@seed-design/react 1.1.17 → 1.2.1
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/BottomSheet/BottomSheet.cjs +1 -1
- package/lib/components/BottomSheet/BottomSheet.d.ts +1 -1
- package/lib/components/BottomSheet/BottomSheet.d.ts.map +1 -1
- package/lib/components/BottomSheet/BottomSheet.js +1 -1
- package/lib/components/Checkbox/Checkbox.cjs +5 -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 +5 -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/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 +5 -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 +5 -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 +6 -0
- package/lib/utils/styled.d.ts +6 -0
- package/lib/utils/styled.d.ts.map +1 -1
- package/lib/utils/styled.js +6 -0
- 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/BottomSheet/BottomSheet.tsx +2 -4
- package/src/components/Checkbox/Checkbox.namespace.ts +2 -0
- package/src/components/Checkbox/Checkbox.tsx +15 -0
- package/src/components/Checkbox/index.ts +2 -0
- 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 +7 -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 +18 -0
|
@@ -6,16 +6,17 @@ import {
|
|
|
6
6
|
type MenuSheetItemVariantProps,
|
|
7
7
|
} from "@seed-design/css/recipes/menu-sheet-item";
|
|
8
8
|
import * as React from "react";
|
|
9
|
-
import { createRecipeContext } from "../../utils/createRecipeContext";
|
|
10
9
|
import { createSlotRecipeContext } from "../../utils/createSlotRecipeContext";
|
|
11
10
|
import { createWithStateProps } from "../../utils/createWithStateProps";
|
|
11
|
+
import clsx from "clsx";
|
|
12
12
|
|
|
13
|
-
const { withRootProvider, withContext } = createSlotRecipeContext(menuSheet);
|
|
13
|
+
const { withRootProvider, withContext, useClassNames } = createSlotRecipeContext(menuSheet);
|
|
14
14
|
const {
|
|
15
|
-
withContext: withItemContext,
|
|
16
15
|
PropsProvider: ItemPropsProvider,
|
|
17
16
|
useProps: useItemProps,
|
|
18
|
-
|
|
17
|
+
withContext: withItemContext,
|
|
18
|
+
ClassNamesProvider: ItemClassNamesProvider,
|
|
19
|
+
} = createSlotRecipeContext(menuSheetItem);
|
|
19
20
|
const withStateProps = createWithStateProps([useDialogContext]);
|
|
20
21
|
|
|
21
22
|
////////////////////////////////////////////////////////////////////////////////////
|
|
@@ -68,18 +69,18 @@ export interface MenuSheetContentProps
|
|
|
68
69
|
extends DialogPrimitive.ContentProps,
|
|
69
70
|
Pick<MenuSheetItemVariantProps, "labelAlign"> {}
|
|
70
71
|
|
|
71
|
-
const MenuSheetContentBase = withContext<HTMLDivElement, DialogPrimitive.ContentProps>(
|
|
72
|
-
DialogPrimitive.Content,
|
|
73
|
-
"content",
|
|
74
|
-
);
|
|
75
|
-
|
|
76
72
|
export const MenuSheetContent = React.forwardRef<HTMLDivElement, MenuSheetContentProps>(
|
|
77
|
-
({
|
|
73
|
+
({ className, ...props }, ref) => {
|
|
74
|
+
const [variantProps, otherProps] = menuSheetItem.splitVariantProps(props);
|
|
75
|
+
const classNames = useClassNames();
|
|
76
|
+
|
|
78
77
|
return (
|
|
79
|
-
<ItemPropsProvider value={
|
|
80
|
-
<
|
|
81
|
-
{
|
|
82
|
-
|
|
78
|
+
<ItemPropsProvider value={variantProps}>
|
|
79
|
+
<DialogPrimitive.Content
|
|
80
|
+
className={clsx(classNames.content, className)}
|
|
81
|
+
ref={ref}
|
|
82
|
+
{...otherProps}
|
|
83
|
+
/>
|
|
83
84
|
</ItemPropsProvider>
|
|
84
85
|
);
|
|
85
86
|
},
|
|
@@ -96,8 +97,9 @@ export const MenuSheetHeader = withContext<HTMLDivElement, MenuSheetHeaderProps>
|
|
|
96
97
|
"header",
|
|
97
98
|
);
|
|
98
99
|
|
|
99
|
-
|
|
100
|
-
|
|
100
|
+
// NOTE: uses DialogPrimitive.TitleProps,
|
|
101
|
+
// but actual rendered component is a Primitive.h2 rather than a DialogPrimitive.Title
|
|
102
|
+
// find out why later; h2 is same but missing and some a11y features
|
|
101
103
|
export interface MenuSheetTitleProps extends DialogPrimitive.TitleProps {}
|
|
102
104
|
|
|
103
105
|
export const MenuSheetTitle = withContext<HTMLHeadingElement, MenuSheetTitleProps>(
|
|
@@ -105,6 +107,16 @@ export const MenuSheetTitle = withContext<HTMLHeadingElement, MenuSheetTitleProp
|
|
|
105
107
|
"title",
|
|
106
108
|
);
|
|
107
109
|
|
|
110
|
+
// NOTE: uses DialogPrimitive.DescriptionProps,
|
|
111
|
+
// but actual rendered component is a Primitive.p rather than a DialogPrimitive.Description
|
|
112
|
+
// find out why later; p is same but missing and some a11y features
|
|
113
|
+
export interface MenuSheetDescriptionProps extends DialogPrimitive.DescriptionProps {}
|
|
114
|
+
|
|
115
|
+
export const MenuSheetDescription = withContext<HTMLParagraphElement, MenuSheetDescriptionProps>(
|
|
116
|
+
withStateProps(Primitive.p),
|
|
117
|
+
"description",
|
|
118
|
+
);
|
|
119
|
+
|
|
108
120
|
////////////////////////////////////////////////////////////////////////////////////
|
|
109
121
|
|
|
110
122
|
export interface MenuSheetListProps extends PrimitiveProps, React.HTMLAttributes<HTMLDivElement> {}
|
|
@@ -120,21 +132,22 @@ export interface MenuSheetGroupProps
|
|
|
120
132
|
extends React.HTMLAttributes<HTMLDivElement>,
|
|
121
133
|
Pick<MenuSheetItemVariantProps, "labelAlign"> {}
|
|
122
134
|
|
|
123
|
-
const MenuSheetGroupBase = withContext<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(
|
|
124
|
-
withStateProps(Primitive.div),
|
|
125
|
-
"group",
|
|
126
|
-
);
|
|
127
|
-
|
|
128
135
|
export const MenuSheetGroup = React.forwardRef<HTMLDivElement, MenuSheetGroupProps>(
|
|
129
|
-
({
|
|
136
|
+
({ className, ...props }, ref) => {
|
|
137
|
+
const [variantProps, otherProps] = menuSheetItem.splitVariantProps(props);
|
|
130
138
|
const parentProps = useItemProps();
|
|
131
|
-
|
|
139
|
+
|
|
140
|
+
const classNames = useClassNames();
|
|
141
|
+
const { stateProps } = useDialogContext();
|
|
132
142
|
|
|
133
143
|
return (
|
|
134
|
-
<ItemPropsProvider value={
|
|
135
|
-
<
|
|
136
|
-
{
|
|
137
|
-
|
|
144
|
+
<ItemPropsProvider value={{ ...parentProps, ...variantProps }}>
|
|
145
|
+
<Primitive.div
|
|
146
|
+
className={clsx(classNames.group, className)}
|
|
147
|
+
ref={ref}
|
|
148
|
+
{...stateProps}
|
|
149
|
+
{...otherProps}
|
|
150
|
+
/>
|
|
138
151
|
</ItemPropsProvider>
|
|
139
152
|
);
|
|
140
153
|
},
|
|
@@ -147,19 +160,54 @@ export interface MenuSheetItemProps
|
|
|
147
160
|
MenuSheetItemVariantProps,
|
|
148
161
|
React.HTMLAttributes<HTMLButtonElement> {}
|
|
149
162
|
|
|
150
|
-
const MenuSheetItemBase = withItemContext<HTMLButtonElement, MenuSheetItemProps>(
|
|
151
|
-
withStateProps(Primitive.button),
|
|
152
|
-
);
|
|
153
|
-
|
|
154
163
|
export const MenuSheetItem = React.forwardRef<HTMLButtonElement, MenuSheetItemProps>(
|
|
155
|
-
({
|
|
164
|
+
({ className: propClassName, ...props }, ref) => {
|
|
165
|
+
const [variantProps, otherProps] = menuSheetItem.splitVariantProps(props);
|
|
156
166
|
const parentProps = useItemProps();
|
|
157
|
-
const labelAlign = overriddenLabelAlign ?? parentProps?.labelAlign;
|
|
158
167
|
|
|
159
|
-
|
|
168
|
+
const classNames = menuSheetItem({ ...parentProps, ...variantProps });
|
|
169
|
+
const { stateProps } = useDialogContext();
|
|
170
|
+
|
|
171
|
+
return (
|
|
172
|
+
<ItemClassNamesProvider value={classNames}>
|
|
173
|
+
<Primitive.button
|
|
174
|
+
ref={ref}
|
|
175
|
+
className={clsx(classNames.root, propClassName)}
|
|
176
|
+
{...stateProps}
|
|
177
|
+
{...otherProps}
|
|
178
|
+
/>
|
|
179
|
+
</ItemClassNamesProvider>
|
|
180
|
+
);
|
|
160
181
|
},
|
|
161
182
|
);
|
|
162
183
|
|
|
184
|
+
export interface MenuSheetItemContentProps
|
|
185
|
+
extends PrimitiveProps,
|
|
186
|
+
React.HTMLAttributes<HTMLDivElement> {}
|
|
187
|
+
|
|
188
|
+
export const MenuSheetItemContent = withItemContext<HTMLDivElement, MenuSheetItemContentProps>(
|
|
189
|
+
withStateProps(Primitive.div),
|
|
190
|
+
"content",
|
|
191
|
+
);
|
|
192
|
+
|
|
193
|
+
export interface MenuSheetItemLabelProps
|
|
194
|
+
extends PrimitiveProps,
|
|
195
|
+
React.HTMLAttributes<HTMLSpanElement> {}
|
|
196
|
+
|
|
197
|
+
export const MenuSheetItemLabel = withItemContext<HTMLSpanElement, MenuSheetItemLabelProps>(
|
|
198
|
+
withStateProps(Primitive.span),
|
|
199
|
+
"label",
|
|
200
|
+
);
|
|
201
|
+
|
|
202
|
+
export interface MenuSheetItemDescriptionProps
|
|
203
|
+
extends PrimitiveProps,
|
|
204
|
+
React.HTMLAttributes<HTMLSpanElement> {}
|
|
205
|
+
|
|
206
|
+
export const MenuSheetItemDescription = withItemContext<
|
|
207
|
+
HTMLSpanElement,
|
|
208
|
+
MenuSheetItemDescriptionProps
|
|
209
|
+
>(withStateProps(Primitive.span), "description");
|
|
210
|
+
|
|
163
211
|
////////////////////////////////////////////////////////////////////////////////////
|
|
164
212
|
|
|
165
213
|
export interface MenuSheetFooterProps
|
|
@@ -6,10 +6,14 @@ export {
|
|
|
6
6
|
MenuSheetHeader,
|
|
7
7
|
MenuSheetRoot,
|
|
8
8
|
MenuSheetTitle,
|
|
9
|
+
MenuSheetDescription,
|
|
9
10
|
MenuSheetTrigger,
|
|
10
11
|
MenuSheetList,
|
|
11
12
|
MenuSheetGroup,
|
|
12
13
|
MenuSheetItem,
|
|
14
|
+
MenuSheetItemContent,
|
|
15
|
+
MenuSheetItemLabel,
|
|
16
|
+
MenuSheetItemDescription,
|
|
13
17
|
MenuSheetCloseButton,
|
|
14
18
|
type MenuSheetBackdropProps,
|
|
15
19
|
type MenuSheetPositionerProps,
|
|
@@ -18,10 +22,14 @@ export {
|
|
|
18
22
|
type MenuSheetHeaderProps,
|
|
19
23
|
type MenuSheetRootProps,
|
|
20
24
|
type MenuSheetTitleProps,
|
|
25
|
+
type MenuSheetDescriptionProps,
|
|
21
26
|
type MenuSheetTriggerProps,
|
|
22
27
|
type MenuSheetListProps,
|
|
23
28
|
type MenuSheetGroupProps,
|
|
24
29
|
type MenuSheetItemProps,
|
|
30
|
+
type MenuSheetItemContentProps,
|
|
31
|
+
type MenuSheetItemLabelProps,
|
|
32
|
+
type MenuSheetItemDescriptionProps,
|
|
25
33
|
type MenuSheetCloseButtonProps,
|
|
26
34
|
} from "./MenuSheet";
|
|
27
35
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { radio, type RadioVariantProps } from "@seed-design/css/recipes/radio";
|
|
2
|
+
import { radioGroup, type RadioGroupVariantProps } from "@seed-design/css/recipes/radio-group";
|
|
2
3
|
import { radiomark, type RadiomarkVariantProps } from "@seed-design/css/recipes/radiomark";
|
|
3
4
|
import { mergeProps } from "@seed-design/dom-utils";
|
|
4
5
|
import {
|
|
@@ -12,7 +13,9 @@ import { createSlotRecipeContext } from "../../utils/createSlotRecipeContext";
|
|
|
12
13
|
import { createWithStateProps } from "../../utils/createWithStateProps";
|
|
13
14
|
import { InternalIcon } from "../private/Icon";
|
|
14
15
|
import { splitMultipleVariantsProps } from "../../utils/splitMultipleVariantsProps";
|
|
16
|
+
import { createRecipeContext } from "../../utils/createRecipeContext";
|
|
15
17
|
|
|
18
|
+
const { withContext: withGroupContext } = createRecipeContext(radioGroup);
|
|
16
19
|
const { ClassNamesProvider, withContext } = createSlotRecipeContext(radio);
|
|
17
20
|
const {
|
|
18
21
|
withProvider: withRadiomarkProvider,
|
|
@@ -23,9 +26,12 @@ const withStateProps = createWithStateProps([useRadioGroupItemContext]);
|
|
|
23
26
|
|
|
24
27
|
////////////////////////////////////////////////////////////////////////////////////
|
|
25
28
|
|
|
26
|
-
export interface RadioGroupRootProps
|
|
29
|
+
export interface RadioGroupRootProps
|
|
30
|
+
extends RadioGroupVariantProps,
|
|
31
|
+
PrimitiveProps,
|
|
32
|
+
React.HTMLAttributes<HTMLDivElement> {}
|
|
27
33
|
|
|
28
|
-
export const RadioGroupRoot =
|
|
34
|
+
export const RadioGroupRoot = withGroupContext<HTMLDivElement, RadioGroupRootProps>(Primitive.div);
|
|
29
35
|
|
|
30
36
|
////////////////////////////////////////////////////////////////////////////////////
|
|
31
37
|
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export {
|
|
2
|
+
RadioGroupFieldRoot as Root,
|
|
3
|
+
RadioGroupFieldHeader as Header,
|
|
4
|
+
RadioGroupFieldLabel as Label,
|
|
5
|
+
RadioGroupFieldIndicatorText as IndicatorText,
|
|
6
|
+
RadioGroupFieldRequiredIndicator as RequiredIndicator,
|
|
7
|
+
RadioGroupFieldFooter as Footer,
|
|
8
|
+
RadioGroupFieldDescription as Description,
|
|
9
|
+
RadioGroupFieldErrorMessage as ErrorMessage,
|
|
10
|
+
type RadioGroupFieldRootProps as RootProps,
|
|
11
|
+
type RadioGroupFieldHeaderProps as HeaderProps,
|
|
12
|
+
type RadioGroupFieldLabelProps as LabelProps,
|
|
13
|
+
type RadioGroupFieldIndicatorTextProps as IndicatorTextProps,
|
|
14
|
+
type RadioGroupFieldRequiredIndicatorProps as RequiredIndicatorProps,
|
|
15
|
+
type RadioGroupFieldFooterProps as FooterProps,
|
|
16
|
+
type RadioGroupFieldDescriptionProps as DescriptionProps,
|
|
17
|
+
type RadioGroupFieldErrorMessageProps as ErrorMessageProps,
|
|
18
|
+
} from "./RadioGroupField";
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { field, type FieldVariantProps } from "@seed-design/css/recipes/field";
|
|
4
|
+
import { fieldLabel, type FieldLabelVariantProps } from "@seed-design/css/recipes/field-label";
|
|
5
|
+
import { Primitive, type PrimitiveProps } from "@seed-design/react-primitive";
|
|
6
|
+
import { RadioGroup as RadioGroupPrimitive } from "@seed-design/react-radio-group";
|
|
7
|
+
import type * as React from "react";
|
|
8
|
+
import { forwardRef } from "react";
|
|
9
|
+
import clsx from "clsx";
|
|
10
|
+
import { createSlotRecipeContext } from "../../utils/createSlotRecipeContext";
|
|
11
|
+
import { InternalIcon } from "../private/Icon";
|
|
12
|
+
|
|
13
|
+
const { withProvider, withContext } = createSlotRecipeContext(field);
|
|
14
|
+
const {
|
|
15
|
+
withContext: withLabelContext,
|
|
16
|
+
withProvider: withLabelProvider,
|
|
17
|
+
useClassNames: useLabelClassNames,
|
|
18
|
+
} = createSlotRecipeContext(fieldLabel);
|
|
19
|
+
|
|
20
|
+
////////////////////////////////////////////////////////////////////////////////////
|
|
21
|
+
|
|
22
|
+
export interface RadioGroupFieldRootProps
|
|
23
|
+
extends FieldVariantProps,
|
|
24
|
+
RadioGroupPrimitive.RootProps {}
|
|
25
|
+
|
|
26
|
+
export const RadioGroupFieldRoot = withProvider<HTMLDivElement, RadioGroupFieldRootProps>(
|
|
27
|
+
RadioGroupPrimitive.Root,
|
|
28
|
+
"root",
|
|
29
|
+
);
|
|
30
|
+
|
|
31
|
+
////////////////////////////////////////////////////////////////////////////////////
|
|
32
|
+
|
|
33
|
+
export interface RadioGroupFieldHeaderProps
|
|
34
|
+
extends PrimitiveProps,
|
|
35
|
+
React.HTMLAttributes<HTMLDivElement> {}
|
|
36
|
+
|
|
37
|
+
export const RadioGroupFieldHeader = withContext<HTMLDivElement, RadioGroupFieldHeaderProps>(
|
|
38
|
+
Primitive.div,
|
|
39
|
+
"header",
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
export interface RadioGroupFieldLabelProps
|
|
43
|
+
extends FieldLabelVariantProps,
|
|
44
|
+
RadioGroupPrimitive.LabelProps {}
|
|
45
|
+
|
|
46
|
+
export const RadioGroupFieldLabel = withLabelProvider<HTMLDivElement, RadioGroupFieldLabelProps>(
|
|
47
|
+
RadioGroupPrimitive.Label,
|
|
48
|
+
"root",
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
export interface RadioGroupFieldIndicatorTextProps
|
|
52
|
+
extends PrimitiveProps,
|
|
53
|
+
React.HTMLAttributes<HTMLSpanElement> {}
|
|
54
|
+
|
|
55
|
+
export const RadioGroupFieldIndicatorText = withLabelContext<
|
|
56
|
+
HTMLSpanElement,
|
|
57
|
+
RadioGroupFieldIndicatorTextProps
|
|
58
|
+
>(Primitive.span, "indicatorText");
|
|
59
|
+
|
|
60
|
+
export interface RadioGroupFieldRequiredIndicatorProps extends React.SVGProps<SVGElement> {}
|
|
61
|
+
|
|
62
|
+
export const RadioGroupFieldRequiredIndicator = forwardRef<
|
|
63
|
+
SVGSVGElement,
|
|
64
|
+
RadioGroupFieldRequiredIndicatorProps
|
|
65
|
+
>(({ className, ...props }, ref) => {
|
|
66
|
+
const { indicatorIcon } = useLabelClassNames();
|
|
67
|
+
|
|
68
|
+
return (
|
|
69
|
+
<InternalIcon
|
|
70
|
+
svg={
|
|
71
|
+
// biome-ignore lint/a11y/noSvgWithoutTitle: InternalIcon is aria-hidden
|
|
72
|
+
<svg
|
|
73
|
+
viewBox="0 0 6 6"
|
|
74
|
+
fill="none"
|
|
75
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
76
|
+
className={clsx(indicatorIcon, className)}
|
|
77
|
+
>
|
|
78
|
+
<path
|
|
79
|
+
d="M3.75002 1.55859L4.41318 1.09468C4.75243 0.857361 5.21982 0.939865 5.45732 1.27899C5.69499 1.61836 5.61243 2.08615 5.27295 2.32366L4.30763 2.99902L5.27372 3.67612C5.61285 3.91381 5.69517 4.38137 5.45761 4.72059C5.21999 5.0599 4.7523 5.14233 4.41299 4.90471L3.75002 4.44043V5.25C3.75002 5.66421 3.41423 6 3.00002 6C2.5858 6 2.25002 5.66421 2.25002 5.25V4.44043L1.58704 4.90471C1.24773 5.14233 0.780041 5.0599 0.542418 4.72059C0.304856 4.38137 0.387176 3.91381 0.726309 3.67612L1.6924 2.99902L0.727079 2.32366C0.387603 2.08615 0.305043 1.61836 0.542707 1.27899C0.780206 0.939865 1.2476 0.857361 1.58685 1.09468L2.25002 1.55859V0.75C2.25002 0.335786 2.5858 0 3.00002 0C3.41423 0 3.75002 0.335786 3.75002 0.75V1.55859Z"
|
|
80
|
+
fill="currentColor"
|
|
81
|
+
/>
|
|
82
|
+
</svg>
|
|
83
|
+
}
|
|
84
|
+
ref={ref}
|
|
85
|
+
{...props}
|
|
86
|
+
/>
|
|
87
|
+
);
|
|
88
|
+
});
|
|
89
|
+
RadioGroupFieldRequiredIndicator.displayName = "RadioGroupFieldRequiredIndicator";
|
|
90
|
+
|
|
91
|
+
////////////////////////////////////////////////////////////////////////////////////
|
|
92
|
+
|
|
93
|
+
export interface RadioGroupFieldFooterProps
|
|
94
|
+
extends PrimitiveProps,
|
|
95
|
+
React.HTMLAttributes<HTMLDivElement> {}
|
|
96
|
+
|
|
97
|
+
export const RadioGroupFieldFooter = withContext<HTMLDivElement, RadioGroupFieldFooterProps>(
|
|
98
|
+
Primitive.div,
|
|
99
|
+
"footer",
|
|
100
|
+
);
|
|
101
|
+
|
|
102
|
+
export interface RadioGroupFieldDescriptionProps extends RadioGroupPrimitive.DescriptionProps {}
|
|
103
|
+
|
|
104
|
+
export const RadioGroupFieldDescription = withContext<
|
|
105
|
+
HTMLSpanElement,
|
|
106
|
+
RadioGroupFieldDescriptionProps
|
|
107
|
+
>(RadioGroupPrimitive.Description, "description");
|
|
108
|
+
|
|
109
|
+
export interface RadioGroupFieldErrorMessageProps extends RadioGroupPrimitive.ErrorMessageProps {}
|
|
110
|
+
|
|
111
|
+
export const RadioGroupFieldErrorMessage = withContext<
|
|
112
|
+
HTMLDivElement,
|
|
113
|
+
RadioGroupFieldErrorMessageProps
|
|
114
|
+
>(RadioGroupPrimitive.ErrorMessage, "errorMessage");
|
|
@@ -1,12 +1,24 @@
|
|
|
1
1
|
export {
|
|
2
|
+
CheckSelectBoxBody as Body,
|
|
3
|
+
CheckSelectBoxCheckmarkControl as CheckmarkControl,
|
|
4
|
+
CheckSelectBoxCheckmarkIcon as CheckmarkIcon,
|
|
2
5
|
CheckSelectBoxContent as Content,
|
|
3
6
|
CheckSelectBoxDescription as Description,
|
|
7
|
+
CheckSelectBoxFooter as Footer,
|
|
4
8
|
CheckSelectBoxGroup as Group,
|
|
9
|
+
CheckSelectBoxHiddenInput as HiddenInput,
|
|
5
10
|
CheckSelectBoxLabel as Label,
|
|
6
11
|
CheckSelectBoxRoot as Root,
|
|
12
|
+
CheckSelectBoxTrigger as Trigger,
|
|
13
|
+
type CheckSelectBoxBodyProps as BodyProps,
|
|
14
|
+
type CheckSelectBoxCheckmarkControlProps as CheckmarkControlProps,
|
|
15
|
+
type CheckSelectBoxCheckmarkIconProps as CheckmarkIconProps,
|
|
7
16
|
type CheckSelectBoxContentProps as ContentProps,
|
|
8
17
|
type CheckSelectBoxDescriptionProps as DescriptionProps,
|
|
18
|
+
type CheckSelectBoxFooterProps as FooterProps,
|
|
9
19
|
type CheckSelectBoxGroupProps as GroupProps,
|
|
20
|
+
type CheckSelectBoxHiddenInputProps as HiddenInputProps,
|
|
10
21
|
type CheckSelectBoxLabelProps as LabelProps,
|
|
11
22
|
type CheckSelectBoxRootProps as RootProps,
|
|
23
|
+
type CheckSelectBoxTriggerProps as TriggerProps,
|
|
12
24
|
} from "./CheckSelectBox";
|