@seed-design/react 0.2.4 → 1.0.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/{Celcius/Celcius.cjs → Celsius/Celsius.cjs} +2 -2
- package/lib/components/Celsius/Celsius.d.ts +6 -0
- package/lib/components/Celsius/Celsius.d.ts.map +1 -0
- package/lib/components/Celsius/Celsius.js +6 -0
- package/lib/components/{Celcius → Celsius}/index.cjs +2 -2
- package/lib/components/Celsius/index.d.ts +2 -0
- package/lib/components/Celsius/index.d.ts.map +1 -0
- package/lib/components/Celsius/index.js +1 -0
- package/lib/components/Checkbox/Checkbox.cjs +9 -8
- package/lib/components/Checkbox/Checkbox.d.ts.map +1 -1
- package/lib/components/Checkbox/Checkbox.js +9 -8
- package/lib/components/List/List.cjs +5 -3
- package/lib/components/List/List.d.ts.map +1 -1
- package/lib/components/List/List.js +5 -3
- package/lib/components/List/ListHeader.cjs +20 -0
- package/lib/components/List/ListHeader.d.ts +11 -0
- package/lib/components/List/ListHeader.d.ts.map +1 -0
- package/lib/components/List/ListHeader.js +16 -0
- package/lib/components/List/ListHeader.namespace.d.ts +2 -0
- package/lib/components/List/ListHeader.namespace.d.ts.map +1 -0
- package/lib/components/List/index.cjs +2 -0
- package/lib/components/List/index.d.ts +1 -0
- package/lib/components/List/index.d.ts.map +1 -1
- package/lib/components/List/index.js +1 -0
- package/lib/components/MannerTemp/MannerTempEmote.cjs +80 -612
- package/lib/components/MannerTemp/MannerTempEmote.d.ts +2 -2
- package/lib/components/MannerTemp/MannerTempEmote.d.ts.map +1 -1
- package/lib/components/MannerTemp/MannerTempEmote.js +81 -613
- package/lib/components/RadioGroup/RadioGroup.cjs +2 -3
- package/lib/components/RadioGroup/RadioGroup.d.ts.map +1 -1
- package/lib/components/RadioGroup/RadioGroup.js +2 -3
- package/lib/components/Snackbar/Snackbar.cjs +5 -0
- package/lib/components/Snackbar/Snackbar.d.ts +4 -1
- package/lib/components/Snackbar/Snackbar.d.ts.map +1 -1
- package/lib/components/Snackbar/Snackbar.js +5 -1
- package/lib/components/Snackbar/Snackbar.namespace.cjs +1 -0
- package/lib/components/Snackbar/Snackbar.namespace.d.ts +1 -1
- package/lib/components/Snackbar/Snackbar.namespace.d.ts.map +1 -1
- package/lib/components/Snackbar/Snackbar.namespace.js +1 -1
- package/lib/components/Switch/Switch.cjs +23 -11
- package/lib/components/Switch/Switch.d.ts +3 -2
- package/lib/components/Switch/Switch.d.ts.map +1 -1
- package/lib/components/Switch/Switch.js +23 -11
- package/lib/components/index.cjs +4 -2
- package/lib/components/index.d.ts +1 -1
- package/lib/components/index.js +2 -1
- package/lib/index.cjs +4 -2
- package/lib/index.js +2 -1
- package/lib/utils/splitMultipleVariantsProps.cjs +32 -0
- package/lib/utils/splitMultipleVariantsProps.d.ts +21 -0
- package/lib/utils/splitMultipleVariantsProps.js +28 -0
- package/package.json +19 -19
- package/src/components/Celsius/Celsius.tsx +9 -0
- package/src/components/Celsius/index.ts +4 -0
- package/src/components/Checkbox/Checkbox.tsx +15 -15
- package/src/components/List/List.tsx +5 -3
- package/src/components/List/ListHeader.namespace.ts +0 -0
- package/src/components/List/ListHeader.tsx +24 -0
- package/src/components/List/index.ts +2 -0
- package/src/components/MannerTemp/MannerTempEmote.tsx +104 -432
- package/src/components/RadioGroup/RadioGroup.tsx +3 -4
- package/src/components/Snackbar/Snackbar.namespace.ts +2 -0
- package/src/components/Snackbar/Snackbar.tsx +12 -1
- package/src/components/Switch/Switch.tsx +34 -26
- package/src/components/index.ts +1 -1
- package/src/utils/splitMultipleVariantsProps.d.ts +21 -0
- package/src/utils/splitMultipleVariantsProps.mjs +25 -0
- package/lib/components/Celcius/Celcius.d.ts +0 -6
- package/lib/components/Celcius/Celcius.d.ts.map +0 -1
- package/lib/components/Celcius/Celcius.js +0 -6
- package/lib/components/Celcius/index.d.ts +0 -2
- package/lib/components/Celcius/index.d.ts.map +0 -1
- package/lib/components/Celcius/index.js +0 -1
- package/src/components/Celcius/Celcius.tsx +0 -9
- package/src/components/Celcius/index.ts +0 -4
|
@@ -14,6 +14,7 @@ const React = require('react');
|
|
|
14
14
|
const createSlotRecipeContext = require('../../utils/createSlotRecipeContext.cjs');
|
|
15
15
|
const createWithStateProps = require('../../utils/createWithStateProps.cjs');
|
|
16
16
|
const Icon = require('../private/Icon.cjs');
|
|
17
|
+
const splitMultipleVariantsProps = require('../../utils/splitMultipleVariantsProps.cjs');
|
|
17
18
|
|
|
18
19
|
const { ClassNamesProvider, withContext } = createSlotRecipeContext.createSlotRecipeContext(radio.radio);
|
|
19
20
|
const {
|
|
@@ -25,9 +26,7 @@ const withStateProps = createWithStateProps.createWithStateProps([reactRadioGrou
|
|
|
25
26
|
const RadioGroupRoot = reactRadioGroup.RadioGroup.Root;
|
|
26
27
|
const RadioGroupItem = Object.assign(
|
|
27
28
|
React.forwardRef(({ className, ...props }, ref) => {
|
|
28
|
-
const [radioVariantProps,
|
|
29
|
-
const [radiomarkVariantProps] = radiomark.radiomark.splitVariantProps(props);
|
|
30
|
-
const [, otherProps] = radiomark.radiomark.splitVariantProps(__otherProps);
|
|
29
|
+
const [{ radio: radioVariantProps, radiomark: radiomarkVariantProps }, otherProps] = splitMultipleVariantsProps.splitMultipleVariantsProps(props, { radio: radio.radio, radiomark: radiomark.radiomark });
|
|
31
30
|
const classNames = radio.radio(radioVariantProps);
|
|
32
31
|
return /* @__PURE__ */ jsxRuntime.jsx(RadiomarkPropsProvider, { value: radiomarkVariantProps, children: /* @__PURE__ */ jsxRuntime.jsx(ClassNamesProvider, { value: classNames, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
33
32
|
reactRadioGroup.RadioGroup.Item,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioGroup.d.ts","sourceRoot":"","sources":["../../../src/components/RadioGroup/RadioGroup.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAS,KAAK,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAC/E,OAAO,EAAa,KAAK,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAE3F,OAAO,EACL,UAAU,IAAI,mBAAmB,EAElC,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"RadioGroup.d.ts","sourceRoot":"","sources":["../../../src/components/RadioGroup/RadioGroup.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAS,KAAK,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAC/E,OAAO,EAAa,KAAK,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAE3F,OAAO,EACL,UAAU,IAAI,mBAAmB,EAElC,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAkB9E,MAAM,WAAW,mBAAoB,SAAQ,mBAAmB,CAAC,SAAS;CAAG;AAE7E,eAAO,MAAM,cAAc,0HAA2B,CAAC;AAIvD,MAAM,WAAW,mBACf,SAAQ,iBAAiB,EACvB,qBAAqB,EACrB,mBAAmB,CAAC,SAAS;CAAG;AAEpC,eAAO,MAAM,cAAc;;CAsB1B,CAAC;AAIF,MAAM,WAAW,wBACf,SAAQ,cAAc,EACpB,KAAK,CAAC,cAAc,CAAC,eAAe,CAAC;CAAG;AAE5C,eAAO,MAAM,mBAAmB,sHAG/B,CAAC;AAIF,MAAM,WAAW,0BACf,SAAQ,qBAAqB,EAC3B,mBAAmB,CAAC,gBAAgB;CAAG;AAE3C,eAAO,MAAM,qBAAqB,uHAGQ,CAAC;AAI3C,MAAM,WAAW,4BAA6B,SAAQ,KAAK,CAAC,aAAa,CAAC,aAAa,CAAC;IACtF;;OAEG;IACH,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAE5B;;OAEG;IACH,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,eAAO,MAAM,uBAAuB,wHA4BnC,CAAC;AAKF,MAAM,WAAW,8BAA+B,SAAQ,mBAAmB,CAAC,oBAAoB;CAAG;AAEnG,eAAO,MAAM,yBAAyB,uIAAsC,CAAC"}
|
|
@@ -10,6 +10,7 @@ import { forwardRef } from 'react';
|
|
|
10
10
|
import { createSlotRecipeContext } from '../../utils/createSlotRecipeContext.js';
|
|
11
11
|
import { createWithStateProps } from '../../utils/createWithStateProps.js';
|
|
12
12
|
import { InternalIcon } from '../private/Icon.js';
|
|
13
|
+
import { splitMultipleVariantsProps } from '../../utils/splitMultipleVariantsProps.js';
|
|
13
14
|
|
|
14
15
|
const { ClassNamesProvider, withContext } = createSlotRecipeContext(radio);
|
|
15
16
|
const {
|
|
@@ -21,9 +22,7 @@ const withStateProps = createWithStateProps([useRadioGroupItemContext]);
|
|
|
21
22
|
const RadioGroupRoot = RadioGroup.Root;
|
|
22
23
|
const RadioGroupItem = Object.assign(
|
|
23
24
|
forwardRef(({ className, ...props }, ref) => {
|
|
24
|
-
const [radioVariantProps,
|
|
25
|
-
const [radiomarkVariantProps] = radiomark.splitVariantProps(props);
|
|
26
|
-
const [, otherProps] = radiomark.splitVariantProps(__otherProps);
|
|
25
|
+
const [{ radio: radioVariantProps, radiomark: radiomarkVariantProps }, otherProps] = splitMultipleVariantsProps(props, { radio, radiomark });
|
|
27
26
|
const classNames = radio(radioVariantProps);
|
|
28
27
|
return /* @__PURE__ */ jsx(RadiomarkPropsProvider, { value: radiomarkVariantProps, children: /* @__PURE__ */ jsx(ClassNamesProvider, { value: classNames, children: /* @__PURE__ */ jsx(
|
|
29
28
|
RadioGroup.Item,
|
|
@@ -24,6 +24,10 @@ const SnackbarRoot = withProvider(
|
|
|
24
24
|
reactSnackbar.Snackbar.Root,
|
|
25
25
|
"root"
|
|
26
26
|
);
|
|
27
|
+
const SnackbarContent = withContext(
|
|
28
|
+
reactPrimitive.Primitive.div,
|
|
29
|
+
"content"
|
|
30
|
+
);
|
|
27
31
|
const SnackbarMessage = withContext(
|
|
28
32
|
reactPrimitive.Primitive.span,
|
|
29
33
|
"message"
|
|
@@ -52,6 +56,7 @@ const SnackbarAvoidOverlap = reactSnackbar.Snackbar.AvoidOverlap;
|
|
|
52
56
|
|
|
53
57
|
exports.SnackbarActionButton = SnackbarActionButton;
|
|
54
58
|
exports.SnackbarAvoidOverlap = SnackbarAvoidOverlap;
|
|
59
|
+
exports.SnackbarContent = SnackbarContent;
|
|
55
60
|
exports.SnackbarHiddenCloseButton = SnackbarHiddenCloseButton;
|
|
56
61
|
exports.SnackbarMessage = SnackbarMessage;
|
|
57
62
|
exports.SnackbarPrefixIcon = SnackbarPrefixIcon;
|
|
@@ -12,9 +12,12 @@ export declare const SnackbarRegion: ForwardRefExoticComponent<SnackbarRegionPro
|
|
|
12
12
|
export interface SnackbarRootProps extends SnackbarVariantProps, SnackbarPrimitive.RootProps {
|
|
13
13
|
}
|
|
14
14
|
export declare const SnackbarRoot: ForwardRefExoticComponent<SnackbarRootProps & RefAttributes<HTMLDivElement>>;
|
|
15
|
+
export interface SnackbarContentProps extends PrimitiveProps, React.HTMLAttributes<HTMLDivElement> {
|
|
16
|
+
}
|
|
17
|
+
export declare const SnackbarContent: ForwardRefExoticComponent<SnackbarContentProps & RefAttributes<HTMLDivElement>>;
|
|
15
18
|
export interface SnackbarMessageProps extends PrimitiveProps, React.HTMLAttributes<HTMLSpanElement> {
|
|
16
19
|
}
|
|
17
|
-
export declare const SnackbarMessage: ForwardRefExoticComponent<SnackbarMessageProps & RefAttributes<
|
|
20
|
+
export declare const SnackbarMessage: ForwardRefExoticComponent<SnackbarMessageProps & RefAttributes<HTMLSpanElement>>;
|
|
18
21
|
export interface SnackbarPrefixIconProps extends InternalIconProps {
|
|
19
22
|
}
|
|
20
23
|
export declare const SnackbarPrefixIcon: ForwardRefExoticComponent<SnackbarPrefixIconProps & RefAttributes<HTMLDivElement>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Snackbar.d.ts","sourceRoot":"","sources":["../../../src/components/Snackbar/Snackbar.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAY,KAAK,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AAGxF,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9E,OAAO,EAAE,QAAQ,IAAI,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAI5E,OAAO,EAAgB,KAAK,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAOvE,MAAM,WAAW,yBAA0B,SAAQ,iBAAiB,CAAC,iBAAiB;CAAG;AAEzF,eAAO,MAAM,oBAAoB,qHAAiC,CAAC;AAInE,MAAM,WAAW,mBAAoB,SAAQ,oBAAoB,EAAE,iBAAiB,CAAC,WAAW;CAAG;AAEnG,eAAO,MAAM,cAAc,gHAE1B,CAAC;AAIF,MAAM,WAAW,iBAAkB,SAAQ,oBAAoB,EAAE,iBAAiB,CAAC,SAAS;CAAG;AAE/F,eAAO,MAAM,YAAY,8GAGxB,CAAC;AAIF,MAAM,WAAW,oBACf,SAAQ,cAAc,EACpB,KAAK,CAAC,cAAc,CAAC,eAAe,CAAC;CAAG;AAE5C,eAAO,MAAM,eAAe,
|
|
1
|
+
{"version":3,"file":"Snackbar.d.ts","sourceRoot":"","sources":["../../../src/components/Snackbar/Snackbar.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAY,KAAK,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AAGxF,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9E,OAAO,EAAE,QAAQ,IAAI,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAI5E,OAAO,EAAgB,KAAK,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAOvE,MAAM,WAAW,yBAA0B,SAAQ,iBAAiB,CAAC,iBAAiB;CAAG;AAEzF,eAAO,MAAM,oBAAoB,qHAAiC,CAAC;AAInE,MAAM,WAAW,mBAAoB,SAAQ,oBAAoB,EAAE,iBAAiB,CAAC,WAAW;CAAG;AAEnG,eAAO,MAAM,cAAc,gHAE1B,CAAC;AAIF,MAAM,WAAW,iBAAkB,SAAQ,oBAAoB,EAAE,iBAAiB,CAAC,SAAS;CAAG;AAE/F,eAAO,MAAM,YAAY,8GAGxB,CAAC;AAIF,MAAM,WAAW,oBACf,SAAQ,cAAc,EACpB,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;CAAG;AAE3C,eAAO,MAAM,eAAe,iHAG3B,CAAC;AAIF,MAAM,WAAW,oBACf,SAAQ,cAAc,EACpB,KAAK,CAAC,cAAc,CAAC,eAAe,CAAC;CAAG;AAE5C,eAAO,MAAM,eAAe,kHAG3B,CAAC;AAIF,MAAM,WAAW,uBAAwB,SAAQ,iBAAiB;CAAG;AAErE,eAAO,MAAM,kBAAkB,oHAG9B,CAAC;AAIF,MAAM,WAAW,yBACf,SAAQ,cAAc,EACpB,KAAK,CAAC,cAAc,CAAC,iBAAiB,CAAC;CAAG;AAE9C,eAAO,MAAM,oBAAoB,yHAGhC,CAAC;AAIF,MAAM,WAAW,8BAA+B,SAAQ,iBAAiB,CAAC,gBAAgB;CAAG;AAE7F;;GAEG;AACH,eAAO,MAAM,yBAAyB,8HAYpC,CAAC;AAIH,MAAM,WAAW,qBAAsB,SAAQ,iBAAiB,CAAC,aAAa;CAAG;AAEjF,eAAO,MAAM,gBAAgB,wEAA6B,CAAC;AAI3D,MAAM,WAAW,yBAA0B,SAAQ,iBAAiB,CAAC,iBAAiB;CAAG;AAEzF,eAAO,MAAM,oBAAoB,oJAAiC,CAAC"}
|
|
@@ -20,6 +20,10 @@ const SnackbarRoot = withProvider(
|
|
|
20
20
|
Snackbar.Root,
|
|
21
21
|
"root"
|
|
22
22
|
);
|
|
23
|
+
const SnackbarContent = withContext(
|
|
24
|
+
Primitive.div,
|
|
25
|
+
"content"
|
|
26
|
+
);
|
|
23
27
|
const SnackbarMessage = withContext(
|
|
24
28
|
Primitive.span,
|
|
25
29
|
"message"
|
|
@@ -46,4 +50,4 @@ const SnackbarHiddenCloseButton = forwardRef((props, ref) => {
|
|
|
46
50
|
const SnackbarRenderer = Snackbar.Renderer;
|
|
47
51
|
const SnackbarAvoidOverlap = Snackbar.AvoidOverlap;
|
|
48
52
|
|
|
49
|
-
export { SnackbarActionButton, SnackbarAvoidOverlap, SnackbarHiddenCloseButton, SnackbarMessage, SnackbarPrefixIcon, SnackbarRegion, SnackbarRenderer, SnackbarRoot, SnackbarRootProvider };
|
|
53
|
+
export { SnackbarActionButton, SnackbarAvoidOverlap, SnackbarContent, SnackbarHiddenCloseButton, SnackbarMessage, SnackbarPrefixIcon, SnackbarRegion, SnackbarRenderer, SnackbarRoot, SnackbarRootProvider };
|
|
@@ -8,6 +8,7 @@ const Snackbar = require('./Snackbar.cjs');
|
|
|
8
8
|
|
|
9
9
|
exports.ActionButton = Snackbar.SnackbarActionButton;
|
|
10
10
|
exports.AvoidOverlap = Snackbar.SnackbarAvoidOverlap;
|
|
11
|
+
exports.Content = Snackbar.SnackbarContent;
|
|
11
12
|
exports.HiddenCloseButton = Snackbar.SnackbarHiddenCloseButton;
|
|
12
13
|
exports.Message = Snackbar.SnackbarMessage;
|
|
13
14
|
exports.PrefixIcon = Snackbar.SnackbarPrefixIcon;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { SnackbarActionButton as ActionButton, SnackbarAvoidOverlap as AvoidOverlap, SnackbarHiddenCloseButton as HiddenCloseButton, SnackbarMessage as Message, SnackbarPrefixIcon as PrefixIcon, SnackbarRegion as Region, SnackbarRenderer as Renderer, SnackbarRoot as Root, SnackbarRootProvider as RootProvider, type SnackbarActionButtonProps as ActionButtonProps, type SnackbarAvoidOverlapProps as AvoidOverlapProps, type SnackbarHiddenCloseButtonProps as HiddenCloseButtonProps, type SnackbarMessageProps as MessageProps, type SnackbarPrefixIconProps as PrefixIconProps, type SnackbarRegionProps as RegionProps, type SnackbarRendererProps as RendererProps, type SnackbarRootProps as RootProps, type SnackbarRootProviderProps as RootProviderProps, } from './Snackbar';
|
|
1
|
+
export { SnackbarActionButton as ActionButton, SnackbarAvoidOverlap as AvoidOverlap, SnackbarHiddenCloseButton as HiddenCloseButton, SnackbarMessage as Message, SnackbarContent as Content, SnackbarPrefixIcon as PrefixIcon, SnackbarRegion as Region, SnackbarRenderer as Renderer, SnackbarRoot as Root, SnackbarRootProvider as RootProvider, type SnackbarActionButtonProps as ActionButtonProps, type SnackbarAvoidOverlapProps as AvoidOverlapProps, type SnackbarHiddenCloseButtonProps as HiddenCloseButtonProps, type SnackbarMessageProps as MessageProps, type SnackbarContentProps as ContentProps, type SnackbarPrefixIconProps as PrefixIconProps, type SnackbarRegionProps as RegionProps, type SnackbarRendererProps as RendererProps, type SnackbarRootProps as RootProps, type SnackbarRootProviderProps as RootProviderProps, } from './Snackbar';
|
|
2
2
|
//# sourceMappingURL=Snackbar.namespace.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Snackbar.namespace.d.ts","sourceRoot":"","sources":["../../../src/components/Snackbar/Snackbar.namespace.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,IAAI,YAAY,EACpC,oBAAoB,IAAI,YAAY,EACpC,yBAAyB,IAAI,iBAAiB,EAC9C,eAAe,IAAI,OAAO,EAC1B,kBAAkB,IAAI,UAAU,EAChC,cAAc,IAAI,MAAM,EACxB,gBAAgB,IAAI,QAAQ,EAC5B,YAAY,IAAI,IAAI,EACpB,oBAAoB,IAAI,YAAY,EACpC,KAAK,yBAAyB,IAAI,iBAAiB,EACnD,KAAK,yBAAyB,IAAI,iBAAiB,EACnD,KAAK,8BAA8B,IAAI,sBAAsB,EAC7D,KAAK,oBAAoB,IAAI,YAAY,EACzC,KAAK,uBAAuB,IAAI,eAAe,EAC/C,KAAK,mBAAmB,IAAI,WAAW,EACvC,KAAK,qBAAqB,IAAI,aAAa,EAC3C,KAAK,iBAAiB,IAAI,SAAS,EACnC,KAAK,yBAAyB,IAAI,iBAAiB,GACpD,MAAM,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"Snackbar.namespace.d.ts","sourceRoot":"","sources":["../../../src/components/Snackbar/Snackbar.namespace.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,IAAI,YAAY,EACpC,oBAAoB,IAAI,YAAY,EACpC,yBAAyB,IAAI,iBAAiB,EAC9C,eAAe,IAAI,OAAO,EAC1B,eAAe,IAAI,OAAO,EAC1B,kBAAkB,IAAI,UAAU,EAChC,cAAc,IAAI,MAAM,EACxB,gBAAgB,IAAI,QAAQ,EAC5B,YAAY,IAAI,IAAI,EACpB,oBAAoB,IAAI,YAAY,EACpC,KAAK,yBAAyB,IAAI,iBAAiB,EACnD,KAAK,yBAAyB,IAAI,iBAAiB,EACnD,KAAK,8BAA8B,IAAI,sBAAsB,EAC7D,KAAK,oBAAoB,IAAI,YAAY,EACzC,KAAK,oBAAoB,IAAI,YAAY,EACzC,KAAK,uBAAuB,IAAI,eAAe,EAC/C,KAAK,mBAAmB,IAAI,WAAW,EACvC,KAAK,qBAAqB,IAAI,aAAa,EAC3C,KAAK,iBAAiB,IAAI,SAAS,EACnC,KAAK,yBAAyB,IAAI,iBAAiB,GACpD,MAAM,YAAY,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { SnackbarActionButton as ActionButton, SnackbarAvoidOverlap as AvoidOverlap, SnackbarHiddenCloseButton as HiddenCloseButton, SnackbarMessage as Message, SnackbarPrefixIcon as PrefixIcon, SnackbarRegion as Region, SnackbarRenderer as Renderer, SnackbarRoot as Root, SnackbarRootProvider as RootProvider } from './Snackbar.js';
|
|
1
|
+
export { SnackbarActionButton as ActionButton, SnackbarAvoidOverlap as AvoidOverlap, SnackbarContent as Content, SnackbarHiddenCloseButton as HiddenCloseButton, SnackbarMessage as Message, SnackbarPrefixIcon as PrefixIcon, SnackbarRegion as Region, SnackbarRenderer as Renderer, SnackbarRoot as Root, SnackbarRootProvider as RootProvider } from './Snackbar.js';
|
|
@@ -6,36 +6,48 @@ 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 switchMark = require('@seed-design/css/recipes/switch-mark');
|
|
9
10
|
const createSlotRecipeContext = require('../../utils/createSlotRecipeContext.cjs');
|
|
10
11
|
const reactPrimitive = require('@seed-design/react-primitive');
|
|
11
12
|
const createWithStateProps = require('../../utils/createWithStateProps.cjs');
|
|
12
13
|
const React = require('react');
|
|
13
14
|
const clsx = require('clsx');
|
|
15
|
+
const splitMultipleVariantsProps = require('../../utils/splitMultipleVariantsProps.cjs');
|
|
14
16
|
|
|
15
17
|
const { withContext, ClassNamesProvider } = createSlotRecipeContext.createSlotRecipeContext(_switch.switchStyle);
|
|
18
|
+
const {
|
|
19
|
+
withContext: withControlContext,
|
|
20
|
+
PropsProvider: ControlPropsProvider,
|
|
21
|
+
withProvider: withControlProvider
|
|
22
|
+
} = createSlotRecipeContext.createSlotRecipeContext(switchMark.switchMark);
|
|
16
23
|
const withStateProps = createWithStateProps.createWithStateProps([reactSwitch.useSwitchContext]);
|
|
17
24
|
const SwitchRoot = React.forwardRef(
|
|
18
|
-
({
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
+
({ className, ...props }, ref) => {
|
|
26
|
+
const [{ switch: switchVariantProps, switchMark: switchMarkVariantProps }, otherProps] = splitMultipleVariantsProps.splitMultipleVariantsProps(
|
|
27
|
+
{
|
|
28
|
+
...props,
|
|
29
|
+
// TODO: replace this mapping completely
|
|
30
|
+
size: props.size === "small" ? "16" : props.size === "medium" ? "32" : props.size
|
|
31
|
+
},
|
|
32
|
+
{ switchMark: switchMark.switchMark, switch: _switch.switchStyle }
|
|
33
|
+
);
|
|
34
|
+
const classNames = _switch.switchStyle(switchVariantProps);
|
|
35
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ControlPropsProvider, { value: switchMarkVariantProps, children: /* @__PURE__ */ jsxRuntime.jsx(ClassNamesProvider, { value: classNames, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
25
36
|
reactSwitch.Switch.Root,
|
|
26
37
|
{
|
|
27
38
|
ref,
|
|
28
39
|
className: clsx(classNames.root, className),
|
|
29
40
|
...otherProps
|
|
30
41
|
}
|
|
31
|
-
) });
|
|
42
|
+
) }) });
|
|
32
43
|
}
|
|
33
44
|
);
|
|
34
|
-
|
|
45
|
+
SwitchRoot.displayName = "SwitchRoot";
|
|
46
|
+
const SwitchControl = withControlProvider(
|
|
35
47
|
reactSwitch.Switch.Control,
|
|
36
|
-
"
|
|
48
|
+
"root"
|
|
37
49
|
);
|
|
38
|
-
const SwitchThumb =
|
|
50
|
+
const SwitchThumb = withControlContext(
|
|
39
51
|
reactSwitch.Switch.Thumb,
|
|
40
52
|
"thumb"
|
|
41
53
|
);
|
|
@@ -1,16 +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 { SwitchMarkVariantProps } from '@seed-design/css/recipes/switch-mark';
|
|
3
4
|
import { PrimitiveProps } from '@seed-design/react-primitive';
|
|
4
5
|
import { default as React } from 'react';
|
|
5
6
|
/**
|
|
6
7
|
* @deprecated Use `16` or `32` instead of `small` or `medium`.
|
|
7
8
|
*/
|
|
8
9
|
type SwitchVariantDeprecatedSizeProps = "small" | "medium";
|
|
9
|
-
export interface SwitchRootProps extends Omit<SwitchVariantProps, "size">, SwitchPrimitive.RootProps {
|
|
10
|
+
export interface SwitchRootProps extends Omit<SwitchVariantProps, "size">, Omit<SwitchMarkVariantProps, "size">, SwitchPrimitive.RootProps {
|
|
10
11
|
size?: SwitchVariantProps["size"] | SwitchVariantDeprecatedSizeProps;
|
|
11
12
|
}
|
|
12
13
|
export declare const SwitchRoot: React.ForwardRefExoticComponent<SwitchRootProps & React.RefAttributes<HTMLLabelElement>>;
|
|
13
|
-
export interface SwitchControlProps extends SwitchPrimitive.ControlProps {
|
|
14
|
+
export interface SwitchControlProps extends SwitchMarkVariantProps, SwitchPrimitive.ControlProps {
|
|
14
15
|
}
|
|
15
16
|
export declare const SwitchControl: React.ForwardRefExoticComponent<SwitchControlProps & React.RefAttributes<HTMLDivElement>>;
|
|
16
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;
|
|
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,sCAAsC,CAAC;AAE/F,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,0FA0BtB,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,36 +2,48 @@
|
|
|
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 { switchMark } from '@seed-design/css/recipes/switch-mark';
|
|
5
6
|
import { createSlotRecipeContext } from '../../utils/createSlotRecipeContext.js';
|
|
6
7
|
import { Primitive } from '@seed-design/react-primitive';
|
|
7
8
|
import { createWithStateProps } from '../../utils/createWithStateProps.js';
|
|
8
9
|
import React__default from 'react';
|
|
9
10
|
import clsx from 'clsx';
|
|
11
|
+
import { splitMultipleVariantsProps } from '../../utils/splitMultipleVariantsProps.js';
|
|
10
12
|
|
|
11
13
|
const { withContext, ClassNamesProvider } = createSlotRecipeContext(switchStyle);
|
|
14
|
+
const {
|
|
15
|
+
withContext: withControlContext,
|
|
16
|
+
PropsProvider: ControlPropsProvider,
|
|
17
|
+
withProvider: withControlProvider
|
|
18
|
+
} = createSlotRecipeContext(switchMark);
|
|
12
19
|
const withStateProps = createWithStateProps([useSwitchContext]);
|
|
13
20
|
const SwitchRoot = React__default.forwardRef(
|
|
14
|
-
({
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
+
({ className, ...props }, ref) => {
|
|
22
|
+
const [{ switch: switchVariantProps, switchMark: switchMarkVariantProps }, otherProps] = splitMultipleVariantsProps(
|
|
23
|
+
{
|
|
24
|
+
...props,
|
|
25
|
+
// TODO: replace this mapping completely
|
|
26
|
+
size: props.size === "small" ? "16" : props.size === "medium" ? "32" : props.size
|
|
27
|
+
},
|
|
28
|
+
{ switchMark, switch: switchStyle }
|
|
29
|
+
);
|
|
30
|
+
const classNames = switchStyle(switchVariantProps);
|
|
31
|
+
return /* @__PURE__ */ jsx(ControlPropsProvider, { value: switchMarkVariantProps, children: /* @__PURE__ */ jsx(ClassNamesProvider, { value: classNames, children: /* @__PURE__ */ jsx(
|
|
21
32
|
Switch.Root,
|
|
22
33
|
{
|
|
23
34
|
ref,
|
|
24
35
|
className: clsx(classNames.root, className),
|
|
25
36
|
...otherProps
|
|
26
37
|
}
|
|
27
|
-
) });
|
|
38
|
+
) }) });
|
|
28
39
|
}
|
|
29
40
|
);
|
|
30
|
-
|
|
41
|
+
SwitchRoot.displayName = "SwitchRoot";
|
|
42
|
+
const SwitchControl = withControlProvider(
|
|
31
43
|
Switch.Control,
|
|
32
|
-
"
|
|
44
|
+
"root"
|
|
33
45
|
);
|
|
34
|
-
const SwitchThumb =
|
|
46
|
+
const SwitchThumb = withControlContext(
|
|
35
47
|
Switch.Thumb,
|
|
36
48
|
"thumb"
|
|
37
49
|
);
|
package/lib/components/index.cjs
CHANGED
|
@@ -14,7 +14,7 @@ const BottomSheet_namespace = require('./BottomSheet/BottomSheet.namespace.cjs')
|
|
|
14
14
|
const Box = require('./Box/Box.cjs');
|
|
15
15
|
const Callout = require('./Callout/Callout.cjs');
|
|
16
16
|
const Callout_namespace = require('./Callout/Callout.namespace.cjs');
|
|
17
|
-
const
|
|
17
|
+
const Celsius = require('./Celsius/Celsius.cjs');
|
|
18
18
|
const Checkbox = require('./Checkbox/Checkbox.cjs');
|
|
19
19
|
const Checkbox_namespace = require('./Checkbox/Checkbox.namespace.cjs');
|
|
20
20
|
const Chip = require('./Chip/Chip.cjs');
|
|
@@ -47,6 +47,7 @@ const InlineBanner = require('./InlineBanner/InlineBanner.cjs');
|
|
|
47
47
|
const InlineBanner_namespace = require('./InlineBanner/InlineBanner.namespace.cjs');
|
|
48
48
|
const LinkContent = require('./LinkContent/LinkContent.cjs');
|
|
49
49
|
const List = require('./List/List.cjs');
|
|
50
|
+
const ListHeader = require('./List/ListHeader.cjs');
|
|
50
51
|
const List_namespace = require('./List/List.namespace.cjs');
|
|
51
52
|
const LoadingIndicator = require('./LoadingIndicator/LoadingIndicator.cjs');
|
|
52
53
|
const MannerTemp = require('./MannerTemp/MannerTemp.cjs');
|
|
@@ -132,7 +133,7 @@ exports.CalloutLink = Callout.CalloutLink;
|
|
|
132
133
|
exports.CalloutRoot = Callout.CalloutRoot;
|
|
133
134
|
exports.CalloutTitle = Callout.CalloutTitle;
|
|
134
135
|
exports.Callout = Callout_namespace;
|
|
135
|
-
exports.
|
|
136
|
+
exports.Celsius = Celsius.Celsius;
|
|
136
137
|
exports.CheckboxControl = Checkbox.CheckboxControl;
|
|
137
138
|
exports.CheckboxHiddenInput = Checkbox.CheckboxHiddenInput;
|
|
138
139
|
exports.CheckboxIndicator = Checkbox.CheckboxIndicator;
|
|
@@ -224,6 +225,7 @@ exports.ListPrefix = List.ListPrefix;
|
|
|
224
225
|
exports.ListRoot = List.ListRoot;
|
|
225
226
|
exports.ListSuffix = List.ListSuffix;
|
|
226
227
|
exports.ListTitle = List.ListTitle;
|
|
228
|
+
exports.ListHeader = ListHeader.ListHeader;
|
|
227
229
|
exports.List = List_namespace;
|
|
228
230
|
exports.LoadingIndicator = LoadingIndicator.LoadingIndicator;
|
|
229
231
|
exports.MannerTemp = MannerTemp.MannerTemp;
|
package/lib/components/index.js
CHANGED
|
@@ -14,7 +14,7 @@ export { Box } from './Box/Box.js';
|
|
|
14
14
|
export { CalloutCloseButton, CalloutContent, CalloutDescription, CalloutLink, CalloutRoot, CalloutTitle } from './Callout/Callout.js';
|
|
15
15
|
import * as Callout_namespace from './Callout/Callout.namespace.js';
|
|
16
16
|
export { Callout_namespace as Callout };
|
|
17
|
-
export {
|
|
17
|
+
export { Celsius } from './Celsius/Celsius.js';
|
|
18
18
|
export { CheckboxControl, CheckboxHiddenInput, CheckboxIndicator, CheckboxLabel, CheckboxRoot } from './Checkbox/Checkbox.js';
|
|
19
19
|
import * as Checkbox_namespace from './Checkbox/Checkbox.namespace.js';
|
|
20
20
|
export { Checkbox_namespace as Checkbox };
|
|
@@ -56,6 +56,7 @@ import * as InlineBanner_namespace from './InlineBanner/InlineBanner.namespace.j
|
|
|
56
56
|
export { InlineBanner_namespace as InlineBanner };
|
|
57
57
|
export { LinkContent } from './LinkContent/LinkContent.js';
|
|
58
58
|
export { ListContent, ListDetail, ListItem, ListPrefix, ListRoot, ListSuffix, ListTitle } from './List/List.js';
|
|
59
|
+
export { ListHeader } from './List/ListHeader.js';
|
|
59
60
|
import * as List_namespace from './List/List.namespace.js';
|
|
60
61
|
export { List_namespace as List };
|
|
61
62
|
export { LoadingIndicator } from './LoadingIndicator/LoadingIndicator.js';
|
package/lib/index.cjs
CHANGED
|
@@ -14,7 +14,7 @@ const BottomSheet_namespace = require('./components/BottomSheet/BottomSheet.name
|
|
|
14
14
|
const Box = require('./components/Box/Box.cjs');
|
|
15
15
|
const Callout = require('./components/Callout/Callout.cjs');
|
|
16
16
|
const Callout_namespace = require('./components/Callout/Callout.namespace.cjs');
|
|
17
|
-
const
|
|
17
|
+
const Celsius = require('./components/Celsius/Celsius.cjs');
|
|
18
18
|
const Checkbox = require('./components/Checkbox/Checkbox.cjs');
|
|
19
19
|
const Checkbox_namespace = require('./components/Checkbox/Checkbox.namespace.cjs');
|
|
20
20
|
const Chip = require('./components/Chip/Chip.cjs');
|
|
@@ -47,6 +47,7 @@ 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
49
|
const List = require('./components/List/List.cjs');
|
|
50
|
+
const ListHeader = require('./components/List/ListHeader.cjs');
|
|
50
51
|
const List_namespace = require('./components/List/List.namespace.cjs');
|
|
51
52
|
const LoadingIndicator = require('./components/LoadingIndicator/LoadingIndicator.cjs');
|
|
52
53
|
const MannerTemp = require('./components/MannerTemp/MannerTemp.cjs');
|
|
@@ -132,7 +133,7 @@ exports.CalloutLink = Callout.CalloutLink;
|
|
|
132
133
|
exports.CalloutRoot = Callout.CalloutRoot;
|
|
133
134
|
exports.CalloutTitle = Callout.CalloutTitle;
|
|
134
135
|
exports.Callout = Callout_namespace;
|
|
135
|
-
exports.
|
|
136
|
+
exports.Celsius = Celsius.Celsius;
|
|
136
137
|
exports.CheckboxControl = Checkbox.CheckboxControl;
|
|
137
138
|
exports.CheckboxHiddenInput = Checkbox.CheckboxHiddenInput;
|
|
138
139
|
exports.CheckboxIndicator = Checkbox.CheckboxIndicator;
|
|
@@ -224,6 +225,7 @@ exports.ListPrefix = List.ListPrefix;
|
|
|
224
225
|
exports.ListRoot = List.ListRoot;
|
|
225
226
|
exports.ListSuffix = List.ListSuffix;
|
|
226
227
|
exports.ListTitle = List.ListTitle;
|
|
228
|
+
exports.ListHeader = ListHeader.ListHeader;
|
|
227
229
|
exports.List = List_namespace;
|
|
228
230
|
exports.LoadingIndicator = LoadingIndicator.LoadingIndicator;
|
|
229
231
|
exports.MannerTemp = MannerTemp.MannerTemp;
|
package/lib/index.js
CHANGED
|
@@ -14,7 +14,7 @@ export { Box } from './components/Box/Box.js';
|
|
|
14
14
|
export { CalloutCloseButton, CalloutContent, CalloutDescription, CalloutLink, CalloutRoot, CalloutTitle } from './components/Callout/Callout.js';
|
|
15
15
|
import * as Callout_namespace from './components/Callout/Callout.namespace.js';
|
|
16
16
|
export { Callout_namespace as Callout };
|
|
17
|
-
export {
|
|
17
|
+
export { Celsius } from './components/Celsius/Celsius.js';
|
|
18
18
|
export { CheckboxControl, CheckboxHiddenInput, CheckboxIndicator, CheckboxLabel, CheckboxRoot } from './components/Checkbox/Checkbox.js';
|
|
19
19
|
import * as Checkbox_namespace from './components/Checkbox/Checkbox.namespace.js';
|
|
20
20
|
export { Checkbox_namespace as Checkbox };
|
|
@@ -56,6 +56,7 @@ import * as InlineBanner_namespace from './components/InlineBanner/InlineBanner.
|
|
|
56
56
|
export { InlineBanner_namespace as InlineBanner };
|
|
57
57
|
export { LinkContent } from './components/LinkContent/LinkContent.js';
|
|
58
58
|
export { ListContent, ListDetail, ListItem, ListPrefix, ListRoot, ListSuffix, ListTitle } from './components/List/List.js';
|
|
59
|
+
export { ListHeader } from './components/List/ListHeader.js';
|
|
59
60
|
import * as List_namespace from './components/List/List.namespace.js';
|
|
60
61
|
export { List_namespace as List };
|
|
61
62
|
export { LoadingIndicator } from './components/LoadingIndicator/LoadingIndicator.js';
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
5
|
+
|
|
6
|
+
function splitMultipleVariantsProps(props, recipesMap) {
|
|
7
|
+
const multipleVariantsProps = {};
|
|
8
|
+
const extractedKeys = new Set();
|
|
9
|
+
|
|
10
|
+
for (const recipeKey in recipesMap) {
|
|
11
|
+
const recipe = recipesMap[recipeKey];
|
|
12
|
+
|
|
13
|
+
const [variantProps] = recipe.splitVariantProps(props);
|
|
14
|
+
multipleVariantsProps[recipeKey] = variantProps;
|
|
15
|
+
|
|
16
|
+
for (const variantPropKey in variantProps) {
|
|
17
|
+
extractedKeys.add(variantPropKey);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const remainingProps = {};
|
|
22
|
+
|
|
23
|
+
for (const propKey in props) {
|
|
24
|
+
if (extractedKeys.has(propKey)) continue;
|
|
25
|
+
|
|
26
|
+
remainingProps[propKey] = props[propKey];
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
return [multipleVariantsProps, remainingProps];
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
exports.splitMultipleVariantsProps = splitMultipleVariantsProps;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
type ExtractVariantProps<T> = T extends {
|
|
2
|
+
splitVariantProps: (...args: never[]) => [infer V, unknown];
|
|
3
|
+
}
|
|
4
|
+
? V
|
|
5
|
+
: never;
|
|
6
|
+
|
|
7
|
+
type ExtractAllVariantKeys<R> = {
|
|
8
|
+
[K in keyof R]: ExtractVariantProps<R[K]> extends infer V
|
|
9
|
+
? V extends Record<string, unknown>
|
|
10
|
+
? keyof V
|
|
11
|
+
: never
|
|
12
|
+
: never;
|
|
13
|
+
}[keyof R];
|
|
14
|
+
|
|
15
|
+
export declare function splitMultipleVariantsProps<
|
|
16
|
+
R extends Record<string, { splitVariantProps: (...args: never[]) => unknown[] }>,
|
|
17
|
+
P,
|
|
18
|
+
>(
|
|
19
|
+
props: P,
|
|
20
|
+
recipesMap: R,
|
|
21
|
+
): [{ [K in keyof R]: ExtractVariantProps<R[K]> }, Omit<P, ExtractAllVariantKeys<R>>];
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
function splitMultipleVariantsProps(props, recipesMap) {
|
|
3
|
+
const multipleVariantsProps = {};
|
|
4
|
+
const extractedKeys = new Set();
|
|
5
|
+
|
|
6
|
+
for (const recipeKey in recipesMap) {
|
|
7
|
+
const recipe = recipesMap[recipeKey];
|
|
8
|
+
|
|
9
|
+
const [variantProps] = recipe.splitVariantProps(props);
|
|
10
|
+
multipleVariantsProps[recipeKey] = variantProps;
|
|
11
|
+
|
|
12
|
+
for (const variantPropKey in variantProps) {
|
|
13
|
+
extractedKeys.add(variantPropKey);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const remainingProps = {};
|
|
18
|
+
|
|
19
|
+
for (const propKey in props) {
|
|
20
|
+
if (extractedKeys.has(propKey)) continue;
|
|
21
|
+
|
|
22
|
+
remainingProps[propKey] = props[propKey];
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return [multipleVariantsProps, remainingProps];
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export { splitMultipleVariantsProps };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@seed-design/react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/daangn/seed-design.git",
|
|
@@ -39,31 +39,31 @@
|
|
|
39
39
|
"@radix-ui/react-slot": "^1.2.3",
|
|
40
40
|
"@radix-ui/react-use-controllable-state": "1.2.2",
|
|
41
41
|
"@radix-ui/react-use-layout-effect": "^1.1.1",
|
|
42
|
-
"@seed-design/dom-utils": "0.0
|
|
43
|
-
"@seed-design/react-avatar": "0.0
|
|
44
|
-
"@seed-design/react-checkbox": "0.0
|
|
45
|
-
"@seed-design/react-dialog": "0.0
|
|
46
|
-
"@seed-design/react-popover": "0.0
|
|
47
|
-
"@seed-design/react-portal": "0.0
|
|
48
|
-
"@seed-design/react-primitive": "0.0
|
|
49
|
-
"@seed-design/react-progress": "0.0
|
|
50
|
-
"@seed-design/react-pull-to-refresh": "0.0
|
|
51
|
-
"@seed-design/react-radio-group": "0.0
|
|
52
|
-
"@seed-design/react-segmented-control": "0.0
|
|
53
|
-
"@seed-design/react-snackbar": "0.0
|
|
54
|
-
"@seed-design/react-switch": "0.0
|
|
55
|
-
"@seed-design/react-tabs": "0.0
|
|
56
|
-
"@seed-design/react-text-field": "0.0
|
|
57
|
-
"@seed-design/react-toggle": "0.0
|
|
42
|
+
"@seed-design/dom-utils": "1.0.0",
|
|
43
|
+
"@seed-design/react-avatar": "1.0.0",
|
|
44
|
+
"@seed-design/react-checkbox": "1.0.0",
|
|
45
|
+
"@seed-design/react-dialog": "1.0.0",
|
|
46
|
+
"@seed-design/react-popover": "1.0.0",
|
|
47
|
+
"@seed-design/react-portal": "1.0.0",
|
|
48
|
+
"@seed-design/react-primitive": "1.0.0",
|
|
49
|
+
"@seed-design/react-progress": "1.0.0",
|
|
50
|
+
"@seed-design/react-pull-to-refresh": "1.0.0",
|
|
51
|
+
"@seed-design/react-radio-group": "1.0.0",
|
|
52
|
+
"@seed-design/react-segmented-control": "1.0.0",
|
|
53
|
+
"@seed-design/react-snackbar": "1.0.0",
|
|
54
|
+
"@seed-design/react-switch": "1.0.0",
|
|
55
|
+
"@seed-design/react-tabs": "1.0.0",
|
|
56
|
+
"@seed-design/react-text-field": "1.0.0",
|
|
57
|
+
"@seed-design/react-toggle": "1.0.0",
|
|
58
58
|
"clsx": "^2.1.1"
|
|
59
59
|
},
|
|
60
60
|
"peerDependencies": {
|
|
61
|
-
"@seed-design/css": "0.
|
|
61
|
+
"@seed-design/css": "1.0.0",
|
|
62
62
|
"react": ">=18.0.0",
|
|
63
63
|
"react-dom": ">=18.0.0"
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
66
|
-
"@seed-design/css": "0.
|
|
66
|
+
"@seed-design/css": "1.0.0",
|
|
67
67
|
"@vitejs/plugin-react": "^5.0.0",
|
|
68
68
|
"ajv": "^8.17.1",
|
|
69
69
|
"globby": "^14.1.0",
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { checkbox, type CheckboxVariantProps } from "@seed-design/css/recipes/checkbox";
|
|
2
2
|
import { checkmark, type CheckmarkVariantProps } from "@seed-design/css/recipes/checkmark";
|
|
3
|
+
import { splitMultipleVariantsProps } from "../../utils/splitMultipleVariantsProps";
|
|
3
4
|
import { mergeProps } from "@seed-design/dom-utils";
|
|
4
5
|
import { Checkbox as CheckboxPrimitive, useCheckboxContext } from "@seed-design/react-checkbox";
|
|
5
6
|
import { Primitive, type PrimitiveProps } from "@seed-design/react-primitive";
|
|
@@ -33,21 +34,20 @@ export interface CheckboxRootProps
|
|
|
33
34
|
|
|
34
35
|
export const CheckboxRoot = Object.assign(
|
|
35
36
|
forwardRef<HTMLLabelElement, CheckboxRootProps>(({ className, ...props }, ref) => {
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
const [, otherProps] = checkmark.splitVariantProps(__otherProps);
|
|
37
|
+
const [{ checkbox: checkboxVariantProps, checkmark: checkmarkVariantProps }, otherProps] =
|
|
38
|
+
splitMultipleVariantsProps(
|
|
39
|
+
{
|
|
40
|
+
...props,
|
|
41
|
+
// TODO: replace this mapping completely
|
|
42
|
+
weight:
|
|
43
|
+
props.weight === "stronger"
|
|
44
|
+
? "bold"
|
|
45
|
+
: props.weight === "default"
|
|
46
|
+
? "regular"
|
|
47
|
+
: props.weight,
|
|
48
|
+
},
|
|
49
|
+
{ checkbox, checkmark },
|
|
50
|
+
);
|
|
51
51
|
|
|
52
52
|
const classNames = checkbox(checkboxVariantProps);
|
|
53
53
|
|
|
@@ -9,11 +9,13 @@ import { VStack, type VStackProps } from "../Stack";
|
|
|
9
9
|
import { useCheckboxContext } from "@seed-design/react-checkbox";
|
|
10
10
|
import { createWithStateProps } from "../../utils/createWithStateProps";
|
|
11
11
|
import { useRadioGroupItemContext } from "@seed-design/react-radio-group";
|
|
12
|
+
import { useSwitchContext } from "@seed-design/react-switch";
|
|
12
13
|
|
|
13
14
|
const { withContext, withProvider } = createSlotRecipeContext(listItem);
|
|
14
|
-
const withStateProps = createWithStateProps(
|
|
15
|
-
|
|
16
|
-
}
|
|
15
|
+
const withStateProps = createWithStateProps(
|
|
16
|
+
[useCheckboxContext, useRadioGroupItemContext, useSwitchContext],
|
|
17
|
+
{ strict: false },
|
|
18
|
+
);
|
|
17
19
|
|
|
18
20
|
export interface ListRootProps extends VStackProps {}
|
|
19
21
|
|
|
File without changes
|