@dashx/react 0.1.0 → 0.1.2

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 (242) hide show
  1. package/dist/cjs/components/button.d.ts +2 -1
  2. package/dist/cjs/components/button.js +1 -1
  3. package/dist/cjs/components/button.js.map +3 -3
  4. package/dist/cjs/components/card.js +1 -1
  5. package/dist/cjs/components/card.js.map +2 -2
  6. package/dist/cjs/components/checkbox.d.ts +18 -0
  7. package/dist/cjs/components/checkbox.js +2 -0
  8. package/dist/cjs/components/checkbox.js.map +7 -0
  9. package/dist/cjs/components/flex.d.ts +66 -49
  10. package/dist/cjs/components/flex.js +1 -1
  11. package/dist/cjs/components/flex.js.map +3 -3
  12. package/dist/cjs/components/form.d.ts +11 -0
  13. package/dist/cjs/components/form.js +2 -0
  14. package/dist/cjs/components/form.js.map +7 -0
  15. package/dist/cjs/components/index.d.ts +5 -0
  16. package/dist/cjs/components/index.js +1 -1
  17. package/dist/cjs/components/index.js.map +2 -2
  18. package/dist/cjs/components/link.d.ts +10 -0
  19. package/dist/cjs/components/link.js +2 -0
  20. package/dist/cjs/components/link.js.map +7 -0
  21. package/dist/cjs/components/number-field.d.ts +11 -0
  22. package/dist/cjs/components/number-field.js +2 -0
  23. package/dist/cjs/components/number-field.js.map +7 -0
  24. package/dist/cjs/components/popover.d.ts +6 -6
  25. package/dist/cjs/components/text-area.d.ts +11 -0
  26. package/dist/cjs/components/text-area.js +2 -0
  27. package/dist/cjs/components/text-area.js.map +7 -0
  28. package/dist/cjs/components/text-field.d.ts +10 -1
  29. package/dist/cjs/components/text-field.js +1 -1
  30. package/dist/cjs/components/text-field.js.map +3 -3
  31. package/dist/cjs/components/text.d.ts +1 -1
  32. package/dist/cjs/components/text.js +1 -1
  33. package/dist/cjs/components/text.js.map +3 -3
  34. package/dist/cjs/components/theme.d.ts +2 -0
  35. package/dist/cjs/components/theme.js +1 -1
  36. package/dist/cjs/components/theme.js.map +3 -3
  37. package/dist/cjs/components/tooltip.js +1 -1
  38. package/dist/cjs/components/tooltip.js.map +2 -2
  39. package/dist/cjs/hooks/index.d.ts +1 -0
  40. package/dist/cjs/hooks/index.js +1 -1
  41. package/dist/cjs/hooks/index.js.map +3 -3
  42. package/dist/cjs/hooks/use-in-app.js +1 -1
  43. package/dist/cjs/hooks/use-in-app.js.map +3 -3
  44. package/dist/cjs/hooks/use-product-release.d.ts +6 -0
  45. package/dist/cjs/hooks/use-product-release.js +2 -0
  46. package/dist/cjs/hooks/use-product-release.js.map +7 -0
  47. package/dist/cjs/index.js.map +1 -1
  48. package/dist/cjs/providers/DashXProvider.d.ts +7 -2
  49. package/dist/cjs/providers/DashXProvider.js +1 -1
  50. package/dist/cjs/providers/DashXProvider.js.map +3 -3
  51. package/dist/cjs/providers/index.d.ts +1 -1
  52. package/dist/cjs/providers/index.js +1 -1
  53. package/dist/cjs/providers/index.js.map +2 -2
  54. package/dist/cjs/utils/helpers.d.ts +2 -0
  55. package/dist/cjs/utils/helpers.js +2 -0
  56. package/dist/cjs/utils/helpers.js.map +7 -0
  57. package/dist/cjs/variants/base-element.d.ts +25 -18
  58. package/dist/cjs/variants/base-element.js +1 -1
  59. package/dist/cjs/variants/base-element.js.map +2 -2
  60. package/dist/cjs/variants/base-field.d.ts +110 -0
  61. package/dist/cjs/variants/base-field.js +2 -0
  62. package/dist/cjs/variants/base-field.js.map +7 -0
  63. package/dist/cjs/variants/base-input.d.ts +5 -0
  64. package/dist/cjs/variants/base-input.js +2 -0
  65. package/dist/cjs/variants/base-input.js.map +7 -0
  66. package/dist/cjs/variants/button.d.ts +26 -54
  67. package/dist/cjs/variants/button.js +1 -1
  68. package/dist/cjs/variants/button.js.map +2 -2
  69. package/dist/cjs/variants/card.d.ts +2 -62
  70. package/dist/cjs/variants/card.js +1 -1
  71. package/dist/cjs/variants/card.js.map +2 -2
  72. package/dist/cjs/variants/checkbox.d.ts +23 -0
  73. package/dist/cjs/variants/checkbox.js +2 -0
  74. package/dist/cjs/variants/checkbox.js.map +7 -0
  75. package/dist/cjs/variants/field-error.d.ts +65 -0
  76. package/dist/cjs/variants/field-error.js +2 -0
  77. package/dist/cjs/variants/field-error.js.map +7 -0
  78. package/dist/cjs/variants/heading.d.ts +19 -205
  79. package/dist/cjs/variants/index.d.ts +2 -0
  80. package/dist/cjs/variants/index.js +1 -1
  81. package/dist/cjs/variants/index.js.map +2 -2
  82. package/dist/cjs/variants/link.d.ts +215 -0
  83. package/dist/cjs/variants/link.js +2 -0
  84. package/dist/cjs/variants/link.js.map +7 -0
  85. package/dist/cjs/variants/popover.d.ts +5 -61
  86. package/dist/cjs/variants/popover.js +1 -1
  87. package/dist/cjs/variants/popover.js.map +2 -2
  88. package/dist/cjs/variants/text-area.d.ts +141 -0
  89. package/dist/cjs/variants/text-area.js +2 -0
  90. package/dist/cjs/variants/text-area.js.map +7 -0
  91. package/dist/cjs/variants/text-field.d.ts +78 -30
  92. package/dist/cjs/variants/text-field.js +1 -1
  93. package/dist/cjs/variants/text-field.js.map +3 -3
  94. package/dist/cjs/variants/text.d.ts +20 -205
  95. package/dist/cjs/variants/text.js +1 -1
  96. package/dist/cjs/variants/text.js.map +2 -2
  97. package/dist/cjs/variants/tooltip.d.ts +1 -1
  98. package/dist/cjs/variants/tooltip.js +1 -1
  99. package/dist/cjs/variants/tooltip.js.map +2 -2
  100. package/dist/cjs/variants/typography.d.ts +14 -159
  101. package/dist/cjs/variants/typography.js +1 -1
  102. package/dist/cjs/variants/typography.js.map +2 -2
  103. package/dist/esm/components/button.d.ts +2 -1
  104. package/dist/esm/components/button.js +1 -1
  105. package/dist/esm/components/button.js.map +3 -3
  106. package/dist/esm/components/card.js +1 -1
  107. package/dist/esm/components/card.js.map +2 -2
  108. package/dist/esm/components/checkbox.d.ts +18 -0
  109. package/dist/esm/components/checkbox.js +2 -0
  110. package/dist/esm/components/checkbox.js.map +7 -0
  111. package/dist/esm/components/flex.d.ts +321 -16
  112. package/dist/esm/components/flex.js +1 -1
  113. package/dist/esm/components/flex.js.map +3 -3
  114. package/dist/esm/components/form.d.ts +11 -0
  115. package/dist/esm/components/form.js +2 -0
  116. package/dist/esm/components/form.js.map +7 -0
  117. package/dist/esm/components/index.d.ts +5 -0
  118. package/dist/esm/components/index.js +1 -1
  119. package/dist/esm/components/index.js.map +2 -2
  120. package/dist/esm/components/link.d.ts +10 -0
  121. package/dist/esm/components/link.js +2 -0
  122. package/dist/esm/components/link.js.map +7 -0
  123. package/dist/esm/components/number-field.d.ts +11 -0
  124. package/dist/esm/components/number-field.js +2 -0
  125. package/dist/esm/components/number-field.js.map +7 -0
  126. package/dist/esm/components/popover.d.ts +6 -6
  127. package/dist/esm/components/text-area.d.ts +11 -0
  128. package/dist/esm/components/text-area.js +2 -0
  129. package/dist/esm/components/text-area.js.map +7 -0
  130. package/dist/esm/components/text-field.d.ts +10 -1
  131. package/dist/esm/components/text-field.js +1 -1
  132. package/dist/esm/components/text-field.js.map +3 -3
  133. package/dist/esm/components/text.d.ts +1 -1
  134. package/dist/esm/components/text.js +1 -1
  135. package/dist/esm/components/text.js.map +3 -3
  136. package/dist/esm/components/theme.d.ts +2 -0
  137. package/dist/esm/components/theme.js +1 -1
  138. package/dist/esm/components/theme.js.map +3 -3
  139. package/dist/esm/components/tooltip.js +1 -1
  140. package/dist/esm/components/tooltip.js.map +2 -2
  141. package/dist/esm/hooks/index.d.ts +1 -0
  142. package/dist/esm/hooks/index.js +1 -1
  143. package/dist/esm/hooks/index.js.map +2 -2
  144. package/dist/esm/hooks/use-in-app.js +1 -1
  145. package/dist/esm/hooks/use-in-app.js.map +3 -3
  146. package/dist/esm/hooks/use-product-release.d.ts +6 -0
  147. package/dist/esm/hooks/use-product-release.js +2 -0
  148. package/dist/esm/hooks/use-product-release.js.map +7 -0
  149. package/dist/esm/providers/DashXProvider.d.ts +7 -2
  150. package/dist/esm/providers/DashXProvider.js +1 -1
  151. package/dist/esm/providers/DashXProvider.js.map +3 -3
  152. package/dist/esm/providers/index.d.ts +1 -1
  153. package/dist/esm/providers/index.js +1 -1
  154. package/dist/esm/providers/index.js.map +3 -3
  155. package/dist/esm/utils/helpers.d.ts +2 -0
  156. package/dist/esm/utils/helpers.js +2 -0
  157. package/dist/esm/utils/helpers.js.map +7 -0
  158. package/dist/esm/variants/base-element.d.ts +91 -0
  159. package/dist/esm/variants/base-element.js +1 -1
  160. package/dist/esm/variants/base-element.js.map +2 -2
  161. package/dist/esm/variants/base-field.d.ts +236 -0
  162. package/dist/esm/variants/base-field.js +2 -0
  163. package/dist/esm/variants/base-field.js.map +7 -0
  164. package/dist/esm/variants/base-input.d.ts +5 -0
  165. package/dist/esm/variants/base-input.js +2 -0
  166. package/dist/esm/variants/base-input.js.map +7 -0
  167. package/dist/esm/variants/button.d.ts +122 -15
  168. package/dist/esm/variants/button.js +1 -1
  169. package/dist/esm/variants/button.js.map +2 -2
  170. package/dist/esm/variants/card.d.ts +2 -2
  171. package/dist/esm/variants/card.js +1 -1
  172. package/dist/esm/variants/card.js.map +2 -2
  173. package/dist/esm/variants/checkbox.d.ts +41 -0
  174. package/dist/esm/variants/checkbox.js +2 -0
  175. package/dist/esm/variants/checkbox.js.map +7 -0
  176. package/dist/esm/variants/field-error.d.ts +149 -0
  177. package/dist/esm/variants/field-error.js +2 -0
  178. package/dist/esm/variants/field-error.js.map +7 -0
  179. package/dist/esm/variants/heading.d.ts +45 -0
  180. package/dist/esm/variants/index.d.ts +2 -0
  181. package/dist/esm/variants/index.js +1 -1
  182. package/dist/esm/variants/index.js.map +2 -2
  183. package/dist/esm/variants/link.d.ts +470 -0
  184. package/dist/esm/variants/link.js +2 -0
  185. package/dist/esm/variants/link.js.map +7 -0
  186. package/dist/esm/variants/popover.d.ts +4 -4
  187. package/dist/esm/variants/popover.js +1 -1
  188. package/dist/esm/variants/popover.js.map +2 -2
  189. package/dist/esm/variants/text-area.d.ts +298 -0
  190. package/dist/esm/variants/text-area.js +2 -0
  191. package/dist/esm/variants/text-area.js.map +7 -0
  192. package/dist/esm/variants/text-field.d.ts +218 -13
  193. package/dist/esm/variants/text-field.js +1 -1
  194. package/dist/esm/variants/text-field.js.map +3 -3
  195. package/dist/esm/variants/text.d.ts +48 -1
  196. package/dist/esm/variants/text.js +1 -1
  197. package/dist/esm/variants/text.js.map +2 -2
  198. package/dist/esm/variants/tooltip.d.ts +1 -1
  199. package/dist/esm/variants/tooltip.js +1 -1
  200. package/dist/esm/variants/tooltip.js.map +2 -2
  201. package/dist/esm/variants/typography.d.ts +35 -0
  202. package/dist/esm/variants/typography.js +1 -1
  203. package/dist/esm/variants/typography.js.map +2 -2
  204. package/package.json +5 -6
  205. package/src/components/button.tsx +17 -21
  206. package/src/components/card.tsx +2 -2
  207. package/src/components/checkbox.tsx +255 -0
  208. package/src/components/flex.tsx +17 -7
  209. package/src/components/form.tsx +30 -0
  210. package/src/components/index.ts +5 -0
  211. package/src/components/link.tsx +90 -0
  212. package/src/components/number-field.tsx +174 -0
  213. package/src/components/text-area.tsx +107 -0
  214. package/src/components/text-field.tsx +103 -3
  215. package/src/components/text.tsx +13 -4
  216. package/src/components/theme.tsx +16 -4
  217. package/src/components/tooltip.tsx +1 -1
  218. package/src/hooks/index.ts +1 -0
  219. package/src/hooks/use-in-app.ts +17 -58
  220. package/src/hooks/use-product-release.ts +38 -0
  221. package/src/providers/DashXProvider.tsx +91 -5
  222. package/src/providers/index.ts +1 -1
  223. package/src/styles/index.css +180 -43
  224. package/src/utils/helpers.ts +21 -0
  225. package/src/variants/base-element.ts +18 -5
  226. package/src/variants/base-field.ts +42 -0
  227. package/src/variants/base-input.ts +13 -0
  228. package/src/variants/button.ts +47 -27
  229. package/src/variants/card.ts +3 -3
  230. package/src/variants/checkbox.ts +33 -0
  231. package/src/variants/field-error.ts +29 -0
  232. package/src/variants/index.ts +2 -0
  233. package/src/variants/link.ts +34 -0
  234. package/src/variants/popover.ts +5 -5
  235. package/src/variants/text-area.ts +26 -0
  236. package/src/variants/text-field.ts +14 -3
  237. package/src/variants/text.ts +2 -1
  238. package/src/variants/tooltip.ts +1 -1
  239. package/src/variants/typography.ts +14 -9
  240. package/styles.css +546 -124
  241. package/dist/cjs/tsconfig.tsbuildinfo +0 -1
  242. package/dist/esm/tsconfig.tsbuildinfo +0 -1
