@accelint/design-toolkit 2.4.2 → 2.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (252) hide show
  1. package/dist/components/accordion/index.d.ts +1 -1
  2. package/dist/components/accordion/index.js +1 -1
  3. package/dist/components/accordion/index.js.map +1 -1
  4. package/dist/components/accordion/styles.d.ts +1 -5
  5. package/dist/components/accordion/styles.js +1 -1
  6. package/dist/components/accordion/styles.js.map +1 -1
  7. package/dist/components/accordion/types.d.ts +9 -10
  8. package/dist/components/avatar/index.d.ts +4 -2
  9. package/dist/components/avatar/index.js +1 -1
  10. package/dist/components/avatar/index.js.map +1 -1
  11. package/dist/components/avatar/styles.d.ts +16 -15
  12. package/dist/components/avatar/styles.js +1 -1
  13. package/dist/components/avatar/styles.js.map +1 -1
  14. package/dist/components/avatar/types.d.ts +7 -7
  15. package/dist/components/badge/index.d.ts +3 -2
  16. package/dist/components/badge/index.js +1 -1
  17. package/dist/components/badge/index.js.map +1 -1
  18. package/dist/components/badge/styles.js +1 -1
  19. package/dist/components/badge/styles.js.map +1 -1
  20. package/dist/components/badge/types.d.ts +3 -4
  21. package/dist/components/box/index.js +1 -1
  22. package/dist/components/box/index.js.map +1 -1
  23. package/dist/components/button/index.d.ts +6 -4
  24. package/dist/components/button/index.js +1 -1
  25. package/dist/components/button/index.js.map +1 -1
  26. package/dist/components/button/styles.d.ts +25 -24
  27. package/dist/components/button/styles.js +1 -1
  28. package/dist/components/button/styles.js.map +1 -1
  29. package/dist/components/button/types.d.ts +3 -5
  30. package/dist/components/checkbox/index.js +1 -1
  31. package/dist/components/checkbox/index.js.map +1 -1
  32. package/dist/components/checkbox/styles.d.ts +19 -18
  33. package/dist/components/checkbox/styles.js +1 -1
  34. package/dist/components/checkbox/styles.js.map +1 -1
  35. package/dist/components/chip/index.d.ts +4 -2
  36. package/dist/components/chip/index.js +1 -1
  37. package/dist/components/chip/index.js.map +1 -1
  38. package/dist/components/chip/styles.d.ts +70 -69
  39. package/dist/components/chip/styles.js +1 -1
  40. package/dist/components/chip/styles.js.map +1 -1
  41. package/dist/components/chip/types.d.ts +5 -5
  42. package/dist/components/classification-badge/index.d.ts +3 -2
  43. package/dist/components/classification-badge/index.js +1 -1
  44. package/dist/components/classification-badge/index.js.map +1 -1
  45. package/dist/components/classification-badge/styles.js +1 -1
  46. package/dist/components/classification-badge/styles.js.map +1 -1
  47. package/dist/components/classification-badge/types.d.ts +3 -4
  48. package/dist/components/classification-banner/index.d.ts +3 -2
  49. package/dist/components/classification-banner/index.js +1 -1
  50. package/dist/components/classification-banner/index.js.map +1 -1
  51. package/dist/components/classification-banner/styles.js +1 -1
  52. package/dist/components/classification-banner/styles.js.map +1 -1
  53. package/dist/components/classification-banner/types.d.ts +3 -4
  54. package/dist/components/color-picker/index.d.ts +45 -15
  55. package/dist/components/color-picker/index.js +1 -1
  56. package/dist/components/color-picker/index.js.map +1 -1
  57. package/dist/components/color-picker/styles.d.ts +42 -0
  58. package/dist/components/color-picker/styles.js +2 -0
  59. package/dist/components/color-picker/styles.js.map +1 -0
  60. package/dist/components/color-picker/types.d.ts +13 -0
  61. package/dist/components/color-picker/types.js +2 -0
  62. package/dist/components/color-picker/types.js.map +1 -0
  63. package/dist/components/combobox/index.d.ts +9 -14
  64. package/dist/components/combobox/index.js +1 -1
  65. package/dist/components/combobox/index.js.map +1 -1
  66. package/dist/components/date-field/index.d.ts +8 -24
  67. package/dist/components/date-field/index.js +1 -1
  68. package/dist/components/date-field/index.js.map +1 -1
  69. package/dist/components/date-field/styles.d.ts +69 -0
  70. package/dist/components/date-field/styles.js +2 -0
  71. package/dist/components/date-field/styles.js.map +1 -0
  72. package/dist/components/date-field/types.d.ts +29 -0
  73. package/dist/components/date-field/types.js +2 -0
  74. package/dist/components/date-field/types.js.map +1 -0
  75. package/dist/components/details-list/index.d.ts +59 -0
  76. package/dist/components/details-list/index.js +2 -0
  77. package/dist/components/details-list/index.js.map +1 -0
  78. package/dist/components/details-list/styles.d.ts +65 -0
  79. package/dist/components/details-list/styles.js +2 -0
  80. package/dist/components/details-list/styles.js.map +1 -0
  81. package/dist/components/details-list/types.d.ts +16 -0
  82. package/dist/components/details-list/types.js +2 -0
  83. package/dist/components/details-list/types.js.map +1 -0
  84. package/dist/components/dialog/index.d.ts +1 -0
  85. package/dist/components/dialog/index.js +1 -1
  86. package/dist/components/dialog/index.js.map +1 -1
  87. package/dist/components/drawer/context.d.ts +13 -0
  88. package/dist/components/drawer/context.js +2 -0
  89. package/dist/components/drawer/context.js.map +1 -0
  90. package/dist/components/drawer/index.d.ts +48 -0
  91. package/dist/components/drawer/index.js +2 -0
  92. package/dist/components/drawer/index.js.map +1 -0
  93. package/dist/components/drawer/state.d.ts +26 -0
  94. package/dist/components/drawer/state.js +2 -0
  95. package/dist/components/drawer/state.js.map +1 -0
  96. package/dist/components/drawer/styles.d.ts +118 -0
  97. package/dist/components/drawer/styles.js +2 -0
  98. package/dist/components/drawer/styles.js.map +1 -0
  99. package/dist/components/drawer/types.d.ts +279 -0
  100. package/dist/components/drawer/types.js +2 -0
  101. package/dist/components/drawer/types.js.map +1 -0
  102. package/dist/components/hero/index.d.ts +45 -0
  103. package/dist/components/hero/index.js +2 -0
  104. package/dist/components/hero/index.js.map +1 -0
  105. package/dist/components/hero/styles.d.ts +48 -0
  106. package/dist/components/hero/styles.js +2 -0
  107. package/dist/components/hero/styles.js.map +1 -0
  108. package/dist/components/hero/types.d.ts +13 -0
  109. package/dist/components/hero/types.js +2 -0
  110. package/dist/components/hero/types.js.map +1 -0
  111. package/dist/components/icon/index.d.ts +3 -2
  112. package/dist/components/icon/index.js +1 -1
  113. package/dist/components/icon/index.js.map +1 -1
  114. package/dist/components/icon/styles.js +1 -1
  115. package/dist/components/icon/styles.js.map +1 -1
  116. package/dist/components/icon/types.d.ts +4 -5
  117. package/dist/components/input/index.d.ts +1 -0
  118. package/dist/components/input/index.js +1 -1
  119. package/dist/components/input/index.js.map +1 -1
  120. package/dist/components/input/styles.js +1 -1
  121. package/dist/components/input/styles.js.map +1 -1
  122. package/dist/components/input/types.d.ts +1 -0
  123. package/dist/components/label/index.d.ts +3 -2
  124. package/dist/components/label/index.js +1 -1
  125. package/dist/components/label/index.js.map +1 -1
  126. package/dist/components/label/styles.js +1 -1
  127. package/dist/components/label/styles.js.map +1 -1
  128. package/dist/components/label/types.d.ts +2 -3
  129. package/dist/components/menu/index.d.ts +16 -21
  130. package/dist/components/menu/index.js +1 -1
  131. package/dist/components/menu/index.js.map +1 -1
  132. package/dist/components/menu/styles.js +1 -1
  133. package/dist/components/menu/styles.js.map +1 -1
  134. package/dist/components/navigation-stack/index.d.ts +20 -0
  135. package/dist/components/navigation-stack/index.js +2 -0
  136. package/dist/components/navigation-stack/index.js.map +1 -0
  137. package/dist/components/navigation-stack/types.d.ts +31 -0
  138. package/dist/components/navigation-stack/types.js +2 -0
  139. package/dist/components/navigation-stack/types.js.map +1 -0
  140. package/dist/components/options/index.d.ts +28 -22
  141. package/dist/components/options/index.js +1 -1
  142. package/dist/components/options/index.js.map +1 -1
  143. package/dist/components/options/styles.d.ts +72 -0
  144. package/dist/components/options/styles.js +2 -0
  145. package/dist/components/options/styles.js.map +1 -0
  146. package/dist/components/options/types.d.ts +29 -0
  147. package/dist/components/options/types.js +2 -0
  148. package/dist/components/options/types.js.map +1 -0
  149. package/dist/components/popover/index.js +1 -1
  150. package/dist/components/popover/index.js.map +1 -1
  151. package/dist/components/popover/styles.d.ts +16 -15
  152. package/dist/components/popover/styles.js +1 -1
  153. package/dist/components/popover/styles.js.map +1 -1
  154. package/dist/components/query-builder/action-element.js +1 -1
  155. package/dist/components/query-builder/action-element.js.map +1 -1
  156. package/dist/components/query-builder/constants.js +1 -1
  157. package/dist/components/query-builder/constants.js.map +1 -1
  158. package/dist/components/query-builder/group.js +1 -1
  159. package/dist/components/query-builder/group.js.map +1 -1
  160. package/dist/components/query-builder/index.d.ts +5 -20
  161. package/dist/components/query-builder/index.js +1 -1
  162. package/dist/components/query-builder/index.js.map +1 -1
  163. package/dist/components/query-builder/rule.js +1 -1
  164. package/dist/components/query-builder/rule.js.map +1 -1
  165. package/dist/components/query-builder/types.d.ts +22 -0
  166. package/dist/components/query-builder/types.js +2 -0
  167. package/dist/components/query-builder/types.js.map +1 -0
  168. package/dist/components/query-builder/utils.js +1 -1
  169. package/dist/components/query-builder/utils.js.map +1 -1
  170. package/dist/components/query-builder/value-editor.js +1 -1
  171. package/dist/components/query-builder/value-editor.js.map +1 -1
  172. package/dist/components/query-builder/value-selector.js +1 -1
  173. package/dist/components/query-builder/value-selector.js.map +1 -1
  174. package/dist/components/radio/index.js +1 -1
  175. package/dist/components/radio/index.js.map +1 -1
  176. package/dist/components/radio/styles.d.ts +19 -18
  177. package/dist/components/radio/styles.js +1 -1
  178. package/dist/components/radio/styles.js.map +1 -1
  179. package/dist/components/radio/types.d.ts +2 -3
  180. package/dist/components/search-field/index.d.ts +56 -15
  181. package/dist/components/search-field/index.js +1 -1
  182. package/dist/components/search-field/index.js.map +1 -1
  183. package/dist/components/search-field/styles.d.ts +53 -0
  184. package/dist/components/search-field/styles.js +2 -0
  185. package/dist/components/search-field/styles.js.map +1 -0
  186. package/dist/components/search-field/types.d.ts +25 -0
  187. package/dist/components/search-field/types.js +2 -0
  188. package/dist/components/search-field/types.js.map +1 -0
  189. package/dist/components/skeleton/index.d.ts +42 -0
  190. package/dist/components/skeleton/index.js +2 -0
  191. package/dist/components/skeleton/index.js.map +1 -0
  192. package/dist/components/skeleton/styles.d.ts +23 -0
  193. package/dist/components/skeleton/styles.js +2 -0
  194. package/dist/components/skeleton/styles.js.map +1 -0
  195. package/dist/components/skeleton/types.d.ts +8 -0
  196. package/dist/components/skeleton/types.js +2 -0
  197. package/dist/components/skeleton/types.js.map +1 -0
  198. package/dist/components/slider/index.js +1 -1
  199. package/dist/components/slider/index.js.map +1 -1
  200. package/dist/components/switch/index.d.ts +3 -2
  201. package/dist/components/switch/index.js +1 -1
  202. package/dist/components/switch/index.js.map +1 -1
  203. package/dist/components/switch/styles.d.ts +13 -12
  204. package/dist/components/switch/styles.js +1 -1
  205. package/dist/components/switch/styles.js.map +1 -1
  206. package/dist/components/switch/types.d.ts +2 -3
  207. package/dist/components/tabs/index.js +1 -1
  208. package/dist/components/tabs/index.js.map +1 -1
  209. package/dist/components/text-area-field/index.d.ts +4 -3
  210. package/dist/components/text-area-field/index.js +1 -1
  211. package/dist/components/text-area-field/index.js.map +1 -1
  212. package/dist/components/text-area-field/styles.d.ts +19 -18
  213. package/dist/components/text-area-field/styles.js +1 -1
  214. package/dist/components/text-area-field/styles.js.map +1 -1
  215. package/dist/components/text-area-field/types.d.ts +2 -3
  216. package/dist/components/text-field/index.d.ts +4 -2
  217. package/dist/components/text-field/index.js +1 -1
  218. package/dist/components/text-field/index.js.map +1 -1
  219. package/dist/components/text-field/styles.d.ts +19 -18
  220. package/dist/components/text-field/styles.js +1 -1
  221. package/dist/components/text-field/styles.js.map +1 -1
  222. package/dist/components/text-field/types.d.ts +4 -4
  223. package/dist/components/tooltip/index.d.ts +14 -28
  224. package/dist/components/tooltip/index.js +1 -1
  225. package/dist/components/tooltip/index.js.map +1 -1
  226. package/dist/components/tooltip/styles.d.ts +5 -0
  227. package/dist/components/tooltip/styles.js +2 -0
  228. package/dist/components/tooltip/styles.js.map +1 -0
  229. package/dist/components/tooltip/types.d.ts +8 -0
  230. package/dist/components/tooltip/types.js +2 -0
  231. package/dist/components/tooltip/types.js.map +1 -0
  232. package/dist/icons/catalog.js +1 -1
  233. package/dist/index.d.ts +54 -28
  234. package/dist/index.js +1 -1
  235. package/dist/lib/react.d.ts +13 -12
  236. package/dist/lib/react.js +4 -4
  237. package/dist/lib/react.js.map +1 -1
  238. package/dist/lib/types.d.ts +6 -2
  239. package/dist/lib/utils.js +1 -1
  240. package/dist/lib/utils.js.map +1 -1
  241. package/dist/metafile-esm.json +1 -1
  242. package/dist/styles.css +1341 -278
  243. package/dist/tokens/index.js +1 -1
  244. package/dist/tokens/index.js.map +1 -1
  245. package/dist/variants/variants.css +6 -0
  246. package/package.json +81 -58
  247. package/dist/components/options-item/index.d.ts +0 -30
  248. package/dist/components/options-item/index.js +0 -2
  249. package/dist/components/options-item/index.js.map +0 -1
  250. package/dist/components/query-builder/example-configuration.d.ts +0 -30
  251. package/dist/components/query-builder/example-configuration.js +0 -2
  252. package/dist/components/query-builder/example-configuration.js.map +0 -1
