@cdx-ui/components 0.0.1-beta.64 → 0.0.1-beta.66

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 (263) hide show
  1. package/lib/commonjs/components/AlertDialog/index.js +12 -10
  2. package/lib/commonjs/components/AlertDialog/index.js.map +1 -1
  3. package/lib/commonjs/components/Avatar/index.js +125 -25
  4. package/lib/commonjs/components/Avatar/index.js.map +1 -1
  5. package/lib/commonjs/components/Button/index.js +127 -28
  6. package/lib/commonjs/components/Button/index.js.map +1 -1
  7. package/lib/commonjs/components/Button/styles.js +9 -3
  8. package/lib/commonjs/components/Button/styles.js.map +1 -1
  9. package/lib/commonjs/components/CLAUDE.md +115 -11
  10. package/lib/commonjs/components/Checkbox/index.js +69 -22
  11. package/lib/commonjs/components/Checkbox/index.js.map +1 -1
  12. package/lib/commonjs/components/Checkbox/styles.js +1 -1
  13. package/lib/commonjs/components/Checkbox/styles.js.map +1 -1
  14. package/lib/commonjs/components/Chip/index.js +44 -36
  15. package/lib/commonjs/components/Chip/index.js.map +1 -1
  16. package/lib/commonjs/components/Chip/styles.js +6 -35
  17. package/lib/commonjs/components/Chip/styles.js.map +1 -1
  18. package/lib/commonjs/components/Dialog/index.js +92 -72
  19. package/lib/commonjs/components/Dialog/index.js.map +1 -1
  20. package/lib/commonjs/components/Field/index.js +70 -26
  21. package/lib/commonjs/components/Field/index.js.map +1 -1
  22. package/lib/commonjs/components/Form/index.js +5 -12
  23. package/lib/commonjs/components/Form/index.js.map +1 -1
  24. package/lib/commonjs/components/IconButton/index.js +5 -33
  25. package/lib/commonjs/components/IconButton/index.js.map +1 -1
  26. package/lib/commonjs/components/Input/index.js +50 -20
  27. package/lib/commonjs/components/Input/index.js.map +1 -1
  28. package/lib/commonjs/components/Link/index.js +14 -7
  29. package/lib/commonjs/components/Link/index.js.map +1 -1
  30. package/lib/commonjs/components/ListItem/index.js +129 -54
  31. package/lib/commonjs/components/ListItem/index.js.map +1 -1
  32. package/lib/commonjs/components/OtpInput/index.js +94 -28
  33. package/lib/commonjs/components/OtpInput/index.js.map +1 -1
  34. package/lib/commonjs/components/ProgressBar/index.js +8 -13
  35. package/lib/commonjs/components/ProgressBar/index.js.map +1 -1
  36. package/lib/commonjs/components/Radio/index.js +51 -53
  37. package/lib/commonjs/components/Radio/index.js.map +1 -1
  38. package/lib/commonjs/components/Select/index.js +112 -46
  39. package/lib/commonjs/components/Select/index.js.map +1 -1
  40. package/lib/commonjs/components/Select/styles.js +2 -2
  41. package/lib/commonjs/components/Select/styles.js.map +1 -1
  42. package/lib/commonjs/components/Skeleton/index.js +37 -0
  43. package/lib/commonjs/components/Skeleton/index.js.map +1 -0
  44. package/lib/commonjs/components/Skeleton/styles.js +9 -0
  45. package/lib/commonjs/components/Skeleton/styles.js.map +1 -0
  46. package/lib/commonjs/components/Switch/BaseSwitch.js +23 -13
  47. package/lib/commonjs/components/Switch/BaseSwitch.js.map +1 -1
  48. package/lib/commonjs/components/Switch/BaseSwitch.web.js +25 -21
  49. package/lib/commonjs/components/Switch/BaseSwitch.web.js.map +1 -1
  50. package/lib/commonjs/components/Switch/index.js +34 -3
  51. package/lib/commonjs/components/Switch/index.js.map +1 -1
  52. package/lib/commonjs/components/Tile/index.js +150 -77
  53. package/lib/commonjs/components/Tile/index.js.map +1 -1
  54. package/lib/commonjs/components/index.js +12 -0
  55. package/lib/commonjs/components/index.js.map +1 -1
  56. package/lib/commonjs/figma/Chip.figma.js +2 -2
  57. package/lib/commonjs/figma/Chip.figma.js.map +1 -1
  58. package/lib/commonjs/utils/positionToDataIcon.js +41 -0
  59. package/lib/commonjs/utils/positionToDataIcon.js.map +1 -0
  60. package/lib/module/components/AlertDialog/index.js +13 -11
  61. package/lib/module/components/AlertDialog/index.js.map +1 -1
  62. package/lib/module/components/Avatar/index.js +128 -28
  63. package/lib/module/components/Avatar/index.js.map +1 -1
  64. package/lib/module/components/Button/index.js +130 -32
  65. package/lib/module/components/Button/index.js.map +1 -1
  66. package/lib/module/components/Button/styles.js +8 -2
  67. package/lib/module/components/Button/styles.js.map +1 -1
  68. package/lib/module/components/CLAUDE.md +115 -11
  69. package/lib/module/components/Checkbox/index.js +72 -25
  70. package/lib/module/components/Checkbox/index.js.map +1 -1
  71. package/lib/module/components/Checkbox/styles.js +1 -1
  72. package/lib/module/components/Checkbox/styles.js.map +1 -1
  73. package/lib/module/components/Chip/index.js +47 -39
  74. package/lib/module/components/Chip/index.js.map +1 -1
  75. package/lib/module/components/Chip/styles.js +6 -35
  76. package/lib/module/components/Chip/styles.js.map +1 -1
  77. package/lib/module/components/Dialog/index.js +96 -76
  78. package/lib/module/components/Dialog/index.js.map +1 -1
  79. package/lib/module/components/Field/index.js +74 -31
  80. package/lib/module/components/Field/index.js.map +1 -1
  81. package/lib/module/components/Form/index.js +7 -14
  82. package/lib/module/components/Form/index.js.map +1 -1
  83. package/lib/module/components/IconButton/index.js +6 -34
  84. package/lib/module/components/IconButton/index.js.map +1 -1
  85. package/lib/module/components/Input/index.js +53 -23
  86. package/lib/module/components/Input/index.js.map +1 -1
  87. package/lib/module/components/Link/index.js +16 -8
  88. package/lib/module/components/Link/index.js.map +1 -1
  89. package/lib/module/components/ListItem/index.js +134 -59
  90. package/lib/module/components/ListItem/index.js.map +1 -1
  91. package/lib/module/components/OtpInput/index.js +94 -28
  92. package/lib/module/components/OtpInput/index.js.map +1 -1
  93. package/lib/module/components/ProgressBar/index.js +9 -14
  94. package/lib/module/components/ProgressBar/index.js.map +1 -1
  95. package/lib/module/components/Radio/index.js +54 -57
  96. package/lib/module/components/Radio/index.js.map +1 -1
  97. package/lib/module/components/Select/index.js +118 -52
  98. package/lib/module/components/Select/index.js.map +1 -1
  99. package/lib/module/components/Select/styles.js +2 -2
  100. package/lib/module/components/Select/styles.js.map +1 -1
  101. package/lib/module/components/Skeleton/index.js +32 -0
  102. package/lib/module/components/Skeleton/index.js.map +1 -0
  103. package/lib/module/components/Skeleton/styles.js +5 -0
  104. package/lib/module/components/Skeleton/styles.js.map +1 -0
  105. package/lib/module/components/Switch/BaseSwitch.js +24 -14
  106. package/lib/module/components/Switch/BaseSwitch.js.map +1 -1
  107. package/lib/module/components/Switch/BaseSwitch.web.js +26 -22
  108. package/lib/module/components/Switch/BaseSwitch.web.js.map +1 -1
  109. package/lib/module/components/Switch/index.js +35 -4
  110. package/lib/module/components/Switch/index.js.map +1 -1
  111. package/lib/module/components/Tile/index.js +155 -83
  112. package/lib/module/components/Tile/index.js.map +1 -1
  113. package/lib/module/components/index.js +1 -0
  114. package/lib/module/components/index.js.map +1 -1
  115. package/lib/module/figma/Chip.figma.js +2 -2
  116. package/lib/module/figma/Chip.figma.js.map +1 -1
  117. package/lib/module/utils/positionToDataIcon.js +38 -0
  118. package/lib/module/utils/positionToDataIcon.js.map +1 -0
  119. package/lib/typescript/components/AlertDialog/index.d.ts.map +1 -1
  120. package/lib/typescript/components/Avatar/index.d.ts +6 -2
  121. package/lib/typescript/components/Avatar/index.d.ts.map +1 -1
  122. package/lib/typescript/components/Button/index.d.ts +31 -8
  123. package/lib/typescript/components/Button/index.d.ts.map +1 -1
  124. package/lib/typescript/components/Button/styles.d.ts +2 -1
  125. package/lib/typescript/components/Button/styles.d.ts.map +1 -1
  126. package/lib/typescript/components/Checkbox/index.d.ts +3 -1
  127. package/lib/typescript/components/Checkbox/index.d.ts.map +1 -1
  128. package/lib/typescript/components/Chip/index.d.ts +19 -9
  129. package/lib/typescript/components/Chip/index.d.ts.map +1 -1
  130. package/lib/typescript/components/Chip/styles.d.ts +0 -1
  131. package/lib/typescript/components/Chip/styles.d.ts.map +1 -1
  132. package/lib/typescript/components/Dialog/index.d.ts +12 -6
  133. package/lib/typescript/components/Dialog/index.d.ts.map +1 -1
  134. package/lib/typescript/components/Dialog/styles.d.ts +1 -1
  135. package/lib/typescript/components/Field/index.d.ts +14 -7
  136. package/lib/typescript/components/Field/index.d.ts.map +1 -1
  137. package/lib/typescript/components/Form/index.d.ts +4 -4
  138. package/lib/typescript/components/Form/index.d.ts.map +1 -1
  139. package/lib/typescript/components/IconButton/index.d.ts.map +1 -1
  140. package/lib/typescript/components/Input/index.d.ts +11 -3
  141. package/lib/typescript/components/Input/index.d.ts.map +1 -1
  142. package/lib/typescript/components/Link/index.d.ts +2 -0
  143. package/lib/typescript/components/Link/index.d.ts.map +1 -1
  144. package/lib/typescript/components/ListItem/index.d.ts +28 -6
  145. package/lib/typescript/components/ListItem/index.d.ts.map +1 -1
  146. package/lib/typescript/components/OtpInput/index.d.ts +1 -1
  147. package/lib/typescript/components/OtpInput/index.d.ts.map +1 -1
  148. package/lib/typescript/components/ProgressBar/index.d.ts +4 -4
  149. package/lib/typescript/components/ProgressBar/index.d.ts.map +1 -1
  150. package/lib/typescript/components/Radio/index.d.ts +4 -0
  151. package/lib/typescript/components/Radio/index.d.ts.map +1 -1
  152. package/lib/typescript/components/Select/index.d.ts +35 -2
  153. package/lib/typescript/components/Select/index.d.ts.map +1 -1
  154. package/lib/typescript/components/Select/styles.d.ts.map +1 -1
  155. package/lib/typescript/components/Skeleton/index.d.ts +9 -0
  156. package/lib/typescript/components/Skeleton/index.d.ts.map +1 -0
  157. package/lib/typescript/components/Skeleton/styles.d.ts +4 -0
  158. package/lib/typescript/components/Skeleton/styles.d.ts.map +1 -0
  159. package/lib/typescript/components/Switch/BaseSwitch.d.ts +12 -5
  160. package/lib/typescript/components/Switch/BaseSwitch.d.ts.map +1 -1
  161. package/lib/typescript/components/Switch/BaseSwitch.web.d.ts +11 -5
  162. package/lib/typescript/components/Switch/BaseSwitch.web.d.ts.map +1 -1
  163. package/lib/typescript/components/Switch/index.d.ts +5 -1
  164. package/lib/typescript/components/Switch/index.d.ts.map +1 -1
  165. package/lib/typescript/components/Tile/index.d.ts +8 -2
  166. package/lib/typescript/components/Tile/index.d.ts.map +1 -1
  167. package/lib/typescript/components/index.d.ts +1 -0
  168. package/lib/typescript/components/index.d.ts.map +1 -1
  169. package/lib/typescript/utils/positionToDataIcon.d.ts +29 -0
  170. package/lib/typescript/utils/positionToDataIcon.d.ts.map +1 -0
  171. package/package.json +5 -5
  172. package/src/components/AlertDialog/index.tsx +13 -14
  173. package/src/components/Avatar/index.tsx +134 -44
  174. package/src/components/Button/index.tsx +216 -44
  175. package/src/components/Button/styles.ts +50 -38
  176. package/src/components/CLAUDE.md +115 -11
  177. package/src/components/Checkbox/index.tsx +93 -32
  178. package/src/components/Checkbox/styles.ts +1 -1
  179. package/src/components/Chip/index.tsx +88 -61
  180. package/src/components/Chip/styles.ts +6 -18
  181. package/src/components/Dialog/index.tsx +139 -99
  182. package/src/components/Field/index.tsx +113 -49
  183. package/src/components/Form/index.tsx +18 -14
  184. package/src/components/IconButton/index.tsx +7 -31
  185. package/src/components/Input/index.tsx +75 -32
  186. package/src/components/Link/index.tsx +38 -12
  187. package/src/components/ListItem/index.tsx +158 -73
  188. package/src/components/OtpInput/index.tsx +126 -43
  189. package/src/components/ProgressBar/index.tsx +11 -16
  190. package/src/components/Radio/index.tsx +76 -54
  191. package/src/components/Select/index.tsx +174 -59
  192. package/src/components/Select/styles.ts +1 -2
  193. package/src/components/Skeleton/index.tsx +42 -0
  194. package/src/components/Skeleton/styles.ts +5 -0
  195. package/src/components/Switch/BaseSwitch.tsx +38 -16
  196. package/src/components/Switch/BaseSwitch.web.tsx +28 -35
  197. package/src/components/Switch/index.tsx +51 -4
  198. package/src/components/Tile/index.tsx +145 -94
  199. package/src/components/index.ts +1 -0
  200. package/src/utils/positionToDataIcon.ts +34 -0
  201. package/lib/commonjs/components/Field/FieldLabel.js +0 -33
  202. package/lib/commonjs/components/Field/FieldLabel.js.map +0 -1
  203. package/lib/commonjs/components/Field/FieldLabel.web.js +0 -22
  204. package/lib/commonjs/components/Field/FieldLabel.web.js.map +0 -1
  205. package/lib/commonjs/components/Form/FormRoot.js +0 -25
  206. package/lib/commonjs/components/Form/FormRoot.js.map +0 -1
  207. package/lib/commonjs/components/Form/FormRoot.web.js +0 -17
  208. package/lib/commonjs/components/Form/FormRoot.web.js.map +0 -1
  209. package/lib/commonjs/components/Input/BaseInput.android.js +0 -20
  210. package/lib/commonjs/components/Input/BaseInput.android.js.map +0 -1
  211. package/lib/commonjs/components/Input/BaseInput.js +0 -13
  212. package/lib/commonjs/components/Input/BaseInput.js.map +0 -1
  213. package/lib/commonjs/components/Input/BaseInput.web.js +0 -50
  214. package/lib/commonjs/components/Input/BaseInput.web.js.map +0 -1
  215. package/lib/commonjs/components/Select/SelectTriggerHost.js +0 -10
  216. package/lib/commonjs/components/Select/SelectTriggerHost.js.map +0 -1
  217. package/lib/commonjs/components/Select/SelectTriggerHost.web.js +0 -102
  218. package/lib/commonjs/components/Select/SelectTriggerHost.web.js.map +0 -1
  219. package/lib/module/components/Field/FieldLabel.js +0 -29
  220. package/lib/module/components/Field/FieldLabel.js.map +0 -1
  221. package/lib/module/components/Field/FieldLabel.web.js +0 -17
  222. package/lib/module/components/Field/FieldLabel.web.js.map +0 -1
  223. package/lib/module/components/Form/FormRoot.js +0 -21
  224. package/lib/module/components/Form/FormRoot.js.map +0 -1
  225. package/lib/module/components/Form/FormRoot.web.js +0 -12
  226. package/lib/module/components/Form/FormRoot.web.js.map +0 -1
  227. package/lib/module/components/Input/BaseInput.android.js +0 -16
  228. package/lib/module/components/Input/BaseInput.android.js.map +0 -1
  229. package/lib/module/components/Input/BaseInput.js +0 -4
  230. package/lib/module/components/Input/BaseInput.js.map +0 -1
  231. package/lib/module/components/Input/BaseInput.web.js +0 -45
  232. package/lib/module/components/Input/BaseInput.web.js.map +0 -1
  233. package/lib/module/components/Select/SelectTriggerHost.js +0 -7
  234. package/lib/module/components/Select/SelectTriggerHost.js.map +0 -1
  235. package/lib/module/components/Select/SelectTriggerHost.web.js +0 -97
  236. package/lib/module/components/Select/SelectTriggerHost.web.js.map +0 -1
  237. package/lib/typescript/components/Field/FieldLabel.d.ts +0 -18
  238. package/lib/typescript/components/Field/FieldLabel.d.ts.map +0 -1
  239. package/lib/typescript/components/Field/FieldLabel.web.d.ts +0 -16
  240. package/lib/typescript/components/Field/FieldLabel.web.d.ts.map +0 -1
  241. package/lib/typescript/components/Form/FormRoot.d.ts +0 -14
  242. package/lib/typescript/components/Form/FormRoot.d.ts.map +0 -1
  243. package/lib/typescript/components/Form/FormRoot.web.d.ts +0 -10
  244. package/lib/typescript/components/Form/FormRoot.web.d.ts.map +0 -1
  245. package/lib/typescript/components/Input/BaseInput.android.d.ts +0 -3
  246. package/lib/typescript/components/Input/BaseInput.android.d.ts.map +0 -1
  247. package/lib/typescript/components/Input/BaseInput.d.ts +0 -2
  248. package/lib/typescript/components/Input/BaseInput.d.ts.map +0 -1
  249. package/lib/typescript/components/Input/BaseInput.web.d.ts +0 -3
  250. package/lib/typescript/components/Input/BaseInput.web.d.ts.map +0 -1
  251. package/lib/typescript/components/Select/SelectTriggerHost.d.ts +0 -3
  252. package/lib/typescript/components/Select/SelectTriggerHost.d.ts.map +0 -1
  253. package/lib/typescript/components/Select/SelectTriggerHost.web.d.ts +0 -16
  254. package/lib/typescript/components/Select/SelectTriggerHost.web.d.ts.map +0 -1
  255. package/src/components/Field/FieldLabel.tsx +0 -33
  256. package/src/components/Field/FieldLabel.web.tsx +0 -25
  257. package/src/components/Form/FormRoot.tsx +0 -20
  258. package/src/components/Form/FormRoot.web.tsx +0 -12
  259. package/src/components/Input/BaseInput.android.tsx +0 -13
  260. package/src/components/Input/BaseInput.tsx +0 -1
  261. package/src/components/Input/BaseInput.web.tsx +0 -41
  262. package/src/components/Select/SelectTriggerHost.tsx +0 -4
  263. package/src/components/Select/SelectTriggerHost.web.tsx +0 -143
