@seed-design/lynx-react 0.2.0-alpha.3 → 0.3.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.
Files changed (179) hide show
  1. package/lib/_virtual/_rolldown/runtime.js +13 -0
  2. package/lib/components/ActionButton/ActionButton.d.ts +26 -33
  3. package/lib/components/ActionButton/ActionButton.d.ts.map +1 -1
  4. package/lib/components/ActionButton/ActionButton.jsx +139 -120
  5. package/lib/components/ActionButton/index.d.ts +1 -1
  6. package/lib/components/AppBar/AppBar.d.ts +35 -0
  7. package/lib/components/AppBar/AppBar.d.ts.map +1 -0
  8. package/lib/components/AppBar/AppBar.jsx +132 -0
  9. package/lib/components/AppBar/AppBar.namespace.d.ts +2 -0
  10. package/lib/components/AppBar/AppBar.namespace.d.ts.map +1 -0
  11. package/lib/components/AppBar/AppBar.namespace.js +15 -0
  12. package/lib/components/AppBar/context.d.ts +13 -0
  13. package/lib/components/AppBar/context.d.ts.map +1 -0
  14. package/lib/components/AppBar/context.js +12 -0
  15. package/lib/components/AppBar/index.d.ts +3 -0
  16. package/lib/components/AppBar/index.d.ts.map +1 -0
  17. package/lib/components/AppBar/useAppBar.d.ts +15 -0
  18. package/lib/components/AppBar/useAppBar.d.ts.map +1 -0
  19. package/lib/components/AppBar/useAppBar.js +72 -0
  20. package/lib/components/Badge/Badge.d.ts +14 -0
  21. package/lib/components/Badge/Badge.d.ts.map +1 -0
  22. package/lib/components/Badge/Badge.jsx +15 -0
  23. package/lib/components/Badge/index.d.ts +2 -0
  24. package/lib/components/Badge/index.d.ts.map +1 -0
  25. package/lib/components/BottomSheet/BottomSheet.d.ts +22 -27
  26. package/lib/components/BottomSheet/BottomSheet.d.ts.map +1 -1
  27. package/lib/components/BottomSheet/BottomSheet.jsx +127 -142
  28. package/lib/components/BottomSheet/BottomSheet.namespace.d.ts +1 -1
  29. package/lib/components/BottomSheet/BottomSheet.namespace.js +18 -1
  30. package/lib/components/BottomSheet/index.d.ts +2 -2
  31. package/lib/components/Box/Box.d.ts +20 -0
  32. package/lib/components/Box/Box.d.ts.map +1 -0
  33. package/lib/components/Box/Box.jsx +14 -0
  34. package/lib/components/Box/index.d.ts +2 -0
  35. package/lib/components/Box/index.d.ts.map +1 -0
  36. package/lib/components/Checkbox/Checkbox.d.ts +14 -31
  37. package/lib/components/Checkbox/Checkbox.d.ts.map +1 -1
  38. package/lib/components/Checkbox/Checkbox.jsx +107 -98
  39. package/lib/components/Checkbox/Checkbox.namespace.d.ts +1 -1
  40. package/lib/components/Checkbox/Checkbox.namespace.js +12 -1
  41. package/lib/components/Checkbox/index.d.ts +2 -2
  42. package/lib/components/Icon/Icon.d.ts +37 -0
  43. package/lib/components/Icon/Icon.d.ts.map +1 -0
  44. package/lib/components/Icon/Icon.jsx +143 -0
  45. package/lib/components/Icon/index.d.ts +2 -0
  46. package/lib/components/Icon/index.d.ts.map +1 -0
  47. package/lib/components/ProgressCircle/ProgressCircle.d.ts +4 -8
  48. package/lib/components/ProgressCircle/ProgressCircle.d.ts.map +1 -1
  49. package/lib/components/ProgressCircle/ProgressCircle.jsx +255 -260
  50. package/lib/components/ProgressCircle/ProgressCircle.namespace.d.ts +1 -1
  51. package/lib/components/ProgressCircle/ProgressCircle.namespace.js +9 -1
  52. package/lib/components/ProgressCircle/index.d.ts +2 -2
  53. package/lib/components/RadioGroup/RadioGroup.d.ts +12 -29
  54. package/lib/components/RadioGroup/RadioGroup.d.ts.map +1 -1
  55. package/lib/components/RadioGroup/RadioGroup.jsx +134 -118
  56. package/lib/components/RadioGroup/RadioGroup.namespace.d.ts +1 -1
  57. package/lib/components/RadioGroup/RadioGroup.namespace.js +12 -1
  58. package/lib/components/RadioGroup/index.d.ts +2 -2
  59. package/lib/components/Stack/Stack.d.ts +33 -0
  60. package/lib/components/Stack/Stack.d.ts.map +1 -0
  61. package/lib/components/Stack/Stack.jsx +39 -0
  62. package/lib/components/Stack/index.d.ts +2 -0
  63. package/lib/components/Stack/index.d.ts.map +1 -0
  64. package/lib/components/Switch/Switch.d.ts +8 -14
  65. package/lib/components/Switch/Switch.d.ts.map +1 -1
  66. package/lib/components/Switch/Switch.jsx +82 -56
  67. package/lib/components/Switch/Switch.namespace.d.ts +1 -1
  68. package/lib/components/Switch/Switch.namespace.js +11 -1
  69. package/lib/components/Switch/index.d.ts +2 -2
  70. package/lib/components/TagGroup/TagGroup.d.ts +8 -14
  71. package/lib/components/TagGroup/TagGroup.d.ts.map +1 -1
  72. package/lib/components/TagGroup/TagGroup.jsx +42 -39
  73. package/lib/components/TagGroup/TagGroup.namespace.d.ts +1 -1
  74. package/lib/components/TagGroup/TagGroup.namespace.js +10 -1
  75. package/lib/components/TagGroup/index.d.ts +2 -2
  76. package/lib/components/Text/Text.d.ts +7 -0
  77. package/lib/components/Text/Text.d.ts.map +1 -0
  78. package/lib/components/Text/Text.jsx +28 -0
  79. package/lib/components/Text/index.d.ts +2 -0
  80. package/lib/components/Text/index.d.ts.map +1 -0
  81. package/lib/components/index.d.ts +13 -7
  82. package/lib/components/index.d.ts.map +1 -1
  83. package/lib/hooks/index.d.ts +5 -3
  84. package/lib/hooks/index.d.ts.map +1 -1
  85. package/lib/hooks/useControllableState.js +23 -23
  86. package/lib/hooks/useIconColor.d.ts +6 -3
  87. package/lib/hooks/useIconColor.d.ts.map +1 -1
  88. package/lib/hooks/useIconColor.js +34 -37
  89. package/lib/hooks/usePressTap.d.ts +11 -8
  90. package/lib/hooks/usePressTap.d.ts.map +1 -1
  91. package/lib/hooks/usePressTap.js +31 -31
  92. package/lib/hooks/useSafeArea.d.ts +19 -0
  93. package/lib/hooks/useSafeArea.d.ts.map +1 -0
  94. package/lib/hooks/useSafeArea.js +33 -0
  95. package/lib/hooks/useSeedClassName.d.ts +27 -0
  96. package/lib/hooks/useSeedClassName.d.ts.map +1 -0
  97. package/lib/hooks/useSeedClassName.js +32 -0
  98. package/lib/index.d.ts +4 -3
  99. package/lib/index.d.ts.map +1 -1
  100. package/lib/index.js +30 -3
  101. package/lib/types.d.ts +51 -0
  102. package/lib/types.d.ts.map +1 -0
  103. package/lib/utils/children.d.ts +3 -0
  104. package/lib/utils/children.d.ts.map +1 -0
  105. package/lib/utils/children.js +8 -0
  106. package/lib/utils/create-slot-recipe-context.d.ts +13 -12
  107. package/lib/utils/create-slot-recipe-context.d.ts.map +1 -1
  108. package/lib/utils/create-slot-recipe-context.jsx +88 -70
  109. package/lib/utils/get-seed-class-name.d.ts +9 -7
  110. package/lib/utils/get-seed-class-name.d.ts.map +1 -1
  111. package/lib/utils/get-seed-class-name.js +29 -37
  112. package/lib/utils/index.d.ts +4 -4
  113. package/lib/utils/resolve-recipe-token.js +45 -43
  114. package/lib/utils/split-multiple-variants-props.js +32 -32
  115. package/lib/utils/styled.d.ts +83 -0
  116. package/lib/utils/styled.d.ts.map +1 -0
  117. package/lib/utils/styled.js +144 -0
  118. package/package.json +10 -9
  119. package/src/components/ActionButton/ActionButton.test.tsx +167 -0
  120. package/src/components/ActionButton/ActionButton.tsx +210 -169
  121. package/src/components/AppBar/AppBar.namespace.ts +18 -0
  122. package/src/components/AppBar/AppBar.test.tsx +270 -0
  123. package/src/components/AppBar/AppBar.tsx +288 -0
  124. package/src/components/AppBar/context.ts +27 -0
  125. package/src/components/AppBar/index.ts +21 -0
  126. package/src/components/AppBar/useAppBar.ts +100 -0
  127. package/src/components/Badge/Badge.test.tsx +54 -0
  128. package/src/components/Badge/Badge.tsx +32 -0
  129. package/src/components/Badge/index.ts +1 -0
  130. package/src/components/BottomSheet/BottomSheet.test.tsx +219 -0
  131. package/src/components/BottomSheet/BottomSheet.tsx +120 -83
  132. package/src/components/Box/Box.test.tsx +85 -0
  133. package/src/components/Box/Box.tsx +39 -0
  134. package/src/components/Box/index.ts +1 -0
  135. package/src/components/Checkbox/Checkbox.tsx +106 -116
  136. package/src/components/Icon/Icon.tsx +265 -0
  137. package/src/components/Icon/index.ts +8 -0
  138. package/src/components/ProgressCircle/ProgressCircle.tsx +39 -25
  139. package/src/components/RadioGroup/RadioGroup.tsx +98 -117
  140. package/src/components/Stack/Stack.tsx +97 -0
  141. package/src/components/Stack/index.ts +1 -0
  142. package/src/components/Switch/Switch.tsx +59 -50
  143. package/src/components/TagGroup/TagGroup.tsx +27 -25
  144. package/src/components/Text/Text.tsx +64 -0
  145. package/src/components/Text/index.ts +1 -0
  146. package/src/components/index.ts +6 -0
  147. package/src/hooks/index.ts +2 -0
  148. package/src/hooks/{__tests__/useControllableState.test.ts → useControllableState.test.ts} +1 -1
  149. package/src/hooks/{__tests__/useIconColor.test.ts → useIconColor.test.ts} +1 -1
  150. package/src/hooks/useIconColor.ts +22 -12
  151. package/src/hooks/{__tests__/usePressTap.test.ts → usePressTap.test.ts} +1 -1
  152. package/src/hooks/usePressTap.ts +14 -10
  153. package/src/hooks/useSafeArea.test.ts +83 -0
  154. package/src/hooks/useSafeArea.ts +56 -0
  155. package/src/hooks/useSeedClassName.ts +35 -0
  156. package/src/index.ts +1 -0
  157. package/src/types.ts +76 -0
  158. package/src/utils/children.ts +13 -0
  159. package/src/utils/create-slot-recipe-context.test.tsx +96 -0
  160. package/src/utils/create-slot-recipe-context.tsx +55 -15
  161. package/src/utils/get-seed-class-name.ts +10 -12
  162. package/src/utils/{__tests__/split-multiple-variants-props.test.ts → split-multiple-variants-props.test.ts} +1 -1
  163. package/src/utils/styled.ts +442 -0
  164. package/lib/components/ActionButton/index.js +0 -1
  165. package/lib/components/BottomSheet/index.js +0 -2
  166. package/lib/components/Checkbox/index.js +0 -2
  167. package/lib/components/ProgressCircle/index.js +0 -2
  168. package/lib/components/RadioGroup/index.js +0 -2
  169. package/lib/components/Switch/index.js +0 -2
  170. package/lib/components/TagGroup/index.js +0 -2
  171. package/lib/components/index.js +0 -7
  172. package/lib/hooks/index.js +0 -3
  173. package/lib/utils/index.js +0 -4
  174. package/src/components/ActionButton/__tests__/ActionButton.test.tsx +0 -35
  175. package/src/components/BottomSheet/__tests__/BottomSheet.test.tsx +0 -119
  176. package/src/components/__tests__/ProgressCircle.test.ts +0 -33
  177. package/src/components/__tests__/exports.test.ts +0 -38
  178. package/src/components/__tests__/switch.test.ts +0 -34
  179. package/src/utils/__tests__/create-slot-recipe-context.test.tsx +0 -228
