@mindlogic-ai/logician-ui 4.0.0-alpha.24 → 4.0.0-alpha.26

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 (229) hide show
  1. package/dist/components/Badge/Badge.d.ts +2 -15
  2. package/dist/components/Badge/Badge.d.ts.map +1 -1
  3. package/dist/components/Badge/Badge.js +5 -2
  4. package/dist/components/Badge/Badge.js.map +1 -1
  5. package/dist/components/Badge/Badge.mjs +5 -2
  6. package/dist/components/Badge/Badge.mjs.map +1 -1
  7. package/dist/components/Badge/Badge.types.d.ts +15 -2
  8. package/dist/components/Badge/Badge.types.d.ts.map +1 -1
  9. package/dist/components/Badge/index.d.ts +1 -1
  10. package/dist/components/Badge/index.d.ts.map +1 -1
  11. package/dist/components/Button/Button.d.ts +2 -18
  12. package/dist/components/Button/Button.d.ts.map +1 -1
  13. package/dist/components/Button/Button.js +14 -2
  14. package/dist/components/Button/Button.js.map +1 -1
  15. package/dist/components/Button/Button.mjs +14 -2
  16. package/dist/components/Button/Button.mjs.map +1 -1
  17. package/dist/components/Button/Button.types.d.ts +22 -1
  18. package/dist/components/Button/Button.types.d.ts.map +1 -1
  19. package/dist/components/Button/index.d.ts +1 -1
  20. package/dist/components/Button/index.d.ts.map +1 -1
  21. package/dist/components/Card/Card.d.ts +2 -5
  22. package/dist/components/Card/Card.d.ts.map +1 -1
  23. package/dist/components/Card/Card.js +5 -2
  24. package/dist/components/Card/Card.js.map +1 -1
  25. package/dist/components/Card/Card.mjs +5 -2
  26. package/dist/components/Card/Card.mjs.map +1 -1
  27. package/dist/components/Card/Card.types.d.ts +15 -1
  28. package/dist/components/Card/Card.types.d.ts.map +1 -1
  29. package/dist/components/Card/index.d.ts +1 -1
  30. package/dist/components/Card/index.d.ts.map +1 -1
  31. package/dist/components/Chip/Chip.d.ts +3 -16
  32. package/dist/components/Chip/Chip.d.ts.map +1 -1
  33. package/dist/components/Chip/Chip.js +5 -2
  34. package/dist/components/Chip/Chip.js.map +1 -1
  35. package/dist/components/Chip/Chip.mjs +5 -2
  36. package/dist/components/Chip/Chip.mjs.map +1 -1
  37. package/dist/components/Chip/Chip.types.d.ts +11 -2
  38. package/dist/components/Chip/Chip.types.d.ts.map +1 -1
  39. package/dist/components/Chip/index.d.ts +1 -1
  40. package/dist/components/Chip/index.d.ts.map +1 -1
  41. package/dist/components/Container/Container.d.ts +3 -4
  42. package/dist/components/Container/Container.d.ts.map +1 -1
  43. package/dist/components/Container/Container.js +5 -1
  44. package/dist/components/Container/Container.js.map +1 -1
  45. package/dist/components/Container/Container.mjs +5 -1
  46. package/dist/components/Container/Container.mjs.map +1 -1
  47. package/dist/components/Container/Container.types.d.ts +16 -0
  48. package/dist/components/Container/Container.types.d.ts.map +1 -0
  49. package/dist/components/Container/index.d.ts +1 -0
  50. package/dist/components/Container/index.d.ts.map +1 -1
  51. package/dist/components/ExpandableText/ExpandableText.d.ts +8 -9
  52. package/dist/components/ExpandableText/ExpandableText.d.ts.map +1 -1
  53. package/dist/components/Form/FormSection/CollapsibleFormSection.js +1 -0
  54. package/dist/components/Form/FormSection/CollapsibleFormSection.js.map +1 -1
  55. package/dist/components/Form/FormSection/CollapsibleFormSection.mjs +1 -0
  56. package/dist/components/Form/FormSection/CollapsibleFormSection.mjs.map +1 -1
  57. package/dist/components/IconButton/IconButton.d.ts +2 -17
  58. package/dist/components/IconButton/IconButton.d.ts.map +1 -1
  59. package/dist/components/IconButton/IconButton.js +5 -2
  60. package/dist/components/IconButton/IconButton.js.map +1 -1
  61. package/dist/components/IconButton/IconButton.mjs +5 -2
  62. package/dist/components/IconButton/IconButton.mjs.map +1 -1
  63. package/dist/components/IconButton/IconButton.types.d.ts +15 -1
  64. package/dist/components/IconButton/IconButton.types.d.ts.map +1 -1
  65. package/dist/components/IconButton/index.d.ts +1 -1
  66. package/dist/components/IconButton/index.d.ts.map +1 -1
  67. package/dist/components/Menu/Menu.d.ts +1 -1
  68. package/dist/components/Menu/MenuItem.d.ts +2 -2
  69. package/dist/components/Menu/MenuItem.d.ts.map +1 -1
  70. package/dist/components/Menu/MenuItem.js +5 -1
  71. package/dist/components/Menu/MenuItem.js.map +1 -1
  72. package/dist/components/Menu/MenuItem.mjs +5 -1
  73. package/dist/components/Menu/MenuItem.mjs.map +1 -1
  74. package/dist/components/Menu/MenuItem.types.d.ts +17 -2
  75. package/dist/components/Menu/MenuItem.types.d.ts.map +1 -1
  76. package/dist/components/Menu/MenuItem.types.js.map +1 -1
  77. package/dist/components/Menu/MenuItem.types.mjs.map +1 -1
  78. package/dist/components/SeeMoreButton/SeeMoreButton.d.ts +3 -10
  79. package/dist/components/SeeMoreButton/SeeMoreButton.d.ts.map +1 -1
  80. package/dist/components/SeeMoreButton/SeeMoreButton.js +5 -1
  81. package/dist/components/SeeMoreButton/SeeMoreButton.js.map +1 -1
  82. package/dist/components/SeeMoreButton/SeeMoreButton.mjs +5 -1
  83. package/dist/components/SeeMoreButton/SeeMoreButton.mjs.map +1 -1
  84. package/dist/components/SeeMoreButton/SeeMoreButton.types.d.ts +10 -3
  85. package/dist/components/SeeMoreButton/SeeMoreButton.types.d.ts.map +1 -1
  86. package/dist/components/Tag/Tag.d.ts +3 -21
  87. package/dist/components/Tag/Tag.d.ts.map +1 -1
  88. package/dist/components/Tag/Tag.js +5 -2
  89. package/dist/components/Tag/Tag.js.map +1 -1
  90. package/dist/components/Tag/Tag.mjs +5 -2
  91. package/dist/components/Tag/Tag.mjs.map +1 -1
  92. package/dist/components/Tag/Tag.types.d.ts +9 -2
  93. package/dist/components/Tag/Tag.types.d.ts.map +1 -1
  94. package/dist/components/Tag/index.d.ts +1 -1
  95. package/dist/components/Tag/index.d.ts.map +1 -1
  96. package/dist/components/Typography/Caption.d.ts +3 -15
  97. package/dist/components/Typography/Caption.d.ts.map +1 -1
  98. package/dist/components/Typography/Caption.js +5 -2
  99. package/dist/components/Typography/Caption.js.map +1 -1
  100. package/dist/components/Typography/Caption.mjs +5 -2
  101. package/dist/components/Typography/Caption.mjs.map +1 -1
  102. package/dist/components/Typography/H1.d.ts +3 -2
  103. package/dist/components/Typography/H1.d.ts.map +1 -1
  104. package/dist/components/Typography/H1.js +5 -2
  105. package/dist/components/Typography/H1.js.map +1 -1
  106. package/dist/components/Typography/H1.mjs +5 -2
  107. package/dist/components/Typography/H1.mjs.map +1 -1
  108. package/dist/components/Typography/H2.d.ts +3 -2
  109. package/dist/components/Typography/H2.d.ts.map +1 -1
  110. package/dist/components/Typography/H2.js +5 -2
  111. package/dist/components/Typography/H2.js.map +1 -1
  112. package/dist/components/Typography/H2.mjs +5 -2
  113. package/dist/components/Typography/H2.mjs.map +1 -1
  114. package/dist/components/Typography/H3.d.ts +3 -2
  115. package/dist/components/Typography/H3.d.ts.map +1 -1
  116. package/dist/components/Typography/H3.js +5 -2
  117. package/dist/components/Typography/H3.js.map +1 -1
  118. package/dist/components/Typography/H3.mjs +5 -2
  119. package/dist/components/Typography/H3.mjs.map +1 -1
  120. package/dist/components/Typography/H4.d.ts +3 -2
  121. package/dist/components/Typography/H4.d.ts.map +1 -1
  122. package/dist/components/Typography/H4.js +5 -2
  123. package/dist/components/Typography/H4.js.map +1 -1
  124. package/dist/components/Typography/H4.mjs +5 -2
  125. package/dist/components/Typography/H4.mjs.map +1 -1
  126. package/dist/components/Typography/H5.d.ts +3 -2
  127. package/dist/components/Typography/H5.d.ts.map +1 -1
  128. package/dist/components/Typography/H5.js +5 -2
  129. package/dist/components/Typography/H5.js.map +1 -1
  130. package/dist/components/Typography/H5.mjs +5 -2
  131. package/dist/components/Typography/H5.mjs.map +1 -1
  132. package/dist/components/Typography/Link.d.ts +14 -3
  133. package/dist/components/Typography/Link.d.ts.map +1 -1
  134. package/dist/components/Typography/Link.js +5 -2
  135. package/dist/components/Typography/Link.js.map +1 -1
  136. package/dist/components/Typography/Link.mjs +5 -2
  137. package/dist/components/Typography/Link.mjs.map +1 -1
  138. package/dist/components/Typography/Overline.d.ts +3 -13
  139. package/dist/components/Typography/Overline.d.ts.map +1 -1
  140. package/dist/components/Typography/Overline.js +5 -2
  141. package/dist/components/Typography/Overline.js.map +1 -1
  142. package/dist/components/Typography/Overline.mjs +5 -2
  143. package/dist/components/Typography/Overline.mjs.map +1 -1
  144. package/dist/components/Typography/Subtext.d.ts +3 -3
  145. package/dist/components/Typography/Subtext.d.ts.map +1 -1
  146. package/dist/components/Typography/Subtext.js +5 -2
  147. package/dist/components/Typography/Subtext.js.map +1 -1
  148. package/dist/components/Typography/Subtext.mjs +5 -2
  149. package/dist/components/Typography/Subtext.mjs.map +1 -1
  150. package/dist/components/Typography/Subtitle.d.ts +3 -19
  151. package/dist/components/Typography/Subtitle.d.ts.map +1 -1
  152. package/dist/components/Typography/Subtitle.js +5 -2
  153. package/dist/components/Typography/Subtitle.js.map +1 -1
  154. package/dist/components/Typography/Subtitle.mjs +5 -2
  155. package/dist/components/Typography/Subtitle.mjs.map +1 -1
  156. package/dist/components/Typography/Text.d.ts +3 -3
  157. package/dist/components/Typography/Text.d.ts.map +1 -1
  158. package/dist/components/Typography/Text.js +5 -2
  159. package/dist/components/Typography/Text.js.map +1 -1
  160. package/dist/components/Typography/Text.mjs +5 -2
  161. package/dist/components/Typography/Text.mjs.map +1 -1
  162. package/dist/components/Typography/Typography.types.d.ts +35 -2
  163. package/dist/components/Typography/Typography.types.d.ts.map +1 -1
  164. package/dist/components/Typography/index.d.ts +2 -2
  165. package/dist/components/Typography/index.d.ts.map +1 -1
  166. package/dist/components/Workflow/canvas/DrawerShell/DrawerHeader.js +1 -0
  167. package/dist/components/Workflow/canvas/DrawerShell/DrawerHeader.js.map +1 -1
  168. package/dist/components/Workflow/canvas/DrawerShell/DrawerHeader.mjs +1 -0
  169. package/dist/components/Workflow/canvas/DrawerShell/DrawerHeader.mjs.map +1 -1
  170. package/dist/components/Workflow/canvas/DrawerShell/DrawerShell.js +1 -0
  171. package/dist/components/Workflow/canvas/DrawerShell/DrawerShell.js.map +1 -1
  172. package/dist/components/Workflow/canvas/DrawerShell/DrawerShell.mjs +1 -0
  173. package/dist/components/Workflow/canvas/DrawerShell/DrawerShell.mjs.map +1 -1
  174. package/dist/index.d.ts +3 -0
  175. package/dist/index.d.ts.map +1 -1
  176. package/dist/index.js +2 -0
  177. package/dist/index.js.map +1 -1
  178. package/dist/index.mjs +1 -0
  179. package/dist/index.mjs.map +1 -1
  180. package/dist/types/polymorphic.d.ts +101 -0
  181. package/dist/types/polymorphic.d.ts.map +1 -0
  182. package/dist/types/polymorphic.js +57 -0
  183. package/dist/types/polymorphic.js.map +1 -0
  184. package/dist/types/polymorphic.mjs +55 -0
  185. package/dist/types/polymorphic.mjs.map +1 -0
  186. package/package.json +1 -1
  187. package/src/components/Badge/Badge.tsx +8 -4
  188. package/src/components/Badge/Badge.types.ts +19 -2
  189. package/src/components/Badge/index.ts +1 -1
  190. package/src/components/Button/Button.stories.tsx +32 -0
  191. package/src/components/Button/Button.tsx +16 -3
  192. package/src/components/Button/Button.types.ts +31 -2
  193. package/src/components/Button/index.tsx +1 -0
  194. package/src/components/Card/Card.stories.tsx +23 -0
  195. package/src/components/Card/Card.tsx +7 -3
  196. package/src/components/Card/Card.types.ts +21 -1
  197. package/src/components/Card/index.ts +1 -1
  198. package/src/components/Chip/Chip.tsx +8 -4
  199. package/src/components/Chip/Chip.types.ts +19 -4
  200. package/src/components/Chip/index.ts +6 -1
  201. package/src/components/Container/Container.tsx +10 -3
  202. package/src/components/Container/Container.types.ts +20 -0
  203. package/src/components/Container/index.ts +1 -0
  204. package/src/components/IconButton/IconButton.tsx +7 -3
  205. package/src/components/IconButton/IconButton.types.ts +19 -2
  206. package/src/components/IconButton/index.tsx +1 -0
  207. package/src/components/Menu/MenuItem.tsx +9 -3
  208. package/src/components/Menu/MenuItem.types.ts +23 -2
  209. package/src/components/SeeMoreButton/SeeMoreButton.tsx +10 -3
  210. package/src/components/SeeMoreButton/SeeMoreButton.types.ts +14 -3
  211. package/src/components/Tag/Tag.tsx +13 -4
  212. package/src/components/Tag/Tag.types.ts +17 -4
  213. package/src/components/Tag/index.ts +6 -1
  214. package/src/components/Typography/Caption.tsx +9 -3
  215. package/src/components/Typography/H1.tsx +9 -3
  216. package/src/components/Typography/H2.tsx +9 -3
  217. package/src/components/Typography/H3.tsx +9 -3
  218. package/src/components/Typography/H4.tsx +9 -3
  219. package/src/components/Typography/H5.tsx +9 -3
  220. package/src/components/Typography/Link.tsx +22 -4
  221. package/src/components/Typography/Overline.tsx +9 -3
  222. package/src/components/Typography/Subtext.tsx +9 -3
  223. package/src/components/Typography/Subtitle.tsx +9 -3
  224. package/src/components/Typography/Text.tsx +9 -3
  225. package/src/components/Typography/Typography.stories.tsx +26 -0
  226. package/src/components/Typography/Typography.types.ts +47 -2
  227. package/src/components/Typography/index.ts +6 -1
  228. package/src/index.ts +28 -0
  229. package/src/types/polymorphic.ts +114 -0
