@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
|
@@ -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 InlineProps extends Omit<BoxProps, "display" | "direction" | "flexWrap"> {}
|
|
5
8
|
|
|
9
|
+
/**
|
|
10
|
+
* @deprecated Use `HStack` instead.
|
|
11
|
+
*/
|
|
6
12
|
export const Inline = React.forwardRef<HTMLDivElement, InlineProps>((props, ref) => {
|
|
7
13
|
return (
|
|
8
14
|
<Box
|
|
@@ -10,8 +16,8 @@ export const Inline = React.forwardRef<HTMLDivElement, InlineProps>((props, ref)
|
|
|
10
16
|
display="flex"
|
|
11
17
|
flexDirection="row"
|
|
12
18
|
flexWrap="wrap"
|
|
13
|
-
alignItems="
|
|
14
|
-
justifyContent="
|
|
19
|
+
alignItems="flex-start"
|
|
20
|
+
justifyContent="flex-start"
|
|
15
21
|
{...props}
|
|
16
22
|
/>
|
|
17
23
|
);
|
|
@@ -18,7 +18,7 @@ export interface CheckSelectBoxGroupProps
|
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
20
|
* CheckSelectBoxGroup is a simple div wrapper for future extensibility.
|
|
21
|
-
* It does not have spacing by default, nesting <
|
|
21
|
+
* It does not have spacing by default, nesting <VStack> under it is recommended.
|
|
22
22
|
*/
|
|
23
23
|
export const CheckSelectBoxGroup = withGroupContext<HTMLDivElement, CheckSelectBoxGroupProps>(
|
|
24
24
|
forwardRef<HTMLDivElement, CheckSelectBoxGroupProps>((props, ref) => (
|
|
@@ -1,8 +1,26 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { Flex, type FlexProps } from "../Flex";
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
/**
|
|
5
|
+
* @deprecated Use `VStack` instead.
|
|
6
|
+
*/
|
|
7
|
+
export interface StackProps extends Omit<FlexProps, "flexDirection"> {}
|
|
5
8
|
|
|
9
|
+
/**
|
|
10
|
+
* @deprecated Use `VStack` instead.
|
|
11
|
+
*/
|
|
6
12
|
export const Stack = React.forwardRef<HTMLDivElement, StackProps>((props, ref) => {
|
|
7
|
-
return <
|
|
13
|
+
return <Flex ref={ref} display="flex" flexDirection="column" {...props} />;
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
export interface VStackProps extends Omit<FlexProps, "flexDirection"> {}
|
|
17
|
+
|
|
18
|
+
export const VStack = React.forwardRef<HTMLDivElement, VStackProps>((props, ref) => {
|
|
19
|
+
return <Flex ref={ref} display="flex" flexDirection="column" {...props} />;
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
export interface HStackProps extends Omit<FlexProps, "flexDirection"> {}
|
|
23
|
+
|
|
24
|
+
export const HStack = React.forwardRef<HTMLDivElement, HStackProps>((props, ref) => {
|
|
25
|
+
return <Flex ref={ref} display="flex" flexDirection="row" {...props} />;
|
|
8
26
|
});
|
package/src/utils/styled.tsx
CHANGED
|
@@ -17,7 +17,7 @@ export function handleColor(color: string | undefined) {
|
|
|
17
17
|
}
|
|
18
18
|
const [type, value] = color.split(".");
|
|
19
19
|
// @ts-ignore
|
|
20
|
-
return vars.$color[type][value] ??
|
|
20
|
+
return vars.$color[type]?.[value] ?? color;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
export function handleDimension(dimension: string | 0 | undefined) {
|
|
@@ -47,21 +47,28 @@ function handleRadius(radius: string | 0 | undefined) {
|
|
|
47
47
|
return vars.$radius[radius] ?? radius;
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
function handleDisplay(
|
|
51
|
-
display: "block" | "flex" | "inlineFlex" | "inline" | "inlineBlock" | "none" | undefined,
|
|
52
|
-
) {
|
|
50
|
+
function handleDisplay(display: string | undefined) {
|
|
53
51
|
if (!display) {
|
|
54
52
|
return undefined;
|
|
55
53
|
}
|
|
56
54
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
}
|
|
55
|
+
// @ts-ignore
|
|
56
|
+
if (process.env.NODE_ENV !== "production") {
|
|
57
|
+
if (display === "inlineFlex" || display === "inlineBlock") {
|
|
58
|
+
console.warn(
|
|
59
|
+
`[SEED Design System] ${display} is deprecated. Use inline-flex or inline-block instead.`,
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
return (
|
|
65
|
+
{
|
|
66
|
+
flex: "flex",
|
|
67
|
+
inlineFlex: "inline-flex", // @deprecated Use `inline-flex` instead.
|
|
68
|
+
inlineBlock: "inline-block", // @deprecated Use `inline-block` instead.
|
|
69
|
+
none: "none",
|
|
70
|
+
}[display] ?? display
|
|
71
|
+
);
|
|
65
72
|
}
|
|
66
73
|
|
|
67
74
|
function handleFlexDirection(flexDirection: string | undefined) {
|
|
@@ -69,12 +76,23 @@ function handleFlexDirection(flexDirection: string | undefined) {
|
|
|
69
76
|
return undefined;
|
|
70
77
|
}
|
|
71
78
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
79
|
+
// @ts-ignore
|
|
80
|
+
if (process.env.NODE_ENV !== "production") {
|
|
81
|
+
if (flexDirection === "rowReverse" || flexDirection === "columnReverse") {
|
|
82
|
+
console.warn(
|
|
83
|
+
`[SEED Design System] ${flexDirection} is deprecated. Use row-reverse or column-reverse instead.`,
|
|
84
|
+
);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
return (
|
|
89
|
+
{
|
|
90
|
+
row: "row",
|
|
91
|
+
column: "column",
|
|
92
|
+
rowReverse: "row-reverse", // @deprecated Use `row-reverse` instead.
|
|
93
|
+
columnReverse: "column-reverse", // @deprecated Use `column-reverse` instead.
|
|
94
|
+
}[flexDirection] ?? flexDirection
|
|
95
|
+
);
|
|
78
96
|
}
|
|
79
97
|
|
|
80
98
|
function handleJustifyContent(justifyContent: string | undefined) {
|
|
@@ -82,13 +100,29 @@ function handleJustifyContent(justifyContent: string | undefined) {
|
|
|
82
100
|
return undefined;
|
|
83
101
|
}
|
|
84
102
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
103
|
+
// @ts-ignore
|
|
104
|
+
if (process.env.NODE_ENV !== "production") {
|
|
105
|
+
if (justifyContent === "flexStart" || justifyContent === "flexEnd") {
|
|
106
|
+
console.warn(
|
|
107
|
+
`[SEED Design System] ${justifyContent} is deprecated. Use flex-start or flex-end instead.`,
|
|
108
|
+
);
|
|
109
|
+
}
|
|
110
|
+
if (justifyContent === "spaceBetween" || justifyContent === "spaceAround") {
|
|
111
|
+
console.warn(
|
|
112
|
+
`[SEED Design System] ${justifyContent} is deprecated. Use space-between or space-around instead.`,
|
|
113
|
+
);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
return (
|
|
118
|
+
{
|
|
119
|
+
flexStart: "flex-start", // @deprecated Use `flex-start` instead.
|
|
120
|
+
flexEnd: "flex-end", // @deprecated Use `flex-end` instead.
|
|
121
|
+
center: "center",
|
|
122
|
+
spaceBetween: "space-between", // @deprecated Use `space-between` instead.
|
|
123
|
+
spaceAround: "space-around", // @deprecated Use `space-around` instead.
|
|
124
|
+
}[justifyContent] ?? justifyContent
|
|
125
|
+
);
|
|
92
126
|
}
|
|
93
127
|
|
|
94
128
|
function handleAlignItems(alignItems: string | undefined) {
|
|
@@ -96,40 +130,56 @@ function handleAlignItems(alignItems: string | undefined) {
|
|
|
96
130
|
return undefined;
|
|
97
131
|
}
|
|
98
132
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
133
|
+
// @ts-ignore
|
|
134
|
+
if (process.env.NODE_ENV !== "production") {
|
|
135
|
+
if (alignItems === "flexStart" || alignItems === "flexEnd") {
|
|
136
|
+
console.warn(
|
|
137
|
+
`[SEED Design System] ${alignItems} is deprecated. Use flex-start or flex-end instead.`,
|
|
138
|
+
);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
return (
|
|
143
|
+
{
|
|
144
|
+
flexStart: "flex-start", // @deprecated Use `flex-start` instead.
|
|
145
|
+
flexEnd: "flex-end", // @deprecated Use `flex-end` instead.
|
|
146
|
+
center: "center",
|
|
147
|
+
stretch: "stretch",
|
|
148
|
+
}[alignItems] ?? alignItems
|
|
149
|
+
);
|
|
105
150
|
}
|
|
106
151
|
|
|
107
152
|
export interface StyleProps {
|
|
108
|
-
background?: ScopedColorBg | ScopedColorPalette;
|
|
153
|
+
background?: ScopedColorBg | ScopedColorPalette | (string & {});
|
|
109
154
|
|
|
110
|
-
|
|
155
|
+
/**
|
|
156
|
+
* Shorthand for `background`.
|
|
157
|
+
*/
|
|
158
|
+
bg?: ScopedColorBg | ScopedColorPalette | (string & {});
|
|
111
159
|
|
|
112
|
-
|
|
160
|
+
color?: ScopedColorFg | ScopedColorPalette | (string & {});
|
|
113
161
|
|
|
114
|
-
|
|
162
|
+
borderColor?: ScopedColorStroke | ScopedColorPalette | (string & {});
|
|
115
163
|
|
|
116
|
-
|
|
164
|
+
borderWidth?: 0 | 1 | (string & {});
|
|
117
165
|
|
|
118
|
-
|
|
166
|
+
borderTopWidth?: 0 | 1 | (string & {});
|
|
119
167
|
|
|
120
|
-
|
|
168
|
+
borderRightWidth?: 0 | 1 | (string & {});
|
|
121
169
|
|
|
122
|
-
|
|
170
|
+
borderBottomWidth?: 0 | 1 | (string & {});
|
|
123
171
|
|
|
124
|
-
|
|
172
|
+
borderLeftWidth?: 0 | 1 | (string & {});
|
|
125
173
|
|
|
126
|
-
|
|
174
|
+
borderRadius?: Radius | 0 | (string & {});
|
|
127
175
|
|
|
128
|
-
|
|
176
|
+
borderTopLeftRadius?: Radius | 0 | (string & {});
|
|
129
177
|
|
|
130
|
-
|
|
178
|
+
borderTopRightRadius?: Radius | 0 | (string & {});
|
|
131
179
|
|
|
132
|
-
|
|
180
|
+
borderBottomRightRadius?: Radius | 0 | (string & {});
|
|
181
|
+
|
|
182
|
+
borderBottomLeftRadius?: Radius | 0 | (string & {});
|
|
133
183
|
|
|
134
184
|
width?: Dimension | `spacingX.${SpacingX}` | `spacingY.${SpacingY}` | "full" | (string & {});
|
|
135
185
|
|
|
@@ -143,29 +193,72 @@ export interface StyleProps {
|
|
|
143
193
|
|
|
144
194
|
maxHeight?: Dimension | `spacingX.${SpacingX}` | `spacingY.${SpacingY}` | "full" | (string & {});
|
|
145
195
|
|
|
146
|
-
top?: 0;
|
|
196
|
+
top?: 0 | (string & {});
|
|
197
|
+
|
|
198
|
+
left?: 0 | (string & {});
|
|
199
|
+
|
|
200
|
+
right?: 0 | (string & {});
|
|
201
|
+
|
|
202
|
+
bottom?: 0 | (string & {});
|
|
203
|
+
|
|
204
|
+
padding?: Dimension | `spacingX.${SpacingX}` | `spacingY.${SpacingY}` | 0 | (string & {});
|
|
147
205
|
|
|
148
|
-
|
|
206
|
+
/**
|
|
207
|
+
* Shorthand for `padding`.
|
|
208
|
+
*/
|
|
209
|
+
p?: Dimension | `spacingX.${SpacingX}` | `spacingY.${SpacingY}` | 0 | (string & {});
|
|
149
210
|
|
|
150
|
-
|
|
211
|
+
paddingX?: Dimension | `spacingX.${SpacingX}` | `spacingY.${SpacingY}` | 0 | (string & {});
|
|
151
212
|
|
|
152
|
-
|
|
213
|
+
/**
|
|
214
|
+
* Shorthand for `paddingX`.
|
|
215
|
+
*/
|
|
216
|
+
px?: Dimension | `spacingX.${SpacingX}` | `spacingY.${SpacingY}` | 0 | (string & {});
|
|
153
217
|
|
|
154
|
-
|
|
218
|
+
paddingY?: Dimension | `spacingX.${SpacingX}` | `spacingY.${SpacingY}` | 0 | (string & {});
|
|
155
219
|
|
|
156
|
-
|
|
220
|
+
/**
|
|
221
|
+
* Shorthand for `paddingY`.
|
|
222
|
+
*/
|
|
223
|
+
py?: Dimension | `spacingX.${SpacingX}` | `spacingY.${SpacingY}` | 0 | (string & {});
|
|
157
224
|
|
|
158
|
-
|
|
225
|
+
paddingTop?: Dimension | `spacingX.${SpacingX}` | `spacingY.${SpacingY}` | 0 | (string & {});
|
|
159
226
|
|
|
160
|
-
|
|
227
|
+
/**
|
|
228
|
+
* Shorthand for `paddingTop`.
|
|
229
|
+
*/
|
|
230
|
+
pt?: Dimension | `spacingX.${SpacingX}` | `spacingY.${SpacingY}` | 0 | (string & {});
|
|
161
231
|
|
|
162
|
-
paddingRight?: Dimension | `spacingX.${SpacingX}` | `spacingY.${SpacingY}` | 0;
|
|
232
|
+
paddingRight?: Dimension | `spacingX.${SpacingX}` | `spacingY.${SpacingY}` | 0 | (string & {});
|
|
163
233
|
|
|
164
|
-
|
|
234
|
+
/**
|
|
235
|
+
* Shorthand for `paddingRight`.
|
|
236
|
+
*/
|
|
237
|
+
pr?: Dimension | `spacingX.${SpacingX}` | `spacingY.${SpacingY}` | 0 | (string & {});
|
|
165
238
|
|
|
166
|
-
|
|
239
|
+
paddingBottom?: Dimension | `spacingX.${SpacingX}` | `spacingY.${SpacingY}` | 0 | (string & {});
|
|
167
240
|
|
|
168
|
-
|
|
241
|
+
/**
|
|
242
|
+
* Shorthand for `paddingBottom`.
|
|
243
|
+
*/
|
|
244
|
+
pb?: Dimension | `spacingX.${SpacingX}` | `spacingY.${SpacingY}` | 0 | (string & {});
|
|
245
|
+
|
|
246
|
+
paddingLeft?: Dimension | `spacingX.${SpacingX}` | `spacingY.${SpacingY}` | 0 | (string & {});
|
|
247
|
+
|
|
248
|
+
/**
|
|
249
|
+
* Shorthand for `paddingLeft`.
|
|
250
|
+
*/
|
|
251
|
+
pl?: Dimension | `spacingX.${SpacingX}` | `spacingY.${SpacingY}` | 0 | (string & {});
|
|
252
|
+
|
|
253
|
+
display?:
|
|
254
|
+
| "block"
|
|
255
|
+
| "flex"
|
|
256
|
+
| "inline-flex"
|
|
257
|
+
| "inline"
|
|
258
|
+
| "inline-block"
|
|
259
|
+
| "none"
|
|
260
|
+
| "inlineFlex" // @deprecated Use `inline-flex` instead.
|
|
261
|
+
| "inlineBlock"; // @deprecated Use `inline-block` instead.
|
|
169
262
|
|
|
170
263
|
position?: "relative" | "absolute" | "fixed" | "sticky";
|
|
171
264
|
|
|
@@ -178,19 +271,52 @@ export interface StyleProps {
|
|
|
178
271
|
flexShrink?: 0 | (number & {});
|
|
179
272
|
|
|
180
273
|
// Flex
|
|
181
|
-
flexDirection?:
|
|
274
|
+
flexDirection?:
|
|
275
|
+
| "row"
|
|
276
|
+
| "column"
|
|
277
|
+
| "row-reverse"
|
|
278
|
+
| "column-reverse"
|
|
279
|
+
| "rowReverse" // @deprecated Use `row-reverse` instead.
|
|
280
|
+
| "columnReverse"; // @deprecated Use `column-reverse` instead.
|
|
182
281
|
|
|
183
282
|
flexWrap?: "wrap" | "nowrap";
|
|
184
283
|
|
|
185
|
-
justifyContent?:
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
284
|
+
justifyContent?:
|
|
285
|
+
| "flex-start"
|
|
286
|
+
| "flex-end"
|
|
287
|
+
| "center"
|
|
288
|
+
| "space-between"
|
|
289
|
+
| "space-around"
|
|
290
|
+
| "flexStart" // @deprecated Use `flex-start` instead.
|
|
291
|
+
| "flexEnd" // @deprecated Use `flex-end` instead.
|
|
292
|
+
| "spaceBetween" // @deprecated Use `space-between` instead.
|
|
293
|
+
| "spaceAround"; // @deprecated Use `space-around` instead.
|
|
294
|
+
|
|
295
|
+
alignItems?:
|
|
296
|
+
| "flex-start"
|
|
297
|
+
| "flex-end"
|
|
298
|
+
| "center"
|
|
299
|
+
| "stretch"
|
|
300
|
+
| "flexStart" // @deprecated Use `flex-start` instead.
|
|
301
|
+
| "flexEnd"; // @deprecated Use `flex-end` instead.
|
|
302
|
+
|
|
303
|
+
alignContent?:
|
|
304
|
+
| "flex-start"
|
|
305
|
+
| "flex-end"
|
|
306
|
+
| "center"
|
|
307
|
+
| "stretch"
|
|
308
|
+
| "flexStart" // @deprecated Use `flex-start` instead.
|
|
309
|
+
| "flexEnd"; // @deprecated Use `flex-end` instead.
|
|
310
|
+
|
|
311
|
+
alignSelf?:
|
|
312
|
+
| "flex-start"
|
|
313
|
+
| "flex-end"
|
|
314
|
+
| "center"
|
|
315
|
+
| "stretch"
|
|
316
|
+
| "flexStart" // @deprecated Use `flex-start` instead.
|
|
317
|
+
| "flexEnd"; // @deprecated Use `flex-end` instead.
|
|
318
|
+
|
|
319
|
+
gap?: Dimension | `spacingX.${SpacingX}` | `spacingY.${SpacingY}` | 0 | (string & {});
|
|
194
320
|
}
|
|
195
321
|
|
|
196
322
|
interface UseStyleProps extends StyleProps {
|
|
@@ -205,6 +331,7 @@ export function useStyleProps<T extends UseStyleProps>(
|
|
|
205
331
|
} {
|
|
206
332
|
const {
|
|
207
333
|
background,
|
|
334
|
+
bg,
|
|
208
335
|
color,
|
|
209
336
|
borderColor,
|
|
210
337
|
borderWidth,
|
|
@@ -230,6 +357,13 @@ export function useStyleProps<T extends UseStyleProps>(
|
|
|
230
357
|
paddingRight,
|
|
231
358
|
paddingBottom,
|
|
232
359
|
paddingLeft,
|
|
360
|
+
p,
|
|
361
|
+
px,
|
|
362
|
+
py,
|
|
363
|
+
pt,
|
|
364
|
+
pr,
|
|
365
|
+
pb,
|
|
366
|
+
pl,
|
|
233
367
|
bottom,
|
|
234
368
|
left,
|
|
235
369
|
right,
|
|
@@ -253,7 +387,7 @@ export function useStyleProps<T extends UseStyleProps>(
|
|
|
253
387
|
|
|
254
388
|
return {
|
|
255
389
|
style: {
|
|
256
|
-
"--seed-box-background": handleColor(background),
|
|
390
|
+
"--seed-box-background": handleColor(background ?? bg),
|
|
257
391
|
"--seed-box-color": handleColor(color),
|
|
258
392
|
"--seed-box-border-color": handleColor(borderColor),
|
|
259
393
|
"--seed-box-border-width": borderWidth !== undefined ? `${borderWidth}px` : undefined,
|
|
@@ -276,13 +410,13 @@ export function useStyleProps<T extends UseStyleProps>(
|
|
|
276
410
|
"--seed-box-height": handleDimension(height),
|
|
277
411
|
"--seed-box-min-height": handleDimension(minHeight),
|
|
278
412
|
"--seed-box-max-height": handleDimension(maxHeight),
|
|
279
|
-
"--seed-box-padding": handleDimension(padding),
|
|
280
|
-
"--seed-box-padding-x": handleDimension(paddingX),
|
|
281
|
-
"--seed-box-padding-y": handleDimension(paddingY),
|
|
282
|
-
"--seed-box-padding-top": handleDimension(paddingTop),
|
|
283
|
-
"--seed-box-padding-right": handleDimension(paddingRight),
|
|
284
|
-
"--seed-box-padding-bottom": handleDimension(paddingBottom),
|
|
285
|
-
"--seed-box-padding-left": handleDimension(paddingLeft),
|
|
413
|
+
"--seed-box-padding": handleDimension(padding ?? p),
|
|
414
|
+
"--seed-box-padding-x": handleDimension(paddingX ?? px),
|
|
415
|
+
"--seed-box-padding-y": handleDimension(paddingY ?? py),
|
|
416
|
+
"--seed-box-padding-top": handleDimension(paddingTop ?? pt),
|
|
417
|
+
"--seed-box-padding-right": handleDimension(paddingRight ?? pr),
|
|
418
|
+
"--seed-box-padding-bottom": handleDimension(paddingBottom ?? pb),
|
|
419
|
+
"--seed-box-padding-left": handleDimension(paddingLeft ?? pl),
|
|
286
420
|
"--seed-box-top": top,
|
|
287
421
|
"--seed-box-left": left,
|
|
288
422
|
"--seed-box-right": right,
|