Skip to content

Commit

Permalink
Merge pull request #384 from qoretechnologies/feature/custom-intents
Browse files Browse the repository at this point in the history
Added black and white intents, users can now define up to 5 custom intents.
  • Loading branch information
Foxhoundn authored May 29, 2024
2 parents 63e1508 + 8019746 commit 6100c4f
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@qoretechnologies/reqore",
"version": "0.45.0",
"version": "0.46.0",
"description": "ReQore is a highly theme-able and modular UI library for React",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
27 changes: 25 additions & 2 deletions src/constants/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,15 @@ export interface IReqoreIntents {
warning?: TReqoreHexColor;
danger?: TReqoreHexColor;
muted?: TReqoreHexColor;
}
black?: TReqoreHexColor;
white?: TReqoreHexColor;

export type TReqoreIntent = 'info' | 'success' | 'pending' | 'warning' | 'danger' | 'muted';
custom1?: TReqoreHexColor;
custom2?: TReqoreHexColor;
custom3?: TReqoreHexColor;
custom4?: TReqoreHexColor;
custom5?: TReqoreHexColor;
}

export const DEFAULT_INTENTS: IReqoreIntents = {
info: Colors.BLUE,
Expand All @@ -101,8 +107,18 @@ export const DEFAULT_INTENTS: IReqoreIntents = {
warning: Colors.ORANGE,
danger: Colors.RED,
muted: Colors.GRAY,
black: Colors.DARK,
white: Colors.LIGHT,

custom1: Colors.GRAY,
custom2: Colors.GRAY,
custom3: Colors.GRAY,
custom4: Colors.GRAY,
custom5: Colors.GRAY,
};

export type TReqoreIntent = keyof IReqoreIntents;

export const DEFAULT_THEME: IReqoreTheme = {
main: Colors.DARK_THEME,
text: {
Expand All @@ -119,4 +135,11 @@ export const ReqoreIntents: { [key: string]: TReqoreIntent } = {
WARNING: 'warning',
DANGER: 'danger',
MUTED: 'muted',
BLACK: 'black',
WHITE: 'white',
CUSTOM1: 'custom1',
CUSTOM2: 'custom2',
CUSTOM3: 'custom3',
CUSTOM4: 'custom4',
CUSTOM5: 'custom5',
};
29 changes: 29 additions & 0 deletions src/stories/Button/Button.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,35 @@ export const Muted: Story = {
},
};

export const Black: Story = {
render: Template,

args: {
intent: 'black',
},
};

export const White: Story = {
render: Template,

args: {
intent: 'white',
},
};

export const CustomIntent: Story = {
render: Template,

args: {
otherThemeOptions: {
intents: {
custom3: '#5a025a',
},
},
intent: 'custom3',
},
};

export const Effect: Story = {
render: Template,

Expand Down

0 comments on commit 6100c4f

Please sign in to comment.