@@ -1,2 +1,2 @@
1
- import {cn}from'./../../lib/utils.js';import'client-only';import {cva}from'cva';import {useContext}from'react';import {Slider,Label,SliderTrack,SliderThumb,Text,SliderStateContext,useSlottedContext,LabelContext,NumberField,Input}from'react-aria-components';import {Tooltip}from'../tooltip/index.js';import {jsx,jsxs,Fragment}from'react/jsx-runtime';var D=cva("grid gap-s",{variants:{layout:{stacked:"",inline:""},orientation:{vertical:"h-full w-fit",horizontal:"h-xl w-full"}},compoundVariants:[{layout:"stacked",orientation:"horizontal",className:"grid-cols-[auto_1fr_auto] grid-rows-[auto_auto_auto]"},{layout:"inline",orientation:"horizontal",className:"grid-cols-[auto_auto_1fr_auto_auto] grid-rows-1 items-center"},{layout:"stacked",orientation:"vertical",className:"grid-cols-[auto_auto_auto] grid-rows-[auto_auto_1fr_auto]"},{layout:"inline",orientation:"vertical",className:"grid-cols-[auto_1fr_auto] grid-rows-[auto_auto_1fr_auto]"}]}),M=cva("font-display text-body-m text-default-dark",{variants:{orientation:{horizontal:"",vertical:"col-start-1 row-start-4"},layout:{inline:"",stacked:""}},compoundVariants:[{layout:"stacked",orientation:"horizontal",className:"col-start-1 row-start-3"},{layout:"inline",orientation:"horizontal",className:"order-2"},{layout:"stacked",orientation:"vertical",className:"self-end justify-self-end"},{layout:"inline",orientation:"vertical",className:"justify-self-center"}]}),q=cva("font-display text-body-m text-default-dark",{variants:{orientation:{horizontal:"",vertical:"col-start-1 row-start-2"},layout:{inline:"",stacked:""}},compoundVariants:[{layout:"stacked",orientation:"horizontal",className:"col-start-3 row-start-3 justify-self-end"},{layout:"inline",orientation:"horizontal",className:"order-4"},{layout:"stacked",orientation:"vertical",className:"justify-self-end"}]}),E=cva("relative",{variants:{orientation:{horizontal:"h-s w-full",vertical:"h-full w-s"},layout:{inline:"",stacked:""}},compoundVariants:[{orientation:"horizontal",layout:"stacked",className:"col-span-3 row-start-2"},{orientation:"horizontal",layout:"inline",className:"order-3"},{orientation:"vertical",layout:"stacked",className:"col-start-2 row-span-3 row-start-2"},{orientation:"vertical",layout:"inline",className:"col-start-1 row-start-3 justify-self-center"}]}),G=cva("flex gap-s",{variants:{orientation:{horizontal:"flex-row",vertical:"flex-col-reverse"},layout:{inline:"order-5",stacked:"col-start-3 row-start-1"}},compoundVariants:[{layout:"inline",orientation:"horizontal",className:"order-5"},{layout:"inline",orientation:"vertical",className:"col-span-3 col-start-1"},{layout:"stacked",orientation:"vertical",className:"row-start-4"}]}),H=cva("text-default-light",{variants:{orientation:{horizontal:"",vertical:""},layout:{inline:"order-1",stacked:"col-start-1"}},compoundVariants:[{layout:"stacked",orientation:"vertical",className:"col-span-2"},{layout:"inline",orientation:"vertical",className:"col-span-3"}]}),J=cva("h-m w-m rounded-full bg-highlight-bold outline-highlight-bold/40 hover:outline-4 focus:outline-4",{variants:{orientation:{horizontal:"translate-y-[50%]",vertical:"translate-x-[40%]"}}}),K=cva("absolute rounded-full bg-default-light/40",{variants:{orientation:{horizontal:"top-[50%] h-xxs w-full translate-y-[50%]",vertical:"left-[50%] h-full w-xxs "}}}),Q=cva("absolute rounded-full bg-highlight",{variants:{orientation:{horizontal:"top-1/2 h-xxs translate-y-1/2",vertical:"left-1/2 w-xxs"}}}),U=({children:s,className:i,showInput:o=false,showLabel:d=true,layout:l="stacked",value:m,defaultValue:N,label:k,defaultRangeValue:w,rangeValue:S,minValue:p=0,maxValue:g=100,isRange:v=false,orientation:t="horizontal",...z})=>{let T=v?S:m,_=v?w:N;return jsxs(Slider,{className:cn(D({orientation:t,layout:l})),minValue:p,maxValue:g,orientation:t,value:T,defaultValue:_,...z,children:[d&&jsx(Label,{className:H({orientation:t,layout:l}),children:k}),o&&jsx("div",{className:G({orientation:t,layout:l}),children:jsx(W,{})}),jsx(SliderTrack,{className:E({layout:l,orientation:t}),children:({state:r})=>{let n=r.getThumbPercent(0),P=r.getThumbPercent(1)||n,y=`${(r.values.length===2?P-n:n)*100}%`,b=r.values.length===2?`${Math.floor(n*100)}%`:"0";return jsxs(Fragment,{children:[jsx("div",{className:K({orientation:t})}),r.values.map((X,u)=>jsxs(Fragment,{children:[jsx("div",{className:Q({orientation:t}),style:t==="horizontal"?{left:b,width:y}:{bottom:b,height:y}},`slider-${u===0?"min":"max"}`),jsx(SliderThumb,{index:u,className:J({orientation:t}),children:!o&&jsxs(Tooltip,{children:[jsx(Tooltip.Trigger,{children:jsx("div",{className:"size-full"})}),jsx(Tooltip.Body,{placement:"top",children:r.getThumbValue(u)})]})},`slider-thumb-${u===0?"min":"max"}`)]}))]})}}),jsx(Text,{slot:"min",className:M({layout:l,orientation:t}),children:p}),jsx(Text,{slot:"max",className:q({layout:l,orientation:t}),children:g})]})},oa=({defaultValue:s,value:i,...o})=>jsx(U,{...o,isRange:true,defaultRangeValue:s,rangeValue:i});function W({className:s}){let i=useContext(SliderStateContext),o=useSlottedContext(LabelContext);return jsx(Fragment,{children:i?.values.map((d,l)=>jsx(NumberField,{"aria-labelledby":o?.id,value:d,onChange:m=>i.setThumbValue(0,m),children:jsx(Input,{className:cn("w-[50px] rounded-medium border border-interactive px-s py-xs font-display text-body-m text-default-light",s)})},`number-field-${l===0?"min":"max"}`))})}export{oa as RangeSlider,U as Slider};//# sourceMappingURL=index.js.map
1
+ import {jsx,jsxs,Fragment}from'react/jsx-runtime';import {cn}from'./../../lib/utils.js';import'client-only';import {cva}from'class-variance-authority';import {useContext}from'react';import {Slider,Label,SliderTrack,SliderThumb,Text,SliderStateContext,useSlottedContext,LabelContext,NumberField,Input}from'react-aria-components';import {Tooltip}from'../tooltip/index.js';const D=cva("grid gap-s",{variants:{layout:{stacked:"",inline:""},orientation:{vertical:"h-full w-fit",horizontal:"h-xl w-full"}},compoundVariants:[{layout:"stacked",orientation:"horizontal",className:"grid-cols-[auto_1fr_auto] grid-rows-[auto_auto_auto]"},{layout:"inline",orientation:"horizontal",className:"grid-cols-[auto_auto_1fr_auto_auto] grid-rows-1 items-center"},{layout:"stacked",orientation:"vertical",className:"grid-cols-[auto_auto_auto] grid-rows-[auto_auto_1fr_auto]"},{layout:"inline",orientation:"vertical",className:"grid-cols-[auto_1fr_auto] grid-rows-[auto_auto_1fr_auto]"}]}),M=cva("font-display text-body-m text-default-dark",{variants:{orientation:{horizontal:"",vertical:"col-start-1 row-start-4"},layout:{inline:"",stacked:""}},compoundVariants:[{layout:"stacked",orientation:"horizontal",className:"col-start-1 row-start-3"},{layout:"inline",orientation:"horizontal",className:"order-2"},{layout:"stacked",orientation:"vertical",className:"self-end justify-self-end"},{layout:"inline",orientation:"vertical",className:"justify-self-center"}]}),q=cva("font-display text-body-m text-default-dark",{variants:{orientation:{horizontal:"",vertical:"col-start-1 row-start-2"},layout:{inline:"",stacked:""}},compoundVariants:[{layout:"stacked",orientation:"horizontal",className:"col-start-3 row-start-3 justify-self-end"},{layout:"inline",orientation:"horizontal",className:"order-4"},{layout:"stacked",orientation:"vertical",className:"justify-self-end"}]}),E=cva("relative",{variants:{orientation:{horizontal:"h-s w-full",vertical:"h-full w-s"},layout:{inline:"",stacked:""}},compoundVariants:[{orientation:"horizontal",layout:"stacked",className:"col-span-3 row-start-2"},{orientation:"horizontal",layout:"inline",className:"order-3"},{orientation:"vertical",layout:"stacked",className:"col-start-2 row-span-3 row-start-2"},{orientation:"vertical",layout:"inline",className:"col-start-1 row-start-3 justify-self-center"}]}),G=cva("flex gap-s",{variants:{orientation:{horizontal:"flex-row",vertical:"flex-col-reverse"},layout:{inline:"order-5",stacked:"col-start-3 row-start-1"}},compoundVariants:[{layout:"inline",orientation:"horizontal",className:"order-5"},{layout:"inline",orientation:"vertical",className:"col-span-3 col-start-1"},{layout:"stacked",orientation:"vertical",className:"row-start-4"}]}),H=cva("text-default-light",{variants:{orientation:{horizontal:"",vertical:""},layout:{inline:"order-1",stacked:"col-start-1"}},compoundVariants:[{layout:"stacked",orientation:"vertical",className:"col-span-2"},{layout:"inline",orientation:"vertical",className:"col-span-3"}]}),J=cva("h-m w-m rounded-full bg-highlight-bold outline-highlight-bold/40 hover:outline-4 focus:outline-4",{variants:{orientation:{horizontal:"translate-y-[50%]",vertical:"translate-x-[40%]"}}}),K=cva("absolute rounded-full bg-default-light/40",{variants:{orientation:{horizontal:"top-[50%] h-xxs w-full translate-y-[50%]",vertical:"left-[50%] h-full w-xxs "}}}),Q=cva("absolute rounded-full bg-highlight",{variants:{orientation:{horizontal:"top-1/2 h-xxs translate-y-1/2",vertical:"left-1/2 w-xxs"}}}),U=({children:s,className:i,showInput:o=false,showLabel:d=true,layout:l="stacked",value:m,defaultValue:N,label:k,defaultRangeValue:w,rangeValue:S,minValue:p=0,maxValue:g=100,isRange:v=false,orientation:t="horizontal",...z})=>{const T=v?S:m,_=v?w:N;return jsxs(Slider,{className:cn(D({orientation:t,layout:l})),minValue:p,maxValue:g,orientation:t,value:T,defaultValue:_,...z,children:[d&&jsx(Label,{className:H({orientation:t,layout:l}),children:k}),o&&jsx("div",{className:G({orientation:t,layout:l}),children:jsx(W,{})}),jsx(SliderTrack,{className:E({layout:l,orientation:t}),children:({state:r})=>{const n=r.getThumbPercent(0),P=r.getThumbPercent(1)||n,y=`${(r.values.length===2?P-n:n)*100}%`,b=r.values.length===2?`${Math.floor(n*100)}%`:"0";return jsxs(Fragment,{children:[jsx("div",{className:K({orientation:t})}),r.values.map((X,u)=>jsxs(Fragment,{children:[jsx("div",{className:Q({orientation:t}),style:t==="horizontal"?{left:b,width:y}:{bottom:b,height:y}},`slider-${u===0?"min":"max"}`),jsx(SliderThumb,{index:u,className:J({orientation:t}),children:!o&&jsxs(Tooltip,{children:[jsx(Tooltip.Trigger,{children:jsx("div",{className:"size-full"})}),jsx(Tooltip.Body,{placement:"top",children:r.getThumbValue(u)})]})},`slider-thumb-${u===0?"min":"max"}`)]}))]})}}),jsx(Text,{slot:"min",className:M({layout:l,orientation:t}),children:p}),jsx(Text,{slot:"max",className:q({layout:l,orientation:t}),children:g})]})},oa=({defaultValue:s,value:i,...o})=>jsx(U,{...o,isRange:true,defaultRangeValue:s,rangeValue:i});function W({className:s}){const i=useContext(SliderStateContext),o=useSlottedContext(LabelContext);return jsx(Fragment,{children:i?.values.map((d,l)=>jsx(NumberField,{"aria-labelledby":o?.id,value:d,onChange:m=>i.setThumbValue(0,m),children:jsx(Input,{className:cn("w-[50px] rounded-medium border border-interactive px-s py-xs font-display text-body-m text-default-light",s)})},`number-field-${l===0?"min":"max"}`))})}export{oa as RangeSlider,U as Slider};//# sourceMappingURL=index.js.map
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/slider/index.tsx"],"names":["e","cva","layout","value","label","isRange","sliderValue","rangeValue","sliderDefaultValue","defaultRangeValue","defaultValue","jsxs","c","L","Label","a","A","jsx","RACSliderTrack","O","state","minValue","startPercent","index","Fragment","h","orientation","sizeInPercent","I","Tooltip","f","Text","x","RangeSlider","Slider","props","useContext","SliderStateContext","labelProps","useSlottedContext","LabelContext","B","F","$","NumberField","j","C","V"],"mappings":"6VAgC2B,IAAA,CAAA,CAAAA,GAAA,CAAA,YACzB,CAAA,CAAA,SACU,CACN,MAAA,CAAA,CAAS,OACT,CAAA,EAAQ,CAAA,MAEV,CAAA,EAAA,CAAA,CAAA,qBACY,CAAA,cACV,CAAA,wBAGJ,CAAA,CAAA,CAAA,gBAEI,CAAA,CAAQ,iBACR,CAAA,WAAa,CAAA,sBACF,CAAA,sDAGX,CAAA,CAAQ,CAAA,MAAA,CAAA,QACR,CAAA,WAAa,CAAA,YACb,CAAA,SAAW,CAAA,8DAGX,CAAA,CAAQ,iBACR,CAAA,WAAa,CAAA,oBACF,CAAA,2DAGX,CA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AAA,KAGL,CACH,CAEJ,EACF,CAAA,CACAb,CAAAA,CAACc,CAAAA,CAAA,CAAK,CAAA,CAAA,CAAAhB,GAAA,CAAKiB,IAAA,CAAA,CAAA,uBAAoC9B,CAAAA,MAAQ,CAAA,CAAA,CAAA,WACpD,CAAA,CAAA,CAAA,CAAA,CAAA,SAEF,CAAK,CAAA,CAAA,CAAAa,GAAA,CAAKiB,UAAM,CAAA,KAAA,CAAA,SAA8B,CAAA,CAAA,CAAA9B,CAAAA,oBAC5C,CAAA,CAAA,CAAA,CAAA,CAAA,QAIT,CAUa+B,GAAc,CAAC,CAC1B,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,YACA,CAAA9B,CAAAA,CACA,KACF,CAAA,CAAA,CAEIc,GAACiB,CAAA,CACE,GAAGC,GAAAA,CACJ,CAAA,CAAA,CAAA,GAAA,CAAA,CAAO,OACP,CAAA,IAAA,CAAA,iBACA,CAAA,CAAA,CAAA,UAKN,CAAA,CAAA,CAAA,EAAA,SAAuB,CAAA,CAAA,CAAA,SACrB,CAAMf,CAAAA,CAAQgB,CAAAA,CAAWC,IACnBC,CAAaC,CAAAA,UAAkBC,CAAYC,kBAAA,CACjD,CAAA,CAAA,CAAAC,iBAAA,CAAAC,YAAA,CACE1B,8BACU,CAAA,CAAA,QAA2BM,IACjCN,CAAAA,CAAC2B,CAAAA,CAAA,CAEC,GAAA7B,GAAA,CAAA8B,WAAA,CAAA,CAAA,iBACA,CAAA,CAAA,EAAA,EAAO1C,CACP,KAAA,CAAA,CAAA,CAAA,QAAuB,CAAA,CAAA,EAAA,CAAA,CAAA,2BAGrB,CAAAY,GAAA,CAAA+B,KAAA,CAAA,CAAA,SACE,CAAAC,EAAA,CAAA,+HAP+B,MAAQ,CAAA,CAAA,KAW7C,CACD,KAGP,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA","file":"index.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n'use client';\nimport { cn } from '@/lib/utils';\nimport 'client-only';\nimport { cva } from 'cva';\nimport { useContext } from 'react';\nimport {\n Input,\n Label,\n LabelContext,\n NumberField,\n Slider as RACSlider,\n type SliderProps as RACSliderProps,\n SliderTrack as RACSliderTrack,\n SliderStateContext,\n SliderThumb,\n Text,\n useSlottedContext,\n} from 'react-aria-components';\nimport { Tooltip } from '../tooltip';\n\nconst sliderVariants = cva('grid gap-s', {\n variants: {\n layout: {\n stacked: '',\n inline: '',\n },\n orientation: {\n vertical: 'h-full w-fit',\n horizontal: 'h-xl w-full',\n },\n },\n compoundVariants: [\n {\n layout: 'stacked',\n orientation: 'horizontal',\n className: 'grid-cols-[auto_1fr_auto] grid-rows-[auto_auto_auto]',\n },\n {\n layout: 'inline',\n orientation: 'horizontal',\n className: 'grid-cols-[auto_auto_1fr_auto_auto] grid-rows-1 items-center',\n },\n {\n layout: 'stacked',\n orientation: 'vertical',\n className: 'grid-cols-[auto_auto_auto] grid-rows-[auto_auto_1fr_auto]',\n },\n {\n layout: 'inline',\n orientation: 'vertical',\n className: 'grid-cols-[auto_1fr_auto] grid-rows-[auto_auto_1fr_auto]',\n },\n ],\n});\n\nconst minValueVariants = cva('font-display text-body-m text-default-dark', {\n variants: {\n orientation: {\n horizontal: '',\n vertical: 'col-start-1 row-start-4',\n },\n layout: {\n inline: '',\n stacked: '',\n },\n },\n compoundVariants: [\n {\n layout: 'stacked',\n orientation: 'horizontal',\n className: 'col-start-1 row-start-3',\n },\n {\n layout: 'inline',\n orientation: 'horizontal',\n className: 'order-2',\n },\n {\n layout: 'stacked',\n orientation: 'vertical',\n className: 'self-end justify-self-end',\n },\n {\n layout: 'inline',\n orientation: 'vertical',\n className: 'justify-self-center',\n },\n ],\n});\n\nconst maxValueVariants = cva('font-display text-body-m text-default-dark', {\n variants: {\n orientation: {\n horizontal: '',\n vertical: 'col-start-1 row-start-2',\n },\n layout: {\n inline: '',\n stacked: '',\n },\n },\n compoundVariants: [\n {\n layout: 'stacked',\n orientation: 'horizontal',\n className: 'col-start-3 row-start-3 justify-self-end',\n },\n {\n layout: 'inline',\n orientation: 'horizontal',\n className: 'order-4',\n },\n {\n layout: 'stacked',\n orientation: 'vertical',\n className: 'justify-self-end',\n },\n ],\n});\n\nconst sliderTrackVariants = cva('relative', {\n variants: {\n orientation: {\n horizontal: 'h-s w-full',\n vertical: 'h-full w-s',\n },\n layout: {\n inline: '',\n stacked: '',\n },\n },\n compoundVariants: [\n {\n orientation: 'horizontal',\n layout: 'stacked',\n className: 'col-span-3 row-start-2',\n },\n {\n orientation: 'horizontal',\n layout: 'inline',\n className: 'order-3',\n },\n {\n orientation: 'vertical',\n layout: 'stacked',\n className: 'col-start-2 row-span-3 row-start-2',\n },\n {\n orientation: 'vertical',\n layout: 'inline',\n className: 'col-start-1 row-start-3 justify-self-center',\n },\n ],\n});\n\nconst inputVariants = cva('flex gap-s', {\n variants: {\n orientation: {\n horizontal: 'flex-row',\n vertical: 'flex-col-reverse',\n },\n layout: {\n inline: 'order-5',\n stacked: 'col-start-3 row-start-1',\n },\n },\n compoundVariants: [\n {\n layout: 'inline',\n orientation: 'horizontal',\n className: 'order-5',\n },\n {\n layout: 'inline',\n orientation: 'vertical',\n className: 'col-span-3 col-start-1',\n },\n {\n layout: 'stacked',\n orientation: 'vertical',\n className: 'row-start-4',\n },\n ],\n});\n\nconst labelVariants = cva('text-default-light', {\n variants: {\n orientation: {\n horizontal: '',\n vertical: '',\n },\n layout: {\n inline: 'order-1',\n stacked: 'col-start-1',\n },\n },\n compoundVariants: [\n {\n layout: 'stacked',\n orientation: 'vertical',\n className: 'col-span-2',\n },\n {\n layout: 'inline',\n orientation: 'vertical',\n className: 'col-span-3',\n },\n ],\n});\n\nconst sliderThumbVariants = cva(\n 'h-m w-m rounded-full bg-highlight-bold outline-highlight-bold/40 hover:outline-4 focus:outline-4',\n {\n variants: {\n orientation: {\n horizontal: 'translate-y-[50%]',\n vertical: 'translate-x-[40%]',\n },\n },\n },\n);\n\nconst sliderTrackBackgroundVariants = cva(\n 'absolute rounded-full bg-default-light/40',\n {\n variants: {\n orientation: {\n horizontal: 'top-[50%] h-xxs w-full translate-y-[50%]',\n vertical: 'left-[50%] h-full w-xxs ',\n },\n },\n },\n);\n\nconst sliderTrackValueVariants = cva('absolute rounded-full bg-highlight', {\n variants: {\n orientation: {\n horizontal: 'top-1/2 h-xxs translate-y-1/2',\n vertical: 'left-1/2 w-xxs',\n },\n },\n});\n\nexport interface SliderProps\n extends Omit<\n RACSliderProps,\n 'value' | 'defaultValue' | 'showOutput' | 'slot' | 'style' | 'formatOptions'\n > {\n className?: string;\n showInput?: boolean;\n showLabel?: boolean;\n layout: 'stacked' | 'inline';\n value?: number;\n defaultValue?: number;\n rangeValue?: [number, number];\n defaultRangeValue?: [number, number];\n isRange?: boolean;\n label: string;\n}\n\nexport const Slider = ({\n children,\n className,\n showInput = false,\n showLabel = true,\n layout = 'stacked',\n value,\n defaultValue,\n label,\n defaultRangeValue,\n rangeValue,\n minValue = 0,\n maxValue = 100,\n isRange = false,\n orientation = 'horizontal',\n ...props\n}: SliderProps) => {\n const sliderValue = isRange ? rangeValue : value;\n const sliderDefaultValue = isRange ? defaultRangeValue : defaultValue;\n\n return (\n <RACSlider\n className={cn(sliderVariants({ orientation, layout }))}\n minValue={minValue}\n maxValue={maxValue}\n orientation={orientation}\n value={sliderValue}\n defaultValue={sliderDefaultValue}\n {...props}\n >\n {showLabel && (\n <Label className={labelVariants({ orientation, layout })}>\n {label}\n </Label>\n )}\n {showInput && (\n <div className={inputVariants({ orientation, layout })}>\n <SliderInput />\n </div>\n )}\n <RACSliderTrack className={sliderTrackVariants({ layout, orientation })}>\n {({ state }) => {\n const minValue = state.getThumbPercent(0);\n const maxValue = state.getThumbPercent(1) || minValue;\n const sizeInPercent = `${(state.values.length === 2 ? maxValue - minValue : minValue) * 100}%`;\n const startPercent =\n state.values.length === 2 ? `${Math.floor(minValue * 100)}%` : '0';\n return (\n <>\n <div className={sliderTrackBackgroundVariants({ orientation })} />\n {state.values.map((_, index) => {\n return (\n <>\n <div\n key={`slider-${index === 0 ? 'min' : 'max'}`}\n className={sliderTrackValueVariants({ orientation })}\n style={\n orientation === 'horizontal'\n ? {\n left: startPercent,\n width: sizeInPercent,\n }\n : {\n bottom: startPercent,\n height: sizeInPercent,\n }\n }\n />\n\n <SliderThumb\n key={`slider-thumb-${index === 0 ? 'min' : 'max'}`}\n index={index}\n className={sliderThumbVariants({ orientation })}\n >\n {!showInput && (\n <Tooltip>\n <Tooltip.Trigger>\n <div className='size-full' />\n </Tooltip.Trigger>\n <Tooltip.Body placement='top'>\n {state.getThumbValue(index)}\n </Tooltip.Body>\n </Tooltip>\n )}\n </SliderThumb>\n </>\n );\n })}\n </>\n );\n }}\n </RACSliderTrack>\n <Text slot='min' className={minValueVariants({ layout, orientation })}>\n {minValue}\n </Text>\n <Text slot='max' className={maxValueVariants({ layout, orientation })}>\n {maxValue}\n </Text>\n </RACSlider>\n );\n};\n\nexport type RangeSliderProps = Omit<\n SliderProps,\n 'isRange' | 'defaultRangeValue' | 'rangeValue' | 'defaultValue' | 'value'\n> & {\n defaultValue: SliderProps['defaultRangeValue'];\n value: SliderProps['rangeValue'];\n};\n\nexport const RangeSlider = ({\n defaultValue,\n value,\n ...props\n}: RangeSliderProps) => {\n return (\n <Slider\n {...props}\n isRange\n defaultRangeValue={defaultValue}\n rangeValue={value}\n />\n );\n};\n\nfunction SliderInput({ className }: { className?: string }) {\n const state = useContext(SliderStateContext);\n const labelProps = useSlottedContext(LabelContext);\n return (\n <>\n {state?.values.map((value: number, index: number) => (\n <NumberField\n key={`number-field-${index === 0 ? 'min' : 'max'}`}\n aria-labelledby={labelProps?.id}\n value={value}\n onChange={(v) => state.setThumbValue(0, v)}\n >\n <Input\n className={cn(\n 'w-[50px] rounded-medium border border-interactive px-s py-xs font-display text-body-m text-default-light',\n className,\n )}\n />\n </NumberField>\n ))}\n </>\n );\n}\n"]}
1
+ {"version":3,"sources":["../../../src/components/slider/index.tsx"],"names":["e","labelVariants","cva","value","defaultRangeValue","rangeValue","sliderDefaultValue","isRange","defaultValue","jsxs","RACSlider","c","x","maxValue","sliderValue","props","jsx","Label","a","A","label","inputVariants","O","layout","state","minValue","startPercent","h","sliderTrackBackgroundVariants","_","index","Fragment","sliderTrackValueVariants","sizeInPercent","SliderThumb","sliderThumbVariants","Tooltip","f","Text","V","RangeSlider","Slider","useSlottedContext","LabelContext","NumberField","j","labelProps","v","C"],"mappings":"kXAiCE,MAAA,CAAA,CAAAA,GAAA,CAAA,YAEI,CAAA,CAAA,SACA,CAAA,MAAQ,CAAA,CACV,OACA,CAAA,EAAA,CAAA,sBACY,CAAA,CAAA,QACV,CAAA,yBAGJ,CAAA,aAAkB,CAChB,CACE,CAAA,gBACA,CAAA,CAAA,CAAA,MAAA,CAAA,SAAa,CAAA,wBACF,CAAA,SAAA,CAAA,sDAIX,CAAA,CAAA,CAAA,MAAA,CAAA,QAAa,CAAA,WACb,CAAA,YAAW,CAAA,SAAA,CAAA,8DAIX,CAAA,CAAA,CAAA,MAAA,CAAA,SAAa,CAAA,sBACF,CAAA,SAAA,CAAA,2DAIX,CAAA,CAAA,CAAA,MAAA,CAAA,oBACA,CAAA,UAAW,CAAA,SAAA,CAAA,iHAOb,CAAA,CAAA,qBAEE,CAAA,CAAA,gDAIA,CAAA,CAAA,MAAS,EACX,oBAEgB,CAChB,CACE,iBACA,CAAA,CAAA,CAAA,MAAA,CAAA,qBACA,CAAA,YAAW,CAAA,SAAA,CAAA,yBAIX,CAAA,CAAA,CAAA,MAAA,CAAA,QAAa,CAAA,w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AAA,CAAA,MACpD,CAAA,CAAA,CAAA,WAEFe,EAAA,CAAK,CAAA,CAAA,SAAW,CAAA,CAAA,CAAA,CAAApB,GAAA,CAAAqB,IAAA,CAAA,CAAA,IAA8B,CAAA,KAAA,CAAAhB,mBAC5C,CAAA,CAAA,CAAA,WAIT,CAAA,CAUaiB,GAAc,QACzB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAAhC,CAAAA,CACA,EAAA,CAAA,CAAA,CAAA,aAIGiC,CAAAA,CAAA,KACK1B,CACJ,CAAA,CAAA,GAAA,CAAA,CAAA,GAAOG,GACP,CAAA,CAAA,CAAA,CAAA,GAAA,CAAA,CAAA,OAAA,CAAA,IAAmBV,CACnB,iBAKN,CAAA,CAAA,CAAA,UAAuB,CAAA,CAAA,CAAA,EAAA,SACrB,CAAA,CAAA,CAAMgB,SACakB,CAAAA,CAAkBC,CAAY,CAAA,CACjD,MAAA,CACE3B,WAAAe,CAAAA,kBAAA,CACG,0CAAOb,GAAA,CAAAS,QAAA,CAAO,WACbX,EAAC4B,MAEC,CAAA,GAAA,CAAA,CAAA,CAAA,CAAA,CAAA,GAAA1B,GAAA,CAAA2B,WAAiBC,CAAAA,CAAAA,iBAEjB,CAAA,CAAA,EAAWC,GAAMvB,KAAM,CAAA,CAAA,CAAA,QAAc,EAAGuB,EAAC,CAEzC,cACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,QACE,CAAA7B,GAAA,CAAA8B,KAAA,CAAA,CAAA,SAAA,CAAApC,EAAA,CAAA,6GAPiBkB,CAAAA,CAAAA,CAAAA,CAAU,CAAA,aAAiB,EAYnD,CAAA,GAGP,CAAA,CAAA,KAAA,CAAA,KAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA","file":"index.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n'use client';\nimport { cn } from '@/lib/utils';\nimport 'client-only';\nimport { cva } from 'class-variance-authority';\nimport { useContext } from 'react';\nimport {\n Input,\n Label,\n LabelContext,\n NumberField,\n Slider as RACSlider,\n type SliderProps as RACSliderProps,\n SliderTrack as RACSliderTrack,\n SliderStateContext,\n SliderThumb,\n Text,\n useSlottedContext,\n} from 'react-aria-components';\nimport { Tooltip } from '../tooltip';\n\nconst sliderVariants = cva('grid gap-s', {\n variants: {\n layout: {\n stacked: '',\n inline: '',\n },\n orientation: {\n vertical: 'h-full w-fit',\n horizontal: 'h-xl w-full',\n },\n },\n compoundVariants: [\n {\n layout: 'stacked',\n orientation: 'horizontal',\n className: 'grid-cols-[auto_1fr_auto] grid-rows-[auto_auto_auto]',\n },\n {\n layout: 'inline',\n orientation: 'horizontal',\n className: 'grid-cols-[auto_auto_1fr_auto_auto] grid-rows-1 items-center',\n },\n {\n layout: 'stacked',\n orientation: 'vertical',\n className: 'grid-cols-[auto_auto_auto] grid-rows-[auto_auto_1fr_auto]',\n },\n {\n layout: 'inline',\n orientation: 'vertical',\n className: 'grid-cols-[auto_1fr_auto] grid-rows-[auto_auto_1fr_auto]',\n },\n ],\n});\n\nconst minValueVariants = cva('font-display text-body-m text-default-dark', {\n variants: {\n orientation: {\n horizontal: '',\n vertical: 'col-start-1 row-start-4',\n },\n layout: {\n inline: '',\n stacked: '',\n },\n },\n compoundVariants: [\n {\n layout: 'stacked',\n orientation: 'horizontal',\n className: 'col-start-1 row-start-3',\n },\n {\n layout: 'inline',\n orientation: 'horizontal',\n className: 'order-2',\n },\n {\n layout: 'stacked',\n orientation: 'vertical',\n className: 'self-end justify-self-end',\n },\n {\n layout: 'inline',\n orientation: 'vertical',\n className: 'justify-self-center',\n },\n ],\n});\n\nconst maxValueVariants = cva('font-display text-body-m text-default-dark', {\n variants: {\n orientation: {\n horizontal: '',\n vertical: 'col-start-1 row-start-2',\n },\n layout: {\n inline: '',\n stacked: '',\n },\n },\n compoundVariants: [\n {\n layout: 'stacked',\n orientation: 'horizontal',\n className: 'col-start-3 row-start-3 justify-self-end',\n },\n {\n layout: 'inline',\n orientation: 'horizontal',\n className: 'order-4',\n },\n {\n layout: 'stacked',\n orientation: 'vertical',\n className: 'justify-self-end',\n },\n ],\n});\n\nconst sliderTrackVariants = cva('relative', {\n variants: {\n orientation: {\n horizontal: 'h-s w-full',\n vertical: 'h-full w-s',\n },\n layout: {\n inline: '',\n stacked: '',\n },\n },\n compoundVariants: [\n {\n orientation: 'horizontal',\n layout: 'stacked',\n className: 'col-span-3 row-start-2',\n },\n {\n orientation: 'horizontal',\n layout: 'inline',\n className: 'order-3',\n },\n {\n orientation: 'vertical',\n layout: 'stacked',\n className: 'col-start-2 row-span-3 row-start-2',\n },\n {\n orientation: 'vertical',\n layout: 'inline',\n className: 'col-start-1 row-start-3 justify-self-center',\n },\n ],\n});\n\nconst inputVariants = cva('flex gap-s', {\n variants: {\n orientation: {\n horizontal: 'flex-row',\n vertical: 'flex-col-reverse',\n },\n layout: {\n inline: 'order-5',\n stacked: 'col-start-3 row-start-1',\n },\n },\n compoundVariants: [\n {\n layout: 'inline',\n orientation: 'horizontal',\n className: 'order-5',\n },\n {\n layout: 'inline',\n orientation: 'vertical',\n className: 'col-span-3 col-start-1',\n },\n {\n layout: 'stacked',\n orientation: 'vertical',\n className: 'row-start-4',\n },\n ],\n});\n\nconst labelVariants = cva('text-default-light', {\n variants: {\n orientation: {\n horizontal: '',\n vertical: '',\n },\n layout: {\n inline: 'order-1',\n stacked: 'col-start-1',\n },\n },\n compoundVariants: [\n {\n layout: 'stacked',\n orientation: 'vertical',\n className: 'col-span-2',\n },\n {\n layout: 'inline',\n orientation: 'vertical',\n className: 'col-span-3',\n },\n ],\n});\n\nconst sliderThumbVariants = cva(\n 'h-m w-m rounded-full bg-highlight-bold outline-highlight-bold/40 hover:outline-4 focus:outline-4',\n {\n variants: {\n orientation: {\n horizontal: 'translate-y-[50%]',\n vertical: 'translate-x-[40%]',\n },\n },\n },\n);\n\nconst sliderTrackBackgroundVariants = cva(\n 'absolute rounded-full bg-default-light/40',\n {\n variants: {\n orientation: {\n horizontal: 'top-[50%] h-xxs w-full translate-y-[50%]',\n vertical: 'left-[50%] h-full w-xxs ',\n },\n },\n },\n);\n\nconst sliderTrackValueVariants = cva('absolute rounded-full bg-highlight', {\n variants: {\n orientation: {\n horizontal: 'top-1/2 h-xxs translate-y-1/2',\n vertical: 'left-1/2 w-xxs',\n },\n },\n});\n\nexport interface SliderProps\n extends Omit<\n RACSliderProps,\n 'value' | 'defaultValue' | 'showOutput' | 'slot' | 'style' | 'formatOptions'\n > {\n className?: string;\n showInput?: boolean;\n showLabel?: boolean;\n layout: 'stacked' | 'inline';\n value?: number;\n defaultValue?: number;\n rangeValue?: [number, number];\n defaultRangeValue?: [number, number];\n isRange?: boolean;\n label: string;\n}\n\nexport const Slider = ({\n children,\n className,\n showInput = false,\n showLabel = true,\n layout = 'stacked',\n value,\n defaultValue,\n label,\n defaultRangeValue,\n rangeValue,\n minValue = 0,\n maxValue = 100,\n isRange = false,\n orientation = 'horizontal',\n ...props\n}: SliderProps) => {\n const sliderValue = isRange ? rangeValue : value;\n const sliderDefaultValue = isRange ? defaultRangeValue : defaultValue;\n\n return (\n <RACSlider\n className={cn(sliderVariants({ orientation, layout }))}\n minValue={minValue}\n maxValue={maxValue}\n orientation={orientation}\n value={sliderValue}\n defaultValue={sliderDefaultValue}\n {...props}\n >\n {showLabel && (\n <Label className={labelVariants({ orientation, layout })}>\n {label}\n </Label>\n )}\n {showInput && (\n <div className={inputVariants({ orientation, layout })}>\n <SliderInput />\n </div>\n )}\n <RACSliderTrack className={sliderTrackVariants({ layout, orientation })}>\n {({ state }) => {\n const minValue = state.getThumbPercent(0);\n const maxValue = state.getThumbPercent(1) || minValue;\n const sizeInPercent = `${(state.values.length === 2 ? maxValue - minValue : minValue) * 100}%`;\n const startPercent =\n state.values.length === 2 ? `${Math.floor(minValue * 100)}%` : '0';\n return (\n <>\n <div className={sliderTrackBackgroundVariants({ orientation })} />\n {state.values.map((_, index) => {\n return (\n <>\n <div\n key={`slider-${index === 0 ? 'min' : 'max'}`}\n className={sliderTrackValueVariants({ orientation })}\n style={\n orientation === 'horizontal'\n ? {\n left: startPercent,\n width: sizeInPercent,\n }\n : {\n bottom: startPercent,\n height: sizeInPercent,\n }\n }\n />\n\n <SliderThumb\n key={`slider-thumb-${index === 0 ? 'min' : 'max'}`}\n index={index}\n className={sliderThumbVariants({ orientation })}\n >\n {!showInput && (\n <Tooltip>\n <Tooltip.Trigger>\n <div className='size-full' />\n </Tooltip.Trigger>\n <Tooltip.Body placement='top'>\n {state.getThumbValue(index)}\n </Tooltip.Body>\n </Tooltip>\n )}\n </SliderThumb>\n </>\n );\n })}\n </>\n );\n }}\n </RACSliderTrack>\n <Text slot='min' className={minValueVariants({ layout, orientation })}>\n {minValue}\n </Text>\n <Text slot='max' className={maxValueVariants({ layout, orientation })}>\n {maxValue}\n </Text>\n </RACSlider>\n );\n};\n\nexport type RangeSliderProps = Omit<\n SliderProps,\n 'isRange' | 'defaultRangeValue' | 'rangeValue' | 'defaultValue' | 'value'\n> & {\n defaultValue: SliderProps['defaultRangeValue'];\n value: SliderProps['rangeValue'];\n};\n\nexport const RangeSlider = ({\n defaultValue,\n value,\n ...props\n}: RangeSliderProps) => {\n return (\n <Slider\n {...props}\n isRange\n defaultRangeValue={defaultValue}\n rangeValue={value}\n />\n );\n};\n\nfunction SliderInput({ className }: { className?: string }) {\n const state = useContext(SliderStateContext);\n const labelProps = useSlottedContext(LabelContext);\n return (\n <>\n {state?.values.map((value: number, index: number) => (\n <NumberField\n key={`number-field-${index === 0 ? 'min' : 'max'}`}\n aria-labelledby={labelProps?.id}\n value={value}\n onChange={(v) => state.setThumbValue(0, v)}\n >\n <Input\n className={cn(\n 'w-[50px] rounded-medium border border-interactive px-s py-xs font-display text-body-m text-default-light',\n className,\n )}\n />\n </NumberField>\n ))}\n </>\n );\n}\n"]}
@@ -1,10 +1,11 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import * as react from 'react';
3
+ import { ProviderProps } from '../../lib/types.js';
3
4
  import { ContextValue } from 'react-aria-components';