@@ -1,24 +1,14 @@
1
1
  "use strict";
2
2
 
3
- import React, { forwardRef } from 'react';
4
- import { createForm } from '@cdx-ui/primitives';
3
+ import { forwardRef } from 'react';
4
+ import { FormRoot as FormRootPrimitive, dataAttributes, mergeDataAttributes } from '@cdx-ui/primitives';
5
5
  import { cn } from '@cdx-ui/utils';
6
- import { BaseFormRoot } from './FormRoot';
7
6
  import { formRootVariants } from './styles';
8
7
 
9
- // =============================================================================
10
- // PRIMITIVE
11
- // =============================================================================
12
- import { jsx as _jsx } from "react/jsx-runtime";
13
- const FormPrimitive = createForm({
14
- Root: BaseFormRoot
15
- });
16
- FormPrimitive.displayName = 'FormPrimitive';
17
-
18
8
  // =============================================================================
19
9
  // FORM ROOT (container — <form> on web, <View> on RN)
20
10
  // =============================================================================
21
-
11
+ import { jsx as _jsx } from "react/jsx-runtime";
22
12
  const FormRoot = /*#__PURE__*/forwardRef(({
23
13
  className,
24
14
  children,
@@ -26,11 +16,14 @@ const FormRoot = /*#__PURE__*/forwardRef(({
26
16
  ...props
27
17
  }, ref) => {
28
18
  const computedClassName = cn(formRootVariants(), className);
29
- return /*#__PURE__*/_jsx(FormPrimitive, {
19
+ return /*#__PURE__*/_jsx(FormRootPrimitive, {
30
20
  ref: ref,
31
21
  className: computedClassName,
32
22
  style: style,
33
23
  ...props,
24
+ ...mergeDataAttributes(props, dataAttributes({
25
+ slot: 'form'
26
+ })),
34
27
  children: children
35
28
  });
36
29
  });
@@ -1 +1 @@
1
- {"version":3,"names":["React","forwardRef","createForm","cn","BaseFormRoot","formRootVariants","jsx","_jsx","FormPrimitive","Root","displayName","FormRoot","className","children","style","props","ref","computedClassName","Form"],"sourceRoot":"../../../../src","sources":["components/Form/index.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,UAAU,QAAQ,OAAO;AAEzC,SAASC,UAAU,QAAQ,oBAAoB;AAC/C,SAASC,EAAE,QAAQ,eAAe;AAClC,SAASC,YAAY,QAAgC,YAAY;AACjE,SAASC,gBAAgB,QAAQ,UAAU;;AAE3C;AACA;AACA;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAEA,MAAMC,aAAa,GAAGN,UAAU,CAAC;EAAEO,IAAI,EAAEL;AAAa,CAAC,CAAC;AAExDI,aAAa,CAACE,WAAW,GAAG,eAAe;;AAE3C;AACA;AACA;;AAIA,MAAMC,QAAQ,gBAAGV,UAAU,CAAkB,CAAC;EAAEW,SAAS;EAAEC,QAAQ;EAAEC,KAAK;EAAE,GAAGC;AAAM,CAAC,EAAEC,GAAG,KAAK;EAC9F,MAAMC,iBAAiB,GAAGd,EAAE,CAACE,gBAAgB,CAAC,CAAC,EAAEO,SAAS,CAAC;EAE3D,oBACEL,IAAA,CAACC,aAAa;IAACQ,GAAG,EAAEA,GAAI;IAACJ,SAAS,EAAEK,iBAAkB;IAACH,KAAK,EAAEA,KAAM;IAAA,GAAKC,KAAK;IAAAF,QAAA,EAC3EA;EAAQ,CACI,CAAC;AAEpB,CAAC,CAAC;AAEFF,QAAQ,CAACD,WAAW,GAAG,MAAM;;AAE7B;AACA;AACA;;AAEA,OAAO,MAAMQ,IAAI,GAAGP,QAAQ","ignoreList":[]}
1
+ {"version":3,"names":["forwardRef","FormRoot","FormRootPrimitive","dataAttributes","mergeDataAttributes","cn","formRootVariants","jsx","_jsx","className","children","style","props","ref","computedClassName","slot","displayName","Form"],"sourceRoot":"../../../../src","sources":["components/Form/index.tsx"],"mappings":";;AAAA,SAASA,UAAU,QAAQ,OAAO;AAElC,SACEC,QAAQ,IAAIC,iBAAiB,EAC7BC,cAAc,EACdC,mBAAmB,QAEd,oBAAoB;AAC3B,SAASC,EAAE,QAAQ,eAAe;AAClC,SAASC,gBAAgB,QAAQ,UAAU;;AAE3C;AACA;AACA;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAMA,MAAMP,QAAQ,gBAAGD,UAAU,CAAkB,CAAC;EAAES,SAAS;EAAEC,QAAQ;EAAEC,KAAK;EAAE,GAAGC;AAAM,CAAC,EAAEC,GAAG,KAAK;EAC9F,MAAMC,iBAAiB,GAAGT,EAAE,CAACC,gBAAgB,CAAC,CAAC,EAAEG,SAAS,CAAC;EAE3D,oBACED,IAAA,CAACN,iBAAiB;IAChBW,GAAG,EAAEA,GAAI;IACTJ,SAAS,EAAEK,iBAAkB;IAC7BH,KAAK,EAAEA,KAAM;IAAA,GACTC,KAAK;IAAA,GACLR,mBAAmB,CAACQ,KAAK,EAAET,cAAc,CAAC;MAAEY,IAAI,EAAE;IAAO,CAAC,CAAC,CAAC;IAAAL,QAAA,EAE/DA;EAAQ,CACQ,CAAC;AAExB,CAAC,CAAC;AAEFT,QAAQ,CAACe,WAAW,GAAG,MAAM;;AAE7B;AACA;AACA;;AAEA,OAAO,MAAMC,IAAI,GAAGhB,QAAQ","ignoreList":[]}
@@ -1,42 +1,11 @@
1
1
  "use strict";
2
2
 
3
3
  import { forwardRef } from 'react';
4
- import { ActivityIndicator, Pressable, Text, View } from 'react-native';
5
- import { createButton, dataAttributes, useButtonContext } from '@cdx-ui/primitives';
4
+ import { ButtonRoot, dataAttributes, mergeDataAttributes } from '@cdx-ui/primitives';
6
5
  import { cn } from '@cdx-ui/utils';
7
6
  import { Icon } from '../Icon';
8
7
  import { iconButtonGlyphVariants, iconButtonIconColorVariants, iconButtonRootVariants } from './styles';
9
8
  import { jsx as _jsx } from "react/jsx-runtime";
10
- const IconButtonPrimitive = createButton({
11
- Root: Pressable,
12
- Text,
13
- Group: View,
14
- Spinner: ActivityIndicator,
15
- Icon: View
16
- });
17
- function IconButtonGlyph({
18
- as: IconComponent,
19
- className
20
- }) {
21
- const {
22
- hover,
23
- focus,
24
- active,
25
- disabled,
26
- focusVisible
27
- } = useButtonContext();
28
- return /*#__PURE__*/_jsx(Icon, {
29
- as: IconComponent,
30
- className: className,
31
- ...dataAttributes({
32
- hover,
33
- focus,
34
- active,
35
- disabled,
36
- focusVisible
37
- })
38
- });
39
- }
40
9
  const IconButtonRoot = /*#__PURE__*/forwardRef(({
41
10
  variant = 'solid',
42
11
  color = 'neutral',
@@ -59,13 +28,16 @@ const IconButtonRoot = /*#__PURE__*/forwardRef(({
59
28
  variant,
60
29
  color
61
30
  }), iconClassName);
62
- return /*#__PURE__*/_jsx(IconButtonPrimitive, {
31
+ return /*#__PURE__*/_jsx(ButtonRoot, {
63
32
  ref: ref,
64
33
  accessibilityRole: accessibilityRole,
65
34
  className: rootClassName,
66
35
  style: style,
67
36
  ...props,
68
- children: /*#__PURE__*/_jsx(IconButtonGlyph, {
37
+ ...mergeDataAttributes(props, dataAttributes({
38
+ slot: 'icon-button'
39
+ })),
40
+ children: /*#__PURE__*/_jsx(Icon, {
69
41
  as: IconComponent,
70
42
  className: glyphClassName
71
43
  })
@@ -1 +1 @@
1
- {"version":3,"names":["forwardRef","ActivityIndicator","Pressable","Text","View","createButton","dataAttributes","useButtonContext","cn","Icon","iconButtonGlyphVariants","iconButtonIconColorVariants","iconButtonRootVariants","jsx","_jsx","IconButtonPrimitive","Root","Group","Spinner","IconButtonGlyph","as","IconComponent","className","hover","focus","active","disabled","focusVisible","IconButtonRoot","variant","color","size","style","iconClassName","accessibilityRole","props","ref","rootClassName","glyphClassName","children","displayName","IconButton"],"sourceRoot":"../../../../src","sources":["components/IconButton/index.tsx"],"mappings":";;AAAA,SAASA,UAAU,QAAQ,OAAO;AAClC,SAASC,iBAAiB,EAAEC,SAAS,EAAEC,IAAI,EAAEC,IAAI,QAA6B,cAAc;AAC5F,SACEC,YAAY,EACZC,cAAc,EAEdC,gBAAgB,QACX,oBAAoB;AAE3B,SAASC,EAAE,QAAQ,eAAe;AAClC,SAASC,IAAI,QAAwB,SAAS;AAC9C,SAEEC,uBAAuB,EACvBC,2BAA2B,EAC3BC,sBAAsB,QACjB,UAAU;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAElB,MAAMC,mBAAmB,GAAGV,YAAY,CAAC;EACvCW,IAAI,EAAEd,SAAS;EACfC,IAAI;EACJc,KAAK,EAAEb,IAAI;EACXc,OAAO,EAAEjB,iBAAiB;EAC1BQ,IAAI,EAAEL;AACR,CAAC,CAAC;AAEF,SAASe,eAAeA,CAAC;EAAEC,EAAE,EAAEC,aAAa;EAAEC;AAAgD,CAAC,EAAE;EAC/F,MAAM;IAAEC,KAAK;IAAEC,KAAK;IAAEC,MAAM;IAAEC,QAAQ;IAAEC;EAAa,CAAC,GAAGpB,gBAAgB,CAAC,CAAC;EAC3E,oBACEO,IAAA,CAACL,IAAI;IACHW,EAAE,EAAEC,aAAc;IAClBC,SAAS,EAAEA,SAAU;IAAA,GACjBhB,cAAc,CAAC;MACjBiB,KAAK;MACLC,KAAK;MACLC,MAAM;MACNC,QAAQ;MACRC;IACF,CAAC;EAAC,CACH,CAAC;AAEN;AAUA,MAAMC,cAAc,gBAAG5B,UAAU,CAC/B,CACE;EACE6B,OAAO,GAAG,OAAO;EACjBC,KAAK,GAAG,SAAS;EACjBC,IAAI,GAAG,SAAS;EAChBT,SAAS;EACTU,KAAK;EACLZ,EAAE,EAAEC,aAAa;EACjBY,aAAa;EACbC,iBAAiB,GAAG,QAAQ;EAC5B,GAAGC;AACL,CAAC,EACDC,GAAG,KACA;EACH,MAAMC,aAAa,GAAG7B,EAAE,CAACI,sBAAsB,CAAC;IAAEiB,OAAO;IAAEC,KAAK;IAAEC;EAAK,CAAC,CAAC,EAAET,SAAS,CAAC;EAErF,MAAMgB,cAAc,GAAG9B,EAAE,CACvBE,uBAAuB,CAAC;IAAEqB;EAAK,CAAC,CAAC,EACjCpB,2BAA2B,CAAC;IAAEkB,OAAO;IAAEC;EAAM,CAAC,CAAC,EAC/CG,aACF,CAAC;EAED,oBACEnB,IAAA,CAACC,mBAAmB;IAClBqB,GAAG,EAAEA,GAAI;IACTF,iBAAiB,EAAEA,iBAAkB;IACrCZ,SAAS,EAAEe,aAAc;IACzBL,KAAK,EAAEA,KAAM;IAAA,GACTG,KAAK;IAAAI,QAAA,eAETzB,IAAA,CAACK,eAAe;MAACC,EAAE,EAAEC,aAAc;MAACC,SAAS,EAAEgB;IAAe,CAAE;EAAC,CAC9C,CAAC;AAE1B,CACF,CAAC;AAEDV,cAAc,CAACY,WAAW,GAAG,YAAY;AAEzC,OAAO,MAAMC,UAAU,GAAGb,cAAc","ignoreList":[]}
1
+ {"version":3,"names":["forwardRef","ButtonRoot","dataAttributes","mergeDataAttributes","cn","Icon","iconButtonGlyphVariants","iconButtonIconColorVariants","iconButtonRootVariants","jsx","_jsx","IconButtonRoot","variant","color","size","className","style","as","IconComponent","iconClassName","accessibilityRole","props","ref","rootClassName","glyphClassName","slot","children","displayName","IconButton"],"sourceRoot":"../../../../src","sources":["components/IconButton/index.tsx"],"mappings":";;AAAA,SAASA,UAAU,QAAQ,OAAO;AAElC,SACEC,UAAU,EACVC,cAAc,EACdC,mBAAmB,QAEd,oBAAoB;AAE3B,SAASC,EAAE,QAAQ,eAAe;AAClC,SAASC,IAAI,QAAwB,SAAS;AAC9C,SAEEC,uBAAuB,EACvBC,2BAA2B,EAC3BC,sBAAsB,QACjB,UAAU;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAUlB,MAAMC,cAAc,gBAAGX,UAAU,CAC/B,CACE;EACEY,OAAO,GAAG,OAAO;EACjBC,KAAK,GAAG,SAAS;EACjBC,IAAI,GAAG,SAAS;EAChBC,SAAS;EACTC,KAAK;EACLC,EAAE,EAAEC,aAAa;EACjBC,aAAa;EACbC,iBAAiB,GAAG,QAAQ;EAC5B,GAAGC;AACL,CAAC,EACDC,GAAG,KACA;EACH,MAAMC,aAAa,GAAGnB,EAAE,CAACI,sBAAsB,CAAC;IAAEI,OAAO;IAAEC,KAAK;IAAEC;EAAK,CAAC,CAAC,EAAEC,SAAS,CAAC;EAErF,MAAMS,cAAc,GAAGpB,EAAE,CACvBE,uBAAuB,CAAC;IAAEQ;EAAK,CAAC,CAAC,EACjCP,2BAA2B,CAAC;IAAEK,OAAO;IAAEC;EAAM,CAAC,CAAC,EAC/CM,aACF,CAAC;EAED,oBACET,IAAA,CAACT,UAAU;IACTqB,GAAG,EAAEA,GAAI;IACTF,iBAAiB,EAAEA,iBAAkB;IACrCL,SAAS,EAAEQ,aAAc;IACzBP,KAAK,EAAEA,KAAM;IAAA,GACTK,KAAK;IAAA,GACLlB,mBAAmB,CAACkB,KAAK,EAAEnB,cAAc,CAAC;MAAEuB,IAAI,EAAE;IAAc,CAAC,CAAC,CAAC;IAAAC,QAAA,eAEvEhB,IAAA,CAACL,IAAI;MAACY,EAAE,EAAEC,aAAc;MAACH,SAAS,EAAES;IAAe,CAAE;EAAC,CAC5C,CAAC;AAEjB,CACF,CAAC;AAEDb,cAAc,CAACgB,WAAW,GAAG,YAAY;AAEzC,OAAO,MAAMC,UAAU,GAAGjB,cAAc","ignoreList":[]}
@@ -1,27 +1,21 @@
1
1
  "use strict";
2
2
 
3
- import { forwardRef } from 'react';
3
+ import { forwardRef, useMemo } from 'react';
4
4
  import { View } from 'react-native';
5
- import { createInput } from '@cdx-ui/primitives';
6
- import { cn, useStyleContext, withStyleContext } from '@cdx-ui/utils';
5
+ import { InputField as InputFieldPrimitive, InputRoot as InputRootPrimitive, Slot, dataAttributes, mergeDataAttributes } from '@cdx-ui/primitives';
6
+ import { ParentContext, cn, useParentContext, useStyleContext } from '@cdx-ui/utils';
7
7
  import { Icon } from '../Icon';
8
- import { BaseInput } from './BaseInput';
9
8
  import { inputFieldPlaceholderVariants, inputFieldVariants, inputIconVariants, inputRootVariants, inputSlotVariants } from './styles';
10
9
  import { jsx as _jsx } from "react/jsx-runtime";
11
10
  const SCOPE = 'INPUT';
12
- const Root = withStyleContext(View, SCOPE);
13
11
  const useInputStyleContext = () => useStyleContext(SCOPE);
14
- const InputPrimitive = createInput({
15
- Root,
16
- Slot: View,
17
- Field: BaseInput
18
- });
19
12
 
20
13
  // =============================================================================
21
14
  // INPUT (ROOT)
22
15
  // =============================================================================
23
16
 
24
17
  const InputRoot = /*#__PURE__*/forwardRef(({
18
+ asChild,
25
19
  variant = 'outline',
26
20
  size = 'default',
27
21
  className,
@@ -33,16 +27,27 @@ const InputRoot = /*#__PURE__*/forwardRef(({
33
27
  variant,
34
28
  size
35
29
  }), className);
36
- return /*#__PURE__*/_jsx(InputPrimitive, {
37
- ref: ref,
38
- className: computedClassName,
39
- style: style,
40
- context: {
30
+ const parent = useParentContext();
31
+ const ctx = useMemo(() => ({
32
+ ...parent,
33
+ [SCOPE]: {
41
34
  variant,
42
35
  size
43
- },
44
- ...props,
45
- children: children
36
+ }
37
+ }), [parent, variant, size]);
38
+ return /*#__PURE__*/_jsx(ParentContext.Provider, {
39
+ value: ctx,
40
+ children: /*#__PURE__*/_jsx(InputRootPrimitive, {
41
+ ref: ref,
42
+ asChild: asChild,
43
+ className: computedClassName,
44
+ style: style,
45
+ ...props,
46
+ ...mergeDataAttributes(props, dataAttributes({
47
+ slot: 'input'
48
+ })),
49
+ children: children
50
+ })
46
51
  });
47
52
  });
48
53
  InputRoot.displayName = 'Input';
@@ -64,32 +69,40 @@ const InputField = /*#__PURE__*/forwardRef(({
64
69
  size
65
70
  }), className);
66
71
  const computedPlaceholderColorClassName = cn(inputFieldPlaceholderVariants(), placeholderTextColorClassName);
67
- return /*#__PURE__*/_jsx(InputPrimitive.Field, {
72
+ return /*#__PURE__*/_jsx(InputFieldPrimitive, {
68
73
  ref: ref,
69
74
  className: computedClassName,
70
75
  placeholderTextColorClassName: computedPlaceholderColorClassName,
71
76
  style: style,
72
- ...rest
77
+ ...rest,
78
+ ...mergeDataAttributes(rest, dataAttributes({
79
+ slot: 'input-field'
80
+ }))
73
81
  });
74
82
  });
75
83
  InputField.displayName = 'Input.Field';
76
84
 
77
85
  // =============================================================================
78
- // INPUT SLOT
86
+ // INPUT SLOT — styled-only (Standard 3: no behavior beyond layout)
79
87
  // =============================================================================
80
88
 
81
89
  const InputSlot = /*#__PURE__*/forwardRef(({
90
+ asChild,
82
91
  className,
83
92
  children,
84
93
  style,
85
94
  ...props
86
95
  }, ref) => {
87
96
  const computedClassName = cn(inputSlotVariants(), className);
88
- return /*#__PURE__*/_jsx(InputPrimitive.Slot, {
97
+ const Comp = asChild ? Slot : View;
98
+ return /*#__PURE__*/_jsx(Comp, {
89
99
  ref: ref,
90
100
  className: computedClassName,
91
101
  style: style,
92
102
  ...props,
103
+ ...mergeDataAttributes(props, dataAttributes({
104
+ slot: 'input-slot'
105
+ })),
93
106
  children: children
94
107
  });
95
108
  });
@@ -100,6 +113,7 @@ InputSlot.displayName = 'Input.Slot';
100
113
  // =============================================================================
101
114
 
102
115
  const InputIcon = ({
116
+ asChild,
103
117
  className,
104
118
  style,
105
119
  as,
@@ -111,11 +125,27 @@ const InputIcon = ({
111
125
  const computedClassName = cn(inputIconVariants({
112
126
  size
113
127
  }), className);
128
+ if (asChild) {
129
+ return /*#__PURE__*/_jsx(Slot, {
130
+ className: computedClassName,
131
+ style: style,
132
+ ...props,
133
+ ...mergeDataAttributes(props, dataAttributes({
134
+ slot: 'input-icon'
135
+ }))
136
+ });
137
+ }
138
+ if (!as) {
139
+ return null;
140
+ }
114
141
  return /*#__PURE__*/_jsx(Icon, {
115
142
  as: as,
116
143
  className: computedClassName,
117
144
  style: style,
118
- ...props
145
+ ...props,
146
+ ...mergeDataAttributes(props, dataAttributes({
147
+ slot: 'input-icon'
148
+ }))
119
149
  });
120
150
  };
121
151
  InputIcon.displayName = 'Input.Icon';
@@ -1 +1 @@
1
- {"version":3,"names":["forwardRef","View","createInput","cn","useStyleContext","withStyleContext","Icon","BaseInput","inputFieldPlaceholderVariants","inputFieldVariants","inputIconVariants","inputRootVariants","inputSlotVariants","jsx","_jsx","SCOPE","Root","useInputStyleContext","InputPrimitive","Slot","Field","InputRoot","variant","size","className","children","style","props","ref","computedClassName","context","displayName","InputField","placeholderTextColorClassName","rest","computedPlaceholderColorClassName","InputSlot","InputIcon","as","Input","Object","assign"],"sourceRoot":"../../../../src","sources":["components/Input/index.tsx"],"mappings":";;AAAA,SAASA,UAAU,QAAwB,OAAO;AAClD,SAAyBC,IAAI,QAAwB,cAAc;AACnE,SACEC,WAAW,QAIN,oBAAoB;AAC3B,SAASC,EAAE,EAAEC,eAAe,EAAEC,gBAAgB,QAAQ,eAAe;AACrE,SAASC,IAAI,QAAmB,SAAS;AACzC,SAASC,SAAS,QAAQ,aAAa;AACvC,SAEEC,6BAA6B,EAC7BC,kBAAkB,EAClBC,iBAAiB,EACjBC,iBAAiB,EACjBC,iBAAiB,QACZ,UAAU;AAA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C;AAEDU,SAAS,CAACN,WAAW,GAAG,YAAY;;AAEpC;AACA;AACA;;AAQA,OAAO,MAAMQ,KAAK,GAAGC,MAAM,CAACC,MAAM,CAACpB,SAAS,EAAE;EAC5CD,KAAK,EAAEY,UAAU;EACjBb,IAAI,EAAEiB,SAAS;EACf9B,IAAI,EAAE+B;AACR,CAAC,CAA2B","ignoreList":[]}
1
+ {"version":3,"names":["forwardRef","useMemo","View","InputField","InputFieldPrimitive","InputRoot","InputRootPrimitive","Slot","dataAttributes","mergeDataAttributes","ParentContext","cn","useParentContext","useStyleContext","Icon","inputFieldPlaceholderVariants","inputFieldVariants","inputIconVariants","inputRootVariants","inputSlotVariants","jsx","_jsx","SCOPE","useInputStyleContext","asChild","variant","size","className","children","style","props","ref","computedClassName","parent","ctx","Provider","value","slot","displayName","placeholderTextColorClassName","rest","computedPlaceholderColorClassName","InputSlot","Comp","InputIcon","as","Input","Object","assign","Field"],"sourceRoot":"../../../../src","sources":["components/Input/index.tsx"],"mappings":";;AAAA,SAASA,UAAU,EAAEC,OAAO,QAAwB,OAAO;AAC3D,SAAyBC,IAAI,QAAwB,cAAc;AACnE,SACEC,UAAU,IAAIC,mBAAmB,EACjCC,SAAS,IAAIC,kBAAkB,EAC/BC,IAAI,EACJC,cAAc,EACdC,mBAAmB,QAId,oBAAoB;AAC3B,SAASC,aAAa,EAAEC,EAAE,EAAEC,gBAAgB,EAAEC,eAAe,QAAQ,eAAe;AACpF,SAASC,IAAI,QAAwB,SAAS;AAC9C,SAEEC,6BAA6B,EAC7BC,kBAAkB,EAClBC,iBAAiB,EACjBC,iBAAiB,EACjBC,iBAAiB,QACZ,UAAU;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAElB,MAAMC,KAAK,GAAG,OAAO;AAErB,MAAMC,oBAAoB,GAAGA,CAAA,KAAMV,eAAe,CAACS,KAAK,CAAsB;;AAE9E;AACA;AACA;;AAQA,MAAMjB,SAAS,gBAAGL,UAAU,CAC1B,CACE;EAAEwB,O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AAK;EACjF,MAAM;IAAEJ;EAAK,CAAC,GAAGH,oBAAoB,CAAC,CAAC;EACvC,MAAMS,iBAAiB,GAAGrB,EAAE,CAACM,iBAAiB,CAAC;IAAES;EAAK,CAAC,CAAC,EAAEC,SAAS,CAAC;EAEpE,IAAIH,OAAO,EAAE;IACX,oBACEH,IAAA,CAACd,IAAI;MACHoB,SAAS,EAAEK,iBAAkB;MAC7BH,KAAK,EAAEA,KAAM;MAAA,GACTC,KAAK;MAAA,GACLrB,mBAAmB,CAACqB,KAAK,EAAEtB,cAAc,CAAC;QAAE6B,IAAI,EAAE;MAAa,CAAC,CAAC;IAAC,CACvE,CAAC;EAEN;EAEA,IAAI,CAACQ,EAAE,EAAE;IACP,OAAO,IAAI;EACb;EAEA,oBACExB,IAAA,CAACP,IAAI;IACH+B,EAAE,EAAEA,EAAG;IACPlB,SAAS,EAAEK,iBAAkB;IAC7BH,KAAK,EAAEA,KAAM;IAAA,GACTC,KAAK;IAAA,GACLrB,mBAAmB,CAACqB,KAAK,EAAEtB,cAAc,CAAC;MAAE6B,IAAI,EAAE;IAAa,CAAC,CAAC;EAAC,CACvE,CAAC;AAEN,CAAC;AAEDO,SAAS,CAACN,WAAW,GAAG,YAAY;;AAEpC;AACA;AACA;;AAQA,OAAO,MAAMQ,KAAK,GAAGC,MAAM,CAACC,MAAM,CAAC3C,SAAS,EAAE;EAC5C4C,KAAK,EAAE9C,UAAU;EACjBI,IAAI,EAAEmC,SAAS;EACf5B,IAAI,EAAE8B;AACR,CAAC,CAA2B","ignoreList":[]}
@@ -1,16 +1,13 @@
1
1
  "use strict";
2
2
 
3
3
  import { forwardRef } from 'react';
4
- import { Platform, Pressable, Text, View } from 'react-native';
5
- import { createLink, useLinkInteractionContext } from '@cdx-ui/primitives';
4
+ import { Platform, Text, View } from 'react-native';
5
+ import { LinkRoot as LinkRootPrimitive, Slot, dataAttributes, mergeDataAttributes, useLinkInteractionContext } from '@cdx-ui/primitives';
6
6
  import { cn } from '@cdx-ui/utils';
7
7
  import { Icon } from '../Icon';
8
8
  import { linkIconVariants, linkLabelVariants, linkNativeUnderlineVariants, linkRootVariants } from './styles';
9
9
  import { jsx as _jsx } from "react/jsx-runtime";
10
10
  export { LinkProvider } from '@cdx-ui/primitives';
11
- const LinkPrimitive = createLink({
12
- Root: Pressable
13
- });
14
11
 
15
12
  // =============================================================================
16
13
  // STYLED ROOT COMPONENT
@@ -23,11 +20,14 @@ const LinkRoot = /*#__PURE__*/forwardRef(({
23
20
  ...props
24
21
  }, ref) => {
25
22
  const rootClassName = cn(linkRootVariants(), className);
26
- return /*#__PURE__*/_jsx(LinkPrimitive, {
23
+ return /*#__PURE__*/_jsx(LinkRootPrimitive, {
27
24
  ref: ref,
28
25
  className: rootClassName,
29
26
  style: style,
30
27
  ...props,
28
+ ...mergeDataAttributes(props, dataAttributes({
29
+ slot: 'link'
30
+ })),
31
31
  children: children
32
32
  });
33
33
  });
@@ -38,6 +38,7 @@ LinkRoot.displayName = 'Link';
38
38
  // =============================================================================
39
39
 
40
40
  const LinkLabel = /*#__PURE__*/forwardRef(({
41
+ asChild,
41
42
  className,
42
43
  children,
43
44
  style,
@@ -49,11 +50,15 @@ const LinkLabel = /*#__PURE__*/forwardRef(({
49
50
  const computedClassName = cn(linkLabelVariants({
50
51
  visited
51
52
  }), className);
52
- const textElement = /*#__PURE__*/_jsx(Text, {
53
+ const Comp = asChild ? Slot : Text;
54
+ const textElement = /*#__PURE__*/_jsx(Comp, {
53
55
  ref: ref,
54
56
  className: computedClassName,
55
57
  style: style,
56
58
  ...props,
59
+ ...mergeDataAttributes(props, dataAttributes({
60
+ slot: 'link-label'
61
+ })),
57
62
  children: children
58
63
  });
59
64
  if (Platform.OS === 'web') {
@@ -88,7 +93,10 @@ const LinkIcon = ({
88
93
  as: as,
89
94
  className: computedClassName,
90
95
  style: style,
91
- ...props
96
+ ...props,
97
+ ...mergeDataAttributes(props, dataAttributes({
98
+ slot: 'link-icon'
99
+ }))
92
100
  });
93
101
  };
94
102
  LinkIcon.displayName = 'Link.Icon';
@@ -1 +1 @@
1
- {"version":3,"names":["forwardRef","Platform","Pressable","Text","View","createLink","useLinkInteractionContext","cn","Icon","linkIconVariants","linkLabelVariants","linkNativeUnderlineVariants","linkRootVariants","jsx","_jsx","LinkProvider","LinkPrimitive","Root","LinkRoot","className","children","style","props","ref","rootClassName","displayName","LinkLabel","visited","computedClassName","textElement","OS","LinkIcon","as","Link","Object","assign","Label"],"sourceRoot":"../../../../src","sources":["components/Link/index.tsx"],"mappings":";;AAAA,SAASA,UAAU,QAAwB,OAAO;AAClD,SAASC,QAAQ,EAAEC,SAAS,EAAEC,IAAI,EAAEC,IAAI,QAAwB,cAAc;AAC9E,SAASC,UAAU,EAAEC,yBAAyB,QAAyB,oBAAoB;AAC3F,SAASC,EAAE,QAAQ,eAAe;AAClC,SAASC,IAAI,QAAwB,SAAS;AAC9C,SACEC,gBAAgB,EAChBC,iBAAiB,EACjBC,2BAA2B,EAC3BC,gBAAgB,QACX,UAAU;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAElB,SAASC,YAAY,QAA0C,oBAAoB;AAEnF,MAAMC,aAAa,GAAGX,UAAU,CAAC;EAC/BY,IAAI,EAAEf;AACR,CAAC,CAAC;;AAEF;AACA;AACA;;AAMA,MAAMgB,QAAQ,gBAAGlB,UAAU,CAAkB,CAAC;EAAEmB,SAAS;EAAEC,QAAQ;EAAEC,KAAK;EAAE,GAAGC;AAAM,CAAC,EAAEC,GAAG,KAAK;EAC9F,MAAMC,aAAa,GAAGjB,EAAE,CAACK,gBAAgB,CAAC,CAAC,EAAEO,SAAS,CAAC;EAEvD,oBACEL,IAAA,CAACE,aAAa;IAACO,GAAG,EAAEA,GAAI;IAACJ,SAAS,EAAEK,aAAc;IAACH,KAAK,EAAEA,KAAM;IAAA,GAAKC,KAAK;IAAAF,QAAA,EACvEA;EAAQ,CACI,CAAC;AAEpB,CAAC,CAAC;AAEFF,QAAQ,CAACO,WAAW,GAAG,MAAM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AAEDS,QAAQ,CAACN,WAAW,GAAG,WAAW;;AAElC;AACA;AACA;;AAOA,OAAO,MAAMQ,IAAI,GAAGC,MAAM,CAACC,MAAM,CAACjB,QAAQ,EAAE;EAC1CkB,KAAK,EAAEV,SAAS;EAChBlB,IAAI,EAAEuB;AACR,CAAC,CAA0B","ignoreList":[]}
1
+ {"version":3,"names":["forwardRef","Platform","Text","View","LinkRoot","LinkRootPrimitive","Slot","dataAttributes","mergeDataAttributes","useLinkInteractionContext","cn","Icon","linkIconVariants","linkLabelVariants","linkNativeUnderlineVariants","linkRootVariants","jsx","_jsx","LinkProvider","className","children","style","props","ref","rootClassName","slot","displayName","LinkLabel","asChild","visited","computedClassName","Comp","textElement","OS","LinkIcon","as","Link","Object","assign","Label"],"sourceRoot":"../../../../src","sources":["components/Link/index.tsx"],"mappings":";;AAAA,SAASA,UAAU,QAAwB,OAAO;AAClD,SAASC,QAAQ,EAAEC,IAAI,EAAEC,IAAI,QAAwB,cAAc;AACnE,SACEC,QAAQ,IAAIC,iBAAiB,EAC7BC,IAAI,EACJC,cAAc,EACdC,mBAAmB,EACnBC,yBAAyB,QAEpB,oBAAoB;AAC3B,SAASC,EAAE,QAAQ,eAAe;AAClC,SAASC,IAAI,QAAwB,SAAS;AAC9C,SACEC,gBAAgB,EAChBC,iBAAiB,EACjBC,2BAA2B,EAC3BC,gBAAgB,QACX,UAAU;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAElB,SAASC,YAAY,QAA0C,oBAAoB;;AAEnF;AACA;AACA;;AAOA,MAAMd,QAAQ,gBAAGJ,UAAU,CAAkB,CAAC;EAAEmB,SAAS;EAAEC,QAAQ;EAAEC,KAAK;EAAE,GAAGC;AAAM,CAAC,EAAEC,GAAG,KAAK;EAC9F,MAAMC,aAAa,GAAGd,EAAE,CAACK,gBAAgB,CAAC,CAAC,EAAEI,SAAS,CAAC;EAEvD,oBACEF,IAAA,CAACZ,iBAAiB;IAChBkB,GAAG,EAAEA,GAAI;IACTJ,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