@@ -1,7 +1,8 @@
1
1
  import React from 'react';
2
+ import { type SlotProps } from 'react-aria-components';
2
3
  import type { AriaButtonProps, HoverEvents } from 'react-aria';
3
4
  import type { ButtonVariantProps } from '../variants/button.js';
4
- export interface ButtonProps extends Omit<AriaButtonProps, 'elementType' | 'href' | 'target' | 'rel'>, HoverEvents, ButtonVariantProps {
5
+ export interface ButtonProps extends Omit<AriaButtonProps, 'elementType' | 'href' | 'target' | 'rel'>, SlotProps, HoverEvents, ButtonVariantProps {
5
6
  asChild?: boolean;
6
7
  }
7
8
  declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
@@ -1,2 +1,2 @@
1
- "use strict";var m=Object.defineProperty;var j=Object.getOwnPropertyDescriptor;var q=Object.getOwnPropertyNames;var G=Object.prototype.hasOwnProperty;var I=(e,t)=>{for(var n in t)m(e,n,{get:t[n],enumerable:!0})},J=(e,t,n,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of q(t))!G.call(e,r)&&r!==n&&m(e,r,{get:()=>t[r],enumerable:!(s=j(t,r))||s.enumerable});return e};var K=e=>J(m({},"__esModule",{value:!0}),e);var U={};I(U,{Button:()=>B});module.exports=K(U);var b=require("react/jsx-runtime"),v=require("@radix-ui/react-slot"),d=require("@react-aria/utils"),i=require("react"),o=require("react-aria"),p=require("../utils/cn.js"),y=require("../variants/button.js");function Q(e,t){const{asChild:n,children:s,size:r,mode:H,variant:E,roundness:f,shape:R,inset:h}=e;let C=n&&(0,i.isValidElement)(s)&&s?.type||"button";const a=(c,u)=>{let P=e;return u in e&&!c?[P[u],void 0]:[c,P[u]]},[T,M]=a(e.onPress,"onClick"),[S,g]=a(e.onPressStart,"onPointerDown"),[w,D]=a(e.onHoverStart,"onPointerMove"),[F,L]=a(e.onHoverEnd,"onPointerLeave"),l=(0,i.useRef)(null);let{buttonProps:V,isPressed:x}=(0,o.useButton)({...e,elementType:C,onPress:T,onPressStart:S,onClick:M,onPointerDown:g,onPointerMove:D,onPointerLeave:L},l),{focusProps:A,isFocused:O,isFocusVisible:k}=(0,o.useFocusRing)(e),{hoverProps:z,isHovered:_}=(0,o.useHover)({...e,onHoverStart:w,onHoverEnd:F});return(0,b.jsx)(n?v.Slot:"button",{...(0,d.filterDOMProps)(e),...(0,o.mergeProps)(V,A,z),ref:(0,d.mergeRefs)(t,l),"data-disabled":e.isDisabled||void 0,"data-pressed":x||void 0,"data-hovered":_||void 0,"data-focused":O||void 0,"data-focus-visible":k||void 0,className:(0,p.cn)("dr",(0,y.button)({size:r,mode:H,variant:E,roundness:f,shape:R})),"data-radius":f,"data-inset":h,children:s})}const B=(0,i.forwardRef)(Q);
1
+ "use strict";var l=Object.defineProperty;var N=Object.getOwnPropertyDescriptor;var _=Object.getOwnPropertyNames;var j=Object.prototype.hasOwnProperty;var q=(e,t)=>{for(var n in t)l(e,n,{get:t[n],enumerable:!0})},G=(e,t,n,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of _(t))!j.call(e,r)&&r!==n&&l(e,r,{get:()=>t[r],enumerable:!(s=N(t,r))||s.enumerable});return e};var I=e=>G(l({},"__esModule",{value:!0}),e);var K={};q(K,{Button:()=>b});module.exports=I(K);var B=require("react/jsx-runtime"),i=require("react"),d=require("react-aria-components"),u=require("@react-aria/utils"),o=require("react-aria"),c=require("@radix-ui/react-slot"),v=require("../variants/button.js"),p=require("../utils/cn.js"),a=require("../utils/helpers.js");function J(e,t){[e,t]=(0,d.useContextProps)(e,t,d.ButtonContext);const{asChild:n,children:s,size:r,mode:E,variant:H,roundness:m,elevation:f,shape:y,inset:C}=e;let h=n&&(0,i.isValidElement)(s)&&s?.type||"button";const[R,S]=(0,a.fallbackEventTo)(e,"onPress","onClick"),[T,w]=(0,a.fallbackEventTo)(e,"onPressStart","onPointerDown"),[x,M]=(0,a.fallbackEventTo)(e,"onHoverStart","onPointerMove"),[g,D]=(0,a.fallbackEventTo)(e,"onHoverEnd","onPointerLeave"),P=(0,i.useRef)(null);let{buttonProps:F,isPressed:L}=(0,o.useButton)({...e,elementType:h,onPress:R,onPressStart:T,onClick:S,onPointerDown:w,onPointerMove:M,onPointerLeave:D},P),{focusProps:V,isFocused:k,isFocusVisible:A}=(0,o.useFocusRing)(e),{hoverProps:O,isHovered:z}=(0,o.useHover)({...e,onHoverStart:x,onHoverEnd:g});return(0,B.jsx)(n?c.Slot:"button",{...(0,u.filterDOMProps)(e),...(0,o.mergeProps)(F,V,O),slot:e.slot||void 0,ref:(0,u.mergeRefs)(t,P),"data-disabled":e.isDisabled||void 0,"data-pressed":L||void 0,"data-hovered":z||void 0,"data-focused":k||void 0,"data-focus-visible":A||void 0,className:(0,p.cn)("dx",(0,v.button)({size:r,mode:E,variant:H,roundness:m,elevation:f,shape:y})),"data-radius":m,"data-shadow":f,"data-inset":C,children:s})}const b=(0,i.forwardRef)(J);
2
2
  //# sourceMappingURL=button.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/button.tsx"],
