@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,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Card Component
|
|
3
|
+
* A card component that extends Radix UI Card
|
|
4
|
+
*/
|
|
5
|
+
import React from "react";
|
|
6
|
+
import type { CardProps as RadixCardProps } from "@radix-ui/themes";
|
|
7
|
+
import { type ColorToken } from "../../../tokens";
|
|
8
|
+
import "./Card.scss";
|
|
9
|
+
export type { ColorToken } from "../../../tokens";
|
|
10
|
+
export type CardSize = "1" | "2" | "3" | "4" | "5";
|
|
11
|
+
export type CardVariant = "surface" | "classic" | "ghost";
|
|
12
|
+
export interface CardProps extends Omit<RadixCardProps, "size" | "variant" | "m" | "mx" | "my" | "mt" | "mr" | "mb" | "ml"> {
|
|
13
|
+
/**
|
|
14
|
+
* Card size
|
|
15
|
+
* @default '1'
|
|
16
|
+
*/
|
|
17
|
+
size?: CardSize;
|
|
18
|
+
/**
|
|
19
|
+
* Card variant
|
|
20
|
+
* @default 'surface'
|
|
21
|
+
*/
|
|
22
|
+
variant?: CardVariant;
|
|
23
|
+
/**
|
|
24
|
+
* Color token for card background
|
|
25
|
+
*/
|
|
26
|
+
backgroundColorToken?: ColorToken;
|
|
27
|
+
/**
|
|
28
|
+
* Color token for card border
|
|
29
|
+
*/
|
|
30
|
+
borderColorToken?: ColorToken;
|
|
31
|
+
/**
|
|
32
|
+
* Color token for card text
|
|
33
|
+
*/
|
|
34
|
+
textColorToken?: ColorToken;
|
|
35
|
+
/**
|
|
36
|
+
* Custom className
|
|
37
|
+
*/
|
|
38
|
+
className?: string;
|
|
39
|
+
/**
|
|
40
|
+
* Card content
|
|
41
|
+
*/
|
|
42
|
+
children?: React.ReactNode;
|
|
43
|
+
}
|
|
44
|
+
export declare const Card: React.ForwardRefExoticComponent<CardProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { StoryObj } from "@storybook/react-vite";
|
|
3
|
+
import type { ColorToken } from "./Card";
|
|
4
|
+
declare const meta: {
|
|
5
|
+
title: string;
|
|
6
|
+
component: React.ForwardRefExoticComponent<import("./Card").CardProps & 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
|
+
backgroundColorToken: {
|
|
29
|
+
control: "select";
|
|
30
|
+
options: ColorToken[];
|
|
31
|
+
description: string;
|
|
32
|
+
table: {
|
|
33
|
+
category: string;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
borderColorToken: {
|
|
37
|
+
control: "select";
|
|
38
|
+
options: ColorToken[];
|
|
39
|
+
description: string;
|
|
40
|
+
table: {
|
|
41
|
+
category: string;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
textColorToken: {
|
|
45
|
+
control: "select";
|
|
46
|
+
options: ColorToken[];
|
|
47
|
+
description: string;
|
|
48
|
+
table: {
|
|
49
|
+
category: string;
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
children: {
|
|
53
|
+
control: false;
|
|
54
|
+
description: string;
|
|
55
|
+
table: {
|
|
56
|
+
category: string;
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
m: {
|
|
60
|
+
table: {
|
|
61
|
+
disable: boolean;
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
mx: {
|
|
65
|
+
table: {
|
|
66
|
+
disable: boolean;
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
my: {
|
|
70
|
+
table: {
|
|
71
|
+
disable: boolean;
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
mt: {
|
|
75
|
+
table: {
|
|
76
|
+
disable: boolean;
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
mr: {
|
|
80
|
+
table: {
|
|
81
|
+
disable: boolean;
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
mb: {
|
|
85
|
+
table: {
|
|
86
|
+
disable: boolean;
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
ml: {
|
|
90
|
+
table: {
|
|
91
|
+
disable: boolean;
|
|
92
|
+
};
|
|
93
|
+
};
|
|
94
|
+
};
|
|
95
|
+
};
|
|
96
|
+
export default meta;
|
|
97
|
+
type Story = StoryObj<typeof meta>;
|
|
98
|
+
export declare const Default: Story;
|
|
99
|
+
export declare const Sizes: Story;
|
|
100
|
+
export declare const Variants: Story;
|
|
101
|
+
export declare const ProductCard: Story;
|
|
102
|
+
export declare const UserProfileCard: Story;
|
|
103
|
+
export declare const InteractiveColorPicker: Story;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Checkbox Component
|
|
3
|
+
* A checkbox component that extends Radix UI Checkbox
|
|
4
|
+
*/
|
|
5
|
+
import React from "react";
|
|
6
|
+
import type { CheckboxProps as RadixCheckboxProps } from "@radix-ui/themes";
|
|
7
|
+
import { type ColorToken } from "../../../tokens";
|
|
8
|
+
import "./Checkbox.scss";
|
|
9
|
+
export type { ColorToken } from "../../../tokens";
|
|
10
|
+
export type CheckboxSize = "1" | "2" | "3";
|
|
11
|
+
export type CheckboxColor = "primary" | "secondary" | "accent" | "success" | "error" | "warning";
|
|
12
|
+
export interface CheckboxProps extends Omit<RadixCheckboxProps, "size" | "color" | "m" | "mx" | "my" | "mt" | "mr" | "mb" | "ml"> {
|
|
13
|
+
/**
|
|
14
|
+
* Checkbox size
|
|
15
|
+
* @default '2'
|
|
16
|
+
*/
|
|
17
|
+
size?: CheckboxSize;
|
|
18
|
+
/**
|
|
19
|
+
* Checkbox color
|
|
20
|
+
* @default 'primary'
|
|
21
|
+
*/
|
|
22
|
+
color?: CheckboxColor;
|
|
23
|
+
/**
|
|
24
|
+
* Label text for the checkbox
|
|
25
|
+
*/
|
|
26
|
+
label?: string;
|
|
27
|
+
/**
|
|
28
|
+
* Helper text displayed below the checkbox
|
|
29
|
+
*/
|
|
30
|
+
helperText?: string;
|
|
31
|
+
/**
|
|
32
|
+
* Error message - when provided, checkbox shows error state
|
|
33
|
+
*/
|
|
34
|
+
error?: string;
|
|
35
|
+
/**
|
|
36
|
+
* Color token for the checkbox background (unchecked state)
|
|
37
|
+
*/
|
|
38
|
+
backgroundColorToken?: ColorToken;
|
|
39
|
+
/**
|
|
40
|
+
* Color token for the checkbox background (checked state)
|
|
41
|
+
*/
|
|
42
|
+
checkedColorToken?: ColorToken;
|
|
43
|
+
/**
|
|
44
|
+
* Color token for the checkbox border
|
|
45
|
+
*/
|
|
46
|
+
borderColorToken?: ColorToken;
|
|
47
|
+
/**
|
|
48
|
+
* Color token for the checkmark icon
|
|
49
|
+
*/
|
|
50
|
+
checkmarkColorToken?: ColorToken;
|
|
51
|
+
}
|
|
52
|
+
export declare const Checkbox: React.ForwardRefExoticComponent<CheckboxProps & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { StoryObj } from "@storybook/react-vite";
|
|
3
|
+
import type { ColorToken } from "./Checkbox";
|
|
4
|
+
declare const meta: {
|
|
5
|
+
title: string;
|
|
6
|
+
component: React.ForwardRefExoticComponent<import("./Checkbox").CheckboxProps & 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
|
+
error: {
|
|
27
|
+
control: "text";
|
|
28
|
+
description: string;
|
|
29
|
+
table: {
|
|
30
|
+
category: string;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
size: {
|
|
34
|
+
control: "select";
|
|
35
|
+
options: string[];
|
|
36
|
+
description: string;
|
|
37
|
+
table: {
|
|
38
|
+
category: string;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
color: {
|
|
42
|
+
control: "select";
|
|
43
|
+
options: string[];
|
|
44
|
+
description: string;
|
|
45
|
+
table: {
|
|
46
|
+
category: string;
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
variant: {
|
|
50
|
+
control: "select";
|
|
51
|
+
options: string[];
|
|
52
|
+
description: string;
|
|
53
|
+
table: {
|
|
54
|
+
category: string;
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
highContrast: {
|
|
58
|
+
control: "boolean";
|
|
59
|
+
description: string;
|
|
60
|
+
table: {
|
|
61
|
+
category: string;
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
disabled: {
|
|
65
|
+
control: "boolean";
|
|
66
|
+
description: string;
|
|
67
|
+
table: {
|
|
68
|
+
category: string;
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
defaultChecked: {
|
|
72
|
+
control: "boolean";
|
|
73
|
+
description: string;
|
|
74
|
+
table: {
|
|
75
|
+
category: string;
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
checked: {
|
|
79
|
+
control: "select";
|
|
80
|
+
options: (string | boolean)[];
|
|
81
|
+
description: string;
|
|
82
|
+
table: {
|
|
83
|
+
category: string;
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
backgroundColorToken: {
|
|
87
|
+
control: "select";
|
|
88
|
+
options: ColorToken[];
|
|
89
|
+
description: string;
|
|
90
|
+
table: {
|
|
91
|
+
category: string;
|
|
92
|
+
};
|
|
93
|
+
};
|
|
94
|
+
checkedColorToken: {
|
|
95
|
+
control: "select";
|
|
96
|
+
options: ColorToken[];
|
|
97
|
+
description: string;
|
|
98
|
+
table: {
|
|
99
|
+
category: string;
|
|
100
|
+
};
|
|
101
|
+
};
|
|
102
|
+
borderColorToken: {
|
|
103
|
+
control: "select";
|
|
104
|
+
options: ColorToken[];
|
|
105
|
+
description: string;
|
|
106
|
+
table: {
|
|
107
|
+
category: string;
|
|
108
|
+
};
|
|
109
|
+
};
|
|
110
|
+
checkmarkColorToken: {
|
|
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 WithError: Story;
|
|
161
|
+
export declare const Checked: Story;
|
|
162
|
+
export declare const Indeterminate: Story;
|
|
163
|
+
export declare const Disabled: Story;
|
|
164
|
+
export declare const DisabledChecked: Story;
|
|
165
|
+
export declare const Sizes: Story;
|
|
166
|
+
export declare const Colors: Story;
|
|
167
|
+
export declare const Group: Story;
|
|
168
|
+
export declare const InteractiveColorPicker: Story;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Dialog Component
|
|
3
|
+
* A dialog component that extends Radix UI Dialog
|
|
4
|
+
*/
|
|
5
|
+
import React from "react";
|
|
6
|
+
import type { DialogProps as RadixDialogProps } from "@radix-ui/react-dialog";
|
|
7
|
+
import { type ColorToken } from "../../../tokens";
|
|
8
|
+
import "./Dialog.scss";
|
|
9
|
+
export type { ColorToken } from "../../../tokens";
|
|
10
|
+
export interface DialogProps extends Omit<RadixDialogProps, "children"> {
|
|
11
|
+
/**
|
|
12
|
+
* Dialog trigger element
|
|
13
|
+
*/
|
|
14
|
+
trigger?: React.ReactNode;
|
|
15
|
+
/**
|
|
16
|
+
* Dialog title
|
|
17
|
+
*/
|
|
18
|
+
title?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Dialog description
|
|
21
|
+
*/
|
|
22
|
+
description?: string;
|
|
23
|
+
/**
|
|
24
|
+
* Dialog content
|
|
25
|
+
*/
|
|
26
|
+
children?: React.ReactNode;
|
|
27
|
+
/**
|
|
28
|
+
* Show close button
|
|
29
|
+
* @default true
|
|
30
|
+
*/
|
|
31
|
+
showClose?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Color token for overlay background
|
|
34
|
+
*/
|
|
35
|
+
overlayColorToken?: ColorToken;
|
|
36
|
+
/**
|
|
37
|
+
* Color token for dialog background
|
|
38
|
+
*/
|
|
39
|
+
backgroundColorToken?: ColorToken;
|
|
40
|
+
/**
|
|
41
|
+
* Color token for title text
|
|
42
|
+
*/
|
|
43
|
+
titleColorToken?: ColorToken;
|
|
44
|
+
/**
|
|
45
|
+
* Color token for description text
|
|
46
|
+
*/
|
|
47
|
+
descriptionColorToken?: ColorToken;
|
|
48
|
+
/**
|
|
49
|
+
* Custom className for content
|
|
50
|
+
*/
|
|
51
|
+
className?: string;
|
|
52
|
+
}
|
|
53
|
+
export declare const Dialog: React.ForwardRefExoticComponent<DialogProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { StoryObj } from "@storybook/react-vite";
|
|
3
|
+
import type { ColorToken } from "./Dialog";
|
|
4
|
+
declare const meta: {
|
|
5
|
+
title: string;
|
|
6
|
+
component: React.ForwardRefExoticComponent<import("./Dialog").DialogProps & 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
|
+
children: {
|
|
34
|
+
control: false;
|
|
35
|
+
description: string;
|
|
36
|
+
table: {
|
|
37
|
+
category: string;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
showClose: {
|
|
41
|
+
control: "boolean";
|
|
42
|
+
description: string;
|
|
43
|
+
table: {
|
|
44
|
+
category: string;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
overlayColorToken: {
|
|
48
|
+
control: "select";
|
|
49
|
+
options: ColorToken[];
|
|
50
|
+
description: string;
|
|
51
|
+
table: {
|
|
52
|
+
category: string;
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
backgroundColorToken: {
|
|
56
|
+
control: "select";
|
|
57
|
+
options: ColorToken[];
|
|
58
|
+
description: string;
|
|
59
|
+
table: {
|
|
60
|
+
category: string;
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
titleColorToken: {
|
|
64
|
+
control: "select";
|
|
65
|
+
options: ColorToken[];
|
|
66
|
+
description: string;
|
|
67
|
+
table: {
|
|
68
|
+
category: string;
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
descriptionColorToken: {
|
|
72
|
+
control: "select";
|
|
73
|
+
options: ColorToken[];
|
|
74
|
+
description: string;
|
|
75
|
+
table: {
|
|
76
|
+
category: string;
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
m: {
|
|
80
|
+
table: {
|
|
81
|
+
disable: boolean;
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
mx: {
|
|
85
|
+
table: {
|
|
86
|
+
disable: boolean;
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
my: {
|
|
90
|
+
table: {
|
|
91
|
+
disable: boolean;
|
|
92
|
+
};
|
|
93
|
+
};
|
|
94
|
+
mt: {
|
|
95
|
+
table: {
|
|
96
|
+
disable: boolean;
|
|
97
|
+
};
|
|
98
|
+
};
|
|
99
|
+
mr: {
|
|
100
|
+
table: {
|
|
101
|
+
disable: boolean;
|
|
102
|
+
};
|
|
103
|
+
};
|
|
104
|
+
mb: {
|
|
105
|
+
table: {
|
|
106
|
+
disable: boolean;
|
|
107
|
+
};
|
|
108
|
+
};
|
|
109
|
+
ml: {
|
|
110
|
+
table: {
|
|
111
|
+
disable: boolean;
|
|
112
|
+
};
|
|
113
|
+
};
|
|
114
|
+
};
|
|
115
|
+
};
|
|
116
|
+
export default meta;
|
|
117
|
+
type Story = StoryObj<typeof meta>;
|
|
118
|
+
export declare const Default: Story;
|
|
119
|
+
export declare const WithForm: Story;
|
|
120
|
+
export declare const LongContent: Story;
|
|
121
|
+
export declare const WithoutClose: Story;
|
|
122
|
+
export declare const InteractiveColorPicker: Story;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DropdownMenu Component
|
|
3
|
+
* A dropdown menu component that extends Radix UI DropdownMenu
|
|
4
|
+
*/
|
|
5
|
+
import React from "react";
|
|
6
|
+
import { DropdownMenu as RadixDropdownMenu } from "@radix-ui/themes";
|
|
7
|
+
import { type ColorToken } from "../../../tokens";
|
|
8
|
+
import "./DropdownMenu.scss";
|
|
9
|
+
export type { ColorToken } from "../../../tokens";
|
|
10
|
+
export type DropdownMenuSize = "1" | "2";
|
|
11
|
+
export type DropdownMenuVariant = "solid" | "soft";
|
|
12
|
+
type DropdownMenuRootProps = React.ComponentPropsWithoutRef<typeof RadixDropdownMenu.Root>;
|
|
13
|
+
type DropdownMenuContentProps = React.ComponentPropsWithoutRef<typeof RadixDropdownMenu.Content>;
|
|
14
|
+
export interface DropdownMenuItem {
|
|
15
|
+
label: string;
|
|
16
|
+
value: string;
|
|
17
|
+
shortcut?: string;
|
|
18
|
+
color?: "red" | "blue" | "green";
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
}
|
|
21
|
+
export interface DropdownMenuProps extends Omit<DropdownMenuRootProps, "children"> {
|
|
22
|
+
/**
|
|
23
|
+
* Dropdown menu trigger element
|
|
24
|
+
*/
|
|
25
|
+
trigger: React.ReactNode;
|
|
26
|
+
/**
|
|
27
|
+
* Array of menu items
|
|
28
|
+
*/
|
|
29
|
+
items: DropdownMenuItem[];
|
|
30
|
+
/**
|
|
31
|
+
* Menu size
|
|
32
|
+
* @default '2'
|
|
33
|
+
*/
|
|
34
|
+
size?: DropdownMenuSize;
|
|
35
|
+
/**
|
|
36
|
+
* Menu variant
|
|
37
|
+
* @default 'solid'
|
|
38
|
+
*/
|
|
39
|
+
variant?: DropdownMenuVariant;
|
|
40
|
+
/**
|
|
41
|
+
* Callback when item is selected
|
|
42
|
+
*/
|
|
43
|
+
onSelect?: (value: string) => void;
|
|
44
|
+
/**
|
|
45
|
+
* Color token for menu background
|
|
46
|
+
*/
|
|
47
|
+
backgroundColorToken?: ColorToken;
|
|
48
|
+
/**
|
|
49
|
+
* Color token for menu item text
|
|
50
|
+
*/
|
|
51
|
+
textColorToken?: ColorToken;
|
|
52
|
+
/**
|
|
53
|
+
* Content props for positioning
|
|
54
|
+
*/
|
|
55
|
+
contentProps?: Partial<DropdownMenuContentProps>;
|
|
56
|
+
/**
|
|
57
|
+
* Custom className
|
|
58
|
+
*/
|
|
59
|
+
className?: string;
|
|
60
|
+
}
|
|
61
|
+
export declare const DropdownMenu: React.ForwardRefExoticComponent<DropdownMenuProps & React.RefAttributes<HTMLDivElement>>;
|