4
- import { SwitchProps, SwitchProviderProps } from './types.js';
5
+ import { SwitchProps } from './types.js';
5
6
 
6
7
  declare const SwitchContext: react.Context<ContextValue<SwitchProps, HTMLLabelElement>>;
7
- declare function SwitchProvider({ children, ...props }: SwitchProviderProps): react_jsx_runtime.JSX.Element;
8
+ declare function SwitchProvider({ children, ...props }: ProviderProps<SwitchProps>): react_jsx_runtime.JSX.Element;
8
9
  declare namespace SwitchProvider {
9
10
  var displayName: string;
10
11
  }
@@ -1,2 +1,2 @@
1
- import'client-only';import {createContext}from'react';import {useContextProps,Switch,composeRenderProps}from'react-aria-components';import {SwitchStyles}from'./styles.js';import {jsx,jsxs,Fragment}from'react/jsx-runtime';var {switch:P,control:d,label:u}=SwitchStyles(),c=createContext(null);function a({children:t,...e}){return jsx(c.Provider,{value:e,children:t})}a.displayName="Switch.Provider";function l({ref:t,...e}){[e,t]=useContextProps(e,t??null,c);let{children:n,classNames:s,...m}=e;return jsx(Switch,{...m,ref:t,className:composeRenderProps(s?.switch,o=>P({className:o})),children:composeRenderProps(n,o=>jsxs(Fragment,{children:[jsx("span",{className:d({className:s?.control})}),o&&jsx("span",{className:u({className:s?.label}),children:o})]}))})}l.displayName="Switch";l.Provider=a;export{l as Switch,c as SwitchContext};//# sourceMappingURL=index.js.map
1
+ import {jsx,jsxs,Fragment}from'react/jsx-runtime';import'client-only';import {createContext}from'react';import {useContextProps,Switch,composeRenderProps}from'react-aria-components';import {SwitchStyles}from'./styles.js';const {switch:S,control:d,label:u}=SwitchStyles(),c=createContext(null);function a({children:t,...e}){return jsx(c.Provider,{value:e,children:t})}a.displayName="Switch.Provider";function l({ref:t,...e}){[e,t]=useContextProps(e,t??null,c);const{children:n,classNames:s,...p}=e;return jsx(Switch,{...p,ref:t,className:composeRenderProps(s?.switch,o=>S({className:o})),children:composeRenderProps(n,o=>jsxs(Fragment,{children:[jsx("span",{className:d({className:s?.control})}),o&&jsx("span",{className:u({className:s?.label}),children:o})]}))})}l.displayName="Switch",l.Provider=a;export{l as Switch,c as SwitchContext};//# sourceMappingURL=index.js.map
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/switch/index.tsx"],"names":["switchClassNames","control","label","SwitchStyles","SwitchContext","createContext","SwitchProvider","children","jsx","props","Switch","ref","useContextProps","classNames","AriaSwitch","composeRenderProps","className","jsxs","Fragment"],"mappings":"6NAyBM,IAAE,CAAA,MAAQA,CAAAA,CAAkB,QAAAC,CAAAA,CAAS,CAAA,KAAAC,CAAM,CAAA,CAAIC,aAAa,EAErDC,CAAAA,CACXC,CAAAA,aAA2D,CAAA,IAAI,EAEjE,SAASC,CAAe,CAAE,SAAAC,CAAAA,CAAU,CAAA,GAAS,CAAA,CAAwB,CACnE,CAAA,OACEC,GAACJ,CAAAA,CAAc,CAAA,QAAd,CAAuB,CAAA,KAAOK,CAAAA,CAAQ,CAAA,QAAAF,CAAAA,CAAS,CAEpD,CACAD,CAAAA,CAAe,CAAA,WAAc,CAAA,iBAEtB,UAASI,CAAO,CAAE,CAAA,GAAAC,CAAAA,CAAK,IAAS,CAAA,CAAgB,CACrD,CAACF,EAAOE,CAAG,CAAA,CAAIC,CAAAA,eAAgBH,CAAAA,CAAOE,CAAAA,CAAAA,EAAO,IAAMP,CAAa,CAAA,CAEhE,IAAQ,CAAA,QAAAG,CAAAA,CAAU,CAAA,UAAAM,EAAY,CAAA,GAAQ,CAAA,CAAIJ,CAAAA,CAE1C,QACED,GAACM,CAAAA,MAAA,CACE,CAAA,IACD,CAAA,GAAKH,CAAAA,CACL,CAAA,SAAWI,CAAAA,kBAAmBF,IAAY,MAASG,CAAAA,CAAAA,EACjDhB,CAAiB,CAAE,UAAAgB,CAAU,CAAC,CAChC,CAAA,CAEC,SAAAD,CAAAA,kBAAmBR,CAAAA,CAAWA,CAAAA,CAAAA,EAC7BU,IAAAC,SAAA,CACE,CAAA,QAAA,CAAAV,CAAAA,GAAC,CAAA,MAAA,CAAK,UAAWP,CAAAA,CAAQ,CAAE,CAAA,SAAWY,CAAAA,CAAAA,SAAqB,CAAA,CAAG,CAAA,CAC7DN,CAAAA,CAAAA,KACE,CAAA,MAAA,CAAK,CAAA,SAAWL,CAAAA,CAAM,CAAE,UAAWW,CAAAA,CAAAA,EAAY,KAAO,CAAA,CACpD,SAAAN,CAAAA,CACH,CAAA,CAAA,CAEJ,CACD,CAAA,CACH,CAEJ,CACAG,CAAAA,CAAO,CAAA,WAAc,CAAA,QACrBA,EAAO,CAAA,QAAWJ,CAAAA,CAAAA","file":"index.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n'use client';\n\nimport 'client-only';\nimport { createContext } from 'react';\nimport {\n Switch as AriaSwitch,\n type ContextValue,\n composeRenderProps,\n useContextProps,\n} from 'react-aria-components';\nimport { SwitchStyles } from './styles';\nimport type { SwitchProps, SwitchProviderProps } from './types';\n\n// \"switch\" is a reserved term in JS\nconst { switch: switchClassNames, control, label } = SwitchStyles();\n\nexport const SwitchContext =\n createContext<ContextValue<SwitchProps, HTMLLabelElement>>(null);\n\nfunction SwitchProvider({ children, ...props }: SwitchProviderProps) {\n return (\n <SwitchContext.Provider value={props}>{children}</SwitchContext.Provider>\n );\n}\nSwitchProvider.displayName = 'Switch.Provider';\n\nexport function Switch({ ref, ...props }: SwitchProps) {\n [props, ref] = useContextProps(props, ref ?? null, SwitchContext);\n\n const { children, classNames, ...rest } = props;\n\n return (\n <AriaSwitch\n {...rest}\n ref={ref}\n className={composeRenderProps(classNames?.switch, (className) =>\n switchClassNames({ className }),\n )}\n >\n {composeRenderProps(children, (children) => (\n <>\n <span className={control({ className: classNames?.control })} />\n {children && (\n <span className={label({ className: classNames?.label })}>\n {children}\n </span>\n )}\n </>\n ))}\n </AriaSwitch>\n );\n}\nSwitch.displayName = 'Switch';\nSwitch.Provider = SwitchProvider;\n"]}
1
+ {"version":3,"sources":["../../../src/components/switch/index.tsx"],"names":["SwitchStyles","SwitchContext","createContext","m","props","r","SwitchProvider","ref","useContextProps","rest","h","switchClassNames","children","jsxs","Fragment","v","N","jsx","Switch"],"mappings":"6NA0BQ,MAAA,CAAA,gBAAmC,CAAA,CAAA,CAAA,KAAUA,EAAa,CAAA,CAErDC,YAAAA,EACXC,CAA2D,CAAA,CAAAC,aAAA,CAAI,IAEjE,EAAA,oBAAoC,CAAA,CAAGC,CAAM,GAC3C,CAAA,CAAA,CAAA,CAAA,OACiBC,GAAA,CAAA,CAAA,CAAA,QAAS,CAAA,CAAA,KAAe,CAAA,CAAA,CAAA,QAE3C,CACAC,CAAAA,CAAe,CAAA,CAAA,CAAA,CAAA,WAAc,CAAA,2BAEJ,CAAA,CAAA,CAAAC,KAAQH,CAAM,GACrC,CAACA,EAAOG,CAAG,CAAA,CAAIC,CAAAA,CAAgBJ,CAAAA,CAAOG,eAAAA,CAAAA,CAAO,CAAA,CAAA,EAAA,IAE7C,SAAQ,CAAA,QAAU,CAAA,CAAA,CAAA,UAAY,CAAA,CAAGE,CAAK,GAAIL,CAE1C,WACGC,GACE,CAAAK,MAAA,CAAGD,IACJ,CAAA,CAAKF,GACL,CAAA,CAAA,CAAA,4BAA0C,CAAA,CAAA,EAAA,MACxCI,CAAAA,CAAiB,cACnB,CAAA,CAEC,YAAmBC,CAAWA,kBAAAA,CAAAA,CAC7BC,CAAAA,CAAAC,EAAAC,IACE,CAAAC,QAAA,CAAA,CAAA,QAAC,CAAA,CAAAX,GAAA,CAAA,iBAA0B,CAAA,CAAA,CAAA,CAAA,SAAuB,WAAY,CAC7DO,CAAAA,CAAAA,CACCK,EAAC,EAAAZ,GAAA,CAAA,MAAK,CAAA,CAAA,SAAmB,aAAuB,CAAA,CAAA,EAAA,gBAEhD,CAAA,CAEJ,CACD,CAAA,CACH,CAEJ,CACAa,CAAAA,CAAO,CAAA,CAAA,CAAA,CAAA,WAAc,CAAA,QACd,CAAA,CAAA,CAAA,QAAWZ,CAAAA,CAAAA","file":"index.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n'use client';\n\nimport 'client-only';\nimport type { ProviderProps } from '@/lib/types';\nimport { createContext } from 'react';\nimport {\n Switch as AriaSwitch,\n type ContextValue,\n composeRenderProps,\n useContextProps,\n} from 'react-aria-components';\nimport { SwitchStyles } from './styles';\nimport type { SwitchProps } from './types';\n\n// \"switch\" is a reserved term in JS\nconst { switch: switchClassNames, control, label } = SwitchStyles();\n\nexport const SwitchContext =\n createContext<ContextValue<SwitchProps, HTMLLabelElement>>(null);\n\nfunction SwitchProvider({ children, ...props }: ProviderProps<SwitchProps>) {\n return (\n <SwitchContext.Provider value={props}>{children}</SwitchContext.Provider>\n );\n}\nSwitchProvider.displayName = 'Switch.Provider';\n\nexport function Switch({ ref, ...props }: SwitchProps) {\n [props, ref] = useContextProps(props, ref ?? null, SwitchContext);\n\n const { children, classNames, ...rest } = props;\n\n return (\n <AriaSwitch\n {...rest}\n ref={ref}\n className={composeRenderProps(classNames?.switch, (className) =>\n switchClassNames({ className }),\n )}\n >\n {composeRenderProps(children, (children) => (\n <>\n <span className={control({ className: classNames?.control })} />\n {children && (\n <span className={label({ className: classNames?.label })}>\n {children}\n </span>\n )}\n </>\n ))}\n </AriaSwitch>\n );\n}\nSwitch.displayName = 'Switch';\nSwitch.Provider = SwitchProvider;\n"]}
@@ -1,19 +1,20 @@
1
1
  import * as tailwind_variants from 'tailwind-variants';