@@ -1,16 +1,3 @@
1
- import { BadgeProps } from './Badge.types';
2
- /**
3
- * Badge component with color variants using the Golden Ratio color system.
4
- *
5
- * @example
6
- * ```tsx
7
- * <Badge>Default</Badge>
8
- * <Badge variant="success">Completed</Badge>
9
- * <Badge variant="danger">Error</Badge>
10
- * <Badge variant="warning">Pending</Badge>
11
- * <Badge variant="secondary">Featured</Badge>
12
- * <Badge variant="neutral">Draft</Badge>
13
- * ```
14
- */
15
- export declare const Badge: import("react").ForwardRefExoticComponent<BadgeProps & import("react").RefAttributes<HTMLButtonElement>>;
1
+ import { BadgeOwnProps } from './Badge.types';
2
+ export declare const Badge: import("../..").PolymorphicComponent<BadgeOwnProps, "span">;
16
3
  //# sourceMappingURL=Badge.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Badge.d.ts","sourceRoot":"","sources":["../../../src/components/Badge/Badge.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,KAAK,0GAgBjB,CAAC"}
1
+ {"version":3,"file":"Badge.d.ts","sourceRoot":"","sources":["../../../src/components/Badge/Badge.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAoC9C,eAAO,MAAM,KAAK,6DAAgD,CAAC"}
@@ -4,6 +4,7 @@
4
4
  var jsxRuntime = require('react/jsx-runtime');
5
5
  var React = require('react');
6
6
  var react = require('@chakra-ui/react');
7
+ var polymorphic = require('../../types/polymorphic.js');
7
8
  var Badge_styles = require('./Badge.styles.js');
8
9
 
9
10
  /**
@@ -19,10 +20,12 @@ var Badge_styles = require('./Badge.styles.js');
19
20
  * <Badge variant="neutral">Draft</Badge>
20
21
  * ```
21
22
  */
22
- const Badge = React.forwardRef(({ textTransform = 'none', variant = 'primary', ...rest }, ref) => {
23
+ const BadgeImpl = React.forwardRef(({ textTransform = 'none', variant = 'primary', ...rest }, ref) => {
23
24
  return (jsxRuntime.jsx(react.Badge, { ...Badge_styles.baseStyles, ...Badge_styles.variantStyles[variant], w: "fit-content", textTransform: textTransform, ...rest, ref: ref }));
24
25
  });
25
- Badge.displayName = 'Badge';
26
+ /** Type-level polymorphism over the same runtime — see the note on `Button`. */
27
+ BadgeImpl.displayName = 'Badge';
28
+ const Badge = polymorphic.polymorphic(BadgeImpl);
26
29
 
27
30
  exports.Badge = Badge;
28
31
  //# sourceMappingURL=Badge.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Badge.js","sources":["../../../src/components/Badge/Badge.tsx"],"sourcesContent":[null],"names":["forwardRef","_jsx","ChakraBadge","baseStyles","variantStyles"],"mappings":";;;;;;;;AAMA;;;;;;;;;;;;AAYG;MACU,KAAK,GAAGA,gBAAU,CAC7B,CACE,EAAE,aAAa,GAAG,MAAM,EAAE,OAAO,GAAG,SAAS,EAAE,GAAG,IAAI,EAAc,EACpE,GAAqC,KACnC;IACF,QACEC,cAAA,CAACC,WAAW,EAAA,EAAA,GACNC,uBAAU,EAAA,GACVC,0BAAa,CAAC,OAAO,CAAC,EAC1B,CAAC,EAAC,aAAa,EACf,aAAa,EAAE,aAAa,EAAA,GACxB,IAAI,EACR,GAAG,EAAE,GAAG,EAAA,CACR;AAEN,CAAC;AAGH,KAAK,CAAC,WAAW,GAAG,OAAO;;;;"}
1
+ {"version":3,"file":"Badge.js","sources":["../../../src/components/Badge/Badge.tsx"],"sourcesContent":[null],"names":["forwardRef","_jsx","ChakraBadge","baseStyles","variantStyles","polymorphic"],"mappings":";;;;;;;;;AAOA;;;;;;;;;;;;AAYG;AACH,MAAM,SAAS,GAAGA,gBAAU,CAC1B,CACE,EAAE,aAAa,GAAG,MAAM,EAAE,OAAO,GAAG,SAAS,EAAE,GAAG,IAAI,EAAiB,EACvE,GAAqC,KACnC;IACF,QACEC,cAAA,CAACC,WAAW,EAAA,EAAA,GACNC,uBAAU,EAAA,GACVC,0BAAa,CAAC,OAAO,CAAC,EAC1B,CAAC,EAAC,aAAa,EACf,aAAa,EAAE,aAAa,EAAA,GACxB,IAAI,EACR,GAAG,EAAE,GAAG,EAAA,CACR;AAEN,CAAC,CACF;AAED;AACA,SAAS,CAAC,WAAW,GAAG,OAAO;MAElB,KAAK,GAAGC,uBAAW,CAAwB,SAAS;;;;"}
@@ -2,6 +2,7 @@
2
2
  import { jsx } from 'react/jsx-runtime';
3
3
  import { forwardRef } from 'react';
4
4
  import { Badge as Badge$1 } from '@chakra-ui/react';
5
+ import { polymorphic } from '../../types/polymorphic.mjs';
5
6
  import { variantStyles, baseStyles } from './Badge.styles.mjs';
6
7
 
7
8
  /**
@@ -17,10 +18,12 @@ import { variantStyles, baseStyles } from './Badge.styles.mjs';
17
18
  * <Badge variant="neutral">Draft</Badge>
18
19
  * ```
19
20
  */
20
- const Badge = forwardRef(({ textTransform = 'none', variant = 'primary', ...rest }, ref) => {
21
+ const BadgeImpl = forwardRef(({ textTransform = 'none', variant = 'primary', ...rest }, ref) => {
21
22
  return (jsx(Badge$1, { ...baseStyles, ...variantStyles[variant], w: "fit-content", textTransform: textTransform, ...rest, ref: ref }));
22
23
  });
23
- Badge.displayName = 'Badge';
24
+ /** Type-level polymorphism over the same runtime — see the note on `Button`. */
25
+ BadgeImpl.displayName = 'Badge';
26
+ const Badge = polymorphic(BadgeImpl);
24
27
 
25
28
  export { Badge };
26
29
  //# sourceMappingURL=Badge.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Badge.mjs","sources":["../../../src/components/Badge/Badge.tsx"],"sourcesContent":[null],"names":["_jsx","ChakraBadge"],"mappings":";;;;;;AAMA;;;;;;;;;;;;AAYG;MACU,KAAK,GAAG,UAAU,CAC7B,CACE,EAAE,aAAa,GAAG,MAAM,EAAE,OAAO,GAAG,SAAS,EAAE,GAAG,IAAI,EAAc,EACpE,GAAqC,KACnC;IACF,QACEA,GAAA,CAACC,OAAW,EAAA,EAAA,GACN,UAAU,EAAA,GACV,aAAa,CAAC,OAAO,CAAC,EAC1B,CAAC,EAAC,aAAa,EACf,aAAa,EAAE,aAAa,EAAA,GACxB,IAAI,EACR,GAAG,EAAE,GAAG,EAAA,CACR;AAEN,CAAC;AAGH,KAAK,CAAC,WAAW,GAAG,OAAO;;;;"}
1
+ {"version":3,"file":"Badge.mjs","sources":["../../../src/components/Badge/Badge.tsx"],"sourcesContent":[null],"names":["_jsx","ChakraBadge"],"mappings":";;;;;;;AAOA;;;;;;;;;;;;AAYG;AACH,MAAM,SAAS,GAAG,UAAU,CAC1B,CACE,EAAE,aAAa,GAAG,MAAM,EAAE,OAAO,GAAG,SAAS,EAAE,GAAG,IAAI,EAAiB,EACvE,GAAqC,KACnC;IACF,QACEA,GAAA,CAACC,OAAW,EAAA,EAAA,GACN,UAAU,EAAA,GACV,aAAa,CAAC,OAAO,CAAC,EAC1B,CAAC,EAAC,aAAa,EACf,aAAa,EAAE,aAAa,EAAA,GACxB,IAAI,EACR,GAAG,EAAE,GAAG,EAAA,CACR;AAEN,CAAC,CACF;AAED;AACA,SAAS,CAAC,WAAW,GAAG,OAAO;MAElB,KAAK,GAAG,WAAW,CAAwB,SAAS;;;;"}
@@ -1,4 +1,6 @@
1
+ import type { ElementType } from 'react';
1
2
  import { BadgeProps as ChakraBadgeProps } from '@chakra-ui/react';
3
+ import type { PolymorphicProps } from '../../types/polymorphic';
2
4
  /**
3
5
  * Badge variant types for the Golden Ratio color system.
4
6
  *
@@ -13,11 +15,22 @@ import { BadgeProps as ChakraBadgeProps } from '@chakra-ui/react';
13
15
  * - `neutral`: Gray badge for neutral information
14
16
  */
15
17
  export type BadgeVariant = 'primary' | 'secondary' | 'success' | 'warning' | 'danger' | 'neutral';
16
- export interface BadgeProps extends Omit<ChakraBadgeProps, 'variant'> {
18
+ export type BadgeOwnProps = Omit<ChakraBadgeProps, 'variant' | 'as'> & {
17
19
  /**
18
20
  * The color variant of the badge.
19
21
  * @default 'primary'
20
22
  */
21
23
  variant?: BadgeVariant;
22
- }
24
+ };
25
+ /**
26
+ * Props for `Badge`, typed for whatever element `as` renders.
27
+ *
28
+ * Defaults to `'span'`, so bare `BadgeProps` is unchanged. A badge that acts as
29
+ * a citation or filter link is the case that needs this.
30
+ *
31
+ * ```tsx
32
+ * <Badge as="a" href={`#cite-${n}`}>{n}</Badge>
33
+ * ```
34
+ */
35
+ export type BadgeProps<TElement extends ElementType = 'span'> = PolymorphicProps<TElement, BadgeOwnProps>;
23
36
  //# sourceMappingURL=Badge.types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Badge.types.d.ts","sourceRoot":"","sources":["../../../src/components/Badge/Badge.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,IAAI,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAElE;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,YAAY,GACpB,SAAS,GACT,WAAW,GACX,SAAS,GACT,SAAS,GACT,QAAQ,GACR,SAAS,CAAC;AAEd,MAAM,WAAW,UAAW,SAAQ,IAAI,CAAC,gBAAgB,EAAE,SAAS,CAAC;IACnE;;;OAGG;IACH,OAAO,CAAC,EAAE,YAAY,CAAC;CACxB"}
1
+ {"version":3,"file":"Badge.types.d.ts","sourceRoot":"","sources":["../../../src/components/Badge/Badge.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,EAAE,UAAU,IAAI,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAGlE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAEhE;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,YAAY,GACpB,SAAS,GACT,WAAW,GACX,SAAS,GACT,SAAS,GACT,QAAQ,GACR,SAAS,CAAC;AAEd,MAAM,MAAM,aAAa,GAAG,IAAI,CAAC,gBAAgB,EAAE,SAAS,GAAG,IAAI,CAAC,GAAG;IACrE;;;OAGG;IACH,OAAO,CAAC,EAAE,YAAY,CAAC;CACxB,CAAC;AAEF;;;;;;;;;GASG;AACH,MAAM,MAAM,UAAU,CAAC,QAAQ,SAAS,WAAW,GAAG,MAAM,IAC1D,gBAAgB,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC"}
@@ -1,4 +1,4 @@
1
1
  export { Badge } from './Badge';
2
2
  export { baseStyles as badgeStyles, variantStyles as badgeVariantStyles, } from './Badge.styles';
3
- export type { BadgeProps, BadgeVariant } from './Badge.types';
3
+ export type { BadgeOwnProps, BadgeProps, BadgeVariant } from './Badge.types';
4
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Badge/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EACL,UAAU,IAAI,WAAW,EACzB,aAAa,IAAI,kBAAkB,GACpC,MAAM,gBAAgB,CAAC;AACxB,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Badge/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EACL,UAAU,IAAI,WAAW,EACzB,aAAa,IAAI,kBAAkB,GACpC,MAAM,gBAAgB,CAAC;AACxB,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC"}
@@ -1,19 +1,3 @@
1
- /**
2
- * Button component with two-dimensional variant system.
3
- *
4
- * Combines `colorPalette` (semantic color) with `variant` (visual appearance)
5
- * for flexible, consistent button styling.
6
- *
7
- * @example
8
- * ```tsx
9
- * <Button colorPalette="primary" variant="soft">Submit</Button>
10
- * <Button colorPalette="danger" variant="solid">Delete</Button>
11
- * <Button colorPalette="secondary" variant="outline">Cancel</Button>
12
- * <Button colorPalette="neutral" variant="ghost">Close</Button>
13
- * ```
14
- */
15
- export declare const Button: import("react").ForwardRefExoticComponent<Omit<import("@chakra-ui/react").ButtonProps, "colorScheme" | "colorPalette" | "variant" | "leftIcon" | "rightIcon"> & {
16
- colorPalette?: import("./Button.types").ButtonColorPalette;
17
- variant?: import("./Button.types").ButtonVariant;
18
- } & import("react").RefAttributes<HTMLButtonElement>>;
1
+ import { ButtonOwnProps } from './Button.types';
2
+ export declare const Button: import("../..").PolymorphicComponent<ButtonOwnProps, "button">;
19
3
  //# sourceMappingURL=Button.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/components/Button/Button.tsx"],"names":[],"mappings":"AAQA;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,MAAM;;;qDAoClB,CAAC"}
1
+ {"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/components/Button/Button.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,cAAc,EAAe,MAAM,gBAAgB,CAAC;AAkE7D,eAAO,MAAM,MAAM,gEAA0C,CAAC"}
@@ -5,6 +5,7 @@ var jsxRuntime = require('react/jsx-runtime');
5
5
  var React = require('react');
6
6
  var react = require('@chakra-ui/react');
7
7
  var focusRing = require('../../utils/focusRing.js');
8
+ var polymorphic = require('../../types/polymorphic.js');
8
9
  var Button_styles = require('./Button.styles.js');
9
10
 
10
11
  /**
@@ -19,9 +20,12 @@ var Button_styles = require('./Button.styles.js');
19
20
  * <Button colorPalette="danger" variant="solid">Delete</Button>
20
21
  * <Button colorPalette="secondary" variant="outline">Cancel</Button>
21
22
  * <Button colorPalette="neutral" variant="ghost">Close</Button>
23
+ *
24
+ * // `as` carries the element's own props (see Button.types.ts):
25
+ * <Button as="a" href="/docs" target="_blank">문서</Button>
22
26
  * ```
23
27
  */
24
- const Button = React.forwardRef(({ colorPalette, variant = 'soft', size, children, ...rest }, ref) => {
28
+ const ButtonImpl = React.forwardRef(({ colorPalette, variant = 'soft', size, children, ...rest }, ref) => {
25
29
  const palette = colorPalette ?? 'primary';
26
30
  const styles = Button_styles.getButtonStyles(palette, variant);
27
31
  /**
@@ -36,7 +40,15 @@ const Button = React.forwardRef(({ colorPalette, variant = 'soft', size, childre
36
40
  */
37
41
  return (jsxRuntime.jsx(react.Button, { border: "1px solid", lineHeight: "1.2", fontWeight: "semibold", size: size, borderRadius: "md", ...styles, ...focusRing.focusRing, cursor: "pointer", transitionProperty: "all", transitionDuration: "0.25s", transitionTimingFunction: "ease-in-out", ref: ref, ...rest, children: children }));
38
42
  });
39
- Button.displayName = 'Button';
43
+ /**
44
+ * Type-level polymorphism over the same runtime — see `polymorphic` in
45
+ * `src/types/polymorphic.ts` for what the cast does and why it is needed.
46
+ *
47
+ * `as` defaults to `'button'`, so nothing that already compiles stops
48
+ * compiling.
49
+ */
50
+ ButtonImpl.displayName = 'Button';
51
+ const Button = polymorphic.polymorphic(ButtonImpl);
40
52
 
41
53
  exports.Button = Button;
42
54
  //# sourceMappingURL=Button.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Button.js","sources":["../../../src/components/Button/Button.tsx"],"sourcesContent":[null],"names":["forwardRef","getButtonStyles","_jsx","ChakraButton","focusRing"],"mappings":";;;;;;;;;AAQA;;;;;;;;;;;;;AAaG;AACI,MAAM,MAAM,GAAGA,gBAAU,CAC9B,CAAC,EAAE,YAAY,EAAE,OAAO,GAAG,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,EAAE,GAAG,KAAI;AACnE,IAAA,MAAM,OAAO,GAAG,YAAY,IAAI,SAAS;IAEzC,MAAM,MAAM,GAAGC,6BAAe,CAAC,OAAO,EAAE,OAAO,CAAC;AAEhD;;;;;;;;;AASG;IACH,QACEC,cAAA,CAACC,YAAY,EAAA,EACX,MAAM,EAAC,WAAW,EAClB,UAAU,EAAC,KAAK,EAChB,UAAU,EAAC,UAAU,EACrB,IAAI,EAAE,IAAI,EACV,YAAY,EAAC,IAAI,EAAA,GACb,MAAM,EAAA,GACNC,mBAAS,EACb,MAAM,EAAC,SAAS,EAChB,kBAAkB,EAAC,KAAK,EACxB,kBAAkB,EAAC,OAAO,EAC1B,wBAAwB,EAAC,aAAa,EACtC,GAAG,EAAE,GAAG,EAAA,GACJ,IAAI,EAAA,QAAA,EAEP,QAAQ,EAAA,CACI;AAEnB,CAAC;AAGH,MAAM,CAAC,WAAW,GAAG,QAAQ;;;;"}
1
+ {"version":3,"file":"Button.js","sources":["../../../src/components/Button/Button.tsx"],"sourcesContent":[null],"names":["forwardRef","getButtonStyles","_jsx","ChakraButton","focusRing","polymorphic"],"mappings":";;;;;;;;;;AASA;;;;;;;;;;;;;;;;AAgBG;AACH,MAAM,UAAU,GAAGA,gBAAU,CAC3B,CAAC,EAAE,YAAY,EAAE,OAAO,GAAG,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,EAAE,GAAG,KAAI;AACnE,IAAA,MAAM,OAAO,GAAG,YAAY,IAAI,SAAS;IAEzC,MAAM,MAAM,GAAGC,6BAAe,CAAC,OAAO,EAAE,OAAO,CAAC;AAEhD;;;;;;;;;AASG;IACH,QACEC,cAAA,CAACC,YAAY,EAAA,EACX,MAAM,EAAC,WAAW,EAClB,UAAU,EAAC,KAAK,EAChB,UAAU,EAAC,UAAU,EACrB,IAAI,EAAE,IAAI,EACV,YAAY,EAAC,IAAI,EAAA,GACb,MAAM,EAAA,GACNC,mBAAS,EACb,MAAM,EAAC,SAAS,EAChB,kBAAkB,EAAC,KAAK,EACxB,kBAAkB,EAAC,OAAO,EAC1B,wBAAwB,EAAC,aAAa,EACtC,GAAG,EAAE,GAAG,EAAA,GACJ,IAAI,EAAA,QAAA,EAEP,QAAQ,EAAA,CACI;AAEnB,CAAC,CACF;AAED;;;;;;AAMG;AACH,UAAU,CAAC,WAAW,GAAG,QAAQ;MAEpB,MAAM,GAAGC,uBAAW,CAAiB,UAAU;;;;"}
@@ -3,6 +3,7 @@ import { jsx } from 'react/jsx-runtime';
3
3
  import { forwardRef } from 'react';
4
4
  import { Button as Button$1 } from '@chakra-ui/react';
5
5
  import { focusRing } from '../../utils/focusRing.mjs';
6
+ import { polymorphic } from '../../types/polymorphic.mjs';
6
7
  import { getButtonStyles } from './Button.styles.mjs';
7
8
 
8
9
  /**
@@ -17,9 +18,12 @@ import { getButtonStyles } from './Button.styles.mjs';
17
18
  * <Button colorPalette="danger" variant="solid">Delete</Button>
18
19
  * <Button colorPalette="secondary" variant="outline">Cancel</Button>
19
20
  * <Button colorPalette="neutral" variant="ghost">Close</Button>
21
+ *
22
+ * // `as` carries the element's own props (see Button.types.ts):
23
+ * <Button as="a" href="/docs" target="_blank">문서</Button>
20
24
  * ```
21
25
  */
22
- const Button = forwardRef(({ colorPalette, variant = 'soft', size, children, ...rest }, ref) => {
26
+ const ButtonImpl = forwardRef(({ colorPalette, variant = 'soft', size, children, ...rest }, ref) => {
23
27
  const palette = colorPalette ?? 'primary';
24
28
  const styles = getButtonStyles(palette, variant);
25
29
  /**
@@ -34,7 +38,15 @@ const Button = forwardRef(({ colorPalette, variant = 'soft', size, children, ...
34
38
  */
35
39
  return (jsx(Button$1, { border: "1px solid", lineHeight: "1.2", fontWeight: "semibold", size: size, borderRadius: "md", ...styles, ...focusRing, cursor: "pointer", transitionProperty: "all", transitionDuration: "0.25s", transitionTimingFunction: "ease-in-out", ref: ref, ...rest, children: children }));
36
40
  });
37
- Button.displayName = 'Button';
41
+ /**
42
+ * Type-level polymorphism over the same runtime — see `polymorphic` in
43
+ * `src/types/polymorphic.ts` for what the cast does and why it is needed.
44
+ *
45
+ * `as` defaults to `'button'`, so nothing that already compiles stops
46
+ * compiling.
47
+ */
48
+ ButtonImpl.displayName = 'Button';
49
+ const Button = polymorphic(ButtonImpl);
38
50
 
39
51
  export { Button };
40
52
  //# sourceMappingURL=Button.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Button.mjs","sources":["../../../src/components/Button/Button.tsx"],"sourcesContent":[null],"names":["_jsx","ChakraButton"],"mappings":";;;;;;;AAQA;;;;;;;;;;;;;AAaG;AACI,MAAM,MAAM,GAAG,UAAU,CAC9B,CAAC,EAAE,YAAY,EAAE,OAAO,GAAG,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,EAAE,GAAG,KAAI;AACnE,IAAA,MAAM,OAAO,GAAG,YAAY,IAAI,SAAS;IAEzC,MAAM,MAAM,GAAG,eAAe,CAAC,OAAO,EAAE,OAAO,CAAC;AAEhD;;;;;;;;;AASG;IACH,QACEA,GAAA,CAACC,QAAY,EAAA,EACX,MAAM,EAAC,WAAW,EAClB,UAAU,EAAC,KAAK,EAChB,UAAU,EAAC,UAAU,EACrB,IAAI,EAAE,IAAI,EACV,YAAY,EAAC,IAAI,EAAA,GACb,MAAM,EAAA,GACN,SAAS,EACb,MAAM,EAAC,SAAS,EAChB,kBAAkB,EAAC,KAAK,EACxB,kBAAkB,EAAC,OAAO,EAC1B,wBAAwB,EAAC,aAAa,EACtC,GAAG,EAAE,GAAG,EAAA,GACJ,IAAI,EAAA,QAAA,EAEP,QAAQ,EAAA,CACI;AAEnB,CAAC;AAGH,MAAM,CAAC,WAAW,GAAG,QAAQ;;;;"}
1
+ {"version":3,"file":"Button.mjs","sources":["../../../src/components/Button/Button.tsx"],"sourcesContent":[null],"names":["_jsx","ChakraButton"],"mappings":";;;;;;;;AASA;;;;;;;;;;;;;;;;AAgBG;AACH,MAAM,UAAU,GAAG,UAAU,CAC3B,CAAC,EAAE,YAAY,EAAE,OAAO,GAAG,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,EAAE,GAAG,KAAI;AACnE,IAAA,MAAM,OAAO,GAAG,YAAY,IAAI,SAAS;IAEzC,MAAM,MAAM,GAAG,eAAe,CAAC,OAAO,EAAE,OAAO,CAAC;AAEhD;;;;;;;;;AASG;IACH,QACEA,GAAA,CAACC,QAAY,EAAA,EACX,MAAM,EAAC,WAAW,EAClB,UAAU,EAAC,KAAK,EAChB,UAAU,EAAC,UAAU,EACrB,IAAI,EAAE,IAAI,EACV,YAAY,EAAC,IAAI,EAAA,GACb,MAAM,EAAA,GACN,SAAS,EACb,MAAM,EAAC,SAAS,EAChB,kBAAkB,EAAC,KAAK,EACxB,kBAAkB,EAAC,OAAO,EAC1B,wBAAwB,EAAC,aAAa,EACtC,GAAG,EAAE,GAAG,EAAA,GACJ,IAAI,EAAA,QAAA,EAEP,QAAQ,EAAA,CACI;AAEnB,CAAC,CACF;AAED;;;;;;AAMG;AACH,UAAU,CAAC,WAAW,GAAG,QAAQ;MAEpB,MAAM,GAAG,WAAW,CAAiB,UAAU;;;;"}
@@ -1,4 +1,6 @@
1
+ import type { ElementType } from 'react';
1
2
  import { ButtonProps as ChakraButtonProps } from '@chakra-ui/react';
3
+ import type { PolymorphicProps } from '../../types/polymorphic';
2
4
  /**
3
5
  * Button color palette - defines the semantic color family.
4
6
  *
@@ -42,7 +44,7 @@ export type ButtonVariant = 'solid' | 'soft' | 'outline' | 'ghost';
42
44
  * <Button colorPalette="secondary" variant="outline">Cancel</Button>
43
45
  * ```
44
46
  */
45
- export type ButtonProps = Omit<ChakraButtonProps, 'variant' | 'colorScheme' | 'colorPalette' | 'leftIcon' | 'rightIcon'> & {
47
+ export type ButtonOwnProps = Omit<ChakraButtonProps, 'variant' | 'colorScheme' | 'colorPalette' | 'leftIcon' | 'rightIcon' | 'as'> & {
46
48
  /**
47
49
  * The color palette of the button (semantic color family).
48
50
  * Overrides Chakra UI's colorPalette prop (Chakra v3).
@@ -56,4 +58,23 @@ export type ButtonProps = Omit<ChakraButtonProps, 'variant' | 'colorScheme' | 'c
56
58
  */
57
59
  variant?: ButtonVariant;
58
60
  };
61
+ /**
62
+ * Props for `Button`, typed for whatever element `as` renders.
63
+ *
64
+ * Defaults to `'button'`, so `ButtonProps` on its own means exactly what it
65
+ * meant before this became polymorphic — every existing call site and every
66
+ * `ComponentProps<typeof Button>` keeps its type.
67
+ *
68
+ * `as` now carries the element's own props with it:
69
+ *
70
+ * ```tsx
71
+ * <Button as="a" href="/docs" target="_blank" rel="noreferrer">문서</Button>
72
+ * <Button as={Link} href="/admin" prefetch={false}>관리자</Button>
73
+ * ```
74
+ *
75
+ * Before, `as` swapped the rendered element but not the type — `href` was not a
76
+ * `<button>` prop, so consumers reached for `@ts-expect-error`. See
77
+ * `src/types/polymorphic.ts` for why `asChild` does not cover this case.
78
+ */
79
+ export type ButtonProps<TElement extends ElementType = 'button'> = PolymorphicProps<TElement, ButtonOwnProps>;
59
80
  //# sourceMappingURL=Button.types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Button.types.d.ts","sourceRoot":"","sources":["../../../src/components/Button/Button.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,IAAI,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAEpE;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,kBAAkB,GAC1B,SAAS,GACT,WAAW,GACX,QAAQ,GACR,SAAS,GACT,SAAS,GACT,SAAS,CAAC;AAEd;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC;AAEnE;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,WAAW,GAAG,IAAI,CAC5B,iBAAiB,EACjB,SAAS,GAAG,aAAa,GAAG,cAAc,GAAG,UAAU,GAAG,WAAW,CACtE,GAAG;IACF;;;;OAIG;IACH,YAAY,CAAC,EAAE,kBAAkB,CAAC;IAClC;;;;OAIG;IACH,OAAO,CAAC,EAAE,aAAa,CAAC;CACzB,CAAC"}
1
+ {"version":3,"file":"Button.types.d.ts","sourceRoot":"","sources":["../../../src/components/Button/Button.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,EAAE,WAAW,IAAI,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAOpE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAEhE;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,kBAAkB,GAC1B,SAAS,GACT,WAAW,GACX,QAAQ,GACR,SAAS,GACT,SAAS,GACT,SAAS,CAAC;AAEd;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC;AAEnE;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,cAAc,GAAG,IAAI,CAC/B,iBAAiB,EACjB,SAAS,GAAG,aAAa,GAAG,cAAc,GAAG,UAAU,GAAG,WAAW,GAAG,IAAI,CAC7E,GAAG;IACF;;;;OAIG;IACH,YAAY,CAAC,EAAE,kBAAkB,CAAC;IAClC;;;;OAIG;IACH,OAAO,CAAC,EAAE,aAAa,CAAC;CACzB,CAAC;AAEF;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,MAAM,WAAW,CAAC,QAAQ,SAAS,WAAW,GAAG,QAAQ,IAC7D,gBAAgB,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAC"}
@@ -1,4 +1,4 @@
1
1
  export { Button } from './Button';
2
2
  export { buttonColorPalettes, buttonColorPaletteStyles, buttonVariants, getButtonStyles, } from './Button.styles';
3
- export type { ButtonColorPalette, ButtonProps, ButtonVariant, } from './Button.types';
3
+ export type { ButtonColorPalette, ButtonOwnProps, ButtonProps, ButtonVariant, } from './Button.types';
4
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Button/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EACL,mBAAmB,EACnB,wBAAwB,EACxB,cAAc,EACd,eAAe,GAChB,MAAM,iBAAiB,CAAC;AACzB,YAAY,EACV,kBAAkB,EAClB,WAAW,EACX,aAAa,GACd,MAAM,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Button/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EACL,mBAAmB,EACnB,wBAAwB,EACxB,cAAc,EACd,eAAe,GAChB,MAAM,iBAAiB,CAAC;AACzB,YAAY,EACV,kBAAkB,EAClB,cAAc,EACd,WAAW,EACX,aAAa,GACd,MAAM,gBAAgB,CAAC"}
@@ -1,6 +1,3 @@
1
- import { Card as ChakraCard } from '@chakra-ui/react';
2
- export declare const Card: import("react").ForwardRefExoticComponent<ChakraCard.RootProps & {
3
- clickable?: boolean;
4
- variant?: import("./Card.types").CardVariant;
5
- } & import("react").RefAttributes<HTMLDivElement>>;
1
+ import { CardOwnProps } from './Card.types';
2
+ export declare const Card: import("../..").PolymorphicComponent<CardOwnProps, "div">;
6
3
  //# sourceMappingURL=Card.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Card.d.ts","sourceRoot":"","sources":["../../../src/components/Card/Card.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,IAAI,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAKtD,eAAO,MAAM,IAAI;;;kDA+BhB,CAAC"}
1
+ {"version":3,"file":"Card.d.ts","sourceRoot":"","sources":["../../../src/components/Card/Card.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAsC5C,eAAO,MAAM,IAAI,2DAA6C,CAAC"}
@@ -4,9 +4,10 @@
4
4
  var jsxRuntime = require('react/jsx-runtime');
5
5
  var React = require('react');
6
6
  var react = require('@chakra-ui/react');
7
+ var polymorphic = require('../../types/polymorphic.js');
7
8
  var Card_styles = require('./Card.styles.js');
8
9
 
9
- const Card = React.forwardRef(({ clickable, variant = 'default', _hover, ...rest }, ref) => {
10
+ const CardImpl = React.forwardRef(({ clickable, variant = 'default', _hover, ...rest }, ref) => {
10
11
  const mergedHover = clickable
11
12
  ? { ...Card_styles.clickableStyles._hover, ..._hover }
12
13
  : _hover;
@@ -17,7 +18,9 @@ const Card = React.forwardRef(({ clickable, variant = 'default', _hover, ...rest
17
18
  // edge in both modes. The `gradient` variant keeps its primary.light border.
18
19
  borderColor: "border.default", borderRadius: "lg", transitionProperty: "common", transitionDuration: "normal", transitionTimingFunction: "ease", p: 8, ...(clickable ? { cursor: Card_styles.clickableStyles.cursor } : {}), ...Card_styles.variantStyles[variant], ...rest, _hover: mergedHover }));
19
20
  });
20
- Card.displayName = 'Card';
21
+ /** Type-level polymorphism over the same runtime — see the note on `Button`. */
22
+ CardImpl.displayName = 'Card';
23
+ const Card = polymorphic.polymorphic(CardImpl);
21
24
 
22
25
  exports.Card = Card;
23
26
  //# sourceMappingURL=Card.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Card.js","sources":["../../../src/components/Card/Card.tsx"],"sourcesContent":[null],"names":["forwardRef","clickableStyles","_jsx","ChakraCard","variantStyles"],"mappings":";;;;;;;;MAMa,IAAI,GAAGA,gBAAU,CAC5B,CAAC,EAAE,SAAS,EAAE,OAAO,GAAG,SAAS,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,EAAE,GAAG,KAAI;IAC3D,MAAM,WAAW,GAAG;UAChB,EAAE,GAAGC,2BAAe,CAAC,MAAM,EAAE,GAAG,MAAM;UACtC,MAAM;AAEV,IAAA,QACEC,cAAA,CAACC,UAAU,CAAC,IAAI,EAAA,EACd,GAAG,EAAE,GAAG,EACR,QAAQ,EAAC,UAAU,EACnB,EAAE,EAAC,YAAY,EACf,KAAK,EAAC,YAAY,EAClB,SAAS,EAAC,MAAM,EAChB,MAAM,EAAC,WAAW;;;;;QAKlB,WAAW,EAAC,gBAAgB,EAC5B,YAAY,EAAC,IAAI,EACjB,kBAAkB,EAAC,QAAQ,EAC3B,kBAAkB,EAAC,QAAQ,EAC3B,wBAAwB,EAAC,MAAM,EAC/B,CAAC,EAAE,CAAC,EAAA,IACC,SAAS,GAAG,EAAE,MAAM,EAAEF,2BAAe,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,KACrDG,yBAAa,CAAC,OAAO,CAAC,EAAA,GACtB,IAAI,EACR,MAAM,EAAE,WAAW,EAAA,CACnB;AAEN,CAAC;AAGH,IAAI,CAAC,WAAW,GAAG,MAAM;;;;"}
1
+ {"version":3,"file":"Card.js","sources":["../../../src/components/Card/Card.tsx"],"sourcesContent":[null],"names":["forwardRef","clickableStyles","_jsx","ChakraCard","variantStyles","polymorphic"],"mappings":";;;;;;;;;AAOA,MAAM,QAAQ,GAAGA,gBAAU,CACzB,CAAC,EAAE,SAAS,EAAE,OAAO,GAAG,SAAS,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,EAAE,GAAG,KAAI;IAC3D,MAAM,WAAW,GAAG;UAChB,EAAE,GAAGC,2BAAe,CAAC,MAAM,EAAE,GAAG,MAAM;UACtC,MAAM;AAEV,IAAA,QACEC,cAAA,CAACC,UAAU,CAAC,IAAI,EAAA,EACd,GAAG,EAAE,GAAG,EACR,QAAQ,EAAC,UAAU,EACnB,EAAE,EAAC,YAAY,EACf,KAAK,EAAC,YAAY,EAClB,SAAS,EAAC,MAAM,EAChB,MAAM,EAAC,WAAW;;;;;QAKlB,WAAW,EAAC,gBAAgB,EAC5B,YAAY,EAAC,IAAI,EACjB,kBAAkB,EAAC,QAAQ,EAC3B,kBAAkB,EAAC,QAAQ,EAC3B,wBAAwB,EAAC,MAAM,EAC/B,CAAC,EAAE,CAAC,EAAA,IACC,SAAS,GAAG,EAAE,MAAM,EAAEF,2BAAe,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,KACrDG,yBAAa,CAAC,OAAO,CAAC,EAAA,GACtB,IAAI,EACR,MAAM,EAAE,WAAW,EAAA,CACnB;AAEN,CAAC,CACF;AAED;AACA,QAAQ,CAAC,WAAW,GAAG,MAAM;MAEhB,IAAI,GAAGC,uBAAW,CAAsB,QAAQ;;;;"}
@@ -2,9 +2,10 @@
2
2
  import { jsx } from 'react/jsx-runtime';
3
3
  import { forwardRef } from 'react';
4
4
  import { Card as Card$1 } from '@chakra-ui/react';
5
+ import { polymorphic } from '../../types/polymorphic.mjs';
5
6
  import { clickableStyles, variantStyles } from './Card.styles.mjs';
6
7
 
7
- const Card = forwardRef(({ clickable, variant = 'default', _hover, ...rest }, ref) => {
8
+ const CardImpl = forwardRef(({ clickable, variant = 'default', _hover, ...rest }, ref) => {
8
9
  const mergedHover = clickable
9
10
  ? { ...clickableStyles._hover, ..._hover }
10
11
  : _hover;
@@ -15,7 +16,9 @@ const Card = forwardRef(({ clickable, variant = 'default', _hover, ...rest }, re
15
16
  // edge in both modes. The `gradient` variant keeps its primary.light border.
16
17
  borderColor: "border.default", borderRadius: "lg", transitionProperty: "common", transitionDuration: "normal", transitionTimingFunction: "ease", p: 8, ...(clickable ? { cursor: clickableStyles.cursor } : {}), ...variantStyles[variant], ...rest, _hover: mergedHover }));
17
18
  });
18
- Card.displayName = 'Card';
19
+ /** Type-level polymorphism over the same runtime — see the note on `Button`. */
20
+ CardImpl.displayName = 'Card';
21
+ const Card = polymorphic(CardImpl);
19
22
 
20
23
  export { Card };
21
24
  //# sourceMappingURL=Card.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Card.mjs","sources":["../../../src/components/Card/Card.tsx"],"sourcesContent":[null],"names":["_jsx","ChakraCard"],"mappings":";;;;;;MAMa,IAAI,GAAG,UAAU,CAC5B,CAAC,EAAE,SAAS,EAAE,OAAO,GAAG,SAAS,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,EAAE,GAAG,KAAI;IAC3D,MAAM,WAAW,GAAG;UAChB,EAAE,GAAG,eAAe,CAAC,MAAM,EAAE,GAAG,MAAM;UACtC,MAAM;AAEV,IAAA,QACEA,GAAA,CAACC,MAAU,CAAC,IAAI,EAAA,EACd,GAAG,EAAE,GAAG,EACR,QAAQ,EAAC,UAAU,EACnB,EAAE,EAAC,YAAY,EACf,KAAK,EAAC,YAAY,EAClB,SAAS,EAAC,MAAM,EAChB,MAAM,EAAC,WAAW;;;;;QAKlB,WAAW,EAAC,gBAAgB,EAC5B,YAAY,EAAC,IAAI,EACjB,kBAAkB,EAAC,QAAQ,EAC3B,kBAAkB,EAAC,QAAQ,EAC3B,wBAAwB,EAAC,MAAM,EAC/B,CAAC,EAAE,CAAC,EAAA,IACC,SAAS,GAAG,EAAE,MAAM,EAAE,eAAe,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,KACrD,aAAa,CAAC,OAAO,CAAC,EAAA,GACtB,IAAI,EACR,MAAM,EAAE,WAAW,EAAA,CACnB;AAEN,CAAC;AAGH,IAAI,CAAC,WAAW,GAAG,MAAM;;;;"}
1
+ {"version":3,"file":"Card.mjs","sources":["../../../src/components/Card/Card.tsx"],"sourcesContent":[null],"names":["_jsx","ChakraCard"],"mappings":";;;;;;;AAOA,MAAM,QAAQ,GAAG,UAAU,CACzB,CAAC,EAAE,SAAS,EAAE,OAAO,GAAG,SAAS,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,EAAE,GAAG,KAAI;IAC3D,MAAM,WAAW,GAAG;UAChB,EAAE,GAAG,eAAe,CAAC,MAAM,EAAE,GAAG,MAAM;UACtC,MAAM;AAEV,IAAA,QACEA,GAAA,CAACC,MAAU,CAAC,IAAI,EAAA,EACd,GAAG,EAAE,GAAG,EACR,QAAQ,EAAC,UAAU,EACnB,EAAE,EAAC,YAAY,EACf,KAAK,EAAC,YAAY,EAClB,SAAS,EAAC,MAAM,EAChB,MAAM,EAAC,WAAW;;;;;QAKlB,WAAW,EAAC,gBAAgB,EAC5B,YAAY,EAAC,IAAI,EACjB,kBAAkB,EAAC,QAAQ,EAC3B,kBAAkB,EAAC,QAAQ,EAC3B,wBAAwB,EAAC,MAAM,EAC/B,CAAC,EAAE,CAAC,EAAA,IACC,SAAS,GAAG,EAAE,MAAM,EAAE,eAAe,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,KACrD,aAAa,CAAC,OAAO,CAAC,EAAA,GACtB,IAAI,EACR,MAAM,EAAE,WAAW,EAAA,CACnB;AAEN,CAAC,CACF;AAED;AACA,QAAQ,CAAC,WAAW,GAAG,MAAM;MAEhB,IAAI,GAAG,WAAW,CAAsB,QAAQ;;;;"}
@@ -1,7 +1,21 @@
1
+ import type { ElementType } from 'react';
1
2
  import { CardRootProps as ChakraCardRootProps } from '@chakra-ui/react';
3
+ import type { PolymorphicProps } from '../../types/polymorphic';
2
4
  export type CardVariant = 'default' | 'gradient' | 'elevated';
3
- export type CardProps = ChakraCardRootProps & {
5
+ export type CardOwnProps = Omit<ChakraCardRootProps, 'as'> & {
4
6
  clickable?: boolean;
5
7
  variant?: CardVariant;
6
8
  };
9
+ /**
10
+ * Props for `Card`, typed for whatever element `as` renders.
11
+ *
12
+ * A `clickable` card is the case that needs this: the whole card is one target,
13
+ * so it should BE the link rather than contain one. Defaults to `'div'`, so
14
+ * bare `CardProps` is unchanged.
15
+ *
16
+ * ```tsx
17
+ * <Card clickable as={NextLink} href={`/courses/${id}`}>…</Card>
18
+ * ```
19
+ */
20
+ export type CardProps<TElement extends ElementType = 'div'> = PolymorphicProps<TElement, CardOwnProps>;
7
21
  //# sourceMappingURL=Card.types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Card.types.d.ts","sourceRoot":"","sources":["../../../src/components/Card/Card.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,IAAI,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAExE,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,UAAU,GAAG,UAAU,CAAC;AAE9D,MAAM,MAAM,SAAS,GAAG,mBAAmB,GAAG;IAC5C,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,OAAO,CAAC,EAAE,WAAW,CAAC;CACvB,CAAC"}
1
+ {"version":3,"file":"Card.types.d.ts","sourceRoot":"","sources":["../../../src/components/Card/Card.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,EAAE,aAAa,IAAI,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAGxE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAEhE,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,UAAU,GAAG,UAAU,CAAC;AAE9D,MAAM,MAAM,YAAY,GAAG,IAAI,CAAC,mBAAmB,EAAE,IAAI,CAAC,GAAG;IAC3D,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,OAAO,CAAC,EAAE,WAAW,CAAC;CACvB,CAAC;AAEF;;;;;;;;;;GAUG;AACH,MAAM,MAAM,SAAS,CAAC,QAAQ,SAAS,WAAW,GAAG,KAAK,IAAI,gBAAgB,CAC5E,QAAQ,EACR,YAAY,CACb,CAAC"}
@@ -1,3 +1,3 @@
1
1
  export { Card } from './Card';
2
- export type { CardProps } from './Card.types';
2
+ export type { CardOwnProps, CardProps, CardVariant } from './Card.types';
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Card/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,YAAY,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Card/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,YAAY,EAAE,YAAY,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC"}
@@ -1,17 +1,4 @@
1
- import { ChipProps } from './Chip.types';
2
- /**
3
- * A chip component for displaying tags, labels, or status indicators.
4
- *
5
- * Uses a two-dimensional variant system:
6
- * - `colorScheme`: What semantic color (primary, secondary, danger, etc.)
7
- * - `variant`: How it looks visually (solid, soft, outline)
8
- *
9
- * @example
10
- * ```tsx
11
- * <Chip colorScheme="primary" variant="solid">Active</Chip>
12
- * <Chip colorScheme="danger" variant="soft">Error</Chip>
13
- * <Chip colorScheme="success" variant="outline">Completed</Chip>
14
- * ```
15
- */
16
- export declare const Chip: import("react").ForwardRefExoticComponent<ChipProps & import("react").RefAttributes<HTMLButtonElement>>;
1
+ import { ChipOwnProps } from './Chip.types';
2
+ /** Type-level polymorphism over the same runtime — see `polymorphic`. */
3
+ export declare const Chip: import("../..").PolymorphicComponent<ChipOwnProps, "span">;
17
4
  //# sourceMappingURL=Chip.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Chip.d.ts","sourceRoot":"","sources":["../../../src/components/Chip/Chip.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,IAAI,yGAiBhB,CAAC"}
1
+ {"version":3,"file":"Chip.d.ts","sourceRoot":"","sources":["../../../src/components/Chip/Chip.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAqC5C,yEAAyE;AACzE,eAAO,MAAM,IAAI,4DAA8C,CAAC"}
@@ -5,6 +5,7 @@ var jsxRuntime = require('react/jsx-runtime');
5
5
  var React = require('react');
6
6
  var react = require('@chakra-ui/react');
7
7
  var focusRing = require('../../utils/focusRing.js');
8
+ var polymorphic = require('../../types/polymorphic.js');
8
9
  var Chip_styles = require('./Chip.styles.js');
9
10
 
10
11
  /**
@@ -21,11 +22,13 @@ var Chip_styles = require('./Chip.styles.js');
21
22
  * <Chip colorScheme="success" variant="outline">Completed</Chip>
22
23
  * ```
23
24
  */
24
- const Chip = React.forwardRef(({ colorScheme = 'primary', variant = 'soft', ...rest }, ref) => {
25
+ const ChipImpl = React.forwardRef(({ colorScheme = 'primary', variant = 'soft', ...rest }, ref) => {
25
26
  const styles = Chip_styles.getChipStyles(colorScheme, variant);
26
27
  return (jsxRuntime.jsx(react.Badge, { ...Chip_styles.baseStyles, ...styles, ...focusRing.focusRing, ...rest, ref: ref }));
27
28
  });
28
- Chip.displayName = 'Chip';
29
+ ChipImpl.displayName = 'Chip';
30
+ /** Type-level polymorphism over the same runtime — see `polymorphic`. */
31
+ const Chip = polymorphic.polymorphic(ChipImpl);
29
32
 
30
33
  exports.Chip = Chip;
31
34
  //# sourceMappingURL=Chip.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Chip.js","sources":["../../../src/components/Chip/Chip.tsx"],"sourcesContent":[null],"names":["forwardRef","getChipStyles","_jsx","ChakraBadge","baseStyles","focusRing"],"mappings":";;;;;;;;;AAQA;;;;;;;;;;;;;AAaG;MACU,IAAI,GAAGA,gBAAU,CAC5B,CACE,EAAE,WAAW,GAAG,SAAS,EAAE,OAAO,GAAG,MAAM,EAAE,GAAG,IAAI,EAAa,EACjE,GAAqC,KACnC;IACF,MAAM,MAAM,GAAGC,yBAAa,CAAC,WAAW,EAAE,OAAO,CAAC;AAElD,IAAA,QACEC,cAAA,CAACC,WAAW,EAAA,EAAA,GACNC,sBAAU,KACV,MAAM,EAAA,GACNC,mBAAS,EAAA,GACT,IAAI,EACR,GAAG,EAAE,GAAG,EAAA,CACR;AAEN,CAAC;AAGH,IAAI,CAAC,WAAW,GAAG,MAAM;;;;"}
1
+ {"version":3,"file":"Chip.js","sources":["../../../src/components/Chip/Chip.tsx"],"sourcesContent":[null],"names":["forwardRef","getChipStyles","_jsx","ChakraBadge","baseStyles","focusRing","polymorphic"],"mappings":";;;;;;;;;;AASA;;;;;;;;;;;;;AAaG;AACH,MAAM,QAAQ,GAAGA,gBAAU,CACzB,CACE,EAAE,WAAW,GAAG,SAAS,EAAE,OAAO,GAAG,MAAM,EAAE,GAAG,IAAI,EAAgB,EACpE,GAAqC,KACnC;IACF,MAAM,MAAM,GAAGC,yBAAa,CAAC,WAAW,EAAE,OAAO,CAAC;AAElD,IAAA,QACEC,cAAA,CAACC,WAAW,EAAA,EAAA,GACNC,sBAAU,KACV,MAAM,EAAA,GACNC,mBAAS,EAAA,GACT,IAAI,EACR,GAAG,EAAE,GAAG,EAAA,CACR;AAEN,CAAC,CACF;AAED,QAAQ,CAAC,WAAW,GAAG,MAAM;AAE7B;MACa,IAAI,GAAGC,uBAAW,CAAuB,QAAQ;;;;"}
@@ -3,6 +3,7 @@ import { jsx } from 'react/jsx-runtime';
3
3
  import { forwardRef } from 'react';
4
4
  import { Badge } from '@chakra-ui/react';
5
5
  import { focusRing } from '../../utils/focusRing.mjs';
6
+ import { polymorphic } from '../../types/polymorphic.mjs';
6
7
  import { getChipStyles, baseStyles } from './Chip.styles.mjs';
7
8
 
8
9
  /**
@@ -19,11 +20,13 @@ import { getChipStyles, baseStyles } from './Chip.styles.mjs';
19
20
  * <Chip colorScheme="success" variant="outline">Completed</Chip>
20
21
  * ```
21
22
  */
22
- const Chip = forwardRef(({ colorScheme = 'primary', variant = 'soft', ...rest }, ref) => {
23
+ const ChipImpl = forwardRef(({ colorScheme = 'primary', variant = 'soft', ...rest }, ref) => {
23
24
  const styles = getChipStyles(colorScheme, variant);
24
25
  return (jsx(Badge, { ...baseStyles, ...styles, ...focusRing, ...rest, ref: ref }));
25
26
  });
26
- Chip.displayName = 'Chip';
27
+ ChipImpl.displayName = 'Chip';
28
+ /** Type-level polymorphism over the same runtime — see `polymorphic`. */
29
+ const Chip = polymorphic(ChipImpl);
27
30
 
28
31
  export { Chip };
29
32
  //# sourceMappingURL=Chip.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Chip.mjs","sources":["../../../src/components/Chip/Chip.tsx"],"sourcesContent":[null],"names":["_jsx","ChakraBadge"],"mappings":";;;;;;;AAQA;;;;;;;;;;;;;AAaG;MACU,IAAI,GAAG,UAAU,CAC5B,CACE,EAAE,WAAW,GAAG,SAAS,EAAE,OAAO,GAAG,MAAM,EAAE,GAAG,IAAI,EAAa,EACjE,GAAqC,KACnC;IACF,MAAM,MAAM,GAAG,aAAa,CAAC,WAAW,EAAE,OAAO,CAAC;AAElD,IAAA,QACEA,GAAA,CAACC,KAAW,EAAA,EAAA,GACN,UAAU,KACV,MAAM,EAAA,GACN,SAAS,EAAA,GACT,IAAI,EACR,GAAG,EAAE,GAAG,EAAA,CACR;AAEN,CAAC;AAGH,IAAI,CAAC,WAAW,GAAG,MAAM;;;;"}
1
+ {"version":3,"file":"Chip.mjs","sources":["../../../src/components/Chip/Chip.tsx"],"sourcesContent":[null],"names":["_jsx","ChakraBadge"],"mappings":";;;;;;;;AASA;;;;;;;;;;;;;AAaG;AACH,MAAM,QAAQ,GAAG,UAAU,CACzB,CACE,EAAE,WAAW,GAAG,SAAS,EAAE,OAAO,GAAG,MAAM,EAAE,GAAG,IAAI,EAAgB,EACpE,GAAqC,KACnC;IACF,MAAM,MAAM,GAAG,aAAa,CAAC,WAAW,EAAE,OAAO,CAAC;AAElD,IAAA,QACEA,GAAA,CAACC,KAAW,EAAA,EAAA,GACN,UAAU,KACV,MAAM,EAAA,GACN,SAAS,EAAA,GACT,IAAI,EACR,GAAG,EAAE,GAAG,EAAA,CACR;AAEN,CAAC,CACF;AAED,QAAQ,CAAC,WAAW,GAAG,MAAM;AAE7B;MACa,IAAI,GAAG,WAAW,CAAuB,QAAQ;;;;"}
@@ -1,4 +1,6 @@
1
+ import type { ElementType } from 'react';
1
2
  import { BadgeProps as ChakraBadgeProps } from '@chakra-ui/react';
3
+ import type { PolymorphicProps } from '../../types/polymorphic';
2
4
  /**
3
5
  * Chip color schemes - determines the semantic color of the chip.
4
6
  *
@@ -25,8 +27,15 @@ export type ChipVariant = 'solid' | 'soft' | 'outline';
25
27
  *
26
28
  * This matches the Button component's architecture for consistency.
27
29
  */
28
- export interface ChipProps extends Omit<ChakraBadgeProps, 'colorScheme' | 'variant'> {
30
+ export type ChipOwnProps = Omit<ChakraBadgeProps, 'colorScheme' | 'variant' | 'as'> & {
29
31
  colorScheme?: ChipColorScheme;
30
32
  variant?: ChipVariant;
31
- }
33
+ };
34
+ /**
35
+ * Props for `Chip`, typed for whatever element `as` renders. Defaults to
36
+ * `'span'`, so the bare type is unchanged. A filter chip that navigates is the
37
+ * case that needs this — as a real link it keeps middle-click and
38
+ * open-in-new-tab.
39
+ */
40
+ export type ChipProps<TElement extends ElementType = 'span'> = PolymorphicProps<TElement, ChipOwnProps>;
32
41
  //# sourceMappingURL=Chip.types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Chip.types.d.ts","sourceRoot":"","sources":["../../../src/components/Chip/Chip.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,IAAI,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAElE;;;;;;;;;GASG;AACH,MAAM,MAAM,eAAe,GACvB,SAAS,GACT,WAAW,GACX,QAAQ,GACR,SAAS,GACT,SAAS,GACT,SAAS,CAAC;AAEd;;;;;;GAMG;AACH,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,CAAC;AAEvD;;;;;;GAMG;AACH,MAAM,WAAW,SAAU,SAAQ,IAAI,CACrC,gBAAgB,EAChB,aAAa,GAAG,SAAS,CAC1B;IACC,WAAW,CAAC,EAAE,eAAe,CAAC;IAC9B,OAAO,CAAC,EAAE,WAAW,CAAC;CACvB"}
1
+ {"version":3,"file":"Chip.types.d.ts","sourceRoot":"","sources":["../../../src/components/Chip/Chip.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,EAAE,UAAU,IAAI,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAGlE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAEhE;;;;;;;;;GASG;AACH,MAAM,MAAM,eAAe,GACvB,SAAS,GACT,WAAW,GACX,QAAQ,GACR,SAAS,GACT,SAAS,GACT,SAAS,CAAC;AAEd;;;;;;GAMG;AACH,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,CAAC;AAEvD;;;;;;GAMG;AACH,MAAM,MAAM,YAAY,GAAG,IAAI,CAC7B,gBAAgB,EAChB,aAAa,GAAG,SAAS,GAAG,IAAI,CACjC,GAAG;IACF,WAAW,CAAC,EAAE,eAAe,CAAC;IAC9B,OAAO,CAAC,EAAE,WAAW,CAAC;CACvB,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,SAAS,CAAC,QAAQ,SAAS,WAAW,GAAG,MAAM,IAAI,gBAAgB,CAC7E,QAAQ,EACR,YAAY,CACb,CAAC"}
@@ -1,4 +1,4 @@
1
1
  export { Chip } from './Chip';
2
2
  export { colorSchemes, colorSchemeStyles, getChipStyles, variants, } from './Chip.styles';
3
- export type { ChipColorScheme, ChipProps, ChipVariant } from './Chip.types';
3
+ export type { ChipColorScheme, ChipOwnProps, ChipProps, ChipVariant, } from './Chip.types';
4
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Chip/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EACL,YAAY,EACZ,iBAAiB,EACjB,aAAa,EACb,QAAQ,GACT,MAAM,eAAe,CAAC;AACvB,YAAY,EAAE,eAAe,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Chip/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EACL,YAAY,EACZ,iBAAiB,EACjB,aAAa,EACb,QAAQ,GACT,MAAM,eAAe,CAAC;AACvB,YAAY,EACV,eAAe,EACf,YAAY,EACZ,SAAS,EACT,WAAW,GACZ,MAAM,cAAc,CAAC"}
@@ -1,5 +1,4 @@
1
- import { ContainerProps } from '@chakra-ui/react';
2
- export declare const Container: ({ style, disableResponsive, ...rest }: ContainerProps & {
3
- disableResponsive?: boolean;
4
- }) => import("react/jsx-runtime").JSX.Element;
1
+ import { ContainerOwnProps } from './Container.types';
2
+ /** Type-level polymorphism over the same runtime see `polymorphic`. */
3
+ export declare const Container: import("../..").PolymorphicComponent<ContainerOwnProps, "div">;
5
4
  //# sourceMappingURL=Container.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Container.d.ts","sourceRoot":"","sources":["../../../src/components/Container/Container.tsx"],"names":[],"mappings":"AACA,OAAO,EAAgC,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAIhF,eAAO,MAAM,SAAS,GAAI,uCAIvB,cAAc,GAAG;IAAE,iBAAiB,CAAC,EAAE,OAAO,CAAA;CAAE,4CAWlD,CAAC"}
1
+ {"version":3,"file":"Container.d.ts","sourceRoot":"","sources":["../../../src/components/Container/Container.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAsBtD,yEAAyE;AACzE,eAAO,MAAM,SAAS,gEAAuD,CAAC"}