@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,165 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { StoryObj } from "@storybook/react-vite";
|
|
3
|
+
import type { ColorToken } from "./Switch";
|
|
4
|
+
declare const meta: {
|
|
5
|
+
title: string;
|
|
6
|
+
component: React.ForwardRefExoticComponent<import("./Switch").SwitchProps & React.RefAttributes<HTMLButtonElement>>;
|
|
7
|
+
parameters: {
|
|
8
|
+
layout: string;
|
|
9
|
+
};
|
|
10
|
+
tags: string[];
|
|
11
|
+
argTypes: {
|
|
12
|
+
label: {
|
|
13
|
+
control: "text";
|
|
14
|
+
description: string;
|
|
15
|
+
table: {
|
|
16
|
+
category: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
helperText: {
|
|
20
|
+
control: "text";
|
|
21
|
+
description: string;
|
|
22
|
+
table: {
|
|
23
|
+
category: string;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
size: {
|
|
27
|
+
control: "select";
|
|
28
|
+
options: string[];
|
|
29
|
+
description: string;
|
|
30
|
+
table: {
|
|
31
|
+
category: string;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
color: {
|
|
35
|
+
control: "select";
|
|
36
|
+
options: string[];
|
|
37
|
+
description: string;
|
|
38
|
+
table: {
|
|
39
|
+
category: string;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
variant: {
|
|
43
|
+
control: "select";
|
|
44
|
+
options: string[];
|
|
45
|
+
description: string;
|
|
46
|
+
table: {
|
|
47
|
+
category: string;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
radius: {
|
|
51
|
+
control: "select";
|
|
52
|
+
options: string[];
|
|
53
|
+
description: string;
|
|
54
|
+
table: {
|
|
55
|
+
category: string;
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
highContrast: {
|
|
59
|
+
control: "boolean";
|
|
60
|
+
description: string;
|
|
61
|
+
table: {
|
|
62
|
+
category: string;
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
disabled: {
|
|
66
|
+
control: "boolean";
|
|
67
|
+
description: string;
|
|
68
|
+
table: {
|
|
69
|
+
category: string;
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
defaultChecked: {
|
|
73
|
+
control: "boolean";
|
|
74
|
+
description: string;
|
|
75
|
+
table: {
|
|
76
|
+
category: string;
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
checked: {
|
|
80
|
+
control: "boolean";
|
|
81
|
+
description: string;
|
|
82
|
+
table: {
|
|
83
|
+
category: string;
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
labelPosition: {
|
|
87
|
+
control: "select";
|
|
88
|
+
options: string[];
|
|
89
|
+
description: string;
|
|
90
|
+
table: {
|
|
91
|
+
category: string;
|
|
92
|
+
};
|
|
93
|
+
};
|
|
94
|
+
backgroundColorToken: {
|
|
95
|
+
control: "select";
|
|
96
|
+
options: ColorToken[];
|
|
97
|
+
description: string;
|
|
98
|
+
table: {
|
|
99
|
+
category: string;
|
|
100
|
+
};
|
|
101
|
+
};
|
|
102
|
+
checkedColorToken: {
|
|
103
|
+
control: "select";
|
|
104
|
+
options: ColorToken[];
|
|
105
|
+
description: string;
|
|
106
|
+
table: {
|
|
107
|
+
category: string;
|
|
108
|
+
};
|
|
109
|
+
};
|
|
110
|
+
thumbColorToken: {
|
|
111
|
+
control: "select";
|
|
112
|
+
options: ColorToken[];
|
|
113
|
+
description: string;
|
|
114
|
+
table: {
|
|
115
|
+
category: string;
|
|
116
|
+
};
|
|
117
|
+
};
|
|
118
|
+
m: {
|
|
119
|
+
table: {
|
|
120
|
+
disable: boolean;
|
|
121
|
+
};
|
|
122
|
+
};
|
|
123
|
+
mx: {
|
|
124
|
+
table: {
|
|
125
|
+
disable: boolean;
|
|
126
|
+
};
|
|
127
|
+
};
|
|
128
|
+
my: {
|
|
129
|
+
table: {
|
|
130
|
+
disable: boolean;
|
|
131
|
+
};
|
|
132
|
+
};
|
|
133
|
+
mt: {
|
|
134
|
+
table: {
|
|
135
|
+
disable: boolean;
|
|
136
|
+
};
|
|
137
|
+
};
|
|
138
|
+
mr: {
|
|
139
|
+
table: {
|
|
140
|
+
disable: boolean;
|
|
141
|
+
};
|
|
142
|
+
};
|
|
143
|
+
mb: {
|
|
144
|
+
table: {
|
|
145
|
+
disable: boolean;
|
|
146
|
+
};
|
|
147
|
+
};
|
|
148
|
+
ml: {
|
|
149
|
+
table: {
|
|
150
|
+
disable: boolean;
|
|
151
|
+
};
|
|
152
|
+
};
|
|
153
|
+
};
|
|
154
|
+
};
|
|
155
|
+
export default meta;
|
|
156
|
+
type Story = StoryObj<typeof meta>;
|
|
157
|
+
export declare const Default: Story;
|
|
158
|
+
export declare const WithLabel: Story;
|
|
159
|
+
export declare const WithHelperText: Story;
|
|
160
|
+
export declare const LabelLeft: Story;
|
|
161
|
+
export declare const Disabled: Story;
|
|
162
|
+
export declare const DisabledChecked: Story;
|
|
163
|
+
export declare const Sizes: Story;
|
|
164
|
+
export declare const Colors: Story;
|
|
165
|
+
export declare const InteractiveColorPicker: Story;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tabs Component
|
|
3
|
+
* A tabs component that extends Radix UI Tabs
|
|
4
|
+
*/
|
|
5
|
+
import React from "react";
|
|
6
|
+
import { Tabs as RadixTabs } from "@radix-ui/themes";
|
|
7
|
+
import { type ColorToken } from "../../../tokens";
|
|
8
|
+
import "./Tabs.scss";
|
|
9
|
+
export type { ColorToken } from "../../../tokens";
|
|
10
|
+
type TabsRootProps = React.ComponentPropsWithoutRef<typeof RadixTabs.Root>;
|
|
11
|
+
export interface TabItem {
|
|
12
|
+
value: string;
|
|
13
|
+
label: string;
|
|
14
|
+
content: React.ReactNode;
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
}
|
|
17
|
+
export interface TabsProps extends Omit<TabsRootProps, "children"> {
|
|
18
|
+
/**
|
|
19
|
+
* Array of tab items
|
|
20
|
+
*/
|
|
21
|
+
tabs: TabItem[];
|
|
22
|
+
/**
|
|
23
|
+
* Color token for active tab
|
|
24
|
+
*/
|
|
25
|
+
activeColorToken?: ColorToken;
|
|
26
|
+
/**
|
|
27
|
+
* Color token for tab text
|
|
28
|
+
*/
|
|
29
|
+
textColorToken?: ColorToken;
|
|
30
|
+
/**
|
|
31
|
+
* Custom className
|
|
32
|
+
*/
|
|
33
|
+
className?: string;
|
|
34
|
+
}
|
|
35
|
+
export declare const Tabs: React.ForwardRefExoticComponent<TabsProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { StoryObj } from "@storybook/react-vite";
|
|
3
|
+
import type { ColorToken } from "./Tabs";
|
|
4
|
+
declare const meta: {
|
|
5
|
+
title: string;
|
|
6
|
+
component: React.ForwardRefExoticComponent<import("./Tabs").TabsProps & React.RefAttributes<HTMLDivElement>>;
|
|
7
|
+
parameters: {
|
|
8
|
+
layout: string;
|
|
9
|
+
};
|
|
10
|
+
tags: string[];
|
|
11
|
+
argTypes: {
|
|
12
|
+
tabs: {
|
|
13
|
+
control: "object";
|
|
14
|
+
description: string;
|
|
15
|
+
table: {
|
|
16
|
+
category: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
defaultValue: {
|
|
20
|
+
control: "text";
|
|
21
|
+
description: string;
|
|
22
|
+
table: {
|
|
23
|
+
category: string;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
activeColorToken: {
|
|
27
|
+
control: "select";
|
|
28
|
+
options: ColorToken[];
|
|
29
|
+
description: string;
|
|
30
|
+
table: {
|
|
31
|
+
category: string;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
textColorToken: {
|
|
35
|
+
control: "select";
|
|
36
|
+
options: ColorToken[];
|
|
37
|
+
description: string;
|
|
38
|
+
table: {
|
|
39
|
+
category: string;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
m: {
|
|
43
|
+
table: {
|
|
44
|
+
disable: true;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
mx: {
|
|
48
|
+
table: {
|
|
49
|
+
disable: true;
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
my: {
|
|
53
|
+
table: {
|
|
54
|
+
disable: true;
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
mt: {
|
|
58
|
+
table: {
|
|
59
|
+
disable: true;
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
mr: {
|
|
63
|
+
table: {
|
|
64
|
+
disable: true;
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
mb: {
|
|
68
|
+
table: {
|
|
69
|
+
disable: true;
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
ml: {
|
|
73
|
+
table: {
|
|
74
|
+
disable: true;
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
export default meta;
|
|
80
|
+
type Story = StoryObj<typeof meta>;
|
|
81
|
+
export declare const Default: Story;
|
|
82
|
+
export declare const ProductInfo: Story;
|
|
83
|
+
export declare const InteractiveColorPicker: Story;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Toast Component
|
|
3
|
+
* A toast notification component using Radix UI Themes Callout for toast-like notifications
|
|
4
|
+
*/
|
|
5
|
+
import React from "react";
|
|
6
|
+
import { Callout } from "@radix-ui/themes";
|
|
7
|
+
import { type ColorToken } from "../../../tokens";
|
|
8
|
+
import "./Toast.scss";
|
|
9
|
+
export type { ColorToken } from "../../../tokens";
|
|
10
|
+
export type ToastSize = "1" | "2" | "3";
|
|
11
|
+
export type ToastVariant = "soft" | "surface" | "outline";
|
|
12
|
+
export type ToastColor = "blue" | "green" | "red" | "yellow" | "gray";
|
|
13
|
+
type CalloutRootProps = React.ComponentPropsWithoutRef<typeof Callout.Root>;
|
|
14
|
+
export interface ToastProps extends Omit<CalloutRootProps, "size" | "variant" | "color" | "m" | "mx" | "my" | "mt" | "mr" | "mb" | "ml"> {
|
|
15
|
+
/**
|
|
16
|
+
* Toast size
|
|
17
|
+
* @default '2'
|
|
18
|
+
*/
|
|
19
|
+
size?: ToastSize;
|
|
20
|
+
/**
|
|
21
|
+
* Toast variant
|
|
22
|
+
* @default 'soft'
|
|
23
|
+
*/
|
|
24
|
+
variant?: ToastVariant;
|
|
25
|
+
/**
|
|
26
|
+
* Toast color
|
|
27
|
+
* @default 'blue'
|
|
28
|
+
*/
|
|
29
|
+
color?: ToastColor;
|
|
30
|
+
/**
|
|
31
|
+
* Toast title
|
|
32
|
+
*/
|
|
33
|
+
title?: string;
|
|
34
|
+
/**
|
|
35
|
+
* Toast message
|
|
36
|
+
*/
|
|
37
|
+
message?: string;
|
|
38
|
+
/**
|
|
39
|
+
* Icon element
|
|
40
|
+
*/
|
|
41
|
+
icon?: React.ReactNode;
|
|
42
|
+
/**
|
|
43
|
+
* Color token for toast background
|
|
44
|
+
*/
|
|
45
|
+
backgroundColorToken?: ColorToken;
|
|
46
|
+
/**
|
|
47
|
+
* Color token for toast text
|
|
48
|
+
*/
|
|
49
|
+
textColorToken?: ColorToken;
|
|
50
|
+
/**
|
|
51
|
+
* Custom className
|
|
52
|
+
*/
|
|
53
|
+
className?: string;
|
|
54
|
+
/**
|
|
55
|
+
* Content
|
|
56
|
+
*/
|
|
57
|
+
children?: React.ReactNode;
|
|
58
|
+
}
|
|
59
|
+
export declare const Toast: React.ForwardRefExoticComponent<ToastProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { StoryObj } from "@storybook/react-vite";
|
|
3
|
+
import type { ColorToken } from "./Toast";
|
|
4
|
+
declare const meta: {
|
|
5
|
+
title: string;
|
|
6
|
+
component: React.ForwardRefExoticComponent<import("./Toast").ToastProps & React.RefAttributes<HTMLDivElement>>;
|
|
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
|
+
color: {
|
|
29
|
+
control: "select";
|
|
30
|
+
options: string[];
|
|
31
|
+
description: string;
|
|
32
|
+
table: {
|
|
33
|
+
category: string;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
title: {
|
|
37
|
+
control: "text";
|
|
38
|
+
description: string;
|
|
39
|
+
table: {
|
|
40
|
+
category: string;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
message: {
|
|
44
|
+
control: "text";
|
|
45
|
+
description: string;
|
|
46
|
+
table: {
|
|
47
|
+
category: string;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
icon: {
|
|
51
|
+
control: false;
|
|
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 Success: Story;
|
|
113
|
+
export declare const Error: Story;
|
|
114
|
+
export declare const Warning: Story;
|
|
115
|
+
export declare const Info: Story;
|
|
116
|
+
export declare const Sizes: Story;
|
|
117
|
+
export declare const Variants: Story;
|
|
118
|
+
export declare const InteractiveColorPicker: Story;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Toggle Component
|
|
3
|
+
* A toggle button component that extends Radix UI Switch as a toggle
|
|
4
|
+
*/
|
|
5
|
+
import React from "react";
|
|
6
|
+
import type { SwitchProps as RadixSwitchProps } from "@radix-ui/themes";
|
|
7
|
+
import { type ColorToken } from "../../../tokens";
|
|
8
|
+
import "./Toggle.scss";
|
|
9
|
+
export type { ColorToken } from "../../../tokens";
|
|
10
|
+
export type ToggleSize = "1" | "2" | "3";
|
|
11
|
+
export type ToggleColor = "primary" | "secondary" | "accent" | "success" | "error" | "warning";
|
|
12
|
+
export interface ToggleProps extends Omit<RadixSwitchProps, "size" | "color" | "m" | "mx" | "my" | "mt" | "mr" | "mb" | "ml"> {
|
|
13
|
+
size?: ToggleSize;
|
|
14
|
+
color?: ToggleColor;
|
|
15
|
+
label?: string;
|
|
16
|
+
backgroundColorToken?: ColorToken;
|
|
17
|
+
activeColorToken?: ColorToken;
|
|
18
|
+
textColorToken?: ColorToken;
|
|
19
|
+
}
|
|
20
|
+
export declare const Toggle: React.ForwardRefExoticComponent<ToggleProps & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { StoryObj } from "@storybook/react-vite";
|
|
3
|
+
import type { ColorToken } from "./Toggle";
|
|
4
|
+
declare const meta: {
|
|
5
|
+
title: string;
|
|
6
|
+
component: React.ForwardRefExoticComponent<import("./Toggle").ToggleProps & React.RefAttributes<HTMLButtonElement>>;
|
|
7
|
+
parameters: {
|
|
8
|
+
layout: string;
|
|
9
|
+
};
|
|
10
|
+
tags: string[];
|
|
11
|
+
argTypes: {
|
|
12
|
+
label: {
|
|
13
|
+
control: "text";
|
|
14
|
+
description: string;
|
|
15
|
+
table: {
|
|
16
|
+
category: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
size: {
|
|
20
|
+
control: "select";
|
|
21
|
+
options: string[];
|
|
22
|
+
description: string;
|
|
23
|
+
table: {
|
|
24
|
+
category: string;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
color: {
|
|
28
|
+
control: "select";
|
|
29
|
+
options: string[];
|
|
30
|
+
description: string;
|
|
31
|
+
table: {
|
|
32
|
+
category: string;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
disabled: {
|
|
36
|
+
control: "boolean";
|
|
37
|
+
description: string;
|
|
38
|
+
table: {
|
|
39
|
+
category: string;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
defaultChecked: {
|
|
43
|
+
control: "boolean";
|
|
44
|
+
description: string;
|
|
45
|
+
table: {
|
|
46
|
+
category: string;
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
backgroundColorToken: {
|
|
50
|
+
control: "select";
|
|
51
|
+
options: ColorToken[];
|
|
52
|
+
description: string;
|
|
53
|
+
table: {
|
|
54
|
+
category: string;
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
activeColorToken: {
|
|
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 Default: Story;
|
|
113
|
+
export declare const WithLabel: Story;
|
|
114
|
+
export declare const Checked: Story;
|
|
115
|
+
export declare const Disabled: Story;
|
|
116
|
+
export declare const Sizes: Story;
|
|
117
|
+
export declare const Colors: Story;
|
|
118
|
+
export declare const InteractiveColorPicker: Story;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tooltip Component
|
|
3
|
+
* A tooltip component that extends Radix UI Tooltip
|
|
4
|
+
*/
|
|
5
|
+
import React from "react";
|
|
6
|
+
import type { TooltipProps as RadixTooltipProps } from "@radix-ui/themes";
|
|
7
|
+
import { type ColorToken } from "../../../tokens";
|
|
8
|
+
import "./Tooltip.scss";
|
|
9
|
+
export type { ColorToken } from "../../../tokens";
|
|
10
|
+
export interface TooltipProps extends Omit<RadixTooltipProps, "children" | "content"> {
|
|
11
|
+
/**
|
|
12
|
+
* Trigger element
|
|
13
|
+
*/
|
|
14
|
+
children: React.ReactNode;
|
|
15
|
+
/**
|
|
16
|
+
* Tooltip content
|
|
17
|
+
*/
|
|
18
|
+
content: React.ReactNode;
|
|
19
|
+
/**
|
|
20
|
+
* Color token for tooltip background
|
|
21
|
+
*/
|
|
22
|
+
backgroundColorToken?: ColorToken;
|
|
23
|
+
/**
|
|
24
|
+
* Color token for tooltip text
|
|
25
|
+
*/
|
|
26
|
+
textColorToken?: ColorToken;
|
|
27
|
+
/**
|
|
28
|
+
* Custom className
|
|
29
|
+
*/
|
|
30
|
+
className?: string;
|
|
31
|
+
}
|
|
32
|
+
export declare const Tooltip: React.ForwardRefExoticComponent<TooltipProps & React.RefAttributes<HTMLDivElement>>;
|