@seed-design/react 0.0.14 → 0.0.15
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/lib/components/ActionButton/ActionButton.cjs +5 -1
- package/lib/components/ActionButton/ActionButton.d.ts +2 -1
- package/lib/components/ActionButton/ActionButton.d.ts.map +1 -1
- package/lib/components/ActionButton/ActionButton.js +5 -1
- package/lib/components/ActionChip/ActionChip.cjs +1 -0
- package/lib/components/ActionChip/ActionChip.js +1 -0
- package/lib/components/ActionSheet/ActionSheet.cjs +2 -0
- package/lib/components/ActionSheet/ActionSheet.js +2 -0
- package/lib/components/Avatar/Avatar.cjs +2 -0
- package/lib/components/Avatar/Avatar.js +2 -0
- package/lib/components/Badge/Badge.cjs +1 -0
- package/lib/components/Badge/Badge.js +1 -0
- package/lib/components/BottomSheet/BottomSheet.cjs +1 -0
- package/lib/components/BottomSheet/BottomSheet.js +1 -0
- package/lib/components/Callout/Callout.cjs +1 -0
- package/lib/components/Callout/Callout.js +1 -0
- package/lib/components/Checkbox/Checkbox.cjs +1 -0
- package/lib/components/Checkbox/Checkbox.js +1 -0
- package/lib/components/ChipTabs/ChipTabs.cjs +1 -0
- package/lib/components/ChipTabs/ChipTabs.js +1 -0
- package/lib/components/Columns/Columns.cjs +1 -1
- package/lib/components/Columns/Columns.d.ts +12 -0
- package/lib/components/Columns/Columns.d.ts.map +1 -1
- package/lib/components/Columns/Columns.js +1 -1
- package/lib/components/ControlChip/ControlChip.cjs +1 -0
- package/lib/components/ControlChip/ControlChip.js +1 -0
- package/lib/components/Dialog/Dialog.cjs +1 -0
- package/lib/components/Dialog/Dialog.js +1 -0
- package/lib/components/Divider/Divider.cjs +4 -3
- package/lib/components/Divider/Divider.d.ts +3 -3
- package/lib/components/Divider/Divider.d.ts.map +1 -1
- package/lib/components/Divider/Divider.js +4 -3
- package/lib/components/ExtendedActionSheet/ExtendedActionSheet.cjs +2 -0
- package/lib/components/ExtendedActionSheet/ExtendedActionSheet.js +2 -0
- package/lib/components/ExtendedFab/ExtendedFab.cjs +1 -0
- package/lib/components/ExtendedFab/ExtendedFab.js +1 -0
- package/lib/components/Fab/Fab.cjs +1 -0
- package/lib/components/Fab/Fab.js +1 -0
- package/lib/components/Flex/Flex.cjs +15 -2
- package/lib/components/Flex/Flex.d.ts +26 -2
- package/lib/components/Flex/Flex.d.ts.map +1 -1
- package/lib/components/Flex/Flex.js +15 -2
- package/lib/components/HelpBubble/HelpBubble.cjs +1 -0
- package/lib/components/HelpBubble/HelpBubble.js +1 -0
- package/lib/components/IdentityPlaceholder/IdentityPlaceholder.cjs +1 -0
- package/lib/components/IdentityPlaceholder/IdentityPlaceholder.js +1 -0
- package/lib/components/Inline/Inline.cjs +2 -2
- package/lib/components/Inline/Inline.d.ts +6 -0
- package/lib/components/Inline/Inline.d.ts.map +1 -1
- package/lib/components/Inline/Inline.js +2 -2
- package/lib/components/InlineBanner/InlineBanner.cjs +1 -0
- package/lib/components/InlineBanner/InlineBanner.js +1 -0
- package/lib/components/LinkContent/LinkContent.cjs +1 -0
- package/lib/components/LinkContent/LinkContent.js +1 -0
- package/lib/components/MannerTemp/MannerTemp.cjs +1 -0
- package/lib/components/MannerTemp/MannerTemp.js +1 -0
- package/lib/components/MannerTempBadge/MannerTempBadge.cjs +1 -0
- package/lib/components/MannerTempBadge/MannerTempBadge.js +1 -0
- package/lib/components/NotificationBadge/NotificationBadge.cjs +2 -0
- package/lib/components/NotificationBadge/NotificationBadge.js +2 -0
- package/lib/components/ProgressCircle/ProgressCircle.cjs +1 -0
- package/lib/components/ProgressCircle/ProgressCircle.js +1 -0
- package/lib/components/PullToRefresh/PullToRefresh.cjs +1 -0
- package/lib/components/PullToRefresh/PullToRefresh.js +1 -0
- package/lib/components/ReactionButton/ReactionButton.cjs +1 -0
- package/lib/components/ReactionButton/ReactionButton.js +1 -0
- package/lib/components/SegmentedControl/SegmentedControl.cjs +1 -0
- package/lib/components/SegmentedControl/SegmentedControl.js +1 -0
- package/lib/components/SelectBox/CheckSelectBox.cjs +2 -0
- package/lib/components/SelectBox/CheckSelectBox.d.ts +1 -1
- package/lib/components/SelectBox/CheckSelectBox.js +2 -0
- package/lib/components/SelectBox/RadioSelectBox.cjs +2 -0
- package/lib/components/SelectBox/RadioSelectBox.js +2 -0
- package/lib/components/Skeleton/Skeleton.cjs +1 -0
- package/lib/components/Skeleton/Skeleton.js +1 -0
- package/lib/components/Snackbar/Snackbar.cjs +2 -0
- package/lib/components/Snackbar/Snackbar.js +2 -0
- package/lib/components/Stack/Stack.cjs +10 -2
- package/lib/components/Stack/Stack.d.ts +14 -2
- package/lib/components/Stack/Stack.d.ts.map +1 -1
- package/lib/components/Stack/Stack.js +9 -3
- package/lib/components/Stack/index.cjs +2 -0
- package/lib/components/Stack/index.d.ts +1 -1
- package/lib/components/Stack/index.d.ts.map +1 -1
- package/lib/components/Stack/index.js +1 -1
- package/lib/components/Switch/Switch.cjs +1 -0
- package/lib/components/Switch/Switch.js +1 -0
- package/lib/components/Tabs/Tabs.cjs +1 -0
- package/lib/components/Tabs/Tabs.js +1 -0
- package/lib/components/Text/Text.cjs +1 -0
- package/lib/components/Text/Text.js +1 -0
- package/lib/components/TextField/TextField.cjs +1 -0
- package/lib/components/TextField/TextField.js +1 -0
- package/lib/components/ToggleButton/ToggleButton.cjs +1 -0
- package/lib/components/ToggleButton/ToggleButton.js +1 -0
- package/lib/components/index.cjs +2 -0
- package/lib/components/index.js +1 -1
- package/lib/index.cjs +2 -0
- package/lib/index.js +1 -1
- package/lib/utils/styled.cjs +64 -15
- package/lib/utils/styled.d.ts +63 -31
- package/lib/utils/styled.d.ts.map +1 -1
- package/lib/utils/styled.js +64 -15
- package/package.json +7 -5
- package/src/components/ActionButton/ActionButton.tsx +5 -1
- package/src/components/Columns/Columns.tsx +13 -2
- package/src/components/Divider/Divider.tsx +7 -6
- package/src/components/Flex/Flex.tsx +44 -4
- package/src/components/Inline/Inline.tsx +8 -2
- package/src/components/SelectBox/CheckSelectBox.tsx +1 -1
- package/src/components/Stack/Stack.tsx +21 -3
- package/src/components/Stack/index.ts +8 -1
- package/src/utils/styled.tsx +208 -74
package/lib/utils/styled.cjs
CHANGED
|
@@ -11,7 +11,7 @@ function handleColor(color) {
|
|
|
11
11
|
return void 0;
|
|
12
12
|
}
|
|
13
13
|
const [type, value] = color.split(".");
|
|
14
|
-
return vars.vars.$color[type][value] ??
|
|
14
|
+
return vars.vars.$color[type]?.[value] ?? color;
|
|
15
15
|
}
|
|
16
16
|
function handleDimension(dimension) {
|
|
17
17
|
if (dimension == null) {
|
|
@@ -36,52 +36,94 @@ function handleDisplay(display) {
|
|
|
36
36
|
if (!display) {
|
|
37
37
|
return void 0;
|
|
38
38
|
}
|
|
39
|
+
if (process.env.NODE_ENV !== "production") {
|
|
40
|
+
if (display === "inlineFlex" || display === "inlineBlock") {
|
|
41
|
+
console.warn(
|
|
42
|
+
`[SEED Design System] ${display} is deprecated. Use inline-flex or inline-block instead.`
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
39
46
|
return {
|
|
40
|
-
block: "block",
|
|
41
47
|
flex: "flex",
|
|
42
48
|
inlineFlex: "inline-flex",
|
|
43
|
-
inline
|
|
49
|
+
// @deprecated Use `inline-flex` instead.
|
|
44
50
|
inlineBlock: "inline-block",
|
|
51
|
+
// @deprecated Use `inline-block` instead.
|
|
45
52
|
none: "none"
|
|
46
|
-
}[display];
|
|
53
|
+
}[display] ?? display;
|
|
47
54
|
}
|
|
48
55
|
function handleFlexDirection(flexDirection) {
|
|
49
56
|
if (!flexDirection) {
|
|
50
57
|
return void 0;
|
|
51
58
|
}
|
|
59
|
+
if (process.env.NODE_ENV !== "production") {
|
|
60
|
+
if (flexDirection === "rowReverse" || flexDirection === "columnReverse") {
|
|
61
|
+
console.warn(
|
|
62
|
+
`[SEED Design System] ${flexDirection} is deprecated. Use row-reverse or column-reverse instead.`
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
52
66
|
return {
|
|
53
67
|
row: "row",
|
|
54
68
|
column: "column",
|
|
55
69
|
rowReverse: "row-reverse",
|
|
70
|
+
// @deprecated Use `row-reverse` instead.
|
|
56
71
|
columnReverse: "column-reverse"
|
|
57
|
-
|
|
72
|
+
// @deprecated Use `column-reverse` instead.
|
|
73
|
+
}[flexDirection] ?? flexDirection;
|
|
58
74
|
}
|
|
59
75
|
function handleJustifyContent(justifyContent) {
|
|
60
76
|
if (!justifyContent) {
|
|
61
77
|
return void 0;
|
|
62
78
|
}
|
|
79
|
+
if (process.env.NODE_ENV !== "production") {
|
|
80
|
+
if (justifyContent === "flexStart" || justifyContent === "flexEnd") {
|
|
81
|
+
console.warn(
|
|
82
|
+
`[SEED Design System] ${justifyContent} is deprecated. Use flex-start or flex-end instead.`
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
if (justifyContent === "spaceBetween" || justifyContent === "spaceAround") {
|
|
86
|
+
console.warn(
|
|
87
|
+
`[SEED Design System] ${justifyContent} is deprecated. Use space-between or space-around instead.`
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
63
91
|
return {
|
|
64
92
|
flexStart: "flex-start",
|
|
93
|
+
// @deprecated Use `flex-start` instead.
|
|
65
94
|
flexEnd: "flex-end",
|
|
95
|
+
// @deprecated Use `flex-end` instead.
|
|
66
96
|
center: "center",
|
|
67
97
|
spaceBetween: "space-between",
|
|
98
|
+
// @deprecated Use `space-between` instead.
|
|
68
99
|
spaceAround: "space-around"
|
|
69
|
-
|
|
100
|
+
// @deprecated Use `space-around` instead.
|
|
101
|
+
}[justifyContent] ?? justifyContent;
|
|
70
102
|
}
|
|
71
103
|
function handleAlignItems(alignItems) {
|
|
72
104
|
if (!alignItems) {
|
|
73
105
|
return void 0;
|
|
74
106
|
}
|
|
107
|
+
if (process.env.NODE_ENV !== "production") {
|
|
108
|
+
if (alignItems === "flexStart" || alignItems === "flexEnd") {
|
|
109
|
+
console.warn(
|
|
110
|
+
`[SEED Design System] ${alignItems} is deprecated. Use flex-start or flex-end instead.`
|
|
111
|
+
);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
75
114
|
return {
|
|
76
115
|
flexStart: "flex-start",
|
|
116
|
+
// @deprecated Use `flex-start` instead.
|
|
77
117
|
flexEnd: "flex-end",
|
|
118
|
+
// @deprecated Use `flex-end` instead.
|
|
78
119
|
center: "center",
|
|
79
120
|
stretch: "stretch"
|
|
80
|
-
}[alignItems];
|
|
121
|
+
}[alignItems] ?? alignItems;
|
|
81
122
|
}
|
|
82
123
|
function useStyleProps(props) {
|
|
83
124
|
const {
|
|
84
125
|
background,
|
|
126
|
+
bg,
|
|
85
127
|
color,
|
|
86
128
|
borderColor,
|
|
87
129
|
borderWidth,
|
|
@@ -107,6 +149,13 @@ function useStyleProps(props) {
|
|
|
107
149
|
paddingRight,
|
|
108
150
|
paddingBottom,
|
|
109
151
|
paddingLeft,
|
|
152
|
+
p,
|
|
153
|
+
px,
|
|
154
|
+
py,
|
|
155
|
+
pt,
|
|
156
|
+
pr,
|
|
157
|
+
pb,
|
|
158
|
+
pl,
|
|
110
159
|
bottom,
|
|
111
160
|
left,
|
|
112
161
|
right,
|
|
@@ -129,7 +178,7 @@ function useStyleProps(props) {
|
|
|
129
178
|
} = props;
|
|
130
179
|
return {
|
|
131
180
|
style: {
|
|
132
|
-
"--seed-box-background": handleColor(background),
|
|
181
|
+
"--seed-box-background": handleColor(background ?? bg),
|
|
133
182
|
"--seed-box-color": handleColor(color),
|
|
134
183
|
"--seed-box-border-color": handleColor(borderColor),
|
|
135
184
|
"--seed-box-border-width": borderWidth !== void 0 ? `${borderWidth}px` : void 0,
|
|
@@ -148,13 +197,13 @@ function useStyleProps(props) {
|
|
|
148
197
|
"--seed-box-height": handleDimension(height),
|
|
149
198
|
"--seed-box-min-height": handleDimension(minHeight),
|
|
150
199
|
"--seed-box-max-height": handleDimension(maxHeight),
|
|
151
|
-
"--seed-box-padding": handleDimension(padding),
|
|
152
|
-
"--seed-box-padding-x": handleDimension(paddingX),
|
|
153
|
-
"--seed-box-padding-y": handleDimension(paddingY),
|
|
154
|
-
"--seed-box-padding-top": handleDimension(paddingTop),
|
|
155
|
-
"--seed-box-padding-right": handleDimension(paddingRight),
|
|
156
|
-
"--seed-box-padding-bottom": handleDimension(paddingBottom),
|
|
157
|
-
"--seed-box-padding-left": handleDimension(paddingLeft),
|
|
200
|
+
"--seed-box-padding": handleDimension(padding ?? p),
|
|
201
|
+
"--seed-box-padding-x": handleDimension(paddingX ?? px),
|
|
202
|
+
"--seed-box-padding-y": handleDimension(paddingY ?? py),
|
|
203
|
+
"--seed-box-padding-top": handleDimension(paddingTop ?? pt),
|
|
204
|
+
"--seed-box-padding-right": handleDimension(paddingRight ?? pr),
|
|
205
|
+
"--seed-box-padding-bottom": handleDimension(paddingBottom ?? pb),
|
|
206
|
+
"--seed-box-padding-left": handleDimension(paddingLeft ?? pl),
|
|
158
207
|
"--seed-box-top": top,
|
|
159
208
|
"--seed-box-left": left,
|
|
160
209
|
"--seed-box-right": right,
|
package/lib/utils/styled.d.ts
CHANGED
|
@@ -3,49 +3,81 @@ import { ForwardRefExoticComponent, PropsWithoutRef, RefAttributes } from 'react
|
|
|
3
3
|
export declare function handleColor(color: string | undefined): any;
|
|
4
4
|
export declare function handleDimension(dimension: string | 0 | undefined): any;
|
|
5
5
|
export interface StyleProps {
|
|
6
|
-
background?: ScopedColorBg | ScopedColorPalette;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
6
|
+
background?: ScopedColorBg | ScopedColorPalette | (string & {});
|
|
7
|
+
/**
|
|
8
|
+
* Shorthand for `background`.
|
|
9
|
+
*/
|
|
10
|
+
bg?: ScopedColorBg | ScopedColorPalette | (string & {});
|
|
11
|
+
color?: ScopedColorFg | ScopedColorPalette | (string & {});
|
|
12
|
+
borderColor?: ScopedColorStroke | ScopedColorPalette | (string & {});
|
|
13
|
+
borderWidth?: 0 | 1 | (string & {});
|
|
14
|
+
borderTopWidth?: 0 | 1 | (string & {});
|
|
15
|
+
borderRightWidth?: 0 | 1 | (string & {});
|
|
16
|
+
borderBottomWidth?: 0 | 1 | (string & {});
|
|
17
|
+
borderLeftWidth?: 0 | 1 | (string & {});
|
|
18
|
+
borderRadius?: Radius | 0 | (string & {});
|
|
19
|
+
borderTopLeftRadius?: Radius | 0 | (string & {});
|
|
20
|
+
borderTopRightRadius?: Radius | 0 | (string & {});
|
|
21
|
+
borderBottomRightRadius?: Radius | 0 | (string & {});
|
|
22
|
+
borderBottomLeftRadius?: Radius | 0 | (string & {});
|
|
19
23
|
width?: Dimension | `spacingX.${SpacingX}` | `spacingY.${SpacingY}` | "full" | (string & {});
|
|
20
24
|
minWidth?: Dimension | `spacingX.${SpacingX}` | `spacingY.${SpacingY}` | "full" | (string & {});
|
|
21
25
|
maxWidth?: Dimension | `spacingX.${SpacingX}` | `spacingY.${SpacingY}` | "full" | (string & {});
|
|
22
26
|
height?: Dimension | `spacingX.${SpacingX}` | `spacingY.${SpacingY}` | "full" | (string & {});
|
|
23
27
|
minHeight?: Dimension | `spacingX.${SpacingX}` | `spacingY.${SpacingY}` | "full" | (string & {});
|
|
24
28
|
maxHeight?: Dimension | `spacingX.${SpacingX}` | `spacingY.${SpacingY}` | "full" | (string & {});
|
|
25
|
-
top?: 0;
|
|
26
|
-
left?: 0;
|
|
27
|
-
right?: 0;
|
|
28
|
-
bottom?: 0;
|
|
29
|
-
padding?: Dimension | `spacingX.${SpacingX}` | `spacingY.${SpacingY}` | 0;
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
29
|
+
top?: 0 | (string & {});
|
|
30
|
+
left?: 0 | (string & {});
|
|
31
|
+
right?: 0 | (string & {});
|
|
32
|
+
bottom?: 0 | (string & {});
|
|
33
|
+
padding?: Dimension | `spacingX.${SpacingX}` | `spacingY.${SpacingY}` | 0 | (string & {});
|
|
34
|
+
/**
|
|
35
|
+
* Shorthand for `padding`.
|
|
36
|
+
*/
|
|
37
|
+
p?: Dimension | `spacingX.${SpacingX}` | `spacingY.${SpacingY}` | 0 | (string & {});
|
|
38
|
+
paddingX?: Dimension | `spacingX.${SpacingX}` | `spacingY.${SpacingY}` | 0 | (string & {});
|
|
39
|
+
/**
|
|
40
|
+
* Shorthand for `paddingX`.
|
|
41
|
+
*/
|
|
42
|
+
px?: Dimension | `spacingX.${SpacingX}` | `spacingY.${SpacingY}` | 0 | (string & {});
|
|
43
|
+
paddingY?: Dimension | `spacingX.${SpacingX}` | `spacingY.${SpacingY}` | 0 | (string & {});
|
|
44
|
+
/**
|
|
45
|
+
* Shorthand for `paddingY`.
|
|
46
|
+
*/
|
|
47
|
+
py?: Dimension | `spacingX.${SpacingX}` | `spacingY.${SpacingY}` | 0 | (string & {});
|
|
48
|
+
paddingTop?: Dimension | `spacingX.${SpacingX}` | `spacingY.${SpacingY}` | 0 | (string & {});
|
|
49
|
+
/**
|
|
50
|
+
* Shorthand for `paddingTop`.
|
|
51
|
+
*/
|
|
52
|
+
pt?: Dimension | `spacingX.${SpacingX}` | `spacingY.${SpacingY}` | 0 | (string & {});
|
|
53
|
+
paddingRight?: Dimension | `spacingX.${SpacingX}` | `spacingY.${SpacingY}` | 0 | (string & {});
|
|
54
|
+
/**
|
|
55
|
+
* Shorthand for `paddingRight`.
|
|
56
|
+
*/
|
|
57
|
+
pr?: Dimension | `spacingX.${SpacingX}` | `spacingY.${SpacingY}` | 0 | (string & {});
|
|
58
|
+
paddingBottom?: Dimension | `spacingX.${SpacingX}` | `spacingY.${SpacingY}` | 0 | (string & {});
|
|
59
|
+
/**
|
|
60
|
+
* Shorthand for `paddingBottom`.
|
|
61
|
+
*/
|
|
62
|
+
pb?: Dimension | `spacingX.${SpacingX}` | `spacingY.${SpacingY}` | 0 | (string & {});
|
|
63
|
+
paddingLeft?: Dimension | `spacingX.${SpacingX}` | `spacingY.${SpacingY}` | 0 | (string & {});
|
|
64
|
+
/**
|
|
65
|
+
* Shorthand for `paddingLeft`.
|
|
66
|
+
*/
|
|
67
|
+
pl?: Dimension | `spacingX.${SpacingX}` | `spacingY.${SpacingY}` | 0 | (string & {});
|
|
68
|
+
display?: "block" | "flex" | "inline-flex" | "inline" | "inline-block" | "none" | "inlineFlex" | "inlineBlock";
|
|
37
69
|
position?: "relative" | "absolute" | "fixed" | "sticky";
|
|
38
70
|
overflowX?: "visible" | "hidden" | "scroll" | "auto";
|
|
39
71
|
overflowY?: "visible" | "hidden" | "scroll" | "auto";
|
|
40
72
|
flexGrow?: 0 | 1 | (number & {});
|
|
41
73
|
flexShrink?: 0 | (number & {});
|
|
42
|
-
flexDirection?: "row" | "column" | "rowReverse" | "columnReverse";
|
|
74
|
+
flexDirection?: "row" | "column" | "row-reverse" | "column-reverse" | "rowReverse" | "columnReverse";
|
|
43
75
|
flexWrap?: "wrap" | "nowrap";
|
|
44
|
-
justifyContent?: "
|
|
45
|
-
alignItems?: "
|
|
46
|
-
alignContent?: "
|
|
47
|
-
alignSelf?: "
|
|
48
|
-
gap?: Dimension | `spacingX.${SpacingX}` | `spacingY.${SpacingY}` | 0;
|
|
76
|
+
justifyContent?: "flex-start" | "flex-end" | "center" | "space-between" | "space-around" | "flexStart" | "flexEnd" | "spaceBetween" | "spaceAround";
|
|
77
|
+
alignItems?: "flex-start" | "flex-end" | "center" | "stretch" | "flexStart" | "flexEnd";
|
|
78
|
+
alignContent?: "flex-start" | "flex-end" | "center" | "stretch" | "flexStart" | "flexEnd";
|
|
79
|
+
alignSelf?: "flex-start" | "flex-end" | "center" | "stretch" | "flexStart" | "flexEnd";
|
|
80
|
+
gap?: Dimension | `spacingX.${SpacingX}` | `spacingY.${SpacingY}` | 0 | (string & {});
|
|
49
81
|
}
|
|
50
82
|
interface UseStyleProps extends StyleProps {
|
|
51
83
|
style?: React.CSSProperties;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styled.d.ts","sourceRoot":"","sources":["../../src/utils/styled.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EACV,aAAa,EACb,aAAa,EACb,kBAAkB,EAClB,iBAAiB,EACjB,SAAS,EACT,MAAM,EACN,QAAQ,EACR,QAAQ,EACT,MAAM,uBAAuB,CAAC;AAI/B,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,OAOpD;AAED,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,CAAC,GAAG,SAAS,OAiBhE;
|
|
1
|
+
{"version":3,"file":"styled.d.ts","sourceRoot":"","sources":["../../src/utils/styled.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EACV,aAAa,EACb,aAAa,EACb,kBAAkB,EAClB,iBAAiB,EACjB,SAAS,EACT,MAAM,EACN,QAAQ,EACR,QAAQ,EACT,MAAM,uBAAuB,CAAC;AAI/B,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,OAOpD;AAED,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,CAAC,GAAG,SAAS,OAiBhE;AAgHD,MAAM,WAAW,UAAU;IACzB,UAAU,CAAC,EAAE,aAAa,GAAG,kBAAkB,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;IAEhE;;OAEG;IACH,EAAE,CAAC,EAAE,aAAa,GAAG,kBAAkB,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;IAExD,KAAK,CAAC,EAAE,aAAa,GAAG,kBAAkB,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;IAE3D,WAAW,CAAC,EAAE,iBAAiB,GAAG,kBAAkB,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;IAErE,WAAW,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,C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,GAAG,CAAC,EAAE,SAAS,GAAG,YAAY,QAAQ,EAAE,GAAG,YAAY,QAAQ,EAAE,GAAG,CAAC,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;CACvF;AAED,UAAU,aAAc,SAAQ,UAAU;IACxC,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B;AAED,wBAAgB,aAAa,CAAC,CAAC,SAAS,aAAa,EACnD,KAAK,EAAE,CAAC,GACP;IACD,KAAK,EAAE,KAAK,CAAC,aAAa,CAAC;IAC3B,SAAS,EAAE,IAAI,CAAC,CAAC,EAAE,MAAM,aAAa,CAAC,CAAC;CACzC,CA8GA;AAED,wBAAgB,cAAc,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,EAC5C,SAAS,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC,GAAG,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,oHAY3D"}
|
package/lib/utils/styled.js
CHANGED
|
@@ -7,7 +7,7 @@ function handleColor(color) {
|
|
|
7
7
|
return void 0;
|
|
8
8
|
}
|
|
9
9
|
const [type, value] = color.split(".");
|
|
10
|
-
return vars.$color[type][value] ??
|
|
10
|
+
return vars.$color[type]?.[value] ?? color;
|
|
11
11
|
}
|
|
12
12
|
function handleDimension(dimension) {
|
|
13
13
|
if (dimension == null) {
|
|
@@ -32,52 +32,94 @@ function handleDisplay(display) {
|
|
|
32
32
|
if (!display) {
|
|
33
33
|
return void 0;
|
|
34
34
|
}
|
|
35
|
+
if (process.env.NODE_ENV !== "production") {
|
|
36
|
+
if (display === "inlineFlex" || display === "inlineBlock") {
|
|
37
|
+
console.warn(
|
|
38
|
+
`[SEED Design System] ${display} is deprecated. Use inline-flex or inline-block instead.`
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
35
42
|
return {
|
|
36
|
-
block: "block",
|
|
37
43
|
flex: "flex",
|
|
38
44
|
inlineFlex: "inline-flex",
|
|
39
|
-
inline
|
|
45
|
+
// @deprecated Use `inline-flex` instead.
|
|
40
46
|
inlineBlock: "inline-block",
|
|
47
|
+
// @deprecated Use `inline-block` instead.
|
|
41
48
|
none: "none"
|
|
42
|
-
}[display];
|
|
49
|
+
}[display] ?? display;
|
|
43
50
|
}
|
|
44
51
|
function handleFlexDirection(flexDirection) {
|
|
45
52
|
if (!flexDirection) {
|
|
46
53
|
return void 0;
|
|
47
54
|
}
|
|
55
|
+
if (process.env.NODE_ENV !== "production") {
|
|
56
|
+
if (flexDirection === "rowReverse" || flexDirection === "columnReverse") {
|
|
57
|
+
console.warn(
|
|
58
|
+
`[SEED Design System] ${flexDirection} is deprecated. Use row-reverse or column-reverse instead.`
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
48
62
|
return {
|
|
49
63
|
row: "row",
|
|
50
64
|
column: "column",
|
|
51
65
|
rowReverse: "row-reverse",
|
|
66
|
+
// @deprecated Use `row-reverse` instead.
|
|
52
67
|
columnReverse: "column-reverse"
|
|
53
|
-
|
|
68
|
+
// @deprecated Use `column-reverse` instead.
|
|
69
|
+
}[flexDirection] ?? flexDirection;
|
|
54
70
|
}
|
|
55
71
|
function handleJustifyContent(justifyContent) {
|
|
56
72
|
if (!justifyContent) {
|
|
57
73
|
return void 0;
|
|
58
74
|
}
|
|
75
|
+
if (process.env.NODE_ENV !== "production") {
|
|
76
|
+
if (justifyContent === "flexStart" || justifyContent === "flexEnd") {
|
|
77
|
+
console.warn(
|
|
78
|
+
`[SEED Design System] ${justifyContent} is deprecated. Use flex-start or flex-end instead.`
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
if (justifyContent === "spaceBetween" || justifyContent === "spaceAround") {
|
|
82
|
+
console.warn(
|
|
83
|
+
`[SEED Design System] ${justifyContent} is deprecated. Use space-between or space-around instead.`
|
|
84
|
+
);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
59
87
|
return {
|
|
60
88
|
flexStart: "flex-start",
|
|
89
|
+
// @deprecated Use `flex-start` instead.
|
|
61
90
|
flexEnd: "flex-end",
|
|
91
|
+
// @deprecated Use `flex-end` instead.
|
|
62
92
|
center: "center",
|
|
63
93
|
spaceBetween: "space-between",
|
|
94
|
+
// @deprecated Use `space-between` instead.
|
|
64
95
|
spaceAround: "space-around"
|
|
65
|
-
|
|
96
|
+
// @deprecated Use `space-around` instead.
|
|
97
|
+
}[justifyContent] ?? justifyContent;
|
|
66
98
|
}
|
|
67
99
|
function handleAlignItems(alignItems) {
|
|
68
100
|
if (!alignItems) {
|
|
69
101
|
return void 0;
|
|
70
102
|
}
|
|
103
|
+
if (process.env.NODE_ENV !== "production") {
|
|
104
|
+
if (alignItems === "flexStart" || alignItems === "flexEnd") {
|
|
105
|
+
console.warn(
|
|
106
|
+
`[SEED Design System] ${alignItems} is deprecated. Use flex-start or flex-end instead.`
|
|
107
|
+
);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
71
110
|
return {
|
|
72
111
|
flexStart: "flex-start",
|
|
112
|
+
// @deprecated Use `flex-start` instead.
|
|
73
113
|
flexEnd: "flex-end",
|
|
114
|
+
// @deprecated Use `flex-end` instead.
|
|
74
115
|
center: "center",
|
|
75
116
|
stretch: "stretch"
|
|
76
|
-
}[alignItems];
|
|
117
|
+
}[alignItems] ?? alignItems;
|
|
77
118
|
}
|
|
78
119
|
function useStyleProps(props) {
|
|
79
120
|
const {
|
|
80
121
|
background,
|
|
122
|
+
bg,
|
|
81
123
|
color,
|
|
82
124
|
borderColor,
|
|
83
125
|
borderWidth,
|
|
@@ -103,6 +145,13 @@ function useStyleProps(props) {
|
|
|
103
145
|
paddingRight,
|
|
104
146
|
paddingBottom,
|
|
105
147
|
paddingLeft,
|
|
148
|
+
p,
|
|
149
|
+
px,
|
|
150
|
+
py,
|
|
151
|
+
pt,
|
|
152
|
+
pr,
|
|
153
|
+
pb,
|
|
154
|
+
pl,
|
|
106
155
|
bottom,
|
|
107
156
|
left,
|
|
108
157
|
right,
|
|
@@ -125,7 +174,7 @@ function useStyleProps(props) {
|
|
|
125
174
|
} = props;
|
|
126
175
|
return {
|
|
127
176
|
style: {
|
|
128
|
-
"--seed-box-background": handleColor(background),
|
|
177
|
+
"--seed-box-background": handleColor(background ?? bg),
|
|
129
178
|
"--seed-box-color": handleColor(color),
|
|
130
179
|
"--seed-box-border-color": handleColor(borderColor),
|
|
131
180
|
"--seed-box-border-width": borderWidth !== void 0 ? `${borderWidth}px` : void 0,
|
|
@@ -144,13 +193,13 @@ function useStyleProps(props) {
|
|
|
144
193
|
"--seed-box-height": handleDimension(height),
|
|
145
194
|
"--seed-box-min-height": handleDimension(minHeight),
|
|
146
195
|
"--seed-box-max-height": handleDimension(maxHeight),
|
|
147
|
-
"--seed-box-padding": handleDimension(padding),
|
|
148
|
-
"--seed-box-padding-x": handleDimension(paddingX),
|
|
149
|
-
"--seed-box-padding-y": handleDimension(paddingY),
|
|
150
|
-
"--seed-box-padding-top": handleDimension(paddingTop),
|
|
151
|
-
"--seed-box-padding-right": handleDimension(paddingRight),
|
|
152
|
-
"--seed-box-padding-bottom": handleDimension(paddingBottom),
|
|
153
|
-
"--seed-box-padding-left": handleDimension(paddingLeft),
|
|
196
|
+
"--seed-box-padding": handleDimension(padding ?? p),
|
|
197
|
+
"--seed-box-padding-x": handleDimension(paddingX ?? px),
|
|
198
|
+
"--seed-box-padding-y": handleDimension(paddingY ?? py),
|
|
199
|
+
"--seed-box-padding-top": handleDimension(paddingTop ?? pt),
|
|
200
|
+
"--seed-box-padding-right": handleDimension(paddingRight ?? pr),
|
|
201
|
+
"--seed-box-padding-bottom": handleDimension(paddingBottom ?? pb),
|
|
202
|
+
"--seed-box-padding-left": handleDimension(paddingLeft ?? pl),
|
|
154
203
|
"--seed-box-top": top,
|
|
155
204
|
"--seed-box-left": left,
|
|
156
205
|
"--seed-box-right": right,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@seed-design/react",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.15",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/daangn/seed-design.git",
|
|
@@ -30,7 +30,8 @@
|
|
|
30
30
|
],
|
|
31
31
|
"scripts": {
|
|
32
32
|
"clean": "rm -rf lib",
|
|
33
|
-
"build": "vite build"
|
|
33
|
+
"build": "vite build",
|
|
34
|
+
"lint:publish": "bun publint"
|
|
34
35
|
},
|
|
35
36
|
"dependencies": {
|
|
36
37
|
"@radix-ui/react-compose-refs": "^1.1.1",
|
|
@@ -41,7 +42,7 @@
|
|
|
41
42
|
"@seed-design/react-avatar": "0.0.1",
|
|
42
43
|
"@seed-design/react-checkbox": "0.0.1",
|
|
43
44
|
"@seed-design/react-dialog": "0.0.2",
|
|
44
|
-
"@seed-design/react-popover": "0.0.
|
|
45
|
+
"@seed-design/react-popover": "0.0.4",
|
|
45
46
|
"@seed-design/react-primitive": "0.0.1",
|
|
46
47
|
"@seed-design/react-progress": "0.0.1",
|
|
47
48
|
"@seed-design/react-pull-to-refresh": "0.0.2",
|
|
@@ -55,12 +56,13 @@
|
|
|
55
56
|
"clsx": "^2.1.1"
|
|
56
57
|
},
|
|
57
58
|
"peerDependencies": {
|
|
58
|
-
"@seed-design/css": "0.0.
|
|
59
|
+
"@seed-design/css": "0.0.15",
|
|
59
60
|
"react": ">=18.0.0",
|
|
60
61
|
"react-dom": ">=18.0.0"
|
|
61
62
|
},
|
|
62
63
|
"devDependencies": {
|
|
63
|
-
"@seed-design/css": "0.0.
|
|
64
|
+
"@seed-design/css": "0.0.15",
|
|
65
|
+
"@seed-design/qvism-rollup-plugin": "0.0.0",
|
|
64
66
|
"@vitejs/plugin-react": "^4.3.4",
|
|
65
67
|
"globby": "^14.1.0",
|
|
66
68
|
"vite": "^6.2.3",
|
|
@@ -11,11 +11,13 @@ import {
|
|
|
11
11
|
usePendingButton,
|
|
12
12
|
type UsePendingButtonProps,
|
|
13
13
|
} from "../LoadingIndicator/usePendingButton";
|
|
14
|
+
import { useStyleProps, type StyleProps } from "../../utils/styled";
|
|
14
15
|
|
|
15
16
|
export interface ActionButtonProps
|
|
16
17
|
extends ActionButtonVariantProps,
|
|
17
18
|
UsePendingButtonProps,
|
|
18
19
|
PrimitiveProps,
|
|
20
|
+
Pick<StyleProps, "flexGrow">,
|
|
19
21
|
React.ButtonHTMLAttributes<HTMLButtonElement> {}
|
|
20
22
|
|
|
21
23
|
export const ActionButton = React.forwardRef<HTMLButtonElement, ActionButtonProps>(
|
|
@@ -25,6 +27,7 @@ export const ActionButton = React.forwardRef<HTMLButtonElement, ActionButtonProp
|
|
|
25
27
|
) => {
|
|
26
28
|
const recipeClassName = actionButton({ variant, layout, size });
|
|
27
29
|
const api = usePendingButton({ loading, disabled: otherProps.disabled });
|
|
30
|
+
const { style, restProps } = useStyleProps(otherProps);
|
|
28
31
|
|
|
29
32
|
if (layout === "iconOnly" && !(otherProps["aria-label"] || otherProps["aria-labelledby"])) {
|
|
30
33
|
console.warn(
|
|
@@ -38,8 +41,9 @@ export const ActionButton = React.forwardRef<HTMLButtonElement, ActionButtonProp
|
|
|
38
41
|
<Primitive.button
|
|
39
42
|
ref={ref}
|
|
40
43
|
className={clsx(recipeClassName, className)}
|
|
44
|
+
style={style}
|
|
41
45
|
{...api.stateProps}
|
|
42
|
-
{...
|
|
46
|
+
{...restProps}
|
|
43
47
|
>
|
|
44
48
|
{children}
|
|
45
49
|
</Primitive.button>
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { Box, type BoxProps } from "../Box/Box";
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* @deprecated Use `HStack` instead.
|
|
6
|
+
*/
|
|
4
7
|
export interface ColumnsProps extends Omit<BoxProps, "display" | "direction"> {}
|
|
5
8
|
|
|
9
|
+
/**
|
|
10
|
+
* @deprecated Use `HStack` instead.
|
|
11
|
+
*/
|
|
6
12
|
export const Columns = React.forwardRef<HTMLDivElement, ColumnsProps>((props, ref) => {
|
|
7
13
|
return (
|
|
8
14
|
<Box
|
|
@@ -10,17 +16,22 @@ export const Columns = React.forwardRef<HTMLDivElement, ColumnsProps>((props, re
|
|
|
10
16
|
display="flex"
|
|
11
17
|
flexDirection="row"
|
|
12
18
|
flexWrap="nowrap"
|
|
13
|
-
justifyContent="
|
|
19
|
+
justifyContent="flex-start"
|
|
14
20
|
{...props}
|
|
15
21
|
/>
|
|
16
22
|
);
|
|
17
23
|
});
|
|
18
24
|
|
|
25
|
+
/**
|
|
26
|
+
* @deprecated Use `HStack` instead.
|
|
27
|
+
*/
|
|
19
28
|
export interface ColumnProps extends Omit<BoxProps, "display" | "flexDirection" | "width"> {
|
|
20
29
|
width?: BoxProps["width"] | "content";
|
|
21
30
|
}
|
|
22
31
|
|
|
23
|
-
|
|
32
|
+
/**
|
|
33
|
+
* @deprecated Use `HStack` instead.
|
|
34
|
+
*/
|
|
24
35
|
export const Column = React.forwardRef<HTMLDivElement, ColumnProps>((props, ref) => {
|
|
25
36
|
const { width, ...otherProps } = props;
|
|
26
37
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { Box, type BoxProps } from "../Box/Box";
|
|
3
3
|
|
|
4
|
-
export interface DividerProps
|
|
4
|
+
export interface DividerProps {
|
|
5
5
|
/**
|
|
6
6
|
* @default "hr"
|
|
7
7
|
*/
|
|
@@ -10,24 +10,25 @@ export interface DividerProps extends Omit<BoxProps, "display"> {
|
|
|
10
10
|
/**
|
|
11
11
|
* @default "stroke.neutral"
|
|
12
12
|
*/
|
|
13
|
-
|
|
13
|
+
color?: BoxProps["borderColor"];
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* @default 1
|
|
17
17
|
*/
|
|
18
|
-
|
|
18
|
+
thickness?: BoxProps["borderBottomWidth"];
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
export const Divider = React.forwardRef<HTMLHRElement, DividerProps>((props, ref) => {
|
|
22
|
-
const { as = "hr",
|
|
22
|
+
const { as = "hr", color = "stroke.neutral", thickness = 1, ...rest } = props;
|
|
23
23
|
|
|
24
24
|
return (
|
|
25
25
|
<Box
|
|
26
26
|
ref={ref}
|
|
27
27
|
as={as}
|
|
28
28
|
display="block"
|
|
29
|
-
borderColor={
|
|
30
|
-
borderWidth={
|
|
29
|
+
borderColor={color}
|
|
30
|
+
borderWidth={0}
|
|
31
|
+
borderBottomWidth={thickness}
|
|
31
32
|
{...rest}
|
|
32
33
|
/>
|
|
33
34
|
);
|
|
@@ -7,13 +7,53 @@ export interface FlexProps extends Omit<BoxProps, "display"> {
|
|
|
7
7
|
*/
|
|
8
8
|
display?: "flex" | "none";
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
/**
|
|
11
|
+
* Shorthand for `flexDirection`.
|
|
12
|
+
*/
|
|
13
|
+
direction?: BoxProps["flexDirection"];
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Shorthand for `flexWrap`.
|
|
17
|
+
* If true, flex-wrap will be set to `wrap`.
|
|
18
|
+
*/
|
|
19
|
+
wrap?: BoxProps["flexWrap"] | true;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Shorthand for `alignItems`.
|
|
23
|
+
*/
|
|
24
|
+
align?: BoxProps["alignItems"];
|
|
11
25
|
|
|
12
|
-
|
|
26
|
+
/**
|
|
27
|
+
* Shorthand for `justifyContent`.
|
|
28
|
+
*/
|
|
29
|
+
justify?: BoxProps["justifyContent"];
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Shorthand for `flexGrow`.
|
|
33
|
+
* If true, flex-grow will be set to `1`.
|
|
34
|
+
*/
|
|
35
|
+
grow?: BoxProps["flexGrow"] | true;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Shorthand for `flexShrink`.
|
|
39
|
+
*/
|
|
40
|
+
shrink?: BoxProps["flexShrink"];
|
|
13
41
|
}
|
|
14
42
|
|
|
15
43
|
export const Flex = React.forwardRef<HTMLDivElement, FlexProps>((props, ref) => {
|
|
16
|
-
const { direction, wrap, ...rest } = props;
|
|
44
|
+
const { direction, wrap, align, justify, grow, shrink, ...rest } = props;
|
|
17
45
|
|
|
18
|
-
return
|
|
46
|
+
return (
|
|
47
|
+
<Box
|
|
48
|
+
ref={ref}
|
|
49
|
+
display="flex"
|
|
50
|
+
flexDirection={direction}
|
|
51
|
+
flexWrap={wrap === true ? "wrap" : wrap}
|
|
52
|
+
alignItems={align}
|
|
53
|
+
justifyContent={justify}
|
|
54
|
+
flexGrow={grow === true ? 1 : grow}
|
|
55
|
+
flexShrink={shrink}
|
|
56
|
+
{...rest}
|
|
57
|
+
/>
|
|
58
|
+
);
|
|
19
59
|
});
|