2
+ import * as tailwind_merge from 'tailwind-merge';
2
3
 
3
4
  declare const SwitchStyles: tailwind_variants.TVReturnType<{
4
5
  [key: string]: {
5
- [key: string]: tailwind_variants.ClassValue | {
6
- switch?: tailwind_variants.ClassValue;
7
- label?: tailwind_variants.ClassValue;
8
- control?: tailwind_variants.ClassValue;
6
+ [key: string]: tailwind_merge.ClassNameValue | {
7
+ label?: tailwind_merge.ClassNameValue;
8
+ switch?: tailwind_merge.ClassNameValue;
9
+ control?: tailwind_merge.ClassNameValue;
9
10
  };
10
11
  };
11
12
  } | {
12
13
  [x: string]: {
13
- [x: string]: tailwind_variants.ClassValue | {
14
- switch?: tailwind_variants.ClassValue;
15
- label?: tailwind_variants.ClassValue;
16
- control?: tailwind_variants.ClassValue;
14
+ [x: string]: tailwind_merge.ClassNameValue | {
15
+ label?: tailwind_merge.ClassNameValue;
16
+ switch?: tailwind_merge.ClassNameValue;
17
+ control?: tailwind_merge.ClassNameValue;
17
18
  };
18
19
  };
19
20
  } | {}, {
@@ -22,10 +23,10 @@ declare const SwitchStyles: tailwind_variants.TVReturnType<{
22
23
  label: string[];
23
24
  }, undefined, {
24
25
  [key: string]: {
25
- [key: string]: tailwind_variants.ClassValue | {
26
- switch?: tailwind_variants.ClassValue;
27
- label?: tailwind_variants.ClassValue;
28
- control?: tailwind_variants.ClassValue;
26
+ [key: string]: tailwind_merge.ClassNameValue | {
27
+ label?: tailwind_merge.ClassNameValue;
28
+ switch?: tailwind_merge.ClassNameValue;
29
+ control?: tailwind_merge.ClassNameValue;
29
30
  };
30
31
  };
31
32
  } | {}, {
@@ -1,2 +1,2 @@
1
- import {tv}from'./../../lib/utils.js';var i=tv({slots:{switch:"group/switch flex cursor-pointer items-center gap-s disabled:cursor-not-allowed",control:["flex rounded-round bg-transparent p-xxs outline outline-interactive before:mr-l before:block before:size-m before:rounded-full before:bg-default-dark","group-enabled/switch:group-focus/switch:bg-interactive-hover-dark group-enabled/switch:group-focus/switch:outline-interactive-hover group-enabled/switch:group-focus/switch:before:bg-interactive-hover","group-enabled/switch:group-hover/switch:bg-interactive-hover-dark group-enabled/switch:group-hover/switch:outline-interactive-hover group-enabled/switch:group-hover/switch:before:bg-interactive-hover","group-enabled/switch:group-selected/switch:outline-highlight group-selected/switch:before:mr-0 group-selected/switch:before:ml-l group-enabled/switch:group-selected/switch:before:bg-highlight","group-enabled/switch:group-selected/switch:group-focus/switch:bg-highlight-subtle group-enabled/switch:group-selected/switch:group-focus/switch:outline-interactive-hover group-enabled/switch:group-selected/switch:group-focus/switch:before:bg-highlight","group-enabled/switch:group-selected/switch:group-hover/switch:bg-highlight-subtle group-enabled/switch:group-selected/switch:group-hover/switch:outline-highlight group-enabled/switch:group-selected/switch:group-hover/switch:before:bg-highlight","group-disabled/switch:bg-interactive-disabled group-disabled/switch:outline-interactive-disabled group-disabled/switch:before:bg-disabled"],label:["text-body-s text-interactive-default","group-disabled/switch:text-interactive-disabled"]}});export{i as SwitchStyles};//# sourceMappingURL=styles.js.map
1
+ import {tv}from'./../../lib/utils.js';const i=tv({slots:{switch:"group/switch flex cursor-pointer items-center gap-s disabled:cursor-not-allowed",control:["flex rounded-round bg-transparent p-xxs outline outline-interactive before:mr-l before:block before:size-m before:rounded-full before:bg-default-dark","group-enabled/switch:group-focus/switch:bg-interactive-hover-dark group-enabled/switch:group-focus/switch:outline-interactive-hover group-enabled/switch:group-focus/switch:before:bg-interactive-hover","group-enabled/switch:group-hover/switch:bg-interactive-hover-dark group-enabled/switch:group-hover/switch:outline-interactive-hover group-enabled/switch:group-hover/switch:before:bg-interactive-hover","group-enabled/switch:group-selected/switch:outline-highlight group-selected/switch:before:mr-0 group-selected/switch:before:ml-l group-enabled/switch:group-selected/switch:before:bg-highlight","group-enabled/switch:group-selected/switch:group-focus/switch:bg-highlight-subtle group-enabled/switch:group-selected/switch:group-focus/switch:outline-interactive-hover group-enabled/switch:group-selected/switch:group-focus/switch:before:bg-highlight","group-enabled/switch:group-selected/switch:group-hover/switch:bg-highlight-subtle group-enabled/switch:group-selected/switch:group-hover/switch:outline-highlight group-enabled/switch:group-selected/switch:group-hover/switch:before:bg-highlight","group-disabled/switch:bg-interactive-disabled group-disabled/switch:outline-interactive-disabled group-disabled/switch:before:bg-disabled"],label:["text-body-s text-interactive-default","group-disabled/switch:text-interactive-disabled"]}});export{i as SwitchStyles};//# sourceMappingURL=styles.js.map
2
2
  //# sourceMappingURL=styles.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/switch/styles.ts"],"names":["e"],"mappings":"sCAeE,IAAA,CAAA,CAAAA,EAAA,CAAO,CACL,KAAA,CAAA,CACE,MAAA,CAAA,iFACF,CAAA,OACE,CAAA,CAAA,uJACA,CAAA,yMACA,CAAA,yMACA,CAAA,iMACA,CAAA,6PACA,CAAA,qPACA,CAAA,2IAEF,CAAO,CACL,KAAA,CAAA,CAAA,sCACA,CAAA,iDAGL,CAAA,CAAA,CAAA","file":"styles.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { tv } from '@/lib/utils';\n\nexport const SwitchStyles = tv({\n slots: {\n switch:\n 'group/switch flex cursor-pointer items-center gap-s disabled:cursor-not-allowed',\n control: [\n 'flex rounded-round bg-transparent p-xxs outline outline-interactive before:mr-l before:block before:size-m before:rounded-full before:bg-default-dark',\n 'group-enabled/switch:group-focus/switch:bg-interactive-hover-dark group-enabled/switch:group-focus/switch:outline-interactive-hover group-enabled/switch:group-focus/switch:before:bg-interactive-hover',\n 'group-enabled/switch:group-hover/switch:bg-interactive-hover-dark group-enabled/switch:group-hover/switch:outline-interactive-hover group-enabled/switch:group-hover/switch:before:bg-interactive-hover',\n 'group-enabled/switch:group-selected/switch:outline-highlight group-selected/switch:before:mr-0 group-selected/switch:before:ml-l group-enabled/switch:group-selected/switch:before:bg-highlight',\n 'group-enabled/switch:group-selected/switch:group-focus/switch:bg-highlight-subtle group-enabled/switch:group-selected/switch:group-focus/switch:outline-interactive-hover group-enabled/switch:group-selected/switch:group-focus/switch:before:bg-highlight',\n 'group-enabled/switch:group-selected/switch:group-hover/switch:bg-highlight-subtle group-enabled/switch:group-selected/switch:group-hover/switch:outline-highlight group-enabled/switch:group-selected/switch:group-hover/switch:before:bg-highlight',\n 'group-disabled/switch:bg-interactive-disabled group-disabled/switch:outline-interactive-disabled group-disabled/switch:before:bg-disabled',\n ],\n label: [\n 'text-body-s text-interactive-default',\n 'group-disabled/switch:text-interactive-disabled',\n ],\n },\n});\n"]}
1
+ {"version":3,"sources":["../../../src/components/switch/styles.ts"],"names":["e"],"mappings":"sCAeE,MAAA,CAAO,CACLA,EAAA,CAAA,CAAA,KACE,CAAA,CAAA,MAAA,CAAA,iFAEA,CAAA,OAAA,CAAA,CAAA,uJACA,CAAA,yMACA,CAAA,yMACA,CAAA,iMACA,CAAA,6PACA,CAAA,qPACA,CAAA,2IAGA,CAAA,CAAA,KAAA,CAAA,CAAA,sCACA,CAAA,iDAGL,CAAA,CAAA,CAAA","file":"styles.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { tv } from '@/lib/utils';\n\nexport const SwitchStyles = tv({\n slots: {\n switch:\n 'group/switch flex cursor-pointer items-center gap-s disabled:cursor-not-allowed',\n control: [\n 'flex rounded-round bg-transparent p-xxs outline outline-interactive before:mr-l before:block before:size-m before:rounded-full before:bg-default-dark',\n 'group-enabled/switch:group-focus/switch:bg-interactive-hover-dark group-enabled/switch:group-focus/switch:outline-interactive-hover group-enabled/switch:group-focus/switch:before:bg-interactive-hover',\n 'group-enabled/switch:group-hover/switch:bg-interactive-hover-dark group-enabled/switch:group-hover/switch:outline-interactive-hover group-enabled/switch:group-hover/switch:before:bg-interactive-hover',\n 'group-enabled/switch:group-selected/switch:outline-highlight group-selected/switch:before:mr-0 group-selected/switch:before:ml-l group-enabled/switch:group-selected/switch:before:bg-highlight',\n 'group-enabled/switch:group-selected/switch:group-focus/switch:bg-highlight-subtle group-enabled/switch:group-selected/switch:group-focus/switch:outline-interactive-hover group-enabled/switch:group-selected/switch:group-focus/switch:before:bg-highlight',\n 'group-enabled/switch:group-selected/switch:group-hover/switch:bg-highlight-subtle group-enabled/switch:group-selected/switch:group-hover/switch:outline-highlight group-enabled/switch:group-selected/switch:group-hover/switch:before:bg-highlight',\n 'group-disabled/switch:bg-interactive-disabled group-disabled/switch:outline-interactive-disabled group-disabled/switch:before:bg-disabled',\n ],\n label: [\n 'text-body-s text-interactive-default',\n 'group-disabled/switch:text-interactive-disabled',\n ],\n },\n});\n"]}
@@ -1,4 +1,4 @@
1
- import { RefAttributes, PropsWithChildren } from 'react';
1
+ import { RefAttributes } from 'react';
2
2
  import { SwitchProps as SwitchProps$1 } from 'react-aria-components';
3
3
 
4
4
  type SwitchProps = Omit<SwitchProps$1, 'className'> & RefAttributes<HTMLLabelElement> & {
@@ -8,6 +8,5 @@ type SwitchProps = Omit<SwitchProps$1, 'className'> & RefAttributes<HTMLLabelEle
8
8
  label?: string;
9
9
  };
10
10
  };
11
- type SwitchProviderProps = PropsWithChildren<SwitchProps>;
12
11
 
13
- export type { SwitchProps, SwitchProviderProps };
12
+ export type { SwitchProps };
@@ -1,2 +1,2 @@
1
- import {containsExactChildren}from'./../../lib/react.js';import {cn}from'./../../lib/utils.js';import'client-only';import {cva}from'cva';import {Tabs,TabList,Tab,TabPanel}from'react-aria-components';import {jsx}from'react/jsx-runtime';var s=({children:a,className:e,orientation:r="horizontal",isDisabled:t=false,...o})=>(containsExactChildren({children:a,componentName:s.displayName,restrictions:{[n.displayName]:{min:1,max:1}}}),jsx(Tabs,{orientation:r,isDisabled:t,className:cn("group flex w-content flex-row orientation-horizontal:flex-col",e),...o,children:a}));s.displayName="Tabs";var x=cva("flex orientation-horizontal:flex-row flex-col",{variants:{variant:{icons:"[&>*]:p-xs orientation-horizontal:[&>*]:pr-s orientation-horizontal:[&>*]:pl-s [&>*]:leading-[0]",default:"[&>*]:p-s [&>*]:text-header-m"},drawer:{left:"orientation-vertical:gap-xs rounded-r-large bg-surface-default p-s",right:"orientation-vertical:gap-xs rounded-l-large bg-surface-default p-s",top:"orientation-vertical:gap-xs rounded-b-large bg-surface-default p-s",bottom:"orientation-vertical:gap-xs rounded-t-large bg-surface-default p-s"}}}),n=({children:a,className:e,variant:r="default",drawer:t=void 0,...o})=>(containsExactChildren({children:a,componentName:n.displayName,restrictions:{[d.displayName]:{min:1}}}),jsx(TabList,{className:cn(x({variant:r,drawer:t}),e),...o,children:a}));n.displayName="Tabs.List";s.List=n;var z=cn("fg-default-dark cursor-pointer p-s outline-none","rounded-medium group-orientation-horizontal:rounded-small group-orientation-horizontal:rounded-b-none","group-orientation-horizontal:border-static-light group-orientation-horizontal:border-b","group-orientation-vertical:border group-orientation-vertical:border-transparent"),N=cva(z,{variants:{isSelected:{true:"fg-highlight bg-highlight-subtle group-orientation-horizontal:border-highlight"},isHovered:{true:"fg-default-light group-orientation-horizontal:border-interactive-hover"},isFocused:{true:"fg-default-light group-orientation-horizontal:border-interactive-hover"},isDisabled:{true:"fg-disabled cursor-not-allowed group-orientation-horizontal:border-interactive-disabled"}},compoundVariants:[{isSelected:true,isHovered:true,className:"fg-highlight group-orientation-horizontal:border-highlight"},{isSelected:true,isFocused:true,className:"fg-highlight group-orientation-horizontal:border-interactive-hover group-orientation-vertical:border-interactive-hover"},{isDisabled:true,isSelected:true,className:"fg-disabled bg-interactive-disabled group-orientation-horizontal:border-interactive-disabled"}]}),d=({id:a,children:e,className:r,isDisabled:t=false,...o})=>jsx(Tab,{id:a,className:({isSelected:c,isHovered:g,isFocused:h,isDisabled:f})=>cn(N({isSelected:c,isHovered:g,isFocused:h,isDisabled:f}),r),isDisabled:t,...o,children:e});d.displayName="Tabs.Tab";s.Tab=d;var u=({id:a,children:e,className:r,...t})=>jsx(TabPanel,{id:a,className:cn("fg-default-light p-s group-orientation-vertical:pt-0 group-orientation-horizontal:pl-0",r),...t,children:e});u.displayName="Tabs.Panel";s.Panel=u;export{s as Tabs};//# sourceMappingURL=index.js.map
1
+ import {jsx}from'react/jsx-runtime';import {containsExactChildren}from'./../../lib/react.js';import {cn}from'./../../lib/utils.js';import'client-only';import {cva}from'class-variance-authority';import {Tabs,TabList,Tab,TabPanel}from'react-aria-components';const s=({children:a,className:e,orientation:r="horizontal",isDisabled:t=false,...o})=>(containsExactChildren({children:a,componentName:s.displayName,restrictions:[[n,{min:1,max:1}]]}),jsx(Tabs,{orientation:r,isDisabled:t,className:cn("group flex w-content flex-row orientation-horizontal:flex-col",e),...o,children:a}));s.displayName="Tabs";const x=cva("flex orientation-horizontal:flex-row flex-col",{variants:{variant:{icons:"[&>*]:p-xs orientation-horizontal:[&>*]:pr-s orientation-horizontal:[&>*]:pl-s [&>*]:leading-[0]",default:"[&>*]:p-s [&>*]:text-header-m"},drawer:{left:"orientation-vertical:gap-xs rounded-r-large bg-surface-default p-s",right:"orientation-vertical:gap-xs rounded-l-large bg-surface-default p-s",top:"orientation-vertical:gap-xs rounded-b-large bg-surface-default p-s",bottom:"orientation-vertical:gap-xs rounded-t-large bg-surface-default p-s"}}}),n=({children:a,className:e,variant:r="default",drawer:t=void 0,...o})=>(containsExactChildren({children:a,componentName:n.displayName,restrictions:[[d,{min:1}]]}),jsx(TabList,{className:cn(x({variant:r,drawer:t}),e),...o,children:a}));n.displayName="Tabs.List",s.List=n;const z=cn("fg-default-dark cursor-pointer p-s outline-none","rounded-medium group-orientation-horizontal:rounded-small group-orientation-horizontal:rounded-b-none","group-orientation-horizontal:border-static-light group-orientation-horizontal:border-b","group-orientation-vertical:border group-orientation-vertical:border-transparent"),A=cva(z,{variants:{isSelected:{true:"fg-highlight bg-highlight-subtle group-orientation-horizontal:border-highlight"},isHovered:{true:"fg-default-light group-orientation-horizontal:border-interactive-hover"},isFocused:{true:"fg-default-light group-orientation-horizontal:border-interactive-hover"},isDisabled:{true:"fg-disabled cursor-not-allowed group-orientation-horizontal:border-interactive-disabled"}},compoundVariants:[{isSelected:true,isHovered:true,className:"fg-highlight group-orientation-horizontal:border-highlight"},{isSelected:true,isFocused:true,className:"fg-highlight group-orientation-horizontal:border-interactive-hover group-orientation-vertical:border-interactive-hover"},{isDisabled:true,isSelected:true,className:"fg-disabled bg-interactive-disabled group-orientation-horizontal:border-interactive-disabled"}]}),d=({id:a,children:e,className:r,isDisabled:t=false,...o})=>jsx(Tab,{id:a,className:({isSelected:c,isHovered:g,isFocused:h,isDisabled:f})=>cn(A({isSelected:c,isHovered:g,isFocused:h,isDisabled:f}),r),isDisabled:t,...o,children:e});d.displayName="Tabs.Tab",s.Tab=d;const u=({id:a,children:e,className:r,...t})=>jsx(TabPanel,{id:a,className:cn("fg-default-light p-s group-orientation-vertical:pt-0 group-orientation-horizontal:pl-0",r),...t,children:e});u.displayName="Tabs.Panel",s.Panel=u;export{s as Tabs};//# sourceMappingURL=index.js.map
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/tabs/index.tsx"],"names":["children","orientation","containsExactChildren","p","Tabs","jsx","AriaTabs","l","v","isDisabled","cn","i","cva","className","TabList","AriaTabList","tabListStyles","variant","tabBaseStyles","b","AriaTab","id","T","isSelected","isHovered","isFocused","Tab","TabPanel","AriaTabPanel","P"],"mappings":"2OA+BEA,IAAAA,CACA,CAAA,CAAA,CAAA,SACA,CAAA,CAAA,SAAA,CAAAC,CAAAA,CAAc,aACd,CAAA,YAAa,CAAA,UAEf,CACEC,CAAAA,CAAsB,KACpB,CAAA,GAAA,CAAA,CAAA,IACAC,qBAAA,CAAA,CAAA,QAAA,CAAA,CAAA,CAAeC,aAAK,CACpB,CAAA,CAAA,WAAc,CACZ,cAAoB,CAAA,CAAG,CAAE,WAAe,EAE5C,CAAC,GAGCC,CAACC,CAAAA,CAAA,GACC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAAC,GAAA,CAAAC,IAAaP,CAAAA,CACb,WAAYQ,CAAAA,CACZ,WAAWC,CACT,CAAA,CAAA,SAAA,CAAAC,EAAA,CAAA,+DAKD,CAAA,CAAA,CAAA,CAAAX,GACH,CAAA,CAIJI,cAAmB,CAAA,CAAA,WASGQ,CAAAA,gEAElB,CAAA,CAAA,QACE,CAAA,CAAA,OACE,CAAA,CAAA,KAAA,CAAA,kGACO,CAAA,OAAA,CAAA,+BAGT,CAAM,CAAA,MAAA,CAAA,CAAA,IAAA,CAAA,+IAGD,CAAA,GAAA,CAAA,oEAEH,CAAA,MAAA,CAAA,oEAMN,CAAA,CAAA,CAAA,CAAAZ,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,CAAAA,CAAa,CAAA,UAIXJ,CAAAA,CAACe,CAAAA,KACC,CAAA,GAAIC,CACJ,CAAA,GAAAd,GAAA,CAAAe,GAAA,CAAA,CAAA,EAAY,CAAE,CAAA,CAAA,SAAAC,CAAAA,CAAY,WAAAC,CAAW,CAAA,CAAA,UAAW,CAAA,CAAA,SAAAf,CAAW,CAAA,CAAA,UAE3C,CAAA,CAAA,CAAA,GAAAE,EAAA,CAAAY,CAAAA,CAAY,CAAA,WAAW,CAAA,CAAA,SAAAE,CAAW,CAAA,CAAA,SAAAhB,CAAW,CAAC,CAAA,UAI9D,CAAA,CAAA,CAAA,CAAA,CAAYA,CAAAA,CACX,WAEA,CAAA,CAAA,CAAAT,GACH,CAIJ0B,SAAI,CAAA,CAAA,CAAA,CAAA,CAAc,CAAA,CAAA,WACb,CAAA,UAICC,CAAW,CAAC,CAAE,GAAAN,CAAAA,CAAI,CAAA,IAAA,CAAA,CAAA,CAAA,CAAArB,EAAU,CAAA,CAAA,CAAA,QAAAa,CAAW,WAExCe,CAAA,CACC,CAAA,GAAIP,CACJ,CAAA,GAAAd,GAAA,CAAAsB,QAAA,CAAA,CAAA,EAAWnB,CACT,2GAKDV,GACH,CAIJ2B,SAAS,CAAA,CAAA,CAAA,CAAA,CAAc,CAAA,CAAA,WACvBvB,aAAauB,CAAAA,CAAAA,CAAAA,KAAAA,CAAAA,CAAAA","file":"index.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n'use client';\nimport { containsExactChildren } from '@/lib/react';\nimport { cn } from '@/lib/utils';\nimport 'client-only';\nimport { cva } from 'cva';\nimport {\n Tab as AriaTab,\n TabList as AriaTabList,\n type TabListProps as AriaTabListProps,\n TabPanel as AriaTabPanel,\n type TabPanelProps as AriaTabPanelProps,\n type TabProps as AriaTabProps,\n Tabs as AriaTabs,\n type TabsProps as AriaTabsProps,\n} from 'react-aria-components';\n\nexport interface TabsProps extends AriaTabsProps {}\n\nexport const Tabs = ({\n children,\n className,\n orientation = 'horizontal',\n isDisabled = false,\n ...rest\n}: TabsProps) => {\n containsExactChildren({\n children,\n componentName: Tabs.displayName,\n restrictions: {\n [TabList.displayName]: { min: 1, max: 1 },\n },\n });\n\n return (\n <AriaTabs\n orientation={orientation}\n isDisabled={isDisabled}\n className={cn(\n 'group flex w-content flex-row orientation-horizontal:flex-col',\n className,\n )}\n {...rest}\n >\n {children}\n </AriaTabs>\n );\n};\n\nTabs.displayName = 'Tabs';\n\nexport interface TabListProps extends AriaTabListProps<object> {\n /** Whether the tabs are displaying iconography or text. */\n variant?: 'default' | 'icons';\n /** Whether the tabs are used as drawer controls. */\n drawer?: 'left' | 'right' | 'top' | 'bottom';\n}\n\nconst tabListStyles = cva('flex orientation-horizontal:flex-row flex-col', {\n variants: {\n variant: {\n icons:\n '[&>*]:p-xs orientation-horizontal:[&>*]:pr-s orientation-horizontal:[&>*]:pl-s [&>*]:leading-[0]',\n default: '[&>*]:p-s [&>*]:text-header-m',\n },\n drawer: {\n left: 'orientation-vertical:gap-xs rounded-r-large bg-surface-default p-s',\n right:\n 'orientation-vertical:gap-xs rounded-l-large bg-surface-default p-s',\n top: 'orientation-vertical:gap-xs rounded-b-large bg-surface-default p-s',\n bottom:\n 'orientation-vertical:gap-xs rounded-t-large bg-surface-default p-s',\n },\n },\n});\n\nconst TabList = ({\n children,\n className,\n variant = 'default',\n drawer = undefined,\n ...rest\n}: TabListProps) => {\n containsExactChildren({\n children,\n componentName: TabList.displayName,\n restrictions: {\n [Tab.displayName]: { min: 1 },\n },\n });\n\n return (\n <AriaTabList\n className={cn(tabListStyles({ variant, drawer }), className)}\n {...rest}\n >\n {children}\n </AriaTabList>\n );\n};\n\nTabList.displayName = 'Tabs.List';\nTabs.List = TabList;\n\nconst tabBaseStyles = cn(\n 'fg-default-dark cursor-pointer p-s outline-none',\n 'rounded-medium group-orientation-horizontal:rounded-small group-orientation-horizontal:rounded-b-none',\n 'group-orientation-horizontal:border-static-light group-orientation-horizontal:border-b',\n 'group-orientation-vertical:border group-orientation-vertical:border-transparent',\n);\n\nconst tabStyles = cva(tabBaseStyles, {\n variants: {\n isSelected: {\n true: 'fg-highlight bg-highlight-subtle group-orientation-horizontal:border-highlight',\n },\n isHovered: {\n true: 'fg-default-light group-orientation-horizontal:border-interactive-hover',\n },\n isFocused: {\n true: 'fg-default-light group-orientation-horizontal:border-interactive-hover',\n },\n isDisabled: {\n true: 'fg-disabled cursor-not-allowed group-orientation-horizontal:border-interactive-disabled',\n },\n },\n compoundVariants: [\n {\n isSelected: true,\n isHovered: true,\n className: 'fg-highlight group-orientation-horizontal:border-highlight',\n },\n {\n isSelected: true,\n isFocused: true,\n className:\n 'fg-highlight group-orientation-horizontal:border-interactive-hover group-orientation-vertical:border-interactive-hover',\n },\n {\n isDisabled: true,\n isSelected: true,\n className:\n 'fg-disabled bg-interactive-disabled group-orientation-horizontal:border-interactive-disabled',\n },\n ],\n});\n\nexport interface TabProps extends AriaTabProps {}\n\nconst Tab = ({\n id,\n children,\n className,\n isDisabled = false,\n ...rest\n}: TabProps) => {\n return (\n <AriaTab\n id={id}\n className={({ isSelected, isHovered, isFocused, isDisabled }) =>\n cn(\n tabStyles({ isSelected, isHovered, isFocused, isDisabled }),\n className,\n )\n }\n isDisabled={isDisabled}\n {...rest}\n >\n {children}\n </AriaTab>\n );\n};\n\nTab.displayName = 'Tabs.Tab';\nTabs.Tab = Tab;\n\nexport interface TabPanelProps extends AriaTabPanelProps {}\n\nconst TabPanel = ({ id, children, className, ...rest }: TabPanelProps) => {\n return (\n <AriaTabPanel\n id={id}\n className={cn(\n 'fg-default-light p-s group-orientation-vertical:pt-0 group-orientation-horizontal:pl-0',\n className,\n )}\n {...rest}\n >\n {children}\n </AriaTabPanel>\n );\n};\n\nTabPanel.displayName = 'Tabs.Panel';\nTabs.Panel = TabPanel;\n"]}
1
+ {"version":3,"sources":["../../../src/components/tabs/index.tsx"],"names":["rest","p","jsx","AriaTabs","orientation","l","v","i","Tabs","b","variant","drawer","containsExactChildren","AriaTabList","cn","tabListStyles","m","children","TabList","id","T","tabStyles","isSelected","isDisabled","Tab","P","TabPanel"],"mappings":"gQAgCE,MAAA,CAAA,CAAA,CAAA,CAAA,QACA,CAAA,CAAA,CAAA,uBACA,CAAA,CAAA,CAAA,YACGA,CACL,UAEI,CAAA,CAAA,CAAA,KAAA,CAAA,GACA,CAAA,CAAA,IAAAC,qBAAA,CAAA,CAAA,QAAoB,CAAA,CAAA,CAAA,aACpB,CAAA,CAAA,CAAA,WAA2B,CAAA,YAC7B,CAAC,CAAA,CAGCC,CAAAA,CAACC,CAAAA,cACcC,CAAAA,CACb,CAAAC,GAAA,CAAAC,IAAA,CAAA,CAAA,WACA,CAAA,CAAA,CAAA,UACE,CAAA,CAAA,CAAA,SAAA,CAAAC,EAAA,CAAA,+DAMJ,CAAA,CAAA,CAIJC,CAAAA,GAAK,CAAA,CAAA,QAAc,OASnB,CAAA,WAA0B,CAAA,MAAA,CAAA,MAAA,CAAA,CAAAC,GAAA,CAAA,+CAEb,CACP,SACE,CAAA,CAAA,OAAA,CAAA,CAAA,KAAA,CAAA,kGACO,CAAA,OAAA,CAAA,+BAGH,CAAA,CAAA,MAAA,CAAA,CAAA,IAAA,CAAA,+IAGD,CAAA,GAAA,CAAA,oEAEH,CAAA,MAAA,CAAA,oEAON,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,WACAC,SAAU,CAAA,CAAA,CACV,OAAAC,CAAAA,CAAS,UACNX,CACL,MACEY,CAAsB,CACpB,CAAA,MAAA,CAAA,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AA,CAAA,CAAA,UAAW,CAAA,CAAA,CAAA,SAAW,CAAA,CAAA,CAAA,UAIlD,CAAA,CAAA,UAAYgB,CACX,GAAGvB,CAAAA,CAEH,CAAA,CAAA,UACH,CAIJwB,EAAI,GAAA,CAAA,CAAA,QAAc,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,WAKlB,CAAA,YAAoBL,CAAAA,GAAI,CAAA,CAAA,CAAA,MAAU,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,QAAmB,CAAA,CAAA,CAEjDjB,SACMiB,CACJ,CAAA,CAAA,GAAA,CAAA,CAAA,GAAWL,GAAAA,CACTW,oHAMJ,CAAA,CAIJC,EAAS,GAAA,CAAA,CAAA,QAAc,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,WAClB,CAAA,YAAQA,CAAAA,CAAAA,CAAAA,KAAAA,CAAAA,CAAAA","file":"index.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n'use client';\nimport { containsExactChildren } from '@/lib/react';\nimport { cn } from '@/lib/utils';\nimport 'client-only';\nimport { cva } from 'class-variance-authority';\nimport {\n Tab as AriaTab,\n TabList as AriaTabList,\n type TabListProps as AriaTabListProps,\n TabPanel as AriaTabPanel,\n type TabPanelProps as AriaTabPanelProps,\n type TabProps as AriaTabProps,\n Tabs as AriaTabs,\n type TabsProps as AriaTabsProps,\n} from 'react-aria-components';\n\nexport interface TabsProps extends AriaTabsProps {}\n\nexport const Tabs = ({\n children,\n className,\n orientation = 'horizontal',\n isDisabled = false,\n ...rest\n}: TabsProps) => {\n containsExactChildren({\n children,\n componentName: Tabs.displayName,\n restrictions: [[TabList, { min: 1, max: 1 }]],\n });\n\n return (\n <AriaTabs\n orientation={orientation}\n isDisabled={isDisabled}\n className={cn(\n 'group flex w-content flex-row orientation-horizontal:flex-col',\n className,\n )}\n {...rest}\n >\n {children}\n </AriaTabs>\n );\n};\n\nTabs.displayName = 'Tabs';\n\nexport interface TabListProps extends AriaTabListProps<object> {\n /** Whether the tabs are displaying iconography or text. */\n variant?: 'default' | 'icons';\n /** Whether the tabs are used as drawer controls. */\n drawer?: 'left' | 'right' | 'top' | 'bottom';\n}\n\nconst tabListStyles = cva('flex orientation-horizontal:flex-row flex-col', {\n variants: {\n variant: {\n icons:\n '[&>*]:p-xs orientation-horizontal:[&>*]:pr-s orientation-horizontal:[&>*]:pl-s [&>*]:leading-[0]',\n default: '[&>*]:p-s [&>*]:text-header-m',\n },\n drawer: {\n left: 'orientation-vertical:gap-xs rounded-r-large bg-surface-default p-s',\n right:\n 'orientation-vertical:gap-xs rounded-l-large bg-surface-default p-s',\n top: 'orientation-vertical:gap-xs rounded-b-large bg-surface-default p-s',\n bottom:\n 'orientation-vertical:gap-xs rounded-t-large bg-surface-default p-s',\n },\n },\n});\n\nconst TabList = ({\n children,\n className,\n variant = 'default',\n drawer = undefined,\n ...rest\n}: TabListProps) => {\n containsExactChildren({\n children,\n componentName: TabList.displayName,\n restrictions: [[Tab, { min: 1 }]],\n });\n\n return (\n <AriaTabList\n className={cn(tabListStyles({ variant, drawer }), className)}\n {...rest}\n >\n {children}\n </AriaTabList>\n );\n};\n\nTabList.displayName = 'Tabs.List';\nTabs.List = TabList;\n\nconst tabBaseStyles = cn(\n 'fg-default-dark cursor-pointer p-s outline-none',\n 'rounded-medium group-orientation-horizontal:rounded-small group-orientation-horizontal:rounded-b-none',\n 'group-orientation-horizontal:border-static-light group-orientation-horizontal:border-b',\n 'group-orientation-vertical:border group-orientation-vertical:border-transparent',\n);\n\nconst tabStyles = cva(tabBaseStyles, {\n variants: {\n isSelected: {\n true: 'fg-highlight bg-highlight-subtle group-orientation-horizontal:border-highlight',\n },\n isHovered: {\n true: 'fg-default-light group-orientation-horizontal:border-interactive-hover',\n },\n isFocused: {\n true: 'fg-default-light group-orientation-horizontal:border-interactive-hover',\n },\n isDisabled: {\n true: 'fg-disabled cursor-not-allowed group-orientation-horizontal:border-interactive-disabled',\n },\n },\n compoundVariants: [\n {\n isSelected: true,\n isHovered: true,\n className: 'fg-highlight group-orientation-horizontal:border-highlight',\n },\n {\n isSelected: true,\n isFocused: true,\n className:\n 'fg-highlight group-orientation-horizontal:border-interactive-hover group-orientation-vertical:border-interactive-hover',\n },\n {\n isDisabled: true,\n isSelected: true,\n className:\n 'fg-disabled bg-interactive-disabled group-orientation-horizontal:border-interactive-disabled',\n },\n ],\n});\n\nexport interface TabProps extends AriaTabProps {}\n\nconst Tab = ({\n id,\n children,\n className,\n isDisabled = false,\n ...rest\n}: TabProps) => {\n return (\n <AriaTab\n id={id}\n className={({ isSelected, isHovered, isFocused, isDisabled }) =>\n cn(\n tabStyles({ isSelected, isHovered, isFocused, isDisabled }),\n className,\n )\n }\n isDisabled={isDisabled}\n {...rest}\n >\n {children}\n </AriaTab>\n );\n};\n\nTab.displayName = 'Tabs.Tab';\nTabs.Tab = Tab;\n\nexport interface TabPanelProps extends AriaTabPanelProps {}\n\nconst TabPanel = ({ id, children, className, ...rest }: TabPanelProps) => {\n return (\n <AriaTabPanel\n id={id}\n className={cn(\n 'fg-default-light p-s group-orientation-vertical:pt-0 group-orientation-horizontal:pl-0',\n className,\n )}\n {...rest}\n >\n {children}\n </AriaTabPanel>\n );\n};\n\nTabPanel.displayName = 'Tabs.Panel';\nTabs.Panel = TabPanel;\n"]}
@@ -1,10 +1,11 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import * as react from 'react';
3
+ import { ProviderProps } from '../../lib/types.js';
3
4
  import { ContextValue } from 'react-aria-components';
4
- import { TextAreaFieldProps, TextAreaFieldProviderProps } from './types.js';
5
+ import { TextAreaFieldProps } from './types.js';
5
6
 
6
- declare const TextAreaFieldContext: react.Context<ContextValue<TextAreaFieldProviderProps, HTMLDivElement>>;
7
- declare function TextAreaFieldProvider({ children, ...props }: TextAreaFieldProviderProps): react_jsx_runtime.JSX.Element;
7
+ declare const TextAreaFieldContext: react.Context<ContextValue<TextAreaFieldProps, HTMLDivElement>>;
8
+ declare function TextAreaFieldProvider({ children, ...props }: ProviderProps<TextAreaFieldProps>): react_jsx_runtime.JSX.Element;
8
9
  declare namespace TextAreaFieldProvider {
9
10
  var displayName: string;
10
11
  }
@@ -1,2 +1,2 @@
1
- import'client-only';import {createContext}from'react';import {useContextProps,TextField,composeRenderProps,TextArea,Text,FieldError}from'react-aria-components';import {Label}from'../label/index.js';import {TextAreaStyles}from'./styles.js';import {jsx,jsxs,Fragment}from'react/jsx-runtime';var {field:I,label:z,input:D,description:R,error:S}=TextAreaStyles(),c=createContext(null);function x({children:r,...t}){return jsx(c.Provider,{value:t,children:r})}x.displayName="TextAreaField.Provider";function P({ref:r,...t}){[t,r]=useContextProps(t,r??null,c);let{classNames:i,description:a,errorMessage:u,label:d,inputProps:T,size:n="medium",isInvalid:v,...F}=t,p=u||null,m=n==="small";return jsx(TextField,{...F,ref:r,className:composeRenderProps(i?.field,o=>I({className:o})),isInvalid:v||(p?true:void 0),"data-size":n,children:({isDisabled:o,isInvalid:A,isRequired:f})=>jsxs(Fragment,{children:[!!d&&!m&&jsx(Label,{className:z({className:i?.label}),isDisabled:o,isRequired:f,children:d}),jsx(TextArea,{...T,className:composeRenderProps(i?.input,l=>D({className:l}))}),!!a&&!(m||A)&&jsx(Text,{slot:"description",className:R({className:i?.description}),children:a}),jsx(FieldError,{className:composeRenderProps(i?.error,l=>S({className:l})),children:p})]})})}P.displayName="TextAreaField";P.Provider=x;export{P as TextAreaField,c as TextAreaFieldContext};//# sourceMappingURL=index.js.map
1
+ import {jsx,jsxs,Fragment}from'react/jsx-runtime';import'client-only';import {createContext}from'react';import {useContextProps,TextField,composeRenderProps,TextArea,Text,FieldError}from'react-aria-components';import {Label}from'../label/index.js';import {TextAreaStyles}from'./styles.js';const {field:I,label:z,input:D,description:R,error:S}=TextAreaStyles(),c=createContext(null);function x({children:r,...t}){return jsx(c.Provider,{value:t,children:r})}x.displayName="TextAreaField.Provider";function P({ref:r,...t}){[t,r]=useContextProps(t,r??null,c);const{classNames:i,description:a,errorMessage:u,label:d,inputProps:T,size:n="medium",isInvalid:v,...F}=t,p=u||null,m=n==="small";return jsx(TextField,{...F,ref:r,className:composeRenderProps(i?.field,o=>I({className:o})),isInvalid:v||(p?true:void 0),"data-size":n,children:({isDisabled:o,isInvalid:f,isRequired:A})=>jsxs(Fragment,{children:[!!d&&!m&&jsx(Label,{className:z({className:i?.label}),isDisabled:o,isRequired:A,children:d}),jsx(TextArea,{...T,className:composeRenderProps(i?.input,l=>D({className:l}))}),!!a&&!(m||f)&&jsx(Text,{slot:"description",className:R({className:i?.description}),children:a}),jsx(FieldError,{className:composeRenderProps(i?.error,l=>S({className:l})),children:p})]})})}P.displayName="TextAreaField",P.Provider=x;export{P as TextAreaField,c as TextAreaFieldContext};//# sourceMappingURL=index.js.map
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/text-area-field/index.tsx"],"names":["field","label","input","description","TextAreaStyles","E","TextAreaFieldContext","createContext","N","children","props","TextAreaFieldProvider","ref","useContextProps","classNames","descriptionProp","errorMessageProp","labelProp","inputProps","size","isInvalidProp","errorMessage","isSmall","TextField","L","composeRenderProps","className","isDisabled","isInvalid","Fragment","V","jsx","Label","g","isRequired","TextArea","C","Text","y","FieldError","b","error","TextAreaField"],"mappings":"iSA6BQ,IAAA,CAAA,KAAAA,CAAO,CAAA,CAAA,KAAAC,CAAO,CAAA,CAAA,KAAAC,CAAO,CAAA,CAAA,WAAAC,CAAa,CAAA,CAAA,KAAM,CAAA,C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EpCC,IAAAA,CAAAC,QACG,CAAA,CAAA,QAAA,CAAC,CAACb,CAAAA,CAAAA,CAAa,EAACK,CAAAA,CACfS,EAACC,GAAAA,CAAAC,KACC,CAAA,CAAA,SAAWhC,CAAM,CAAE,CAAA,CAAA,SAAWa,CAAAA,CAAY,EAAA,KAAO,CACjD,CAAA,CAAA,UAAYa,CACZ,CAAA,CAAA,UAAYO,CAEX,CAAA,CAAA,QAAAjB,CACH,CAAA,CAEFc,CAAAA,CAACI,GAAAA,CAAAC,QACE,CAAA,CAAA,GACD,CAAA,CAAA,SAAWX,CAAmBX,kBAAAA,CAAAA,CAAY,EAAA,KAAQY,CAAAA,CAChDxB,EAAM,CAAE,CAAA,CAAA,SAAU,CAAC,CACrB,CAAA,CACF,CAAA,CACC,CAAC,CAACa,CAAAA,CAAAA,CAAmB,EAAEO,EAAAA,CAAWM,EAAAA,CAAAA,CACjCG,EAACM,GAAAA,CAAAC,IACC,CAAA,CAAA,IAAK,CAAA,aACL,CAAA,SAAWnC,CAAY,CAAE,CAAA,CAAA,SAAWW,CAAAA,CAAY,EAAA,WAAa,CAE5D,CAAA,CAAA,QAAAC,CACH,CAAA,CAEFgB,CAAAA,CAACQ,GAAAA,CAAAC,UACC,CAAA,CAAA,SAAWf,CAAmBX,kBAAAA,CAAAA,CAAY,EAAA,KAAQY,CAAAA,CAChDe,EAAM,CAAE,CAAA,CAAA,SAAU,CAAC,CACrB,CAAA,CAEC,CAAA,CAAA,QAAApB,CACH,CAAA,CAAA,CACF,CAAA,CAEJ,CAEJ,CACAqB,CAAAA,CAAc,CAAA,CAAA,WAAc,CAAA,eAC5BA,CAAc,CAAA,CAAA,QAAW/B,CAAAA,CAAAA","file":"index.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n'use client';\n\nimport 'client-only';\nimport { createContext } from 'react';\nimport {\n type ContextValue,\n FieldError,\n Text,\n TextArea,\n TextField,\n composeRenderProps,\n useContextProps,\n} from 'react-aria-components';\nimport { Label } from '../label';\nimport { TextAreaStyles } from './styles';\nimport type { TextAreaFieldProps, TextAreaFieldProviderProps } from './types';\n\nconst { field, label, input, description, error } = TextAreaStyles();\n\nexport const TextAreaFieldContext =\n createContext<ContextValue<TextAreaFieldProviderProps, HTMLDivElement>>(null);\n\nfunction TextAreaFieldProvider({\n children,\n ...props\n}: TextAreaFieldProviderProps) {\n return (\n <TextAreaFieldContext.Provider value={props}>\n {children}\n </TextAreaFieldContext.Provider>\n );\n}\nTextAreaFieldProvider.displayName = 'TextAreaField.Provider';\n\nexport function TextAreaField({ ref, ...props }: TextAreaFieldProps) {\n [props, ref] = useContextProps(props, ref ?? null, TextAreaFieldContext);\n\n const {\n classNames,\n description: descriptionProp,\n errorMessage: errorMessageProp,\n label: labelProp,\n inputProps,\n size = 'medium',\n isInvalid: isInvalidProp,\n ...rest\n } = props;\n const errorMessage = errorMessageProp || null; // Protect against empty string\n const isSmall = size === 'small';\n\n return (\n <TextField\n {...rest}\n ref={ref}\n className={composeRenderProps(classNames?.field, (className) =>\n field({ className }),\n )}\n isInvalid={isInvalidProp || (errorMessage ? true : undefined)} // Leave uncontrolled if possible to fallback to validation state\n data-size={size}\n >\n {(\n { isDisabled, isInvalid, isRequired }, // Rely on internal state, not props, since state could differ from props\n ) => (\n <>\n {!!labelProp && !isSmall && (\n <Label\n className={label({ className: classNames?.label })}\n isDisabled={isDisabled}\n isRequired={isRequired}\n >\n {labelProp}\n </Label>\n )}\n <TextArea\n {...inputProps}\n className={composeRenderProps(classNames?.input, (className) =>\n input({ className }),\n )}\n />\n {!!descriptionProp && !(isSmall || isInvalid) && (\n <Text\n slot='description'\n className={description({ className: classNames?.description })}\n >\n {descriptionProp}\n </Text>\n )}\n <FieldError\n className={composeRenderProps(classNames?.error, (className) =>\n error({ className }),\n )}\n >\n {errorMessage}\n </FieldError>\n </>\n )}\n </TextField>\n );\n}\nTextAreaField.displayName = 'TextAreaField';\nTextAreaField.Provider = TextAreaFieldProvider;\n"]}
1
+ {"version":3,"sources":["../../../src/components/text-area-field/index.tsx"],"names":["label","input","description","TextAreaFieldContext","E","b","props","jsx","e","TextAreaFieldProvider","useContextProps","ref","M","descriptionProp","errorMessageProp","inputProps","isSmall","size","L","composeRenderProps","classNames","className","field","isInvalidProp","errorMessage","isDisabled","isInvalid","isRequired","k","V","labelProp","Label","C","Text","y","error"],"mappings":"iSA8Be,MAAA,CAAAA,KAAO,CAAA,CAAA,CAAAC,KAAO,CAAA,CAAA,CAAA,KAAA,CAAAC,CAAAA,CAAa,WAAyB,CAAA,CAEtDC,CAAAA,KACqD,CAAA,CAAI,CAAA,CAEtEC,cAAA,EAAA,CAAA,CAAA,CAAAC,aAAA,CAAA,IACE,EAAA,SACA,CAAA,CAAA,CAAGC,QAEH,CAAA,CAAA,CACEC,GAACJ,CAAqB,CAAA,CAAA,CAAA,OAASK,GAAA,CAAA,CAAA,CAAA,QAC5B,CAAA,CAAA,KACH,CAEJ,CACAC,CAAAA,QAAsB,CAAA,CAAA,CAAA,CAAA,CAAc,CAAA,CAAA,WAAA,CAAA,wBAEJ,CAAA,SAAc,CAAuB,CACnE,CAACH,GAAU,CAAA,CAAII,CAAAA,GAAuBC,CAAAA,CAAAA,CAAO,CAAA,CAAA,CAAA,CAAA,CAAMR,CAAoB,CAAAS,eAEvE,CAAA,CAAA,CAAA,CAAA,EACE,IAAA,CAAA,CAAA,CAAA,CAAA,KACA,CAAA,UAAA,CAAaC,CAAAA,CACb,WAAA,CAAA,CAAcC,CAAAA,YAEd,CAAA,CAAA,CAAA,KAAAC,CAAAA,C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,CAAA,CAAA,IAAA,CACL,aAAyB,CAAA,SAAWd,CAAAA,CAAAA,CAAY,CAAA,SAAA,CAAY,CAAC,EAE5D,WACH,CAAA,CAEFb,CAAAA,QACE,CAAA,CAAA,CAAA,CAAA,CAAAC,GAAWW,CAAAA,UAAmBC,CAAAA,CAAAA,SAAoBC,CAChDc,kBAAAA,CAAM,CAAE,EAAA,KAAA,CAAA,CAAA,EAAU,CAAC,CACrB,CAAA,SAEC,CAAAX,CAAAA,CACH,CAAA,CAAA,CACF,QAKM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAc,CAAA,CAAA,WAAA,CAAA,eACHf,CAAAA,CAAAA,CAAAA,QAAAA,CAAAA,CAAAA","file":"index.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n'use client';\n\nimport 'client-only';\nimport type { ProviderProps } from '@/lib/types';\nimport { createContext } from 'react';\nimport {\n type ContextValue,\n FieldError,\n Text,\n TextArea,\n TextField,\n composeRenderProps,\n useContextProps,\n} from 'react-aria-components';\nimport { Label } from '../label';\nimport { TextAreaStyles } from './styles';\nimport type { TextAreaFieldProps } from './types';\n\nconst { field, label, input, description, error } = TextAreaStyles();\n\nexport const TextAreaFieldContext =\n createContext<ContextValue<TextAreaFieldProps, HTMLDivElement>>(null);\n\nfunction TextAreaFieldProvider({\n children,\n ...props\n}: ProviderProps<TextAreaFieldProps>) {\n return (\n <TextAreaFieldContext.Provider value={props}>\n {children}\n </TextAreaFieldContext.Provider>\n );\n}\nTextAreaFieldProvider.displayName = 'TextAreaField.Provider';\n\nexport function TextAreaField({ ref, ...props }: TextAreaFieldProps) {\n [props, ref] = useContextProps(props, ref ?? null, TextAreaFieldContext);\n\n const {\n classNames,\n description: descriptionProp,\n errorMessage: errorMessageProp,\n label: labelProp,\n inputProps,\n size = 'medium',\n isInvalid: isInvalidProp,\n ...rest\n } = props;\n const errorMessage = errorMessageProp || null; // Protect against empty string\n const isSmall = size === 'small';\n\n return (\n <TextField\n {...rest}\n ref={ref}\n className={composeRenderProps(classNames?.field, (className) =>\n field({ className }),\n )}\n isInvalid={isInvalidProp || (errorMessage ? true : undefined)} // Leave uncontrolled if possible to fallback to validation state\n data-size={size}\n >\n {(\n { isDisabled, isInvalid, isRequired }, // Rely on internal state, not props, since state could differ from props\n ) => (\n <>\n {!!labelProp && !isSmall && (\n <Label\n className={label({ className: classNames?.label })}\n isDisabled={isDisabled}\n isRequired={isRequired}\n >\n {labelProp}\n </Label>\n )}\n <TextArea\n {...inputProps}\n className={composeRenderProps(classNames?.input, (className) =>\n input({ className }),\n )}\n />\n {!!descriptionProp && !(isSmall || isInvalid) && (\n <Text\n slot='description'\n className={description({ className: classNames?.description })}\n >\n {descriptionProp}\n </Text>\n )}\n <FieldError\n className={composeRenderProps(classNames?.error, (className) =>\n error({ className }),\n )}\n >\n {errorMessage}\n </FieldError>\n </>\n )}\n </TextField>\n );\n}\nTextAreaField.displayName = 'TextAreaField';\nTextAreaField.Provider = TextAreaFieldProvider;\n"]}
@@ -1,23 +1,24 @@
1
1
  import * as tailwind_variants from 'tailwind-variants';
2
+ import * as tailwind_merge from 'tailwind-merge';
2
3
 
3
4
  declare const TextAreaStyles: tailwind_variants.TVReturnType<{
4
5
  [key: string]: {
5
- [key: string]: tailwind_variants.ClassValue | {
6
- input?: tailwind_variants.ClassValue;
7
- label?: tailwind_variants.ClassValue;
8
- error?: tailwind_variants.ClassValue;
9
- description?: tailwind_variants.ClassValue;
10
- field?: tailwind_variants.ClassValue;
6
+ [key: string]: tailwind_merge.ClassNameValue | {
7
+ input?: tailwind_merge.ClassNameValue;
8
+ label?: tailwind_merge.ClassNameValue;
9
+ error?: tailwind_merge.ClassNameValue;
10
+ description?: tailwind_merge.ClassNameValue;
11
+ field?: tailwind_merge.ClassNameValue;
11
12
  };
12
13
  };
13
14
  } | {
14
15
  [x: string]: {
15
- [x: string]: tailwind_variants.ClassValue | {
16
- input?: tailwind_variants.ClassValue;
17
- label?: tailwind_variants.ClassValue;
18
- error?: tailwind_variants.ClassValue;
19
- description?: tailwind_variants.ClassValue;
20
- field?: tailwind_variants.ClassValue;
16
+ [x: string]: tailwind_merge.ClassNameValue | {
17
+ input?: tailwind_merge.ClassNameValue;
18
+ label?: tailwind_merge.ClassNameValue;
19
+ error?: tailwind_merge.ClassNameValue;
20
+ description?: tailwind_merge.ClassNameValue;
21
+ field?: tailwind_merge.ClassNameValue;
21
22
  };
22
23
  };
23
24
  } | {}, {
@@ -28,12 +29,12 @@ declare const TextAreaStyles: tailwind_variants.TVReturnType<{
28
29
  error: string;
29
30
  }, undefined, {
30
31
  [key: string]: {
31
- [key: string]: tailwind_variants.ClassValue | {
32
- input?: tailwind_variants.ClassValue;
33
- label?: tailwind_variants.ClassValue;
34
- error?: tailwind_variants.ClassValue;
35
- description?: tailwind_variants.ClassValue;
36
- field?: tailwind_variants.ClassValue;
32
+ [key: string]: tailwind_merge.ClassNameValue | {
33
+ input?: tailwind_merge.ClassNameValue;
34
+ label?: tailwind_merge.ClassNameValue;
35
+ error?: tailwind_merge.ClassNameValue;
36
+ description?: tailwind_merge.ClassNameValue;
37
+ field?: tailwind_merge.ClassNameValue;
37
38
  };
38
39
  };
39
40
  } | {}, {
@@ -1,2 +1,2 @@
1
- import {tv}from'./../../lib/utils.js';var l=tv({slots:{field:"group/text-area-field flex flex-col gap-xs",label:"",input:["block w-full rounded-medium p-s font-display text-default-light outline outline-interactive placeholder:text-default-dark","group-size-medium/text-area-field:text-body-s group-size-small/text-area-field:text-body-xs","group-enabled/text-area-field:focus:outline-highlight","group-enabled/text-area-field:hover:outline-interactive-hover","group-enabled/text-area-field:group-invalid/text-area-field:outline-serious","group-disabled/text-area-field:text-disabled group-disabled/text-area-field:outline-interactive-disabled group-disabled/text-area-field:placeholder:text-disabled"],description:["fg-default-dark text-body-xs","group-disabled/text-area-field:fg-disabled"],error:"fg-serious text-body-xs"}});export{l as TextAreaStyles};//# sourceMappingURL=styles.js.map
1
+ import {tv}from'./../../lib/utils.js';const l=tv({slots:{field:"group/text-area-field flex flex-col gap-xs",label:"",input:["block w-full rounded-medium p-s font-display text-default-light outline outline-interactive placeholder:text-default-dark","group-size-medium/text-area-field:text-body-s group-size-small/text-area-field:text-body-xs","group-enabled/text-area-field:focus:outline-highlight","group-enabled/text-area-field:hover:outline-interactive-hover","group-enabled/text-area-field:group-invalid/text-area-field:outline-serious","group-disabled/text-area-field:text-disabled group-disabled/text-area-field:outline-interactive-disabled group-disabled/text-area-field:placeholder:text-disabled"],description:["fg-default-dark text-body-xs","group-disabled/text-area-field:fg-disabled"],error:"fg-serious text-body-xs"}});export{l as TextAreaStyles};//# sourceMappingURL=styles.js.map
2
2
  //# sourceMappingURL=styles.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/text-area-field/styles.ts"],"names":["e"],"mappings":"sCAeE,IAAA,CAAA,CAAAA,EAAA,CAAO,CACL,KAAA,CAAO,CAAA,KAAA,CAAA,4CACA,MACP,CAAA,EAAO,CACL,KAAA,CAAA,CAAA,2HACA,CAAA,6FACA,CAAA,uDACA,CAAA,+DACA,CAAA,6EACA,CAAA,mKAEF,CAAA,CAAA,WACE,CAAA,CAAA,8BACA,CAAA,4CAEF,CAAO,CAAA,KAAA,CAAA,yBAEV,CAAA,CAAA","file":"styles.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { tv } from '@/lib/utils';\n\nexport const TextAreaStyles = tv({\n slots: {\n field: 'group/text-area-field flex flex-col gap-xs',\n label: '',\n input: [\n 'block w-full rounded-medium p-s font-display text-default-light outline outline-interactive placeholder:text-default-dark',\n 'group-size-medium/text-area-field:text-body-s group-size-small/text-area-field:text-body-xs',\n 'group-enabled/text-area-field:focus:outline-highlight',\n 'group-enabled/text-area-field:hover:outline-interactive-hover',\n 'group-enabled/text-area-field:group-invalid/text-area-field:outline-serious',\n 'group-disabled/text-area-field:text-disabled group-disabled/text-area-field:outline-interactive-disabled group-disabled/text-area-field:placeholder:text-disabled',\n ],\n description: [\n 'fg-default-dark text-body-xs',\n 'group-disabled/text-area-field:fg-disabled',\n ],\n error: 'fg-serious text-body-xs',\n },\n});\n"]}
1
+ {"version":3,"sources":["../../../src/components/text-area-field/styles.ts"],"names":["e"],"mappings":"sCAeE,MAAA,CAAO,CACLA,EAAA,CAAA,CAAA,KAAO,CAAA,CAAA,KAAA,CAAA,4CAEP,CAAA,KAAO,CACL,EAAA,CAAA,KAAA,CAAA,CAAA,2HACA,CAAA,6FACA,CAAA,uDACA,CAAA,+DACA,CAAA,6EACA,CAAA,mKAEF,CAAA,CAAA,WACE,CAAA,CAAA,8BACA,CAAA,4CAEK,CAAA,CAAA,KAAA,CAAA,yBAEV,CAAA,CAAA","file":"styles.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { tv } from '@/lib/utils';\n\nexport const TextAreaStyles = tv({\n slots: {\n field: 'group/text-area-field flex flex-col gap-xs',\n label: '',\n input: [\n 'block w-full rounded-medium p-s font-display text-default-light outline outline-interactive placeholder:text-default-dark',\n 'group-size-medium/text-area-field:text-body-s group-size-small/text-area-field:text-body-xs',\n 'group-enabled/text-area-field:focus:outline-highlight',\n 'group-enabled/text-area-field:hover:outline-interactive-hover',\n 'group-enabled/text-area-field:group-invalid/text-area-field:outline-serious',\n 'group-disabled/text-area-field:text-disabled group-disabled/text-area-field:outline-interactive-disabled group-disabled/text-area-field:placeholder:text-disabled',\n ],\n description: [\n 'fg-default-dark text-body-xs',\n 'group-disabled/text-area-field:fg-disabled',\n ],\n error: 'fg-serious text-body-xs',\n },\n});\n"]}
@@ -1,4 +1,4 @@
1
- import { RefAttributes, PropsWithChildren } from 'react';
1
+ import { RefAttributes } from 'react';
2
2
  import { TextFieldProps, TextAreaProps, FieldErrorProps } from 'react-aria-components';
3
3
 
4
4
  type TextAreaFieldProps = Omit<TextFieldProps, 'children' | 'className'> & RefAttributes<HTMLDivElement> & {
@@ -15,6 +15,5 @@ type TextAreaFieldProps = Omit<TextFieldProps, 'children' | 'className'> & RefAt
15
15
  errorMessage?: FieldErrorProps['children'];
16
16
  size?: 'medium' | 'small';
17
17
  };
18
- type TextAreaFieldProviderProps = PropsWithChildren<TextAreaFieldProps>;
19
18
 
20
- export type { TextAreaFieldProps, TextAreaFieldProviderProps };
19
+ export type { TextAreaFieldProps };
@@ -1,16 +1,18 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import * as react from 'react';
3
3
  import { ContextValue } from 'react-aria-components';
4
- import { TextFieldProps, TextFieldProviderProps } from './types.js';
4
+ import { ProviderProps } from '../../lib/types.js';
5
+ import { TextFieldProps } from './types.js';
5
6
  import '../input/types.js';
6
7
  import 'tailwind-variants';
7
8
  import '../button/types.js';
8
9
  import '../button/styles.js';
10
+ import 'tailwind-merge';
9
11
  import '../input/styles.js';
10
12
  import '../label/types.js';
11
13
 
12
14
  declare const TextFieldContext: react.Context<ContextValue<TextFieldProps, HTMLDivElement>>;
13
- declare function TextFieldProvider({ children, ...props }: TextFieldProviderProps): react_jsx_runtime.JSX.Element;
15
+ declare function TextFieldProvider({ children, ...props }: ProviderProps<TextFieldProps>): react_jsx_runtime.JSX.Element;
14
16
  declare namespace TextFieldProvider {
15
17
  var displayName: string;
16
18
  }
@@ -1,2 +1,2 @@
1
- import'client-only';import {createContext}from'react';import {useContextProps,TextField,composeRenderProps,Text,FieldError}from'react-aria-components';import {Input}from'../input/index.js';import {Label}from'../label/index.js';import {TextFieldStyles}from'./styles.js';import {jsx,jsxs,Fragment}from'react/jsx-runtime';var {field:E,label:A,description:S,error:V}=TextFieldStyles(),x=createContext(null);function u({children:r,...i}){return jsx(x.Provider,{value:i,children:r})}u.displayName="TextField.Provider";function P({ref:r,...i}){[i,r]=useContextProps(i,r??null,x);let{classNames:t,description:s,errorMessage:T,inputProps:F,label:a,size:o="medium",isInvalid:v,...f}=i,d=T||null,n=o==="small";return jsx(TextField,{...f,ref:r,className:composeRenderProps(t?.field,l=>E({className:l})),isInvalid:v||(d?true:void 0),"data-size":o,children:({isDisabled:l,isInvalid:p,isRequired:m})=>jsxs(Fragment,{children:[!!a&&!n&&jsx(Label,{className:A({className:t?.label}),isDisabled:l,isRequired:m,children:a}),jsx(Input,{...F,classNames:t?.input,disabled:l,required:m,size:o,isInvalid:p}),!!s&&!(n||p)&&jsx(Text,{slot:"description",className:S({className:t?.description}),children:s}),jsx(FieldError,{className:composeRenderProps(t?.error,N=>V({className:N})),children:d})]})})}P.displayName="TextField";P.Provider=u;export{P as TextField,x as TextFieldContext};//# sourceMappingURL=index.js.map
1
+ import {jsx,jsxs,Fragment}from'react/jsx-runtime';import'client-only';import {createContext}from'react';import {useContextProps,TextField,composeRenderProps,Text,FieldError}from'react-aria-components';import {Input}from'../input/index.js';import {Label}from'../label/index.js';import {TextFieldStyles}from'./styles.js';const {field:E,label:A,description:S,error:V}=TextFieldStyles(),x=createContext(null);function P({children:r,...t}){return jsx(x.Provider,{value:t,children:r})}P.displayName="TextField.Provider";function u({ref:r,...t}){[t,r]=useContextProps(t,r??null,x);const{classNames:i,description:s,errorMessage:T,inputProps:F,label:a,size:l="medium",isInvalid:v,...f}=t,d=T||null,n=l==="small";return jsx(TextField,{...f,ref:r,className:composeRenderProps(i?.field,o=>E({className:o})),isInvalid:v||(d?true:void 0),"data-size":l,children:({isDisabled:o,isInvalid:p,isRequired:m})=>jsxs(Fragment,{children:[!!a&&!n&&jsx(Label,{className:A({className:i?.label}),isDisabled:o,isRequired:m,children:a}),jsx(Input,{...F,classNames:i?.input,disabled:o,required:m,size:l,isInvalid:p}),!!s&&!(n||p)&&jsx(Text,{slot:"description",className:S({className:i?.description}),children:s}),jsx(FieldError,{className:composeRenderProps(i?.error,b=>V({className:b})),children:d})]})})}u.displayName="TextField",u.Provider=P;export{u as TextField,x as TextFieldContext};//# sourceMappingURL=index.js.map
2
2
  //# sourceMappingURL=index.js.map