@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
|
@@ -1,83 +1,121 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { useLayoutEffect } from '@radix-ui/react-use-layout-effect';
|
|
4
|
+
import { Primitive } from '@seed-design/react-primitive';
|
|
5
|
+
import { TextField, useTextFieldContext } from '@seed-design/react-text-field';
|
|
6
|
+
import { useFieldContext } from '@seed-design/react-field';
|
|
7
|
+
import { textInput } from '@seed-design/css/recipes/text-input';
|
|
8
|
+
import clsx from 'clsx';
|
|
9
|
+
import { forwardRef, useRef, useCallback } from 'react';
|
|
10
|
+
import { createSlotRecipeContext } from '../../utils/createSlotRecipeContext.js';
|
|
11
|
+
import { createWithStateProps } from '../../utils/createWithStateProps.js';
|
|
12
|
+
import { InternalIcon } from '../private/Icon.js';
|
|
13
|
+
import { composeRefs } from '@radix-ui/react-compose-refs';
|
|
14
|
+
import { mergeProps } from '@seed-design/dom-utils';
|
|
15
|
+
|
|
16
|
+
const { withProvider, withContext, useClassNames } = createSlotRecipeContext(textInput);
|
|
17
|
+
const withFieldStateProps = createWithStateProps([{ useContext: useFieldContext, strict: false }]);
|
|
18
|
+
const withStateProps = createWithStateProps([
|
|
19
|
+
useTextFieldContext,
|
|
20
|
+
{ useContext: useFieldContext, strict: false }
|
|
21
|
+
]);
|
|
22
|
+
const TextFieldRoot = withProvider(
|
|
23
|
+
withFieldStateProps(TextField.Root),
|
|
24
|
+
"root"
|
|
25
|
+
);
|
|
26
|
+
const TextFieldPrefixIcon = withContext(
|
|
27
|
+
withStateProps(InternalIcon),
|
|
28
|
+
"prefixIcon"
|
|
29
|
+
);
|
|
30
|
+
const TextFieldPrefixText = withContext(
|
|
31
|
+
withStateProps(Primitive.span),
|
|
32
|
+
"prefixText"
|
|
33
|
+
);
|
|
34
|
+
const TextFieldSuffixIcon = withContext(
|
|
35
|
+
withStateProps(InternalIcon),
|
|
36
|
+
"suffixIcon"
|
|
37
|
+
);
|
|
38
|
+
const TextFieldSuffixText = withContext(
|
|
39
|
+
withStateProps(Primitive.span),
|
|
40
|
+
"suffixText"
|
|
41
|
+
);
|
|
42
|
+
const TextFieldInput = forwardRef(
|
|
43
|
+
({ className, ...otherProps }, ref) => {
|
|
44
|
+
const classNames = useClassNames();
|
|
45
|
+
const textFieldContext = useTextFieldContext();
|
|
46
|
+
const fieldContext = useFieldContext({ strict: false });
|
|
47
|
+
const mergedProps = mergeProps(
|
|
48
|
+
fieldContext ? fieldContext.stateProps : {},
|
|
49
|
+
fieldContext ? fieldContext.inputAriaAttributes : {},
|
|
50
|
+
textFieldContext.inputProps,
|
|
51
|
+
fieldContext ? fieldContext.inputProps : {},
|
|
52
|
+
otherProps
|
|
53
|
+
);
|
|
54
|
+
if (
|
|
55
|
+
// if not in field, then must have aria-label or aria-labelledby
|
|
56
|
+
!fieldContext && !otherProps["aria-label"] && !otherProps["aria-labelledby"]
|
|
57
|
+
) {
|
|
58
|
+
console.warn(
|
|
59
|
+
"TextFieldInput: Please provide `aria-label` or `aria-labelledby` for accessibility, or put `TextFieldInput` inside a `Field` where a `FieldLabel` is provided."
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
return /* @__PURE__ */ jsx(TextField.Input, { ref, ...mergedProps, className: clsx(classNames.value, className) });
|
|
63
|
+
}
|
|
64
|
+
);
|
|
42
65
|
TextFieldInput.displayName = "TextFieldInput";
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
});
|
|
66
|
+
const TextFieldTextarea = forwardRef(
|
|
67
|
+
({ className, autoresize = true, ...otherProps }, ref) => {
|
|
68
|
+
const classNames = useClassNames();
|
|
69
|
+
const textFieldContext = useTextFieldContext();
|
|
70
|
+
const fieldContext = useFieldContext({ strict: false });
|
|
71
|
+
const mergedProps = mergeProps(
|
|
72
|
+
fieldContext ? fieldContext.stateProps : {},
|
|
73
|
+
fieldContext ? fieldContext.inputAriaAttributes : {},
|
|
74
|
+
textFieldContext.inputProps,
|
|
75
|
+
fieldContext ? fieldContext.inputProps : {},
|
|
76
|
+
otherProps
|
|
77
|
+
);
|
|
78
|
+
if (
|
|
79
|
+
// if not in field, then must have aria-label or aria-labelledby
|
|
80
|
+
!fieldContext && !otherProps["aria-label"] && !otherProps["aria-labelledby"]
|
|
81
|
+
) {
|
|
82
|
+
console.warn(
|
|
83
|
+
"TextFieldTextarea: Please provide `aria-label` or `aria-labelledby` for accessibility, or put `TextFieldTextarea` inside a `Field` where a `FieldLabel` is provided."
|
|
84
|
+
);
|
|
85
|
+
}
|
|
86
|
+
const inputRef = useRef(null);
|
|
87
|
+
const onHeightChange = useCallback(() => {
|
|
88
|
+
if (!inputRef.current) return;
|
|
89
|
+
if (otherProps.style?.height) return;
|
|
90
|
+
if (!autoresize) return;
|
|
91
|
+
const input = inputRef.current;
|
|
92
|
+
const prevAlignment = input.style.alignSelf;
|
|
93
|
+
const prevOverflow = input.style.overflow;
|
|
94
|
+
const isFirefox = "MozAppearance" in input.style;
|
|
95
|
+
if (!isFirefox) {
|
|
96
|
+
input.style.overflow = "hidden";
|
|
97
|
+
}
|
|
98
|
+
input.style.alignSelf = "start";
|
|
99
|
+
input.style.height = "auto";
|
|
100
|
+
input.style.height = `${input.scrollHeight + (input.offsetHeight - input.clientHeight)}px`;
|
|
101
|
+
input.style.overflow = prevOverflow;
|
|
102
|
+
input.style.alignSelf = prevAlignment;
|
|
103
|
+
}, [inputRef, otherProps.style?.height, autoresize]);
|
|
104
|
+
useLayoutEffect(() => {
|
|
105
|
+
if (inputRef.current) {
|
|
106
|
+
onHeightChange();
|
|
107
|
+
}
|
|
108
|
+
}, [onHeightChange, textFieldContext.value, inputRef]);
|
|
109
|
+
return /* @__PURE__ */ jsx(
|
|
110
|
+
TextField.Textarea,
|
|
111
|
+
{
|
|
112
|
+
ref: composeRefs(inputRef, ref),
|
|
113
|
+
...mergedProps,
|
|
114
|
+
className: clsx(classNames.value, className)
|
|
115
|
+
}
|
|
116
|
+
);
|
|
117
|
+
}
|
|
118
|
+
);
|
|
81
119
|
TextFieldTextarea.displayName = "TextFieldTextarea";
|
|
82
|
-
|
|
120
|
+
|
|
83
121
|
export { TextFieldInput, TextFieldPrefixIcon, TextFieldPrefixText, TextFieldRoot, TextFieldSuffixIcon, TextFieldSuffixText, TextFieldTextarea };
|
|
@@ -1,19 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
get: function() {
|
|
17
|
-
return TextField_namespace_exports;
|
|
18
|
-
}
|
|
19
|
-
});
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
+
|
|
5
|
+
const TextField = require('./TextField.cjs');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
exports.Input = TextField.TextFieldInput;
|
|
10
|
+
exports.PrefixIcon = TextField.TextFieldPrefixIcon;
|
|
11
|
+
exports.PrefixText = TextField.TextFieldPrefixText;
|
|
12
|
+
exports.Root = TextField.TextFieldRoot;
|
|
13
|
+
exports.SuffixIcon = TextField.TextFieldSuffixIcon;
|
|
14
|
+
exports.SuffixText = TextField.TextFieldSuffixText;
|
|
15
|
+
exports.Textarea = TextField.TextFieldTextarea;
|
|
@@ -1,14 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { TextFieldInput, TextFieldPrefixIcon, TextFieldPrefixText, TextFieldRoot, TextFieldSuffixIcon, TextFieldSuffixText, TextFieldTextarea } from "./TextField.js";
|
|
3
|
-
//#region src/components/TextField/TextField.namespace.ts
|
|
4
|
-
var TextField_namespace_exports = /* @__PURE__ */ __exportAll({
|
|
5
|
-
Input: () => TextFieldInput,
|
|
6
|
-
PrefixIcon: () => TextFieldPrefixIcon,
|
|
7
|
-
PrefixText: () => TextFieldPrefixText,
|
|
8
|
-
Root: () => TextFieldRoot,
|
|
9
|
-
SuffixIcon: () => TextFieldSuffixIcon,
|
|
10
|
-
SuffixText: () => TextFieldSuffixText,
|
|
11
|
-
Textarea: () => TextFieldTextarea
|
|
12
|
-
});
|
|
13
|
-
//#endregion
|
|
14
|
-
export { TextField_namespace_exports };
|
|
1
|
+
export { TextFieldInput as Input, TextFieldPrefixIcon as PrefixIcon, TextFieldPrefixText as PrefixText, TextFieldRoot as Root, TextFieldSuffixIcon as SuffixIcon, TextFieldSuffixText as SuffixText, TextFieldTextarea as Textarea } from './TextField.js';
|
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
exports.TextFieldInput =
|
|
12
|
-
exports.TextFieldPrefixIcon =
|
|
13
|
-
exports.TextFieldPrefixText =
|
|
14
|
-
exports.TextFieldRoot =
|
|
15
|
-
exports.TextFieldSuffixIcon =
|
|
16
|
-
exports.TextFieldSuffixText =
|
|
17
|
-
exports.TextFieldTextarea =
|
|
18
|
-
exports.useTextFieldWithGraphemes =
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
+
|
|
5
|
+
const TextField = require('./TextField.cjs');
|
|
6
|
+
const useTextFieldWithGraphemes = require('./useTextFieldWithGraphemes.cjs');
|
|
7
|
+
const TextField_namespace = require('./TextField.namespace.cjs');
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
exports.TextFieldInput = TextField.TextFieldInput;
|
|
12
|
+
exports.TextFieldPrefixIcon = TextField.TextFieldPrefixIcon;
|
|
13
|
+
exports.TextFieldPrefixText = TextField.TextFieldPrefixText;
|
|
14
|
+
exports.TextFieldRoot = TextField.TextFieldRoot;
|
|
15
|
+
exports.TextFieldSuffixIcon = TextField.TextFieldSuffixIcon;
|
|
16
|
+
exports.TextFieldSuffixText = TextField.TextFieldSuffixText;
|
|
17
|
+
exports.TextFieldTextarea = TextField.TextFieldTextarea;
|
|
18
|
+
exports.useTextFieldWithGraphemes = useTextFieldWithGraphemes.useTextFieldWithGraphemes;
|
|
19
|
+
exports.TextField = TextField_namespace;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import
|
|
4
|
-
export {
|
|
1
|
+
export { TextFieldInput, TextFieldPrefixIcon, TextFieldPrefixText, TextFieldRoot, TextFieldSuffixIcon, TextFieldSuffixText, TextFieldTextarea } from './TextField.js';
|
|
2
|
+
export { useTextFieldWithGraphemes } from './useTextFieldWithGraphemes.js';
|
|
3
|
+
import * as TextField_namespace from './TextField.namespace.js';
|
|
4
|
+
export { TextField_namespace as TextField };
|
|
@@ -1,13 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
'use client';
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
5
|
+
|
|
3
6
|
function memoize(fn) {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
const cache = /* @__PURE__ */ new Map();
|
|
8
|
+
return (arg) => {
|
|
9
|
+
if (cache.has(arg)) {
|
|
10
|
+
return cache.get(arg);
|
|
11
|
+
}
|
|
12
|
+
const result = fn(arg);
|
|
13
|
+
cache.set(arg, result);
|
|
14
|
+
return result;
|
|
15
|
+
};
|
|
11
16
|
}
|
|
12
|
-
|
|
17
|
+
|
|
13
18
|
exports.memoize = memoize;
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
//#region src/components/TextField/memoize.ts
|
|
1
|
+
'use client';
|
|
3
2
|
function memoize(fn) {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
3
|
+
const cache = /* @__PURE__ */ new Map();
|
|
4
|
+
return (arg) => {
|
|
5
|
+
if (cache.has(arg)) {
|
|
6
|
+
return cache.get(arg);
|
|
7
|
+
}
|
|
8
|
+
const result = fn(arg);
|
|
9
|
+
cache.set(arg, result);
|
|
10
|
+
return result;
|
|
11
|
+
};
|
|
11
12
|
}
|
|
12
|
-
|
|
13
|
+
|
|
13
14
|
export { memoize };
|
|
@@ -1,42 +1,52 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
1
|
+
'use client';
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
5
|
+
|
|
6
|
+
const React = require('react');
|
|
7
|
+
const grapheme = require('unicode-segmenter/grapheme');
|
|
8
|
+
const memoize = require('./memoize.cjs');
|
|
9
|
+
|
|
10
|
+
const getGraphemes = (string) => Array.from(grapheme.splitGraphemes(string));
|
|
11
|
+
const memoizedGetGraphemes = memoize.memoize(getGraphemes);
|
|
12
|
+
function useTextFieldWithGraphemes({
|
|
13
|
+
maxGraphemeCount,
|
|
14
|
+
value: controlledValue,
|
|
15
|
+
defaultValue = "",
|
|
16
|
+
onValueChange
|
|
17
|
+
}) {
|
|
18
|
+
const [uncontrolledValue, setUncontrolledValue] = React.useState(defaultValue);
|
|
19
|
+
const isControlled = controlledValue !== void 0;
|
|
20
|
+
const value = isControlled ? controlledValue : uncontrolledValue;
|
|
21
|
+
const graphemes = React.useMemo(() => memoizedGetGraphemes(value), [value]);
|
|
22
|
+
const handleValueChange = React.useCallback(
|
|
23
|
+
(newValue) => {
|
|
24
|
+
const newGraphemes = memoizedGetGraphemes(newValue);
|
|
25
|
+
const newSlicedGraphemes = maxGraphemeCount === void 0 ? newGraphemes : newGraphemes.slice(0, maxGraphemeCount);
|
|
26
|
+
const newSlicedValue = newSlicedGraphemes.join("");
|
|
27
|
+
if (!isControlled) {
|
|
28
|
+
setUncontrolledValue(newValue);
|
|
29
|
+
}
|
|
30
|
+
onValueChange?.({
|
|
31
|
+
value: newValue,
|
|
32
|
+
graphemes: newGraphemes,
|
|
33
|
+
slicedValue: newSlicedValue,
|
|
34
|
+
slicedGraphemes: newSlicedGraphemes
|
|
35
|
+
});
|
|
36
|
+
},
|
|
37
|
+
[isControlled, maxGraphemeCount, onValueChange]
|
|
38
|
+
);
|
|
39
|
+
return {
|
|
40
|
+
textFieldRootProps: {
|
|
41
|
+
value,
|
|
42
|
+
onValueChange: handleValueChange
|
|
43
|
+
},
|
|
44
|
+
counterProps: {
|
|
45
|
+
current: graphemes.length,
|
|
46
|
+
max: maxGraphemeCount ?? 0
|
|
47
|
+
},
|
|
48
|
+
graphemes
|
|
49
|
+
};
|
|
40
50
|
}
|
|
41
|
-
|
|
51
|
+
|
|
42
52
|
exports.useTextFieldWithGraphemes = useTextFieldWithGraphemes;
|
|
@@ -1,41 +1,48 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
function useTextFieldWithGraphemes({
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
1
|
+
'use client';
|
|
2
|
+
import { useState, useMemo, useCallback } from 'react';
|
|
3
|
+
import { splitGraphemes } from 'unicode-segmenter/grapheme';
|
|
4
|
+
import { memoize } from './memoize.js';
|
|
5
|
+
|
|
6
|
+
const getGraphemes = (string) => Array.from(splitGraphemes(string));
|
|
7
|
+
const memoizedGetGraphemes = memoize(getGraphemes);
|
|
8
|
+
function useTextFieldWithGraphemes({
|
|
9
|
+
maxGraphemeCount,
|
|
10
|
+
value: controlledValue,
|
|
11
|
+
defaultValue = "",
|
|
12
|
+
onValueChange
|
|
13
|
+
}) {
|
|
14
|
+
const [uncontrolledValue, setUncontrolledValue] = useState(defaultValue);
|
|
15
|
+
const isControlled = controlledValue !== void 0;
|
|
16
|
+
const value = isControlled ? controlledValue : uncontrolledValue;
|
|
17
|
+
const graphemes = useMemo(() => memoizedGetGraphemes(value), [value]);
|
|
18
|
+
const handleValueChange = useCallback(
|
|
19
|
+
(newValue) => {
|
|
20
|
+
const newGraphemes = memoizedGetGraphemes(newValue);
|
|
21
|
+
const newSlicedGraphemes = maxGraphemeCount === void 0 ? newGraphemes : newGraphemes.slice(0, maxGraphemeCount);
|
|
22
|
+
const newSlicedValue = newSlicedGraphemes.join("");
|
|
23
|
+
if (!isControlled) {
|
|
24
|
+
setUncontrolledValue(newValue);
|
|
25
|
+
}
|
|
26
|
+
onValueChange?.({
|
|
27
|
+
value: newValue,
|
|
28
|
+
graphemes: newGraphemes,
|
|
29
|
+
slicedValue: newSlicedValue,
|
|
30
|
+
slicedGraphemes: newSlicedGraphemes
|
|
31
|
+
});
|
|
32
|
+
},
|
|
33
|
+
[isControlled, maxGraphemeCount, onValueChange]
|
|
34
|
+
);
|
|
35
|
+
return {
|
|
36
|
+
textFieldRootProps: {
|
|
37
|
+
value,
|
|
38
|
+
onValueChange: handleValueChange
|
|
39
|
+
},
|
|
40
|
+
counterProps: {
|
|
41
|
+
current: graphemes.length,
|
|
42
|
+
max: maxGraphemeCount ?? 0
|
|
43
|
+
},
|
|
44
|
+
graphemes
|
|
45
|
+
};
|
|
39
46
|
}
|
|
40
|
-
|
|
47
|
+
|
|
41
48
|
export { useTextFieldWithGraphemes };
|
|
@@ -1,33 +1,49 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
1
|
+
'use client';
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
5
|
+
|
|
6
|
+
const jsxRuntime = require('react/jsx-runtime');
|
|
7
|
+
const toggleButton = require('@seed-design/css/recipes/toggle-button');
|
|
8
|
+
const reactToggle = require('@seed-design/react-toggle');
|
|
9
|
+
const clsx = require('clsx');
|
|
10
|
+
const React = require('react');
|
|
11
|
+
const usePendingButton = require('../LoadingIndicator/usePendingButton.cjs');
|
|
12
|
+
|
|
13
|
+
function _interopNamespaceDefault(e) {
|
|
14
|
+
const n = Object.create(null, { [Symbol.toStringTag]: { value: 'Module' } });
|
|
15
|
+
if (e) {
|
|
16
|
+
for (const k in e) {
|
|
17
|
+
if (k !== 'default') {
|
|
18
|
+
const d = Object.getOwnPropertyDescriptor(e, k);
|
|
19
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
20
|
+
enumerable: true,
|
|
21
|
+
get: () => e[k]
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
n.default = e;
|
|
27
|
+
return Object.freeze(n);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
|
|
31
|
+
|
|
32
|
+
const ToggleButton = React__namespace.forwardRef(
|
|
33
|
+
({ variant = "brandSolid", size = "small", loading = false, className, ...otherProps }, ref) => {
|
|
34
|
+
const recipeClassName = toggleButton.toggleButton({ variant, size });
|
|
35
|
+
const api = usePendingButton.usePendingButton({ loading, disabled: otherProps.disabled });
|
|
36
|
+
return /* @__PURE__ */ jsxRuntime.jsx(usePendingButton.PendingButtonProvider, { value: api, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
37
|
+
reactToggle.Toggle.Root,
|
|
38
|
+
{
|
|
39
|
+
ref,
|
|
40
|
+
className: clsx(recipeClassName, className),
|
|
41
|
+
...api.stateProps,
|
|
42
|
+
...otherProps
|
|
43
|
+
}
|
|
44
|
+
) });
|
|
45
|
+
}
|
|
46
|
+
);
|
|
31
47
|
ToggleButton.displayName = "ToggleButton";
|
|
32
|
-
|
|
48
|
+
|
|
33
49
|
exports.ToggleButton = ToggleButton;
|