@seed-design/react 1.1.26 → 1.1.27
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 +72 -46
- package/lib/components/ActionButton/ActionButton.js +49 -43
- package/lib/components/ActionButton/index.cjs +9 -3
- package/lib/components/ActionButton/index.js +1 -2
- package/lib/components/ActionChip/ActionChip.cjs +16 -13
- package/lib/components/ActionChip/ActionChip.js +12 -12
- package/lib/components/ActionChip/index.cjs +9 -3
- package/lib/components/ActionChip/index.js +1 -2
- package/lib/components/ActionSheet/ActionSheet.cjs +56 -61
- package/lib/components/ActionSheet/ActionSheet.js +52 -60
- package/lib/components/ActionSheet/ActionSheet.namespace.cjs +19 -23
- package/lib/components/ActionSheet/ActionSheet.namespace.js +1 -18
- package/lib/components/ActionSheet/index.cjs +21 -20
- package/lib/components/ActionSheet/index.js +3 -3
- package/lib/components/Article/Article.cjs +44 -19
- package/lib/components/Article/Article.js +21 -16
- package/lib/components/Article/index.cjs +9 -3
- package/lib/components/Article/index.js +1 -2
- package/lib/components/Avatar/Avatar.cjs +58 -35
- package/lib/components/Avatar/Avatar.js +36 -33
- package/lib/components/Avatar/Avatar.namespace.cjs +13 -17
- package/lib/components/Avatar/Avatar.namespace.js +1 -12
- package/lib/components/Avatar/index.cjs +15 -14
- package/lib/components/Avatar/index.js +3 -3
- package/lib/components/Badge/Badge.cjs +19 -23
- package/lib/components/Badge/Badge.js +15 -21
- package/lib/components/Badge/index.cjs +9 -3
- package/lib/components/Badge/index.js +1 -2
- package/lib/components/BottomSheet/BottomSheet.cjs +52 -21
- package/lib/components/BottomSheet/BottomSheet.js +48 -20
- package/lib/components/BottomSheet/BottomSheet.namespace.cjs +21 -25
- package/lib/components/BottomSheet/BottomSheet.namespace.js +2 -20
- package/lib/components/BottomSheet/index.cjs +21 -20
- package/lib/components/BottomSheet/index.js +3 -3
- package/lib/components/BottomSheetHandle/BottomSheetHandle.cjs +19 -24
- package/lib/components/BottomSheetHandle/BottomSheetHandle.js +15 -21
- package/lib/components/BottomSheetHandle/index.cjs +9 -3
- package/lib/components/BottomSheetHandle/index.js +1 -2
- package/lib/components/Box/Box.cjs +38 -26
- package/lib/components/Box/Box.js +15 -23
- package/lib/components/Box/index.cjs +9 -3
- package/lib/components/Box/index.js +1 -2
- package/lib/components/Callout/Callout.cjs +33 -15
- package/lib/components/Callout/Callout.js +29 -14
- package/lib/components/Callout/Callout.namespace.cjs +14 -18
- package/lib/components/Callout/Callout.namespace.js +1 -13
- package/lib/components/Callout/index.cjs +16 -15
- package/lib/components/Callout/index.js +3 -3
- package/lib/components/Celsius/Celsius.cjs +8 -5
- package/lib/components/Celsius/Celsius.js +4 -5
- package/lib/components/Celsius/index.cjs +9 -3
- package/lib/components/Celsius/index.js +1 -2
- package/lib/components/Checkbox/Checkbox.cjs +89 -66
- package/lib/components/Checkbox/Checkbox.js +85 -64
- package/lib/components/Checkbox/Checkbox.namespace.cjs +13 -17
- package/lib/components/Checkbox/Checkbox.namespace.js +1 -12
- package/lib/components/Checkbox/index.cjs +15 -14
- package/lib/components/Checkbox/index.js +3 -3
- package/lib/components/Chip/Chip.cjs +39 -24
- package/lib/components/Chip/Chip.js +35 -23
- package/lib/components/Chip/Chip.namespace.cjs +13 -17
- package/lib/components/Chip/Chip.namespace.js +1 -12
- package/lib/components/Chip/index.cjs +15 -14
- package/lib/components/Chip/index.js +3 -3
- package/lib/components/ChipTabs/ChipTabs.cjs +53 -30
- package/lib/components/ChipTabs/ChipTabs.js +49 -28
- package/lib/components/ChipTabs/ChipTabs.namespace.cjs +14 -18
- package/lib/components/ChipTabs/ChipTabs.namespace.js +1 -13
- package/lib/components/ChipTabs/index.cjs +16 -15
- package/lib/components/ChipTabs/index.js +3 -3
- package/lib/components/Columns/Columns.cjs +55 -34
- package/lib/components/Columns/Columns.js +32 -32
- package/lib/components/Columns/index.cjs +10 -4
- package/lib/components/Columns/index.js +1 -2
- package/lib/components/ConsistentWidth/ConsistentWidth.cjs +22 -17
- package/lib/components/ConsistentWidth/ConsistentWidth.js +18 -15
- package/lib/components/ConsistentWidth/index.cjs +9 -3
- package/lib/components/ConsistentWidth/index.js +1 -2
- package/lib/components/ContextualFloatingButton/ContextualFloatingButton.cjs +51 -36
- package/lib/components/ContextualFloatingButton/ContextualFloatingButton.js +28 -33
- package/lib/components/ContextualFloatingButton/index.cjs +9 -3
- package/lib/components/ContextualFloatingButton/index.js +1 -2
- package/lib/components/ControlChip/ControlChip.cjs +16 -13
- package/lib/components/ControlChip/ControlChip.js +12 -12
- package/lib/components/ControlChip/index.cjs +9 -3
- package/lib/components/ControlChip/index.js +1 -2
- package/lib/components/Count/Count.cjs +14 -16
- package/lib/components/Count/Count.js +10 -14
- package/lib/components/Count/index.cjs +9 -3
- package/lib/components/Count/index.js +1 -2
- package/lib/components/Dialog/Dialog.cjs +44 -24
- package/lib/components/Dialog/Dialog.js +40 -23
- package/lib/components/Dialog/Dialog.namespace.cjs +18 -22
- package/lib/components/Dialog/Dialog.namespace.js +1 -17
- package/lib/components/Dialog/index.cjs +20 -19
- package/lib/components/Dialog/index.js +3 -3
- package/lib/components/Divider/Divider.cjs +68 -32
- package/lib/components/Divider/Divider.js +45 -30
- package/lib/components/Divider/index.cjs +9 -3
- package/lib/components/Divider/index.js +1 -2
- package/lib/components/ExtendedActionSheet/ExtendedActionSheet.cjs +43 -65
- package/lib/components/ExtendedActionSheet/ExtendedActionSheet.js +39 -64
- package/lib/components/ExtendedActionSheet/ExtendedActionSheet.namespace.cjs +20 -24
- package/lib/components/ExtendedActionSheet/ExtendedActionSheet.namespace.js +1 -19
- package/lib/components/ExtendedActionSheet/index.cjs +22 -21
- package/lib/components/ExtendedActionSheet/index.js +3 -3
- package/lib/components/ExtendedFab/ExtendedFab.cjs +17 -15
- package/lib/components/ExtendedFab/ExtendedFab.js +13 -14
- package/lib/components/ExtendedFab/index.cjs +9 -3
- package/lib/components/ExtendedFab/index.js +1 -2
- package/lib/components/Fab/Fab.cjs +12 -12
- package/lib/components/Fab/Fab.js +8 -11
- package/lib/components/Fab/index.cjs +9 -3
- package/lib/components/Fab/index.js +1 -2
- package/lib/components/Field/Field.cjs +107 -62
- package/lib/components/Field/Field.js +103 -60
- package/lib/components/Field/Field.namespace.cjs +17 -21
- package/lib/components/Field/Field.namespace.js +1 -16
- package/lib/components/Field/index.cjs +19 -18
- package/lib/components/Field/index.js +3 -3
- package/lib/components/FieldButton/FieldButton.cjs +177 -94
- package/lib/components/FieldButton/FieldButton.js +154 -91
- package/lib/components/FieldButton/FieldButton.namespace.cjs +26 -30
- package/lib/components/FieldButton/FieldButton.namespace.js +1 -25
- package/lib/components/FieldButton/index.cjs +28 -27
- package/lib/components/FieldButton/index.js +3 -3
- package/lib/components/Flex/Flex.cjs +45 -21
- package/lib/components/Flex/Flex.js +22 -19
- package/lib/components/Flex/index.cjs +9 -3
- package/lib/components/Flex/index.js +1 -2
- package/lib/components/Float/Float.cjs +104 -70
- package/lib/components/Float/Float.js +81 -68
- package/lib/components/Float/index.cjs +9 -3
- package/lib/components/Float/index.js +1 -2
- package/lib/components/FloatingActionButton/FloatingActionButton.cjs +15 -12
- package/lib/components/FloatingActionButton/FloatingActionButton.js +11 -11
- package/lib/components/FloatingActionButton/FloatingActionButton.namespace.cjs +11 -15
- package/lib/components/FloatingActionButton/FloatingActionButton.namespace.js +1 -10
- package/lib/components/FloatingActionButton/index.cjs +13 -12
- package/lib/components/FloatingActionButton/index.js +3 -3
- package/lib/components/HelpBubble/HelpBubble.cjs +81 -51
- package/lib/components/HelpBubble/HelpBubble.js +77 -49
- package/lib/components/HelpBubble/HelpBubble.namespace.cjs +19 -23
- package/lib/components/HelpBubble/HelpBubble.namespace.js +1 -18
- package/lib/components/HelpBubble/index.cjs +21 -20
- package/lib/components/HelpBubble/index.js +3 -3
- package/lib/components/Icon/Icon.cjs +120 -99
- package/lib/components/Icon/Icon.js +116 -98
- package/lib/components/Icon/index.cjs +11 -5
- package/lib/components/Icon/index.js +1 -2
- package/lib/components/IdentityPlaceholder/IdentityPlaceholder.cjs +71 -50
- package/lib/components/IdentityPlaceholder/IdentityPlaceholder.js +48 -48
- package/lib/components/IdentityPlaceholder/IdentityPlaceholder.namespace.cjs +10 -14
- package/lib/components/IdentityPlaceholder/IdentityPlaceholder.namespace.js +1 -9
- package/lib/components/IdentityPlaceholder/index.cjs +12 -11
- package/lib/components/IdentityPlaceholder/index.js +3 -3
- package/lib/components/Inline/Inline.cjs +42 -21
- package/lib/components/Inline/Inline.js +19 -19
- package/lib/components/Inline/index.cjs +9 -3
- package/lib/components/Inline/index.js +1 -2
- package/lib/components/InlineBanner/InlineBanner.cjs +36 -33
- package/lib/components/InlineBanner/InlineBanner.js +32 -32
- package/lib/components/InlineBanner/InlineBanner.namespace.cjs +14 -18
- package/lib/components/InlineBanner/InlineBanner.namespace.js +1 -13
- package/lib/components/InlineBanner/index.cjs +16 -15
- package/lib/components/InlineBanner/index.js +3 -3
- package/lib/components/LinkContent/LinkContent.cjs +15 -13
- package/lib/components/LinkContent/LinkContent.js +11 -12
- package/lib/components/LinkContent/index.cjs +9 -3
- package/lib/components/LinkContent/index.js +1 -2
- package/lib/components/List/List.cjs +63 -46
- package/lib/components/List/List.js +59 -45
- package/lib/components/List/List.namespace.cjs +15 -19
- package/lib/components/List/List.namespace.js +1 -14
- package/lib/components/List/ListHeader.cjs +18 -18
- package/lib/components/List/ListHeader.js +14 -16
- package/lib/components/List/index.cjs +19 -18
- package/lib/components/List/index.js +4 -4
- package/lib/components/LoadingIndicator/LoadingIndicator.cjs +26 -24
- package/lib/components/LoadingIndicator/LoadingIndicator.js +22 -23
- package/lib/components/LoadingIndicator/index.cjs +9 -3
- package/lib/components/LoadingIndicator/index.js +1 -2
- package/lib/components/LoadingIndicator/usePendingButton.cjs +46 -22
- package/lib/components/LoadingIndicator/usePendingButton.js +23 -20
- package/lib/components/MannerTemp/MannerTemp.cjs +18 -20
- package/lib/components/MannerTemp/MannerTemp.js +14 -19
- package/lib/components/MannerTemp/MannerTempEmote.cjs +96 -130
- package/lib/components/MannerTemp/MannerTempEmote.js +92 -129
- package/lib/components/MannerTemp/index.cjs +11 -5
- package/lib/components/MannerTemp/index.js +2 -3
- package/lib/components/MannerTempBadge/MannerTempBadge.cjs +12 -9
- package/lib/components/MannerTempBadge/MannerTempBadge.js +8 -8
- package/lib/components/MannerTempBadge/index.cjs +9 -3
- package/lib/components/MannerTempBadge/index.js +1 -2
- package/lib/components/MenuSheet/MenuSheet.cjs +106 -61
- package/lib/components/MenuSheet/MenuSheet.js +83 -59
- package/lib/components/MenuSheet/MenuSheet.namespace.cjs +20 -24
- package/lib/components/MenuSheet/MenuSheet.namespace.js +1 -19
- package/lib/components/MenuSheet/index.cjs +22 -21
- package/lib/components/MenuSheet/index.js +3 -3
- package/lib/components/NotificationBadge/NotificationBadge.cjs +41 -29
- package/lib/components/NotificationBadge/NotificationBadge.js +19 -27
- package/lib/components/NotificationBadge/index.cjs +10 -4
- package/lib/components/NotificationBadge/index.js +1 -2
- package/lib/components/PageBanner/PageBanner.cjs +51 -32
- package/lib/components/PageBanner/PageBanner.js +47 -30
- package/lib/components/PageBanner/PageBanner.namespace.cjs +15 -19
- package/lib/components/PageBanner/PageBanner.namespace.js +1 -14
- package/lib/components/PageBanner/index.cjs +17 -16
- package/lib/components/PageBanner/index.js +3 -3
- package/lib/components/Portal/index.cjs +10 -7
- package/lib/components/Portal/index.js +1 -2
- package/lib/components/ProgressCircle/ProgressCircle.cjs +23 -11
- package/lib/components/ProgressCircle/ProgressCircle.js +19 -10
- package/lib/components/ProgressCircle/ProgressCircle.namespace.cjs +11 -15
- package/lib/components/ProgressCircle/ProgressCircle.namespace.js +1 -10
- package/lib/components/ProgressCircle/index.cjs +13 -12
- package/lib/components/ProgressCircle/index.js +3 -3
- package/lib/components/PullToRefresh/PullToRefresh.cjs +20 -11
- package/lib/components/PullToRefresh/PullToRefresh.js +16 -10
- package/lib/components/PullToRefresh/PullToRefresh.namespace.cjs +15 -16
- package/lib/components/PullToRefresh/PullToRefresh.namespace.js +2 -12
- package/lib/components/PullToRefresh/index.cjs +16 -18
- package/lib/components/PullToRefresh/index.js +4 -4
- package/lib/components/RadioGroup/RadioGroup.cjs +72 -66
- package/lib/components/RadioGroup/RadioGroup.js +68 -64
- package/lib/components/RadioGroup/RadioGroup.namespace.cjs +14 -18
- package/lib/components/RadioGroup/RadioGroup.namespace.js +1 -13
- package/lib/components/RadioGroup/index.cjs +16 -15
- package/lib/components/RadioGroup/index.js +3 -3
- package/lib/components/ReactionButton/ReactionButton.cjs +47 -28
- package/lib/components/ReactionButton/ReactionButton.js +24 -25
- package/lib/components/ReactionButton/index.cjs +9 -3
- package/lib/components/ReactionButton/index.js +1 -2
- package/lib/components/ResponsivePair/ResponsivePair.cjs +57 -34
- package/lib/components/ResponsivePair/ResponsivePair.js +34 -32
- package/lib/components/ResponsivePair/index.cjs +9 -3
- package/lib/components/ResponsivePair/index.js +1 -2
- package/lib/components/ScrollFog/ScrollFog.cjs +61 -49
- package/lib/components/ScrollFog/ScrollFog.js +57 -47
- package/lib/components/ScrollFog/index.cjs +9 -3
- package/lib/components/ScrollFog/index.js +1 -2
- package/lib/components/SegmentedControl/SegmentedControl.cjs +22 -13
- package/lib/components/SegmentedControl/SegmentedControl.js +18 -12
- package/lib/components/SegmentedControl/SegmentedControl.namespace.cjs +12 -16
- package/lib/components/SegmentedControl/SegmentedControl.namespace.js +1 -11
- package/lib/components/SegmentedControl/index.cjs +14 -13
- package/lib/components/SegmentedControl/index.js +3 -3
- package/lib/components/SelectBox/CheckSelectBox.cjs +35 -29
- package/lib/components/SelectBox/CheckSelectBox.js +31 -28
- package/lib/components/SelectBox/CheckSelectBox.namespace.cjs +13 -17
- package/lib/components/SelectBox/CheckSelectBox.namespace.js +1 -12
- package/lib/components/SelectBox/RadioSelectBox.cjs +33 -19
- package/lib/components/SelectBox/RadioSelectBox.js +29 -18
- package/lib/components/SelectBox/RadioSelectBox.namespace.cjs +13 -17
- package/lib/components/SelectBox/RadioSelectBox.namespace.js +1 -12
- package/lib/components/SelectBox/index.cjs +23 -27
- package/lib/components/SelectBox/index.js +6 -5
- package/lib/components/Skeleton/Skeleton.cjs +13 -10
- package/lib/components/Skeleton/Skeleton.js +9 -9
- package/lib/components/Skeleton/index.cjs +9 -3
- package/lib/components/Skeleton/index.js +1 -2
- package/lib/components/Slider/Slider.cjs +90 -69
- package/lib/components/Slider/Slider.js +86 -67
- package/lib/components/Slider/Slider.namespace.cjs +21 -25
- package/lib/components/Slider/Slider.namespace.js +1 -20
- package/lib/components/Slider/index.cjs +23 -22
- package/lib/components/Slider/index.js +3 -3
- package/lib/components/Snackbar/Snackbar.cjs +55 -38
- package/lib/components/Snackbar/Snackbar.js +51 -37
- package/lib/components/Snackbar/Snackbar.namespace.cjs +18 -22
- package/lib/components/Snackbar/Snackbar.namespace.js +1 -17
- package/lib/components/Snackbar/index.cjs +24 -26
- package/lib/components/Snackbar/index.js +5 -5
- package/lib/components/Snackbar/useSnackbarAdapter.cjs +26 -22
- package/lib/components/Snackbar/useSnackbarAdapter.js +22 -21
- package/lib/components/Stack/Stack.cjs +35 -32
- package/lib/components/Stack/Stack.js +12 -30
- package/lib/components/Stack/index.cjs +11 -5
- package/lib/components/Stack/index.js +1 -2
- package/lib/components/Switch/Switch.cjs +63 -45
- package/lib/components/Switch/Switch.js +59 -42
- package/lib/components/Switch/Switch.namespace.cjs +13 -17
- package/lib/components/Switch/Switch.namespace.js +1 -12
- package/lib/components/Switch/index.cjs +15 -14
- package/lib/components/Switch/index.js +3 -3
- package/lib/components/Tabs/Tabs.cjs +33 -15
- package/lib/components/Tabs/Tabs.js +29 -14
- package/lib/components/Tabs/Tabs.namespace.cjs +19 -20
- package/lib/components/Tabs/Tabs.namespace.js +2 -16
- package/lib/components/Tabs/index.cjs +20 -22
- package/lib/components/Tabs/index.js +4 -4
- package/lib/components/TagGroup/TagGroup.cjs +35 -44
- package/lib/components/TagGroup/TagGroup.js +31 -42
- package/lib/components/TagGroup/TagGroup.namespace.cjs +10 -14
- package/lib/components/TagGroup/TagGroup.namespace.js +1 -9
- package/lib/components/TagGroup/index.cjs +12 -11
- package/lib/components/TagGroup/index.js +3 -3
- package/lib/components/Text/Text.cjs +85 -49
- package/lib/components/Text/Text.js +81 -47
- package/lib/components/Text/index.cjs +9 -3
- package/lib/components/Text/index.js +1 -2
- package/lib/components/TextField/TextField.cjs +122 -82
- package/lib/components/TextField/TextField.js +118 -80
- package/lib/components/TextField/TextField.namespace.cjs +15 -19
- package/lib/components/TextField/TextField.namespace.js +1 -14
- package/lib/components/TextField/index.cjs +19 -18
- package/lib/components/TextField/index.js +4 -4
- package/lib/components/TextField/memoize.cjs +15 -10
- package/lib/components/TextField/memoize.js +11 -10
- package/lib/components/TextField/useTextFieldWithGraphemes.cjs +50 -40
- package/lib/components/TextField/useTextFieldWithGraphemes.js +46 -39
- package/lib/components/ToggleButton/ToggleButton.cjs +47 -31
- package/lib/components/ToggleButton/ToggleButton.js +24 -28
- package/lib/components/ToggleButton/index.cjs +9 -3
- package/lib/components/ToggleButton/index.js +1 -2
- package/lib/components/VisuallyHidden/VisuallyHidden.cjs +14 -18
- package/lib/components/VisuallyHidden/VisuallyHidden.js +10 -17
- package/lib/components/VisuallyHidden/index.cjs +9 -3
- package/lib/components/VisuallyHidden/index.js +1 -2
- package/lib/components/index.cjs +401 -554
- package/lib/components/index.js +129 -100
- package/lib/components/private/Icon.cjs +15 -15
- package/lib/components/private/Icon.js +11 -14
- package/lib/components/private/useDismissible.cjs +73 -54
- package/lib/components/private/useDismissible.js +48 -53
- package/lib/index.cjs +401 -554
- package/lib/index.js +129 -100
- package/lib/primitive.cjs +55 -73
- package/lib/primitive.js +12 -12
- package/lib/utils/createRecipeContext.cjs +37 -46
- package/lib/utils/createRecipeContext.js +33 -44
- package/lib/utils/createSlotRecipeContext.cjs +74 -91
- package/lib/utils/createSlotRecipeContext.js +70 -89
- package/lib/utils/createWithStateProps.cjs +25 -23
- package/lib/utils/createWithStateProps.js +21 -22
- package/lib/utils/splitMultipleVariantsProps.cjs +29 -16
- package/lib/utils/splitMultipleVariantsProps.js +25 -16
- package/lib/utils/styled.cjs +273 -141
- package/lib/utils/styled.js +269 -141
- package/lib/vars.cjs +11 -7
- package/lib/vars.js +1 -1
- package/package.json +2 -2
- package/lib/_virtual/_rolldown/runtime.cjs +0 -34
- package/lib/_virtual/_rolldown/runtime.js +0 -14
package/lib/utils/styled.js
CHANGED
|
@@ -1,167 +1,295 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { vars } from '@seed-design/css/vars';
|
|
4
|
+
import { forwardRef } from 'react';
|
|
5
|
+
|
|
6
6
|
function handleColor(color) {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
if (!color) {
|
|
8
|
+
return void 0;
|
|
9
|
+
}
|
|
10
|
+
const [type, value] = color.split(".");
|
|
11
|
+
return vars.$color[type]?.[value] ?? color;
|
|
10
12
|
}
|
|
11
13
|
function handleDimension(dimension) {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
if (dimension == null) {
|
|
15
|
+
return void 0;
|
|
16
|
+
}
|
|
17
|
+
if (typeof dimension === "number") {
|
|
18
|
+
return `${dimension}px`;
|
|
19
|
+
}
|
|
20
|
+
if (dimension === "full") {
|
|
21
|
+
return "100%";
|
|
22
|
+
}
|
|
23
|
+
const [type, value] = dimension.split(".");
|
|
24
|
+
return vars.$dimension[dimension] ?? vars.$dimension[type]?.[value] ?? dimension;
|
|
17
25
|
}
|
|
18
26
|
function handleBleed(dimension, direction) {
|
|
19
|
-
|
|
20
|
-
|
|
27
|
+
if (dimension === "asPadding") {
|
|
28
|
+
return `var(--seed-box-padding-${direction})`;
|
|
29
|
+
}
|
|
30
|
+
return handleDimension(dimension);
|
|
21
31
|
}
|
|
22
32
|
function handleShadow(shadow) {
|
|
23
|
-
|
|
24
|
-
|
|
33
|
+
if (!shadow) {
|
|
34
|
+
return void 0;
|
|
35
|
+
}
|
|
36
|
+
return vars.$shadow[shadow] ?? shadow;
|
|
25
37
|
}
|
|
26
38
|
function handlePaddingWithSafeArea(padding, direction) {
|
|
27
|
-
|
|
28
|
-
|
|
39
|
+
if (padding === "safeArea") {
|
|
40
|
+
return `var(--seed-safe-area-${direction})`;
|
|
41
|
+
}
|
|
42
|
+
const paddingValue = handleDimension(padding);
|
|
43
|
+
return paddingValue;
|
|
29
44
|
}
|
|
30
45
|
function handleRadius(radius) {
|
|
31
|
-
|
|
32
|
-
|
|
46
|
+
if (radius == null) {
|
|
47
|
+
return void 0;
|
|
48
|
+
}
|
|
49
|
+
return vars.$radius[radius] ?? radius;
|
|
33
50
|
}
|
|
34
51
|
function handleGradient(gradientToken, direction) {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
52
|
+
if (!gradientToken || !direction) {
|
|
53
|
+
return void 0;
|
|
54
|
+
}
|
|
55
|
+
const colorStops = vars.$gradient[gradientToken];
|
|
56
|
+
if (!colorStops) {
|
|
57
|
+
return void 0;
|
|
58
|
+
}
|
|
59
|
+
return `linear-gradient(${direction}, ${colorStops})`;
|
|
39
60
|
}
|
|
40
61
|
function handleDisplay(display) {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
62
|
+
if (!display) {
|
|
63
|
+
return void 0;
|
|
64
|
+
}
|
|
65
|
+
if (process.env.NODE_ENV !== "production") {
|
|
66
|
+
if (display === "inlineFlex" || display === "inlineBlock") {
|
|
67
|
+
console.warn(
|
|
68
|
+
`[SEED Design System] display='${display}' is deprecated and will be removed in @seed-design/react@1.3.0. Use display='${display === "inlineFlex" ? "inline-flex" : "inline-block"}' instead.`
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
return {
|
|
73
|
+
flex: "flex",
|
|
74
|
+
inlineFlex: "inline-flex",
|
|
75
|
+
// @deprecated Use `inline-flex` instead.
|
|
76
|
+
inlineBlock: "inline-block",
|
|
77
|
+
// @deprecated Use `inline-block` instead.
|
|
78
|
+
none: "none"
|
|
79
|
+
}[display] ?? display;
|
|
51
80
|
}
|
|
52
81
|
function handleFlexDirection(flexDirection) {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
82
|
+
if (!flexDirection) {
|
|
83
|
+
return void 0;
|
|
84
|
+
}
|
|
85
|
+
if (process.env.NODE_ENV !== "production") {
|
|
86
|
+
if (flexDirection === "rowReverse" || flexDirection === "columnReverse") {
|
|
87
|
+
console.warn(
|
|
88
|
+
`[SEED Design System] flexDirection='${flexDirection}' is deprecated and will be removed in @seed-design/react@1.3.0. Use flexDirection='${flexDirection === "rowReverse" ? "row-reverse" : "column-reverse"}' instead.`
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
return {
|
|
93
|
+
row: "row",
|
|
94
|
+
column: "column",
|
|
95
|
+
rowReverse: "row-reverse",
|
|
96
|
+
// @deprecated Use `row-reverse` instead.
|
|
97
|
+
columnReverse: "column-reverse"
|
|
98
|
+
// @deprecated Use `column-reverse` instead.
|
|
99
|
+
}[flexDirection] ?? flexDirection;
|
|
63
100
|
}
|
|
64
101
|
function handleJustifyContent(justifyContent) {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
102
|
+
if (!justifyContent) {
|
|
103
|
+
return void 0;
|
|
104
|
+
}
|
|
105
|
+
if (process.env.NODE_ENV !== "production") {
|
|
106
|
+
if (justifyContent === "flexStart" || justifyContent === "flexEnd") {
|
|
107
|
+
console.warn(
|
|
108
|
+
`[SEED Design System] justifyContent='${justifyContent}' is deprecated and will be removed in @seed-design/react@1.3.0. Use justifyContent='${justifyContent === "flexStart" ? "flex-start" : "flex-end"}' instead.`
|
|
109
|
+
);
|
|
110
|
+
}
|
|
111
|
+
if (justifyContent === "spaceBetween" || justifyContent === "spaceAround") {
|
|
112
|
+
console.warn(
|
|
113
|
+
`[SEED Design System] justifyContent='${justifyContent}' is deprecated and will be removed in @seed-design/react@1.3.0. Use justifyContent='${justifyContent === "spaceBetween" ? "space-between" : "space-around"}' instead.`
|
|
114
|
+
);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
return {
|
|
118
|
+
flexStart: "flex-start",
|
|
119
|
+
// @deprecated Use `flex-start` instead.
|
|
120
|
+
flexEnd: "flex-end",
|
|
121
|
+
// @deprecated Use `flex-end` instead.
|
|
122
|
+
center: "center",
|
|
123
|
+
spaceBetween: "space-between",
|
|
124
|
+
// @deprecated Use `space-between` instead.
|
|
125
|
+
spaceAround: "space-around"
|
|
126
|
+
// @deprecated Use `space-around` instead.
|
|
127
|
+
}[justifyContent] ?? justifyContent;
|
|
77
128
|
}
|
|
78
129
|
function handleAlignItems(alignItems) {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
130
|
+
if (!alignItems) {
|
|
131
|
+
return void 0;
|
|
132
|
+
}
|
|
133
|
+
if (process.env.NODE_ENV !== "production") {
|
|
134
|
+
if (alignItems === "flexStart" || alignItems === "flexEnd") {
|
|
135
|
+
console.warn(
|
|
136
|
+
`[SEED Design System] alignItems='${alignItems}' is deprecated and will be removed in @seed-design/react@1.3.0. Use alignItems='${alignItems === "flexStart" ? "flex-start" : "flex-end"}' instead.`
|
|
137
|
+
);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
return {
|
|
141
|
+
flexStart: "flex-start",
|
|
142
|
+
// @deprecated Use `flex-start` instead.
|
|
143
|
+
flexEnd: "flex-end",
|
|
144
|
+
// @deprecated Use `flex-end` instead.
|
|
145
|
+
center: "center",
|
|
146
|
+
stretch: "stretch"
|
|
147
|
+
}[alignItems] ?? alignItems;
|
|
89
148
|
}
|
|
90
149
|
function useStyleProps(props) {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
150
|
+
const {
|
|
151
|
+
background,
|
|
152
|
+
bg,
|
|
153
|
+
bgGradient,
|
|
154
|
+
backgroundGradient,
|
|
155
|
+
bgGradientDirection,
|
|
156
|
+
backgroundGradientDirection,
|
|
157
|
+
color,
|
|
158
|
+
borderColor,
|
|
159
|
+
borderWidth,
|
|
160
|
+
borderTopWidth,
|
|
161
|
+
borderRightWidth,
|
|
162
|
+
borderBottomWidth,
|
|
163
|
+
borderLeftWidth,
|
|
164
|
+
borderRadius,
|
|
165
|
+
borderTopLeftRadius,
|
|
166
|
+
borderTopRightRadius,
|
|
167
|
+
borderBottomRightRadius,
|
|
168
|
+
borderBottomLeftRadius,
|
|
169
|
+
boxShadow,
|
|
170
|
+
width,
|
|
171
|
+
minWidth,
|
|
172
|
+
maxWidth,
|
|
173
|
+
height,
|
|
174
|
+
minHeight,
|
|
175
|
+
maxHeight,
|
|
176
|
+
padding,
|
|
177
|
+
paddingX,
|
|
178
|
+
paddingY,
|
|
179
|
+
paddingTop,
|
|
180
|
+
paddingRight,
|
|
181
|
+
paddingBottom,
|
|
182
|
+
paddingLeft,
|
|
183
|
+
p,
|
|
184
|
+
px,
|
|
185
|
+
py,
|
|
186
|
+
pt,
|
|
187
|
+
pr,
|
|
188
|
+
pb,
|
|
189
|
+
pl,
|
|
190
|
+
bleedX,
|
|
191
|
+
bleedY,
|
|
192
|
+
bleedTop,
|
|
193
|
+
bleedRight,
|
|
194
|
+
bleedBottom,
|
|
195
|
+
bleedLeft,
|
|
196
|
+
bottom,
|
|
197
|
+
left,
|
|
198
|
+
right,
|
|
199
|
+
top,
|
|
200
|
+
display,
|
|
201
|
+
position,
|
|
202
|
+
overflowX,
|
|
203
|
+
overflowY,
|
|
204
|
+
zIndex,
|
|
205
|
+
flexGrow,
|
|
206
|
+
flexShrink,
|
|
207
|
+
flexDirection,
|
|
208
|
+
flexWrap,
|
|
209
|
+
justifyContent,
|
|
210
|
+
alignItems,
|
|
211
|
+
alignContent,
|
|
212
|
+
alignSelf,
|
|
213
|
+
gap,
|
|
214
|
+
unstable_transform,
|
|
215
|
+
_active,
|
|
216
|
+
style,
|
|
217
|
+
...restProps
|
|
218
|
+
} = props;
|
|
219
|
+
const gradientValue = handleGradient(
|
|
220
|
+
bgGradient ?? backgroundGradient,
|
|
221
|
+
bgGradientDirection ?? backgroundGradientDirection
|
|
222
|
+
);
|
|
223
|
+
return {
|
|
224
|
+
style: {
|
|
225
|
+
"--seed-box-background": handleColor(background ?? bg) ?? gradientValue,
|
|
226
|
+
"--seed-box-color": handleColor(color),
|
|
227
|
+
"--seed-box-border-color": handleColor(borderColor),
|
|
228
|
+
"--seed-box-border-width": borderWidth !== void 0 ? `${borderWidth}px` : void 0,
|
|
229
|
+
"--seed-box-border-top-width": borderTopWidth !== void 0 ? `${borderTopWidth}px` : void 0,
|
|
230
|
+
"--seed-box-border-right-width": borderRightWidth !== void 0 ? `${borderRightWidth}px` : void 0,
|
|
231
|
+
"--seed-box-border-bottom-width": borderBottomWidth !== void 0 ? `${borderBottomWidth}px` : void 0,
|
|
232
|
+
"--seed-box-border-left-width": borderLeftWidth !== void 0 ? `${borderLeftWidth}px` : void 0,
|
|
233
|
+
"--seed-box-border-radius": handleRadius(borderRadius),
|
|
234
|
+
"--seed-box-border-top-left-radius": handleRadius(borderTopLeftRadius),
|
|
235
|
+
"--seed-box-border-top-right-radius": handleRadius(borderTopRightRadius),
|
|
236
|
+
"--seed-box-border-bottom-right-radius": handleRadius(borderBottomRightRadius),
|
|
237
|
+
"--seed-box-border-bottom-left-radius": handleRadius(borderBottomLeftRadius),
|
|
238
|
+
"--seed-box-box-shadow": handleShadow(boxShadow),
|
|
239
|
+
"--seed-box-width": handleDimension(width),
|
|
240
|
+
"--seed-box-min-width": handleDimension(minWidth),
|
|
241
|
+
"--seed-box-max-width": handleDimension(maxWidth),
|
|
242
|
+
"--seed-box-height": handleDimension(height),
|
|
243
|
+
"--seed-box-min-height": handleDimension(minHeight),
|
|
244
|
+
"--seed-box-max-height": handleDimension(maxHeight),
|
|
245
|
+
"--seed-box-padding": handleDimension(padding ?? p),
|
|
246
|
+
"--seed-box-padding-x": handleDimension(paddingX ?? px),
|
|
247
|
+
"--seed-box-padding-y": handleDimension(paddingY ?? py),
|
|
248
|
+
"--seed-box-padding-top": handlePaddingWithSafeArea(paddingTop ?? pt, "top"),
|
|
249
|
+
"--seed-box-padding-right": handleDimension(paddingRight ?? pr),
|
|
250
|
+
"--seed-box-padding-bottom": handlePaddingWithSafeArea(paddingBottom ?? pb, "bottom"),
|
|
251
|
+
"--seed-box-padding-left": handleDimension(paddingLeft ?? pl),
|
|
252
|
+
"--seed-box-bleed-top": handleBleed(bleedTop ?? bleedY, "top"),
|
|
253
|
+
"--seed-box-bleed-right": handleBleed(bleedRight ?? bleedX, "right"),
|
|
254
|
+
"--seed-box-bleed-bottom": handleBleed(bleedBottom ?? bleedY, "bottom"),
|
|
255
|
+
"--seed-box-bleed-left": handleBleed(bleedLeft ?? bleedX, "left"),
|
|
256
|
+
"--seed-box-top": top,
|
|
257
|
+
"--seed-box-left": left,
|
|
258
|
+
"--seed-box-right": right,
|
|
259
|
+
"--seed-box-bottom": bottom,
|
|
260
|
+
"--seed-box-gap": handleDimension(gap),
|
|
261
|
+
"--seed-box-display": handleDisplay(display),
|
|
262
|
+
"--seed-box-position": position,
|
|
263
|
+
"--seed-box-overflow-x": overflowX,
|
|
264
|
+
"--seed-box-overflow-y": overflowY,
|
|
265
|
+
"--seed-box-z-index": zIndex,
|
|
266
|
+
"--seed-box-flex-grow": flexGrow === true ? 1 : flexGrow,
|
|
267
|
+
"--seed-box-flex-shrink": flexShrink === true ? 1 : flexShrink,
|
|
268
|
+
"--seed-box-flex-direction": handleFlexDirection(flexDirection),
|
|
269
|
+
"--seed-box-flex-wrap": flexWrap === true ? "wrap" : flexWrap,
|
|
270
|
+
"--seed-box-justify-content": handleJustifyContent(justifyContent),
|
|
271
|
+
"--seed-box-align-items": handleAlignItems(alignItems),
|
|
272
|
+
"--seed-box-align-content": handleAlignItems(alignContent),
|
|
273
|
+
"--seed-box-align-self": handleAlignItems(alignSelf),
|
|
274
|
+
"--seed-box-unstable-transform": unstable_transform,
|
|
275
|
+
// Active
|
|
276
|
+
"--seed-box-background--active": handleColor(_active?.bg ?? _active?.background),
|
|
277
|
+
...style
|
|
278
|
+
},
|
|
279
|
+
restProps: {
|
|
280
|
+
...restProps,
|
|
281
|
+
// see global.ts to understand why we need this
|
|
282
|
+
...(_active?.bg != null || _active?.background != null) && { "data-has-active-bg": "" }
|
|
283
|
+
}
|
|
284
|
+
};
|
|
153
285
|
}
|
|
154
286
|
function withStyleProps(Component) {
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
});
|
|
162
|
-
});
|
|
163
|
-
Node.displayName = Component.displayName || Component.name;
|
|
164
|
-
return Node;
|
|
287
|
+
const Node = forwardRef((props, ref) => {
|
|
288
|
+
const { style, restProps } = useStyleProps(props);
|
|
289
|
+
return /* @__PURE__ */ jsx(Component, { ref, style, ...restProps });
|
|
290
|
+
});
|
|
291
|
+
Node.displayName = Component.displayName || Component.name;
|
|
292
|
+
return Node;
|
|
165
293
|
}
|
|
166
|
-
|
|
167
|
-
export { handleColor, handleDimension, handleRadius, useStyleProps, withStyleProps };
|
|
294
|
+
|
|
295
|
+
export { handleColor, handleDimension, handlePaddingWithSafeArea, handleRadius, useStyleProps, withStyleProps };
|
package/lib/vars.cjs
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.
|
|
4
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
+
|
|
5
|
+
const vars = require('@seed-design/css/vars');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
Object.keys(vars).forEach(k => {
|
|
10
|
+
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
5
11
|
enumerable: true,
|
|
6
|
-
get:
|
|
7
|
-
return _seed_design_css_vars[k];
|
|
8
|
-
}
|
|
12
|
+
get: () => vars[k]
|
|
9
13
|
});
|
|
10
14
|
});
|
package/lib/vars.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from
|
|
1
|
+
export * from '@seed-design/css/vars';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@seed-design/react",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.27",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/daangn/seed-design.git",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"@seed-design/react-drawer": "1.0.9",
|
|
48
48
|
"@seed-design/react-field": "1.0.1",
|
|
49
49
|
"@seed-design/react-field-button": "1.0.1",
|
|
50
|
-
"@seed-design/react-popover": "1.0.
|
|
50
|
+
"@seed-design/react-popover": "1.0.4",
|
|
51
51
|
"@seed-design/react-portal": "1.0.0",
|
|
52
52
|
"@seed-design/react-primitive": "1.0.0",
|
|
53
53
|
"@seed-design/react-progress": "1.0.0",
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
//#region \0rolldown/runtime.js
|
|
3
|
-
var __create = Object.create;
|
|
4
|
-
var __defProp = Object.defineProperty;
|
|
5
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
-
var __exportAll = (all, no_symbols) => {
|
|
10
|
-
let target = {};
|
|
11
|
-
for (var name in all) __defProp(target, name, {
|
|
12
|
-
get: all[name],
|
|
13
|
-
enumerable: true
|
|
14
|
-
});
|
|
15
|
-
if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
16
|
-
return target;
|
|
17
|
-
};
|
|
18
|
-
var __copyProps = (to, from, except, desc) => {
|
|
19
|
-
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
20
|
-
key = keys[i];
|
|
21
|
-
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
22
|
-
get: ((k) => from[k]).bind(null, key),
|
|
23
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
return to;
|
|
27
|
-
};
|
|
28
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
29
|
-
value: mod,
|
|
30
|
-
enumerable: true
|
|
31
|
-
}) : target, mod));
|
|
32
|
-
//#endregion
|
|
33
|
-
exports.__exportAll = __exportAll;
|
|
34
|
-
exports.__toESM = __toESM;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
//#region \0rolldown/runtime.js
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __exportAll = (all, no_symbols) => {
|
|
5
|
-
let target = {};
|
|
6
|
-
for (var name in all) __defProp(target, name, {
|
|
7
|
-
get: all[name],
|
|
8
|
-
enumerable: true
|
|
9
|
-
});
|
|
10
|
-
if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
11
|
-
return target;
|
|
12
|
-
};
|
|
13
|
-
//#endregion
|
|
14
|
-
export { __exportAll };
|