4
- "sourcesContent": ["import { Slot } from '@radix-ui/react-slot';\nimport { filterDOMProps, mergeRefs } from '@react-aria/utils';\nimport React, { forwardRef, isValidElement, useRef } from 'react';\nimport { mergeProps, useButton, useFocusRing, useHover } from 'react-aria';\n\nimport { cn } from '../utils/cn.js';\nimport { button } from '../variants/button.js';\n\nimport type { ElementType } from 'react';\nimport type { AriaButtonProps, HoverEvents } from 'react-aria';\nimport type { ButtonVariantProps } from '../variants/button.js';\n\nexport interface ButtonProps\n extends Omit<AriaButtonProps, 'elementType' | 'href' | 'target' | 'rel'>,\n HoverEvents,\n ButtonVariantProps {\n asChild?: boolean;\n}\n\nfunction _Button(props: ButtonProps, ref: React.ForwardedRef<HTMLButtonElement>) {\n const { asChild, children, size, mode, variant, roundness, shape, inset } = props;\n let elementType = asChild\n ? (isValidElement(children) && (children?.type as ElementType)) || 'button'\n : 'button';\n\n const fallbackEventTo = (event: any, fallbackEventName: any) => {\n let anyProps: any = props;\n if (fallbackEventName in props && !event) {\n return [anyProps[fallbackEventName], undefined];\n }\n\n return [event, anyProps[fallbackEventName]];\n };\n\n const [onPress, onClick] = fallbackEventTo(props.onPress, 'onClick');\n const [onPressStart, onPointerDown] = fallbackEventTo(props.onPressStart, 'onPointerDown');\n const [onHoverStart, onPointerMove] = fallbackEventTo(props.onHoverStart, 'onPointerMove');\n const [onHoverEnd, onPointerLeave] = fallbackEventTo(props.onHoverEnd, 'onPointerLeave');\n const innerRef = useRef<HTMLButtonElement>(null);\n let { buttonProps, isPressed } = useButton(\n {\n ...props,\n elementType,\n onPress,\n onPressStart,\n // @ts-ignore\n onClick,\n // @ts-ignore\n onPointerDown,\n // @ts-ignore\n onPointerMove,\n // @ts-ignore\n onPointerLeave,\n },\n innerRef,\n );\n let { focusProps, isFocused, isFocusVisible } = useFocusRing(props);\n\n let { hoverProps, isHovered } = useHover({\n ...props,\n onHoverStart,\n onHoverEnd,\n });\n\n let Comp = asChild ? Slot : 'button';\n\n return (\n <Comp\n {...filterDOMProps(props)}\n {...mergeProps(buttonProps, focusProps, hoverProps)}\n ref={mergeRefs(ref, innerRef)}\n data-disabled={props.isDisabled || undefined}\n data-pressed={isPressed || undefined}\n data-hovered={isHovered || undefined}\n data-focused={isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}\n className={cn('dr', button({ size, mode, variant, roundness, shape }))}\n data-radius={roundness}\n data-inset={inset}\n >\n {children}\n </Comp>\n );\n}\n\nconst Button = forwardRef(_Button);\n\nexport { Button };\n"],
5
- "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,YAAAE,IAAA,eAAAC,EAAAH,GAmEI,IAAAI,EAAA,6BAnEJC,EAAqB,gCACrBC,EAA0C,6BAC1CC,EA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EAC5B,gBAAevB,EAAM,YAAc,OACnC,eAAcyB,GAAa,OAC3B,eAAcK,GAAa,OAC3B,eAAcH,GAAa,OAC3B,qBAAoBC,GAAkB,OACtC,aAAW,MAAG,QAAM,UAAO,CAAE,KAAAxB,EAAM,KAAAC,EAAM,QAAAC,EAAS,UAAAC,EAAW,MAAAC,CAAM,CAAC,CAAC,EACrE,cAAaD,EACb,aAAYE,EAEX,SAAAN,EACH,CAEJ,CAEA,MAAMb,KAAS,cAAWS,CAAO",
6
- "names": ["button_exports", "__export", "Button", "__toCommonJS", "import_jsx_runtime", "import_react_slot", "import_utils", "import_react", "import_react_aria", "import_cn", "import_button", "_Button", "props", "ref", "asChild", "children", "size", "mode", "variant", "roundness", "shape", "inset", "elementType", "fallbackEventTo", "event", "fallbackEventName", "anyProps", "onPress", "onClick", "onPressStart", "onPointerDown", "onHoverStart", "onPointerMove", "onHoverEnd", "onPointerLeave", "innerRef", "buttonProps", "isPressed", "focusProps", "isFocused", "isFocusVisible", "hoverProps", "isHovered"]
4
+ "sourcesContent": ["import React, { forwardRef, isValidElement, useRef } from 'react';\nimport { ButtonContext, useContextProps, type SlotProps } from 'react-aria-components';\nimport { filterDOMProps, mergeRefs } from '@react-aria/utils';\nimport { mergeProps, useButton, useFocusRing, useHover } from 'react-aria';\nimport { Slot } from '@radix-ui/react-slot';\nimport type { ElementType } from 'react';\nimport type { AriaButtonProps, HoverEvents } from 'react-aria';\n\nimport { button } from '../variants/button.js';\nimport { cn } from '../utils/cn.js';\nimport { fallbackEventTo } from '../utils/helpers.js';\nimport type { ButtonVariantProps } from '../variants/button.js';\n\nexport interface ButtonProps\n extends Omit<AriaButtonProps, 'elementType' | 'href' | 'target' | 'rel'>,\n SlotProps,\n HoverEvents,\n ButtonVariantProps {\n asChild?: boolean;\n}\n\nfunction _Button(props: ButtonProps, ref: React.ForwardedRef<HTMLButtonElement>) {\n [props, ref] = useContextProps(props, ref, ButtonContext);\n const { asChild, children, size, mode, variant, roundness, elevation, shape, inset } = props;\n let elementType = asChild\n ? (isValidElement(children) && (children?.type as ElementType)) || 'button'\n : 'button';\n\n const [onPress, onClick] = fallbackEventTo(props, 'onPress', 'onClick');\n const [onPressStart, onPointerDown] = fallbackEventTo(props, 'onPressStart', 'onPointerDown');\n const [onHoverStart, onPointerMove] = fallbackEventTo(props, 'onHoverStart', 'onPointerMove');\n const [onHoverEnd, onPointerLeave] = fallbackEventTo(props, 'onHoverEnd', 'onPointerLeave');\n const innerRef = useRef<HTMLButtonElement>(null);\n let { buttonProps, isPressed } = useButton(\n {\n ...props,\n elementType,\n onPress,\n onPressStart,\n // @ts-ignore\n onClick,\n // @ts-ignore\n onPointerDown,\n // @ts-ignore\n onPointerMove,\n // @ts-ignore\n onPointerLeave,\n },\n innerRef,\n );\n let { focusProps, isFocused, isFocusVisible } = useFocusRing(props);\n\n let { hoverProps, isHovered } = useHover({\n ...props,\n onHoverStart,\n onHoverEnd,\n });\n\n let Comp = asChild ? Slot : 'button';\n\n return (\n <Comp\n {...filterDOMProps(props)}\n {...mergeProps(buttonProps, focusProps, hoverProps)}\n slot={props.slot || undefined}\n ref={mergeRefs(ref, innerRef)}\n data-disabled={props.isDisabled || undefined}\n data-pressed={isPressed || undefined}\n data-hovered={isHovered || undefined}\n data-focused={isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}\n className={cn('dx', button({ size, mode, variant, roundness, elevation, shape }))}\n data-radius={roundness}\n data-shadow={elevation}\n data-inset={inset}\n >\n {children}\n </Comp>\n );\n}\n\nconst Button = forwardRef(_Button);\n\nexport { Button };\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,YAAAE,IAAA,eAAAC,EAAAH,GA6DI,IAAAI,EAAA,6BA7DJC,EAA0D,iBAC1DC,EAA+D,iCAC/DC,EAA0C,6BAC1CC,EAA8D,sBAC9DC,EAAqB,gCAIrBC,EAAuB,iCACvBC,EAAmB,0BACnBC,EAAgC,+BAWhC,SAASC,EAAQC,EA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EAAM,KAAAC,EAAM,QAAAC,EAAS,UAAAC,EAAW,UAAAC,EAAW,MAAAC,CAAM,CAAC,CAAC,EAChF,cAAaF,EACb,cAAaC,EACb,aAAYE,EAEX,SAAAP,EACH,CAEJ,CAEA,MAAMf,KAAS,cAAWW,CAAO",
6
+ "names": ["button_exports", "__export", "Button", "__toCommonJS", "import_jsx_runtime", "import_react", "import_react_aria_components", "import_utils", "import_react_aria", "import_react_slot", "import_button", "import_cn", "import_helpers", "_Button", "props", "ref", "asChild", "children", "size", "mode", "variant", "roundness", "elevation", "shape", "inset", "elementType", "onPress", "onClick", "onPressStart", "onPointerDown", "onHoverStart", "onPointerMove", "onHoverEnd", "onPointerLeave", "innerRef", "buttonProps", "isPressed", "focusProps", "isFocused", "isFocusVisible", "hoverProps", "isHovered"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var f=Object.create;var e=Object.defineProperty;var P=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var v=Object.getPrototypeOf,y=Object.prototype.hasOwnProperty;var N=(r,a)=>{for(var o in a)e(r,o,{get:a[o],enumerable:!0})},m=(r,a,o,s)=>{if(a&&typeof a=="object"||typeof a=="function")for(let t of u(a))!y.call(r,t)&&t!==o&&e(r,t,{get:()=>a[t],enumerable:!(s=P(a,t))||s.enumerable});return r};var H=(r,a,o)=>(o=r!=null?f(v(r)):{},m(a||!r||!r.__esModule?e(o,"default",{value:r,enumerable:!0}):o,r)),L=r=>m(e({},"__esModule",{value:!0}),r);var R={};N(R,{Card:()=>i});module.exports=L(R);var c=require("react/jsx-runtime"),M=H(require("react")),n=require("@radix-ui/react-slot"),d=require("../variants/card.js"),C=require("../utils/cn.js");const i=M.forwardRef((r,a)=>{const{asChild:o,className:s,spacing:t="medium",roundness:p,...l}=r;return(0,c.jsx)(o?n.Slot:"div",{ref:a,...l,className:(0,C.cn)("dr",(0,d.card)({className:s,spacing:t,roundness:p})),"data-radius":p,style:{"--padding":d.SPACING[t]}})});i.displayName="Card";
1
+ "use strict";var f=Object.create;var s=Object.defineProperty;var P=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var v=Object.getPrototypeOf,y=Object.prototype.hasOwnProperty;var N=(r,a)=>{for(var o in a)s(r,o,{get:a[o],enumerable:!0})},p=(r,a,o,e)=>{if(a&&typeof a=="object"||typeof a=="function")for(let t of u(a))!y.call(r,t)&&t!==o&&s(r,t,{get:()=>a[t],enumerable:!(e=P(a,t))||e.enumerable});return r};var x=(r,a,o)=>(o=r!=null?f(v(r)):{},p(a||!r||!r.__esModule?s(o,"default",{value:r,enumerable:!0}):o,r)),H=r=>p(s({},"__esModule",{value:!0}),r);var M={};N(M,{Card:()=>i});module.exports=H(M);var c=require("react/jsx-runtime"),L=x(require("react")),n=require("@radix-ui/react-slot"),d=require("../variants/card.js"),C=require("../utils/cn.js");const i=L.forwardRef((r,a)=>{const{asChild:o,className:e,spacing:t="medium",roundness:m="medium",...l}=r;return(0,c.jsx)(o?n.Slot:"div",{ref:a,...l,className:(0,C.cn)("dx",(0,d.card)({className:e,spacing:t,roundness:m})),"data-radius":m,style:{"--padding":d.SPACING[t]}})});i.displayName="Card";
2
2
  //# sourceMappingURL=card.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/card.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nimport { Slot } from '@radix-ui/react-slot';\n\nimport { SPACING, card } from '../variants/card.js';\nimport { cn } from '../utils/cn.js';\n\nimport type { CardVariantProps } from '../variants/card.js';\n\ninterface CardProps extends React.HTMLAttributes<HTMLDivElement>, CardVariantProps {\n asChild?: boolean;\n}\nconst Card = React.forwardRef<HTMLDivElement, CardProps>((props, ref) => {\n const { asChild, className, spacing = 'medium', roundness, ...rest } = props;\n const Comp = asChild ? Slot : 'div';\n return (\n <Comp\n ref={ref}\n {...rest}\n className={cn('dr', card({ className, spacing, roundness }))}\n data-radius={roundness}\n style={{\n // @ts-ignore\n '--padding': SPACING[spacing],\n }}\n />\n );\n});\n\nCard.displayName = 'Card';\n\nexport { Card };\nexport type { CardProps };\n"],
5
- "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,UAAAE,IAAA,eAAAC,EAAAH,GAeI,IAAAI,EAAA,6BAfJC,EAAuB,oBACvBC,EAAqB,gCAErBC,EAA8B,+BAC9BC,EAAmB,0BAOnB,MAAMN,EAAOG,EAAM,WAAsC,CAACI,EAAOC,IAAQ,CACvE,KAAM,CAAE,QAAAC,EAAS,UAAAC,EAAW,QAAAC,EAAU,SAAU,UAAAC,EAAW,GAAGC,CAAK,EAAIN,EAEvE,SACE,OAFWE,EAAU,OAAO,MAE3B,CACC,IAAKD,EACJ,GAAGK,EACJ,aAAW,MAAG,QAAM,QAAK,CAAE,UAAAH,EAAW,QAAAC,EAAS,UAAAC,CAAU,CAAC,CAAC,EAC3D,cAAaA,EACb,MAAO,CAEL,YAAa,UAAQD,CAAO,CAC9B,EACF,CAEJ,CAAC,EAEDX,EAAK,YAAc",
4
+ "sourcesContent": ["import * as React from 'react';\nimport { Slot } from '@radix-ui/react-slot';\n\nimport { SPACING, card } from '../variants/card.js';\nimport { cn } from '../utils/cn.js';\n\nimport type { CardVariantProps } from '../variants/card.js';\n\ninterface CardProps extends React.HTMLAttributes<HTMLDivElement>, CardVariantProps {\n asChild?: boolean;\n}\nconst Card = React.forwardRef<HTMLDivElement, CardProps>((props, ref) => {\n const { asChild, className, spacing = 'medium', roundness = 'medium', ...rest } = props;\n const Comp = asChild ? Slot : 'div';\n return (\n <Comp\n ref={ref}\n {...rest}\n className={cn('dx', card({ className, spacing, roundness }))}\n data-radius={roundness}\n style={{\n // @ts-ignore\n '--padding': SPACING[spacing],\n }}\n />\n );\n});\n\nCard.displayName = 'Card';\n\nexport { Card };\nexport type { CardProps };\n"],
5
+ "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,UAAAE,IAAA,eAAAC,EAAAH,GAeI,IAAAI,EAAA,6BAfJC,EAAuB,oBACvBC,EAAqB,gCAErBC,EAA8B,+BAC9BC,EAAmB,0BAOnB,MAAMN,EAAOG,EAAM,WAAsC,CAACI,EAAOC,IAAQ,CACvE,KAAM,CAAE,QAAAC,EAAS,UAAAC,EAAW,QAAAC,EAAU,SAAU,UAAAC,EAAY,SAAU,GAAGC,CAAK,EAAIN,EAElF,SACE,OAFWE,EAAU,OAAO,MAE3B,CACC,IAAKD,EACJ,GAAGK,EACJ,aAAW,MAAG,QAAM,QAAK,CAAE,UAAAH,EAAW,QAAAC,EAAS,UAAAC,CAAU,CAAC,CAAC,EAC3D,cAAaA,EACb,MAAO,CAEL,YAAa,UAAQD,CAAO,CAC9B,EACF,CAEJ,CAAC,EAEDX,EAAK,YAAc",
6
6
  "names": ["card_exports", "__export", "Card", "__toCommonJS", "import_jsx_runtime", "React", "import_react_slot", "import_card", "import_cn", "props", "ref", "asChild", "className", "spacing", "roundness", "rest"]
7
7
  }
@@ -0,0 +1,18 @@
1
+ import { type SlotProps, type ValidationResult } from 'react-aria-components';
2
+ import { type AriaCheckboxGroupProps, type AriaCheckboxProps, type HoverEvents } from 'react-aria';
3
+ import { type MutableRefObject, type ReactNode } from 'react';
4
+ import { type CheckboxVariantProps } from '../variants/index.js';
5
+ export interface CheckboxGroupProps extends Omit<AriaCheckboxGroupProps, 'validationState'>, CheckboxVariantProps, SlotProps {
6
+ placeholder?: string;
7
+ label?: string;
8
+ description?: string | ReactNode;
9
+ errorMessage?: string | ((validation: ValidationResult) => string);
10
+ children?: ReactNode;
11
+ }
12
+ export interface CheckboxProps extends Omit<AriaCheckboxProps, 'validationState'>, HoverEvents, SlotProps, CheckboxVariantProps {
13
+ inputRef?: MutableRefObject<HTMLInputElement>;
14
+ children?: ReactNode;
15
+ }
16
+ declare const Checkbox: import("react").ForwardRefExoticComponent<CheckboxProps & import("react").RefAttributes<HTMLLabelElement>>;
17
+ declare const CheckboxGroup: import("react").ForwardRefExoticComponent<CheckboxGroupProps & import("react").RefAttributes<HTMLDivElement>>;
18
+ export { Checkbox, CheckboxGroup };
@@ -0,0 +1,2 @@
1
+ "use strict";var y=Object.defineProperty;var D=Object.getOwnPropertyDescriptor;var L=Object.getOwnPropertyNames;var N=Object.prototype.hasOwnProperty;var j=(e,i)=>{for(var o in i)y(e,o,{get:i[o],enumerable:!0})},A=(e,i,o,t)=>{if(i&&typeof i=="object"||typeof i=="function")for(let r of L(i))!N.call(e,r)&&r!==o&&y(e,r,{get:()=>i[r],enumerable:!(t=D(i,r))||t.enumerable});return e};var z=e=>A(y({},"__esModule",{value:!0}),e);var K={};j(K,{Checkbox:()=>V,CheckboxGroup:()=>B});module.exports=z(K);var d=require("react/jsx-runtime"),a=require("react-aria-components"),n=require("react-aria"),m=require("react-stately"),s=require("@react-aria/utils"),c=require("react"),u=require("./text.js"),h=require("./flex.js"),F=require("../variants/field-error.js"),R=require("../utils/cn.js"),T=require("../variants/index.js");function _(e,i){[e,i]=(0,a.useContextProps)(e,i,a.CheckboxGroupContext);let{validationBehavior:o}=(0,a.useSlottedContext)(a.FormContext)||{},t=e.validationBehavior??o??"native",r=(0,m.useCheckboxGroupState)({...e,validationBehavior:t}),{groupProps:v,labelProps:x,descriptionProps:b,errorMessageProps:C,...l}=(0,n.useCheckboxGroup)({...e,validationBehavior:t},r);return(0,d.jsxs)(h.Flex,{...v,direction:"column",gap:2,ref:i,slot:e.slot||void 0,"data-readonly":r.isReadOnly||void 0,"data-required":e.isRequired||void 0,"data-invalid":r.isInvalid||void 0,"data-disabled":e.isDisabled||void 0,children:[e.label&&(0,d.jsx)(u.Text,{...x,size:1,transform:"uppercase",weight:"semibold",variant:"tertiary",color:"gray",children:e.label}),(0,d.jsx)(a.CheckboxGroupStateContext.Provider,{value:r,children:e.children}),l.isInvalid&&(0,d.jsx)(u.Text,{...C,size:1,className:(0,R.cn)("dx",(0,F.fieldError)({})),children:e.errorMessage?typeof e.errorMessage=="string"?e.errorMessage:e.errorMessage(l):l.validationErrors.length===0?void 0:l.validationErrors.join(" ")}),e.description&&(0,d.jsx)(u.Text,{size:1,variant:"tertiary",...b,children:e.description})]})}function J({size:e="medium",roundness:i="medium",elevation:o="medium",...t},r){let{inputRef:v=null,...x}=t;[t,r]=(0,a.useContextProps)(x,r,a.CheckboxContext);let{validationBehavior:b}=(0,a.useSlottedContext)(a.FormContext)||{},C=t.validationBehavior??b??"native",l=(0,c.useContext)(a.CheckboxGroupStateContext),g=(0,s.useObjectRef)((0,s.mergeRefs)(v,t.inputRef!==void 0?t.inputRef:null)),{labelProps:H,inputProps:I,isSelected:f,isDisabled:k,isReadOnly:P,isPressed:p,isInvalid:M}=l?(0,n.useCheckboxGroupItem)({...t,value:t.value,children:typeof t.children=="function"?!0:t.children},l,g):(0,n.useCheckbox)({...t,children:typeof t.children=="function"?!0:t.children,validationBehavior:C},(0,m.useToggleState)(t),g),{isFocused:w,isFocusVisible:G,focusProps:q}=(0,n.useFocusRing)(),E=k||P,{hoverProps:O,isHovered:S}=(0,n.useHover)({...t,isDisabled:E});return(0,d.jsx)(h.Flex,{asChild:!0,gap:2,children:(0,d.jsxs)(u.Text,{as:"label",...(0,n.mergeProps)((0,s.filterDOMProps)(t),H,O),color:"gray",variant:f?"primary":"secondary",ref:r,slot:t.slot||void 0,"data-selected":f||void 0,"data-indeterminate":t.isIndeterminate||void 0,"data-pressed":p||void 0,"data-hovered":S||void 0,"data-focused":w||void 0,"data-focus-visible":G||void 0,"data-disabled":k||void 0,"data-readonly":P||void 0,"data-invalid":M||void 0,"data-required":t.isRequired||void 0,size:{small:1,medium:2,large:3}[e],children:[(0,d.jsx)(n.VisuallyHidden,{elementType:"span",children:(0,d.jsx)("input",{...(0,n.mergeProps)(I,q),ref:g})}),(0,d.jsx)(h.Flex,{"data-radius":i,"data-elevation":o,"data-selected":f||void 0,"data-indeterminate":t.isIndeterminate||void 0,"data-pressed":p||void 0,"data-hovered":S||void 0,"data-focused":w||void 0,"data-focus-visible":G||void 0,"data-disabled":k||void 0,"data-readonly":P||void 0,"data-invalid":M||void 0,"data-required":t.isRequired||void 0,justify:"center",align:"center",className:(0,R.cn)("dx",(0,T.checkbox)({size:e,roundness:i})),children:f?(0,d.jsxs)("svg",{width:"24",height:"24",viewBox:"0 0 11 8",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,d.jsx)("path",{d:"M4.43968 6.18236L2.31836 4.06104",stroke:"currentColor","stroke-width":"2","stroke-miterlimit":"10","stroke-linecap":"square"}),(0,d.jsx)("path",{d:"M5.85419 4.76739L8.68262 1.93896",stroke:"currentColor","stroke-width":"2","stroke-miterlimit":"10","stroke-linecap":"square"})]}):null}),t.children]})})}const V=(0,c.forwardRef)(J),B=(0,c.forwardRef)(_);
2
+ //# sourceMappingURL=checkbox.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/components/checkbox.tsx"],
4
+ "sourcesContent": ["import {\n CheckboxContext,\n CheckboxGroupContext,\n CheckboxGroupStateContext,\n FormContext,\n useContextProps,\n useSlottedContext,\n type SlotProps,\n type ValidationResult,\n} from 'react-aria-components';\nimport {\n type AriaCheckboxGroupProps,\n type AriaCheckboxProps,\n type HoverEvents,\n mergeProps,\n useCheckbox,\n useCheckboxGroup,\n useCheckboxGroupItem,\n useFocusRing,\n useHover,\n VisuallyHidden,\n} from 'react-aria';\nimport { useCheckboxGroupState, useToggleState } from 'react-stately';\nimport { filterDOMProps, mergeRefs, useObjectRef } from '@react-aria/utils';\nimport {\n forwardRef,\n useContext,\n type ForwardedRef,\n type MutableRefObject,\n type ReactNode,\n} from 'react';\n\nimport { Text } from './text.js';\nimport { Flex } from './flex.js';\nimport { fieldError } from '../variants/field-error.js';\nimport { cn } from '../utils/cn.js';\nimport { checkbox, type CheckboxVariantProps } from '../variants/index.js';\n\nexport interface CheckboxGroupProps\n extends Omit<AriaCheckboxGroupProps, 'validationState'>,\n CheckboxVariantProps,\n SlotProps {\n placeholder?: string;\n label?: string;\n description?: string | ReactNode;\n errorMessage?: string | ((validation: ValidationResult) => string);\n children?: ReactNode;\n}\nexport interface CheckboxProps\n extends Omit<AriaCheckboxProps, 'validationState'>,\n HoverEvents,\n SlotProps,\n CheckboxVariantProps {\n inputRef?: MutableRefObject<HTMLInputElement>;\n children?: ReactNode;\n}\n\nfunction _CheckboxGroup(props: CheckboxGroupProps, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, CheckboxGroupContext);\n let { validationBehavior: formValidationBehavior } = useSlottedContext(FormContext) || {};\n let validationBehavior = props.validationBehavior ?? formValidationBehavior ?? 'native';\n let state = useCheckboxGroupState({\n ...props,\n validationBehavior,\n });\n\n let { groupProps, labelProps, descriptionProps, errorMessageProps, ...validation } =\n useCheckboxGroup(\n {\n ...props,\n validationBehavior,\n },\n state,\n );\n\n return (\n <Flex\n {...groupProps}\n direction=\"column\"\n gap={2}\n ref={ref}\n slot={props.slot || undefined}\n data-readonly={state.isReadOnly || undefined}\n data-required={props.isRequired || undefined}\n data-invalid={state.isInvalid || undefined}\n data-disabled={props.isDisabled || undefined}\n >\n {props.label && (\n <Text\n {...labelProps}\n size={1}\n transform=\"uppercase\"\n weight=\"semibold\"\n variant=\"tertiary\"\n color=\"gray\"\n >\n {props.label}\n </Text>\n )}\n <CheckboxGroupStateContext.Provider value={state}>\n {props.children}\n </CheckboxGroupStateContext.Provider>\n {validation.isInvalid && (\n <Text {...errorMessageProps} size={1} className={cn('dx', fieldError({}))}>\n {props.errorMessage\n ? typeof props.errorMessage === 'string'\n ? props.errorMessage\n : props.errorMessage(validation)\n : validation.validationErrors.length === 0\n ? undefined\n : validation.validationErrors.join(' ')}\n </Text>\n )}\n\n {props.description && (\n <Text size={1} variant=\"tertiary\" {...descriptionProps}>\n {props.description}\n </Text>\n )}\n </Flex>\n );\n}\n\nfunction _Checkbox(\n { size = 'medium', roundness = 'medium', elevation = 'medium', ...props }: CheckboxProps,\n ref: ForwardedRef<HTMLLabelElement>,\n) {\n let { inputRef: userProvidedInputRef = null, ...otherProps } = props;\n [props, ref] = useContextProps(otherProps, ref, CheckboxContext);\n let { validationBehavior: formValidationBehavior } = useSlottedContext(FormContext) || {};\n let validationBehavior = props.validationBehavior ?? formValidationBehavior ?? 'native';\n let groupState = useContext(CheckboxGroupStateContext);\n let inputRef = useObjectRef(\n mergeRefs(userProvidedInputRef, props.inputRef !== undefined ? props.inputRef : null),\n );\n let { labelProps, inputProps, isSelected, isDisabled, isReadOnly, isPressed, isInvalid } =\n groupState\n ? // eslint-disable-next-line react-hooks/rules-of-hooks\n useCheckboxGroupItem(\n {\n ...props,\n // Value is optional for standalone checkboxes, but required for CheckboxGroup items;\n // it's passed explicitly here to avoid typescript error (requires ignore).\n // @ts-ignore\n value: props.value,\n // ReactNode type doesn't allow function children.\n children: typeof props.children === 'function' ? true : props.children,\n },\n groupState,\n inputRef,\n )\n : // eslint-disable-next-line react-hooks/rules-of-hooks\n useCheckbox(\n {\n ...props,\n children: typeof props.children === 'function' ? true : props.children,\n validationBehavior,\n // eslint-disable-next-line react-hooks/rules-of-hooks\n },\n useToggleState(props),\n inputRef,\n );\n let { isFocused, isFocusVisible, focusProps } = useFocusRing();\n let isInteractionDisabled = isDisabled || isReadOnly;\n\n let { hoverProps, isHovered } = useHover({\n ...props,\n isDisabled: isInteractionDisabled,\n });\n\n return (\n <Flex asChild gap={2}>\n <Text\n as=\"label\"\n {...mergeProps(filterDOMProps(props), labelProps, hoverProps)}\n color=\"gray\"\n variant={isSelected ? 'primary' : 'secondary'}\n ref={ref}\n slot={props.slot || undefined}\n data-selected={isSelected || undefined}\n data-indeterminate={props.isIndeterminate || undefined}\n data-pressed={isPressed || undefined}\n data-hovered={isHovered || undefined}\n data-focused={isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-disabled={isDisabled || undefined}\n data-readonly={isReadOnly || undefined}\n data-invalid={isInvalid || undefined}\n data-required={props.isRequired || undefined}\n size={\n (\n {\n small: 1,\n medium: 2,\n large: 3,\n } as const\n )[size]\n }\n >\n <VisuallyHidden elementType=\"span\">\n <input {...mergeProps(inputProps, focusProps)} ref={inputRef} />\n </VisuallyHidden>\n <Flex\n data-radius={roundness}\n data-elevation={elevation}\n data-selected={isSelected || undefined}\n data-indeterminate={props.isIndeterminate || undefined}\n data-pressed={isPressed || undefined}\n data-hovered={isHovered || undefined}\n data-focused={isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-disabled={isDisabled || undefined}\n data-readonly={isReadOnly || undefined}\n data-invalid={isInvalid || undefined}\n data-required={props.isRequired || undefined}\n justify=\"center\"\n align=\"center\"\n className={cn('dx', checkbox({ size, roundness }))}\n >\n {isSelected ? (\n <svg\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 11 8\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M4.43968 6.18236L2.31836 4.06104\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-miterlimit=\"10\"\n stroke-linecap=\"square\"\n />\n <path\n d=\"M5.85419 4.76739L8.68262 1.93896\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-miterlimit=\"10\"\n stroke-linecap=\"square\"\n />\n </svg>\n ) : null}\n </Flex>\n {props.children}\n </Text>\n </Flex>\n );\n}\n\nconst Checkbox = forwardRef(_Checkbox);\n\nconst CheckboxGroup = forwardRef(_CheckboxGroup);\n\nexport { Checkbox, CheckboxGroup };\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,cAAAE,EAAA,kBAAAC,IAAA,eAAAC,EAAAJ,GA4EI,IAAAK,EAAA,6BA5EJC,EASO,iCACPC,EAWO,sBACPC,EAAsD,yBACtDC,EAAwD,6BACxDC,EAMO,iBAEPC,EAAqB,qBACrBC,EAAqB,qBACrBC,EAA2B,sCAC3BC,EAAmB,0BACnBC,EAAoD,gCAqBpD,SAASC,EAAeC,EAA2BC,EAAmC,CACpF,CAACD,EAAOC,CAAG,KAAI,mBAAgBD,EA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AM,YAAc,OACnC,KAEI,CACE,MAAO,EACP,OAAQ,EACR,MAAO,CACT,EACAW,CAAI,EAGR,oBAAC,kBAAe,YAAY,OAC1B,mBAAC,SAAO,MAAG,cAAWO,EAAYQ,CAAU,EAAG,IAAKT,EAAU,EAChE,KACA,OAAC,QACC,cAAaL,EACb,iBAAgBC,EAChB,gBAAeM,GAAc,OAC7B,qBAAoBnB,EAAM,iBAAmB,OAC7C,eAAcsB,GAAa,OAC3B,eAAcO,GAAa,OAC3B,eAAcL,GAAa,OAC3B,qBAAoBC,GAAkB,OACtC,gBAAeL,GAAc,OAC7B,gBAAeC,GAAc,OAC7B,eAAcE,GAAa,OAC3B,gBAAevB,EAAM,YAAc,OACnC,QAAQ,SACR,MAAM,SACN,aAAW,MAAG,QAAM,YAAS,CAAE,KAAAW,EAAM,UAAAC,CAAU,CAAC,CAAC,EAEhD,SAAAO,KACC,QAAC,OACC,MAAM,KACN,OAAO,KACP,QAAQ,WACR,KAAK,OACL,MAAM,6BAEN,oBAAC,QACC,EAAE,mCACF,OAAO,eACP,eAAa,IACb,oBAAkB,KAClB,iBAAe,SACjB,KACA,OAAC,QACC,EAAE,mCACF,OAAO,eACP,eAAa,IACb,oBAAkB,KAClB,iBAAe,SACjB,GACF,EACE,KACN,EACCnB,EAAM,UACT,EACF,CAEJ,CAEA,MAAMf,KAAW,cAAWyB,CAAS,EAE/BxB,KAAgB,cAAWa,CAAc",
6
+ "names": ["checkbox_exports", "__export", "Checkbox", "CheckboxGroup", "__toCommonJS", "import_jsx_runtime", "import_react_aria_components", "import_react_aria", "import_react_stately", "import_utils", "import_react", "import_text", "import_flex", "import_field_error", "import_cn", "import_variants", "_CheckboxGroup", "props", "ref", "formValidationBehavior", "validationBehavior", "state", "groupProps", "labelProps", "descriptionProps", "errorMessageProps", "validation", "_Checkbox", "size", "roundness", "elevation", "userProvidedInputRef", "otherProps", "groupState", "inputRef", "inputProps", "isSelected", "isDisabled", "isReadOnly", "isPressed", "isInvalid", "isFocused", "isFocusVisible", "focusProps", "isInteractionDisabled", "hoverProps", "isHovered"]
7
+ }
@@ -2,8 +2,10 @@ import React from 'react';
2
2
  import type { VariantProps } from 'tailwind-variants';
