@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,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ScrollArea Component
|
|
3
|
+
* A scroll area component that extends Radix UI ScrollArea
|
|
4
|
+
*/
|
|
5
|
+
import React from "react";
|
|
6
|
+
import type { ScrollAreaProps as RadixScrollAreaProps } from "@radix-ui/themes";
|
|
7
|
+
import { type ColorToken } from "../../../tokens";
|
|
8
|
+
import "./ScrollArea.scss";
|
|
9
|
+
export type { ColorToken } from "../../../tokens";
|
|
10
|
+
export type ScrollAreaSize = "1" | "2" | "3";
|
|
11
|
+
export type ScrollAreaScrollbars = "vertical" | "horizontal" | "both";
|
|
12
|
+
export interface ScrollAreaProps extends Omit<RadixScrollAreaProps, "size" | "scrollbars" | "m" | "mx" | "my" | "mt" | "mr" | "mb" | "ml"> {
|
|
13
|
+
/**
|
|
14
|
+
* Scroll area size
|
|
15
|
+
* @default '1'
|
|
16
|
+
*/
|
|
17
|
+
size?: ScrollAreaSize;
|
|
18
|
+
/**
|
|
19
|
+
* Which scrollbars to show
|
|
20
|
+
* @default 'vertical'
|
|
21
|
+
*/
|
|
22
|
+
scrollbars?: ScrollAreaScrollbars;
|
|
23
|
+
/**
|
|
24
|
+
* Color token for scrollbar
|
|
25
|
+
*/
|
|
26
|
+
scrollbarColorToken?: ColorToken;
|
|
27
|
+
/**
|
|
28
|
+
* Custom className
|
|
29
|
+
*/
|
|
30
|
+
className?: string;
|
|
31
|
+
/**
|
|
32
|
+
* Content
|
|
33
|
+
*/
|
|
34
|
+
children?: React.ReactNode;
|
|
35
|
+
}
|
|
36
|
+
export declare const ScrollArea: React.ForwardRefExoticComponent<ScrollAreaProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { StoryObj } from "@storybook/react-vite";
|
|
3
|
+
import type { ColorToken } from "./ScrollArea";
|
|
4
|
+
declare const meta: {
|
|
5
|
+
title: string;
|
|
6
|
+
component: React.ForwardRefExoticComponent<import("./ScrollArea").ScrollAreaProps & 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
|
+
scrollbars: {
|
|
21
|
+
control: "select";
|
|
22
|
+
options: string[];
|
|
23
|
+
description: string;
|
|
24
|
+
table: {
|
|
25
|
+
category: string;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
scrollbarColorToken: {
|
|
29
|
+
control: "select";
|
|
30
|
+
options: ColorToken[];
|
|
31
|
+
description: string;
|
|
32
|
+
table: {
|
|
33
|
+
category: string;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
children: {
|
|
37
|
+
control: false;
|
|
38
|
+
description: string;
|
|
39
|
+
table: {
|
|
40
|
+
category: string;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
m: {
|
|
44
|
+
table: {
|
|
45
|
+
disable: boolean;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
mx: {
|
|
49
|
+
table: {
|
|
50
|
+
disable: boolean;
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
my: {
|
|
54
|
+
table: {
|
|
55
|
+
disable: boolean;
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
mt: {
|
|
59
|
+
table: {
|
|
60
|
+
disable: boolean;
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
mr: {
|
|
64
|
+
table: {
|
|
65
|
+
disable: boolean;
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
mb: {
|
|
69
|
+
table: {
|
|
70
|
+
disable: boolean;
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
ml: {
|
|
74
|
+
table: {
|
|
75
|
+
disable: boolean;
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
export default meta;
|
|
81
|
+
type Story = StoryObj<typeof meta>;
|
|
82
|
+
export declare const Vertical: Story;
|
|
83
|
+
export declare const Horizontal: Story;
|
|
84
|
+
export declare const Both: Story;
|
|
85
|
+
export declare const InteractiveColorPicker: Story;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Select Component
|
|
3
|
+
* A select component that extends Radix UI Select
|
|
4
|
+
*/
|
|
5
|
+
import React from "react";
|
|
6
|
+
import { Select as RadixSelect } from "@radix-ui/themes";
|
|
7
|
+
import { type ColorToken } from "../../../tokens";
|
|
8
|
+
import "./Select.scss";
|
|
9
|
+
export type { ColorToken } from "../../../tokens";
|
|
10
|
+
export type SelectSize = "1" | "2" | "3";
|
|
11
|
+
export type SelectVariant = "surface" | "classic" | "soft" | "ghost";
|
|
12
|
+
type SelectRootProps = React.ComponentPropsWithoutRef<typeof RadixSelect.Root>;
|
|
13
|
+
type SelectContentProps = React.ComponentPropsWithoutRef<typeof RadixSelect.Content>;
|
|
14
|
+
export interface SelectOption {
|
|
15
|
+
value: string;
|
|
16
|
+
label: string;
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
}
|
|
19
|
+
export interface SelectProps extends Omit<SelectRootProps, "children"> {
|
|
20
|
+
/**
|
|
21
|
+
* Select size
|
|
22
|
+
* @default '2'
|
|
23
|
+
*/
|
|
24
|
+
size?: SelectSize;
|
|
25
|
+
/**
|
|
26
|
+
* Select variant
|
|
27
|
+
* @default 'surface'
|
|
28
|
+
*/
|
|
29
|
+
variant?: SelectVariant;
|
|
30
|
+
/**
|
|
31
|
+
* Placeholder text
|
|
32
|
+
*/
|
|
33
|
+
placeholder?: string;
|
|
34
|
+
/**
|
|
35
|
+
* Array of select options
|
|
36
|
+
*/
|
|
37
|
+
options: SelectOption[];
|
|
38
|
+
/**
|
|
39
|
+
* Color token for select background
|
|
40
|
+
*/
|
|
41
|
+
backgroundColorToken?: ColorToken;
|
|
42
|
+
/**
|
|
43
|
+
* Color token for select text
|
|
44
|
+
*/
|
|
45
|
+
textColorToken?: ColorToken;
|
|
46
|
+
/**
|
|
47
|
+
* Content props
|
|
48
|
+
*/
|
|
49
|
+
contentProps?: Partial<SelectContentProps>;
|
|
50
|
+
/**
|
|
51
|
+
* Custom className
|
|
52
|
+
*/
|
|
53
|
+
className?: string;
|
|
54
|
+
}
|
|
55
|
+
export declare const Select: React.ForwardRefExoticComponent<SelectProps & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { StoryObj } from "@storybook/react-vite";
|
|
3
|
+
import type { ColorToken } from "./Select";
|
|
4
|
+
declare const meta: {
|
|
5
|
+
title: string;
|
|
6
|
+
component: React.ForwardRefExoticComponent<import("./Select").SelectProps & React.RefAttributes<HTMLButtonElement>>;
|
|
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
|
+
placeholder: {
|
|
29
|
+
control: "text";
|
|
30
|
+
description: string;
|
|
31
|
+
table: {
|
|
32
|
+
category: string;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
options: {
|
|
36
|
+
control: "object";
|
|
37
|
+
description: string;
|
|
38
|
+
table: {
|
|
39
|
+
category: string;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
backgroundColorToken: {
|
|
43
|
+
control: "select";
|
|
44
|
+
options: ColorToken[];
|
|
45
|
+
description: string;
|
|
46
|
+
table: {
|
|
47
|
+
category: string;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
textColorToken: {
|
|
51
|
+
control: "select";
|
|
52
|
+
options: ColorToken[];
|
|
53
|
+
description: string;
|
|
54
|
+
table: {
|
|
55
|
+
category: string;
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
m: {
|
|
59
|
+
table: {
|
|
60
|
+
disable: boolean;
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
mx: {
|
|
64
|
+
table: {
|
|
65
|
+
disable: boolean;
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
my: {
|
|
69
|
+
table: {
|
|
70
|
+
disable: boolean;
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
mt: {
|
|
74
|
+
table: {
|
|
75
|
+
disable: boolean;
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
mr: {
|
|
79
|
+
table: {
|
|
80
|
+
disable: boolean;
|
|
81
|
+
};
|
|
82
|
+
};
|
|
83
|
+
mb: {
|
|
84
|
+
table: {
|
|
85
|
+
disable: boolean;
|
|
86
|
+
};
|
|
87
|
+
};
|
|
88
|
+
ml: {
|
|
89
|
+
table: {
|
|
90
|
+
disable: boolean;
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
};
|
|
94
|
+
};
|
|
95
|
+
export default meta;
|
|
96
|
+
type Story = StoryObj<typeof meta>;
|
|
97
|
+
export declare const Default: Story;
|
|
98
|
+
export declare const Sizes: Story;
|
|
99
|
+
export declare const Variants: Story;
|
|
100
|
+
export declare const WithDisabled: Story;
|
|
101
|
+
export declare const InteractiveColorPicker: Story;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Separator Component
|
|
3
|
+
* A separator component that extends Radix UI Separator
|
|
4
|
+
*/
|
|
5
|
+
import React from "react";
|
|
6
|
+
import type { SeparatorProps as RadixSeparatorProps } from "@radix-ui/themes";
|
|
7
|
+
import { type ColorToken } from "../../../tokens";
|
|
8
|
+
import "./Separator.scss";
|
|
9
|
+
export type { ColorToken } from "../../../tokens";
|
|
10
|
+
export type SeparatorSize = "1" | "2" | "3" | "4";
|
|
11
|
+
export type SeparatorOrientation = "horizontal" | "vertical";
|
|
12
|
+
export interface SeparatorProps extends Omit<RadixSeparatorProps, "size" | "m" | "mx" | "my" | "mt" | "mr" | "mb" | "ml"> {
|
|
13
|
+
size?: SeparatorSize;
|
|
14
|
+
orientation?: SeparatorOrientation;
|
|
15
|
+
colorToken?: ColorToken;
|
|
16
|
+
}
|
|
17
|
+
export declare const Separator: React.ForwardRefExoticComponent<SeparatorProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { StoryObj } from "@storybook/react-vite";
|
|
3
|
+
import type { ColorToken } from "./Separator";
|
|
4
|
+
declare const meta: {
|
|
5
|
+
title: string;
|
|
6
|
+
component: React.ForwardRefExoticComponent<import("./Separator").SeparatorProps & 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
|
+
orientation: {
|
|
21
|
+
control: "select";
|
|
22
|
+
options: string[];
|
|
23
|
+
description: string;
|
|
24
|
+
table: {
|
|
25
|
+
category: string;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
colorToken: {
|
|
29
|
+
control: "select";
|
|
30
|
+
options: ColorToken[];
|
|
31
|
+
description: string;
|
|
32
|
+
table: {
|
|
33
|
+
category: string;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
m: {
|
|
37
|
+
table: {
|
|
38
|
+
disable: boolean;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
mx: {
|
|
42
|
+
table: {
|
|
43
|
+
disable: boolean;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
my: {
|
|
47
|
+
table: {
|
|
48
|
+
disable: boolean;
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
mt: {
|
|
52
|
+
table: {
|
|
53
|
+
disable: boolean;
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
mr: {
|
|
57
|
+
table: {
|
|
58
|
+
disable: boolean;
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
mb: {
|
|
62
|
+
table: {
|
|
63
|
+
disable: boolean;
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
ml: {
|
|
67
|
+
table: {
|
|
68
|
+
disable: boolean;
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
export default meta;
|
|
74
|
+
type Story = StoryObj<typeof meta>;
|
|
75
|
+
export declare const Horizontal: Story;
|
|
76
|
+
export declare const Vertical: Story;
|
|
77
|
+
export declare const Sizes: Story;
|
|
78
|
+
export declare const WithContent: Story;
|
|
79
|
+
export declare const InteractiveColorPicker: Story;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Slider Component
|
|
3
|
+
* A slider component that extends Radix UI Slider
|
|
4
|
+
*/
|
|
5
|
+
import React from "react";
|
|
6
|
+
import type { SliderProps as RadixSliderProps } from "@radix-ui/themes";
|
|
7
|
+
import { type ColorToken } from "../../../tokens";
|
|
8
|
+
import "./Slider.scss";
|
|
9
|
+
export type { ColorToken } from "../../../tokens";
|
|
10
|
+
export type SliderSize = "1" | "2" | "3";
|
|
11
|
+
export type SliderVariant = "classic" | "surface" | "soft";
|
|
12
|
+
export interface SliderProps extends Omit<RadixSliderProps, "size" | "variant" | "m" | "mx" | "my" | "mt" | "mr" | "mb" | "ml"> {
|
|
13
|
+
/**
|
|
14
|
+
* Slider size
|
|
15
|
+
* @default '2'
|
|
16
|
+
*/
|
|
17
|
+
size?: SliderSize;
|
|
18
|
+
/**
|
|
19
|
+
* Slider variant
|
|
20
|
+
* @default 'classic'
|
|
21
|
+
*/
|
|
22
|
+
variant?: SliderVariant;
|
|
23
|
+
/**
|
|
24
|
+
* Default value(s)
|
|
25
|
+
*/
|
|
26
|
+
defaultValue?: number[];
|
|
27
|
+
/**
|
|
28
|
+
* Min value
|
|
29
|
+
* @default 0
|
|
30
|
+
*/
|
|
31
|
+
min?: number;
|
|
32
|
+
/**
|
|
33
|
+
* Max value
|
|
34
|
+
* @default 100
|
|
35
|
+
*/
|
|
36
|
+
max?: number;
|
|
37
|
+
/**
|
|
38
|
+
* Step increment
|
|
39
|
+
* @default 1
|
|
40
|
+
*/
|
|
41
|
+
step?: number;
|
|
42
|
+
/**
|
|
43
|
+
* Color token for slider track
|
|
44
|
+
*/
|
|
45
|
+
trackColorToken?: ColorToken;
|
|
46
|
+
/**
|
|
47
|
+
* Color token for slider thumb
|
|
48
|
+
*/
|
|
49
|
+
thumbColorToken?: ColorToken;
|
|
50
|
+
/**
|
|
51
|
+
* Custom className
|
|
52
|
+
*/
|
|
53
|
+
className?: string;
|
|
54
|
+
}
|
|
55
|
+
export declare const Slider: React.ForwardRefExoticComponent<SliderProps & React.RefAttributes<HTMLSpanElement>>;
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { StoryObj } from "@storybook/react-vite";
|
|
3
|
+
import type { ColorToken } from "./Slider";
|
|
4
|
+
declare const meta: {
|
|
5
|
+
title: string;
|
|
6
|
+
component: React.ForwardRefExoticComponent<import("./Slider").SliderProps & 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
|
+
defaultValue: {
|
|
29
|
+
control: "object";
|
|
30
|
+
description: string;
|
|
31
|
+
table: {
|
|
32
|
+
category: string;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
min: {
|
|
36
|
+
control: "number";
|
|
37
|
+
description: string;
|
|
38
|
+
table: {
|
|
39
|
+
category: string;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
max: {
|
|
43
|
+
control: "number";
|
|
44
|
+
description: string;
|
|
45
|
+
table: {
|
|
46
|
+
category: string;
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
step: {
|
|
50
|
+
control: "number";
|
|
51
|
+
description: string;
|
|
52
|
+
table: {
|
|
53
|
+
category: string;
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
trackColorToken: {
|
|
57
|
+
control: "select";
|
|
58
|
+
options: ColorToken[];
|
|
59
|
+
description: string;
|
|
60
|
+
table: {
|
|
61
|
+
category: string;
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
thumbColorToken: {
|
|
65
|
+
control: "select";
|
|
66
|
+
options: ColorToken[];
|
|
67
|
+
description: string;
|
|
68
|
+
table: {
|
|
69
|
+
category: string;
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
m: {
|
|
73
|
+
table: {
|
|
74
|
+
disable: boolean;
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
mx: {
|
|
78
|
+
table: {
|
|
79
|
+
disable: boolean;
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
my: {
|
|
83
|
+
table: {
|
|
84
|
+
disable: boolean;
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
mt: {
|
|
88
|
+
table: {
|
|
89
|
+
disable: boolean;
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
mr: {
|
|
93
|
+
table: {
|
|
94
|
+
disable: boolean;
|
|
95
|
+
};
|
|
96
|
+
};
|
|
97
|
+
mb: {
|
|
98
|
+
table: {
|
|
99
|
+
disable: boolean;
|
|
100
|
+
};
|
|
101
|
+
};
|
|
102
|
+
ml: {
|
|
103
|
+
table: {
|
|
104
|
+
disable: boolean;
|
|
105
|
+
};
|
|
106
|
+
};
|
|
107
|
+
};
|
|
108
|
+
};
|
|
109
|
+
export default meta;
|
|
110
|
+
type Story = StoryObj<typeof meta>;
|
|
111
|
+
export declare const Default: Story;
|
|
112
|
+
export declare const Sizes: Story;
|
|
113
|
+
export declare const Variants: Story;
|
|
114
|
+
export declare const VolumeControl: Story;
|
|
115
|
+
export declare const InteractiveColorPicker: Story;
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stepper Component
|
|
3
|
+
* A step-based progress indicator with step text display
|
|
4
|
+
*/
|
|
5
|
+
import React from "react";
|
|
6
|
+
import type { ProgressProps as RadixProgressProps } from "@radix-ui/themes";
|
|
7
|
+
import { type ColorToken } from "../../../tokens";
|
|
8
|
+
import "./Stepper.scss";
|
|
9
|
+
export type { ColorToken } from "../../../tokens";
|
|
10
|
+
export type StepperVariant = "classic" | "surface" | "soft";
|
|
11
|
+
export type StepperSize = "1" | "2" | "3";
|
|
12
|
+
export type StepperColor = "primary" | "secondary" | "accent" | "success" | "error" | "warning" | "info" | "neutral" | "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 type DisplayType = "steps" | "percentage";
|
|
14
|
+
export type TextPosition = "left" | "right" | "top-left" | "top-center" | "top-right" | "bottom-left" | "bottom-center" | "bottom-right";
|
|
15
|
+
export interface StepperProps extends Omit<RadixProgressProps, "color" | "variant" | "size" | "value" | "max" | "duration" | "m" | "mx" | "my" | "mt" | "mr" | "mb" | "ml"> {
|
|
16
|
+
/**
|
|
17
|
+
* Stepper variant style
|
|
18
|
+
* @default 'surface'
|
|
19
|
+
*/
|
|
20
|
+
variant?: StepperVariant;
|
|
21
|
+
/**
|
|
22
|
+
* Stepper size
|
|
23
|
+
* @default '2'
|
|
24
|
+
*/
|
|
25
|
+
size?: StepperSize;
|
|
26
|
+
/**
|
|
27
|
+
* Stepper color - supports custom brand colors and Radix UI colors
|
|
28
|
+
* @default 'primary'
|
|
29
|
+
*/
|
|
30
|
+
color?: StepperColor;
|
|
31
|
+
/**
|
|
32
|
+
* Color token for the progress bar fill
|
|
33
|
+
* @default undefined (uses color prop)
|
|
34
|
+
*/
|
|
35
|
+
barColorToken?: ColorToken;
|
|
36
|
+
/**
|
|
37
|
+
* Color token for the progress bar background
|
|
38
|
+
* @default 'gray-a3'
|
|
39
|
+
*/
|
|
40
|
+
backgroundColorToken?: ColorToken;
|
|
41
|
+
/**
|
|
42
|
+
* Enable high contrast mode
|
|
43
|
+
* @default false
|
|
44
|
+
*/
|
|
45
|
+
highContrast?: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Current step number (1-based)
|
|
48
|
+
* @default 1
|
|
49
|
+
*/
|
|
50
|
+
currentStep?: number;
|
|
51
|
+
/**
|
|
52
|
+
* Total number of steps
|
|
53
|
+
* @default 4
|
|
54
|
+
*/
|
|
55
|
+
totalSteps?: number;
|
|
56
|
+
/**
|
|
57
|
+
* Animation duration (e.g., "300ms", "1s")
|
|
58
|
+
*/
|
|
59
|
+
duration?: `${number}ms` | `${number}s`;
|
|
60
|
+
/**
|
|
61
|
+
* Border radius preset
|
|
62
|
+
*/
|
|
63
|
+
radius?: "none" | "small" | "medium" | "large" | "full";
|
|
64
|
+
/**
|
|
65
|
+
* Display type: steps or percentage
|
|
66
|
+
* @default 'steps'
|
|
67
|
+
*/
|
|
68
|
+
displayType?: DisplayType;
|
|
69
|
+
/**
|
|
70
|
+
* Position of the progress text
|
|
71
|
+
* @default 'left'
|
|
72
|
+
*/
|
|
73
|
+
textPosition?: TextPosition;
|
|
74
|
+
/**
|
|
75
|
+
* Color token for the text
|
|
76
|
+
* @default 'gray-12'
|
|
77
|
+
*/
|
|
78
|
+
textColorToken?: ColorToken;
|
|
79
|
+
/**
|
|
80
|
+
* Whether to show the step/percentage text
|
|
81
|
+
* @default true
|
|
82
|
+
*/
|
|
83
|
+
showStepText?: boolean;
|
|
84
|
+
/**
|
|
85
|
+
* Custom step text format. Use {current} and {total} as placeholders
|
|
86
|
+
* @default "Step {current}/{total}"
|
|
87
|
+
*/
|
|
88
|
+
stepTextFormat?: string;
|
|
89
|
+
/**
|
|
90
|
+
* Starting text (e.g., "Start")
|
|
91
|
+
* @default undefined
|
|
92
|
+
*/
|
|
93
|
+
startText?: string;
|
|
94
|
+
/**
|
|
95
|
+
* Ending text (e.g., "Complete")
|
|
96
|
+
* @default undefined
|
|
97
|
+
*/
|
|
98
|
+
endText?: string;
|
|
99
|
+
}
|
|
100
|
+
export declare const Stepper: React.ForwardRefExoticComponent<StepperProps & React.RefAttributes<HTMLDivElement>>;
|