@seed-design/react 1.1.16 → 1.2.0
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/AspectRatio/AspectRatio.cjs +53 -0
- package/lib/components/AspectRatio/AspectRatio.d.ts +11 -0
- package/lib/components/AspectRatio/AspectRatio.d.ts.map +1 -0
- package/lib/components/AspectRatio/AspectRatio.js +30 -0
- package/lib/components/AspectRatio/index.cjs +9 -0
- package/lib/components/AspectRatio/index.d.ts +2 -0
- package/lib/components/AspectRatio/index.d.ts.map +1 -0
- package/lib/components/AspectRatio/index.js +1 -0
- package/lib/components/Avatar/Avatar.cjs +4 -10
- package/lib/components/Avatar/Avatar.d.ts +4 -4
- package/lib/components/Avatar/Avatar.d.ts.map +1 -1
- package/lib/components/Avatar/Avatar.js +4 -10
- package/lib/components/Checkbox/Checkbox.cjs +10 -0
- package/lib/components/Checkbox/Checkbox.d.ts +4 -0
- package/lib/components/Checkbox/Checkbox.d.ts.map +1 -1
- package/lib/components/Checkbox/Checkbox.js +10 -1
- package/lib/components/Checkbox/Checkbox.namespace.cjs +1 -0
- package/lib/components/Checkbox/Checkbox.namespace.d.ts +1 -1
- package/lib/components/Checkbox/Checkbox.namespace.d.ts.map +1 -1
- package/lib/components/Checkbox/Checkbox.namespace.js +1 -1
- package/lib/components/Checkbox/index.cjs +1 -0
- package/lib/components/Checkbox/index.d.ts +1 -1
- package/lib/components/Checkbox/index.d.ts.map +1 -1
- package/lib/components/Checkbox/index.js +1 -1
- package/lib/components/ChipTabs/ChipTabs.cjs +23 -4
- package/lib/components/ChipTabs/ChipTabs.d.ts.map +1 -1
- package/lib/components/ChipTabs/ChipTabs.js +23 -4
- package/lib/components/Dialog/Dialog.d.ts.map +1 -1
- package/lib/components/Fieldset/Fieldset.cjs +86 -0
- package/lib/components/Fieldset/Fieldset.d.ts +30 -0
- package/lib/components/Fieldset/Fieldset.d.ts.map +1 -0
- package/lib/components/Fieldset/Fieldset.js +75 -0
- package/lib/components/Fieldset/Fieldset.namespace.cjs +16 -0
- package/lib/components/Fieldset/Fieldset.namespace.d.ts +2 -0
- package/lib/components/Fieldset/Fieldset.namespace.d.ts.map +1 -0
- package/lib/components/Fieldset/Fieldset.namespace.js +1 -0
- package/lib/components/Fieldset/index.cjs +18 -0
- package/lib/components/Fieldset/index.d.ts +3 -0
- package/lib/components/Fieldset/index.d.ts.map +1 -0
- package/lib/components/Fieldset/index.js +3 -0
- package/lib/components/Grid/Grid.cjs +56 -0
- package/lib/components/Grid/Grid.d.ts +41 -0
- package/lib/components/Grid/Grid.d.ts.map +1 -0
- package/lib/components/Grid/Grid.js +33 -0
- package/lib/components/Grid/index.cjs +9 -0
- package/lib/components/Grid/index.d.ts +2 -0
- package/lib/components/Grid/index.d.ts.map +1 -0
- package/lib/components/Grid/index.js +1 -0
- package/lib/components/GridItem/GridItem.cjs +45 -0
- package/lib/components/GridItem/GridItem.d.ts +35 -0
- package/lib/components/GridItem/GridItem.d.ts.map +1 -0
- package/lib/components/GridItem/GridItem.js +22 -0
- package/lib/components/GridItem/index.cjs +9 -0
- package/lib/components/GridItem/index.d.ts +2 -0
- package/lib/components/GridItem/index.d.ts.map +1 -0
- package/lib/components/GridItem/index.js +1 -0
- package/lib/components/HelpBubble/HelpBubble.cjs +5 -0
- package/lib/components/HelpBubble/HelpBubble.d.ts +3 -0
- package/lib/components/HelpBubble/HelpBubble.d.ts.map +1 -1
- package/lib/components/HelpBubble/HelpBubble.js +5 -1
- package/lib/components/HelpBubble/HelpBubble.namespace.cjs +1 -0
- package/lib/components/HelpBubble/HelpBubble.namespace.d.ts +1 -1
- package/lib/components/HelpBubble/HelpBubble.namespace.d.ts.map +1 -1
- package/lib/components/HelpBubble/HelpBubble.namespace.js +1 -1
- package/lib/components/HelpBubble/index.cjs +1 -0
- package/lib/components/HelpBubble/index.d.ts +1 -1
- package/lib/components/HelpBubble/index.d.ts.map +1 -1
- package/lib/components/HelpBubble/index.js +1 -1
- package/lib/components/ImageFrame/ImageFrame.cjs +157 -0
- package/lib/components/ImageFrame/ImageFrame.d.ts +51 -0
- package/lib/components/ImageFrame/ImageFrame.d.ts.map +1 -0
- package/lib/components/ImageFrame/ImageFrame.js +129 -0
- package/lib/components/ImageFrame/index.cjs +14 -0
- package/lib/components/ImageFrame/index.d.ts +2 -0
- package/lib/components/ImageFrame/index.d.ts.map +1 -0
- package/lib/components/ImageFrame/index.js +1 -0
- package/lib/components/MenuSheet/MenuSheet.cjs +60 -24
- package/lib/components/MenuSheet/MenuSheet.d.ts +12 -0
- package/lib/components/MenuSheet/MenuSheet.d.ts.map +1 -1
- package/lib/components/MenuSheet/MenuSheet.js +57 -25
- package/lib/components/MenuSheet/MenuSheet.namespace.cjs +4 -0
- package/lib/components/MenuSheet/MenuSheet.namespace.d.ts +1 -1
- package/lib/components/MenuSheet/MenuSheet.namespace.d.ts.map +1 -1
- package/lib/components/MenuSheet/MenuSheet.namespace.js +1 -1
- package/lib/components/MenuSheet/index.cjs +4 -0
- package/lib/components/MenuSheet/index.d.ts +1 -1
- package/lib/components/MenuSheet/index.d.ts.map +1 -1
- package/lib/components/MenuSheet/index.js +1 -1
- package/lib/components/RadioGroup/RadioGroup.cjs +4 -1
- package/lib/components/RadioGroup/RadioGroup.d.ts +3 -2
- package/lib/components/RadioGroup/RadioGroup.d.ts.map +1 -1
- package/lib/components/RadioGroup/RadioGroup.js +4 -1
- package/lib/components/RadioGroupField/RadioGroupField.cjs +79 -0
- package/lib/components/RadioGroupField/RadioGroupField.d.ts +30 -0
- package/lib/components/RadioGroupField/RadioGroupField.d.ts.map +1 -0
- package/lib/components/RadioGroupField/RadioGroupField.js +68 -0
- package/lib/components/RadioGroupField/RadioGroupField.namespace.cjs +16 -0
- package/lib/components/RadioGroupField/RadioGroupField.namespace.d.ts +2 -0
- package/lib/components/RadioGroupField/RadioGroupField.namespace.d.ts.map +1 -0
- package/lib/components/RadioGroupField/RadioGroupField.namespace.js +1 -0
- package/lib/components/RadioGroupField/index.cjs +18 -0
- package/lib/components/RadioGroupField/index.d.ts +3 -0
- package/lib/components/RadioGroupField/index.d.ts.map +1 -0
- package/lib/components/RadioGroupField/index.js +3 -0
- package/lib/components/SelectBox/CheckSelectBox.cjs +117 -8
- package/lib/components/SelectBox/CheckSelectBox.d.ts +38 -10
- package/lib/components/SelectBox/CheckSelectBox.d.ts.map +1 -1
- package/lib/components/SelectBox/CheckSelectBox.js +113 -10
- package/lib/components/SelectBox/CheckSelectBox.namespace.cjs +6 -0
- 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 +112 -9
- package/lib/components/SelectBox/RadioSelectBox.d.ts +31 -7
- package/lib/components/SelectBox/RadioSelectBox.d.ts.map +1 -1
- package/lib/components/SelectBox/RadioSelectBox.js +109 -10
- package/lib/components/SelectBox/RadioSelectBox.namespace.cjs +5 -1
- 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 +11 -1
- 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/Switch/Switch.cjs +10 -5
- package/lib/components/Switch/Switch.d.ts +3 -3
- package/lib/components/Switch/Switch.d.ts.map +1 -1
- package/lib/components/Switch/Switch.js +10 -5
- package/lib/components/TagGroup/TagGroup.cjs +25 -9
- package/lib/components/TagGroup/TagGroup.d.ts +5 -1
- package/lib/components/TagGroup/TagGroup.d.ts.map +1 -1
- package/lib/components/TagGroup/TagGroup.js +25 -10
- package/lib/components/TagGroup/TagGroup.namespace.cjs +1 -0
- package/lib/components/TagGroup/TagGroup.namespace.d.ts +1 -1
- package/lib/components/TagGroup/TagGroup.namespace.d.ts.map +1 -1
- package/lib/components/TagGroup/TagGroup.namespace.js +1 -1
- package/lib/components/TagGroup/index.cjs +1 -0
- package/lib/components/TagGroup/index.d.ts +1 -1
- package/lib/components/TagGroup/index.d.ts.map +1 -1
- package/lib/components/TagGroup/index.js +1 -1
- package/lib/components/index.cjs +53 -1
- package/lib/components/index.d.ts +6 -0
- package/lib/components/index.d.ts.map +1 -1
- package/lib/components/index.js +16 -6
- package/lib/index.cjs +53 -1
- package/lib/index.js +16 -6
- package/lib/utils/styled.cjs +11 -5
- package/lib/utils/styled.d.ts +6 -0
- package/lib/utils/styled.d.ts.map +1 -1
- package/lib/utils/styled.js +11 -5
- package/package.json +6 -3
- package/src/components/AspectRatio/AspectRatio.tsx +38 -0
- package/src/components/AspectRatio/index.ts +1 -0
- package/src/components/Avatar/Avatar.tsx +7 -14
- package/src/components/Checkbox/Checkbox.namespace.ts +2 -0
- package/src/components/Checkbox/Checkbox.tsx +24 -0
- package/src/components/Checkbox/index.ts +2 -0
- package/src/components/ChipTabs/ChipTabs.tsx +25 -4
- package/src/components/Dialog/Dialog.tsx +6 -0
- package/src/components/Fieldset/Fieldset.namespace.ts +17 -0
- package/src/components/Fieldset/Fieldset.tsx +101 -0
- package/src/components/Fieldset/index.ts +19 -0
- package/src/components/Grid/Grid.tsx +79 -0
- package/src/components/Grid/index.ts +1 -0
- package/src/components/GridItem/GridItem.tsx +70 -0
- package/src/components/GridItem/index.ts +1 -0
- package/src/components/HelpBubble/HelpBubble.namespace.ts +3 -0
- package/src/components/HelpBubble/HelpBubble.tsx +7 -2
- package/src/components/HelpBubble/index.ts +2 -0
- package/src/components/ImageFrame/ImageFrame.tsx +227 -0
- package/src/components/ImageFrame/index.ts +14 -0
- package/src/components/MenuSheet/MenuSheet.namespace.ts +8 -0
- package/src/components/MenuSheet/MenuSheet.tsx +82 -34
- package/src/components/MenuSheet/index.ts +8 -0
- package/src/components/RadioGroup/RadioGroup.tsx +8 -2
- package/src/components/RadioGroupField/RadioGroupField.namespace.ts +18 -0
- package/src/components/RadioGroupField/RadioGroupField.tsx +114 -0
- package/src/components/RadioGroupField/index.ts +2 -0
- package/src/components/SelectBox/CheckSelectBox.namespace.ts +12 -0
- package/src/components/SelectBox/CheckSelectBox.tsx +229 -24
- package/src/components/SelectBox/RadioSelectBox.namespace.ts +10 -2
- package/src/components/SelectBox/RadioSelectBox.tsx +210 -16
- package/src/components/SelectBox/index.ts +22 -2
- package/src/components/Switch/Switch.tsx +16 -7
- package/src/components/TagGroup/TagGroup.namespace.ts +2 -0
- package/src/components/TagGroup/TagGroup.tsx +33 -9
- package/src/components/TagGroup/index.ts +2 -0
- package/src/components/index.ts +6 -0
- package/src/utils/styled.tsx +23 -5
|
@@ -1,30 +1,129 @@
|
|
|
1
1
|
'use client';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { composeRefs } from '@radix-ui/react-compose-refs';
|
|
2
4
|
import { selectBox } from '@seed-design/css/recipes/select-box';
|
|
3
5
|
import { selectBoxGroup } from '@seed-design/css/recipes/select-box-group';
|
|
6
|
+
import { useCollapsibleContext, Collapsible, useCollapsible, CollapsibleProvider } from '@seed-design/react-collapsible';
|
|
4
7
|
import { Primitive } from '@seed-design/react-primitive';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
8
|
+
import { useRadioGroupItemContext, RadioGroup } from '@seed-design/react-radio-group';
|
|
9
|
+
import { forwardRef, useContext, createContext, useState, useCallback } from 'react';
|
|
7
10
|
import { createSlotRecipeContext } from '../../utils/createSlotRecipeContext.js';
|
|
8
11
|
import { createWithStateProps } from '../../utils/createWithStateProps.js';
|
|
12
|
+
import clsx from 'clsx';
|
|
9
13
|
|
|
10
|
-
const { withContext
|
|
11
|
-
const { withContext, withProvider } = createSlotRecipeContext(selectBox);
|
|
14
|
+
const { PropsProvider, ClassNamesProvider, withContext, useProps, useClassNames } = createSlotRecipeContext(selectBox);
|
|
12
15
|
const withStateProps = createWithStateProps([useRadioGroupItemContext]);
|
|
13
|
-
const
|
|
14
|
-
|
|
16
|
+
const FooterContext = createContext(null);
|
|
17
|
+
const RadioSelectBoxGroup = forwardRef(
|
|
18
|
+
({ columns = 1, className, style, ...props }, ref) => {
|
|
19
|
+
const [variantProps, otherProps] = selectBoxGroup.splitVariantProps(props);
|
|
20
|
+
const recipeClassName = selectBoxGroup(variantProps);
|
|
21
|
+
const layout = columns === 1 ? "horizontal" : "vertical";
|
|
22
|
+
return /* @__PURE__ */ jsx(PropsProvider, { value: { layout }, children: /* @__PURE__ */ jsx(
|
|
23
|
+
Primitive.div,
|
|
24
|
+
{
|
|
25
|
+
ref,
|
|
26
|
+
"data-columns": columns,
|
|
27
|
+
className: clsx(recipeClassName, className),
|
|
28
|
+
style: {
|
|
29
|
+
...style,
|
|
30
|
+
"--seed-select-box-group--columns": columns
|
|
31
|
+
},
|
|
32
|
+
...otherProps
|
|
33
|
+
}
|
|
34
|
+
) });
|
|
35
|
+
}
|
|
15
36
|
);
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
37
|
+
function FooterVisibilityProvider({
|
|
38
|
+
children,
|
|
39
|
+
footerVisibility
|
|
40
|
+
}) {
|
|
41
|
+
const { checked } = useRadioGroupItemContext();
|
|
42
|
+
const collapsible = useCollapsible({
|
|
43
|
+
open: {
|
|
44
|
+
"when-selected": checked,
|
|
45
|
+
"when-not-selected": !checked
|
|
46
|
+
}[footerVisibility]
|
|
47
|
+
});
|
|
48
|
+
const [isFooterRendered, setIsFooterRendered] = useState(false);
|
|
49
|
+
const footerRef = useCallback((node) => {
|
|
50
|
+
setIsFooterRendered(!!node);
|
|
51
|
+
}, []);
|
|
52
|
+
return /* @__PURE__ */ jsx(CollapsibleProvider, { value: collapsible, children: /* @__PURE__ */ jsx(FooterContext.Provider, { value: { isFooterRendered, footerRef, footerVisibility }, children }) });
|
|
53
|
+
}
|
|
54
|
+
const RadioSelectBoxItem = forwardRef(
|
|
55
|
+
({ footerVisibility = "when-selected", className, children, ...props }, ref) => {
|
|
56
|
+
const [variantProps, otherProps] = selectBox.splitVariantProps(props);
|
|
57
|
+
const classNames = selectBox({
|
|
58
|
+
...useProps(),
|
|
59
|
+
...variantProps
|
|
60
|
+
});
|
|
61
|
+
return /* @__PURE__ */ jsx(ClassNamesProvider, { value: classNames, children: /* @__PURE__ */ jsx(
|
|
62
|
+
RadioGroup.Item,
|
|
63
|
+
{
|
|
64
|
+
ref,
|
|
65
|
+
className: clsx(classNames.root, className),
|
|
66
|
+
...otherProps,
|
|
67
|
+
children: footerVisibility === "always" ? children : /* @__PURE__ */ jsx(FooterVisibilityProvider, { footerVisibility, children })
|
|
68
|
+
}
|
|
69
|
+
) });
|
|
70
|
+
}
|
|
71
|
+
);
|
|
72
|
+
const RadioSelectBoxTrigger = withContext(
|
|
73
|
+
withStateProps(Primitive.div),
|
|
74
|
+
"trigger"
|
|
19
75
|
);
|
|
20
76
|
const RadioSelectBoxContent = withContext(
|
|
21
77
|
withStateProps(Primitive.div),
|
|
22
78
|
"content"
|
|
23
79
|
);
|
|
80
|
+
const RadioSelectBoxBody = withContext(
|
|
81
|
+
withStateProps(Primitive.div),
|
|
82
|
+
"body"
|
|
83
|
+
);
|
|
24
84
|
const RadioSelectBoxLabel = withContext(
|
|
25
85
|
withStateProps(Primitive.div),
|
|
26
86
|
"label"
|
|
27
87
|
);
|
|
28
88
|
const RadioSelectBoxDescription = withContext(withStateProps(Primitive.div), "description");
|
|
89
|
+
const RadioSelectBoxHiddenInput = forwardRef((props, ref) => {
|
|
90
|
+
const collapsibleContext = useCollapsibleContext({ strict: false });
|
|
91
|
+
const footerContext = useContext(FooterContext);
|
|
92
|
+
const triggerAriaProps = footerContext?.isFooterRendered ? collapsibleContext?.triggerAriaProps : void 0;
|
|
93
|
+
return /* @__PURE__ */ jsx(RadioGroup.ItemHiddenInput, { ref, ...triggerAriaProps, ...props });
|
|
94
|
+
});
|
|
95
|
+
RadioSelectBoxHiddenInput.displayName = "RadioSelectBoxHiddenInput";
|
|
96
|
+
const RadioSelectBoxFooter = forwardRef(
|
|
97
|
+
({ className, children, ...props }, ref) => {
|
|
98
|
+
const classNames = useClassNames();
|
|
99
|
+
const { stateProps } = useRadioGroupItemContext();
|
|
100
|
+
const collapsibleContext = useCollapsibleContext({ strict: false });
|
|
101
|
+
const footerContext = useContext(FooterContext);
|
|
102
|
+
const composedRef = composeRefs(ref, footerContext?.footerRef ?? null);
|
|
103
|
+
if (collapsibleContext) {
|
|
104
|
+
return /* @__PURE__ */ jsx(
|
|
105
|
+
Collapsible.Content,
|
|
106
|
+
{
|
|
107
|
+
ref: composedRef,
|
|
108
|
+
className: clsx(classNames.footer, className),
|
|
109
|
+
...stateProps,
|
|
110
|
+
...props,
|
|
111
|
+
children
|
|
112
|
+
}
|
|
113
|
+
);
|
|
114
|
+
}
|
|
115
|
+
return /* @__PURE__ */ jsx(
|
|
116
|
+
Primitive.div,
|
|
117
|
+
{
|
|
118
|
+
ref: composedRef,
|
|
119
|
+
className: clsx(classNames.footer, className),
|
|
120
|
+
...stateProps,
|
|
121
|
+
...props,
|
|
122
|
+
children
|
|
123
|
+
}
|
|
124
|
+
);
|
|
125
|
+
}
|
|
126
|
+
);
|
|
127
|
+
RadioSelectBoxFooter.displayName = "RadioSelectBoxFooter";
|
|
29
128
|
|
|
30
|
-
export { RadioSelectBoxContent, RadioSelectBoxDescription, RadioSelectBoxItem, RadioSelectBoxLabel,
|
|
129
|
+
export { RadioSelectBoxBody, RadioSelectBoxContent, RadioSelectBoxDescription, RadioSelectBoxFooter, RadioSelectBoxGroup, RadioSelectBoxHiddenInput, RadioSelectBoxItem, RadioSelectBoxLabel, RadioSelectBoxTrigger };
|
|
@@ -6,8 +6,12 @@ const RadioSelectBox = require('./RadioSelectBox.cjs');
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
|
+
exports.Body = RadioSelectBox.RadioSelectBoxBody;
|
|
9
10
|
exports.Content = RadioSelectBox.RadioSelectBoxContent;
|
|
10
11
|
exports.Description = RadioSelectBox.RadioSelectBoxDescription;
|
|
12
|
+
exports.Footer = RadioSelectBox.RadioSelectBoxFooter;
|
|
13
|
+
exports.Group = RadioSelectBox.RadioSelectBoxGroup;
|
|
14
|
+
exports.HiddenInput = RadioSelectBox.RadioSelectBoxHiddenInput;
|
|
11
15
|
exports.Item = RadioSelectBox.RadioSelectBoxItem;
|
|
12
16
|
exports.Label = RadioSelectBox.RadioSelectBoxLabel;
|
|
13
|
-
exports.
|
|
17
|
+
exports.Trigger = RadioSelectBox.RadioSelectBoxTrigger;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { RadioSelectBoxContent as Content, RadioSelectBoxDescription as Description, RadioSelectBoxItem as Item, RadioSelectBoxLabel as Label,
|
|
1
|
+
export { RadioSelectBoxBody as Body, RadioSelectBoxContent as Content, RadioSelectBoxDescription as Description, RadioSelectBoxFooter as Footer, RadioSelectBoxGroup as Group, RadioSelectBoxHiddenInput as HiddenInput, RadioSelectBoxItem as Item, RadioSelectBoxLabel as Label, RadioSelectBoxTrigger as Trigger, type RadioSelectBoxBodyProps as BodyProps, type RadioSelectBoxContentProps as ContentProps, type RadioSelectBoxDescriptionProps as DescriptionProps, type RadioSelectBoxFooterProps as FooterProps, type RadioSelectBoxGroupProps as GroupProps, type RadioSelectBoxHiddenInputProps as HiddenInputProps, type RadioSelectBoxItemProps as ItemProps, type RadioSelectBoxLabelProps as LabelProps, type RadioSelectBoxTriggerProps as TriggerProps, } from './RadioSelectBox';
|
|
2
2
|
//# sourceMappingURL=RadioSelectBox.namespace.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioSelectBox.namespace.d.ts","sourceRoot":"","sources":["../../../src/components/SelectBox/RadioSelectBox.namespace.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,IAAI,OAAO,EAChC,yBAAyB,IAAI,WAAW,EACxC,kBAAkB,IAAI,IAAI,EAC1B,mBAAmB,IAAI,KAAK,EAC5B,
|
|
1
|
+
{"version":3,"file":"RadioSelectBox.namespace.d.ts","sourceRoot":"","sources":["../../../src/components/SelectBox/RadioSelectBox.namespace.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,IAAI,IAAI,EAC1B,qBAAqB,IAAI,OAAO,EAChC,yBAAyB,IAAI,WAAW,EACxC,oBAAoB,IAAI,MAAM,EAC9B,mBAAmB,IAAI,KAAK,EAC5B,yBAAyB,IAAI,WAAW,EACxC,kBAAkB,IAAI,IAAI,EAC1B,mBAAmB,IAAI,KAAK,EAC5B,qBAAqB,IAAI,OAAO,EAChC,KAAK,uBAAuB,IAAI,SAAS,EACzC,KAAK,0BAA0B,IAAI,YAAY,EAC/C,KAAK,8BAA8B,IAAI,gBAAgB,EACvD,KAAK,yBAAyB,IAAI,WAAW,EAC7C,KAAK,wBAAwB,IAAI,UAAU,EAC3C,KAAK,8BAA8B,IAAI,gBAAgB,EACvD,KAAK,uBAAuB,IAAI,SAAS,EACzC,KAAK,wBAAwB,IAAI,UAAU,EAC3C,KAAK,0BAA0B,IAAI,YAAY,GAChD,MAAM,kBAAkB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { RadioSelectBoxContent as Content, RadioSelectBoxDescription as Description, RadioSelectBoxItem as Item, RadioSelectBoxLabel as Label,
|
|
1
|
+
export { RadioSelectBoxBody as Body, RadioSelectBoxContent as Content, RadioSelectBoxDescription as Description, RadioSelectBoxFooter as Footer, RadioSelectBoxGroup as Group, RadioSelectBoxHiddenInput as HiddenInput, RadioSelectBoxItem as Item, RadioSelectBoxLabel as Label, RadioSelectBoxTrigger as Trigger } from './RadioSelectBox.js';
|
|
@@ -9,15 +9,25 @@ const RadioSelectBox_namespace = require('./RadioSelectBox.namespace.cjs');
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
+
exports.CheckSelectBoxBody = CheckSelectBox.CheckSelectBoxBody;
|
|
13
|
+
exports.CheckSelectBoxCheckmarkControl = CheckSelectBox.CheckSelectBoxCheckmarkControl;
|
|
14
|
+
exports.CheckSelectBoxCheckmarkIcon = CheckSelectBox.CheckSelectBoxCheckmarkIcon;
|
|
12
15
|
exports.CheckSelectBoxContent = CheckSelectBox.CheckSelectBoxContent;
|
|
13
16
|
exports.CheckSelectBoxDescription = CheckSelectBox.CheckSelectBoxDescription;
|
|
17
|
+
exports.CheckSelectBoxFooter = CheckSelectBox.CheckSelectBoxFooter;
|
|
14
18
|
exports.CheckSelectBoxGroup = CheckSelectBox.CheckSelectBoxGroup;
|
|
19
|
+
exports.CheckSelectBoxHiddenInput = CheckSelectBox.CheckSelectBoxHiddenInput;
|
|
15
20
|
exports.CheckSelectBoxLabel = CheckSelectBox.CheckSelectBoxLabel;
|
|
16
21
|
exports.CheckSelectBoxRoot = CheckSelectBox.CheckSelectBoxRoot;
|
|
22
|
+
exports.CheckSelectBoxTrigger = CheckSelectBox.CheckSelectBoxTrigger;
|
|
23
|
+
exports.RadioSelectBoxBody = RadioSelectBox.RadioSelectBoxBody;
|
|
17
24
|
exports.RadioSelectBoxContent = RadioSelectBox.RadioSelectBoxContent;
|
|
18
25
|
exports.RadioSelectBoxDescription = RadioSelectBox.RadioSelectBoxDescription;
|
|
26
|
+
exports.RadioSelectBoxFooter = RadioSelectBox.RadioSelectBoxFooter;
|
|
27
|
+
exports.RadioSelectBoxGroup = RadioSelectBox.RadioSelectBoxGroup;
|
|
28
|
+
exports.RadioSelectBoxHiddenInput = RadioSelectBox.RadioSelectBoxHiddenInput;
|
|
19
29
|
exports.RadioSelectBoxItem = RadioSelectBox.RadioSelectBoxItem;
|
|
20
30
|
exports.RadioSelectBoxLabel = RadioSelectBox.RadioSelectBoxLabel;
|
|
21
|
-
exports.
|
|
31
|
+
exports.RadioSelectBoxTrigger = RadioSelectBox.RadioSelectBoxTrigger;
|
|
22
32
|
exports.CheckSelectBox = CheckSelectBox_namespace;
|
|
23
33
|
exports.RadioSelectBox = RadioSelectBox_namespace;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { CheckSelectBoxContent, CheckSelectBoxDescription, CheckSelectBoxGroup, CheckSelectBoxLabel, CheckSelectBoxRoot, type CheckSelectBoxContentProps, type CheckSelectBoxDescriptionProps, type CheckSelectBoxGroupProps, type CheckSelectBoxLabelProps, type CheckSelectBoxRootProps, } from './CheckSelectBox';
|
|
2
|
-
export { RadioSelectBoxContent, RadioSelectBoxDescription, RadioSelectBoxItem, RadioSelectBoxLabel,
|
|
1
|
+
export { CheckSelectBoxBody, CheckSelectBoxCheckmarkControl, CheckSelectBoxCheckmarkIcon, CheckSelectBoxContent, CheckSelectBoxDescription, CheckSelectBoxFooter, CheckSelectBoxGroup, CheckSelectBoxHiddenInput, CheckSelectBoxLabel, CheckSelectBoxRoot, CheckSelectBoxTrigger, type CheckSelectBoxBodyProps, type CheckSelectBoxCheckmarkControlProps, type CheckSelectBoxCheckmarkIconProps, type CheckSelectBoxContentProps, type CheckSelectBoxDescriptionProps, type CheckSelectBoxFooterProps, type CheckSelectBoxGroupProps, type CheckSelectBoxHiddenInputProps, type CheckSelectBoxLabelProps, type CheckSelectBoxRootProps, type CheckSelectBoxTriggerProps, } from './CheckSelectBox';
|
|
2
|
+
export { RadioSelectBoxBody, RadioSelectBoxContent, RadioSelectBoxDescription, RadioSelectBoxFooter, RadioSelectBoxGroup, RadioSelectBoxHiddenInput, RadioSelectBoxItem, RadioSelectBoxLabel, RadioSelectBoxTrigger, type RadioSelectBoxBodyProps, type RadioSelectBoxContentProps, type RadioSelectBoxDescriptionProps, type RadioSelectBoxFooterProps, type RadioSelectBoxGroupProps, type RadioSelectBoxHiddenInputProps, type RadioSelectBoxItemProps, type RadioSelectBoxLabelProps, type RadioSelectBoxTriggerProps, } from './RadioSelectBox';
|
|
3
3
|
export * as CheckSelectBox from './CheckSelectBox.namespace';
|
|
4
4
|
export * as RadioSelectBox from './RadioSelectBox.namespace';
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/SelectBox/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,yBAAyB,EACzB,mBAAmB,EACnB,mBAAmB,EACnB,kBAAkB,EAClB,KAAK,0BAA0B,EAC/B,KAAK,8BAA8B,EACnC,KAAK,wBAAwB,EAC7B,KAAK,wBAAwB,EAC7B,KAAK,uBAAuB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/SelectBox/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,8BAA8B,EAC9B,2BAA2B,EAC3B,qBAAqB,EACrB,yBAAyB,EACzB,oBAAoB,EACpB,mBAAmB,EACnB,yBAAyB,EACzB,mBAAmB,EACnB,kBAAkB,EAClB,qBAAqB,EACrB,KAAK,uBAAuB,EAC5B,KAAK,mCAAmC,EACxC,KAAK,gCAAgC,EACrC,KAAK,0BAA0B,EAC/B,KAAK,8BAA8B,EACnC,KAAK,yBAAyB,EAC9B,KAAK,wBAAwB,EAC7B,KAAK,8BAA8B,EACnC,KAAK,wBAAwB,EAC7B,KAAK,uBAAuB,EAC5B,KAAK,0BAA0B,GAChC,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACL,kBAAkB,EAClB,qBAAqB,EACrB,yBAAyB,EACzB,oBAAoB,EACpB,mBAAmB,EACnB,yBAAyB,EACzB,kBAAkB,EAClB,mBAAmB,EACnB,qBAAqB,EACrB,KAAK,uBAAuB,EAC5B,KAAK,0BAA0B,EAC/B,KAAK,8BAA8B,EACnC,KAAK,yBAAyB,EAC9B,KAAK,wBAAwB,EAC7B,KAAK,8BAA8B,EACnC,KAAK,uBAAuB,EAC5B,KAAK,wBAAwB,EAC7B,KAAK,0BAA0B,GAChC,MAAM,kBAAkB,CAAC;AAE1B,OAAO,KAAK,cAAc,MAAM,4BAA4B,CAAC;AAC7D,OAAO,KAAK,cAAc,MAAM,4BAA4B,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { CheckSelectBoxContent, CheckSelectBoxDescription, CheckSelectBoxGroup, CheckSelectBoxLabel, CheckSelectBoxRoot } from './CheckSelectBox.js';
|
|
2
|
-
export { RadioSelectBoxContent, RadioSelectBoxDescription, RadioSelectBoxItem, RadioSelectBoxLabel,
|
|
1
|
+
export { CheckSelectBoxBody, CheckSelectBoxCheckmarkControl, CheckSelectBoxCheckmarkIcon, CheckSelectBoxContent, CheckSelectBoxDescription, CheckSelectBoxFooter, CheckSelectBoxGroup, CheckSelectBoxHiddenInput, CheckSelectBoxLabel, CheckSelectBoxRoot, CheckSelectBoxTrigger } from './CheckSelectBox.js';
|
|
2
|
+
export { RadioSelectBoxBody, RadioSelectBoxContent, RadioSelectBoxDescription, RadioSelectBoxFooter, RadioSelectBoxGroup, RadioSelectBoxHiddenInput, RadioSelectBoxItem, RadioSelectBoxLabel, RadioSelectBoxTrigger } from './RadioSelectBox.js';
|
|
3
3
|
import * as CheckSelectBox_namespace from './CheckSelectBox.namespace.js';
|
|
4
4
|
export { CheckSelectBox_namespace as CheckSelectBox };
|
|
5
5
|
import * as RadioSelectBox_namespace from './RadioSelectBox.namespace.js';
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
6
6
|
const jsxRuntime = require('react/jsx-runtime');
|
|
7
7
|
const reactSwitch = require('@seed-design/react-switch');
|
|
8
8
|
const _switch = require('@seed-design/css/recipes/switch');
|
|
9
|
-
const
|
|
9
|
+
const switchmark = require('@seed-design/css/recipes/switchmark');
|
|
10
10
|
const createSlotRecipeContext = require('../../utils/createSlotRecipeContext.cjs');
|
|
11
11
|
const reactPrimitive = require('@seed-design/react-primitive');
|
|
12
12
|
const createWithStateProps = require('../../utils/createWithStateProps.cjs');
|
|
@@ -19,20 +19,25 @@ const {
|
|
|
19
19
|
withContext: withControlContext,
|
|
20
20
|
PropsProvider: ControlPropsProvider,
|
|
21
21
|
withProvider: withControlProvider
|
|
22
|
-
} = createSlotRecipeContext.createSlotRecipeContext(
|
|
22
|
+
} = createSlotRecipeContext.createSlotRecipeContext(switchmark.switchmark);
|
|
23
23
|
const withStateProps = createWithStateProps.createWithStateProps([reactSwitch.useSwitchContext]);
|
|
24
24
|
const SwitchRoot = React.forwardRef(
|
|
25
25
|
({ className, ...props }, ref) => {
|
|
26
|
-
|
|
26
|
+
if (process.env.NODE_ENV !== "production" && (props.size === "small" || props.size === "medium")) {
|
|
27
|
+
console.warn(
|
|
28
|
+
`[SEED Design System] Switch size='${props.size}' is deprecated and will be removed in @seed-design/react@1.3.0. Use size='${props.size === "small" ? "16" : "32"}' instead.`
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
const [{ switch: switchVariantProps, switchmark: switchmarkVariantProps }, otherProps] = splitMultipleVariantsProps.splitMultipleVariantsProps(
|
|
27
32
|
{
|
|
28
33
|
...props,
|
|
29
34
|
// TODO: replace this mapping completely
|
|
30
35
|
size: props.size === "small" ? "16" : props.size === "medium" ? "32" : props.size
|
|
31
36
|
},
|
|
32
|
-
{
|
|
37
|
+
{ switchmark: switchmark.switchmark, switch: _switch.switchStyle }
|
|
33
38
|
);
|
|
34
39
|
const classNames = _switch.switchStyle(switchVariantProps);
|
|
35
|
-
return /* @__PURE__ */ jsxRuntime.jsx(ControlPropsProvider, { value:
|
|
40
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ControlPropsProvider, { value: switchmarkVariantProps, children: /* @__PURE__ */ jsxRuntime.jsx(ClassNamesProvider, { value: classNames, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
36
41
|
reactSwitch.Switch.Root,
|
|
37
42
|
{
|
|
38
43
|
ref,
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { Switch as SwitchPrimitive } from '@seed-design/react-switch';
|
|
2
2
|
import { SwitchVariantProps } from '@seed-design/css/recipes/switch';
|
|
3
|
-
import {
|
|
3
|
+
import { SwitchmarkVariantProps } from '@seed-design/css/recipes/switchmark';
|
|
4
4
|
import { PrimitiveProps } from '@seed-design/react-primitive';
|
|
5
5
|
import { default as React } from 'react';
|
|
6
6
|
/**
|
|
7
7
|
* @deprecated Use `16` or `32` instead of `small` or `medium`.
|
|
8
8
|
*/
|
|
9
9
|
type SwitchVariantDeprecatedSizeProps = "small" | "medium";
|
|
10
|
-
export interface SwitchRootProps extends Omit<SwitchVariantProps, "size">, Omit<
|
|
10
|
+
export interface SwitchRootProps extends Omit<SwitchVariantProps, "size">, Omit<SwitchmarkVariantProps, "size">, SwitchPrimitive.RootProps {
|
|
11
11
|
size?: SwitchVariantProps["size"] | SwitchVariantDeprecatedSizeProps;
|
|
12
12
|
}
|
|
13
13
|
export declare const SwitchRoot: React.ForwardRefExoticComponent<SwitchRootProps & React.RefAttributes<HTMLLabelElement>>;
|
|
14
|
-
export interface SwitchControlProps extends
|
|
14
|
+
export interface SwitchControlProps extends SwitchmarkVariantProps, SwitchPrimitive.ControlProps {
|
|
15
15
|
}
|
|
16
16
|
export declare const SwitchControl: React.ForwardRefExoticComponent<SwitchControlProps & React.RefAttributes<HTMLDivElement>>;
|
|
17
17
|
export interface SwitchThumbProps extends SwitchPrimitive.ThumbProps {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Switch.d.ts","sourceRoot":"","sources":["../../../src/components/Switch/Switch.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,eAAe,EAAoB,MAAM,2BAA2B,CAAC;AACxF,OAAO,EAAe,KAAK,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AACvF,OAAO,EAAc,KAAK,sBAAsB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"Switch.d.ts","sourceRoot":"","sources":["../../../src/components/Switch/Switch.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,eAAe,EAAoB,MAAM,2BAA2B,CAAC;AACxF,OAAO,EAAe,KAAK,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AACvF,OAAO,EAAc,KAAK,sBAAsB,EAAE,MAAM,qCAAqC,CAAC;AAE9F,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE9E,OAAO,KAAK,MAAM,OAAO,CAAC;AAc1B;;GAEG;AACH,KAAK,gCAAgC,GAAG,OAAO,GAAG,QAAQ,CAAC;AAE3D,MAAM,WAAW,eACf,SAAQ,IAAI,CAAC,kBAAkB,EAAE,MAAM,CAAC,EACtC,IAAI,CAAC,sBAAsB,EAAE,MAAM,CAAC,EACpC,eAAe,CAAC,SAAS;IAC3B,IAAI,CAAC,EAAE,kBAAkB,CAAC,MAAM,CAAC,GAAG,gCAAgC,CAAC;CACtE;AAED,eAAO,MAAM,UAAU,0FAmCtB,CAAC;AAKF,MAAM,WAAW,kBAAmB,SAAQ,sBAAsB,EAAE,eAAe,CAAC,YAAY;CAAG;AAEnG,eAAO,MAAM,aAAa,2FAGzB,CAAC;AAIF,MAAM,WAAW,gBAAiB,SAAQ,eAAe,CAAC,UAAU;CAAG;AAEvE,eAAO,MAAM,WAAW,yFAGvB,CAAC;AAIF,MAAM,WAAW,gBAAiB,SAAQ,cAAc,EAAE,KAAK,CAAC,cAAc,CAAC,eAAe,CAAC;CAAG;AAElG,eAAO,MAAM,WAAW,0FAGvB,CAAC;AAIF,MAAM,WAAW,sBAAuB,SAAQ,eAAe,CAAC,gBAAgB;CAAG;AAEnF,eAAO,MAAM,iBAAiB,2GAA8B,CAAC"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
3
|
import { Switch, useSwitchContext } from '@seed-design/react-switch';
|
|
4
4
|
import { switchStyle } from '@seed-design/css/recipes/switch';
|
|
5
|
-
import {
|
|
5
|
+
import { switchmark } from '@seed-design/css/recipes/switchmark';
|
|
6
6
|
import { createSlotRecipeContext } from '../../utils/createSlotRecipeContext.js';
|
|
7
7
|
import { Primitive } from '@seed-design/react-primitive';
|
|
8
8
|
import { createWithStateProps } from '../../utils/createWithStateProps.js';
|
|
@@ -15,20 +15,25 @@ const {
|
|
|
15
15
|
withContext: withControlContext,
|
|
16
16
|
PropsProvider: ControlPropsProvider,
|
|
17
17
|
withProvider: withControlProvider
|
|
18
|
-
} = createSlotRecipeContext(
|
|
18
|
+
} = createSlotRecipeContext(switchmark);
|
|
19
19
|
const withStateProps = createWithStateProps([useSwitchContext]);
|
|
20
20
|
const SwitchRoot = React__default.forwardRef(
|
|
21
21
|
({ className, ...props }, ref) => {
|
|
22
|
-
|
|
22
|
+
if (process.env.NODE_ENV !== "production" && (props.size === "small" || props.size === "medium")) {
|
|
23
|
+
console.warn(
|
|
24
|
+
`[SEED Design System] Switch size='${props.size}' is deprecated and will be removed in @seed-design/react@1.3.0. Use size='${props.size === "small" ? "16" : "32"}' instead.`
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
const [{ switch: switchVariantProps, switchmark: switchmarkVariantProps }, otherProps] = splitMultipleVariantsProps(
|
|
23
28
|
{
|
|
24
29
|
...props,
|
|
25
30
|
// TODO: replace this mapping completely
|
|
26
31
|
size: props.size === "small" ? "16" : props.size === "medium" ? "32" : props.size
|
|
27
32
|
},
|
|
28
|
-
{
|
|
33
|
+
{ switchmark, switch: switchStyle }
|
|
29
34
|
);
|
|
30
35
|
const classNames = switchStyle(switchVariantProps);
|
|
31
|
-
return /* @__PURE__ */ jsx(ControlPropsProvider, { value:
|
|
36
|
+
return /* @__PURE__ */ jsx(ControlPropsProvider, { value: switchmarkVariantProps, children: /* @__PURE__ */ jsx(ClassNamesProvider, { value: classNames, children: /* @__PURE__ */ jsx(
|
|
32
37
|
Switch.Root,
|
|
33
38
|
{
|
|
34
39
|
ref,
|
|
@@ -7,13 +7,13 @@ const jsxRuntime = require('react/jsx-runtime');
|
|
|
7
7
|
const reactPrimitive = require('@seed-design/react-primitive');
|
|
8
8
|
const tagGroup = require('@seed-design/css/recipes/tag-group');
|
|
9
9
|
const tagGroupItem = require('@seed-design/css/recipes/tag-group-item');
|
|
10
|
-
const createRecipeContext = require('../../utils/createRecipeContext.cjs');
|
|
11
10
|
const React = require('react');
|
|
12
11
|
const clsx = require('clsx');
|
|
13
12
|
const splitMultipleVariantsProps = require('../../utils/splitMultipleVariantsProps.cjs');
|
|
14
|
-
const
|
|
13
|
+
const styled = require('../../utils/styled.cjs');
|
|
14
|
+
const createSlotRecipeContext = require('../../utils/createSlotRecipeContext.cjs');
|
|
15
15
|
|
|
16
|
-
const { PropsProvider, useProps } =
|
|
16
|
+
const { PropsProvider, useProps, withContext, ClassNamesProvider } = createSlotRecipeContext.createSlotRecipeContext(tagGroupItem.tagGroupItem);
|
|
17
17
|
const TagGroupRoot = React.forwardRef(
|
|
18
18
|
({ className, children, separator = " · ", ...props }, ref) => {
|
|
19
19
|
const [{ tagGroup: tagGroupVariantProps, tagGroupItem: tagGroupItemVariantProps }, otherProps] = splitMultipleVariantsProps.splitMultipleVariantsProps(props, { tagGroup: tagGroup.tagGroup, tagGroupItem: tagGroupItem.tagGroupItem });
|
|
@@ -27,12 +27,28 @@ const TagGroupRoot = React.forwardRef(
|
|
|
27
27
|
)) }) });
|
|
28
28
|
}
|
|
29
29
|
);
|
|
30
|
-
const TagGroupItem = React.forwardRef(
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
});
|
|
30
|
+
const TagGroupItem = React.forwardRef(
|
|
31
|
+
({ className, ...props }, ref) => {
|
|
32
|
+
const parentVariantProps = useProps();
|
|
33
|
+
const [variantProps, otherProps] = tagGroupItem.tagGroupItem.splitVariantProps(props);
|
|
34
|
+
const classNames = tagGroupItem.tagGroupItem({ ...parentVariantProps, ...variantProps });
|
|
35
|
+
const { style, restProps } = styled.useStyleProps(otherProps);
|
|
36
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ClassNamesProvider, { value: classNames, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
37
|
+
reactPrimitive.Primitive.span,
|
|
38
|
+
{
|
|
39
|
+
ref,
|
|
40
|
+
style,
|
|
41
|
+
className: clsx(classNames.root, className),
|
|
42
|
+
...restProps
|
|
43
|
+
}
|
|
44
|
+
) });
|
|
45
|
+
}
|
|
46
|
+
);
|
|
47
|
+
const TagGroupItemLabel = withContext(
|
|
48
|
+
reactPrimitive.Primitive.span,
|
|
49
|
+
"label"
|
|
50
|
+
);
|
|
36
51
|
|
|
37
52
|
exports.TagGroupItem = TagGroupItem;
|
|
53
|
+
exports.TagGroupItemLabel = TagGroupItemLabel;
|
|
38
54
|
exports.TagGroupRoot = TagGroupRoot;
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import { PrimitiveProps } from '@seed-design/react-primitive';
|
|
2
2
|
import { TagGroupVariantProps } from '@seed-design/css/recipes/tag-group';
|
|
3
3
|
import { TagGroupItemVariantProps } from '@seed-design/css/recipes/tag-group-item';
|
|
4
|
+
import { StyleProps } from '../../utils/styled';
|
|
4
5
|
import { ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
5
6
|
export interface TagGroupRootProps extends TagGroupVariantProps, TagGroupItemVariantProps, PrimitiveProps, React.HTMLAttributes<HTMLSpanElement> {
|
|
6
7
|
separator?: React.ReactNode;
|
|
7
8
|
}
|
|
8
9
|
export declare const TagGroupRoot: ForwardRefExoticComponent<TagGroupRootProps & RefAttributes<HTMLSpanElement>>;
|
|
9
|
-
export interface TagGroupItemProps extends TagGroupItemVariantProps, PrimitiveProps, React.HTMLAttributes<HTMLSpanElement> {
|
|
10
|
+
export interface TagGroupItemProps extends TagGroupItemVariantProps, Pick<StyleProps, "flexShrink">, PrimitiveProps, React.HTMLAttributes<HTMLSpanElement> {
|
|
10
11
|
}
|
|
11
12
|
export declare const TagGroupItem: ForwardRefExoticComponent<TagGroupItemProps & RefAttributes<HTMLSpanElement>>;
|
|
13
|
+
export interface TagGroupItemLabelProps extends PrimitiveProps, React.HTMLAttributes<HTMLSpanElement> {
|
|
14
|
+
}
|
|
15
|
+
export declare const TagGroupItemLabel: ForwardRefExoticComponent<TagGroupItemLabelProps & RefAttributes<HTMLSpanElement>>;
|
|
12
16
|
//# sourceMappingURL=TagGroup.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TagGroup.d.ts","sourceRoot":"","sources":["../../../src/components/TagGroup/TagGroup.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9E,OAAO,EAAY,KAAK,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AACzF,OAAO,EAEL,KAAK,wBAAwB,EAC9B,MAAM,yCAAyC,CAAC;
|
|
1
|
+
{"version":3,"file":"TagGroup.d.ts","sourceRoot":"","sources":["../../../src/components/TagGroup/TagGroup.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9E,OAAO,EAAY,KAAK,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AACzF,OAAO,EAEL,KAAK,wBAAwB,EAC9B,MAAM,yCAAyC,CAAC;AAIjD,OAAO,EAAiB,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAMpE,MAAM,WAAW,iBACf,SAAQ,oBAAoB,EAC1B,wBAAwB,EACxB,cAAc,EACd,KAAK,CAAC,cAAc,CAAC,eAAe,CAAC;IACvC,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC7B;AAED,eAAO,MAAM,YAAY,+GA0BxB,CAAC;AAEF,MAAM,WAAW,iBACf,SAAQ,wBAAwB,EAC9B,IAAI,CAAC,UAAU,EAAE,YAAY,CAAC,EAC9B,cAAc,EACd,KAAK,CAAC,cAAc,CAAC,eAAe,CAAC;CAAG;AAE5C,eAAO,MAAM,YAAY,+GAoBxB,CAAC;AAEF,MAAM,WAAW,sBACf,SAAQ,cAAc,EACpB,KAAK,CAAC,cAAc,CAAC,eAAe,CAAC;CAAG;AAE5C,eAAO,MAAM,iBAAiB,oHAG7B,CAAC"}
|
|
@@ -3,13 +3,13 @@ import { jsx, jsxs } from 'react/jsx-runtime';
|
|
|
3
3
|
import { Primitive } from '@seed-design/react-primitive';
|
|
4
4
|
import { tagGroup } from '@seed-design/css/recipes/tag-group';
|
|
5
5
|
import { tagGroupItem } from '@seed-design/css/recipes/tag-group-item';
|
|
6
|
-
import { createRecipeContext } from '../../utils/createRecipeContext.js';
|
|
7
6
|
import { forwardRef, Children, Fragment } from 'react';
|
|
8
7
|
import clsx from 'clsx';
|
|
9
8
|
import { splitMultipleVariantsProps } from '../../utils/splitMultipleVariantsProps.js';
|
|
10
|
-
import {
|
|
9
|
+
import { useStyleProps } from '../../utils/styled.js';
|
|
10
|
+
import { createSlotRecipeContext } from '../../utils/createSlotRecipeContext.js';
|
|
11
11
|
|
|
12
|
-
const { PropsProvider, useProps } =
|
|
12
|
+
const { PropsProvider, useProps, withContext, ClassNamesProvider } = createSlotRecipeContext(tagGroupItem);
|
|
13
13
|
const TagGroupRoot = forwardRef(
|
|
14
14
|
({ className, children, separator = " · ", ...props }, ref) => {
|
|
15
15
|
const [{ tagGroup: tagGroupVariantProps, tagGroupItem: tagGroupItemVariantProps }, otherProps] = splitMultipleVariantsProps(props, { tagGroup, tagGroupItem });
|
|
@@ -23,11 +23,26 @@ const TagGroupRoot = forwardRef(
|
|
|
23
23
|
)) }) });
|
|
24
24
|
}
|
|
25
25
|
);
|
|
26
|
-
const TagGroupItem = forwardRef(
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
});
|
|
26
|
+
const TagGroupItem = forwardRef(
|
|
27
|
+
({ className, ...props }, ref) => {
|
|
28
|
+
const parentVariantProps = useProps();
|
|
29
|
+
const [variantProps, otherProps] = tagGroupItem.splitVariantProps(props);
|
|
30
|
+
const classNames = tagGroupItem({ ...parentVariantProps, ...variantProps });
|
|
31
|
+
const { style, restProps } = useStyleProps(otherProps);
|
|
32
|
+
return /* @__PURE__ */ jsx(ClassNamesProvider, { value: classNames, children: /* @__PURE__ */ jsx(
|
|
33
|
+
Primitive.span,
|
|
34
|
+
{
|
|
35
|
+
ref,
|
|
36
|
+
style,
|
|
37
|
+
className: clsx(classNames.root, className),
|
|
38
|
+
...restProps
|
|
39
|
+
}
|
|
40
|
+
) });
|
|
41
|
+
}
|
|
42
|
+
);
|
|
43
|
+
const TagGroupItemLabel = withContext(
|
|
44
|
+
Primitive.span,
|
|
45
|
+
"label"
|
|
46
|
+
);
|
|
32
47
|
|
|
33
|
-
export { TagGroupItem, TagGroupRoot };
|
|
48
|
+
export { TagGroupItem, TagGroupItemLabel, TagGroupRoot };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { TagGroupRoot as Root, TagGroupItem as Item, type TagGroupRootProps as RootProps, type TagGroupItemProps as ItemProps, } from './TagGroup';
|
|
1
|
+
export { TagGroupRoot as Root, TagGroupItem as Item, TagGroupItemLabel as ItemLabel, type TagGroupRootProps as RootProps, type TagGroupItemProps as ItemProps, type TagGroupItemLabelProps as ItemLabelProps, } from './TagGroup';
|
|
2
2
|
//# sourceMappingURL=TagGroup.namespace.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TagGroup.namespace.d.ts","sourceRoot":"","sources":["../../../src/components/TagGroup/TagGroup.namespace.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,IAAI,IAAI,EACpB,YAAY,IAAI,IAAI,EACpB,KAAK,iBAAiB,IAAI,SAAS,EACnC,KAAK,iBAAiB,IAAI,SAAS,
|
|
1
|
+
{"version":3,"file":"TagGroup.namespace.d.ts","sourceRoot":"","sources":["../../../src/components/TagGroup/TagGroup.namespace.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,IAAI,IAAI,EACpB,YAAY,IAAI,IAAI,EACpB,iBAAiB,IAAI,SAAS,EAC9B,KAAK,iBAAiB,IAAI,SAAS,EACnC,KAAK,iBAAiB,IAAI,SAAS,EACnC,KAAK,sBAAsB,IAAI,cAAc,GAC9C,MAAM,YAAY,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { TagGroupItem as Item, TagGroupRoot as Root } from './TagGroup.js';
|
|
1
|
+
export { TagGroupItem as Item, TagGroupItemLabel as ItemLabel, TagGroupRoot as Root } from './TagGroup.js';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { TagGroupRoot, TagGroupItem, type TagGroupRootProps, type TagGroupItemProps, } from './TagGroup';
|
|
1
|
+
export { TagGroupRoot, TagGroupItem, TagGroupItemLabel, type TagGroupRootProps, type TagGroupItemProps, type TagGroupItemLabelProps, } from './TagGroup';
|
|
2
2
|
export * as TagGroup from './TagGroup.namespace';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/TagGroup/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,YAAY,EACZ,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/TagGroup/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,YAAY,EACZ,iBAAiB,EACjB,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACtB,KAAK,sBAAsB,GAC5B,MAAM,YAAY,CAAC;AAEpB,OAAO,KAAK,QAAQ,MAAM,sBAAsB,CAAC"}
|