@dynamic-mockups/design-system 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +396 -0
- package/dist/.storybook/ColorTokenSelect.d.ts +14 -0
- package/dist/.storybook/colorTokenOptions.d.ts +28 -0
- package/dist/.storybook/iconOptions.d.ts +54 -0
- package/dist/design-system.css +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +87 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +11635 -0
- package/dist/index.mjs.map +1 -0
- package/dist/src/components/atoms/Accordion/Accordion.d.ts +52 -0
- package/dist/src/components/atoms/Accordion/Accordion.stories.d.ts +109 -0
- package/dist/src/components/atoms/Accordion/index.d.ts +2 -0
- package/dist/src/components/atoms/AlertDialog/AlertDialog.d.ts +66 -0
- package/dist/src/components/atoms/AlertDialog/AlertDialog.stories.d.ts +144 -0
- package/dist/src/components/atoms/AlertDialog/index.d.ts +2 -0
- package/dist/src/components/atoms/Avatar/Avatar.d.ts +54 -0
- package/dist/src/components/atoms/Avatar/Avatar.stories.d.ts +119 -0
- package/dist/src/components/atoms/Avatar/index.d.ts +2 -0
- package/dist/src/components/atoms/Badge/Badge.d.ts +58 -0
- package/dist/src/components/atoms/Badge/Badge.stories.d.ts +706 -0
- package/dist/src/components/atoms/Badge/index.d.ts +2 -0
- package/dist/src/components/atoms/Button/Button.d.ts +63 -0
- package/dist/src/components/atoms/Button/Button.stories.d.ts +763 -0
- package/dist/src/components/atoms/Button/index.d.ts +2 -0
- package/dist/src/components/atoms/Card/Card.d.ts +44 -0
- package/dist/src/components/atoms/Card/Card.stories.d.ts +103 -0
- package/dist/src/components/atoms/Card/index.d.ts +2 -0
- package/dist/src/components/atoms/Checkbox/Checkbox.d.ts +52 -0
- package/dist/src/components/atoms/Checkbox/Checkbox.stories.d.ts +168 -0
- package/dist/src/components/atoms/Checkbox/index.d.ts +2 -0
- package/dist/src/components/atoms/Dialog/Dialog.d.ts +53 -0
- package/dist/src/components/atoms/Dialog/Dialog.stories.d.ts +122 -0
- package/dist/src/components/atoms/Dialog/index.d.ts +2 -0
- package/dist/src/components/atoms/DropdownMenu/DropdownMenu.d.ts +61 -0
- package/dist/src/components/atoms/DropdownMenu/DropdownMenu.stories.d.ts +109 -0
- package/dist/src/components/atoms/DropdownMenu/index.d.ts +2 -0
- package/dist/src/components/atoms/HoverCard/HoverCard.d.ts +38 -0
- package/dist/src/components/atoms/HoverCard/HoverCard.stories.d.ts +86 -0
- package/dist/src/components/atoms/HoverCard/index.d.ts +2 -0
- package/dist/src/components/atoms/Label/Label.d.ts +19 -0
- package/dist/src/components/atoms/Label/Label.stories.d.ts +100 -0
- package/dist/src/components/atoms/Label/index.d.ts +2 -0
- package/dist/src/components/atoms/Popover/Popover.d.ts +44 -0
- package/dist/src/components/atoms/Popover/Popover.stories.d.ts +94 -0
- package/dist/src/components/atoms/Popover/index.d.ts +2 -0
- package/dist/src/components/atoms/Progress/Progress.d.ts +45 -0
- package/dist/src/components/atoms/Progress/Progress.stories.d.ts +108 -0
- package/dist/src/components/atoms/Progress/index.d.ts +2 -0
- package/dist/src/components/atoms/ProgressBar/ProgressBar.d.ts +66 -0
- package/dist/src/components/atoms/ProgressBar/ProgressBar.stories.d.ts +439 -0
- package/dist/src/components/atoms/ProgressBar/index.d.ts +2 -0
- package/dist/src/components/atoms/RadioGroup/RadioGroup.d.ts +46 -0
- package/dist/src/components/atoms/RadioGroup/RadioGroup.stories.d.ts +104 -0
- package/dist/src/components/atoms/RadioGroup/index.d.ts +2 -0
- package/dist/src/components/atoms/ScrollArea/ScrollArea.d.ts +36 -0
- package/dist/src/components/atoms/ScrollArea/ScrollArea.stories.d.ts +85 -0
- package/dist/src/components/atoms/ScrollArea/index.d.ts +2 -0
- package/dist/src/components/atoms/Select/Select.d.ts +55 -0
- package/dist/src/components/atoms/Select/Select.stories.d.ts +101 -0
- package/dist/src/components/atoms/Select/index.d.ts +2 -0
- package/dist/src/components/atoms/Separator/Separator.d.ts +17 -0
- package/dist/src/components/atoms/Separator/Separator.stories.d.ts +79 -0
- package/dist/src/components/atoms/Separator/index.d.ts +2 -0
- package/dist/src/components/atoms/Slider/Slider.d.ts +55 -0
- package/dist/src/components/atoms/Slider/Slider.stories.d.ts +115 -0
- package/dist/src/components/atoms/Slider/index.d.ts +2 -0
- package/dist/src/components/atoms/Stepper/Stepper.d.ts +100 -0
- package/dist/src/components/atoms/Stepper/Stepper.stories.d.ts +496 -0
- package/dist/src/components/atoms/Stepper/index.d.ts +2 -0
- package/dist/src/components/atoms/Switch/Switch.d.ts +49 -0
- package/dist/src/components/atoms/Switch/Switch.stories.d.ts +165 -0
- package/dist/src/components/atoms/Switch/index.d.ts +2 -0
- package/dist/src/components/atoms/Tabs/Tabs.d.ts +35 -0
- package/dist/src/components/atoms/Tabs/Tabs.stories.d.ts +83 -0
- package/dist/src/components/atoms/Tabs/index.d.ts +2 -0
- package/dist/src/components/atoms/Toast/Toast.d.ts +59 -0
- package/dist/src/components/atoms/Toast/Toast.stories.d.ts +118 -0
- package/dist/src/components/atoms/Toast/index.d.ts +2 -0
- package/dist/src/components/atoms/Toggle/Toggle.d.ts +20 -0
- package/dist/src/components/atoms/Toggle/Toggle.stories.d.ts +118 -0
- package/dist/src/components/atoms/Toggle/index.d.ts +2 -0
- package/dist/src/components/atoms/Tooltip/Tooltip.d.ts +32 -0
- package/dist/src/components/atoms/Tooltip/Tooltip.stories.d.ts +87 -0
- package/dist/src/components/atoms/Tooltip/index.d.ts +2 -0
- package/dist/src/components/atoms/index.d.ts +29 -0
- package/dist/src/components/index.d.ts +9 -0
- package/dist/src/components/molecules/CheckboxChip/CheckboxChip.d.ts +65 -0
- package/dist/src/components/molecules/CheckboxChip/CheckboxChip.stories.d.ts +90 -0
- package/dist/src/components/molecules/CheckboxChip/CheckboxChipGroup.d.ts +63 -0
- package/dist/src/components/molecules/RadioSelector/RadioSelector.d.ts +72 -0
- package/dist/src/components/molecules/RadioSelector/RadioSelector.stories.d.ts +118 -0
- package/dist/src/components/molecules/index.d.ts +10 -0
- package/dist/src/components/organisms/CTABox/CTABox.d.ts +69 -0
- package/dist/src/components/organisms/CTABox/CTABox.stories.d.ts +117 -0
- package/dist/src/components/organisms/OnboardingInfoBox/OnboardingInfoBox.d.ts +65 -0
- package/dist/src/components/organisms/OnboardingInfoBox/OnboardingInfoBox.stories.d.ts +93 -0
- package/dist/src/components/organisms/index.d.ts +8 -0
- package/dist/src/components/pages/index.d.ts +5 -0
- package/dist/src/components/templates/OnboardingTemplate/OnboardingTemplate.d.ts +185 -0
- package/dist/src/components/templates/OnboardingTemplate/OnboardingTemplate.stories.d.ts +26 -0
- package/dist/src/components/templates/index.d.ts +6 -0
- package/dist/src/index.d.ts +21 -0
- package/dist/src/tests/storybook/ColorTokenSelect.test.d.ts +4 -0
- package/dist/src/theme/ThemeProvider.d.ts +36 -0
- package/dist/src/theme/index.d.ts +2 -0
- package/dist/src/theme/theme.d.ts +18 -0
- package/dist/src/tokens/colorTokens.d.ts +58 -0
- package/dist/src/tokens/colorTokens.test.d.ts +4 -0
- package/dist/src/tokens/colors.d.ts +168 -0
- package/dist/src/tokens/index.d.ts +270 -0
- package/dist/src/tokens/radii.d.ts +17 -0
- package/dist/src/tokens/shadows.d.ts +16 -0
- package/dist/src/tokens/spacing.d.ts +38 -0
- package/dist/src/tokens/typography.d.ts +57 -0
- package/package.json +104 -0
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Accordion Component
|
|
3
|
+
* An accordion component that extends Radix UI Accordion
|
|
4
|
+
*/
|
|
5
|
+
import React from "react";
|
|
6
|
+
import type { AccordionSingleProps, AccordionMultipleProps } from "@radix-ui/react-accordion";
|
|
7
|
+
import { type ColorToken } from "../../../tokens";
|
|
8
|
+
import "./Accordion.scss";
|
|
9
|
+
export type { ColorToken } from "../../../tokens";
|
|
10
|
+
export type AccordionType = "single" | "multiple";
|
|
11
|
+
export interface AccordionItemData {
|
|
12
|
+
value: string;
|
|
13
|
+
trigger: React.ReactNode;
|
|
14
|
+
content: React.ReactNode;
|
|
15
|
+
}
|
|
16
|
+
export interface BaseAccordionProps {
|
|
17
|
+
/**
|
|
18
|
+
* Accordion type - single allows one item open, multiple allows many
|
|
19
|
+
* @default 'single'
|
|
20
|
+
*/
|
|
21
|
+
type?: AccordionType;
|
|
22
|
+
/**
|
|
23
|
+
* Array of accordion items
|
|
24
|
+
*/
|
|
25
|
+
items: AccordionItemData[];
|
|
26
|
+
/**
|
|
27
|
+
* Default open value(s)
|
|
28
|
+
*/
|
|
29
|
+
defaultValue?: string | string[];
|
|
30
|
+
/**
|
|
31
|
+
* Color token for trigger text
|
|
32
|
+
*/
|
|
33
|
+
triggerColorToken?: ColorToken;
|
|
34
|
+
/**
|
|
35
|
+
* Color token for content text
|
|
36
|
+
*/
|
|
37
|
+
contentColorToken?: ColorToken;
|
|
38
|
+
/**
|
|
39
|
+
* Color token for border
|
|
40
|
+
*/
|
|
41
|
+
borderColorToken?: ColorToken;
|
|
42
|
+
/**
|
|
43
|
+
* Color token for background
|
|
44
|
+
*/
|
|
45
|
+
backgroundColorToken?: ColorToken;
|
|
46
|
+
/**
|
|
47
|
+
* Custom className
|
|
48
|
+
*/
|
|
49
|
+
className?: string;
|
|
50
|
+
}
|
|
51
|
+
export type AccordionProps = BaseAccordionProps & (Omit<AccordionSingleProps, "type" | "children"> | Omit<AccordionMultipleProps, "type" | "children">);
|
|
52
|
+
export declare const Accordion: React.ForwardRefExoticComponent<AccordionProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { StoryObj } from "@storybook/react-vite";
|
|
3
|
+
import type { ColorToken } from "./Accordion";
|
|
4
|
+
declare const meta: {
|
|
5
|
+
title: string;
|
|
6
|
+
component: React.ForwardRefExoticComponent<import("./Accordion").AccordionProps & React.RefAttributes<HTMLDivElement>>;
|
|
7
|
+
parameters: {
|
|
8
|
+
layout: string;
|
|
9
|
+
};
|
|
10
|
+
tags: string[];
|
|
11
|
+
argTypes: {
|
|
12
|
+
type: {
|
|
13
|
+
control: "select";
|
|
14
|
+
options: string[];
|
|
15
|
+
description: string;
|
|
16
|
+
table: {
|
|
17
|
+
category: string;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
items: {
|
|
21
|
+
control: "object";
|
|
22
|
+
description: string;
|
|
23
|
+
table: {
|
|
24
|
+
category: string;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
defaultValue: {
|
|
28
|
+
control: "text";
|
|
29
|
+
description: string;
|
|
30
|
+
table: {
|
|
31
|
+
category: string;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
triggerColorToken: {
|
|
35
|
+
control: "select";
|
|
36
|
+
options: ColorToken[];
|
|
37
|
+
description: string;
|
|
38
|
+
table: {
|
|
39
|
+
category: string;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
contentColorToken: {
|
|
43
|
+
control: "select";
|
|
44
|
+
options: ColorToken[];
|
|
45
|
+
description: string;
|
|
46
|
+
table: {
|
|
47
|
+
category: string;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
borderColorToken: {
|
|
51
|
+
control: "select";
|
|
52
|
+
options: ColorToken[];
|
|
53
|
+
description: string;
|
|
54
|
+
table: {
|
|
55
|
+
category: string;
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
backgroundColorToken: {
|
|
59
|
+
control: "select";
|
|
60
|
+
options: ColorToken[];
|
|
61
|
+
description: string;
|
|
62
|
+
table: {
|
|
63
|
+
category: string;
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
m: {
|
|
67
|
+
table: {
|
|
68
|
+
disable: boolean;
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
mx: {
|
|
72
|
+
table: {
|
|
73
|
+
disable: boolean;
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
my: {
|
|
77
|
+
table: {
|
|
78
|
+
disable: boolean;
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
mt: {
|
|
82
|
+
table: {
|
|
83
|
+
disable: boolean;
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
mr: {
|
|
87
|
+
table: {
|
|
88
|
+
disable: boolean;
|
|
89
|
+
};
|
|
90
|
+
};
|
|
91
|
+
mb: {
|
|
92
|
+
table: {
|
|
93
|
+
disable: boolean;
|
|
94
|
+
};
|
|
95
|
+
};
|
|
96
|
+
ml: {
|
|
97
|
+
table: {
|
|
98
|
+
disable: boolean;
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
};
|
|
102
|
+
};
|
|
103
|
+
export default meta;
|
|
104
|
+
type Story = StoryObj<typeof meta>;
|
|
105
|
+
export declare const Single: Story;
|
|
106
|
+
export declare const Multiple: Story;
|
|
107
|
+
export declare const FAQ: Story;
|
|
108
|
+
export declare const RichContent: Story;
|
|
109
|
+
export declare const InteractiveColorPicker: Story;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AlertDialog Component
|
|
3
|
+
* An alert dialog component that extends Radix UI AlertDialog
|
|
4
|
+
*/
|
|
5
|
+
import React from "react";
|
|
6
|
+
import type { AlertDialogProps as RadixAlertDialogProps } from "@radix-ui/react-alert-dialog";
|
|
7
|
+
import { type ColorToken } from "../../../tokens";
|
|
8
|
+
import "./AlertDialog.scss";
|
|
9
|
+
export type { ColorToken } from "../../../tokens";
|
|
10
|
+
export interface AlertDialogProps extends Omit<RadixAlertDialogProps, "children"> {
|
|
11
|
+
/**
|
|
12
|
+
* Alert dialog trigger element
|
|
13
|
+
*/
|
|
14
|
+
trigger?: React.ReactNode;
|
|
15
|
+
/**
|
|
16
|
+
* Alert dialog title
|
|
17
|
+
*/
|
|
18
|
+
title: string;
|
|
19
|
+
/**
|
|
20
|
+
* Alert dialog description
|
|
21
|
+
*/
|
|
22
|
+
description: string;
|
|
23
|
+
/**
|
|
24
|
+
* Cancel button text
|
|
25
|
+
* @default 'Cancel'
|
|
26
|
+
*/
|
|
27
|
+
cancelText?: string;
|
|
28
|
+
/**
|
|
29
|
+
* Action button text
|
|
30
|
+
* @default 'Confirm'
|
|
31
|
+
*/
|
|
32
|
+
actionText?: string;
|
|
33
|
+
/**
|
|
34
|
+
* Callback when action button is clicked
|
|
35
|
+
*/
|
|
36
|
+
onAction?: () => void;
|
|
37
|
+
/**
|
|
38
|
+
* Callback when cancel button is clicked
|
|
39
|
+
*/
|
|
40
|
+
onCancel?: () => void;
|
|
41
|
+
/**
|
|
42
|
+
* Color token for overlay background
|
|
43
|
+
*/
|
|
44
|
+
overlayColorToken?: ColorToken;
|
|
45
|
+
/**
|
|
46
|
+
* Color token for dialog background
|
|
47
|
+
*/
|
|
48
|
+
backgroundColorToken?: ColorToken;
|
|
49
|
+
/**
|
|
50
|
+
* Color token for title text
|
|
51
|
+
*/
|
|
52
|
+
titleColorToken?: ColorToken;
|
|
53
|
+
/**
|
|
54
|
+
* Color token for description text
|
|
55
|
+
*/
|
|
56
|
+
descriptionColorToken?: ColorToken;
|
|
57
|
+
/**
|
|
58
|
+
* Color token for action button background
|
|
59
|
+
*/
|
|
60
|
+
actionColorToken?: ColorToken;
|
|
61
|
+
/**
|
|
62
|
+
* Custom className
|
|
63
|
+
*/
|
|
64
|
+
className?: string;
|
|
65
|
+
}
|
|
66
|
+
export declare const AlertDialog: React.ForwardRefExoticComponent<AlertDialogProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { StoryObj } from "@storybook/react-vite";
|
|
3
|
+
import type { ColorToken } from "./AlertDialog";
|
|
4
|
+
declare const meta: {
|
|
5
|
+
title: string;
|
|
6
|
+
component: React.ForwardRefExoticComponent<import("./AlertDialog").AlertDialogProps & React.RefAttributes<HTMLDivElement>>;
|
|
7
|
+
parameters: {
|
|
8
|
+
layout: string;
|
|
9
|
+
};
|
|
10
|
+
tags: string[];
|
|
11
|
+
argTypes: {
|
|
12
|
+
trigger: {
|
|
13
|
+
control: false;
|
|
14
|
+
description: string;
|
|
15
|
+
table: {
|
|
16
|
+
category: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
title: {
|
|
20
|
+
control: "text";
|
|
21
|
+
description: string;
|
|
22
|
+
table: {
|
|
23
|
+
category: string;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
description: {
|
|
27
|
+
control: "text";
|
|
28
|
+
description: string;
|
|
29
|
+
table: {
|
|
30
|
+
category: string;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
cancelText: {
|
|
34
|
+
control: "text";
|
|
35
|
+
description: string;
|
|
36
|
+
table: {
|
|
37
|
+
category: string;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
actionText: {
|
|
41
|
+
control: "text";
|
|
42
|
+
description: string;
|
|
43
|
+
table: {
|
|
44
|
+
category: string;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
onAction: {
|
|
48
|
+
control: false;
|
|
49
|
+
description: string;
|
|
50
|
+
table: {
|
|
51
|
+
category: string;
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
onCancel: {
|
|
55
|
+
control: false;
|
|
56
|
+
description: string;
|
|
57
|
+
table: {
|
|
58
|
+
category: string;
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
overlayColorToken: {
|
|
62
|
+
control: "select";
|
|
63
|
+
options: ColorToken[];
|
|
64
|
+
description: string;
|
|
65
|
+
table: {
|
|
66
|
+
category: string;
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
backgroundColorToken: {
|
|
70
|
+
control: "select";
|
|
71
|
+
options: ColorToken[];
|
|
72
|
+
description: string;
|
|
73
|
+
table: {
|
|
74
|
+
category: string;
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
titleColorToken: {
|
|
78
|
+
control: "select";
|
|
79
|
+
options: ColorToken[];
|
|
80
|
+
description: string;
|
|
81
|
+
table: {
|
|
82
|
+
category: string;
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
descriptionColorToken: {
|
|
86
|
+
control: "select";
|
|
87
|
+
options: ColorToken[];
|
|
88
|
+
description: string;
|
|
89
|
+
table: {
|
|
90
|
+
category: string;
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
actionColorToken: {
|
|
94
|
+
control: "select";
|
|
95
|
+
options: ColorToken[];
|
|
96
|
+
description: string;
|
|
97
|
+
table: {
|
|
98
|
+
category: string;
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
m: {
|
|
102
|
+
table: {
|
|
103
|
+
disable: boolean;
|
|
104
|
+
};
|
|
105
|
+
};
|
|
106
|
+
mx: {
|
|
107
|
+
table: {
|
|
108
|
+
disable: boolean;
|
|
109
|
+
};
|
|
110
|
+
};
|
|
111
|
+
my: {
|
|
112
|
+
table: {
|
|
113
|
+
disable: boolean;
|
|
114
|
+
};
|
|
115
|
+
};
|
|
116
|
+
mt: {
|
|
117
|
+
table: {
|
|
118
|
+
disable: boolean;
|
|
119
|
+
};
|
|
120
|
+
};
|
|
121
|
+
mr: {
|
|
122
|
+
table: {
|
|
123
|
+
disable: boolean;
|
|
124
|
+
};
|
|
125
|
+
};
|
|
126
|
+
mb: {
|
|
127
|
+
table: {
|
|
128
|
+
disable: boolean;
|
|
129
|
+
};
|
|
130
|
+
};
|
|
131
|
+
ml: {
|
|
132
|
+
table: {
|
|
133
|
+
disable: boolean;
|
|
134
|
+
};
|
|
135
|
+
};
|
|
136
|
+
};
|
|
137
|
+
};
|
|
138
|
+
export default meta;
|
|
139
|
+
type Story = StoryObj<typeof meta>;
|
|
140
|
+
export declare const Default: Story;
|
|
141
|
+
export declare const CustomText: Story;
|
|
142
|
+
export declare const WithCallback: Story;
|
|
143
|
+
export declare const DangerAction: Story;
|
|
144
|
+
export declare const InteractiveColorPicker: Story;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Avatar Component
|
|
3
|
+
* An avatar component that extends Radix UI Avatar
|
|
4
|
+
*/
|
|
5
|
+
import React from "react";
|
|
6
|
+
import type { AvatarProps as RadixAvatarProps } from "@radix-ui/themes";
|
|
7
|
+
import { type ColorToken } from "../../../tokens";
|
|
8
|
+
import "./Avatar.scss";
|
|
9
|
+
export type { ColorToken } from "../../../tokens";
|
|
10
|
+
export type AvatarSize = "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9";
|
|
11
|
+
export type AvatarVariant = "solid" | "soft";
|
|
12
|
+
export type AvatarRadius = "none" | "small" | "medium" | "large" | "full";
|
|
13
|
+
export interface AvatarProps extends Omit<RadixAvatarProps, "size" | "variant" | "radius" | "fallback" | "m" | "mx" | "my" | "mt" | "mr" | "mb" | "ml"> {
|
|
14
|
+
/**
|
|
15
|
+
* Avatar size
|
|
16
|
+
* @default '3'
|
|
17
|
+
*/
|
|
18
|
+
size?: AvatarSize;
|
|
19
|
+
/**
|
|
20
|
+
* Avatar variant
|
|
21
|
+
* @default 'soft'
|
|
22
|
+
*/
|
|
23
|
+
variant?: AvatarVariant;
|
|
24
|
+
/**
|
|
25
|
+
* Border radius preset
|
|
26
|
+
* @default 'full'
|
|
27
|
+
*/
|
|
28
|
+
radius?: AvatarRadius;
|
|
29
|
+
/**
|
|
30
|
+
* Image source URL
|
|
31
|
+
*/
|
|
32
|
+
src?: string;
|
|
33
|
+
/**
|
|
34
|
+
* Alt text for the image
|
|
35
|
+
*/
|
|
36
|
+
alt?: string;
|
|
37
|
+
/**
|
|
38
|
+
* Fallback text (usually initials)
|
|
39
|
+
*/
|
|
40
|
+
fallback?: string;
|
|
41
|
+
/**
|
|
42
|
+
* Color token for avatar background
|
|
43
|
+
*/
|
|
44
|
+
backgroundColorToken?: ColorToken;
|
|
45
|
+
/**
|
|
46
|
+
* Color token for fallback text
|
|
47
|
+
*/
|
|
48
|
+
textColorToken?: ColorToken;
|
|
49
|
+
/**
|
|
50
|
+
* Custom className
|
|
51
|
+
*/
|
|
52
|
+
className?: string;
|
|
53
|
+
}
|
|
54
|
+
export declare const Avatar: React.ForwardRefExoticComponent<AvatarProps & React.RefAttributes<HTMLSpanElement>>;
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { StoryObj } from "@storybook/react-vite";
|
|
3
|
+
import type { ColorToken } from "./Avatar";
|
|
4
|
+
declare const meta: {
|
|
5
|
+
title: string;
|
|
6
|
+
component: React.ForwardRefExoticComponent<import("./Avatar").AvatarProps & React.RefAttributes<HTMLSpanElement>>;
|
|
7
|
+
parameters: {
|
|
8
|
+
layout: string;
|
|
9
|
+
};
|
|
10
|
+
tags: string[];
|
|
11
|
+
argTypes: {
|
|
12
|
+
size: {
|
|
13
|
+
control: "select";
|
|
14
|
+
options: string[];
|
|
15
|
+
description: string;
|
|
16
|
+
table: {
|
|
17
|
+
category: string;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
variant: {
|
|
21
|
+
control: "select";
|
|
22
|
+
options: string[];
|
|
23
|
+
description: string;
|
|
24
|
+
table: {
|
|
25
|
+
category: string;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
radius: {
|
|
29
|
+
control: "select";
|
|
30
|
+
options: string[];
|
|
31
|
+
description: string;
|
|
32
|
+
table: {
|
|
33
|
+
category: string;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
src: {
|
|
37
|
+
control: "text";
|
|
38
|
+
description: string;
|
|
39
|
+
table: {
|
|
40
|
+
category: string;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
alt: {
|
|
44
|
+
control: "text";
|
|
45
|
+
description: string;
|
|
46
|
+
table: {
|
|
47
|
+
category: string;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
fallback: {
|
|
51
|
+
control: "text";
|
|
52
|
+
description: string;
|
|
53
|
+
table: {
|
|
54
|
+
category: string;
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
backgroundColorToken: {
|
|
58
|
+
control: "select";
|
|
59
|
+
options: ColorToken[];
|
|
60
|
+
description: string;
|
|
61
|
+
table: {
|
|
62
|
+
category: string;
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
textColorToken: {
|
|
66
|
+
control: "select";
|
|
67
|
+
options: ColorToken[];
|
|
68
|
+
description: string;
|
|
69
|
+
table: {
|
|
70
|
+
category: string;
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
m: {
|
|
74
|
+
table: {
|
|
75
|
+
disable: boolean;
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
mx: {
|
|
79
|
+
table: {
|
|
80
|
+
disable: boolean;
|
|
81
|
+
};
|
|
82
|
+
};
|
|
83
|
+
my: {
|
|
84
|
+
table: {
|
|
85
|
+
disable: boolean;
|
|
86
|
+
};
|
|
87
|
+
};
|
|
88
|
+
mt: {
|
|
89
|
+
table: {
|
|
90
|
+
disable: boolean;
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
mr: {
|
|
94
|
+
table: {
|
|
95
|
+
disable: boolean;
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
mb: {
|
|
99
|
+
table: {
|
|
100
|
+
disable: boolean;
|
|
101
|
+
};
|
|
102
|
+
};
|
|
103
|
+
ml: {
|
|
104
|
+
table: {
|
|
105
|
+
disable: boolean;
|
|
106
|
+
};
|
|
107
|
+
};
|
|
108
|
+
};
|
|
109
|
+
};
|
|
110
|
+
export default meta;
|
|
111
|
+
type Story = StoryObj<typeof meta>;
|
|
112
|
+
export declare const WithImage: Story;
|
|
113
|
+
export declare const WithFallback: Story;
|
|
114
|
+
export declare const Sizes: Story;
|
|
115
|
+
export declare const Variants: Story;
|
|
116
|
+
export declare const Radius: Story;
|
|
117
|
+
export declare const WithImages: Story;
|
|
118
|
+
export declare const UserList: Story;
|
|
119
|
+
export declare const InteractiveColorPicker: Story;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Badge Component
|
|
3
|
+
* A flexible badge component that extends Radix UI with icon support
|
|
4
|
+
*/
|
|
5
|
+
import React from "react";
|
|
6
|
+
import type { BadgeProps as RadixBadgeProps } from "@radix-ui/themes";
|
|
7
|
+
import { type ColorToken } from "../../../tokens";
|
|
8
|
+
import "./Badge.scss";
|
|
9
|
+
export type { ColorToken } from "../../../tokens";
|
|
10
|
+
export type BadgeVariant = "solid" | "soft" | "outline" | "surface";
|
|
11
|
+
export type BadgeSize = "1" | "2" | "3";
|
|
12
|
+
export type BadgeColor = "accent" | "neutral" | "error" | "success" | "warning" | "info" | "gray" | "gold" | "bronze" | "brown" | "yellow" | "amber" | "orange" | "tomato" | "red" | "ruby" | "crimson" | "pink" | "plum" | "purple" | "violet" | "iris" | "indigo" | "blue" | "cyan" | "teal" | "jade" | "green" | "grass" | "lime" | "mint" | "sky";
|
|
13
|
+
export interface BadgeProps extends Omit<RadixBadgeProps, "color" | "variant" | "size" | "m" | "mx" | "my" | "mt" | "mr" | "mb" | "ml"> {
|
|
14
|
+
/**
|
|
15
|
+
* Badge variant style
|
|
16
|
+
* @default 'soft'
|
|
17
|
+
*/
|
|
18
|
+
variant?: BadgeVariant;
|
|
19
|
+
/**
|
|
20
|
+
* Badge size
|
|
21
|
+
* @default '1'
|
|
22
|
+
*/
|
|
23
|
+
size?: BadgeSize;
|
|
24
|
+
/**
|
|
25
|
+
* Badge color - supports custom brand colors and Radix UI colors
|
|
26
|
+
* @default 'accent'
|
|
27
|
+
*/
|
|
28
|
+
color?: BadgeColor;
|
|
29
|
+
/**
|
|
30
|
+
* Enable high contrast mode
|
|
31
|
+
* @default false
|
|
32
|
+
*/
|
|
33
|
+
highContrast?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Color token for the badge background
|
|
36
|
+
* @default undefined (uses color prop)
|
|
37
|
+
*/
|
|
38
|
+
backgroundColorToken?: ColorToken;
|
|
39
|
+
/**
|
|
40
|
+
* Color token for the badge text
|
|
41
|
+
* @default undefined (uses variant defaults)
|
|
42
|
+
*/
|
|
43
|
+
textColorToken?: ColorToken;
|
|
44
|
+
/**
|
|
45
|
+
* Color token for the badge border (outline variant)
|
|
46
|
+
* @default undefined (uses variant defaults)
|
|
47
|
+
*/
|
|
48
|
+
borderColorToken?: ColorToken;
|
|
49
|
+
/**
|
|
50
|
+
* Icon to display before the badge text
|
|
51
|
+
*/
|
|
52
|
+
iconStart?: React.ReactNode;
|
|
53
|
+
/**
|
|
54
|
+
* Badge text content
|
|
55
|
+
*/
|
|
56
|
+
children?: React.ReactNode;
|
|
57
|
+
}
|
|
58
|
+
export declare const Badge: React.ForwardRefExoticComponent<BadgeProps & React.RefAttributes<HTMLSpanElement>>;
|