@@ -0,0 +1,14 @@
1
+ import { useStyleProps } from "../../utils/styled.js";
2
+ import clsx from "clsx";
3
+ import * as React from "@lynx-js/react";
4
+ //#region src/components/Box/Box.tsx
5
+ var Box = React.forwardRef((props, ref) => {
6
+ const { style, restProps } = useStyleProps(props);
7
+ const { children, className, ...nativeProps } = restProps;
8
+ return <view {...ref ? { ref } : {}} {...nativeProps} className={clsx(className)} style={style}>
9
+ {children}
10
+ </view>;
11
+ });
12
+ Box.displayName = "Box";
13
+ //#endregion
14
+ export { Box };
@@ -0,0 +1,2 @@
1
+ export { Box, type BoxProps } from './Box';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Box/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,KAAK,QAAQ,EAAE,MAAM,OAAO,CAAC"}
@@ -1,11 +1,9 @@
1
- import * as React from "react";
2
- import { type CSSProperties, type ReactElement } from "react";
3
- import type { MainThread } from "@lynx-js/types";
4
- import type { CheckboxVariantProps } from "@seed-design/lynx-css/recipes/checkbox";
5
- import type { CheckmarkVariantProps } from "@seed-design/lynx-css/recipes/checkmark";
6
- export interface CheckboxRootProps extends CheckboxVariantProps, Omit<CheckmarkVariantProps, "size" | "checked" | "disabled" | "indeterminate"> {
7
- children?: React.ReactNode;
8
- className?: string;
1
+ import { ReactElement } from '@lynx-js/react';
2
+ import { CheckboxVariantProps } from '@seed-design/lynx-css/recipes/checkbox';
3
+ import { CheckmarkVariantProps } from '@seed-design/lynx-css/recipes/checkmark';
4
+ import { LynxIconElementProps, LynxStyledElementProps } from '../../types';
5
+ import * as React from "@lynx-js/react";
6
+ export interface CheckboxRootProps extends CheckboxVariantProps, Omit<CheckmarkVariantProps, "size" | "checked" | "disabled" | "indeterminate">, LynxStyledElementProps {
9
7
  checked?: boolean;
10
8
  defaultChecked?: boolean;
11
9
  indeterminate?: boolean;
@@ -13,40 +11,25 @@ export interface CheckboxRootProps extends CheckboxVariantProps, Omit<CheckmarkV
13
11
  onCheckedChange?: (checked: boolean) => void;
14
12
  }
15
13
  export declare const CheckboxRoot: React.ForwardRefExoticComponent<CheckboxRootProps & React.RefAttributes<unknown>>;
16
- export interface CheckboxControlProps extends Pick<CheckmarkVariantProps, "tone" | "variant" | "size"> {
17
- children?: React.ReactNode;
18
- className?: string;
14
+ export interface CheckboxControlProps extends Pick<CheckmarkVariantProps, "tone" | "variant" | "size">, LynxStyledElementProps {
19
15
  }
20
16
  export declare const CheckboxControl: React.ForwardRefExoticComponent<CheckboxControlProps & React.RefAttributes<unknown>>;
21
- type IconElementProps = {
22
- className?: string;
23
- style?: CSSProperties;
24
- ref?: React.Ref<MainThread.Element>;
25
- "main-thread:binduiappear"?: () => void;
26
- };
27
- export interface CheckboxIndicatorProps {
17
+ export interface CheckboxIndicatorProps extends Pick<LynxStyledElementProps, "className" | "style"> {
28
18
  /** Icon rendered when neither checked nor indeterminate. Optional. */
29
- unchecked?: ReactElement<IconElementProps>;
19
+ unchecked?: ReactElement<LynxIconElementProps>;
30
20
  /** Icon rendered when `checked=true` and `indeterminate=false`. */
31
- checked: ReactElement<IconElementProps>;
21
+ checked: ReactElement<LynxIconElementProps>;
32
22
  /** Icon rendered when `indeterminate=true`. */
33
- indeterminate?: ReactElement<IconElementProps>;
34
- className?: string;
35
- style?: CSSProperties;
23
+ indeterminate?: ReactElement<LynxIconElementProps>;
36
24
  }
37
- export declare function CheckboxIndicator(props: CheckboxIndicatorProps): React.ReactElement<IconElementProps, string | React.JSXElementConstructor<any>> | null;
25
+ export declare function CheckboxIndicator(props: CheckboxIndicatorProps): React.JSX.Element | null;
38
26
  export declare namespace CheckboxIndicator {
39
27
  var displayName: string;
40
28
  }
41
- export interface CheckboxLabelProps {
42
- children?: React.ReactNode;
43
- className?: string;
29
+ export interface CheckboxLabelProps extends LynxStyledElementProps {
44
30
  }
45
31
  export declare const CheckboxLabel: React.ForwardRefExoticComponent<CheckboxLabelProps & React.RefAttributes<unknown>>;
46
- export interface CheckboxGroupProps {
47
- children?: React.ReactNode;
48
- className?: string;
32
+ export interface CheckboxGroupProps extends LynxStyledElementProps {
49
33
  }
50
34
  export declare const CheckboxGroup: React.ForwardRefExoticComponent<CheckboxGroupProps & React.RefAttributes<unknown>>;
51
- export {};
52
35
  //# sourceMappingURL=Checkbox.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Checkbox.d.ts","sourceRoot":"","sources":["../../../src/components/Checkbox/Checkbox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAgC,KAAK,aAAa,EAAE,KAAK,YAAY,EAAE,MAAM,OAAO,CAAC;AAE5F,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAGjD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wCAAwC,CAAC;AAEnF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,yCAAyC,CAAC;AA8DrF,MAAM,WAAW,iBACf,SAAQ,oBAAoB,EAC1B,IAAI,CAAC,qBAAqB,EAAE,MAAM,GAAG,SAAS,GAAG,UAAU,GAAG,eAAe,CAAC;IAChF,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;CAC9C;AAED,eAAO,MAAM,YAAY,mFAgDvB,CAAC;AAKH,MAAM,WAAW,oBACf,SAAQ,IAAI,CAAC,qBAAqB,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAAC;IAChE,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,eAAe,sFAiC1B,CAAC;AAKH,KAAK,gBAAgB,GAAG;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;IACpC,0BAA0B,CAAC,EAAE,MAAM,IAAI,CAAC;CACzC,CAAC;AAEF,MAAM,WAAW,sBAAsB;IACrC,sEAAsE;IACtE,SAAS,CAAC,EAAE,YAAY,CAAC,gBAAgB,CAAC,CAAC;IAC3C,mEAAmE;IACnE,OAAO,EAAE,YAAY,CAAC,gBAAgB,CAAC,CAAC;IACxC,+CAA+C;IAC/C,aAAa,CAAC,EAAE,YAAY,CAAC,gBAAgB,CAAC,CAAC;IAC/C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,0FA8C9D;yBA9Ce,iBAAiB;;;AAmDjC,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,aAAa,oFAcxB,CAAC;AAKH,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,aAAa,oFAaxB,CAAC"}
1
+ {"version":3,"file":"Checkbox.d.ts","sourceRoot":"","sources":["../../../src/components/Checkbox/Checkbox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAAkB,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAInE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wCAAwC,CAAC;AAEnF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,yCAAyC,CAAC;AAKrF,OAAO,KAAK,EACV,oBAAoB,EACpB,sBAAsB,EAGvB,MAAM,aAAa,CAAC;AAuDrB,MAAM,WAAW,iBACf,SAAQ,oBAAoB,EAC1B,IAAI,CAAC,qBAAqB,EAAE,MAAM,GAAG,SAAS,GAAG,UAAU,GAAG,eAAe,CAAC,EAC9E,sBAAsB;IACxB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;CAC9C;AAED,eAAO,MAAM,YAAY,mFA8DvB,CAAC;AAKH,MAAM,WAAW,oBACf,SAAQ,IAAI,CAAC,qBAAqB,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAAC,EAC9D,sBAAsB;CAAG;AAE7B,eAAO,MAAM,eAAe,sFA2B1B,CAAC;AAKH,MAAM,WAAW,sBACf,SAAQ,IAAI,CAAC,sBAAsB,EAAE,WAAW,GAAG,OAAO,CAAC;IAC3D,sEAAsE;IACtE,SAAS,CAAC,EAAE,YAAY,CAAC,oBAAoB,CAAC,CAAC;IAC/C,mEAAmE;IACnE,OAAO,EAAE,YAAY,CAAC,oBAAoB,CAAC,CAAC;IAC5C,+CAA+C;IAC/C,aAAa,CAAC,EAAE,YAAY,CAAC,oBAAoB,CAAC,CAAC;CACpD;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,4BAwC9D;yBAxCe,iBAAiB;;;AA6CjC,MAAM,WAAW,kBAAmB,SAAQ,sBAAsB;CAAG;AAErE,eAAO,MAAM,aAAa,oFAiBxB,CAAC;AAKH,MAAM,WAAW,kBAAmB,SAAQ,sBAAsB;CAAG;AAErE,eAAO,MAAM,aAAa,oFAaxB,CAAC"}
@@ -1,121 +1,130 @@
1
- import * as React from "react";
2
- import { cloneElement, isValidElement } from "react";
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";
3
5
  import clsx from "clsx";
6
+ import * as React from "@lynx-js/react";
7
+ import { isValidElement } from "@lynx-js/react";
4
8
  import { checkbox } from "@seed-design/lynx-css/recipes/checkbox";
5
9
  import { checkmark } from "@seed-design/lynx-css/recipes/checkmark";
6
10
  import { checkboxGroup } from "@seed-design/lynx-css/recipes/checkbox-group";
7
- import { vars as checkmarkVars } from "@seed-design/lynx-css/vars/component/checkmark";
8
- import { useControllableState } from "../../hooks/useControllableState";
9
- import { useIconColor } from "../../hooks/useIconColor";
10
- import { usePressTap } from "../../hooks/usePressTap";
11
- import { capitalize, resolveRecipeToken } from "../../utils/resolve-recipe-token";
12
- import { splitMultipleVariantsProps } from "../../utils/split-multiple-variants-props";
13
- const CheckboxContext = React.createContext(null);
11
+ //#region src/components/Checkbox/Checkbox.tsx
12
+ var CheckboxContext = React.createContext(null);
14
13
  function useCheckboxContext(consumer) {
15
- const ctx = React.useContext(CheckboxContext);
16
- if (!ctx) {
17
- throw new Error(`<${consumer}/> must be rendered inside <CheckboxRoot/>.`);
18
- }
19
- return ctx;
14
+ const ctx = React.useContext(CheckboxContext);
15
+ if (!ctx) throw new Error(`<${consumer}/> must be rendered inside <CheckboxRoot/>.`);
16
+ return ctx;
20
17
  }
21
- const CheckmarkIconClassContext = React.createContext(null);
22
- function useCheckmarkIconClass(consumer) {
23
- const ctx = React.useContext(CheckmarkIconClassContext);
24
- if (!ctx) {
25
- throw new Error(`<${consumer}/> must be rendered inside <CheckboxControl/>.`);
26
- }
27
- return ctx;
18
+ var CheckmarkControlContext = React.createContext(null);
19
+ function useCheckmarkControlContext(consumer) {
20
+ const ctx = React.useContext(CheckmarkControlContext);
21
+ if (!ctx) throw new Error(`<${consumer}/> must be rendered inside <CheckboxControl/>.`);
22
+ return ctx;
28
23
  }
29
- export const CheckboxRoot = React.forwardRef((props, ref) => {
30
- const { children, className, checked: checkedProp, defaultChecked = false, indeterminate = false, disabled = false, onCheckedChange, ...restProps } = props;
31
- const [{ checkbox: checkboxVariantProps, checkmark: checkmarkVariantProps }, nativeProps] = splitMultipleVariantsProps(restProps, { checkbox, checkmark });
32
- const weight = checkboxVariantProps.weight ?? "regular";
33
- const size = checkboxVariantProps.size ?? "medium";
34
- const tone = checkmarkVariantProps.tone ?? "brand";
35
- const variant = checkmarkVariantProps.variant ?? "square";
36
- const [checked, setChecked] = useControllableState({
37
- value: checkedProp,
38
- defaultValue: defaultChecked,
39
- onChange: onCheckedChange,
40
- });
41
- const { pressed, ...pressHandlers } = usePressTap({
42
- disabled,
43
- onTap: () => setChecked(!checked),
44
- });
45
- const rootClassName = checkbox({ weight, size, disabled }).root;
46
- const ctx = React.useMemo(() => ({ checked, indeterminate, disabled, pressed, size, weight, tone, variant }), [checked, indeterminate, disabled, pressed, size, weight, tone, variant]);
47
- return (<CheckboxContext.Provider value={ctx}>
48
- <view {...(ref ? { ref: ref } : {})} className={clsx(rootClassName, className)} {...pressHandlers} {...nativeProps}>
24
+ var CheckboxRoot = React.forwardRef((props, ref) => {
25
+ const { children, className, checked: checkedProp, defaultChecked = false, indeterminate = false, disabled = false, onCheckedChange, ...restProps } = props;
26
+ const [{ checkbox: checkboxVariantProps, checkmark: checkmarkVariantProps }, nativeProps] = splitMultipleVariantsProps(restProps, {
27
+ checkbox,
28
+ checkmark
29
+ });
30
+ const [checked, setChecked] = useControllableState({
31
+ value: checkedProp,
32
+ defaultValue: defaultChecked,
33
+ onChange: onCheckedChange
34
+ });
35
+ const toggle = React.useCallback(() => setChecked(!checked), [checked, setChecked]);
36
+ const { pressed, ...pressHandlers } = usePressTap({
37
+ disabled,
38
+ onTap: toggle
39
+ });
40
+ const rootClassName = checkbox({
41
+ ...checkboxVariantProps,
42
+ disabled
43
+ }).root;
44
+ const contextValue = React.useMemo(() => ({
45
+ checked,
46
+ indeterminate,
47
+ disabled,
48
+ pressed,
49
+ checkboxVariantProps,
50
+ checkmarkVariantProps,
51
+ toggle
52
+ }), [
53
+ checked,
54
+ indeterminate,
55
+ disabled,
56
+ pressed,
57
+ checkboxVariantProps,
58
+ checkmarkVariantProps,
59
+ toggle
60
+ ]);
61
+ return <CheckboxContext.Provider value={contextValue}>
62
+ <view {...ref ? { ref } : {}} className={clsx(rootClassName, className)} {...pressHandlers} {...nativeProps}>
49
63
  {children}
50
64
  </view>
51
- </CheckboxContext.Provider>);
65
+ </CheckboxContext.Provider>;
52
66
  });
53
67
  CheckboxRoot.displayName = "CheckboxRoot";
54
- export const CheckboxControl = React.forwardRef((props, ref) => {
55
- const [variantProps, restProps] = checkmark.splitVariantProps(props);
56
- const { children, className, ...nativeProps } = restProps;
57
- const { checked, indeterminate, disabled, pressed, tone: ctxTone, variant: ctxVariant, size: ctxSize, } = useCheckboxContext("CheckboxControl");
58
- const tone = variantProps.tone ?? ctxTone;
59
- const variant = variantProps.variant ?? ctxVariant;
60
- const size = variantProps.size ?? ctxSize;
61
- const classes = React.useMemo(() => checkmark({ variant, tone, size, checked, disabled, indeterminate, pressed }), [variant, tone, size, checked, disabled, indeterminate, pressed]);
62
- return (<CheckmarkIconClassContext.Provider value={classes.icon}>
63
- <view {...(ref ? { ref: ref } : {})} className={clsx(classes.root, className)} {...nativeProps}>
68
+ var CheckboxControl = React.forwardRef((props, ref) => {
69
+ const [variantProps, restProps] = checkmark.splitVariantProps(props);
70
+ const { children, className, ...nativeProps } = restProps;
71
+ const context = useCheckboxContext("CheckboxControl");
72
+ const checkmarkVariantProps = {
73
+ ...context.checkmarkVariantProps,
74
+ ...variantProps,
75
+ checked: context.checked,
76
+ disabled: context.disabled,
77
+ indeterminate: context.indeterminate,
78
+ pressed: context.pressed
79
+ };
80
+ const classes = checkmark(checkmarkVariantProps);
81
+ return <CheckmarkControlContext.Provider value={{
82
+ iconClassName: classes.icon,
83
+ checkmarkVariantProps
84
+ }}>
85
+ <view {...ref ? { ref } : {}} className={clsx(classes.root, className)} {...nativeProps}>
64
86
  {children}
65
87
  </view>
66
- </CheckmarkIconClassContext.Provider>);
88
+ </CheckmarkControlContext.Provider>;
67
89
  });
68
90
  CheckboxControl.displayName = "CheckboxControl";
69
- export function CheckboxIndicator(props) {
70
- const { unchecked, checked: checkedIcon, indeterminate: indeterminateIcon, className, style, } = props;
71
- const { checked, indeterminate, disabled, pressed, tone, variant, size } = useCheckboxContext("CheckboxIndicator");
72
- const iconClassName = useCheckmarkIconClass("CheckboxIndicator");
73
- const iconColor = useIconColor([
74
- checked,
75
- indeterminate,
76
- disabled,
77
- pressed,
78
- tone,
79
- variant,
80
- size,
81
- ]);
82
- if (process.env.NODE_ENV !== "production" && indeterminate && !indeterminateIcon) {
83
- console.warn("[seed-design] CheckboxIndicator: `indeterminate` prop must be provided when the checkbox is in an indeterminate state.");
84
- }
85
- const icon = indeterminate ? indeterminateIcon : checked ? checkedIcon : unchecked;
86
- if (!icon || !isValidElement(icon))
87
- return null;
88
- // lynx-monochrome-icon 이 `<image style={{ width, height, ...style }}>` 로 자체 default size 를 박으므로
89
- // recipe 토큰에서 꺼낸 사이즈를 inline 으로 주입해 덮는다.
90
- const iconSize = resolveRecipeToken(checkmarkVars, [
91
- `variant${capitalize(variant)}Size${capitalize(size)}`,
92
- "enabled",
93
- "icon",
94
- "size",
95
- ]);
96
- return cloneElement(icon, {
97
- ...iconColor,
98
- className: clsx(iconClassName, icon.props.className, className),
99
- style: iconSize
100
- ? { width: iconSize, height: iconSize, ...icon.props.style, ...style }
101
- : { ...icon.props.style, ...style },
102
- });
91
+ function CheckboxIndicator(props) {
92
+ const { unchecked, checked: checkedIcon, indeterminate: indeterminateIcon, className, style } = props;
93
+ const context = useCheckboxContext("CheckboxIndicator");
94
+ const { iconClassName, checkmarkVariantProps } = useCheckmarkControlContext("CheckboxIndicator");
95
+ if (process.env.NODE_ENV !== "production" && context.indeterminate && !indeterminateIcon) console.warn("[seed-design] CheckboxIndicator: `indeterminate` prop must be provided when the checkbox is in an indeterminate state.");
96
+ const icon = context.indeterminate ? indeterminateIcon : context.checked ? checkedIcon : unchecked;
97
+ if (!icon || !isValidElement(icon)) return null;
98
+ return <InternalIcon icon={icon} className={clsx(iconClassName, className)} style={style} deps={[
99
+ context.checked,
100
+ context.indeterminate,
101
+ context.disabled,
102
+ context.pressed,
103
+ checkmarkVariantProps.tone,
104
+ checkmarkVariantProps.variant,
105
+ checkmarkVariantProps.size
106
+ ]} />;
103
107
  }
104
108
  CheckboxIndicator.displayName = "CheckboxIndicator";
105
- export const CheckboxLabel = React.forwardRef((props, ref) => {
106
- const { children, className, ...nativeProps } = props;
107
- const { disabled, weight, size } = useCheckboxContext("CheckboxLabel");
108
- const labelClassName = checkbox({ weight, size, disabled }).label;
109
- return (<text {...(ref ? { ref: ref } : {})} className={clsx(labelClassName, className)} {...nativeProps}>
109
+ var CheckboxLabel = React.forwardRef((props, ref) => {
110
+ const { children, className, ...nativeProps } = props;
111
+ const context = useCheckboxContext("CheckboxLabel");
112
+ const labelClassName = checkbox({
113
+ ...context.checkboxVariantProps,
114
+ disabled: context.disabled
115
+ }).label;
116
+ return <text {...ref ? { ref } : {}} className={clsx(labelClassName, className)} {...nativeProps}>
110
117
  {children}
111
- </text>);
118
+ </text>;
112
119
  });
113
120
  CheckboxLabel.displayName = "CheckboxLabel";
114
- export const CheckboxGroup = React.forwardRef((props, ref) => {
115
- const { children, className, ...nativeProps } = props;
116
- const classes = checkboxGroup();
117
- return (<view {...(ref ? { ref: ref } : {})} className={clsx(classes, className)} {...nativeProps}>
121
+ var CheckboxGroup = React.forwardRef((props, ref) => {
122
+ const { children, className, ...nativeProps } = props;
123
+ const classes = checkboxGroup();
124
+ return <view {...ref ? { ref } : {}} className={clsx(classes.root, className)} {...nativeProps}>
118
125
  {children}
119
- </view>);
126
+ </view>;
120
127
  });
121
128
  CheckboxGroup.displayName = "CheckboxGroup";
129
+ //#endregion
130
+ export { CheckboxControl, CheckboxGroup, CheckboxIndicator, CheckboxLabel, CheckboxRoot };
@@ -1,2 +1,2 @@
1
- export { CheckboxControl as Control, CheckboxGroup as Group, CheckboxIndicator as Indicator, CheckboxLabel as Label, CheckboxRoot as Root, type CheckboxControlProps as ControlProps, type CheckboxGroupProps as GroupProps, type CheckboxIndicatorProps as IndicatorProps, type CheckboxLabelProps as LabelProps, type CheckboxRootProps as RootProps, } from "./Checkbox";
1
+ export { CheckboxControl as Control, CheckboxGroup as Group, CheckboxIndicator as Indicator, CheckboxLabel as Label, CheckboxRoot as Root, type CheckboxControlProps as ControlProps, type CheckboxGroupProps as GroupProps, type CheckboxIndicatorProps as IndicatorProps, type CheckboxLabelProps as LabelProps, type CheckboxRootProps as RootProps, } from './Checkbox';
2
2
  //# sourceMappingURL=Checkbox.namespace.d.ts.map
@@ -1 +1,12 @@
1
- export { CheckboxControl as Control, CheckboxGroup as Group, CheckboxIndicator as Indicator, CheckboxLabel as Label, CheckboxRoot as Root, } from "./Checkbox";
1
+ import { __exportAll } from "../../_virtual/_rolldown/runtime.js";
2
+ import { CheckboxControl, CheckboxGroup, CheckboxIndicator, CheckboxLabel, CheckboxRoot } from "./Checkbox.jsx";
3
+ //#region src/components/Checkbox/Checkbox.namespace.ts
4
+ var Checkbox_namespace_exports = /* @__PURE__ */ __exportAll({
5
+ Control: () => CheckboxControl,
6
+ Group: () => CheckboxGroup,
7
+ Indicator: () => CheckboxIndicator,
8
+ Label: () => CheckboxLabel,
9
+ Root: () => CheckboxRoot
10
+ });
11
+ //#endregion
12
+ export { Checkbox_namespace_exports };
@@ -1,3 +1,3 @@
1
- export { CheckboxRoot, CheckboxControl, CheckboxIndicator, CheckboxLabel, CheckboxGroup, type CheckboxRootProps, type CheckboxControlProps, type CheckboxIndicatorProps, type CheckboxLabelProps, type CheckboxGroupProps, } from "./Checkbox";
2
- export * as Checkbox from "./Checkbox.namespace";
1
+ export { CheckboxRoot, CheckboxControl, CheckboxIndicator, CheckboxLabel, CheckboxGroup, type CheckboxRootProps, type CheckboxControlProps, type CheckboxIndicatorProps, type CheckboxLabelProps, type CheckboxGroupProps, } from './Checkbox';
2
+ export * as Checkbox from './Checkbox.namespace';
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,37 @@
1
+ import { DependencyList, ReactElement } from '@lynx-js/react';
2
+ import { LynxIconElementProps, LynxStyledElementProps } from '../../types';
3
+ import { StyleProps } from '../../utils/styled';
4
+ import * as React from "@lynx-js/react";
5
+ export type IconSlotName = "icon" | "prefixIcon" | "suffixIcon";
6
+ interface IconSlotContextValue {
7
+ classNames?: Partial<Record<IconSlotName, string>>;
8
+ deps?: DependencyList;
9
+ }
10
+ export declare function IconRequired({ children, enabled, }: {
11
+ children: React.ReactNode;
12
+ enabled: boolean;
13
+ }): React.JSX.Element;
14
+ export declare function IconSlotProvider({ value, children, }: {
15
+ value: IconSlotContextValue;
16
+ children: React.ReactNode;
17
+ }): React.JSX.Element;
18
+ export declare function getIconSlotName(node: React.ReactNode): IconSlotName | null;
19
+ export interface IconProps extends LynxStyledElementProps {
20
+ icon: ReactElement<LynxIconElementProps>;
21
+ size?: StyleProps["height"] | number;
22
+ color?: StyleProps["color"];
23
+ }
24
+ export interface PrefixIconProps extends IconProps {
25
+ }
26
+ export interface SuffixIconProps extends IconProps {
27
+ }
28
+ export declare const Icon: React.ForwardRefExoticComponent<IconProps & React.RefAttributes<unknown>>;
29
+ export declare const PrefixIcon: React.ForwardRefExoticComponent<PrefixIconProps & React.RefAttributes<unknown>>;
30
+ export declare const SuffixIcon: React.ForwardRefExoticComponent<SuffixIconProps & React.RefAttributes<unknown>>;
31
+ export interface InternalIconProps extends LynxStyledElementProps {
32
+ icon: ReactElement<LynxIconElementProps>;
33
+ deps?: DependencyList;
34
+ }
35
+ export declare const InternalIcon: React.ForwardRefExoticComponent<InternalIconProps & React.RefAttributes<unknown>>;
36
+ export {};
37
+ //# sourceMappingURL=Icon.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Icon.d.ts","sourceRoot":"","sources":["../../../src/components/Icon/Icon.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAGL,KAAK,cAAc,EACnB,KAAK,YAAY,EAClB,MAAM,gBAAgB,CAAC;AAGxB,OAAO,KAAK,EAAE,oBAAoB,EAAE,sBAAsB,EAAe,MAAM,aAAa,CAAC;AAC7F,OAAO,EAAgC,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEnF,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,YAAY,GAAG,YAAY,CAAC;AAIhE,UAAU,oBAAoB;IAC5B,UAAU,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC,CAAC;IACnD,IAAI,CAAC,EAAE,cAAc,CAAC;CACvB;AAWD,wBAAgB,YAAY,CAAC,EAC3B,QAAQ,EACR,OAAO,GACR,EAAE;IACD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,OAAO,EAAE,OAAO,CAAC;CAClB,qBAyCA;AAED,wBAAgB,gBAAgB,CAAC,EAC/B,KAAK,EACL,QAAQ,GACT,EAAE;IACD,KAAK,EAAE,oBAAoB,CAAC;IAC5B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,qBAEA;AAUD,wBAAgB,eAAe,CAAC,IAAI,EAAE,KAAK,CAAC,SAAS,GAAG,YAAY,GAAG,IAAI,CAI1E;AAID,MAAM,WAAW,SAAU,SAAQ,sBAAsB;IACvD,IAAI,EAAE,YAAY,CAAC,oBAAoB,CAAC,CAAC;IACzC,IAAI,CAAC,EAAE,UAAU,CAAC,QAAQ,CAAC,GAAG,MAAM,CAAC;IACrC,KAAK,CAAC,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC;CAC7B;AAED,MAAM,WAAW,eAAgB,SAAQ,SAAS;CAAG;AAErD,MAAM,WAAW,eAAgB,SAAQ,SAAS;CAAG;AAqGrD,eAAO,MAAM,IAAI,2EAA8D,CAAC;AAChF,eAAO,MAAM,UAAU,iFAItB,CAAC;AACF,eAAO,MAAM,UAAU,iFAItB,CAAC;AAIF,MAAM,WAAW,iBAAkB,SAAQ,sBAAsB;IAC/D,IAAI,EAAE,YAAY,CAAC,oBAAoB,CAAC,CAAC;IACzC,IAAI,CAAC,EAAE,cAAc,CAAC;CACvB;AAED,eAAO,MAAM,YAAY,mFA2BvB,CAAC"}
@@ -0,0 +1,143 @@
1
+ import { handleColor, handleDimension } from "../../utils/styled.js";
2
+ import { useIconColor } from "../../hooks/useIconColor.js";
3
+ import clsx from "clsx";
4
+ import * as React from "@lynx-js/react";
5
+ import { cloneElement, isValidElement, useMainThreadRef } from "@lynx-js/react";
6
+ //#region src/components/Icon/Icon.tsx
7
+ var IconSlotContext = React.createContext(null);
8
+ var IconRequiredContext = React.createContext(null);
9
+ function IconRequired({ children, enabled }) {
10
+ const registeredCountRef = React.useRef(0);
11
+ const parentContext = React.useContext(IconRequiredContext);
12
+ const register = React.useCallback(() => {
13
+ registeredCountRef.current += 1;
14
+ if (process.env.NODE_ENV !== "production" && registeredCountRef.current > 1) throw new Error("Icon-only Component must render only one <Icon /> under children. Check if you are rendering multiple <Icon />.");
15
+ }, []);
16
+ const unregister = React.useCallback(() => {
17
+ registeredCountRef.current = Math.max(0, registeredCountRef.current - 1);
18
+ }, []);
19
+ React.useLayoutEffect(() => {
20
+ if (!enabled) return;
21
+ if (process.env.NODE_ENV !== "production") {
22
+ if (parentContext) throw new Error("Icon-only Component must not be nested within another Icon-Only. Check if you are using Icon-Only inside another Icon-Only.");
23
+ if (registeredCountRef.current === 0) throw new Error("Icon-only Component must render <Icon /> as a child. Check if you are using raw icon element instead of <Icon icon={} />.");
24
+ }
25
+ }, [enabled, parentContext]);
26
+ const value = React.useMemo(() => {
27
+ if (!enabled) return parentContext ?? null;
28
+ return {
29
+ register,
30
+ unregister
31
+ };
32
+ }, [
33
+ enabled,
34
+ parentContext,
35
+ register,
36
+ unregister
37
+ ]);
38
+ return <IconRequiredContext.Provider value={value}>{children}</IconRequiredContext.Provider>;
39
+ }
40
+ function IconSlotProvider({ value, children }) {
41
+ return <IconSlotContext.Provider value={value}>{children}</IconSlotContext.Provider>;
42
+ }
43
+ var iconSlotMarker = Symbol.for("@seed-design/lynx-react/icon-slot");
44
+ function getIconSlotName(node) {
45
+ if (!isValidElement(node)) return null;
46
+ return node.type[iconSlotMarker] ?? null;
47
+ }
48
+ function mergeWrapperStyle({ size, color, style }) {
49
+ const dimension = handleDimension(size);
50
+ const resolvedColor = handleColor(color);
51
+ if (dimension == null && resolvedColor == null) return style;
52
+ return {
53
+ ...dimension != null ? {
54
+ width: dimension,
55
+ height: dimension
56
+ } : {},
57
+ ...resolvedColor != null ? { color: resolvedColor } : {},
58
+ ...style
59
+ };
60
+ }
61
+ function getStyleColor(style) {
62
+ return style?.color;
63
+ }
64
+ var IconSlotBase = React.forwardRef((props, ref) => {
65
+ const { icon, slot, baseClassName, className, style, size, color, children: _children, ...nativeProps } = props;
66
+ const context = React.useContext(IconSlotContext);
67
+ const iconRequiredContext = React.useContext(IconRequiredContext);
68
+ const sourceRef = useMainThreadRef(null);
69
+ const slotClassName = slot != null ? context?.classNames?.[slot] : void 0;
70
+ const iconColor = useIconColor([
71
+ baseClassName,
72
+ slotClassName,
73
+ className,
74
+ size,
75
+ color,
76
+ getStyleColor(style),
77
+ ...context?.deps ?? []
78
+ ], { sourceRef });
79
+ const hasValidIcon = isValidElement(icon);
80
+ React.useLayoutEffect(() => {
81
+ if (slot !== "icon" || !hasValidIcon) return;
82
+ iconRequiredContext?.register();
83
+ return () => {
84
+ iconRequiredContext?.unregister();
85
+ };
86
+ }, [
87
+ hasValidIcon,
88
+ iconRequiredContext,
89
+ slot
90
+ ]);
91
+ if (!hasValidIcon) return null;
92
+ return <view {...ref ? { ref } : {}} {...nativeProps} main-thread:ref={sourceRef} className={clsx(baseClassName, slotClassName, className)} style={mergeWrapperStyle({
93
+ size,
94
+ color,
95
+ style
96
+ })}>
97
+ {cloneElement(icon, {
98
+ ...iconColor,
99
+ className: icon.props.className,
100
+ style: {
101
+ ...icon.props.style,
102
+ width: "100%",
103
+ height: "100%"
104
+ }
105
+ })}
106
+ </view>;
107
+ });
108
+ IconSlotBase.displayName = "IconSlotBase";
109
+ function createIconComponent(displayName, slot, baseClassName) {
110
+ const Component = React.forwardRef((props, ref) => {
111
+ return <IconSlotBase ref={ref} slot={slot} baseClassName={baseClassName} {...props} />;
112
+ });
113
+ Component.displayName = displayName;
114
+ Component[iconSlotMarker] = slot;
115
+ return Component;
116
+ }
117
+ var Icon = createIconComponent("Icon", "icon", "seed-icon");
118
+ var PrefixIcon = createIconComponent("PrefixIcon", "prefixIcon", "seed-prefix-icon");
119
+ var SuffixIcon = createIconComponent("SuffixIcon", "suffixIcon", "seed-suffix-icon");
120
+ var InternalIcon = React.forwardRef((props, ref) => {
121
+ const { icon, deps = [], className, style, children: _children, ...nativeProps } = props;
122
+ const sourceRef = useMainThreadRef(null);
123
+ const iconColor = useIconColor([
124
+ className,
125
+ getStyleColor(style),
126
+ ...deps ?? []
127
+ ], { sourceRef });
128
+ if (!isValidElement(icon)) return null;
129
+ return <view {...ref ? { ref } : {}} {...nativeProps} main-thread:ref={sourceRef} className={className} style={style}>
130
+ {cloneElement(icon, {
131
+ ...iconColor,
132
+ className: icon.props.className,
133
+ style: {
134
+ ...icon.props.style,
135
+ width: "100%",
136
+ height: "100%"
137
+ }
138
+ })}
139
+ </view>;
140
+ });
141
+ InternalIcon.displayName = "InternalIcon";
142
+ //#endregion
143
+ export { Icon, IconRequired, IconSlotProvider, InternalIcon, PrefixIcon, SuffixIcon, getIconSlotName };
@@ -0,0 +1,2 @@
1
+ export { Icon, PrefixIcon, SuffixIcon, type IconProps, type PrefixIconProps, type SuffixIconProps, } from './Icon';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Icon/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EACJ,UAAU,EACV,UAAU,EACV,KAAK,SAAS,EACd,KAAK,eAAe,EACpB,KAAK,eAAe,GACrB,MAAM,QAAQ,CAAC"}
@@ -1,11 +1,10 @@
1
+ import { ProgressCircleVariantProps } from '@seed-design/lynx-css/recipes/progress-circle';
2
+ import { LynxStyledElementProps } from '../../types';
1
3
  import type * as React from "@lynx-js/react";
2
- import type { ProgressCircleVariantProps } from "@seed-design/lynx-css/recipes/progress-circle";
3
- export interface ProgressCircleRootProps extends ProgressCircleVariantProps {
4
+ export interface ProgressCircleRootProps extends ProgressCircleVariantProps, LynxStyledElementProps {
4
5
  minValue?: number;
5
6
  maxValue?: number;
6
7
  value?: number;
7
- children?: React.ReactNode;
8
- className?: string;
9
8
  }
10
9
  export type RootProps = ProgressCircleRootProps;
11
10
  /**
@@ -18,10 +17,7 @@ export type RootProps = ProgressCircleRootProps;
18
17
  *
19
18
  * Lynx SVG + stroke-dasharray 지원 시 CSS-only 애니메이션으로 전환 예정.
20
19
  */
21
- export declare const ProgressCircleRoot: {
22
- (props: ProgressCircleRootProps): React.JSX.Element;
23
- displayName: string;
24
- };
20
+ export declare const ProgressCircleRoot: React.ForwardRefExoticComponent<ProgressCircleRootProps & React.RefAttributes<unknown>>;
25
21
  export declare const ProgressCircleRange: {
26
22
  (): React.JSX.Element;
27
23
  displayName: string;
@@ -1 +1 @@
1
- {"version":3,"file":"ProgressCircle.d.ts","sourceRoot":"","sources":["../../../src/components/ProgressCircle/ProgressCircle.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,gBAAgB,CAAC;AAY7C,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,+CAA+C,CAAC;AAqGhG,MAAM,WAAW,uBAAwB,SAAQ,0BAA0B;IACzE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,MAAM,SAAS,GAAG,uBAAuB,CAAC;AAEhD;;;;;;;;;GASG;AACH,eAAO,MAAM,kBAAkB;YAAW,uBAAuB;;CAgChE,CAAC;AAEF,eAAO,MAAM,mBAAmB;;;CAQ/B,CAAC"}
1
+ {"version":3,"file":"ProgressCircle.d.ts","sourceRoot":"","sources":["../../../src/components/ProgressCircle/ProgressCircle.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,gBAAgB,CAAC;AAa7C,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,+CAA+C,CAAC;AAChG,OAAO,KAAK,EAAE,sBAAsB,EAAe,MAAM,aAAa,CAAC;AA2GvE,MAAM,WAAW,uBACf,SAAQ,0BAA0B,EAChC,sBAAsB;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,MAAM,SAAS,GAAG,uBAAuB,CAAC;AAIhD;;;;;;;;;GASG;AACH,eAAO,MAAM,kBAAkB,yFA8B7B,CAAC;AAIH,eAAO,MAAM,mBAAmB;;;CAQ/B,CAAC"}