3
3
  declare const flexVariants: import("tailwind-variants").TVReturnType<{
4
4
  direction: {
5
- column: string[];
6
- row: string[];
5
+ column: string;
6
+ row: string;
7
+ 'column-reverse': string;
8
+ 'row-reverse': string;
7
9
  };
8
10
  gap: {
9
11
  1: string;
@@ -22,46 +24,24 @@ declare const flexVariants: import("tailwind-variants").TVReturnType<{
22
24
  32: string;
23
25
  };
24
26
  justify: {
25
- center: string;
26
- between: string;
27
- };
28
- align: {
29
27
  baseline: string;
30
28
  center: string;
31
- };
32
- }, undefined, "flex", import("tailwind-variants/dist/config.js").TVConfig<{
33
- direction: {
34
- column: string[];
35
- row: string[];
36
- };
37
- gap: {
38
- 1: string;
39
- 2: string;
40
- 3: string;
41
- 4: string;
42
- 6: string;
43
- 8: string;
44
- 10: string;
45
- 12: string;
46
- 14: string;
47
- 16: string;
48
- 18: string;
49
- 24: string;
50
- 28: string;
51
- 32: string;
52
- };
53
- justify: {
54
- center: string;
55
29
  between: string;
30
+ start: string;
31
+ end: string;
56
32
  };
57
33
  align: {
58
34
  baseline: string;
59
35
  center: string;
36
+ start: string;
37
+ end: string;
60
38
  };
61
- }, {
39
+ }, undefined, "flex", {
62
40
  direction: {
63
- column: string[];
64
- row: string[];
41
+ column: string;
42
+ row: string;
43
+ 'column-reverse': string;
44
+ 'row-reverse': string;
65
45
  };
66
46
  gap: {
67
47
  1: string;
@@ -80,17 +60,24 @@ declare const flexVariants: import("tailwind-variants").TVReturnType<{
80
60
  32: string;
81
61
  };
82
62
  justify: {
63
+ baseline: string;
83
64
  center: string;
84
65
  between: string;
66
+ start: string;
67
+ end: string;
85
68
  };
86
69
  align: {
87
70
  baseline: string;
88
71
  center: string;
72
+ start: string;
73
+ end: string;
89
74
  };
90
- }>, {
75
+ }, undefined, import("tailwind-variants").TVReturnType<{
91
76
  direction: {
92
- column: string[];
93
- row: string[];
77
+ column: string;
78
+ row: string;
79
+ 'column-reverse': string;
80
+ 'row-reverse': string;
94
81
  };
95
82
  gap: {
96
83
  1: string;
@@ -109,17 +96,28 @@ declare const flexVariants: import("tailwind-variants").TVReturnType<{
109
96
  32: string;
110
97
  };
111
98
  justify: {
99
+ baseline: string;
112
100
  center: string;
113
101
  between: string;
102
+ start: string;
103
+ end: string;
114
104
  };
115
105
  align: {
116
106
  baseline: string;
117
107
  center: string;
118
- };
119
- }, undefined, import("tailwind-variants").TVReturnType<{
108
+ start: string;
109
+ end: string;
110
+ };
111
+ }, undefined, "flex", unknown, unknown, undefined>>;
112
+ type FlexProps = VariantProps<typeof flexVariants> & {
113
+ asChild?: boolean;
114
+ };
115
+ declare const Flex: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & VariantProps<import("tailwind-variants").TVReturnType<{
120
116
  direction: {
121
- column: string[];
122
- row: string[];
117
+ column: string;
118
+ row: string;
119
+ 'column-reverse': string;
120
+ 'row-reverse': string;
123
121
  };
124
122
  gap: {
125
123
  1: string;
@@ -138,17 +136,24 @@ declare const flexVariants: import("tailwind-variants").TVReturnType<{
138
136
  32: string;
139
137
  };
140
138
  justify: {
139
+ baseline: string;
141
140
  center: string;
142
141
  between: string;
142
+ start: string;
143
+ end: string;
143
144
  };
144
145
  align: {
145
146
  baseline: string;
146
147
  center: string;
148
+ start: string;
149
+ end: string;
147
150
  };
148
- }, undefined, "flex", import("tailwind-variants/dist/config.js").TVConfig<{
151
+ }, undefined, "flex", {
149
152
  direction: {
150
- column: string[];
151
- row: string[];
153
+ column: string;
154
+ row: string;
155
+ 'column-reverse': string;
156
+ 'row-reverse': string;
152
157
  };
153
158
  gap: {
154
159
  1: string;
@@ -167,17 +172,24 @@ declare const flexVariants: import("tailwind-variants").TVReturnType<{
167
172
  32: string;
168
173
  };
169
174
  justify: {
175
+ baseline: string;
170
176
  center: string;
171
177
  between: string;
178
+ start: string;
179
+ end: string;
172
180
  };
173
181
  align: {
174
182
  baseline: string;
175
183
  center: string;
184
+ start: string;
185
+ end: string;
176
186
  };
177
- }, {
187
+ }, undefined, import("tailwind-variants").TVReturnType<{
178
188
  direction: {
179
- column: string[];
180
- row: string[];
189
+ column: string;
190
+ row: string;
191
+ 'column-reverse': string;
192
+ 'row-reverse': string;
181
193
  };
182
194
  gap: {
183
195
  1: string;
@@ -196,15 +208,20 @@ declare const flexVariants: import("tailwind-variants").TVReturnType<{
196
208
  32: string;
197
209
  };
198
210
  justify: {
211
+ baseline: string;
199
212
  center: string;
200
213
  between: string;
214
+ start: string;
215
+ end: string;
201
216
  };
202
217
  align: {
203
218
  baseline: string;
204
219
  center: string;
220
+ start: string;
221
+ end: string;
205
222
  };
206
- }>, unknown, unknown, undefined>>;
207
- type FlexProps = VariantProps<typeof flexVariants>;
208
- declare const Flex: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & FlexProps & React.RefAttributes<HTMLDivElement>>;
223
+ }, undefined, "flex", unknown, unknown, undefined>>> & {
224
+ asChild?: boolean;
225
+ } & React.RefAttributes<HTMLDivElement>>;
209
226
  export type { FlexProps };
210
227
  export { Flex };
@@ -1,2 +1,2 @@
1
- "use strict";var y=Object.create;var i=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var d=Object.getOwnPropertyNames;var u=Object.getPrototypeOf,v=Object.prototype.hasOwnProperty;var w=(e,a)=>{for(var t in a)i(e,t,{get:a[t],enumerable:!0})},n=(e,a,t,p)=>{if(a&&typeof a=="object"||typeof a=="function")for(let r of d(a))!v.call(e,r)&&r!==t&&i(e,r,{get:()=>a[r],enumerable:!(p=b(a,r))||p.enumerable});return e};var F=(e,a,t)=>(t=e!=null?y(u(e)):{},n(a||!e||!e.__esModule?i(t,"default",{value:e,enumerable:!0}):t,e)),P=e=>n(i({},"__esModule",{value:!0}),e);var j={};w(j,{Flex:()=>s});module.exports=P(j);var f=require("react/jsx-runtime"),o=F(require("react")),l=require("tailwind-variants"),g=require("../utils/cn.js");const V=(0,l.tv)({base:"flex",variants:{direction:{column:["flex-col"],row:["flex-row"]},gap:{1:"gap-1",2:"gap-2",3:"gap-3",4:"gap-4",6:"gap-6",8:"gap-8",10:"gap-10",12:"gap-12",14:"gap-14",16:"gap-16",18:"gap-18",24:"gap-24",28:"gap-28",32:"gap-32"},justify:{center:"justify-center",between:"justify-between"},align:{baseline:"items-baseline",center:"items-center"}}}),s=o.default.forwardRef((e,a)=>{const{className:t,direction:p,gap:r,justify:c,align:m,...x}=e;return(0,f.jsx)("div",{className:(0,g.cn)(V({direction:p,gap:r,justify:c,align:m}),t),ref:a,...x})});s.displayName="Flex";
1
+ "use strict";var y=Object.create;var i=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var v=Object.getOwnPropertyNames;var b=Object.getPrototypeOf,w=Object.prototype.hasOwnProperty;var j=(e,t)=>{for(var a in t)i(e,a,{get:t[a],enumerable:!0})},n=(e,t,a,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of v(t))!w.call(e,r)&&r!==a&&i(e,r,{get:()=>t[r],enumerable:!(s=u(t,r))||s.enumerable});return e};var F=(e,t,a)=>(a=e!=null?y(b(e)):{},n(t||!e||!e.__esModule?i(a,"default",{value:e,enumerable:!0}):a,e)),P=e=>n(i({},"__esModule",{value:!0}),e);var V={};j(V,{Flex:()=>o});module.exports=P(V);var m=require("react/jsx-runtime"),p=F(require("react")),l=require("tailwind-variants"),f=require("@radix-ui/react-slot"),M=require("../utils/cn.js");const C=(0,l.tv)({base:"flex",variants:{direction:{column:"flex-col",row:"flex-row","column-reverse":"flex-col-reverse","row-reverse":"flex-row-reverse"},gap:{1:"gap-1",2:"gap-2",3:"gap-3",4:"gap-4",6:"gap-6",8:"gap-8",10:"gap-10",12:"gap-12",14:"gap-14",16:"gap-16",18:"gap-18",24:"gap-24",28:"gap-28",32:"gap-32"},justify:{baseline:"justify-baseline",center:"justify-center",between:"justify-between",start:"justify-start",end:"justify-end"},align:{baseline:"items-baseline",center:"items-center",start:"items-start",end:"items-end"}}}),o=p.default.forwardRef((e,t)=>{const{className:a,direction:s,gap:r,justify:c,align:g,asChild:x,...d}=e;return(0,m.jsx)(x?f.Slot:"div",{className:C({direction:s,gap:r,justify:c,align:g,className:a}),ref:t,...d})});o.displayName="Flex";
2
2
  //# sourceMappingURL=flex.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/flex.tsx"],
4
- "sourcesContent": ["import React from 'react';\nimport { tv } from 'tailwind-variants';\n\nimport { cn } from '../utils/cn.js';\n\nimport type { VariantProps } from 'tailwind-variants';\n\nconst flexVariants = tv({\n base: 'flex',\n variants: {\n direction: {\n column: ['flex-col'],\n row: ['flex-row'],\n },\n gap: {\n 1: 'gap-1',\n 2: 'gap-2',\n 3: 'gap-3',\n 4: 'gap-4',\n 6: 'gap-6',\n 8: 'gap-8',\n 10: 'gap-10',\n 12: 'gap-12',\n 14: 'gap-14',\n 16: 'gap-16',\n 18: 'gap-18',\n 24: 'gap-24',\n 28: 'gap-28',\n 32: 'gap-32',\n },\n justify: {\n center: 'justify-center',\n between: 'justify-between',\n },\n align: {\n baseline: 'items-baseline',\n center: 'items-center',\n },\n },\n});\n\ntype FlexProps = VariantProps<typeof flexVariants>;\n\nconst Flex = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement> & FlexProps>(\n (props, ref) => {\n const { className, direction, gap, justify, align, ...rest } = props;\n\n return (\n <div\n className={cn(flexVariants({ direction, gap, justify, align }), className)}\n ref={ref}\n {...rest}\n />\n );\n },\n);\n\nFlex.displayName = 'Flex';\n\nexport type { FlexProps };\nexport { Flex };\n"],
5
- "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,UAAAE,IAAA,eAAAC,EAAAH,GAgDM,IAAAI,EAAA,6BAhDNC,EAAkB,oBAClBC,EAAmB,6BAEnBC,EAAmB,0BAInB,MAAMC,KAAe,MAAG,CACtB,KAAM,OACN,SAAU,CACR,UAAW,CACT,OAAQ,CAAC,UAAU,EACnB,IAAK,CAAC,UAAU,CAClB,EACA,IAAK,CACH,EAAG,QACH,EAAG,QACH,EAAG,QACH,EAAG,QACH,EAAG,QACH,EAAG,QACH,GAAI,SACJ,GAAI,SACJ,GAAI,SACJ,GAAI,SACJ,GAAI,SACJ,GAAI,SACJ,GAAI,SACJ,GAAI,QACN,EACA,QAAS,CACP,OAAQ,iBACR,QAAS,iBACX,EACA,MAAO,CACL,SAAU,iBACV,OAAQ,cACV,CACF,CACF,CAAC,EAIKN,EAAO,EAAAO,QAAM,WACjB,CAACC,EAAOC,IAAQ,CACd,KAAM,CAAE,UAAAC,EAAW,UAAAC,EAAW,IAAAC,EAAK,QAAAC,EAAS,MAAAC,EAAO,GAAGC,CAAK,EAAIP,EAE/D,SACE,OAAC,OACC,aAAW,MAAGF,EAAa,CAAE,UAAAK,EAAW,IAAAC,EAAK,QAAAC,EAAS,MAAAC,CAAM,CAAC,EAAGJ,CAAS,EACzE,IAAKD,EACJ,GAAGM,EACN,CAEJ,CACF,EAEAf,EAAK,YAAc",
6
- "names": ["flex_exports", "__export", "Flex", "__toCommonJS", "import_jsx_runtime", "import_react", "import_tailwind_variants", "import_cn", "flexVariants", "React", "props", "ref", "className", "direction", "gap", "justify", "align", "rest"]
4
+ "sourcesContent": ["import React from 'react';\nimport { tv } from 'tailwind-variants';\nimport { Slot } from '@radix-ui/react-slot';\n\nimport { cn } from '../utils/cn.js';\n\nimport type { VariantProps } from 'tailwind-variants';\n\nconst flexVariants = tv({\n base: 'flex',\n variants: {\n direction: {\n column: 'flex-col',\n row: 'flex-row',\n 'column-reverse': 'flex-col-reverse',\n 'row-reverse': 'flex-row-reverse',\n },\n gap: {\n 1: 'gap-1',\n 2: 'gap-2',\n 3: 'gap-3',\n 4: 'gap-4',\n 6: 'gap-6',\n 8: 'gap-8',\n 10: 'gap-10',\n 12: 'gap-12',\n 14: 'gap-14',\n 16: 'gap-16',\n 18: 'gap-18',\n 24: 'gap-24',\n 28: 'gap-28',\n 32: 'gap-32',\n },\n justify: {\n baseline: 'justify-baseline',\n center: 'justify-center',\n between: 'justify-between',\n start: 'justify-start',\n end: 'justify-end',\n },\n align: {\n baseline: 'items-baseline',\n center: 'items-center',\n start: 'items-start',\n end: 'items-end',\n },\n },\n});\n\ntype FlexProps = VariantProps<typeof flexVariants> & {\n asChild?: boolean;\n};\n\nconst Flex = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement> & FlexProps>(\n (props, ref) => {\n const { className, direction, gap, justify, align, asChild, ...rest } = props;\n const Comp = asChild ? Slot : 'div';\n return (\n <Comp\n className={flexVariants({ direction, gap, justify, align, className })}\n ref={ref}\n {...rest}\n />\n );\n },\n);\n\nFlex.displayName = 'Flex';\n\nexport type { FlexProps };\nexport { Flex };\n"],
5
+ "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,UAAAE,IAAA,eAAAC,EAAAH,GA0DM,IAAAI,EAAA,6BA1DNC,EAAkB,oBAClBC,EAAmB,6BACnBC,EAAqB,gCAErBC,EAAmB,0BAInB,MAAMC,KAAe,MAAG,CACtB,KAAM,OACN,SAAU,CACR,UAAW,CACT,OAAQ,WACR,IAAK,WACL,iBAAkB,mBAClB,cAAe,kBACjB,EACA,IAAK,CACH,EAAG,QACH,EAAG,QACH,EAAG,QACH,EAAG,QACH,EAAG,QACH,EAAG,QACH,GAAI,SACJ,GAAI,SACJ,GAAI,SACJ,GAAI,SACJ,GAAI,SACJ,GAAI,SACJ,GAAI,SACJ,GAAI,QACN,EACA,QAAS,CACP,SAAU,mBACV,OAAQ,iBACR,QAAS,kBACT,MAAO,gBACP,IAAK,aACP,EACA,MAAO,CACL,SAAU,iBACV,OAAQ,eACR,MAAO,cACP,IAAK,WACP,CACF,CACF,CAAC,EAMKP,EAAO,EAAAQ,QAAM,WACjB,CAACC,EAAOC,IAAQ,CACd,KAAM,CAAE,UAAAC,EAAW,UAAAC,EAAW,IAAAC,EAAK,QAAAC,EAAS,MAAAC,EAAO,QAAAC,EAAS,GAAGC,CAAK,EAAIR,EAExE,SACE,OAFWO,EAAU,OAAO,MAE3B,CACC,UAAWT,EAAa,CAAE,UAAAK,EAAW,IAAAC,EAAK,QAAAC,EAAS,MAAAC,EAAO,UAAAJ,CAAU,CAAC,EACrE,IAAKD,EACJ,GAAGO,EACN,CAEJ,CACF,EAEAjB,EAAK,YAAc",
6
+ "names": ["flex_exports", "__export", "Flex", "__toCommonJS", "import_jsx_runtime", "import_react", "import_tailwind_variants", "import_react_slot", "import_cn", "flexVariants", "React", "props", "ref", "className", "direction", "gap", "justify", "align", "asChild", "rest"]
7
7
  }
@@ -0,0 +1,11 @@
1
+ import type { FormProps as _FormProps } from '@react-types/form';
2
+ import type { CSSProperties, ReactNode } from 'react';
3
+ import type { DOMProps } from '@react-types/shared';
4
+ export interface FormProps extends _FormProps, DOMProps {
5
+ className?: string;
6
+ style?: CSSProperties;
7
+ children?: ReactNode;
8
+ noValidate?: boolean;
9
+ }
10
+ declare const Form: import("react").ForwardRefExoticComponent<FormProps & import("react").RefAttributes<HTMLFormElement>>;
11
+ export { Form };
@@ -0,0 +1,2 @@
1
+ "use strict";var i=Object.defineProperty;var f=Object.getOwnPropertyDescriptor;var F=Object.getOwnPropertyNames;var P=Object.prototype.hasOwnProperty;var c=(o,r)=>{for(var t in r)i(o,t,{get:r[t],enumerable:!0})},v=(o,r,t,a)=>{if(r&&typeof r=="object"||typeof r=="function")for(let e of F(r))!P.call(o,e)&&e!==t&&i(o,e,{get:()=>r[e],enumerable:!(a=f(r,e))||a.enumerable});return o};var x=o=>v(i({},"__esModule",{value:!0}),o);var C={};c(C,{Form:()=>p});module.exports=x(C);var m=require("react/jsx-runtime"),s=require("react-aria-components"),d=require("react-stately"),n=require("react");function y(o,r){let{validationErrors:t,children:a,className:e,...l}=o;return(0,m.jsx)("form",{...l,ref:r,className:e,children:(0,m.jsx)(s.FormContext.Provider,{value:{validationBehavior:o.noValidate?"aria":"native"},children:(0,m.jsx)(d.FormValidationContext.Provider,{value:t??{},children:a})})})}const p=(0,n.forwardRef)(y);
2
+ //# sourceMappingURL=form.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/components/form.tsx"],
4
+ "sourcesContent": ["import { FormContext } from 'react-aria-components';\nimport { FormValidationContext } from 'react-stately';\nimport { forwardRef } from 'react';\n\nimport type { FormProps as _FormProps } from '@react-types/form';\nimport type { CSSProperties, ForwardedRef, ReactNode } from 'react';\nimport type { DOMProps } from '@react-types/shared';\n\nexport interface FormProps extends _FormProps, DOMProps {\n className?: string;\n style?: CSSProperties;\n children?: ReactNode;\n noValidate?: boolean;\n}\n\nfunction _Form(props: FormProps, ref: ForwardedRef<HTMLFormElement>) {\n let { validationErrors, children, className, ...domProps } = props;\n return (\n <form {...domProps} ref={ref} className={className}>\n <FormContext.Provider value={{ validationBehavior: props.noValidate ? 'aria' : 'native' }}>\n <FormValidationContext.Provider value={validationErrors ?? {}}>\n {children}\n </FormValidationContext.Provider>\n </FormContext.Provider>\n </form>\n );\n}\n\nconst Form = forwardRef(_Form);\nexport { Form };\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,UAAAE,IAAA,eAAAC,EAAAH,GAoBQ,IAAAI,EAAA,6BApBRC,EAA4B,iCAC5BC,EAAsC,yBACtCC,EAA2B,iBAa3B,SAASC,EAAMC,EAAkBC,EAAoC,CACnE,GAAI,CAAE,iBAAAC,EAAkB,SAAAC,EAAU,UAAAC,EAAW,GAAGC,CAAS,EAAIL,EAC7D,SACE,OAAC,QAAM,GAAGK,EAAU,IAAKJ,EAAK,UAAWG,EACvC,mBAAC,cAAY,SAAZ,CAAqB,MAAO,CAAE,mBAAoBJ,EAAM,WAAa,OAAS,QAAS,EACtF,mBAAC,wBAAsB,SAAtB,CAA+B,MAAOE,GAAoB,CAAC,EACzD,SAAAC,EACH,EACF,EACF,CAEJ,CAEA,MAAMV,KAAO,cAAWM,CAAK",
6
+ "names": ["form_exports", "__export", "Form", "__toCommonJS", "import_jsx_runtime", "import_react_aria_components", "import_react_stately", "import_react", "_Form", "props", "ref", "validationErrors", "children", "className", "domProps"]
7
+ }
@@ -1,11 +1,16 @@
1
1
  export * from './button.js';
2
2
  export * from './card.js';
3
+ export * from './checkbox.js';
3
4
  export * from './flex.js';
5
+ export * from './form.js';
4
6
  export * from './heading.js';
5
7
  export * from './icon-button.js';
8
+ export * from './link.js';
9
+ export * from './number-field.js';
6
10
  export * as Popover from './popover.js';
7
11
  export * from './toast.js';
8
12
  export * from './text.js';
13
+ export * from './text-area.js';
9
14
  export * from './text-field.js';
10
15
  export * from './theme.js';
11
16
  export * as Tooltip from './tooltip.js';
@@ -1,2 +1,2 @@
1
- "use strict";var i=Object.create;var x=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var v=Object.getOwnPropertyNames;var P=Object.getPrototypeOf,T=Object.prototype.hasOwnProperty;var b=(p,e)=>{for(var t in e)x(p,t,{get:e[t],enumerable:!0})},m=(p,e,t,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let f of v(e))!T.call(p,f)&&f!==t&&x(p,f,{get:()=>e[f],enumerable:!(a=l(e,f))||a.enumerable});return p},r=(p,e,t)=>(m(p,e,"default"),t&&m(t,e,"default")),s=(p,e,t)=>(t=p!=null?i(P(p)):{},m(e||!p||!p.__esModule?x(t,"default",{value:p,enumerable:!0}):t,p)),c=p=>m(x({},"__esModule",{value:!0}),p);var o={};b(o,{Popover:()=>d,Tooltip:()=>g});module.exports=c(o);r(o,require("./button.js"),module.exports);r(o,require("./card.js"),module.exports);r(o,require("./flex.js"),module.exports);r(o,require("./heading.js"),module.exports);r(o,require("./icon-button.js"),module.exports);var d=s(require("./popover.js"));r(o,require("./toast.js"),module.exports);r(o,require("./text.js"),module.exports);r(o,require("./text-field.js"),module.exports);r(o,require("./theme.js"),module.exports);var g=s(require("./tooltip.js"));
1
+ "use strict";var i=Object.create;var x=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var v=Object.getOwnPropertyNames;var P=Object.getPrototypeOf,T=Object.prototype.hasOwnProperty;var b=(p,e)=>{for(var t in e)x(p,t,{get:e[t],enumerable:!0})},m=(p,e,t,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let f of v(e))!T.call(p,f)&&f!==t&&x(p,f,{get:()=>e[f],enumerable:!(a=l(e,f))||a.enumerable});return p},r=(p,e,t)=>(m(p,e,"default"),t&&m(t,e,"default")),s=(p,e,t)=>(t=p!=null?i(P(p)):{},m(e||!p||!p.__esModule?x(t,"default",{value:p,enumerable:!0}):t,p)),c=p=>m(x({},"__esModule",{value:!0}),p);var o={};b(o,{Popover:()=>d,Tooltip:()=>g});module.exports=c(o);r(o,require("./button.js"),module.exports);r(o,require("./card.js"),module.exports);r(o,require("./checkbox.js"),module.exports);r(o,require("./flex.js"),module.exports);r(o,require("./form.js"),module.exports);r(o,require("./heading.js"),module.exports);r(o,require("./icon-button.js"),module.exports);r(o,require("./link.js"),module.exports);r(o,require("./number-field.js"),module.exports);var d=s(require("./popover.js"));r(o,require("./toast.js"),module.exports);r(o,require("./text.js"),module.exports);r(o,require("./text-area.js"),module.exports);r(o,require("./text-field.js"),module.exports);r(o,require("./theme.js"),module.exports);var g=s(require("./tooltip.js"));
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/index.ts"],
4
- "sourcesContent": ["export * from './button.js';\nexport * from './card.js';\nexport * from './flex.js';\nexport * from './heading.js';\nexport * from './icon-button.js';\nexport * as Popover from './popover.js';\nexport * from './toast.js';\nexport * from './text.js';\nexport * from './text-field.js';\nexport * from './theme.js';\nexport * as Tooltip from './tooltip.js';\n"],
5
- "mappings": "wmBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,EAAA,YAAAC,IAAA,eAAAC,EAAAJ,GAAAK,EAAAL,EAAc,uBAAd,gBACAK,EAAAL,EAAc,qBADd,gBAEAK,EAAAL,EAAc,qBAFd,gBAGAK,EAAAL,EAAc,wBAHd,gBAIAK,EAAAL,EAAc,4BAJd,gBAKA,IAAAE,EAAyB,2BACzBG,EAAAL,EAAc,sBANd,gBAOAK,EAAAL,EAAc,qBAPd,gBAQAK,EAAAL,EAAc,2BARd,gBASAK,EAAAL,EAAc,sBATd,gBAUA,IAAAG,EAAyB",
4
+ "sourcesContent": ["export * from './button.js';\nexport * from './card.js';\nexport * from './checkbox.js';\nexport * from './flex.js';\nexport * from './form.js';\nexport * from './heading.js';\nexport * from './icon-button.js';\nexport * from './link.js';\nexport * from './number-field.js';\nexport * as Popover from './popover.js';\nexport * from './toast.js';\nexport * from './text.js';\nexport * from './text-area.js';\nexport * from './text-field.js';\nexport * from './theme.js';\nexport * as Tooltip from './tooltip.js';\n"],
5
+ "mappings": "wmBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,EAAA,YAAAC,IAAA,eAAAC,EAAAJ,GAAAK,EAAAL,EAAc,uBAAd,gBACAK,EAAAL,EAAc,qBADd,gBAEAK,EAAAL,EAAc,yBAFd,gBAGAK,EAAAL,EAAc,qBAHd,gBAIAK,EAAAL,EAAc,qBAJd,gBAKAK,EAAAL,EAAc,wBALd,gBAMAK,EAAAL,EAAc,4BANd,gBAOAK,EAAAL,EAAc,qBAPd,gBAQAK,EAAAL,EAAc,6BARd,gBASA,IAAAE,EAAyB,2BACzBG,EAAAL,EAAc,sBAVd,gBAWAK,EAAAL,EAAc,qBAXd,gBAYAK,EAAAL,EAAc,0BAZd,gBAaAK,EAAAL,EAAc,2BAbd,gBAcAK,EAAAL,EAAc,sBAdd,gBAeA,IAAAG,EAAyB",
6
6
  "names": ["components_exports", "__export", "Popover", "Tooltip", "__toCommonJS", "__reExport"]
