@seed-design/react 0.2.2 → 0.2.3
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/Checkbox/Checkbox.cjs +29 -8
- package/lib/components/Checkbox/Checkbox.d.ts +11 -4
- package/lib/components/Checkbox/Checkbox.d.ts.map +1 -1
- package/lib/components/Checkbox/Checkbox.js +29 -8
- package/lib/components/Divider/Divider.cjs +23 -23
- package/lib/components/Divider/Divider.d.ts +2 -3
- package/lib/components/Divider/Divider.d.ts.map +1 -1
- package/lib/components/Divider/Divider.js +23 -23
- package/lib/components/LinkContent/LinkContent.d.ts +6 -0
- package/lib/components/LinkContent/LinkContent.d.ts.map +1 -1
- package/lib/components/List/List.cjs +57 -0
- package/lib/components/List/List.d.ts +27 -0
- package/lib/components/List/List.d.ts.map +1 -0
- package/lib/components/List/List.js +47 -0
- package/lib/components/List/List.namespace.cjs +15 -0
- package/lib/components/List/List.namespace.d.ts +2 -0
- package/lib/components/List/List.namespace.d.ts.map +1 -0
- package/lib/components/List/List.namespace.js +1 -0
- package/lib/components/List/index.cjs +17 -0
- package/lib/components/List/index.d.ts +3 -0
- package/lib/components/List/index.d.ts.map +1 -0
- package/lib/components/List/index.js +3 -0
- package/lib/components/RadioGroup/RadioGroup.cjs +79 -0
- package/lib/components/RadioGroup/RadioGroup.d.ts +34 -0
- package/lib/components/RadioGroup/RadioGroup.d.ts.map +1 -0
- package/lib/components/RadioGroup/RadioGroup.js +70 -0
- package/lib/components/RadioGroup/RadioGroup.namespace.cjs +14 -0
- package/lib/components/RadioGroup/RadioGroup.namespace.d.ts +2 -0
- package/lib/components/RadioGroup/RadioGroup.namespace.d.ts.map +1 -0
- package/lib/components/RadioGroup/RadioGroup.namespace.js +1 -0
- package/lib/components/RadioGroup/index.cjs +16 -0
- package/lib/components/RadioGroup/index.d.ts +3 -0
- package/lib/components/RadioGroup/index.d.ts.map +1 -0
- package/lib/components/RadioGroup/index.js +3 -0
- package/lib/components/SelectBox/CheckSelectBox.cjs +0 -13
- package/lib/components/SelectBox/CheckSelectBox.d.ts +0 -10
- package/lib/components/SelectBox/CheckSelectBox.d.ts.map +1 -1
- package/lib/components/SelectBox/CheckSelectBox.js +1 -11
- package/lib/components/SelectBox/CheckSelectBox.namespace.cjs +0 -3
- package/lib/components/SelectBox/CheckSelectBox.namespace.d.ts +1 -1
- package/lib/components/SelectBox/CheckSelectBox.namespace.d.ts.map +1 -1
- package/lib/components/SelectBox/CheckSelectBox.namespace.js +1 -1
- package/lib/components/SelectBox/RadioSelectBox.cjs +0 -13
- package/lib/components/SelectBox/RadioSelectBox.d.ts +0 -10
- package/lib/components/SelectBox/RadioSelectBox.d.ts.map +1 -1
- package/lib/components/SelectBox/RadioSelectBox.js +1 -11
- package/lib/components/SelectBox/RadioSelectBox.namespace.cjs +0 -3
- package/lib/components/SelectBox/RadioSelectBox.namespace.d.ts +1 -1
- package/lib/components/SelectBox/RadioSelectBox.namespace.d.ts.map +1 -1
- package/lib/components/SelectBox/RadioSelectBox.namespace.js +1 -1
- package/lib/components/SelectBox/index.cjs +0 -6
- package/lib/components/SelectBox/index.d.ts +2 -2
- package/lib/components/SelectBox/index.d.ts.map +1 -1
- package/lib/components/SelectBox/index.js +2 -2
- package/lib/components/index.cjs +23 -10
- package/lib/components/index.d.ts +3 -1
- package/lib/components/index.d.ts.map +1 -1
- package/lib/components/index.js +10 -4
- package/lib/index.cjs +23 -10
- package/lib/index.js +10 -4
- package/package.json +3 -3
- package/src/components/Checkbox/Checkbox.tsx +46 -11
- package/src/components/Divider/Divider.tsx +35 -34
- package/src/components/LinkContent/LinkContent.tsx +6 -0
- package/src/components/List/List.namespace.ts +16 -0
- package/src/components/List/List.tsx +79 -0
- package/src/components/List/index.ts +18 -0
- package/src/components/RadioGroup/RadioGroup.namespace.ts +14 -0
- package/src/components/RadioGroup/RadioGroup.tsx +130 -0
- package/src/components/RadioGroup/index.ts +16 -0
- package/src/components/SelectBox/CheckSelectBox.namespace.ts +0 -6
- package/src/components/SelectBox/CheckSelectBox.tsx +0 -19
- package/src/components/SelectBox/RadioSelectBox.namespace.ts +0 -6
- package/src/components/SelectBox/RadioSelectBox.tsx +0 -19
- package/src/components/SelectBox/index.ts +0 -12
- package/src/components/index.ts +3 -1
package/lib/index.cjs
CHANGED
|
@@ -33,10 +33,10 @@ const ExtendedActionSheet = require('./components/ExtendedActionSheet/ExtendedAc
|
|
|
33
33
|
const ExtendedActionSheet_namespace = require('./components/ExtendedActionSheet/ExtendedActionSheet.namespace.cjs');
|
|
34
34
|
const ExtendedFab = require('./components/ExtendedFab/ExtendedFab.cjs');
|
|
35
35
|
const Fab = require('./components/Fab/Fab.cjs');
|
|
36
|
-
const FloatingActionButton = require('./components/FloatingActionButton/FloatingActionButton.cjs');
|
|
37
|
-
const FloatingActionButton_namespace = require('./components/FloatingActionButton/FloatingActionButton.namespace.cjs');
|
|
38
36
|
const Flex = require('./components/Flex/Flex.cjs');
|
|
39
37
|
const Float = require('./components/Float/Float.cjs');
|
|
38
|
+
const FloatingActionButton = require('./components/FloatingActionButton/FloatingActionButton.cjs');
|
|
39
|
+
const FloatingActionButton_namespace = require('./components/FloatingActionButton/FloatingActionButton.namespace.cjs');
|
|
40
40
|
const HelpBubble = require('./components/HelpBubble/HelpBubble.cjs');
|
|
41
41
|
const HelpBubble_namespace = require('./components/HelpBubble/HelpBubble.namespace.cjs');
|
|
42
42
|
const Icon = require('./components/Icon/Icon.cjs');
|
|
@@ -46,6 +46,8 @@ const Inline = require('./components/Inline/Inline.cjs');
|
|
|
46
46
|
const InlineBanner = require('./components/InlineBanner/InlineBanner.cjs');
|
|
47
47
|
const InlineBanner_namespace = require('./components/InlineBanner/InlineBanner.namespace.cjs');
|
|
48
48
|
const LinkContent = require('./components/LinkContent/LinkContent.cjs');
|
|
49
|
+
const List = require('./components/List/List.cjs');
|
|
50
|
+
const List_namespace = require('./components/List/List.namespace.cjs');
|
|
49
51
|
const LoadingIndicator = require('./components/LoadingIndicator/LoadingIndicator.cjs');
|
|
50
52
|
const MannerTemp = require('./components/MannerTemp/MannerTemp.cjs');
|
|
51
53
|
const MannerTempEmote = require('./components/MannerTemp/MannerTempEmote.cjs');
|
|
@@ -60,6 +62,8 @@ const ProgressCircle = require('./components/ProgressCircle/ProgressCircle.cjs')
|
|
|
60
62
|
const ProgressCircle_namespace = require('./components/ProgressCircle/ProgressCircle.namespace.cjs');
|
|
61
63
|
const PullToRefresh = require('./components/PullToRefresh/PullToRefresh.cjs');
|
|
62
64
|
const PullToRefresh_namespace = require('./components/PullToRefresh/PullToRefresh.namespace.cjs');
|
|
65
|
+
const RadioGroup = require('./components/RadioGroup/RadioGroup.cjs');
|
|
66
|
+
const RadioGroup_namespace = require('./components/RadioGroup/RadioGroup.namespace.cjs');
|
|
63
67
|
const ReactionButton = require('./components/ReactionButton/ReactionButton.cjs');
|
|
64
68
|
const ResponsivePair = require('./components/ResponsivePair/ResponsivePair.cjs');
|
|
65
69
|
const SegmentedControl = require('./components/SegmentedControl/SegmentedControl.cjs');
|
|
@@ -181,12 +185,12 @@ exports.ExtendedActionSheetTrigger = ExtendedActionSheet.ExtendedActionSheetTrig
|
|
|
181
185
|
exports.ExtendedActionSheet = ExtendedActionSheet_namespace;
|
|
182
186
|
exports.ExtendedFab = ExtendedFab.ExtendedFab;
|
|
183
187
|
exports.Fab = Fab.Fab;
|
|
188
|
+
exports.Flex = Flex.Flex;
|
|
189
|
+
exports.Float = Float.Float;
|
|
184
190
|
exports.FloatingActionButtonIcon = FloatingActionButton.FloatingActionButtonIcon;
|
|
185
191
|
exports.FloatingActionButtonLabel = FloatingActionButton.FloatingActionButtonLabel;
|
|
186
192
|
exports.FloatingActionButtonRoot = FloatingActionButton.FloatingActionButtonRoot;
|
|
187
193
|
exports.FloatingActionButton = FloatingActionButton_namespace;
|
|
188
|
-
exports.Flex = Flex.Flex;
|
|
189
|
-
exports.Float = Float.Float;
|
|
190
194
|
exports.HelpBubbleAnchor = HelpBubble.HelpBubbleAnchor;
|
|
191
195
|
exports.HelpBubbleArrow = HelpBubble.HelpBubbleArrow;
|
|
192
196
|
exports.HelpBubbleArrowTip = HelpBubble.HelpBubbleArrowTip;
|
|
@@ -213,6 +217,14 @@ exports.InlineBannerRoot = InlineBanner.InlineBannerRoot;
|
|
|
213
217
|
exports.InlineBannerTitle = InlineBanner.InlineBannerTitle;
|
|
214
218
|
exports.InlineBanner = InlineBanner_namespace;
|
|
215
219
|
exports.LinkContent = LinkContent.LinkContent;
|
|
220
|
+
exports.ListContent = List.ListContent;
|
|
221
|
+
exports.ListDetail = List.ListDetail;
|
|
222
|
+
exports.ListItem = List.ListItem;
|
|
223
|
+
exports.ListPrefix = List.ListPrefix;
|
|
224
|
+
exports.ListRoot = List.ListRoot;
|
|
225
|
+
exports.ListSuffix = List.ListSuffix;
|
|
226
|
+
exports.ListTitle = List.ListTitle;
|
|
227
|
+
exports.List = List_namespace;
|
|
216
228
|
exports.LoadingIndicator = LoadingIndicator.LoadingIndicator;
|
|
217
229
|
exports.MannerTemp = MannerTemp.MannerTemp;
|
|
218
230
|
exports.MannerTempEmote = MannerTempEmote.MannerTempEmote;
|
|
@@ -251,6 +263,13 @@ exports.PullToRefreshContent = PullToRefresh.PullToRefreshContent;
|
|
|
251
263
|
exports.PullToRefreshIndicator = PullToRefresh.PullToRefreshIndicator;
|
|
252
264
|
exports.PullToRefreshRoot = PullToRefresh.PullToRefreshRoot;
|
|
253
265
|
exports.PullToRefresh = PullToRefresh_namespace;
|
|
266
|
+
exports.RadioGroupItem = RadioGroup.RadioGroupItem;
|
|
267
|
+
exports.RadioGroupItemControl = RadioGroup.RadioGroupItemControl;
|
|
268
|
+
exports.RadioGroupItemHiddenInput = RadioGroup.RadioGroupItemHiddenInput;
|
|
269
|
+
exports.RadioGroupItemIndicator = RadioGroup.RadioGroupItemIndicator;
|
|
270
|
+
exports.RadioGroupItemLabel = RadioGroup.RadioGroupItemLabel;
|
|
271
|
+
exports.RadioGroupRoot = RadioGroup.RadioGroupRoot;
|
|
272
|
+
exports.RadioGroup = RadioGroup_namespace;
|
|
254
273
|
exports.ReactionButton = ReactionButton.ReactionButton;
|
|
255
274
|
exports.ResponsivePair = ResponsivePair.ResponsivePair;
|
|
256
275
|
exports.SegmentedControlIndicator = SegmentedControl.SegmentedControlIndicator;
|
|
@@ -259,18 +278,12 @@ exports.SegmentedControlItemHiddenInput = SegmentedControl.SegmentedControlItemH
|
|
|
259
278
|
exports.SegmentedControlRoot = SegmentedControl.SegmentedControlRoot;
|
|
260
279
|
exports.SegmentedControl = SegmentedControl_namespace;
|
|
261
280
|
exports.CheckSelectBoxContent = CheckSelectBox.CheckSelectBoxContent;
|
|
262
|
-
exports.CheckSelectBoxControl = CheckSelectBox.CheckSelectBoxControl;
|
|
263
281
|
exports.CheckSelectBoxDescription = CheckSelectBox.CheckSelectBoxDescription;
|
|
264
282
|
exports.CheckSelectBoxGroup = CheckSelectBox.CheckSelectBoxGroup;
|
|
265
|
-
exports.CheckSelectBoxHiddenInput = CheckSelectBox.CheckSelectBoxHiddenInput;
|
|
266
|
-
exports.CheckSelectBoxIcon = CheckSelectBox.CheckSelectBoxIcon;
|
|
267
283
|
exports.CheckSelectBoxLabel = CheckSelectBox.CheckSelectBoxLabel;
|
|
268
284
|
exports.CheckSelectBoxRoot = CheckSelectBox.CheckSelectBoxRoot;
|
|
269
285
|
exports.RadioSelectBoxContent = RadioSelectBox.RadioSelectBoxContent;
|
|
270
|
-
exports.RadioSelectBoxControl = RadioSelectBox.RadioSelectBoxControl;
|
|
271
286
|
exports.RadioSelectBoxDescription = RadioSelectBox.RadioSelectBoxDescription;
|
|
272
|
-
exports.RadioSelectBoxHiddenInput = RadioSelectBox.RadioSelectBoxHiddenInput;
|
|
273
|
-
exports.RadioSelectBoxIcon = RadioSelectBox.RadioSelectBoxIcon;
|
|
274
287
|
exports.RadioSelectBoxItem = RadioSelectBox.RadioSelectBoxItem;
|
|
275
288
|
exports.RadioSelectBoxLabel = RadioSelectBox.RadioSelectBoxLabel;
|
|
276
289
|
exports.RadioSelectBoxRoot = RadioSelectBox.RadioSelectBoxRoot;
|
package/lib/index.js
CHANGED
|
@@ -38,11 +38,11 @@ import * as ExtendedActionSheet_namespace from './components/ExtendedActionSheet
|
|
|
38
38
|
export { ExtendedActionSheet_namespace as ExtendedActionSheet };
|
|
39
39
|
export { ExtendedFab } from './components/ExtendedFab/ExtendedFab.js';
|
|
40
40
|
export { Fab } from './components/Fab/Fab.js';
|
|
41
|
+
export { Flex } from './components/Flex/Flex.js';
|
|
42
|
+
export { Float } from './components/Float/Float.js';
|
|
41
43
|
export { FloatingActionButtonIcon, FloatingActionButtonLabel, FloatingActionButtonRoot } from './components/FloatingActionButton/FloatingActionButton.js';
|
|
42
44
|
import * as FloatingActionButton_namespace from './components/FloatingActionButton/FloatingActionButton.namespace.js';
|
|
43
45
|
export { FloatingActionButton_namespace as FloatingActionButton };
|
|
44
|
-
export { Flex } from './components/Flex/Flex.js';
|
|
45
|
-
export { Float } from './components/Float/Float.js';
|
|
46
46
|
export { HelpBubbleAnchor, HelpBubbleArrow, HelpBubbleArrowTip, HelpBubbleCloseButton, HelpBubbleContent, HelpBubbleDescription, HelpBubblePositioner, HelpBubbleRoot, HelpBubbleTitle, HelpBubbleTrigger } from './components/HelpBubble/HelpBubble.js';
|
|
47
47
|
import * as HelpBubble_namespace from './components/HelpBubble/HelpBubble.namespace.js';
|
|
48
48
|
export { HelpBubble_namespace as HelpBubble };
|
|
@@ -55,6 +55,9 @@ export { InlineBannerCloseButton, InlineBannerContent, InlineBannerDescription,
|
|
|
55
55
|
import * as InlineBanner_namespace from './components/InlineBanner/InlineBanner.namespace.js';
|
|
56
56
|
export { InlineBanner_namespace as InlineBanner };
|
|
57
57
|
export { LinkContent } from './components/LinkContent/LinkContent.js';
|
|
58
|
+
export { ListContent, ListDetail, ListItem, ListPrefix, ListRoot, ListSuffix, ListTitle } from './components/List/List.js';
|
|
59
|
+
import * as List_namespace from './components/List/List.namespace.js';
|
|
60
|
+
export { List_namespace as List };
|
|
58
61
|
export { LoadingIndicator } from './components/LoadingIndicator/LoadingIndicator.js';
|
|
59
62
|
export { MannerTemp } from './components/MannerTemp/MannerTemp.js';
|
|
60
63
|
export { MannerTempEmote } from './components/MannerTemp/MannerTempEmote.js';
|
|
@@ -73,13 +76,16 @@ export { ProgressCircle_namespace as ProgressCircle };
|
|
|
73
76
|
export { PullToRefreshContent, PullToRefreshIndicator, PullToRefreshRoot } from './components/PullToRefresh/PullToRefresh.js';
|
|
74
77
|
import * as PullToRefresh_namespace from './components/PullToRefresh/PullToRefresh.namespace.js';
|
|
75
78
|
export { PullToRefresh_namespace as PullToRefresh };
|
|
79
|
+
export { RadioGroupItem, RadioGroupItemControl, RadioGroupItemHiddenInput, RadioGroupItemIndicator, RadioGroupItemLabel, RadioGroupRoot } from './components/RadioGroup/RadioGroup.js';
|
|
80
|
+
import * as RadioGroup_namespace from './components/RadioGroup/RadioGroup.namespace.js';
|
|
81
|
+
export { RadioGroup_namespace as RadioGroup };
|
|
76
82
|
export { ReactionButton } from './components/ReactionButton/ReactionButton.js';
|
|
77
83
|
export { ResponsivePair } from './components/ResponsivePair/ResponsivePair.js';
|
|
78
84
|
export { SegmentedControlIndicator, SegmentedControlItem, SegmentedControlItemHiddenInput, SegmentedControlRoot } from './components/SegmentedControl/SegmentedControl.js';
|
|
79
85
|
import * as SegmentedControl_namespace from './components/SegmentedControl/SegmentedControl.namespace.js';
|
|
80
86
|
export { SegmentedControl_namespace as SegmentedControl };
|
|
81
|
-
export { CheckSelectBoxContent,
|
|
82
|
-
export { RadioSelectBoxContent,
|
|
87
|
+
export { CheckSelectBoxContent, CheckSelectBoxDescription, CheckSelectBoxGroup, CheckSelectBoxLabel, CheckSelectBoxRoot } from './components/SelectBox/CheckSelectBox.js';
|
|
88
|
+
export { RadioSelectBoxContent, RadioSelectBoxDescription, RadioSelectBoxItem, RadioSelectBoxLabel, RadioSelectBoxRoot } from './components/SelectBox/RadioSelectBox.js';
|
|
83
89
|
import * as CheckSelectBox_namespace from './components/SelectBox/CheckSelectBox.namespace.js';
|
|
84
90
|
export { CheckSelectBox_namespace as CheckSelectBox };
|
|
85
91
|
import * as RadioSelectBox_namespace from './components/SelectBox/RadioSelectBox.namespace.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@seed-design/react",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.3",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/daangn/seed-design.git",
|
|
@@ -58,12 +58,12 @@
|
|
|
58
58
|
"clsx": "^2.1.1"
|
|
59
59
|
},
|
|
60
60
|
"peerDependencies": {
|
|
61
|
-
"@seed-design/css": "0.2.
|
|
61
|
+
"@seed-design/css": "0.2.3",
|
|
62
62
|
"react": ">=18.0.0",
|
|
63
63
|
"react-dom": ">=18.0.0"
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
66
|
-
"@seed-design/css": "0.2.
|
|
66
|
+
"@seed-design/css": "0.2.3",
|
|
67
67
|
"@vitejs/plugin-react": "^5.0.0",
|
|
68
68
|
"ajv": "^8.17.1",
|
|
69
69
|
"globby": "^14.1.0",
|
|
@@ -1,31 +1,66 @@
|
|
|
1
|
+
import { checkbox, type CheckboxVariantProps } from "@seed-design/css/recipes/checkbox";
|
|
2
|
+
import { checkmark, type CheckmarkVariantProps } from "@seed-design/css/recipes/checkmark";
|
|
1
3
|
import { mergeProps } from "@seed-design/dom-utils";
|
|
2
4
|
import { Checkbox as CheckboxPrimitive, useCheckboxContext } from "@seed-design/react-checkbox";
|
|
3
5
|
import { Primitive, type PrimitiveProps } from "@seed-design/react-primitive";
|
|
4
|
-
import
|
|
6
|
+
import clsx from "clsx";
|
|
5
7
|
import { forwardRef } from "react";
|
|
6
8
|
import { createSlotRecipeContext } from "../../utils/createSlotRecipeContext";
|
|
7
9
|
import { createWithStateProps } from "../../utils/createWithStateProps";
|
|
8
10
|
import { InternalIcon } from "../private/Icon";
|
|
9
11
|
|
|
10
|
-
const {
|
|
12
|
+
const { ClassNamesProvider, withContext } = createSlotRecipeContext(checkbox);
|
|
13
|
+
const {
|
|
14
|
+
withProvider: withCheckmarkProvider,
|
|
15
|
+
useClassNames: useCheckmarkClassNames,
|
|
16
|
+
PropsProvider: CheckmarkPropsProvider,
|
|
17
|
+
} = createSlotRecipeContext(checkmark);
|
|
11
18
|
const withStateProps = createWithStateProps([useCheckboxContext]);
|
|
12
19
|
|
|
13
20
|
////////////////////////////////////////////////////////////////////////////////////
|
|
14
21
|
|
|
15
|
-
export interface CheckboxRootProps
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
22
|
+
export interface CheckboxRootProps
|
|
23
|
+
extends CheckboxVariantProps,
|
|
24
|
+
CheckmarkVariantProps,
|
|
25
|
+
CheckboxPrimitive.RootProps {}
|
|
26
|
+
|
|
27
|
+
export const CheckboxRoot = Object.assign(
|
|
28
|
+
forwardRef<HTMLLabelElement, CheckboxRootProps>(({ className, ...props }, ref) => {
|
|
29
|
+
const [checkboxVariantProps, otherProps] = checkbox.splitVariantProps(props);
|
|
30
|
+
const [checkmarkVariantProps] = checkmark.splitVariantProps(props);
|
|
31
|
+
const classNames = checkbox(checkboxVariantProps);
|
|
32
|
+
|
|
33
|
+
return (
|
|
34
|
+
<CheckmarkPropsProvider value={checkmarkVariantProps}>
|
|
35
|
+
<ClassNamesProvider value={classNames}>
|
|
36
|
+
<CheckboxPrimitive.Root
|
|
37
|
+
ref={ref}
|
|
38
|
+
className={clsx(classNames.root, className)}
|
|
39
|
+
{...otherProps}
|
|
40
|
+
/>
|
|
41
|
+
</ClassNamesProvider>
|
|
42
|
+
</CheckmarkPropsProvider>
|
|
43
|
+
);
|
|
44
|
+
}),
|
|
45
|
+
{
|
|
46
|
+
Primitive: CheckboxPrimitive.Root,
|
|
47
|
+
},
|
|
20
48
|
);
|
|
21
49
|
|
|
22
50
|
////////////////////////////////////////////////////////////////////////////////////
|
|
23
51
|
|
|
24
|
-
|
|
52
|
+
/**
|
|
53
|
+
* CheckboxControl combines Checkbox.Primitive with checkmark.root styling
|
|
54
|
+
* This enables standalone usage of Checkbox.Control with variants
|
|
55
|
+
*/
|
|
25
56
|
|
|
26
|
-
export
|
|
57
|
+
export interface CheckboxControlProps
|
|
58
|
+
extends CheckmarkVariantProps,
|
|
59
|
+
CheckboxPrimitive.ControlProps {}
|
|
60
|
+
|
|
61
|
+
export const CheckboxControl = withCheckmarkProvider<HTMLDivElement, CheckboxControlProps>(
|
|
27
62
|
CheckboxPrimitive.Control,
|
|
28
|
-
"
|
|
63
|
+
"root",
|
|
29
64
|
);
|
|
30
65
|
|
|
31
66
|
////////////////////////////////////////////////////////////////////////////////////
|
|
@@ -58,7 +93,7 @@ export const CheckboxIndicator = forwardRef<SVGSVGElement, CheckboxIndicatorProp
|
|
|
58
93
|
ref,
|
|
59
94
|
) => {
|
|
60
95
|
const { stateProps, checked, indeterminate } = useCheckboxContext();
|
|
61
|
-
const classNames =
|
|
96
|
+
const classNames = useCheckmarkClassNames();
|
|
62
97
|
|
|
63
98
|
const mergedProps = mergeProps(
|
|
64
99
|
stateProps,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { Box, type BoxProps } from "../Box/Box";
|
|
3
3
|
|
|
4
|
-
export interface DividerProps {
|
|
4
|
+
export interface DividerProps extends Omit<React.HTMLAttributes<HTMLHRElement>, "color"> {
|
|
5
5
|
/**
|
|
6
6
|
* The HTML element to use for the divider.
|
|
7
7
|
* Keep in mind that "hr" elements are read by screen readers as a semantic break with an implicit role="separator"
|
|
@@ -18,43 +18,44 @@ export interface DividerProps {
|
|
|
18
18
|
/**
|
|
19
19
|
* @default 1
|
|
20
20
|
*/
|
|
21
|
-
thickness?: BoxProps["
|
|
21
|
+
thickness?: BoxProps["borderWidth"];
|
|
22
22
|
|
|
23
23
|
/**
|
|
24
24
|
* @default "horizontal"
|
|
25
25
|
*/
|
|
26
26
|
orientation?: "horizontal" | "vertical";
|
|
27
|
-
|
|
28
|
-
role?: Extract<React.AriaRole, "separator">;
|
|
29
27
|
}
|
|
30
28
|
|
|
31
|
-
export const Divider = React.forwardRef<HTMLHRElement, DividerProps>(
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
29
|
+
export const Divider = React.forwardRef<HTMLHRElement, DividerProps>(
|
|
30
|
+
(
|
|
31
|
+
{
|
|
32
|
+
as = "hr",
|
|
33
|
+
color = "stroke.neutralMuted",
|
|
34
|
+
thickness = 1,
|
|
35
|
+
orientation = "horizontal",
|
|
36
|
+
...props
|
|
37
|
+
},
|
|
38
|
+
ref,
|
|
39
|
+
) => {
|
|
40
|
+
return (
|
|
41
|
+
<Box
|
|
42
|
+
ref={ref}
|
|
43
|
+
as={as}
|
|
44
|
+
// if hr, aria-orientation=horizontal is implied if not specified
|
|
45
|
+
{...(((as === "hr" &&
|
|
46
|
+
orientation !== "horizontal" &&
|
|
47
|
+
(props.role === undefined || props.role === "separator")) ||
|
|
48
|
+
// if not hr but role is separator aria-orientation is needed
|
|
49
|
+
(as !== "hr" && props.role === "separator")) && {
|
|
50
|
+
"aria-orientation": orientation,
|
|
51
|
+
})}
|
|
52
|
+
display="block"
|
|
53
|
+
borderColor={color}
|
|
54
|
+
borderWidth={0}
|
|
55
|
+
{...(orientation === "vertical" && { borderRightWidth: thickness })}
|
|
56
|
+
{...(orientation === "horizontal" && { borderBottomWidth: thickness })}
|
|
57
|
+
{...props}
|
|
58
|
+
/>
|
|
59
|
+
);
|
|
60
|
+
},
|
|
61
|
+
);
|
|
@@ -6,12 +6,18 @@ import { withStyleProps, type StyleProps } from "../../utils/styled";
|
|
|
6
6
|
|
|
7
7
|
const { withContext } = createRecipeContext(linkContent);
|
|
8
8
|
|
|
9
|
+
/**
|
|
10
|
+
* @deprecated Use `ActionButton` with variant="ghost" instead.
|
|
11
|
+
*/
|
|
9
12
|
export interface LinkContentProps
|
|
10
13
|
extends LinkContentVariantProps,
|
|
11
14
|
PrimitiveProps,
|
|
12
15
|
Pick<StyleProps, "color">,
|
|
13
16
|
Omit<React.HTMLAttributes<HTMLSpanElement>, "color"> {}
|
|
14
17
|
|
|
18
|
+
/**
|
|
19
|
+
* @deprecated Use `ActionButton` with variant="ghost" instead.
|
|
20
|
+
*/
|
|
15
21
|
export const LinkContent = withContext<HTMLButtonElement, LinkContentProps>(
|
|
16
22
|
withStyleProps(Primitive.span),
|
|
17
23
|
);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export {
|
|
2
|
+
ListContent as Content,
|
|
3
|
+
ListDetail as Detail,
|
|
4
|
+
ListItem as Item,
|
|
5
|
+
ListPrefix as Prefix,
|
|
6
|
+
ListRoot as Root,
|
|
7
|
+
ListSuffix as Suffix,
|
|
8
|
+
ListTitle as Title,
|
|
9
|
+
type ListContentProps as ContentProps,
|
|
10
|
+
type ListDetailProps as DetailProps,
|
|
11
|
+
type ListItemProps as ItemProps,
|
|
12
|
+
type ListPrefixProps as PrefixProps,
|
|
13
|
+
type ListRootProps as RootProps,
|
|
14
|
+
type ListSuffixProps as SuffixProps,
|
|
15
|
+
type ListTitleProps as TitleProps,
|
|
16
|
+
} from "./List";
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import type * as React from "react";
|
|
2
|
+
|
|
3
|
+
import { listItem, type ListItemVariantProps } from "@seed-design/css/recipes/list-item";
|
|
4
|
+
import { Primitive, type PrimitiveProps } from "@seed-design/react-primitive";
|
|
5
|
+
import { forwardRef } from "react";
|
|
6
|
+
import { createSlotRecipeContext } from "../../utils/createSlotRecipeContext";
|
|
7
|
+
import { withStyleProps, type StyleProps } from "../../utils/styled";
|
|
8
|
+
import { VStack, type VStackProps } from "../Stack";
|
|
9
|
+
import { useCheckboxContext } from "@seed-design/react-checkbox";
|
|
10
|
+
import { createWithStateProps } from "../../utils/createWithStateProps";
|
|
11
|
+
import { useRadioGroupItemContext } from "@seed-design/react-radio-group";
|
|
12
|
+
|
|
13
|
+
const { withContext, withProvider } = createSlotRecipeContext(listItem);
|
|
14
|
+
const withStateProps = createWithStateProps([useCheckboxContext, useRadioGroupItemContext], {
|
|
15
|
+
strict: false,
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
export interface ListRootProps extends VStackProps {}
|
|
19
|
+
|
|
20
|
+
export const ListRoot = forwardRef<HTMLUListElement, ListRootProps>(
|
|
21
|
+
({ as = "ul", ...props }, ref) => {
|
|
22
|
+
return <VStack as={as} ref={ref as React.ForwardedRef<HTMLDivElement>} {...props} />;
|
|
23
|
+
},
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
export interface ListItemProps
|
|
27
|
+
extends PrimitiveProps,
|
|
28
|
+
Pick<StyleProps, "alignItems">,
|
|
29
|
+
React.HTMLAttributes<HTMLLIElement>,
|
|
30
|
+
ListItemVariantProps {}
|
|
31
|
+
|
|
32
|
+
export const ListItem = withProvider<HTMLLIElement, ListItemProps>(
|
|
33
|
+
withStateProps(withStyleProps(Primitive.li)),
|
|
34
|
+
"root",
|
|
35
|
+
);
|
|
36
|
+
|
|
37
|
+
export interface ListContentProps
|
|
38
|
+
extends PrimitiveProps,
|
|
39
|
+
Pick<StyleProps, "gap" | "pr" | "paddingRight">,
|
|
40
|
+
React.HTMLAttributes<HTMLDivElement> {}
|
|
41
|
+
|
|
42
|
+
export const ListContent = withContext<HTMLDivElement, ListContentProps>(
|
|
43
|
+
withStateProps(withStyleProps(Primitive.div)),
|
|
44
|
+
"content",
|
|
45
|
+
);
|
|
46
|
+
|
|
47
|
+
export interface ListPrefixProps
|
|
48
|
+
extends PrimitiveProps,
|
|
49
|
+
Pick<StyleProps, "pr" | "paddingRight">,
|
|
50
|
+
React.HTMLAttributes<HTMLDivElement> {}
|
|
51
|
+
|
|
52
|
+
export const ListPrefix = withContext<HTMLDivElement, ListPrefixProps>(
|
|
53
|
+
withStateProps(withStyleProps(Primitive.div)),
|
|
54
|
+
"prefix",
|
|
55
|
+
);
|
|
56
|
+
|
|
57
|
+
export interface ListSuffixProps
|
|
58
|
+
extends PrimitiveProps,
|
|
59
|
+
Pick<StyleProps, "gap" | "position">,
|
|
60
|
+
React.HTMLAttributes<HTMLDivElement> {}
|
|
61
|
+
|
|
62
|
+
export const ListSuffix = withContext<HTMLDivElement, ListSuffixProps>(
|
|
63
|
+
withStateProps(withStyleProps(Primitive.div)),
|
|
64
|
+
"suffix",
|
|
65
|
+
);
|
|
66
|
+
|
|
67
|
+
export interface ListTitleProps extends PrimitiveProps, React.HTMLAttributes<HTMLDivElement> {}
|
|
68
|
+
|
|
69
|
+
export const ListTitle = withContext<HTMLDivElement, ListTitleProps>(
|
|
70
|
+
withStateProps(Primitive.div),
|
|
71
|
+
"title",
|
|
72
|
+
);
|
|
73
|
+
|
|
74
|
+
export interface ListDetailProps extends PrimitiveProps, React.HTMLAttributes<HTMLDivElement> {}
|
|
75
|
+
|
|
76
|
+
export const ListDetail = withContext<HTMLDivElement, ListDetailProps>(
|
|
77
|
+
withStateProps(Primitive.div),
|
|
78
|
+
"detail",
|
|
79
|
+
);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export {
|
|
2
|
+
ListContent,
|
|
3
|
+
ListDetail,
|
|
4
|
+
ListItem,
|
|
5
|
+
ListPrefix,
|
|
6
|
+
ListRoot,
|
|
7
|
+
ListSuffix,
|
|
8
|
+
ListTitle,
|
|
9
|
+
type ListContentProps,
|
|
10
|
+
type ListDetailProps,
|
|
11
|
+
type ListItemProps,
|
|
12
|
+
type ListPrefixProps,
|
|
13
|
+
type ListRootProps,
|
|
14
|
+
type ListSuffixProps,
|
|
15
|
+
type ListTitleProps,
|
|
16
|
+
} from "./List";
|
|
17
|
+
|
|
18
|
+
export * as List from "./List.namespace";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export {
|
|
2
|
+
RadioGroupRoot as Root,
|
|
3
|
+
RadioGroupItem as Item,
|
|
4
|
+
RadioGroupItemLabel as ItemLabel,
|
|
5
|
+
RadioGroupItemControl as ItemControl,
|
|
6
|
+
RadioGroupItemIndicator as ItemIndicator,
|
|
7
|
+
RadioGroupItemHiddenInput as ItemHiddenInput,
|
|
8
|
+
type RadioGroupRootProps as RootProps,
|
|
9
|
+
type RadioGroupItemProps as ItemProps,
|
|
10
|
+
type RadioGroupItemLabelProps as ItemLabelProps,
|
|
11
|
+
type RadioGroupItemControlProps as ItemControlProps,
|
|
12
|
+
type RadioGroupItemIndicatorProps as ItemIndicatorProps,
|
|
13
|
+
type RadioGroupItemHiddenInputProps as ItemHiddenInputProps,
|
|
14
|
+
} from "./RadioGroup";
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { radio, type RadioVariantProps } from "@seed-design/css/recipes/radio";
|
|
2
|
+
import { radiomark, type RadiomarkVariantProps } from "@seed-design/css/recipes/radiomark";
|
|
3
|
+
import { mergeProps } from "@seed-design/dom-utils";
|
|
4
|
+
import {
|
|
5
|
+
RadioGroup as RadioGroupPrimitive,
|
|
6
|
+
useRadioGroupItemContext,
|
|
7
|
+
} from "@seed-design/react-radio-group";
|
|
8
|
+
import { Primitive, type PrimitiveProps } from "@seed-design/react-primitive";
|
|
9
|
+
import clsx from "clsx";
|
|
10
|
+
import { forwardRef } from "react";
|
|
11
|
+
import { createSlotRecipeContext } from "../../utils/createSlotRecipeContext";
|
|
12
|
+
import { createWithStateProps } from "../../utils/createWithStateProps";
|
|
13
|
+
import { InternalIcon } from "../private/Icon";
|
|
14
|
+
|
|
15
|
+
const { ClassNamesProvider, withContext } = createSlotRecipeContext(radio);
|
|
16
|
+
const {
|
|
17
|
+
withProvider: withRadiomarkProvider,
|
|
18
|
+
useClassNames: useRadiomarkClassNames,
|
|
19
|
+
PropsProvider: RadiomarkPropsProvider,
|
|
20
|
+
} = createSlotRecipeContext(radiomark);
|
|
21
|
+
const withStateProps = createWithStateProps([useRadioGroupItemContext]);
|
|
22
|
+
|
|
23
|
+
////////////////////////////////////////////////////////////////////////////////////
|
|
24
|
+
|
|
25
|
+
export interface RadioGroupRootProps extends RadioGroupPrimitive.RootProps {}
|
|
26
|
+
|
|
27
|
+
export const RadioGroupRoot = RadioGroupPrimitive.Root;
|
|
28
|
+
|
|
29
|
+
////////////////////////////////////////////////////////////////////////////////////
|
|
30
|
+
|
|
31
|
+
export interface RadioGroupItemProps
|
|
32
|
+
extends RadioVariantProps,
|
|
33
|
+
RadiomarkVariantProps,
|
|
34
|
+
RadioGroupPrimitive.ItemProps {}
|
|
35
|
+
|
|
36
|
+
export const RadioGroupItem = Object.assign(
|
|
37
|
+
forwardRef<HTMLLabelElement, RadioGroupItemProps>(({ className, ...props }, ref) => {
|
|
38
|
+
const [radioVariantProps, otherProps] = radio.splitVariantProps(props);
|
|
39
|
+
const [radiomarkVariantProps] = radiomark.splitVariantProps(props);
|
|
40
|
+
const classNames = radio(radioVariantProps);
|
|
41
|
+
|
|
42
|
+
return (
|
|
43
|
+
<RadiomarkPropsProvider value={radiomarkVariantProps}>
|
|
44
|
+
<ClassNamesProvider value={classNames}>
|
|
45
|
+
<RadioGroupPrimitive.Item
|
|
46
|
+
ref={ref}
|
|
47
|
+
className={clsx(classNames.root, className)}
|
|
48
|
+
{...otherProps}
|
|
49
|
+
/>
|
|
50
|
+
</ClassNamesProvider>
|
|
51
|
+
</RadiomarkPropsProvider>
|
|
52
|
+
);
|
|
53
|
+
}),
|
|
54
|
+
{
|
|
55
|
+
Primitive: RadioGroupPrimitive.Item,
|
|
56
|
+
},
|
|
57
|
+
);
|
|
58
|
+
|
|
59
|
+
////////////////////////////////////////////////////////////////////////////////////
|
|
60
|
+
|
|
61
|
+
export interface RadioGroupItemLabelProps
|
|
62
|
+
extends PrimitiveProps,
|
|
63
|
+
React.HTMLAttributes<HTMLSpanElement> {}
|
|
64
|
+
|
|
65
|
+
export const RadioGroupItemLabel = withContext<HTMLSpanElement, RadioGroupItemLabelProps>(
|
|
66
|
+
withStateProps(Primitive.span),
|
|
67
|
+
"label",
|
|
68
|
+
);
|
|
69
|
+
|
|
70
|
+
////////////////////////////////////////////////////////////////////////////////////
|
|
71
|
+
|
|
72
|
+
export interface RadioGroupItemControlProps
|
|
73
|
+
extends RadiomarkVariantProps,
|
|
74
|
+
RadioGroupPrimitive.ItemControlProps {}
|
|
75
|
+
|
|
76
|
+
export const RadioGroupItemControl = withRadiomarkProvider<
|
|
77
|
+
HTMLDivElement,
|
|
78
|
+
RadioGroupItemControlProps
|
|
79
|
+
>(RadioGroupPrimitive.ItemControl, "root");
|
|
80
|
+
|
|
81
|
+
////////////////////////////////////////////////////////////////////////////////////
|
|
82
|
+
|
|
83
|
+
export interface RadioGroupItemIndicatorProps extends React.SVGAttributes<SVGSVGElement> {
|
|
84
|
+
/**
|
|
85
|
+
* The icon to display when the radio is unchecked.
|
|
86
|
+
*/
|
|
87
|
+
unchecked?: React.ReactNode;
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* The icon to display when the radio is checked.
|
|
91
|
+
*/
|
|
92
|
+
checked?: React.ReactNode;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export const RadioGroupItemIndicator = forwardRef<SVGSVGElement, RadioGroupItemIndicatorProps>(
|
|
96
|
+
({ unchecked: uncheckedSvg, checked: checkedSvg, ...otherProps }, ref) => {
|
|
97
|
+
const { stateProps, checked } = useRadioGroupItemContext();
|
|
98
|
+
const classNames = useRadiomarkClassNames();
|
|
99
|
+
|
|
100
|
+
const mergedProps = mergeProps(
|
|
101
|
+
stateProps,
|
|
102
|
+
{ className: classNames.icon },
|
|
103
|
+
otherProps as React.HTMLAttributes<HTMLElement>,
|
|
104
|
+
);
|
|
105
|
+
|
|
106
|
+
if (checked)
|
|
107
|
+
return (
|
|
108
|
+
<InternalIcon
|
|
109
|
+
ref={ref}
|
|
110
|
+
svg={
|
|
111
|
+
checkedSvg ?? (
|
|
112
|
+
<svg aria-hidden="true" viewBox="0 0 24 24">
|
|
113
|
+
<circle cx="12" cy="12" r="12" fill="currentColor" />
|
|
114
|
+
</svg>
|
|
115
|
+
)
|
|
116
|
+
}
|
|
117
|
+
{...mergedProps}
|
|
118
|
+
/>
|
|
119
|
+
);
|
|
120
|
+
if (uncheckedSvg) return <InternalIcon ref={ref} svg={uncheckedSvg} {...mergedProps} />;
|
|
121
|
+
return null;
|
|
122
|
+
},
|
|
123
|
+
);
|
|
124
|
+
RadioGroupItemIndicator.displayName = "RadioGroupItemIndicator";
|
|
125
|
+
|
|
126
|
+
////////////////////////////////////////////////////////////////////////////////////
|
|
127
|
+
|
|
128
|
+
export interface RadioGroupItemHiddenInputProps extends RadioGroupPrimitive.ItemHiddenInputProps {}
|
|
129
|
+
|
|
130
|
+
export const RadioGroupItemHiddenInput = RadioGroupPrimitive.ItemHiddenInput;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export {
|
|
2
|
+
RadioGroupRoot,
|
|
3
|
+
RadioGroupItem,
|
|
4
|
+
RadioGroupItemLabel,
|
|
5
|
+
RadioGroupItemControl,
|
|
6
|
+
RadioGroupItemIndicator,
|
|
7
|
+
RadioGroupItemHiddenInput,
|
|
8
|
+
type RadioGroupRootProps,
|
|
9
|
+
type RadioGroupItemProps,
|
|
10
|
+
type RadioGroupItemLabelProps,
|
|
11
|
+
type RadioGroupItemControlProps,
|
|
12
|
+
type RadioGroupItemIndicatorProps,
|
|
13
|
+
type RadioGroupItemHiddenInputProps,
|
|
14
|
+
} from "./RadioGroup";
|
|
15
|
+
|
|
16
|
+
export * as RadioGroup from "./RadioGroup.namespace";
|
|
@@ -1,18 +1,12 @@
|
|
|
1
1
|
export {
|
|
2
2
|
CheckSelectBoxContent as Content,
|
|
3
|
-
CheckSelectBoxControl as Control,
|
|
4
3
|
CheckSelectBoxDescription as Description,
|
|
5
4
|
CheckSelectBoxGroup as Group,
|
|
6
|
-
CheckSelectBoxHiddenInput as HiddenInput,
|
|
7
|
-
CheckSelectBoxIcon as Icon,
|
|
8
5
|
CheckSelectBoxLabel as Label,
|
|
9
6
|
CheckSelectBoxRoot as Root,
|
|
10
7
|
type CheckSelectBoxContentProps as ContentProps,
|
|
11
|
-
type CheckSelectBoxControlProps as ControlProps,
|
|
12
8
|
type CheckSelectBoxDescriptionProps as DescriptionProps,
|
|
13
9
|
type CheckSelectBoxGroupProps as GroupProps,
|
|
14
|
-
type CheckSelectBoxHiddenInputProps as HiddenInputProps,
|
|
15
|
-
type CheckSelectBoxIconProps as IconProps,
|
|
16
10
|
type CheckSelectBoxLabelProps as LabelProps,
|
|
17
11
|
type CheckSelectBoxRootProps as RootProps,
|
|
18
12
|
} from "./CheckSelectBox";
|