@seed-design/lynx-react 0.1.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/_virtual/_rolldown/runtime.js +13 -0
- package/lib/components/ActionButton/ActionButton.d.ts +44 -0
- package/lib/components/ActionButton/ActionButton.d.ts.map +1 -0
- package/lib/components/ActionButton/ActionButton.jsx +158 -0
- package/lib/components/ActionButton/index.d.ts +2 -0
- package/lib/components/ActionButton/index.d.ts.map +1 -0
- package/lib/components/BottomSheet/BottomSheet.d.ts +87 -0
- package/lib/components/BottomSheet/BottomSheet.d.ts.map +1 -0
- package/lib/components/BottomSheet/BottomSheet.jsx +150 -0
- package/lib/components/BottomSheet/BottomSheet.namespace.d.ts +2 -0
- package/lib/components/BottomSheet/BottomSheet.namespace.d.ts.map +1 -0
- package/lib/components/BottomSheet/BottomSheet.namespace.js +18 -0
- package/lib/components/BottomSheet/index.d.ts +3 -0
- package/lib/components/BottomSheet/index.d.ts.map +1 -0
- package/lib/components/Box/Box.d.ts +20 -0
- package/lib/components/Box/Box.d.ts.map +1 -0
- package/lib/components/Box/Box.jsx +14 -0
- package/lib/components/Box/index.d.ts +2 -0
- package/lib/components/Box/index.d.ts.map +1 -0
- package/lib/components/Checkbox/Checkbox.d.ts +35 -0
- package/lib/components/Checkbox/Checkbox.d.ts.map +1 -0
- package/lib/components/Checkbox/Checkbox.jsx +130 -0
- package/lib/components/Checkbox/Checkbox.namespace.d.ts +2 -0
- package/lib/components/Checkbox/Checkbox.namespace.d.ts.map +1 -0
- package/lib/components/Checkbox/Checkbox.namespace.js +12 -0
- package/lib/components/Checkbox/index.d.ts +3 -0
- package/lib/components/Checkbox/index.d.ts.map +1 -0
- package/lib/components/Icon/Icon.d.ts +37 -0
- package/lib/components/Icon/Icon.d.ts.map +1 -0
- package/lib/components/Icon/Icon.jsx +143 -0
- package/lib/components/Icon/index.d.ts +2 -0
- package/lib/components/Icon/index.d.ts.map +1 -0
- package/lib/components/ProgressCircle/ProgressCircle.d.ts +25 -0
- package/lib/components/ProgressCircle/ProgressCircle.d.ts.map +1 -0
- package/lib/components/ProgressCircle/ProgressCircle.jsx +281 -0
- package/lib/components/ProgressCircle/ProgressCircle.namespace.d.ts +2 -0
- package/lib/components/ProgressCircle/ProgressCircle.namespace.d.ts.map +1 -0
- package/lib/components/ProgressCircle/ProgressCircle.namespace.js +9 -0
- package/lib/components/ProgressCircle/index.d.ts +3 -0
- package/lib/components/ProgressCircle/index.d.ts.map +1 -0
- package/lib/components/RadioGroup/RadioGroup.d.ts +34 -0
- package/lib/components/RadioGroup/RadioGroup.d.ts.map +1 -0
- package/lib/components/RadioGroup/RadioGroup.jsx +160 -0
- package/lib/components/RadioGroup/RadioGroup.namespace.d.ts +2 -0
- package/lib/components/RadioGroup/RadioGroup.namespace.d.ts.map +1 -0
- package/lib/components/RadioGroup/RadioGroup.namespace.js +12 -0
- package/lib/components/RadioGroup/index.d.ts +3 -0
- package/lib/components/RadioGroup/index.d.ts.map +1 -0
- package/lib/components/Stack/Stack.d.ts +33 -0
- package/lib/components/Stack/Stack.d.ts.map +1 -0
- package/lib/components/Stack/Stack.jsx +39 -0
- package/lib/components/Stack/index.d.ts +2 -0
- package/lib/components/Stack/index.d.ts.map +1 -0
- package/lib/components/Switch/Switch.d.ts +21 -0
- package/lib/components/Switch/Switch.d.ts.map +1 -0
- package/lib/components/Switch/Switch.jsx +101 -0
- package/lib/components/Switch/Switch.namespace.d.ts +2 -0
- package/lib/components/Switch/Switch.namespace.d.ts.map +1 -0
- package/lib/components/Switch/Switch.namespace.js +11 -0
- package/lib/components/Switch/index.d.ts +3 -0
- package/lib/components/Switch/index.d.ts.map +1 -0
- package/lib/components/TagGroup/TagGroup.d.ts +34 -0
- package/lib/components/TagGroup/TagGroup.d.ts.map +1 -0
- package/lib/components/TagGroup/TagGroup.jsx +57 -0
- package/lib/components/TagGroup/TagGroup.namespace.d.ts +2 -0
- package/lib/components/TagGroup/TagGroup.namespace.d.ts.map +1 -0
- package/lib/components/TagGroup/TagGroup.namespace.js +10 -0
- package/lib/components/TagGroup/index.d.ts +3 -0
- package/lib/components/TagGroup/index.d.ts.map +1 -0
- package/lib/components/Text/Text.d.ts +7 -0
- package/lib/components/Text/Text.d.ts.map +1 -0
- package/lib/components/Text/Text.jsx +28 -0
- package/lib/components/Text/index.d.ts +2 -0
- package/lib/components/Text/index.d.ts.map +1 -0
- package/lib/components/index.d.ts +12 -0
- package/lib/components/index.d.ts.map +1 -0
- package/lib/hooks/index.d.ts +5 -0
- package/lib/hooks/index.d.ts.map +1 -0
- package/lib/hooks/useControllableState.d.ts +15 -0
- package/lib/hooks/useControllableState.d.ts.map +1 -0
- package/lib/hooks/useControllableState.js +27 -0
- package/lib/hooks/useIconColor.d.ts +19 -0
- package/lib/hooks/useIconColor.d.ts.map +1 -0
- package/lib/hooks/useIconColor.js +38 -0
- package/lib/hooks/usePressTap.d.ts +27 -0
- package/lib/hooks/usePressTap.d.ts.map +1 -0
- package/lib/hooks/usePressTap.js +35 -0
- package/lib/hooks/useSafeArea.d.ts +19 -0
- package/lib/hooks/useSafeArea.d.ts.map +1 -0
- package/lib/hooks/useSafeArea.js +33 -0
- package/lib/index.d.ts +5 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +26 -0
- package/lib/types.d.ts +33 -0
- package/lib/types.d.ts.map +1 -0
- package/lib/utils/children.d.ts +3 -0
- package/lib/utils/children.d.ts.map +1 -0
- package/lib/utils/children.js +8 -0
- package/lib/utils/create-slot-recipe-context.d.ts +27 -0
- package/lib/utils/create-slot-recipe-context.d.ts.map +1 -0
- package/lib/utils/create-slot-recipe-context.jsx +94 -0
- package/lib/utils/get-seed-class-name.d.ts +22 -0
- package/lib/utils/get-seed-class-name.d.ts.map +1 -0
- package/lib/utils/get-seed-class-name.js +28 -0
- package/lib/utils/index.d.ts +5 -0
- package/lib/utils/index.d.ts.map +1 -0
- package/lib/utils/resolve-recipe-token.d.ts +38 -0
- package/lib/utils/resolve-recipe-token.d.ts.map +1 -0
- package/lib/utils/resolve-recipe-token.js +49 -0
- package/lib/utils/split-multiple-variants-props.d.ts +29 -0
- package/lib/utils/split-multiple-variants-props.d.ts.map +1 -0
- package/lib/utils/split-multiple-variants-props.js +34 -0
- package/lib/utils/styled.d.ts +83 -0
- package/lib/utils/styled.d.ts.map +1 -0
- package/lib/utils/styled.js +144 -0
- package/package.json +54 -0
- package/src/components/ActionButton/ActionButton.test.tsx +137 -0
- package/src/components/ActionButton/ActionButton.tsx +340 -0
- package/src/components/ActionButton/index.ts +1 -0
- package/src/components/BottomSheet/BottomSheet.namespace.ts +24 -0
- package/src/components/BottomSheet/BottomSheet.test.tsx +153 -0
- package/src/components/BottomSheet/BottomSheet.tsx +397 -0
- package/src/components/BottomSheet/index.ts +27 -0
- package/src/components/Box/Box.test.tsx +85 -0
- package/src/components/Box/Box.tsx +39 -0
- package/src/components/Box/index.ts +1 -0
- package/src/components/Checkbox/Checkbox.namespace.ts +12 -0
- package/src/components/Checkbox/Checkbox.tsx +282 -0
- package/src/components/Checkbox/index.ts +14 -0
- package/src/components/Icon/Icon.tsx +265 -0
- package/src/components/Icon/index.ts +8 -0
- package/src/components/ProgressCircle/ProgressCircle.namespace.ts +5 -0
- package/src/components/ProgressCircle/ProgressCircle.tsx +424 -0
- package/src/components/ProgressCircle/index.ts +9 -0
- package/src/components/RadioGroup/RadioGroup.namespace.ts +12 -0
- package/src/components/RadioGroup/RadioGroup.tsx +320 -0
- package/src/components/RadioGroup/index.ts +14 -0
- package/src/components/Stack/Stack.tsx +97 -0
- package/src/components/Stack/index.ts +1 -0
- package/src/components/Switch/Switch.namespace.ts +10 -0
- package/src/components/Switch/Switch.tsx +200 -0
- package/src/components/Switch/index.ts +12 -0
- package/src/components/TagGroup/TagGroup.namespace.ts +8 -0
- package/src/components/TagGroup/TagGroup.tsx +127 -0
- package/src/components/TagGroup/index.ts +10 -0
- package/src/components/Text/Text.tsx +64 -0
- package/src/components/Text/index.ts +1 -0
- package/src/components/index.ts +11 -0
- package/src/hooks/index.ts +4 -0
- package/src/hooks/useControllableState.test.ts +120 -0
- package/src/hooks/useControllableState.ts +38 -0
- package/src/hooks/useIconColor.test.ts +13 -0
- package/src/hooks/useIconColor.ts +67 -0
- package/src/hooks/usePressTap.test.ts +129 -0
- package/src/hooks/usePressTap.ts +58 -0
- package/src/hooks/useSafeArea.test.ts +83 -0
- package/src/hooks/useSafeArea.ts +56 -0
- package/src/index.ts +4 -0
- package/src/types.ts +45 -0
- package/src/utils/children.ts +13 -0
- package/src/utils/create-slot-recipe-context.test.tsx +96 -0
- package/src/utils/create-slot-recipe-context.tsx +187 -0
- package/src/utils/get-seed-class-name.ts +47 -0
- package/src/utils/index.ts +4 -0
- package/src/utils/resolve-recipe-token.ts +47 -0
- package/src/utils/split-multiple-variants-props.test.ts +61 -0
- package/src/utils/split-multiple-variants-props.ts +59 -0
- package/src/utils/styled.ts +442 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { __exportAll } from "../../_virtual/_rolldown/runtime.js";
|
|
2
|
+
import { ProgressCircleRange, ProgressCircleRoot } from "./ProgressCircle.jsx";
|
|
3
|
+
//#region src/components/ProgressCircle/ProgressCircle.namespace.ts
|
|
4
|
+
var ProgressCircle_namespace_exports = /* @__PURE__ */ __exportAll({
|
|
5
|
+
Range: () => ProgressCircleRange,
|
|
6
|
+
Root: () => ProgressCircleRoot
|
|
7
|
+
});
|
|
8
|
+
//#endregion
|
|
9
|
+
export { ProgressCircle_namespace_exports };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { ProgressCircleRange, ProgressCircleRoot, type ProgressCircleRootProps, type ProgressCircleRootProps as ProgressCircleProps, type RootProps, } from './ProgressCircle';
|
|
2
|
+
export * as ProgressCircle from './ProgressCircle.namespace';
|
|
3
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/ProgressCircle/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,kBAAkB,EAClB,KAAK,uBAAuB,EAC5B,KAAK,uBAAuB,IAAI,mBAAmB,EACnD,KAAK,SAAS,GACf,MAAM,kBAAkB,CAAC;AAE1B,OAAO,KAAK,cAAc,MAAM,4BAA4B,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { ReactElement } from '@lynx-js/react';
|
|
2
|
+
import { RadioVariantProps } from '@seed-design/lynx-css/recipes/radio';
|
|
3
|
+
import { RadiomarkVariantProps } from '@seed-design/lynx-css/recipes/radiomark';
|
|
4
|
+
import { LynxIconElementProps, LynxStyledElementProps } from '../../types';
|
|
5
|
+
import * as React from "@lynx-js/react";
|
|
6
|
+
export interface RadioGroupRootProps extends RadioVariantProps, Omit<RadiomarkVariantProps, "size" | "checked" | "disabled">, LynxStyledElementProps {
|
|
7
|
+
value?: string;
|
|
8
|
+
defaultValue?: string;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
onValueChange?: (value: string) => void;
|
|
11
|
+
}
|
|
12
|
+
export declare const RadioGroupRoot: React.ForwardRefExoticComponent<RadioGroupRootProps & React.RefAttributes<unknown>>;
|
|
13
|
+
export interface RadioGroupItemProps extends LynxStyledElementProps {
|
|
14
|
+
value: string;
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
}
|
|
17
|
+
export declare const RadioGroupItem: React.ForwardRefExoticComponent<RadioGroupItemProps & React.RefAttributes<unknown>>;
|
|
18
|
+
export interface RadioGroupItemControlProps extends Pick<RadiomarkVariantProps, "tone">, LynxStyledElementProps {
|
|
19
|
+
}
|
|
20
|
+
export declare const RadioGroupItemControl: React.ForwardRefExoticComponent<RadioGroupItemControlProps & React.RefAttributes<unknown>>;
|
|
21
|
+
export interface RadioGroupItemIndicatorProps extends Pick<LynxStyledElementProps, "className" | "style"> {
|
|
22
|
+
/** Icon rendered when not checked. Optional — falls back to default `<view>` dot when omitted. */
|
|
23
|
+
unchecked?: ReactElement<LynxIconElementProps>;
|
|
24
|
+
/** Icon rendered when the item is checked. Optional — falls back to default `<view>` dot when omitted. */
|
|
25
|
+
checked?: ReactElement<LynxIconElementProps>;
|
|
26
|
+
}
|
|
27
|
+
export declare function RadioGroupItemIndicator(props: RadioGroupItemIndicatorProps): React.JSX.Element;
|
|
28
|
+
export declare namespace RadioGroupItemIndicator {
|
|
29
|
+
var displayName: string;
|
|
30
|
+
}
|
|
31
|
+
export interface RadioGroupItemLabelProps extends LynxStyledElementProps {
|
|
32
|
+
}
|
|
33
|
+
export declare const RadioGroupItemLabel: React.ForwardRefExoticComponent<RadioGroupItemLabelProps & React.RefAttributes<unknown>>;
|
|
34
|
+
//# sourceMappingURL=RadioGroup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RadioGroup.d.ts","sourceRoot":"","sources":["../../../src/components/RadioGroup/RadioGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAAkB,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAInE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AAE7E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,yCAAyC,CAAC;AAKrF,OAAO,KAAK,EACV,oBAAoB,EACpB,sBAAsB,EAGvB,MAAM,aAAa,CAAC;AAsErB,MAAM,WAAW,mBACf,SAAQ,iBAAiB,EACvB,IAAI,CAAC,qBAAqB,EAAE,MAAM,GAAG,SAAS,GAAG,UAAU,CAAC,EAC5D,sBAAsB;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACzC;AAED,eAAO,MAAM,cAAc,qFAyDzB,CAAC;AAKH,MAAM,WAAW,mBAAoB,SAAQ,sBAAsB;IACjE,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,eAAO,MAAM,cAAc,qFA+CzB,CAAC;AAKH,MAAM,WAAW,0BACf,SAAQ,IAAI,CAAC,qBAAqB,EAAE,MAAM,CAAC,EACzC,sBAAsB;CAAG;AAE7B,eAAO,MAAM,qBAAqB,4FA6BjC,CAAC;AAKF,MAAM,WAAW,4BACf,SAAQ,IAAI,CAAC,sBAAsB,EAAE,WAAW,GAAG,OAAO,CAAC;IAC3D,kGAAkG;IAClG,SAAS,CAAC,EAAE,YAAY,CAAC,oBAAoB,CAAC,CAAC;IAC/C,0GAA0G;IAC1G,OAAO,CAAC,EAAE,YAAY,CAAC,oBAAoB,CAAC,CAAC;CAC9C;AAED,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,4BAA4B,qBA6B1E;yBA7Be,uBAAuB;;;AAkCvC,MAAM,WAAW,wBAAyB,SAAQ,sBAAsB;CAAG;AAE3E,eAAO,MAAM,mBAAmB,0FAoB/B,CAAC"}
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import { usePressTap } from "../../hooks/usePressTap.js";
|
|
2
|
+
import { InternalIcon } from "../Icon/Icon.jsx";
|
|
3
|
+
import { useControllableState } from "../../hooks/useControllableState.js";
|
|
4
|
+
import { splitMultipleVariantsProps } from "../../utils/split-multiple-variants-props.js";
|
|
5
|
+
import clsx from "clsx";
|
|
6
|
+
import * as React from "@lynx-js/react";
|
|
7
|
+
import { isValidElement } from "@lynx-js/react";
|
|
8
|
+
import { radio } from "@seed-design/lynx-css/recipes/radio";
|
|
9
|
+
import { radiomark } from "@seed-design/lynx-css/recipes/radiomark";
|
|
10
|
+
import { radioGroup } from "@seed-design/lynx-css/recipes/radio-group";
|
|
11
|
+
//#region src/components/RadioGroup/RadioGroup.tsx
|
|
12
|
+
var RadioGroupContext = React.createContext(null);
|
|
13
|
+
function useRadioGroupContext(consumer) {
|
|
14
|
+
const ctx = React.useContext(RadioGroupContext);
|
|
15
|
+
if (!ctx) throw new Error(`<${consumer}/> must be rendered inside <RadioGroupRoot/>.`);
|
|
16
|
+
return ctx;
|
|
17
|
+
}
|
|
18
|
+
var RadioGroupItemContext = React.createContext(null);
|
|
19
|
+
function useRadioGroupItemContext(consumer) {
|
|
20
|
+
const ctx = React.useContext(RadioGroupItemContext);
|
|
21
|
+
if (!ctx) throw new Error(`<${consumer}/> must be rendered inside <RadioGroupItem/>.`);
|
|
22
|
+
return ctx;
|
|
23
|
+
}
|
|
24
|
+
var RadiomarkControlContext = React.createContext(null);
|
|
25
|
+
function useRadiomarkControlContext(consumer) {
|
|
26
|
+
const ctx = React.useContext(RadiomarkControlContext);
|
|
27
|
+
if (!ctx) throw new Error(`<${consumer}/> must be rendered inside <RadioGroupItemControl/>.`);
|
|
28
|
+
return ctx;
|
|
29
|
+
}
|
|
30
|
+
var RadioGroupRoot = React.forwardRef((props, ref) => {
|
|
31
|
+
const { children, className, value: valueProp, defaultValue, disabled = false, onValueChange, ...restProps } = props;
|
|
32
|
+
const [{ radio: radioVariantProps, radiomark: radiomarkVariantProps }, nativeProps] = splitMultipleVariantsProps(restProps, {
|
|
33
|
+
radio,
|
|
34
|
+
radiomark
|
|
35
|
+
});
|
|
36
|
+
const handleChange = React.useCallback((next) => {
|
|
37
|
+
if (next !== null) onValueChange?.(next);
|
|
38
|
+
}, [onValueChange]);
|
|
39
|
+
const [value, setValueInternal] = useControllableState({
|
|
40
|
+
value: valueProp !== void 0 ? valueProp : void 0,
|
|
41
|
+
defaultValue: defaultValue ?? null,
|
|
42
|
+
onChange: handleChange
|
|
43
|
+
});
|
|
44
|
+
const setValue = React.useCallback((next) => {
|
|
45
|
+
setValueInternal(next);
|
|
46
|
+
}, [setValueInternal]);
|
|
47
|
+
const rootClassName = radioGroup().root;
|
|
48
|
+
const contextValue = React.useMemo(() => ({
|
|
49
|
+
value,
|
|
50
|
+
setValue,
|
|
51
|
+
disabled,
|
|
52
|
+
radioVariantProps,
|
|
53
|
+
radiomarkVariantProps
|
|
54
|
+
}), [
|
|
55
|
+
value,
|
|
56
|
+
setValue,
|
|
57
|
+
disabled,
|
|
58
|
+
radioVariantProps,
|
|
59
|
+
radiomarkVariantProps
|
|
60
|
+
]);
|
|
61
|
+
return <RadioGroupContext.Provider value={contextValue}>
|
|
62
|
+
<view {...ref ? { ref } : {}} className={clsx(rootClassName, className)} {...nativeProps}>
|
|
63
|
+
{children}
|
|
64
|
+
</view>
|
|
65
|
+
</RadioGroupContext.Provider>;
|
|
66
|
+
});
|
|
67
|
+
RadioGroupRoot.displayName = "RadioGroupRoot";
|
|
68
|
+
var RadioGroupItem = React.forwardRef((props, ref) => {
|
|
69
|
+
const { value: itemValue, disabled: itemDisabled = false, children, className, ...nativeProps } = props;
|
|
70
|
+
const groupContext = useRadioGroupContext("RadioGroupItem");
|
|
71
|
+
const disabled = groupContext.disabled || itemDisabled;
|
|
72
|
+
const checked = groupContext.value === itemValue;
|
|
73
|
+
const select = React.useCallback(() => {
|
|
74
|
+
if (checked) return;
|
|
75
|
+
groupContext.setValue(itemValue);
|
|
76
|
+
}, [
|
|
77
|
+
checked,
|
|
78
|
+
groupContext,
|
|
79
|
+
itemValue
|
|
80
|
+
]);
|
|
81
|
+
const { pressed, ...pressHandlers } = usePressTap({
|
|
82
|
+
disabled,
|
|
83
|
+
onTap: select
|
|
84
|
+
});
|
|
85
|
+
const rootClassName = radio({
|
|
86
|
+
...groupContext.radioVariantProps,
|
|
87
|
+
disabled
|
|
88
|
+
}).root;
|
|
89
|
+
const itemContextValue = React.useMemo(() => ({
|
|
90
|
+
value: itemValue,
|
|
91
|
+
checked,
|
|
92
|
+
disabled,
|
|
93
|
+
pressed,
|
|
94
|
+
select
|
|
95
|
+
}), [
|
|
96
|
+
itemValue,
|
|
97
|
+
checked,
|
|
98
|
+
disabled,
|
|
99
|
+
pressed,
|
|
100
|
+
select
|
|
101
|
+
]);
|
|
102
|
+
return <RadioGroupItemContext.Provider value={itemContextValue}>
|
|
103
|
+
<view {...ref ? { ref } : {}} className={clsx(rootClassName, className)} {...pressHandlers} {...nativeProps}>
|
|
104
|
+
{children}
|
|
105
|
+
</view>
|
|
106
|
+
</RadioGroupItemContext.Provider>;
|
|
107
|
+
});
|
|
108
|
+
RadioGroupItem.displayName = "RadioGroupItem";
|
|
109
|
+
var RadioGroupItemControl = React.forwardRef((props, ref) => {
|
|
110
|
+
const [variantProps, restProps] = radiomark.splitVariantProps(props);
|
|
111
|
+
const { children, className, ...nativeProps } = restProps;
|
|
112
|
+
const groupContext = useRadioGroupContext("RadioGroupItemControl");
|
|
113
|
+
const itemContext = useRadioGroupItemContext("RadioGroupItemControl");
|
|
114
|
+
const radiomarkVariantProps = {
|
|
115
|
+
...groupContext.radiomarkVariantProps,
|
|
116
|
+
...variantProps,
|
|
117
|
+
checked: itemContext.checked,
|
|
118
|
+
disabled: itemContext.disabled,
|
|
119
|
+
pressed: itemContext.pressed
|
|
120
|
+
};
|
|
121
|
+
const classes = radiomark(radiomarkVariantProps);
|
|
122
|
+
return <RadiomarkControlContext.Provider value={{
|
|
123
|
+
iconClassName: classes.icon,
|
|
124
|
+
radiomarkVariantProps
|
|
125
|
+
}}>
|
|
126
|
+
<view {...ref ? { ref } : {}} className={clsx(classes.root, className)} {...nativeProps}>
|
|
127
|
+
{children}
|
|
128
|
+
</view>
|
|
129
|
+
</RadiomarkControlContext.Provider>;
|
|
130
|
+
});
|
|
131
|
+
RadioGroupItemControl.displayName = "RadioGroupItemControl";
|
|
132
|
+
function RadioGroupItemIndicator(props) {
|
|
133
|
+
const { unchecked, checked: checkedIcon, className, style } = props;
|
|
134
|
+
const itemContext = useRadioGroupItemContext("RadioGroupItemIndicator");
|
|
135
|
+
const { iconClassName, radiomarkVariantProps } = useRadiomarkControlContext("RadioGroupItemIndicator");
|
|
136
|
+
const icon = itemContext.checked ? checkedIcon : unchecked;
|
|
137
|
+
if (!icon || !isValidElement(icon)) return <view className={clsx(iconClassName, className)} style={style} />;
|
|
138
|
+
return <InternalIcon icon={icon} className={clsx(iconClassName, className)} style={style} deps={[
|
|
139
|
+
itemContext.checked,
|
|
140
|
+
itemContext.disabled,
|
|
141
|
+
itemContext.pressed,
|
|
142
|
+
radiomarkVariantProps.tone,
|
|
143
|
+
radiomarkVariantProps.size
|
|
144
|
+
]} />;
|
|
145
|
+
}
|
|
146
|
+
RadioGroupItemIndicator.displayName = "RadioGroupItemIndicator";
|
|
147
|
+
var RadioGroupItemLabel = React.forwardRef((props, ref) => {
|
|
148
|
+
const { children, className, ...nativeProps } = props;
|
|
149
|
+
const itemContext = useRadioGroupItemContext("RadioGroupItemLabel");
|
|
150
|
+
const labelClassName = radio({
|
|
151
|
+
...useRadioGroupContext("RadioGroupItemLabel").radioVariantProps,
|
|
152
|
+
disabled: itemContext.disabled
|
|
153
|
+
}).label;
|
|
154
|
+
return <text {...ref ? { ref } : {}} className={clsx(labelClassName, className)} {...nativeProps}>
|
|
155
|
+
{children}
|
|
156
|
+
</text>;
|
|
157
|
+
});
|
|
158
|
+
RadioGroupItemLabel.displayName = "RadioGroupItemLabel";
|
|
159
|
+
//#endregion
|
|
160
|
+
export { RadioGroupItem, RadioGroupItemControl, RadioGroupItemIndicator, RadioGroupItemLabel, RadioGroupRoot };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { RadioGroupItem as Item, RadioGroupItemControl as ItemControl, RadioGroupItemIndicator as ItemIndicator, RadioGroupItemLabel as ItemLabel, RadioGroupRoot as Root, type RadioGroupItemControlProps as ItemControlProps, type RadioGroupItemIndicatorProps as ItemIndicatorProps, type RadioGroupItemLabelProps as ItemLabelProps, type RadioGroupItemProps as ItemProps, type RadioGroupRootProps as RootProps, } from './RadioGroup';
|
|
2
|
+
//# sourceMappingURL=RadioGroup.namespace.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RadioGroup.namespace.d.ts","sourceRoot":"","sources":["../../../src/components/RadioGroup/RadioGroup.namespace.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,IAAI,IAAI,EACtB,qBAAqB,IAAI,WAAW,EACpC,uBAAuB,IAAI,aAAa,EACxC,mBAAmB,IAAI,SAAS,EAChC,cAAc,IAAI,IAAI,EACtB,KAAK,0BAA0B,IAAI,gBAAgB,EACnD,KAAK,4BAA4B,IAAI,kBAAkB,EACvD,KAAK,wBAAwB,IAAI,cAAc,EAC/C,KAAK,mBAAmB,IAAI,SAAS,EACrC,KAAK,mBAAmB,IAAI,SAAS,GACtC,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { __exportAll } from "../../_virtual/_rolldown/runtime.js";
|
|
2
|
+
import { RadioGroupItem, RadioGroupItemControl, RadioGroupItemIndicator, RadioGroupItemLabel, RadioGroupRoot } from "./RadioGroup.jsx";
|
|
3
|
+
//#region src/components/RadioGroup/RadioGroup.namespace.ts
|
|
4
|
+
var RadioGroup_namespace_exports = /* @__PURE__ */ __exportAll({
|
|
5
|
+
Item: () => RadioGroupItem,
|
|
6
|
+
ItemControl: () => RadioGroupItemControl,
|
|
7
|
+
ItemIndicator: () => RadioGroupItemIndicator,
|
|
8
|
+
ItemLabel: () => RadioGroupItemLabel,
|
|
9
|
+
Root: () => RadioGroupRoot
|
|
10
|
+
});
|
|
11
|
+
//#endregion
|
|
12
|
+
export { RadioGroup_namespace_exports };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { RadioGroupRoot, RadioGroupItem, RadioGroupItemControl, RadioGroupItemIndicator, RadioGroupItemLabel, type RadioGroupRootProps, type RadioGroupItemProps, type RadioGroupItemControlProps, type RadioGroupItemIndicatorProps, type RadioGroupItemLabelProps, } from './RadioGroup';
|
|
2
|
+
export * as RadioGroup from './RadioGroup.namespace';
|
|
3
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/RadioGroup/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,cAAc,EACd,qBAAqB,EACrB,uBAAuB,EACvB,mBAAmB,EACnB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,0BAA0B,EAC/B,KAAK,4BAA4B,EACjC,KAAK,wBAAwB,GAC9B,MAAM,cAAc,CAAC;AAEtB,OAAO,KAAK,UAAU,MAAM,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { LynxPressableProps, LynxStyledElementProps } from '../../types';
|
|
2
|
+
import { StyleProps } from '../../utils/styled';
|
|
3
|
+
import * as React from "@lynx-js/react";
|
|
4
|
+
type StackStyleProps = "display" | "flexDirection" | "alignItems" | "justifyContent" | "flexWrap" | "flexGrow" | "flexShrink";
|
|
5
|
+
interface StackBaseProps extends StyleProps, LynxStyledElementProps, LynxPressableProps {
|
|
6
|
+
bindtouchstart?: () => void;
|
|
7
|
+
bindtouchend?: () => void;
|
|
8
|
+
bindtouchcancel?: () => void;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* @platform Lynx
|
|
12
|
+
*
|
|
13
|
+
* `VStack`과 `HStack`은 native `<view>`를 직접 렌더링하고 stack 방향에 필요한
|
|
14
|
+
* 최소 flex style만 적용합니다. 앱 코드에서 성능에 민감한 반복 레이아웃을 만들
|
|
15
|
+
* 때는 native `<view>`/`<text>`와 Tailwind utility className을 우선 고려하세요.
|
|
16
|
+
* 패키지 컴포넌트 내부에서는 `Box`를 합성하지 않고 native tag와 recipe className을
|
|
17
|
+
* 사용해 primitive 컴포넌트 비용이 누적되지 않도록 합니다.
|
|
18
|
+
*/
|
|
19
|
+
export interface StackProps extends Omit<StackBaseProps, StackStyleProps> {
|
|
20
|
+
align?: StackBaseProps["alignItems"];
|
|
21
|
+
justify?: StackBaseProps["justifyContent"];
|
|
22
|
+
wrap?: StackBaseProps["flexWrap"];
|
|
23
|
+
grow?: StackBaseProps["flexGrow"];
|
|
24
|
+
shrink?: StackBaseProps["flexShrink"];
|
|
25
|
+
}
|
|
26
|
+
export interface VStackProps extends StackProps {
|
|
27
|
+
}
|
|
28
|
+
export interface HStackProps extends StackProps {
|
|
29
|
+
}
|
|
30
|
+
export declare const VStack: React.ForwardRefExoticComponent<VStackProps & React.RefAttributes<unknown>>;
|
|
31
|
+
export declare const HStack: React.ForwardRefExoticComponent<HStackProps & React.RefAttributes<unknown>>;
|
|
32
|
+
export {};
|
|
33
|
+
//# sourceMappingURL=Stack.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Stack.d.ts","sourceRoot":"","sources":["../../../src/components/Stack/Stack.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,gBAAgB,CAAC;AAExC,OAAO,KAAK,EAAE,kBAAkB,EAAE,sBAAsB,EAAe,MAAM,aAAa,CAAC;AAC3F,OAAO,EAAiB,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEpE,KAAK,eAAe,GAChB,SAAS,GACT,eAAe,GACf,YAAY,GACZ,gBAAgB,GAChB,UAAU,GACV,UAAU,GACV,YAAY,CAAC;AAEjB,UAAU,cAAe,SAAQ,UAAU,EAAE,sBAAsB,EAAE,kBAAkB;IACrF,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,eAAe,CAAC,EAAE,MAAM,IAAI,CAAC;CAC9B;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,UAAW,SAAQ,IAAI,CAAC,cAAc,EAAE,eAAe,CAAC;IACvE,KAAK,CAAC,EAAE,cAAc,CAAC,YAAY,CAAC,CAAC;IACrC,OAAO,CAAC,EAAE,cAAc,CAAC,gBAAgB,CAAC,CAAC;IAC3C,IAAI,CAAC,EAAE,cAAc,CAAC,UAAU,CAAC,CAAC;IAClC,IAAI,CAAC,EAAE,cAAc,CAAC,UAAU,CAAC,CAAC;IAClC,MAAM,CAAC,EAAE,cAAc,CAAC,YAAY,CAAC,CAAC;CACvC;AAED,MAAM,WAAW,WAAY,SAAQ,UAAU;CAAG;AAElD,MAAM,WAAW,WAAY,SAAQ,UAAU;CAAG;AA0ClD,eAAO,MAAM,MAAM,6EAIjB,CAAC;AAIH,eAAO,MAAM,MAAM,6EAIjB,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { useStyleProps } from "../../utils/styled.js";
|
|
2
|
+
import clsx from "clsx";
|
|
3
|
+
import * as React from "@lynx-js/react";
|
|
4
|
+
//#region src/components/Stack/Stack.tsx
|
|
5
|
+
function getStackProps(props) {
|
|
6
|
+
const { align, justify, wrap, grow, shrink, ...restProps } = props;
|
|
7
|
+
return {
|
|
8
|
+
alignItems: align,
|
|
9
|
+
justifyContent: justify,
|
|
10
|
+
flexWrap: wrap,
|
|
11
|
+
flexGrow: grow,
|
|
12
|
+
flexShrink: shrink,
|
|
13
|
+
...restProps
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
function useStackStyleProps(props, flexDirection) {
|
|
17
|
+
return useStyleProps({
|
|
18
|
+
display: "flex",
|
|
19
|
+
flexDirection,
|
|
20
|
+
...getStackProps(props)
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
function renderStackView(stackStyleProps, ref) {
|
|
24
|
+
const { style, restProps } = stackStyleProps;
|
|
25
|
+
const { children, className, ...nativeProps } = restProps;
|
|
26
|
+
return <view {...ref ? { ref } : {}} {...nativeProps} className={clsx(className)} style={style}>
|
|
27
|
+
{children}
|
|
28
|
+
</view>;
|
|
29
|
+
}
|
|
30
|
+
var VStack = React.forwardRef((props, ref) => {
|
|
31
|
+
return renderStackView(useStackStyleProps(props, "column"), ref);
|
|
32
|
+
});
|
|
33
|
+
VStack.displayName = "VStack";
|
|
34
|
+
var HStack = React.forwardRef((props, ref) => {
|
|
35
|
+
return renderStackView(useStackStyleProps(props, "row"), ref);
|
|
36
|
+
});
|
|
37
|
+
HStack.displayName = "HStack";
|
|
38
|
+
//#endregion
|
|
39
|
+
export { HStack, VStack };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Stack/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,WAAW,EAAE,KAAK,UAAU,EAAE,MAAM,EAAE,KAAK,WAAW,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { SwitchVariantProps } from '@seed-design/lynx-css/recipes/switch';
|
|
2
|
+
import { SwitchmarkVariantProps } from '@seed-design/lynx-css/recipes/switchmark';
|
|
3
|
+
import { LynxStyledElementProps } from '../../types';
|
|
4
|
+
import * as React from "@lynx-js/react";
|
|
5
|
+
export interface SwitchRootProps extends SwitchVariantProps, Omit<SwitchmarkVariantProps, "size">, LynxStyledElementProps {
|
|
6
|
+
checked?: boolean;
|
|
7
|
+
defaultChecked?: boolean;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
onCheckedChange?: (checked: boolean) => void;
|
|
10
|
+
}
|
|
11
|
+
export declare const SwitchRoot: React.ForwardRefExoticComponent<SwitchRootProps & React.RefAttributes<unknown>>;
|
|
12
|
+
export interface SwitchControlProps extends Pick<SwitchmarkVariantProps, "tone" | "size">, LynxStyledElementProps {
|
|
13
|
+
}
|
|
14
|
+
export declare const SwitchControl: React.ForwardRefExoticComponent<SwitchControlProps & React.RefAttributes<unknown>>;
|
|
15
|
+
export interface SwitchThumbProps extends Pick<LynxStyledElementProps, "className" | "style"> {
|
|
16
|
+
}
|
|
17
|
+
export declare const SwitchThumb: React.ForwardRefExoticComponent<SwitchThumbProps & React.RefAttributes<unknown>>;
|
|
18
|
+
export interface SwitchLabelProps extends LynxStyledElementProps {
|
|
19
|
+
}
|
|
20
|
+
export declare const SwitchLabel: React.ForwardRefExoticComponent<SwitchLabelProps & React.RefAttributes<unknown>>;
|
|
21
|
+
//# sourceMappingURL=Switch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Switch.d.ts","sourceRoot":"","sources":["../../../src/components/Switch/Switch.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,gBAAgB,CAAC;AAIxC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAE/E,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,0CAA0C,CAAC;AAKvF,OAAO,KAAK,EAAE,sBAAsB,EAA4B,MAAM,aAAa,CAAC;AAkDpF,MAAM,WAAW,eACf,SAAQ,kBAAkB,EACxB,IAAI,CAAC,sBAAsB,EAAE,MAAM,CAAC,EACpC,sBAAsB;IACxB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;CAC9C;AAED,eAAO,MAAM,UAAU,iFAmDrB,CAAC;AAKH,MAAM,WAAW,kBACf,SAAQ,IAAI,CAAC,sBAAsB,EAAE,MAAM,GAAG,MAAM,CAAC,EACnD,sBAAsB;CAAG;AAE7B,eAAO,MAAM,aAAa,oFAyBxB,CAAC;AAKH,MAAM,WAAW,gBAAiB,SAAQ,IAAI,CAAC,sBAAsB,EAAE,WAAW,GAAG,OAAO,CAAC;CAAG;AAEhG,eAAO,MAAM,WAAW,kFAWtB,CAAC;AAKH,MAAM,WAAW,gBAAiB,SAAQ,sBAAsB;CAAG;AAEnE,eAAO,MAAM,WAAW,kFAiBtB,CAAC"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { usePressTap } from "../../hooks/usePressTap.js";
|
|
2
|
+
import { useControllableState } from "../../hooks/useControllableState.js";
|
|
3
|
+
import { splitMultipleVariantsProps } from "../../utils/split-multiple-variants-props.js";
|
|
4
|
+
import clsx from "clsx";
|
|
5
|
+
import * as React from "@lynx-js/react";
|
|
6
|
+
import { switchStyle } from "@seed-design/lynx-css/recipes/switch";
|
|
7
|
+
import { switchmark } from "@seed-design/lynx-css/recipes/switchmark";
|
|
8
|
+
//#region src/components/Switch/Switch.tsx
|
|
9
|
+
var SwitchContext = React.createContext(null);
|
|
10
|
+
function useSwitchContext(consumer) {
|
|
11
|
+
const ctx = React.useContext(SwitchContext);
|
|
12
|
+
if (!ctx) throw new Error(`<${consumer}/> must be rendered inside <SwitchRoot/>.`);
|
|
13
|
+
return ctx;
|
|
14
|
+
}
|
|
15
|
+
var SwitchmarkControlContext = React.createContext(null);
|
|
16
|
+
function useSwitchmarkControlContext(consumer) {
|
|
17
|
+
const ctx = React.useContext(SwitchmarkControlContext);
|
|
18
|
+
if (!ctx) throw new Error(`<${consumer}/> must be rendered inside <SwitchControl/>.`);
|
|
19
|
+
return ctx;
|
|
20
|
+
}
|
|
21
|
+
var SwitchRoot = React.forwardRef((props, ref) => {
|
|
22
|
+
const { children, className, checked: checkedProp, defaultChecked = false, disabled = false, onCheckedChange, ...restProps } = props;
|
|
23
|
+
const [{ switch: switchVariantProps, switchmark: switchmarkVariantProps }, nativeProps] = splitMultipleVariantsProps(restProps, {
|
|
24
|
+
switch: switchStyle,
|
|
25
|
+
switchmark
|
|
26
|
+
});
|
|
27
|
+
const [checked, setChecked] = useControllableState({
|
|
28
|
+
value: checkedProp,
|
|
29
|
+
defaultValue: defaultChecked,
|
|
30
|
+
onChange: onCheckedChange
|
|
31
|
+
});
|
|
32
|
+
const toggle = React.useCallback(() => setChecked(!checked), [checked, setChecked]);
|
|
33
|
+
const { pressed: _pressed, ...pressHandlers } = usePressTap({
|
|
34
|
+
disabled,
|
|
35
|
+
onTap: toggle
|
|
36
|
+
});
|
|
37
|
+
const rootClassName = switchStyle({
|
|
38
|
+
...switchVariantProps,
|
|
39
|
+
disabled
|
|
40
|
+
}).root;
|
|
41
|
+
const contextValue = React.useMemo(() => ({
|
|
42
|
+
checked,
|
|
43
|
+
disabled,
|
|
44
|
+
switchVariantProps,
|
|
45
|
+
switchmarkVariantProps,
|
|
46
|
+
toggle
|
|
47
|
+
}), [
|
|
48
|
+
checked,
|
|
49
|
+
disabled,
|
|
50
|
+
switchVariantProps,
|
|
51
|
+
switchmarkVariantProps,
|
|
52
|
+
toggle
|
|
53
|
+
]);
|
|
54
|
+
return <SwitchContext.Provider value={contextValue}>
|
|
55
|
+
<view {...ref ? { ref } : {}} className={clsx(rootClassName, className)} {...pressHandlers} {...nativeProps}>
|
|
56
|
+
{children}
|
|
57
|
+
</view>
|
|
58
|
+
</SwitchContext.Provider>;
|
|
59
|
+
});
|
|
60
|
+
SwitchRoot.displayName = "SwitchRoot";
|
|
61
|
+
var SwitchControl = React.forwardRef((props, ref) => {
|
|
62
|
+
const [variantProps, restProps] = switchmark.splitVariantProps(props);
|
|
63
|
+
const { children, className, ...nativeProps } = restProps;
|
|
64
|
+
const context = useSwitchContext("SwitchControl");
|
|
65
|
+
const switchmarkVariantProps = {
|
|
66
|
+
...context.switchmarkVariantProps,
|
|
67
|
+
...variantProps,
|
|
68
|
+
checked: context.checked,
|
|
69
|
+
disabled: context.disabled
|
|
70
|
+
};
|
|
71
|
+
const classes = switchmark(switchmarkVariantProps);
|
|
72
|
+
return <SwitchmarkControlContext.Provider value={{
|
|
73
|
+
thumbClassName: classes.thumb,
|
|
74
|
+
switchmarkVariantProps
|
|
75
|
+
}}>
|
|
76
|
+
<view {...ref ? { ref } : {}} className={clsx(classes.root, className)} {...nativeProps}>
|
|
77
|
+
{children}
|
|
78
|
+
</view>
|
|
79
|
+
</SwitchmarkControlContext.Provider>;
|
|
80
|
+
});
|
|
81
|
+
SwitchControl.displayName = "SwitchControl";
|
|
82
|
+
var SwitchThumb = React.forwardRef((props, ref) => {
|
|
83
|
+
const { className, ...nativeProps } = props;
|
|
84
|
+
const { thumbClassName } = useSwitchmarkControlContext("SwitchThumb");
|
|
85
|
+
return <view {...ref ? { ref } : {}} className={clsx(thumbClassName, className)} {...nativeProps} />;
|
|
86
|
+
});
|
|
87
|
+
SwitchThumb.displayName = "SwitchThumb";
|
|
88
|
+
var SwitchLabel = React.forwardRef((props, ref) => {
|
|
89
|
+
const { children, className, ...nativeProps } = props;
|
|
90
|
+
const context = useSwitchContext("SwitchLabel");
|
|
91
|
+
const labelClassName = switchStyle({
|
|
92
|
+
...context.switchVariantProps,
|
|
93
|
+
disabled: context.disabled
|
|
94
|
+
}).label;
|
|
95
|
+
return <text {...ref ? { ref } : {}} className={clsx(labelClassName, className)} {...nativeProps}>
|
|
96
|
+
{children}
|
|
97
|
+
</text>;
|
|
98
|
+
});
|
|
99
|
+
SwitchLabel.displayName = "SwitchLabel";
|
|
100
|
+
//#endregion
|
|
101
|
+
export { SwitchControl, SwitchLabel, SwitchRoot, SwitchThumb };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { SwitchControl as Control, SwitchLabel as Label, SwitchRoot as Root, SwitchThumb as Thumb, type SwitchControlProps as ControlProps, type SwitchLabelProps as LabelProps, type SwitchRootProps as RootProps, type SwitchThumbProps as ThumbProps, } from './Switch';
|
|
2
|
+
//# sourceMappingURL=Switch.namespace.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Switch.namespace.d.ts","sourceRoot":"","sources":["../../../src/components/Switch/Switch.namespace.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,IAAI,OAAO,EACxB,WAAW,IAAI,KAAK,EACpB,UAAU,IAAI,IAAI,EAClB,WAAW,IAAI,KAAK,EACpB,KAAK,kBAAkB,IAAI,YAAY,EACvC,KAAK,gBAAgB,IAAI,UAAU,EACnC,KAAK,eAAe,IAAI,SAAS,EACjC,KAAK,gBAAgB,IAAI,UAAU,GACpC,MAAM,UAAU,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { __exportAll } from "../../_virtual/_rolldown/runtime.js";
|
|
2
|
+
import { SwitchControl, SwitchLabel, SwitchRoot, SwitchThumb } from "./Switch.jsx";
|
|
3
|
+
//#region src/components/Switch/Switch.namespace.ts
|
|
4
|
+
var Switch_namespace_exports = /* @__PURE__ */ __exportAll({
|
|
5
|
+
Control: () => SwitchControl,
|
|
6
|
+
Label: () => SwitchLabel,
|
|
7
|
+
Root: () => SwitchRoot,
|
|
8
|
+
Thumb: () => SwitchThumb
|
|
9
|
+
});
|
|
10
|
+
//#endregion
|
|
11
|
+
export { Switch_namespace_exports };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Switch/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,aAAa,EACb,WAAW,EACX,WAAW,EACX,KAAK,eAAe,EACpB,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,GACtB,MAAM,UAAU,CAAC;AAElB,OAAO,KAAK,MAAM,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { TagGroupVariantProps } from '@seed-design/lynx-css/recipes/tag-group';
|
|
2
|
+
import { TagGroupItemVariantProps } from '@seed-design/lynx-css/recipes/tag-group-item';
|
|
3
|
+
import { LynxStyledElementProps } from '../../types';
|
|
4
|
+
import { StyleProps } from '../../utils/styled';
|
|
5
|
+
import * as React from "@lynx-js/react";
|
|
6
|
+
/**
|
|
7
|
+
* @platform Lynx
|
|
8
|
+
*
|
|
9
|
+
* 웹 대비 미지원 기능:
|
|
10
|
+
* - `truncate` prop: Lynx flex 모델에서는 item 단위 wrap만 가능해 웹 수준의
|
|
11
|
+
* "한 줄 유지 + label ellipsis" 조합을 재현할 수 없음
|
|
12
|
+
* - `asChild` prop: Lynx Slot 미지원
|
|
13
|
+
* - 아이콘 slot: Lynx 3.7 SVG 지원 후 검토 (Tier B)
|
|
14
|
+
*/
|
|
15
|
+
export interface TagGroupRootProps extends TagGroupVariantProps, TagGroupItemVariantProps, LynxStyledElementProps {
|
|
16
|
+
/**
|
|
17
|
+
* children 사이에 삽입되는 구분자. 기본값 `" · "`.
|
|
18
|
+
*/
|
|
19
|
+
separator?: React.ReactNode;
|
|
20
|
+
}
|
|
21
|
+
export declare const TagGroupRoot: React.ForwardRefExoticComponent<TagGroupRootProps & React.RefAttributes<unknown>>;
|
|
22
|
+
/**
|
|
23
|
+
* @platform Lynx
|
|
24
|
+
*
|
|
25
|
+
* 웹 대비 미지원 기능:
|
|
26
|
+
* - `asChild` prop: Lynx Slot 미지원
|
|
27
|
+
*/
|
|
28
|
+
export interface TagGroupItemProps extends TagGroupItemVariantProps, Pick<StyleProps, "flexShrink">, LynxStyledElementProps {
|
|
29
|
+
}
|
|
30
|
+
export declare const TagGroupItem: React.ForwardRefExoticComponent<TagGroupItemProps & React.RefAttributes<unknown>>;
|
|
31
|
+
export interface TagGroupItemLabelProps extends LynxStyledElementProps {
|
|
32
|
+
}
|
|
33
|
+
export declare const TagGroupItemLabel: React.ForwardRefExoticComponent<TagGroupItemLabelProps & React.RefAttributes<unknown>>;
|
|
34
|
+
//# sourceMappingURL=TagGroup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TagGroup.d.ts","sourceRoot":"","sources":["../../../src/components/TagGroup/TagGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,gBAAgB,CAAC;AAExC,OAAO,EAAY,KAAK,oBAAoB,EAAE,MAAM,yCAAyC,CAAC;AAC9F,OAAO,EAEL,KAAK,wBAAwB,EAC9B,MAAM,8CAA8C,CAAC;AAEtD,OAAO,KAAK,EAAE,sBAAsB,EAA4B,MAAM,aAAa,CAAC;AAIpF,OAAO,EAAiB,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAOpE;;;;;;;;GAQG;AACH,MAAM,WAAW,iBACf,SAAQ,oBAAoB,EAC1B,wBAAwB,EACxB,sBAAsB;IACxB;;OAEG;IACH,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC7B;AAED,eAAO,MAAM,YAAY,mFAiCvB,CAAC;AAKH;;;;;GAKG;AACH,MAAM,WAAW,iBACf,SAAQ,wBAAwB,EAC9B,IAAI,CAAC,UAAU,EAAE,YAAY,CAAC,EAC9B,sBAAsB;CAAG;AAE7B,eAAO,MAAM,YAAY,mFAmBvB,CAAC;AAKH,MAAM,WAAW,sBAAuB,SAAQ,sBAAsB;CAAG;AAEzE,eAAO,MAAM,iBAAiB,wFAY5B,CAAC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { createSlotRecipeContext } from "../../utils/create-slot-recipe-context.jsx";
|
|
2
|
+
import { toArray } from "../../utils/children.js";
|
|
3
|
+
import { useStyleProps } from "../../utils/styled.js";
|
|
4
|
+
import { splitMultipleVariantsProps } from "../../utils/split-multiple-variants-props.js";
|
|
5
|
+
import clsx from "clsx";
|
|
6
|
+
import * as React from "@lynx-js/react";
|
|
7
|
+
import { tagGroup } from "@seed-design/lynx-css/recipes/tag-group";
|
|
8
|
+
import { tagGroupItem } from "@seed-design/lynx-css/recipes/tag-group-item";
|
|
9
|
+
//#region src/components/TagGroup/TagGroup.tsx
|
|
10
|
+
var { PropsProvider, useProps, ClassNamesProvider, useClassNames } = createSlotRecipeContext(tagGroupItem);
|
|
11
|
+
var TagGroupRoot = React.forwardRef((props, ref) => {
|
|
12
|
+
const [{ tagGroup: tagGroupVariantProps, tagGroupItem: tagGroupItemVariantProps }, otherProps] = splitMultipleVariantsProps(props, {
|
|
13
|
+
tagGroup,
|
|
14
|
+
tagGroupItem
|
|
15
|
+
});
|
|
16
|
+
const { children, className, separator = " · ", ...nativeProps } = otherProps;
|
|
17
|
+
const classes = tagGroup(tagGroupVariantProps);
|
|
18
|
+
const visibleChildren = toArray(children);
|
|
19
|
+
return <PropsProvider value={tagGroupItemVariantProps}>
|
|
20
|
+
<view {...ref ? { ref } : {}} className={clsx(classes.root, className)} {...nativeProps}>
|
|
21
|
+
{visibleChildren.map((child, index) => {
|
|
22
|
+
if (index === 0) return child;
|
|
23
|
+
return <view key={child.key ?? index} className={classes.separatorWrapper}>
|
|
24
|
+
<text className={classes.separator}>{separator}</text>
|
|
25
|
+
{child}
|
|
26
|
+
</view>;
|
|
27
|
+
})}
|
|
28
|
+
</view>
|
|
29
|
+
</PropsProvider>;
|
|
30
|
+
});
|
|
31
|
+
TagGroupRoot.displayName = "TagGroupRoot";
|
|
32
|
+
var TagGroupItem = React.forwardRef((props, ref) => {
|
|
33
|
+
const parentVariantProps = useProps();
|
|
34
|
+
const [localVariantProps, otherProps] = tagGroupItem.splitVariantProps(props);
|
|
35
|
+
const classes = tagGroupItem({
|
|
36
|
+
...parentVariantProps,
|
|
37
|
+
...localVariantProps
|
|
38
|
+
});
|
|
39
|
+
const { style, restProps } = useStyleProps(otherProps);
|
|
40
|
+
const { children, className, ...nativeProps } = restProps;
|
|
41
|
+
return <ClassNamesProvider value={classes}>
|
|
42
|
+
<view {...ref ? { ref } : {}} className={clsx(classes.root, className)} style={style} {...nativeProps}>
|
|
43
|
+
{children}
|
|
44
|
+
</view>
|
|
45
|
+
</ClassNamesProvider>;
|
|
46
|
+
});
|
|
47
|
+
TagGroupItem.displayName = "TagGroupItem";
|
|
48
|
+
var TagGroupItemLabel = React.forwardRef((props, ref) => {
|
|
49
|
+
const classes = useClassNames();
|
|
50
|
+
const { children, className, ...nativeProps } = props;
|
|
51
|
+
return <text {...ref ? { ref } : {}} className={clsx(classes.label, className)} {...nativeProps}>
|
|
52
|
+
{children}
|
|
53
|
+
</text>;
|
|
54
|
+
});
|
|
55
|
+
TagGroupItemLabel.displayName = "TagGroupItemLabel";
|
|
56
|
+
//#endregion
|
|
57
|
+
export { TagGroupItem, TagGroupItemLabel, TagGroupRoot };
|
|
@@ -0,0 +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,iBAAiB,IAAI,SAAS,EAC9B,YAAY,IAAI,IAAI,EACpB,KAAK,sBAAsB,IAAI,cAAc,EAC7C,KAAK,iBAAiB,IAAI,SAAS,EACnC,KAAK,iBAAiB,IAAI,SAAS,GACpC,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { __exportAll } from "../../_virtual/_rolldown/runtime.js";
|
|
2
|
+
import { TagGroupItem, TagGroupItemLabel, TagGroupRoot } from "./TagGroup.jsx";
|
|
3
|
+
//#region src/components/TagGroup/TagGroup.namespace.ts
|
|
4
|
+
var TagGroup_namespace_exports = /* @__PURE__ */ __exportAll({
|
|
5
|
+
Item: () => TagGroupItem,
|
|
6
|
+
ItemLabel: () => TagGroupItemLabel,
|
|
7
|
+
Root: () => TagGroupRoot
|
|
8
|
+
});
|
|
9
|
+
//#endregion
|
|
10
|
+
export { TagGroup_namespace_exports };
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { TextStyleProps } from '../../utils/styled';
|
|
2
|
+
import { LynxStyledElementProps } from '../../types';
|
|
3
|
+
import * as React from "@lynx-js/react";
|
|
4
|
+
export interface TextProps extends TextStyleProps, LynxStyledElementProps {
|
|
5
|
+
}
|
|
6
|
+
export declare const Text: React.ForwardRefExoticComponent<TextProps & React.RefAttributes<unknown>>;
|
|
7
|
+
//# sourceMappingURL=Text.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Text.d.ts","sourceRoot":"","sources":["../../../src/components/Text/Text.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,gBAAgB,CAAC;AAExC,OAAO,EAML,KAAK,cAAc,EACpB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,sBAAsB,EAAe,MAAM,aAAa,CAAC;AAYvE,MAAM,WAAW,SAAU,SAAQ,cAAc,EAAE,sBAAsB;CAAG;AAE5E,eAAO,MAAM,IAAI,2EAkCf,CAAC"}
|