7
7
  }
@@ -0,0 +1,10 @@
1
+ import { type SlotProps } from 'react-aria-components';
2
+ import { type ReactNode } from 'react';
3
+ import type { AriaLinkOptions, HoverEvents } from 'react-aria';
4
+ import { type LinkVariantProps } from '../variants/index.js';
5
+ export interface LinkProps extends Omit<AriaLinkOptions, 'elementType'>, SlotProps, HoverEvents, LinkVariantProps {
6
+ asChild?: boolean;
7
+ children?: ReactNode;
8
+ }
9
+ declare const Link: import("react").ForwardRefExoticComponent<LinkProps & import("react").RefAttributes<HTMLAnchorElement>>;
10
+ export { Link };
@@ -0,0 +1,2 @@
1
+ "use strict";var m=Object.defineProperty;var _=Object.getOwnPropertyDescriptor;var q=Object.getOwnPropertyNames;var B=Object.prototype.hasOwnProperty;var G=(e,n)=>{for(var t in n)m(e,t,{get:n[t],enumerable:!0})},I=(e,n,t,a)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of q(n))!B.call(e,i)&&i!==t&&m(e,i,{get:()=>n[i],enumerable:!(a=_(n,i))||a.enumerable});return e};var J=e=>I(m({},"__esModule",{value:!0}),e);var Q={};G(Q,{Link:()=>v});module.exports=J(Q);var k=require("react/jsx-runtime"),r=require("react-aria-components"),d=require("@react-aria/utils"),l=require("react"),o=require("react-aria"),f=require("@radix-ui/react-slot"),u=require("react"),P=require("../variants/index.js"),s=require("../utils/helpers.js");function K(e,n){[e,n]=(0,r.useContextProps)(e,n,r.TextContext),[e,n]=(0,r.useContextProps)(e,n,r.LinkContext);const{asChild:t,children:a,size:i,align:L,color:y,variant:p,weight:C,transform:E,underline:H}=e;let h=t&&(0,l.isValidElement)(a)&&a?.type||"a";const[R,T]=(0,s.fallbackEventTo)(e,"onPress","onClick"),[S,b]=(0,s.fallbackEventTo)(e,"onPressStart","onPointerDown"),[g,w]=(0,s.fallbackEventTo)(e,"onHoverStart","onPointerMove"),[x,F]=(0,s.fallbackEventTo)(e,"onHoverEnd","onPointerLeave"),c=(0,u.useRef)(null);let{linkProps:M,isPressed:A}=(0,o.useLink)({...e,elementType:h,onPress:R,onPressStart:S,onClick:T,onPointerDown:b,onPointerMove:w,onPointerLeave:F},c),{focusProps:D,isFocused:O,isFocusVisible:V}=(0,o.useFocusRing)(e),{hoverProps:N,isHovered:z}=(0,o.useHover)({...e,onHoverStart:g,onHoverEnd:x});return(0,k.jsx)(t?f.Slot:"a",{...(0,d.filterDOMProps)(e),...(0,o.mergeProps)(M,D,N),slot:e.slot||void 0,ref:(0,d.mergeRefs)(n,c),"data-disabled":e.isDisabled||void 0,"data-pressed":A||void 0,"data-hovered":z||void 0,"data-focused":O||void 0,"data-focus-visible":V||void 0,"data-current":!!e["aria-current"]||void 0,className:(0,P.link)({size:i,align:L,color:y,variant:p,weight:C,transform:E,underline:H}),children:a})}const v=(0,l.forwardRef)(K);
2
+ //# sourceMappingURL=link.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/components/link.tsx"],
4
+ "sourcesContent": ["import { LinkContext, TextContext, useContextProps, type SlotProps } from 'react-aria-components';\nimport { filterDOMProps, mergeRefs } from '@react-aria/utils';\nimport {\n forwardRef,\n isValidElement,\n type ElementType,\n type ForwardedRef,\n type ReactNode,\n} from 'react';\nimport { mergeProps, useFocusRing, useHover, useLink } from 'react-aria';\nimport { Slot } from '@radix-ui/react-slot';\nimport { useRef } from 'react';\nimport type { AriaLinkOptions, HoverEvents } from 'react-aria';\n\nimport { link, type LinkVariantProps } from '../variants/index.js';\nimport { fallbackEventTo } from '../utils/helpers.js';\n\nexport interface LinkProps\n extends Omit<AriaLinkOptions, 'elementType'>,\n SlotProps,\n HoverEvents,\n LinkVariantProps {\n asChild?: boolean;\n children?: ReactNode;\n}\n\nfunction _Link(props: LinkProps, ref: ForwardedRef<HTMLAnchorElement>) {\n // @ts-ignore\n [props, ref] = useContextProps(props, ref, TextContext);\n [props, ref] = useContextProps(props, ref, LinkContext);\n const { asChild, children, size, align, color, variant, weight, transform, underline } = props;\n let elementType = asChild\n ? (isValidElement(children) && (children?.type as ElementType)) || 'a'\n : 'a';\n\n const [onPress, onClick] = fallbackEventTo(props, 'onPress', 'onClick');\n const [onPressStart, onPointerDown] = fallbackEventTo(props, 'onPressStart', 'onPointerDown');\n const [onHoverStart, onPointerMove] = fallbackEventTo(props, 'onHoverStart', 'onPointerMove');\n const [onHoverEnd, onPointerLeave] = fallbackEventTo(props, 'onHoverEnd', 'onPointerLeave');\n const innerRef = useRef<HTMLAnchorElement>(null);\n let { linkProps, isPressed } = useLink(\n {\n ...props,\n // @ts-ignore\n elementType,\n onPress,\n onPressStart,\n // @ts-ignore\n onClick,\n // @ts-ignore\n onPointerDown,\n // @ts-ignore\n onPointerMove,\n // @ts-ignore\n onPointerLeave,\n },\n innerRef,\n );\n let { focusProps, isFocused, isFocusVisible } = useFocusRing(props);\n\n let { hoverProps, isHovered } = useHover({\n ...props,\n onHoverStart,\n onHoverEnd,\n });\n\n let Comp = asChild ? Slot : 'a';\n\n return (\n <Comp\n {...filterDOMProps(props)}\n {...mergeProps(linkProps, focusProps, hoverProps)}\n slot={props.slot || undefined}\n ref={mergeRefs(ref, innerRef)}\n data-disabled={props.isDisabled || undefined}\n data-pressed={isPressed || undefined}\n data-hovered={isHovered || undefined}\n data-focused={isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}\n // @ts-ignore\n data-current={!!props['aria-current'] || undefined}\n className={link({ size, align, color, variant, weight, transform, underline })}\n >\n {children}\n </Comp>\n );\n}\n\nconst Link = /*#__PURE__*/ forwardRef(_Link);\nexport { Link };\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,UAAAE,IAAA,eAAAC,EAAAH,GAqEI,IAAAI,EAAA,6BArEJC,EAA0E,iCAC1EC,EAA0C,6BAC1CC,EAMO,iBACPC,EAA4D,sBAC5DC,EAAqB,gCACrBF,EAAuB,iBAGvBG,EAA4C,gCAC5CC,EAAgC,+BAWhC,SAASC,EAAMC,EAAkBC,EAAsC,CAErE,CAACD,EAAOC,CAAG,KAAI,mBAAgBD,EAAOC,EAAK,aAAW,EACtD,CAACD,EAAOC,CAAG,KAAI,mBAAgBD,EAAOC,EAAK,aAA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C,EAAS,OAAAC,EAAQ,UAAAC,EAAW,UAAAC,CAAU,CAAC,EAE5E,SAAAP,EACH,CAEJ,CAEA,MAAMd,KAAqB,cAAWU,CAAK",
6
+ "names": ["link_exports", "__export", "Link", "__toCommonJS", "import_jsx_runtime", "import_react_aria_components", "import_utils", "import_react", "import_react_aria", "import_react_slot", "import_variants", "import_helpers", "_Link", "props", "ref", "asChild", "children", "size", "align", "color", "variant", "weight", "transform", "underline", "elementType", "onPress", "onClick", "onPressStart", "onPointerDown", "onHoverStart", "onPointerMove", "onHoverEnd", "onPointerLeave", "innerRef", "linkProps", "isPressed", "focusProps", "isFocused", "isFocusVisible", "hoverProps", "isHovered"]
7
+ }
@@ -0,0 +1,11 @@
1
+ import { type ReactNode } from 'react';
2
+ import type { NumberFieldProps as BaseNumberFieldProps, ValidationResult } from 'react-aria-components';
3
+ import type { TextFieldVariantProps } from '../variants/index.js';
4
+ interface NumberFieldProps extends BaseNumberFieldProps, TextFieldVariantProps {
5
+ placeholder?: string;
6
+ label?: string;
7
+ description?: string | ReactNode;
8
+ errorMessage?: string | ((validation: ValidationResult) => string);
9
+ }
10
+ declare const NumberField: import("react").ForwardRefExoticComponent<NumberFieldProps & import("react").RefAttributes<HTMLDivElement>>;
11
+ export { NumberField };
@@ -0,0 +1,2 @@
1
+ "use strict";var b=Object.defineProperty;var j=Object.getOwnPropertyDescriptor;var A=Object.getOwnPropertyNames;var O=Object.prototype.hasOwnProperty;var S=(i,t)=>{for(var l in t)b(i,l,{get:t[l],enumerable:!0})},U=(i,t,l,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let d of A(t))!O.call(i,d)&&d!==l&&b(i,d,{get:()=>t[d],enumerable:!(a=j(t,d))||a.enumerable});return i};var _=i=>U(b({},"__esModule",{value:!0}),i);var k={};S(k,{NumberField:()=>w});module.exports=_(k);var e=require("react/jsx-runtime"),N=require("@radix-ui/react-use-rect"),u=require("react-aria-components"),F=require("react-stately"),m=require("../utils/cn.js"),P=require("../variants/field-error.js"),R=require("../variants/index.js"),n=require("./index.js"),y=require("@react-aria/utils"),p=require("lucide-react"),s=require("react"),c=require("react-aria"),T=require("../utils/helpers.js");function $({label:i,description:t,errorMessage:l,size:a="medium",roundness:d="medium",elevation:f="medium",...r},g){const[E,B]=(0,s.useState)(null),v=(0,N.useRect)(E);[r,g]=(0,u.useContextProps)(r,g,u.NumberFieldContext);let{locale:D}=(0,c.useLocale)(),x=(0,F.useNumberFieldState)({...r,locale:D}),h=(0,s.useRef)(null),{labelProps:V,groupProps:q,inputProps:C,incrementButtonProps:I,decrementButtonProps:L,descriptionProps:H,errorMessageProps:M,...o}=(0,c.useNumberField)({...(0,T.removeDataAttributes)(r),label:i},x,h);return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)(n.Flex,{gap:2,direction:"column",...(0,y.filterDOMProps)(r),ref:g,slot:r.slot||void 0,"data-disabled":r.isDisabled||void 0,"data-invalid":o.isInvalid||void 0,children:[i&&(0,e.jsx)(n.Text,{...V,size:1,transform:"uppercase",weight:"semibold",variant:"tertiary",color:"gray",children:i}),(0,e.jsxs)("div",{...q,className:"relative","data-radius":d,"data-shadow":f,children:[(0,e.jsx)("input",{...C,ref:h,style:{"--append-padding-right":v?`${v.width}px`:0},className:(0,m.cn)("dx","w-full",(0,R.textField)({size:a,roundness:d,elevation:f})),"data-disabled":r.isDisabled||void 0,"data-invalid":o.isInvalid||void 0,"data-readonly":r.isReadOnly||void 0,"data-required":r.isRequired||void 0}),(0,e.jsxs)(n.Flex,{ref:B,direction:["large","extralarge"].includes(a)?"column":"row-reverse",align:["large","extralarge"].includes(a)?"start":"center",justify:["large","extralarge"].includes(a)?"center":"start",className:(0,m.cn)("absolute top-[0] bottom-[0] transform",{"right-3":["extrasmall","small"].includes(a),"right-4":["medium","large"].includes(a),"right-6":a==="extralarge"}),children:[(0,e.jsx)(n.Button,{...I,size:"extrasmall",shape:"square",variant:"ghost",mode:"subtle",inset:"right",slot:"increment",children:(0,e.jsx)(p.ChevronUp,{})}),(0,e.jsx)(n.Button,{...L,size:"extrasmall",shape:"square",variant:"ghost",mode:"subtle",inset:"right",slot:"decrement",children:(0,e.jsx)(p.ChevronDown,{})})]}),o.isInvalid&&(0,e.jsx)(n.Text,{...M,size:1,className:(0,m.cn)("dx",(0,P.fieldError)({size:a,roundness:d,elevation:f})),children:l?typeof l=="string"?l:l(o):o.validationErrors.length===0?void 0:o.validationErrors.join(" ")})]}),t&&(0,e.jsx)(n.Text,{size:1,variant:"tertiary",...H,children:t})]}),r.name&&(0,e.jsx)("input",{type:"hidden",name:r.name,value:isNaN(x.numberValue)?"":x.numberValue})]})}const w=(0,s.forwardRef)($);
2
+ //# sourceMappingURL=number-field.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/components/number-field.tsx"],
4
+ "sourcesContent": ["import { useRect } from '@radix-ui/react-use-rect';\nimport { NumberFieldContext, useContextProps } from 'react-aria-components';\nimport { useNumberFieldState } from 'react-stately';\nimport { cn } from '../utils/cn.js';\nimport { fieldError } from '../variants/field-error.js';\nimport { textField } from '../variants/index.js';\nimport { Button, Flex, Text } from './index.js';\nimport { filterDOMProps } from '@react-aria/utils';\nimport { ChevronDown, ChevronUp } from 'lucide-react';\nimport { forwardRef, useRef, useState, type ReactNode } from 'react';\nimport { useLocale, useNumberField } from 'react-aria';\nimport { removeDataAttributes } from '../utils/helpers.js';\nimport type {\n NumberFieldProps as BaseNumberFieldProps,\n ValidationResult,\n} from 'react-aria-components';\nimport type { TextFieldVariantProps } from '../variants/index.js';\n\ninterface NumberFieldProps extends BaseNumberFieldProps, TextFieldVariantProps {\n placeholder?: string;\n label?: string;\n description?: string | ReactNode;\n errorMessage?: string | ((validation: ValidationResult) => string);\n}\n\nfunction _NumberField(\n {\n label,\n description,\n errorMessage,\n size = 'medium',\n roundness = 'medium',\n elevation = 'medium',\n ...props\n }: NumberFieldProps,\n ref: React.ForwardedRef<HTMLDivElement>,\n) {\n const [appendEl, setAppendEl] = useState<HTMLDivElement | null>(null);\n const appendRect = useRect(appendEl);\n [props, ref] = useContextProps(props, ref, NumberFieldContext);\n\n let { locale } = useLocale();\n let state = useNumberFieldState({\n ...props,\n locale,\n });\n\n let inputRef = useRef<HTMLInputElement>(null);\n\n let {\n labelProps,\n groupProps,\n inputProps,\n incrementButtonProps,\n decrementButtonProps,\n descriptionProps,\n errorMessageProps,\n ...validation\n } = useNumberField(\n {\n ...removeDataAttributes(props),\n label,\n },\n state,\n inputRef,\n );\n\n return (\n <>\n <Flex\n gap={2}\n direction=\"column\"\n {...filterDOMProps(props)}\n ref={ref}\n slot={props.slot || undefined}\n data-disabled={props.isDisabled || undefined}\n data-invalid={validation.isInvalid || undefined}\n >\n {label && (\n <Text\n {...labelProps}\n size={1}\n transform=\"uppercase\"\n weight=\"semibold\"\n variant=\"tertiary\"\n color=\"gray\"\n >\n {label}\n </Text>\n )}\n <div {...groupProps} className=\"relative\" data-radius={roundness} data-shadow={elevation}>\n <input\n {...inputProps}\n ref={inputRef}\n style={{\n // @ts-ignore\n '--append-padding-right': appendRect ? `${appendRect.width}px` : 0,\n }}\n className={cn('dx', 'w-full', textField({ size, roundness, elevation }))}\n data-disabled={props.isDisabled || undefined}\n data-invalid={validation.isInvalid || undefined}\n data-readonly={props.isReadOnly || undefined}\n data-required={props.isRequired || undefined}\n />\n <Flex\n ref={setAppendEl}\n direction={['large', 'extralarge'].includes(size) ? 'column' : 'row-reverse'}\n align={['large', 'extralarge'].includes(size) ? 'start' : 'center'}\n justify={['large', 'extralarge'].includes(size) ? 'center' : 'start'}\n className={cn('absolute top-[0] bottom-[0] transform', {\n 'right-3': ['extrasmall', 'small'].includes(size),\n 'right-4': ['medium', 'large'].includes(size),\n 'right-6': size === 'extralarge',\n })}\n >\n <Button\n {...incrementButtonProps}\n size=\"extrasmall\"\n shape=\"square\"\n variant=\"ghost\"\n mode=\"subtle\"\n inset=\"right\"\n slot=\"increment\"\n >\n <ChevronUp />\n </Button>\n <Button\n {...decrementButtonProps}\n size=\"extrasmall\"\n shape=\"square\"\n variant=\"ghost\"\n mode=\"subtle\"\n inset=\"right\"\n slot=\"decrement\"\n >\n <ChevronDown />\n </Button>\n </Flex>\n {validation.isInvalid && (\n <Text\n {...errorMessageProps}\n size={1}\n className={cn('dx', fieldError({ size, roundness, elevation }))}\n >\n {errorMessage\n ? typeof errorMessage === 'string'\n ? errorMessage\n : errorMessage(validation)\n : validation.validationErrors.length === 0\n ? undefined\n : validation.validationErrors.join(' ')}\n </Text>\n )}\n </div>\n {description && (\n <Text size={1} variant=\"tertiary\" {...descriptionProps}>\n {description}\n </Text>\n )}\n </Flex>\n {props.name && (\n <input\n type=\"hidden\"\n name={props.name}\n value={isNaN(state.numberValue) ? '' : state.numberValue}\n />\n )}\n </>\n );\n}\n\nconst NumberField = forwardRef(_NumberField);\n\nexport { NumberField };\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,iBAAAE,IAAA,eAAAC,EAAAH,GAoEI,IAAAI,EAAA,6BApEJC,EAAwB,oCACxBC,EAAoD,iCACpDC,EAAoC,yBACpCC,EAAmB,0BACnBC,EAA2B,sCAC3BC,EAA0B,gCAC1BC,EAAmC,sBACnCC,EAA+B,6BAC/BC,EAAuC,wBACvCC,EAA6D,iBAC7DC,EAA0C,sBAC1CC,EAAqC,+BAcrC,SAASC,EACP,CACE,MAAAC,EACA,YAAAC,EACA,aAAAC,EACA,KAAAC,EAAO,SACP,UAAAC,EAAY,SACZ,UAAAC,EAAY,SACZ,GAAGC,CACL,EACAC,EACA,CACA,KAAM,CAACC,EAAUC,CAAW,KAAI,YAAgC,IAAI,EAC9DC,KAAa,WAAQF,CAAQ,EACnC,CAACF,EAAOC,CAAG,KAAI,mBAAgBD,EAAOC,EAAK,oBAAkB,EAE7D,GAAI,CAAE,OAAAI,CAAO,KAAI,aAAU,EACvBC,KAAQ,uBAAoB,CAC9B,GAAGN,EACH,OAAAK,CACF,CAAC,EAEGE,K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,KAAK,aACL,MAAM,SACN,QAAQ,QACR,KAAK,SACL,MAAM,QACN,KAAK,YAEL,mBAAC,cAAU,EACb,KACA,OAAC,UACE,GAAGC,EACJ,KAAK,aACL,MAAM,SACN,QAAQ,QACR,KAAK,SACL,MAAM,QACN,KAAK,YAEL,mBAAC,gBAAY,EACf,GACF,EACCG,EAAW,cACV,OAAC,QACE,GAAGD,EACJ,KAAM,EACN,aAAW,MAAG,QAAM,cAAW,CAAE,KAAAjB,EAAM,UAAAC,EAAW,UAAAC,CAAU,CAAC,CAAC,EAE7D,SAAAH,EACG,OAAOA,GAAiB,SACtBA,EACAA,EAAamB,CAAU,EACzBA,EAAW,iBAAiB,SAAW,EACrC,OACAA,EAAW,iBAAiB,KAAK,GAAG,EAC5C,GAEJ,EACCpB,MACC,OAAC,QAAK,KAAM,EAAG,QAAQ,WAAY,GAAGkB,EACnC,SAAAlB,EACH,GAEJ,EACCK,EAAM,SACL,OAAC,SACC,KAAK,SACL,KAAMA,EAAM,KACZ,MAAO,MAAMM,EAAM,WAAW,EAAI,GAAKA,EAAM,YAC/C,GAEJ,CAEJ,CAEA,MAAM5B,KAAc,cAAWe,CAAY",
6
+ "names": ["number_field_exports", "__export", "NumberField", "__toCommonJS", "import_jsx_runtime", "import_react_use_rect", "import_react_aria_components", "import_react_stately", "import_cn", "import_field_error", "import_variants", "import_index", "import_utils", "import_lucide_react", "import_react", "import_react_aria", "import_helpers", "_NumberField", "label", "description", "errorMessage", "size", "roundness", "elevation", "props", "ref", "appendEl", "setAppendEl", "appendRect", "locale", "state", "inputRef", "labelProps", "groupProps", "inputProps", "incrementButtonProps", "decrementButtonProps", "descriptionProps", "errorMessageProps", "validation"]
7
+ }