@traefik-labs/faency 13.5.0 → 13.7.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 (203) hide show
  1. package/dist/components/AriaTable/AriaTable.cjs +3 -5
  2. package/dist/components/AriaTable/AriaTable.cjs.map +1 -1
  3. package/dist/components/AriaTable/AriaTable.constants.cjs +5 -0
  4. package/dist/components/AriaTable/AriaTable.constants.cjs.map +1 -0
  5. package/dist/components/AriaTable/AriaTable.constants.js +5 -0
  6. package/dist/components/AriaTable/AriaTable.constants.js.map +1 -0
  7. package/dist/components/AriaTable/AriaTable.js +7 -9
  8. package/dist/components/AriaTable/AriaTable.js.map +1 -1
  9. package/dist/components/AriaTable/AriaTable.vanilla.cjs +194 -0
  10. package/dist/components/AriaTable/AriaTable.vanilla.cjs.map +1 -0
  11. package/dist/components/AriaTable/AriaTable.vanilla.css.cjs +28 -0
  12. package/dist/components/AriaTable/AriaTable.vanilla.css.cjs.map +1 -0
  13. package/dist/components/AriaTable/AriaTable.vanilla.css.js +17 -0
  14. package/dist/components/AriaTable/AriaTable.vanilla.css.js.map +1 -0
  15. package/dist/components/AriaTable/AriaTable.vanilla.js +185 -0
  16. package/dist/components/AriaTable/AriaTable.vanilla.js.map +1 -0
  17. package/dist/components/Badge/Badge.vanilla.cjs +2 -1
  18. package/dist/components/Badge/Badge.vanilla.cjs.map +1 -1
  19. package/dist/components/Badge/Badge.vanilla.js +2 -1
  20. package/dist/components/Badge/Badge.vanilla.js.map +1 -1
  21. package/dist/components/Blockquote/Blockquote.vanilla.cjs +2 -1
  22. package/dist/components/Blockquote/Blockquote.vanilla.cjs.map +1 -1
  23. package/dist/components/Blockquote/Blockquote.vanilla.js +2 -1
  24. package/dist/components/Blockquote/Blockquote.vanilla.js.map +1 -1
  25. package/dist/components/Box/Box.vanilla.cjs +2 -1
  26. package/dist/components/Box/Box.vanilla.cjs.map +1 -1
  27. package/dist/components/Box/Box.vanilla.js +2 -1
  28. package/dist/components/Box/Box.vanilla.js.map +1 -1
  29. package/dist/components/Bubble/Bubble.vanilla.cjs +2 -1
  30. package/dist/components/Bubble/Bubble.vanilla.cjs.map +1 -1
  31. package/dist/components/Bubble/Bubble.vanilla.js +2 -1
  32. package/dist/components/Bubble/Bubble.vanilla.js.map +1 -1
  33. package/dist/components/Button/Button.vanilla.cjs +2 -1
  34. package/dist/components/Button/Button.vanilla.cjs.map +1 -1
  35. package/dist/components/Button/Button.vanilla.js +2 -1
  36. package/dist/components/Button/Button.vanilla.js.map +1 -1
  37. package/dist/components/ButtonSwitch/ButtonSwitch.vanilla.cjs +5 -4
  38. package/dist/components/ButtonSwitch/ButtonSwitch.vanilla.cjs.map +1 -1
  39. package/dist/components/ButtonSwitch/ButtonSwitch.vanilla.js +5 -4
  40. package/dist/components/ButtonSwitch/ButtonSwitch.vanilla.js.map +1 -1
  41. package/dist/components/Card/Card.vanilla.cjs +2 -1
  42. package/dist/components/Card/Card.vanilla.cjs.map +1 -1
  43. package/dist/components/Card/Card.vanilla.js +2 -1
  44. package/dist/components/Card/Card.vanilla.js.map +1 -1
  45. package/dist/components/CodeBlock/CodeBlock.vanilla.cjs +3 -11
  46. package/dist/components/CodeBlock/CodeBlock.vanilla.cjs.map +1 -1
  47. package/dist/components/CodeBlock/CodeBlock.vanilla.js +4 -12
  48. package/dist/components/CodeBlock/CodeBlock.vanilla.js.map +1 -1
  49. package/dist/components/Combobox/Combobox.vanilla.cjs +2 -2
  50. package/dist/components/Combobox/Combobox.vanilla.cjs.map +1 -1
  51. package/dist/components/Combobox/Combobox.vanilla.js +2 -2
  52. package/dist/components/Combobox/Combobox.vanilla.js.map +1 -1
  53. package/dist/components/Container/Container.vanilla.cjs +2 -1
  54. package/dist/components/Container/Container.vanilla.cjs.map +1 -1
  55. package/dist/components/Container/Container.vanilla.js +2 -1
  56. package/dist/components/Container/Container.vanilla.js.map +1 -1
  57. package/dist/components/Elevation/Elevation.vanilla.cjs +2 -1
  58. package/dist/components/Elevation/Elevation.vanilla.cjs.map +1 -1
  59. package/dist/components/Elevation/Elevation.vanilla.css.cjs.map +1 -1
  60. package/dist/components/Elevation/Elevation.vanilla.css.js.map +1 -1
  61. package/dist/components/Elevation/Elevation.vanilla.js +2 -1
  62. package/dist/components/Elevation/Elevation.vanilla.js.map +1 -1
  63. package/dist/components/Field/Field.js +5 -5
  64. package/dist/components/Field/Field.js.map +1 -1
  65. package/dist/components/Field/Field.vanilla.js +5 -5
  66. package/dist/components/Field/Field.vanilla.js.map +1 -1
  67. package/dist/components/Flex/Flex.vanilla.cjs +2 -1
  68. package/dist/components/Flex/Flex.vanilla.cjs.map +1 -1
  69. package/dist/components/Flex/Flex.vanilla.js +2 -1
  70. package/dist/components/Flex/Flex.vanilla.js.map +1 -1
  71. package/dist/components/Grid/Grid.vanilla.cjs +2 -1
  72. package/dist/components/Grid/Grid.vanilla.cjs.map +1 -1
  73. package/dist/components/Grid/Grid.vanilla.js +2 -1
  74. package/dist/components/Grid/Grid.vanilla.js.map +1 -1
  75. package/dist/components/IconButton/IconButton.vanilla.cjs +2 -1
  76. package/dist/components/IconButton/IconButton.vanilla.cjs.map +1 -1
  77. package/dist/components/IconButton/IconButton.vanilla.js +2 -1
  78. package/dist/components/IconButton/IconButton.vanilla.js.map +1 -1
  79. package/dist/components/Image/Image.vanilla.cjs +2 -1
  80. package/dist/components/Image/Image.vanilla.cjs.map +1 -1
  81. package/dist/components/Image/Image.vanilla.js +2 -1
  82. package/dist/components/Image/Image.vanilla.js.map +1 -1
  83. package/dist/components/Input/Input.vanilla.cjs +2 -1
  84. package/dist/components/Input/Input.vanilla.cjs.map +1 -1
  85. package/dist/components/Input/Input.vanilla.js +2 -1
  86. package/dist/components/Input/Input.vanilla.js.map +1 -1
  87. package/dist/components/Label/Label.vanilla.cjs +2 -1
  88. package/dist/components/Label/Label.vanilla.cjs.map +1 -1
  89. package/dist/components/Label/Label.vanilla.js +2 -1
  90. package/dist/components/Label/Label.vanilla.js.map +1 -1
  91. package/dist/components/List/List.vanilla.cjs +128 -0
  92. package/dist/components/List/List.vanilla.cjs.map +1 -0
  93. package/dist/components/List/List.vanilla.css.cjs +30 -0
  94. package/dist/components/List/List.vanilla.css.cjs.map +1 -0
  95. package/dist/components/List/List.vanilla.css.js +25 -0
  96. package/dist/components/List/List.vanilla.css.js.map +1 -0
  97. package/dist/components/List/List.vanilla.js +124 -0
  98. package/dist/components/List/List.vanilla.js.map +1 -0
  99. package/dist/components/Meter/Meter.vanilla.cjs +2 -1
  100. package/dist/components/Meter/Meter.vanilla.cjs.map +1 -1
  101. package/dist/components/Meter/Meter.vanilla.js +2 -1
  102. package/dist/components/Meter/Meter.vanilla.js.map +1 -1
  103. package/dist/components/Panel/Panel.vanilla.cjs +2 -1
  104. package/dist/components/Panel/Panel.vanilla.cjs.map +1 -1
  105. package/dist/components/Panel/Panel.vanilla.js +2 -1
  106. package/dist/components/Panel/Panel.vanilla.js.map +1 -1
  107. package/dist/components/Paragraph/Paragraph.vanilla.cjs +2 -1
  108. package/dist/components/Paragraph/Paragraph.vanilla.cjs.map +1 -1
  109. package/dist/components/Paragraph/Paragraph.vanilla.js +2 -1
  110. package/dist/components/Paragraph/Paragraph.vanilla.js.map +1 -1
  111. package/dist/components/RowLink/RowLink.cjs +12 -63
  112. package/dist/components/RowLink/RowLink.cjs.map +1 -1
  113. package/dist/components/RowLink/RowLink.constants.cjs +7 -0
  114. package/dist/components/RowLink/RowLink.constants.cjs.map +1 -0
  115. package/dist/components/RowLink/RowLink.constants.js +6 -0
  116. package/dist/components/RowLink/RowLink.constants.js.map +1 -0
  117. package/dist/components/RowLink/RowLink.js +6 -58
  118. package/dist/components/RowLink/RowLink.js.map +1 -1
  119. package/dist/components/RowLink/RowLink.utils.cjs +87 -0
  120. package/dist/components/RowLink/RowLink.utils.cjs.map +1 -0
  121. package/dist/components/RowLink/RowLink.utils.js +83 -0
  122. package/dist/components/RowLink/RowLink.utils.js.map +1 -0
  123. package/dist/components/RowLink/RowLink.vanilla.cjs +21 -0
  124. package/dist/components/RowLink/RowLink.vanilla.cjs.map +1 -0
  125. package/dist/components/RowLink/RowLink.vanilla.css.cjs +10 -0
  126. package/dist/components/RowLink/RowLink.vanilla.css.cjs.map +1 -0
  127. package/dist/components/RowLink/RowLink.vanilla.css.js +8 -0
  128. package/dist/components/RowLink/RowLink.vanilla.css.js.map +1 -0
  129. package/dist/components/RowLink/RowLink.vanilla.js +19 -0
  130. package/dist/components/RowLink/RowLink.vanilla.js.map +1 -0
  131. package/dist/components/SegmentedControl/SegmentedControl.vanilla.cjs +3 -3
  132. package/dist/components/SegmentedControl/SegmentedControl.vanilla.cjs.map +1 -1
  133. package/dist/components/SegmentedControl/SegmentedControl.vanilla.js +3 -3
  134. package/dist/components/SegmentedControl/SegmentedControl.vanilla.js.map +1 -1
  135. package/dist/components/Skeleton/Skeleton.vanilla.cjs +2 -1
  136. package/dist/components/Skeleton/Skeleton.vanilla.cjs.map +1 -1
  137. package/dist/components/Skeleton/Skeleton.vanilla.js +2 -1
  138. package/dist/components/Skeleton/Skeleton.vanilla.js.map +1 -1
  139. package/dist/components/Spinner/Spinner.vanilla.cjs +2 -1
  140. package/dist/components/Spinner/Spinner.vanilla.cjs.map +1 -1
  141. package/dist/components/Spinner/Spinner.vanilla.js +2 -1
  142. package/dist/components/Spinner/Spinner.vanilla.js.map +1 -1
  143. package/dist/components/SplitLayout/SplitLayout.vanilla.cjs +4 -3
  144. package/dist/components/SplitLayout/SplitLayout.vanilla.cjs.map +1 -1
  145. package/dist/components/SplitLayout/SplitLayout.vanilla.js +6 -5
  146. package/dist/components/SplitLayout/SplitLayout.vanilla.js.map +1 -1
  147. package/dist/components/Table/ExpandToggle.vanilla.cjs +30 -0
  148. package/dist/components/Table/ExpandToggle.vanilla.cjs.map +1 -0
  149. package/dist/components/Table/ExpandToggle.vanilla.js +27 -0
  150. package/dist/components/Table/ExpandToggle.vanilla.js.map +1 -0
  151. package/dist/components/Table/SortButton.vanilla.cjs +38 -0
  152. package/dist/components/Table/SortButton.vanilla.cjs.map +1 -0
  153. package/dist/components/Table/SortButton.vanilla.js +35 -0
  154. package/dist/components/Table/SortButton.vanilla.js.map +1 -0
  155. package/dist/components/Table/Table.cjs +3 -5
  156. package/dist/components/Table/Table.cjs.map +1 -1
  157. package/dist/components/Table/Table.js +5 -7
  158. package/dist/components/Table/Table.js.map +1 -1
  159. package/dist/components/Table/Table.vanilla.cjs +142 -0
  160. package/dist/components/Table/Table.vanilla.cjs.map +1 -0
  161. package/dist/components/Table/Table.vanilla.css.cjs +178 -0
  162. package/dist/components/Table/Table.vanilla.css.cjs.map +1 -0
  163. package/dist/components/Table/Table.vanilla.css.js +161 -0
  164. package/dist/components/Table/Table.vanilla.css.js.map +1 -0
  165. package/dist/components/Table/Table.vanilla.js +133 -0
  166. package/dist/components/Table/Table.vanilla.js.map +1 -0
  167. package/dist/components/Table/useTableSort.cjs +60 -0
  168. package/dist/components/Table/useTableSort.cjs.map +1 -0
  169. package/dist/components/Table/useTableSort.js +59 -0
  170. package/dist/components/Table/useTableSort.js.map +1 -0
  171. package/dist/components/Text/Text.vanilla.cjs +2 -1
  172. package/dist/components/Text/Text.vanilla.cjs.map +1 -1
  173. package/dist/components/Text/Text.vanilla.js +2 -1
  174. package/dist/components/Text/Text.vanilla.js.map +1 -1
  175. package/dist/components/TextField/TextField.vanilla.js +2 -2
  176. package/dist/components/TextField/TextField.vanilla.js.map +1 -1
  177. package/dist/components/Textarea/Textarea.vanilla.cjs +2 -1
  178. package/dist/components/Textarea/Textarea.vanilla.cjs.map +1 -1
  179. package/dist/components/Textarea/Textarea.vanilla.js +2 -1
  180. package/dist/components/Textarea/Textarea.vanilla.js.map +1 -1
  181. package/dist/components/Toast/Toast.vanilla.cjs +5 -5
  182. package/dist/components/Toast/Toast.vanilla.cjs.map +1 -1
  183. package/dist/components/Toast/Toast.vanilla.js +5 -5
  184. package/dist/components/Toast/Toast.vanilla.js.map +1 -1
  185. package/dist/faency.css +2495 -1638
  186. package/dist/index.cjs +25 -0
  187. package/dist/index.d.ts +611 -6
  188. package/dist/index.js +5 -1
  189. package/dist/styles/cx.cjs +5 -0
  190. package/dist/styles/cx.cjs.map +1 -0
  191. package/dist/styles/cx.js +5 -0
  192. package/dist/styles/cx.js.map +1 -0
  193. package/dist/styles/themes.css.cjs.map +1 -1
  194. package/dist/styles/themes.css.js.map +1 -1
  195. package/dist/styles/tokens.css.cjs +93 -79
  196. package/dist/styles/tokens.css.cjs.map +1 -1
  197. package/dist/styles/tokens.css.js +93 -79
  198. package/dist/styles/tokens.css.js.map +1 -1
  199. package/dist/styles/useInlineStyle.cjs +16 -0
  200. package/dist/styles/useInlineStyle.cjs.map +1 -0
  201. package/dist/styles/useInlineStyle.js +16 -0
  202. package/dist/styles/useInlineStyle.js.map +1 -0
  203. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"ButtonSwitch.vanilla.cjs","names":["forwardRef","useVanillaExtractTheme","processCSSProp","assignInlineVars","buttonSwitchContainer","ToggleGroupPrimitive","buttonSwitchItem"],"sources":["../../../components/ButtonSwitch/ButtonSwitch.vanilla.tsx"],"sourcesContent":["import * as ToggleGroupPrimitive from '@radix-ui/react-toggle-group';\nimport { assignInlineVars } from '@vanilla-extract/dynamic';\nimport { ElementType, forwardRef } from 'react';\n\nimport { CSSProps, processCSSProp } from '../../styles/cssProps';\nimport {\n PolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef,\n} from '../../styles/polymorphic';\nimport { useVanillaExtractTheme } from '../../styles/themeContext';\nimport { buttonSwitchContainer, buttonSwitchItem } from './ButtonSwitch.vanilla.css';\n\n// Container Component\ninterface ButtonSwitchContainerOwnProps extends CSSProps {\n type?: 'single' | 'multiple';\n value?: string | string[];\n defaultValue?: string | string[];\n onValueChange?: (value: any) => void;\n disabled?: boolean;\n rovingFocus?: boolean;\n loop?: boolean;\n orientation?: 'horizontal' | 'vertical';\n dir?: 'ltr' | 'rtl';\n}\n\nexport type ButtonSwitchContainerVanillaProps<C extends ElementType = 'div'> =\n PolymorphicComponentProps<C, ButtonSwitchContainerOwnProps>;\n\ntype ButtonSwitchContainerVanillaComponent = PolymorphicComponent<\n 'div',\n ButtonSwitchContainerVanillaProps<ElementType>\n>;\n\nconst ButtonSwitchContainerVanillaImpl = forwardRef(\n <C extends ElementType = 'div'>(\n { as, className, css, style, children, ...props }: ButtonSwitchContainerVanillaProps<C>,\n ref?: PolymorphicRef<C>,\n ) => {\n const Component = (as || 'div') as any;\n const { colors } = useVanillaExtractTheme();\n\n const { style: cssStyles, vars } = processCSSProp(css, colors);\n\n const mergedStyles = {\n ...cssStyles,\n ...style,\n ...assignInlineVars(vars),\n };\n\n if (as) {\n return (\n <Component\n ref={ref}\n className={`${buttonSwitchContainer} ${className || ''}`.trim()}\n style={mergedStyles}\n role=\"group\"\n {...props}\n >\n {children}\n </Component>\n );\n }\n\n return (\n <ToggleGroupPrimitive.Root\n ref={ref as any}\n className={`${buttonSwitchContainer} ${className || ''}`.trim()}\n style={mergedStyles}\n {...(props as any)}\n >\n {children}\n </ToggleGroupPrimitive.Root>\n );\n },\n);\n\nButtonSwitchContainerVanillaImpl.displayName = 'ButtonSwitchContainerVanilla';\n\nexport const ButtonSwitchContainerVanilla =\n ButtonSwitchContainerVanillaImpl as ButtonSwitchContainerVanillaComponent;\n\n// Item Component\ninterface ButtonSwitchItemOwnProps extends CSSProps {\n value: string;\n disabled?: boolean;\n}\n\nexport type ButtonSwitchItemVanillaProps<C extends ElementType = 'button'> =\n PolymorphicComponentProps<C, ButtonSwitchItemOwnProps>;\n\ntype ButtonSwitchItemVanillaComponent = PolymorphicComponent<\n 'button',\n ButtonSwitchItemVanillaProps<ElementType>\n>;\n\nconst ButtonSwitchItemVanillaImpl = forwardRef(\n <C extends ElementType = 'button'>(\n { as, className, css, style, children, ...props }: ButtonSwitchItemVanillaProps<C>,\n ref?: PolymorphicRef<C>,\n ) => {\n const Component = (as || 'button') as any;\n const { colors } = useVanillaExtractTheme();\n\n const { style: cssStyles, vars } = processCSSProp(css, colors);\n\n const mergedStyles = {\n ...cssStyles,\n ...style,\n ...assignInlineVars(vars),\n };\n\n if (as) {\n return (\n <Component\n ref={ref}\n className={`${buttonSwitchItem} ${className || ''}`.trim()}\n style={mergedStyles}\n role=\"radio\"\n {...props}\n >\n {children}\n </Component>\n );\n }\n\n return (\n <ToggleGroupPrimitive.Item\n ref={ref as any}\n className={`${buttonSwitchItem} ${className || ''}`.trim()}\n style={mergedStyles}\n {...(props as any)}\n >\n {children}\n </ToggleGroupPrimitive.Item>\n );\n },\n);\n\nButtonSwitchItemVanillaImpl.displayName = 'ButtonSwitchItemVanilla';\n\nexport const ButtonSwitchItemVanilla =\n ButtonSwitchItemVanillaImpl as ButtonSwitchItemVanillaComponent;\n"],"mappings":";;;;;;;;;;AAkCA,IAAM,oCAAA,GAAmCA,MAAAA,WAAAA,EAErC,EAAE,IAAI,WAAW,KAAK,OAAO,UAAU,GAAG,SAC1C,QACG;CACH,MAAM,YAAa,MAAM;CACzB,MAAM,EAAE,WAAWC,qBAAAA,uBAAuB;CAE1C,MAAM,EAAE,OAAO,WAAW,SAASC,iBAAAA,eAAe,KAAK,MAAM;CAE7D,MAAM,eAAe;EACnB,GAAG;EACH,GAAG;EACH,IAAA,GAAGC,yBAAAA,iBAAAA,CAAiB,IAAI;CAC1B;CAEA,IAAI,IACF,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,WAAD;EACO;EACL,WAAW,GAAGC,iCAAAA,sBAAsB,GAAG,aAAa,KAAK,KAAK;EAC9D,OAAO;EACP,MAAK;EACL,GAAI;EAEH;CACQ,CAAA;CAIf,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACC,6BAAqB,MAAtB;EACO;EACL,WAAW,GAAGD,iCAAAA,sBAAsB,GAAG,aAAa,KAAK,KAAK;EAC9D,OAAO;EACP,GAAK;EAEJ;CACwB,CAAA;AAE/B,CACF;AAEA,iCAAiC,cAAc;AAE/C,IAAa,+BACX;AAgBF,IAAM,+BAAA,GAA8BJ,MAAAA,WAAAA,EAEhC,EAAE,IAAI,WAAW,KAAK,OAAO,UAAU,GAAG,SAC1C,QACG;CACH,MAAM,YAAa,MAAM;CACzB,MAAM,EAAE,WAAWC,qBAAAA,uBAAuB;CAE1C,MAAM,EAAE,OAAO,WAAW,SAASC,iBAAAA,eAAe,KAAK,MAAM;CAE7D,MAAM,eAAe;EACnB,GAAG;EACH,GAAG;EACH,IAAA,GAAGC,yBAAAA,iBAAAA,CAAiB,IAAI;CAC1B;CAEA,IAAI,IACF,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,WAAD;EACO;EACL,WAAW,GAAGG,iCAAAA,iBAAiB,GAAG,aAAa,KAAK,KAAK;EACzD,OAAO;EACP,MAAK;EACL,GAAI;EAEH;CACQ,CAAA;CAIf,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACD,6BAAqB,MAAtB;EACO;EACL,WAAW,GAAGC,iCAAAA,iBAAiB,GAAG,aAAa,KAAK,KAAK;EACzD,OAAO;EACP,GAAK;EAEJ;CACwB,CAAA;AAE/B,CACF;AAEA,4BAA4B,cAAc;AAE1C,IAAa,0BACX"}
1
+ {"version":3,"file":"ButtonSwitch.vanilla.cjs","names":["forwardRef","useVanillaExtractTheme","processCSSProp","assignInlineVars","cx","buttonSwitchContainer","ToggleGroupPrimitive","buttonSwitchItem"],"sources":["../../../components/ButtonSwitch/ButtonSwitch.vanilla.tsx"],"sourcesContent":["import * as ToggleGroupPrimitive from '@radix-ui/react-toggle-group';\nimport { assignInlineVars } from '@vanilla-extract/dynamic';\nimport { ElementType, forwardRef } from 'react';\n\nimport { CSSProps, processCSSProp } from '../../styles/cssProps';\nimport { cx } from '../../styles/cx';\nimport {\n PolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef,\n} from '../../styles/polymorphic';\nimport { useVanillaExtractTheme } from '../../styles/themeContext';\nimport { buttonSwitchContainer, buttonSwitchItem } from './ButtonSwitch.vanilla.css';\n\n// Container Component\ninterface ButtonSwitchContainerOwnProps extends CSSProps {\n type?: 'single' | 'multiple';\n value?: string | string[];\n defaultValue?: string | string[];\n onValueChange?: (value: any) => void;\n disabled?: boolean;\n rovingFocus?: boolean;\n loop?: boolean;\n orientation?: 'horizontal' | 'vertical';\n dir?: 'ltr' | 'rtl';\n}\n\nexport type ButtonSwitchContainerVanillaProps<C extends ElementType = 'div'> =\n PolymorphicComponentProps<C, ButtonSwitchContainerOwnProps>;\n\ntype ButtonSwitchContainerVanillaComponent = PolymorphicComponent<\n 'div',\n ButtonSwitchContainerVanillaProps<ElementType>\n>;\n\nconst ButtonSwitchContainerVanillaImpl = forwardRef(\n <C extends ElementType = 'div'>(\n { as, className, css, style, children, ...props }: ButtonSwitchContainerVanillaProps<C>,\n ref?: PolymorphicRef<C>,\n ) => {\n const Component = (as || 'div') as any;\n const { colors } = useVanillaExtractTheme();\n\n const { style: cssStyles, vars } = processCSSProp(css, colors);\n\n const mergedStyles = {\n ...cssStyles,\n ...style,\n ...assignInlineVars(vars),\n };\n\n if (as) {\n return (\n <Component\n ref={ref}\n className={cx(buttonSwitchContainer, className)}\n style={mergedStyles}\n role=\"group\"\n {...props}\n >\n {children}\n </Component>\n );\n }\n\n return (\n <ToggleGroupPrimitive.Root\n ref={ref as any}\n className={cx(buttonSwitchContainer, className)}\n style={mergedStyles}\n {...(props as any)}\n >\n {children}\n </ToggleGroupPrimitive.Root>\n );\n },\n);\n\nButtonSwitchContainerVanillaImpl.displayName = 'ButtonSwitchContainerVanilla';\n\nexport const ButtonSwitchContainerVanilla =\n ButtonSwitchContainerVanillaImpl as ButtonSwitchContainerVanillaComponent;\n\n// Item Component\ninterface ButtonSwitchItemOwnProps extends CSSProps {\n value: string;\n disabled?: boolean;\n}\n\nexport type ButtonSwitchItemVanillaProps<C extends ElementType = 'button'> =\n PolymorphicComponentProps<C, ButtonSwitchItemOwnProps>;\n\ntype ButtonSwitchItemVanillaComponent = PolymorphicComponent<\n 'button',\n ButtonSwitchItemVanillaProps<ElementType>\n>;\n\nconst ButtonSwitchItemVanillaImpl = forwardRef(\n <C extends ElementType = 'button'>(\n { as, className, css, style, children, ...props }: ButtonSwitchItemVanillaProps<C>,\n ref?: PolymorphicRef<C>,\n ) => {\n const Component = (as || 'button') as any;\n const { colors } = useVanillaExtractTheme();\n\n const { style: cssStyles, vars } = processCSSProp(css, colors);\n\n const mergedStyles = {\n ...cssStyles,\n ...style,\n ...assignInlineVars(vars),\n };\n\n if (as) {\n return (\n <Component\n ref={ref}\n className={cx(buttonSwitchItem, className)}\n style={mergedStyles}\n role=\"radio\"\n {...props}\n >\n {children}\n </Component>\n );\n }\n\n return (\n <ToggleGroupPrimitive.Item\n ref={ref as any}\n className={cx(buttonSwitchItem, className)}\n style={mergedStyles}\n {...(props as any)}\n >\n {children}\n </ToggleGroupPrimitive.Item>\n );\n },\n);\n\nButtonSwitchItemVanillaImpl.displayName = 'ButtonSwitchItemVanilla';\n\nexport const ButtonSwitchItemVanilla =\n ButtonSwitchItemVanillaImpl as ButtonSwitchItemVanillaComponent;\n"],"mappings":";;;;;;;;;;;AAmCA,IAAM,oCAAA,GAAmCA,MAAAA,WAAAA,EAErC,EAAE,IAAI,WAAW,KAAK,OAAO,UAAU,GAAG,SAC1C,QACG;CACH,MAAM,YAAa,MAAM;CACzB,MAAM,EAAE,WAAWC,qBAAAA,uBAAuB;CAE1C,MAAM,EAAE,OAAO,WAAW,SAASC,iBAAAA,eAAe,KAAK,MAAM;CAE7D,MAAM,eAAe;EACnB,GAAG;EACH,GAAG;EACH,IAAA,GAAGC,yBAAAA,iBAAAA,CAAiB,IAAI;CAC1B;CAEA,IAAI,IACF,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,WAAD;EACO;EACL,WAAWC,WAAAA,GAAGC,iCAAAA,uBAAuB,SAAS;EAC9C,OAAO;EACP,MAAK;EACL,GAAI;EAEH;CACQ,CAAA;CAIf,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACC,6BAAqB,MAAtB;EACO;EACL,WAAWF,WAAAA,GAAGC,iCAAAA,uBAAuB,SAAS;EAC9C,OAAO;EACP,GAAK;EAEJ;CACwB,CAAA;AAE/B,CACF;AAEA,iCAAiC,cAAc;AAE/C,IAAa,+BACX;AAgBF,IAAM,+BAAA,GAA8BL,MAAAA,WAAAA,EAEhC,EAAE,IAAI,WAAW,KAAK,OAAO,UAAU,GAAG,SAC1C,QACG;CACH,MAAM,YAAa,MAAM;CACzB,MAAM,EAAE,WAAWC,qBAAAA,uBAAuB;CAE1C,MAAM,EAAE,OAAO,WAAW,SAASC,iBAAAA,eAAe,KAAK,MAAM;CAE7D,MAAM,eAAe;EACnB,GAAG;EACH,GAAG;EACH,IAAA,GAAGC,yBAAAA,iBAAAA,CAAiB,IAAI;CAC1B;CAEA,IAAI,IACF,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,WAAD;EACO;EACL,WAAWC,WAAAA,GAAGG,iCAAAA,kBAAkB,SAAS;EACzC,OAAO;EACP,MAAK;EACL,GAAI;EAEH;CACQ,CAAA;CAIf,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACD,6BAAqB,MAAtB;EACO;EACL,WAAWF,WAAAA,GAAGG,iCAAAA,kBAAkB,SAAS;EACzC,OAAO;EACP,GAAK;EAEJ;CACwB,CAAA;AAE/B,CACF;AAEA,4BAA4B,cAAc;AAE1C,IAAa,0BACX"}
@@ -1,4 +1,5 @@
1
1
  import { processCSSProp } from "../../styles/cssProps.js";
2
+ import { cx } from "../../styles/cx.js";
2
3
  import { useVanillaExtractTheme } from "../../styles/themeContext.js";
3
4
  import { buttonSwitchContainer, buttonSwitchItem } from "./ButtonSwitch.vanilla.css.js";
4
5
  import { forwardRef } from "react";
@@ -17,7 +18,7 @@ var ButtonSwitchContainerVanillaImpl = forwardRef(({ as, className, css, style,
17
18
  };
18
19
  if (as) return /* @__PURE__ */ jsx(Component, {
19
20
  ref,
20
- className: `${buttonSwitchContainer} ${className || ""}`.trim(),
21
+ className: cx(buttonSwitchContainer, className),
21
22
  style: mergedStyles,
22
23
  role: "group",
23
24
  ...props,
@@ -25,7 +26,7 @@ var ButtonSwitchContainerVanillaImpl = forwardRef(({ as, className, css, style,
25
26
  });
26
27
  return /* @__PURE__ */ jsx(ToggleGroupPrimitive.Root, {
27
28
  ref,
28
- className: `${buttonSwitchContainer} ${className || ""}`.trim(),
29
+ className: cx(buttonSwitchContainer, className),
29
30
  style: mergedStyles,
30
31
  ...props,
31
32
  children
@@ -44,7 +45,7 @@ var ButtonSwitchItemVanillaImpl = forwardRef(({ as, className, css, style, child
44
45
  };
45
46
  if (as) return /* @__PURE__ */ jsx(Component, {
46
47
  ref,
47
- className: `${buttonSwitchItem} ${className || ""}`.trim(),
48
+ className: cx(buttonSwitchItem, className),
48
49
  style: mergedStyles,
49
50
  role: "radio",
50
51
  ...props,
@@ -52,7 +53,7 @@ var ButtonSwitchItemVanillaImpl = forwardRef(({ as, className, css, style, child
52
53
  });
53
54
  return /* @__PURE__ */ jsx(ToggleGroupPrimitive.Item, {
54
55
  ref,
55
- className: `${buttonSwitchItem} ${className || ""}`.trim(),
56
+ className: cx(buttonSwitchItem, className),
56
57
  style: mergedStyles,
57
58
  ...props,
58
59
  children
@@ -1 +1 @@
1
- {"version":3,"file":"ButtonSwitch.vanilla.js","names":[],"sources":["../../../components/ButtonSwitch/ButtonSwitch.vanilla.tsx"],"sourcesContent":["import * as ToggleGroupPrimitive from '@radix-ui/react-toggle-group';\nimport { assignInlineVars } from '@vanilla-extract/dynamic';\nimport { ElementType, forwardRef } from 'react';\n\nimport { CSSProps, processCSSProp } from '../../styles/cssProps';\nimport {\n PolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef,\n} from '../../styles/polymorphic';\nimport { useVanillaExtractTheme } from '../../styles/themeContext';\nimport { buttonSwitchContainer, buttonSwitchItem } from './ButtonSwitch.vanilla.css';\n\n// Container Component\ninterface ButtonSwitchContainerOwnProps extends CSSProps {\n type?: 'single' | 'multiple';\n value?: string | string[];\n defaultValue?: string | string[];\n onValueChange?: (value: any) => void;\n disabled?: boolean;\n rovingFocus?: boolean;\n loop?: boolean;\n orientation?: 'horizontal' | 'vertical';\n dir?: 'ltr' | 'rtl';\n}\n\nexport type ButtonSwitchContainerVanillaProps<C extends ElementType = 'div'> =\n PolymorphicComponentProps<C, ButtonSwitchContainerOwnProps>;\n\ntype ButtonSwitchContainerVanillaComponent = PolymorphicComponent<\n 'div',\n ButtonSwitchContainerVanillaProps<ElementType>\n>;\n\nconst ButtonSwitchContainerVanillaImpl = forwardRef(\n <C extends ElementType = 'div'>(\n { as, className, css, style, children, ...props }: ButtonSwitchContainerVanillaProps<C>,\n ref?: PolymorphicRef<C>,\n ) => {\n const Component = (as || 'div') as any;\n const { colors } = useVanillaExtractTheme();\n\n const { style: cssStyles, vars } = processCSSProp(css, colors);\n\n const mergedStyles = {\n ...cssStyles,\n ...style,\n ...assignInlineVars(vars),\n };\n\n if (as) {\n return (\n <Component\n ref={ref}\n className={`${buttonSwitchContainer} ${className || ''}`.trim()}\n style={mergedStyles}\n role=\"group\"\n {...props}\n >\n {children}\n </Component>\n );\n }\n\n return (\n <ToggleGroupPrimitive.Root\n ref={ref as any}\n className={`${buttonSwitchContainer} ${className || ''}`.trim()}\n style={mergedStyles}\n {...(props as any)}\n >\n {children}\n </ToggleGroupPrimitive.Root>\n );\n },\n);\n\nButtonSwitchContainerVanillaImpl.displayName = 'ButtonSwitchContainerVanilla';\n\nexport const ButtonSwitchContainerVanilla =\n ButtonSwitchContainerVanillaImpl as ButtonSwitchContainerVanillaComponent;\n\n// Item Component\ninterface ButtonSwitchItemOwnProps extends CSSProps {\n value: string;\n disabled?: boolean;\n}\n\nexport type ButtonSwitchItemVanillaProps<C extends ElementType = 'button'> =\n PolymorphicComponentProps<C, ButtonSwitchItemOwnProps>;\n\ntype ButtonSwitchItemVanillaComponent = PolymorphicComponent<\n 'button',\n ButtonSwitchItemVanillaProps<ElementType>\n>;\n\nconst ButtonSwitchItemVanillaImpl = forwardRef(\n <C extends ElementType = 'button'>(\n { as, className, css, style, children, ...props }: ButtonSwitchItemVanillaProps<C>,\n ref?: PolymorphicRef<C>,\n ) => {\n const Component = (as || 'button') as any;\n const { colors } = useVanillaExtractTheme();\n\n const { style: cssStyles, vars } = processCSSProp(css, colors);\n\n const mergedStyles = {\n ...cssStyles,\n ...style,\n ...assignInlineVars(vars),\n };\n\n if (as) {\n return (\n <Component\n ref={ref}\n className={`${buttonSwitchItem} ${className || ''}`.trim()}\n style={mergedStyles}\n role=\"radio\"\n {...props}\n >\n {children}\n </Component>\n );\n }\n\n return (\n <ToggleGroupPrimitive.Item\n ref={ref as any}\n className={`${buttonSwitchItem} ${className || ''}`.trim()}\n style={mergedStyles}\n {...(props as any)}\n >\n {children}\n </ToggleGroupPrimitive.Item>\n );\n },\n);\n\nButtonSwitchItemVanillaImpl.displayName = 'ButtonSwitchItemVanilla';\n\nexport const ButtonSwitchItemVanilla =\n ButtonSwitchItemVanillaImpl as ButtonSwitchItemVanillaComponent;\n"],"mappings":";;;;;;;;AAkCA,IAAM,mCAAmC,YAErC,EAAE,IAAI,WAAW,KAAK,OAAO,UAAU,GAAG,SAC1C,QACG;CACH,MAAM,YAAa,MAAM;CACzB,MAAM,EAAE,WAAW,uBAAuB;CAE1C,MAAM,EAAE,OAAO,WAAW,SAAS,eAAe,KAAK,MAAM;CAE7D,MAAM,eAAe;EACnB,GAAG;EACH,GAAG;EACH,GAAG,iBAAiB,IAAI;CAC1B;CAEA,IAAI,IACF,OACE,oBAAC,WAAD;EACO;EACL,WAAW,GAAG,sBAAsB,GAAG,aAAa,KAAK,KAAK;EAC9D,OAAO;EACP,MAAK;EACL,GAAI;EAEH;CACQ,CAAA;CAIf,OACE,oBAAC,qBAAqB,MAAtB;EACO;EACL,WAAW,GAAG,sBAAsB,GAAG,aAAa,KAAK,KAAK;EAC9D,OAAO;EACP,GAAK;EAEJ;CACwB,CAAA;AAE/B,CACF;AAEA,iCAAiC,cAAc;AAE/C,IAAa,+BACX;AAgBF,IAAM,8BAA8B,YAEhC,EAAE,IAAI,WAAW,KAAK,OAAO,UAAU,GAAG,SAC1C,QACG;CACH,MAAM,YAAa,MAAM;CACzB,MAAM,EAAE,WAAW,uBAAuB;CAE1C,MAAM,EAAE,OAAO,WAAW,SAAS,eAAe,KAAK,MAAM;CAE7D,MAAM,eAAe;EACnB,GAAG;EACH,GAAG;EACH,GAAG,iBAAiB,IAAI;CAC1B;CAEA,IAAI,IACF,OACE,oBAAC,WAAD;EACO;EACL,WAAW,GAAG,iBAAiB,GAAG,aAAa,KAAK,KAAK;EACzD,OAAO;EACP,MAAK;EACL,GAAI;EAEH;CACQ,CAAA;CAIf,OACE,oBAAC,qBAAqB,MAAtB;EACO;EACL,WAAW,GAAG,iBAAiB,GAAG,aAAa,KAAK,KAAK;EACzD,OAAO;EACP,GAAK;EAEJ;CACwB,CAAA;AAE/B,CACF;AAEA,4BAA4B,cAAc;AAE1C,IAAa,0BACX"}
1
+ {"version":3,"file":"ButtonSwitch.vanilla.js","names":[],"sources":["../../../components/ButtonSwitch/ButtonSwitch.vanilla.tsx"],"sourcesContent":["import * as ToggleGroupPrimitive from '@radix-ui/react-toggle-group';\nimport { assignInlineVars } from '@vanilla-extract/dynamic';\nimport { ElementType, forwardRef } from 'react';\n\nimport { CSSProps, processCSSProp } from '../../styles/cssProps';\nimport { cx } from '../../styles/cx';\nimport {\n PolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef,\n} from '../../styles/polymorphic';\nimport { useVanillaExtractTheme } from '../../styles/themeContext';\nimport { buttonSwitchContainer, buttonSwitchItem } from './ButtonSwitch.vanilla.css';\n\n// Container Component\ninterface ButtonSwitchContainerOwnProps extends CSSProps {\n type?: 'single' | 'multiple';\n value?: string | string[];\n defaultValue?: string | string[];\n onValueChange?: (value: any) => void;\n disabled?: boolean;\n rovingFocus?: boolean;\n loop?: boolean;\n orientation?: 'horizontal' | 'vertical';\n dir?: 'ltr' | 'rtl';\n}\n\nexport type ButtonSwitchContainerVanillaProps<C extends ElementType = 'div'> =\n PolymorphicComponentProps<C, ButtonSwitchContainerOwnProps>;\n\ntype ButtonSwitchContainerVanillaComponent = PolymorphicComponent<\n 'div',\n ButtonSwitchContainerVanillaProps<ElementType>\n>;\n\nconst ButtonSwitchContainerVanillaImpl = forwardRef(\n <C extends ElementType = 'div'>(\n { as, className, css, style, children, ...props }: ButtonSwitchContainerVanillaProps<C>,\n ref?: PolymorphicRef<C>,\n ) => {\n const Component = (as || 'div') as any;\n const { colors } = useVanillaExtractTheme();\n\n const { style: cssStyles, vars } = processCSSProp(css, colors);\n\n const mergedStyles = {\n ...cssStyles,\n ...style,\n ...assignInlineVars(vars),\n };\n\n if (as) {\n return (\n <Component\n ref={ref}\n className={cx(buttonSwitchContainer, className)}\n style={mergedStyles}\n role=\"group\"\n {...props}\n >\n {children}\n </Component>\n );\n }\n\n return (\n <ToggleGroupPrimitive.Root\n ref={ref as any}\n className={cx(buttonSwitchContainer, className)}\n style={mergedStyles}\n {...(props as any)}\n >\n {children}\n </ToggleGroupPrimitive.Root>\n );\n },\n);\n\nButtonSwitchContainerVanillaImpl.displayName = 'ButtonSwitchContainerVanilla';\n\nexport const ButtonSwitchContainerVanilla =\n ButtonSwitchContainerVanillaImpl as ButtonSwitchContainerVanillaComponent;\n\n// Item Component\ninterface ButtonSwitchItemOwnProps extends CSSProps {\n value: string;\n disabled?: boolean;\n}\n\nexport type ButtonSwitchItemVanillaProps<C extends ElementType = 'button'> =\n PolymorphicComponentProps<C, ButtonSwitchItemOwnProps>;\n\ntype ButtonSwitchItemVanillaComponent = PolymorphicComponent<\n 'button',\n ButtonSwitchItemVanillaProps<ElementType>\n>;\n\nconst ButtonSwitchItemVanillaImpl = forwardRef(\n <C extends ElementType = 'button'>(\n { as, className, css, style, children, ...props }: ButtonSwitchItemVanillaProps<C>,\n ref?: PolymorphicRef<C>,\n ) => {\n const Component = (as || 'button') as any;\n const { colors } = useVanillaExtractTheme();\n\n const { style: cssStyles, vars } = processCSSProp(css, colors);\n\n const mergedStyles = {\n ...cssStyles,\n ...style,\n ...assignInlineVars(vars),\n };\n\n if (as) {\n return (\n <Component\n ref={ref}\n className={cx(buttonSwitchItem, className)}\n style={mergedStyles}\n role=\"radio\"\n {...props}\n >\n {children}\n </Component>\n );\n }\n\n return (\n <ToggleGroupPrimitive.Item\n ref={ref as any}\n className={cx(buttonSwitchItem, className)}\n style={mergedStyles}\n {...(props as any)}\n >\n {children}\n </ToggleGroupPrimitive.Item>\n );\n },\n);\n\nButtonSwitchItemVanillaImpl.displayName = 'ButtonSwitchItemVanilla';\n\nexport const ButtonSwitchItemVanilla =\n ButtonSwitchItemVanillaImpl as ButtonSwitchItemVanillaComponent;\n"],"mappings":";;;;;;;;;AAmCA,IAAM,mCAAmC,YAErC,EAAE,IAAI,WAAW,KAAK,OAAO,UAAU,GAAG,SAC1C,QACG;CACH,MAAM,YAAa,MAAM;CACzB,MAAM,EAAE,WAAW,uBAAuB;CAE1C,MAAM,EAAE,OAAO,WAAW,SAAS,eAAe,KAAK,MAAM;CAE7D,MAAM,eAAe;EACnB,GAAG;EACH,GAAG;EACH,GAAG,iBAAiB,IAAI;CAC1B;CAEA,IAAI,IACF,OACE,oBAAC,WAAD;EACO;EACL,WAAW,GAAG,uBAAuB,SAAS;EAC9C,OAAO;EACP,MAAK;EACL,GAAI;EAEH;CACQ,CAAA;CAIf,OACE,oBAAC,qBAAqB,MAAtB;EACO;EACL,WAAW,GAAG,uBAAuB,SAAS;EAC9C,OAAO;EACP,GAAK;EAEJ;CACwB,CAAA;AAE/B,CACF;AAEA,iCAAiC,cAAc;AAE/C,IAAa,+BACX;AAgBF,IAAM,8BAA8B,YAEhC,EAAE,IAAI,WAAW,KAAK,OAAO,UAAU,GAAG,SAC1C,QACG;CACH,MAAM,YAAa,MAAM;CACzB,MAAM,EAAE,WAAW,uBAAuB;CAE1C,MAAM,EAAE,OAAO,WAAW,SAAS,eAAe,KAAK,MAAM;CAE7D,MAAM,eAAe;EACnB,GAAG;EACH,GAAG;EACH,GAAG,iBAAiB,IAAI;CAC1B;CAEA,IAAI,IACF,OACE,oBAAC,WAAD;EACO;EACL,WAAW,GAAG,kBAAkB,SAAS;EACzC,OAAO;EACP,MAAK;EACL,GAAI;EAEH;CACQ,CAAA;CAIf,OACE,oBAAC,qBAAqB,MAAtB;EACO;EACL,WAAW,GAAG,kBAAkB,SAAS;EACzC,OAAO;EACP,GAAK;EAEJ;CACwB,CAAA;AAE/B,CACF;AAEA,4BAA4B,cAAc;AAE1C,IAAa,0BACX"}
@@ -1,4 +1,5 @@
1
1
  const require_cssProps = require("../../styles/cssProps.cjs");
2
+ const require_cx = require("../../styles/cx.cjs");
2
3
  const require_themeContext = require("../../styles/themeContext.cjs");
3
4
  const require_Card_vanilla_css = require("./Card.vanilla.css.cjs");
4
5
  let react = require("react");
@@ -22,7 +23,7 @@ var CardVanillaComponentImpl = (0, react.forwardRef)(({ as, className, css, styl
22
23
  const additionalProps = interactive && !as ? { tabIndex: 0 } : {};
23
24
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Component, {
24
25
  ref,
25
- className: `${recipeClass} ${className || ""}`.trim(),
26
+ className: require_cx.cx(recipeClass, className),
26
27
  style: mergedStyles,
27
28
  ...additionalProps,
28
29
  ...props
@@ -1 +1 @@
1
- {"version":3,"file":"Card.vanilla.cjs","names":["forwardRef","useVanillaExtractTheme","processCSSProp","assignInlineVars","interactiveCardRecipe","cardRecipe"],"sources":["../../../components/Card/Card.vanilla.tsx"],"sourcesContent":["import { assignInlineVars } from '@vanilla-extract/dynamic';\nimport { RecipeVariants } from '@vanilla-extract/recipes';\nimport { ElementType, forwardRef } from 'react';\n\nimport { CSSProps, processCSSProp } from '../../styles/cssProps';\nimport {\n PolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef,\n} from '../../styles/polymorphic';\nimport { useVanillaExtractTheme } from '../../styles/themeContext';\nimport { cardRecipe, interactiveCardRecipe } from './Card.vanilla.css';\n\ntype CardRecipeVariants = NonNullable<RecipeVariants<typeof cardRecipe>>;\n\ninterface CardOwnProps extends CSSProps {\n elevation?: CardRecipeVariants['elevation'];\n variant?: CardRecipeVariants['variant'];\n active?: CardRecipeVariants['active'];\n interactive?: boolean;\n}\n\nexport type CardVanillaProps<C extends ElementType = 'div'> = PolymorphicComponentProps<\n C,\n CardOwnProps\n>;\n\ntype CardVanillaComponent = PolymorphicComponent<'div', CardVanillaProps<ElementType>>;\n\nconst CardVanillaComponentImpl = forwardRef(\n <C extends ElementType = 'div'>(\n {\n as,\n className,\n css,\n style,\n elevation,\n variant,\n active,\n interactive,\n ...props\n }: CardVanillaProps<C>,\n ref?: PolymorphicRef<C>,\n ) => {\n const Component = as || (interactive ? 'button' : 'div');\n const { colors } = useVanillaExtractTheme();\n const { style: cssStyles, vars } = processCSSProp(css, colors);\n const mergedStyles = { ...cssStyles, ...style, ...assignInlineVars(vars) };\n\n const recipe = interactive ? interactiveCardRecipe : cardRecipe;\n const recipeClass = recipe({ elevation, variant, active });\n\n const additionalProps = interactive && !as ? { tabIndex: 0 } : {};\n\n return (\n <Component\n ref={ref}\n className={`${recipeClass} ${className || ''}`.trim()}\n style={mergedStyles}\n {...additionalProps}\n {...props}\n />\n );\n },\n);\n\nCardVanillaComponentImpl.displayName = 'CardVanilla';\n\nexport const CardVanilla = CardVanillaComponentImpl as CardVanillaComponent;\n"],"mappings":";;;;;;;AA6BA,IAAM,4BAAA,GAA2BA,MAAAA,WAAAA,EAE7B,EACE,IACA,WACA,KACA,OACA,WACA,SACA,QACA,aACA,GAAG,SAEL,QACG;CACH,MAAM,YAAY,OAAO,cAAc,WAAW;CAClD,MAAM,EAAE,WAAWC,qBAAAA,uBAAuB;CAC1C,MAAM,EAAE,OAAO,WAAW,SAASC,iBAAAA,eAAe,KAAK,MAAM;CAC7D,MAAM,eAAe;EAAE,GAAG;EAAW,GAAG;EAAO,IAAA,GAAGC,yBAAAA,iBAAAA,CAAiB,IAAI;CAAE;CAGzE,MAAM,eADS,cAAcC,yBAAAA,wBAAwBC,yBAAAA,WAAAA,CAC1B;EAAE;EAAW;EAAS;CAAO,CAAC;CAEzD,MAAM,kBAAkB,eAAe,CAAC,KAAK,EAAE,UAAU,EAAE,IAAI,CAAC;CAEhE,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,WAAD;EACO;EACL,WAAW,GAAG,YAAY,GAAG,aAAa,KAAK,KAAK;EACpD,OAAO;EACP,GAAI;EACJ,GAAI;CACL,CAAA;AAEL,CACF;AAEA,yBAAyB,cAAc;AAEvC,IAAa,cAAc"}
1
+ {"version":3,"file":"Card.vanilla.cjs","names":["forwardRef","useVanillaExtractTheme","processCSSProp","assignInlineVars","interactiveCardRecipe","cardRecipe","cx"],"sources":["../../../components/Card/Card.vanilla.tsx"],"sourcesContent":["import { assignInlineVars } from '@vanilla-extract/dynamic';\nimport { RecipeVariants } from '@vanilla-extract/recipes';\nimport { ElementType, forwardRef } from 'react';\n\nimport { CSSProps, processCSSProp } from '../../styles/cssProps';\nimport { cx } from '../../styles/cx';\nimport {\n PolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef,\n} from '../../styles/polymorphic';\nimport { useVanillaExtractTheme } from '../../styles/themeContext';\nimport { cardRecipe, interactiveCardRecipe } from './Card.vanilla.css';\n\ntype CardRecipeVariants = NonNullable<RecipeVariants<typeof cardRecipe>>;\n\ninterface CardOwnProps extends CSSProps {\n elevation?: CardRecipeVariants['elevation'];\n variant?: CardRecipeVariants['variant'];\n active?: CardRecipeVariants['active'];\n interactive?: boolean;\n}\n\nexport type CardVanillaProps<C extends ElementType = 'div'> = PolymorphicComponentProps<\n C,\n CardOwnProps\n>;\n\ntype CardVanillaComponent = PolymorphicComponent<'div', CardVanillaProps<ElementType>>;\n\nconst CardVanillaComponentImpl = forwardRef(\n <C extends ElementType = 'div'>(\n {\n as,\n className,\n css,\n style,\n elevation,\n variant,\n active,\n interactive,\n ...props\n }: CardVanillaProps<C>,\n ref?: PolymorphicRef<C>,\n ) => {\n const Component = as || (interactive ? 'button' : 'div');\n const { colors } = useVanillaExtractTheme();\n const { style: cssStyles, vars } = processCSSProp(css, colors);\n const mergedStyles = { ...cssStyles, ...style, ...assignInlineVars(vars) };\n\n const recipe = interactive ? interactiveCardRecipe : cardRecipe;\n const recipeClass = recipe({ elevation, variant, active });\n\n const additionalProps = interactive && !as ? { tabIndex: 0 } : {};\n\n return (\n <Component\n ref={ref}\n className={cx(recipeClass, className)}\n style={mergedStyles}\n {...additionalProps}\n {...props}\n />\n );\n },\n);\n\nCardVanillaComponentImpl.displayName = 'CardVanilla';\n\nexport const CardVanilla = CardVanillaComponentImpl as CardVanillaComponent;\n"],"mappings":";;;;;;;;AA8BA,IAAM,4BAAA,GAA2BA,MAAAA,WAAAA,EAE7B,EACE,IACA,WACA,KACA,OACA,WACA,SACA,QACA,aACA,GAAG,SAEL,QACG;CACH,MAAM,YAAY,OAAO,cAAc,WAAW;CAClD,MAAM,EAAE,WAAWC,qBAAAA,uBAAuB;CAC1C,MAAM,EAAE,OAAO,WAAW,SAASC,iBAAAA,eAAe,KAAK,MAAM;CAC7D,MAAM,eAAe;EAAE,GAAG;EAAW,GAAG;EAAO,IAAA,GAAGC,yBAAAA,iBAAAA,CAAiB,IAAI;CAAE;CAGzE,MAAM,eADS,cAAcC,yBAAAA,wBAAwBC,yBAAAA,WAAAA,CAC1B;EAAE;EAAW;EAAS;CAAO,CAAC;CAEzD,MAAM,kBAAkB,eAAe,CAAC,KAAK,EAAE,UAAU,EAAE,IAAI,CAAC;CAEhE,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,WAAD;EACO;EACL,WAAWC,WAAAA,GAAG,aAAa,SAAS;EACpC,OAAO;EACP,GAAI;EACJ,GAAI;CACL,CAAA;AAEL,CACF;AAEA,yBAAyB,cAAc;AAEvC,IAAa,cAAc"}
@@ -1,4 +1,5 @@
1
1
  import { processCSSProp } from "../../styles/cssProps.js";
2
+ import { cx } from "../../styles/cx.js";
2
3
  import { useVanillaExtractTheme } from "../../styles/themeContext.js";
3
4
  import { cardRecipe, interactiveCardRecipe } from "./Card.vanilla.css.js";
4
5
  import { forwardRef } from "react";
@@ -22,7 +23,7 @@ var CardVanillaComponentImpl = forwardRef(({ as, className, css, style, elevatio
22
23
  const additionalProps = interactive && !as ? { tabIndex: 0 } : {};
23
24
  return /* @__PURE__ */ jsx(Component, {
24
25
  ref,
25
- className: `${recipeClass} ${className || ""}`.trim(),
26
+ className: cx(recipeClass, className),
26
27
  style: mergedStyles,
27
28
  ...additionalProps,
28
29
  ...props
@@ -1 +1 @@
1
- {"version":3,"file":"Card.vanilla.js","names":[],"sources":["../../../components/Card/Card.vanilla.tsx"],"sourcesContent":["import { assignInlineVars } from '@vanilla-extract/dynamic';\nimport { RecipeVariants } from '@vanilla-extract/recipes';\nimport { ElementType, forwardRef } from 'react';\n\nimport { CSSProps, processCSSProp } from '../../styles/cssProps';\nimport {\n PolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef,\n} from '../../styles/polymorphic';\nimport { useVanillaExtractTheme } from '../../styles/themeContext';\nimport { cardRecipe, interactiveCardRecipe } from './Card.vanilla.css';\n\ntype CardRecipeVariants = NonNullable<RecipeVariants<typeof cardRecipe>>;\n\ninterface CardOwnProps extends CSSProps {\n elevation?: CardRecipeVariants['elevation'];\n variant?: CardRecipeVariants['variant'];\n active?: CardRecipeVariants['active'];\n interactive?: boolean;\n}\n\nexport type CardVanillaProps<C extends ElementType = 'div'> = PolymorphicComponentProps<\n C,\n CardOwnProps\n>;\n\ntype CardVanillaComponent = PolymorphicComponent<'div', CardVanillaProps<ElementType>>;\n\nconst CardVanillaComponentImpl = forwardRef(\n <C extends ElementType = 'div'>(\n {\n as,\n className,\n css,\n style,\n elevation,\n variant,\n active,\n interactive,\n ...props\n }: CardVanillaProps<C>,\n ref?: PolymorphicRef<C>,\n ) => {\n const Component = as || (interactive ? 'button' : 'div');\n const { colors } = useVanillaExtractTheme();\n const { style: cssStyles, vars } = processCSSProp(css, colors);\n const mergedStyles = { ...cssStyles, ...style, ...assignInlineVars(vars) };\n\n const recipe = interactive ? interactiveCardRecipe : cardRecipe;\n const recipeClass = recipe({ elevation, variant, active });\n\n const additionalProps = interactive && !as ? { tabIndex: 0 } : {};\n\n return (\n <Component\n ref={ref}\n className={`${recipeClass} ${className || ''}`.trim()}\n style={mergedStyles}\n {...additionalProps}\n {...props}\n />\n );\n },\n);\n\nCardVanillaComponentImpl.displayName = 'CardVanilla';\n\nexport const CardVanilla = CardVanillaComponentImpl as CardVanillaComponent;\n"],"mappings":";;;;;;;AA6BA,IAAM,2BAA2B,YAE7B,EACE,IACA,WACA,KACA,OACA,WACA,SACA,QACA,aACA,GAAG,SAEL,QACG;CACH,MAAM,YAAY,OAAO,cAAc,WAAW;CAClD,MAAM,EAAE,WAAW,uBAAuB;CAC1C,MAAM,EAAE,OAAO,WAAW,SAAS,eAAe,KAAK,MAAM;CAC7D,MAAM,eAAe;EAAE,GAAG;EAAW,GAAG;EAAO,GAAG,iBAAiB,IAAI;CAAE;CAGzE,MAAM,eADS,cAAc,wBAAwB,WAAA,CAC1B;EAAE;EAAW;EAAS;CAAO,CAAC;CAEzD,MAAM,kBAAkB,eAAe,CAAC,KAAK,EAAE,UAAU,EAAE,IAAI,CAAC;CAEhE,OACE,oBAAC,WAAD;EACO;EACL,WAAW,GAAG,YAAY,GAAG,aAAa,KAAK,KAAK;EACpD,OAAO;EACP,GAAI;EACJ,GAAI;CACL,CAAA;AAEL,CACF;AAEA,yBAAyB,cAAc;AAEvC,IAAa,cAAc"}
1
+ {"version":3,"file":"Card.vanilla.js","names":[],"sources":["../../../components/Card/Card.vanilla.tsx"],"sourcesContent":["import { assignInlineVars } from '@vanilla-extract/dynamic';\nimport { RecipeVariants } from '@vanilla-extract/recipes';\nimport { ElementType, forwardRef } from 'react';\n\nimport { CSSProps, processCSSProp } from '../../styles/cssProps';\nimport { cx } from '../../styles/cx';\nimport {\n PolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef,\n} from '../../styles/polymorphic';\nimport { useVanillaExtractTheme } from '../../styles/themeContext';\nimport { cardRecipe, interactiveCardRecipe } from './Card.vanilla.css';\n\ntype CardRecipeVariants = NonNullable<RecipeVariants<typeof cardRecipe>>;\n\ninterface CardOwnProps extends CSSProps {\n elevation?: CardRecipeVariants['elevation'];\n variant?: CardRecipeVariants['variant'];\n active?: CardRecipeVariants['active'];\n interactive?: boolean;\n}\n\nexport type CardVanillaProps<C extends ElementType = 'div'> = PolymorphicComponentProps<\n C,\n CardOwnProps\n>;\n\ntype CardVanillaComponent = PolymorphicComponent<'div', CardVanillaProps<ElementType>>;\n\nconst CardVanillaComponentImpl = forwardRef(\n <C extends ElementType = 'div'>(\n {\n as,\n className,\n css,\n style,\n elevation,\n variant,\n active,\n interactive,\n ...props\n }: CardVanillaProps<C>,\n ref?: PolymorphicRef<C>,\n ) => {\n const Component = as || (interactive ? 'button' : 'div');\n const { colors } = useVanillaExtractTheme();\n const { style: cssStyles, vars } = processCSSProp(css, colors);\n const mergedStyles = { ...cssStyles, ...style, ...assignInlineVars(vars) };\n\n const recipe = interactive ? interactiveCardRecipe : cardRecipe;\n const recipeClass = recipe({ elevation, variant, active });\n\n const additionalProps = interactive && !as ? { tabIndex: 0 } : {};\n\n return (\n <Component\n ref={ref}\n className={cx(recipeClass, className)}\n style={mergedStyles}\n {...additionalProps}\n {...props}\n />\n );\n },\n);\n\nCardVanillaComponentImpl.displayName = 'CardVanilla';\n\nexport const CardVanilla = CardVanillaComponentImpl as CardVanillaComponent;\n"],"mappings":";;;;;;;;AA8BA,IAAM,2BAA2B,YAE7B,EACE,IACA,WACA,KACA,OACA,WACA,SACA,QACA,aACA,GAAG,SAEL,QACG;CACH,MAAM,YAAY,OAAO,cAAc,WAAW;CAClD,MAAM,EAAE,WAAW,uBAAuB;CAC1C,MAAM,EAAE,OAAO,WAAW,SAAS,eAAe,KAAK,MAAM;CAC7D,MAAM,eAAe;EAAE,GAAG;EAAW,GAAG;EAAO,GAAG,iBAAiB,IAAI;CAAE;CAGzE,MAAM,eADS,cAAc,wBAAwB,WAAA,CAC1B;EAAE;EAAW;EAAS;CAAO,CAAC;CAEzD,MAAM,kBAAkB,eAAe,CAAC,KAAK,EAAE,UAAU,EAAE,IAAI,CAAC;CAEhE,OACE,oBAAC,WAAD;EACO;EACL,WAAW,GAAG,aAAa,SAAS;EACpC,OAAO;EACP,GAAI;EACJ,GAAI;CACL,CAAA;AAEL,CACF;AAEA,yBAAyB,cAAc;AAEvC,IAAa,cAAc"}
@@ -1,5 +1,6 @@
1
1
  const require_runtime = require("../../_virtual/_rolldown/runtime.cjs");
2
2
  const require_cssProps = require("../../styles/cssProps.cjs");
3
+ const require_cx = require("../../styles/cx.cjs");
3
4
  const require_themeContext = require("../../styles/themeContext.cjs");
4
5
  const require_useIsomorphicLayoutEffect = require("../../utils/useIsomorphicLayoutEffect.cjs");
5
6
  const require_AccessibleIcon = require("../AccessibleIcon/AccessibleIcon.cjs");
@@ -96,12 +97,7 @@ var CodeBlockVanilla = (0, react.forwardRef)(({ lang = "text", code, copyable =
96
97
  style: containerStyles,
97
98
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("pre", {
98
99
  ref: setPreRef,
99
- className: [
100
- require_CodeBlock_vanilla_css.pre,
101
- noBorder ? require_CodeBlock_vanilla_css.preNoBorder : "",
102
- highlightClass,
103
- className
104
- ].filter(Boolean).join(" "),
100
+ className: require_cx.cx(require_CodeBlock_vanilla_css.pre, noBorder && "_1krwcuz1", highlightClass, className),
105
101
  style: {
106
102
  maxHeight,
107
103
  ...highlightStyle,
@@ -110,11 +106,7 @@ var CodeBlockVanilla = (0, react.forwardRef)(({ lang = "text", code, copyable =
110
106
  },
111
107
  ...props,
112
108
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
113
- className: [
114
- require_CodeBlock_vanilla_css.codeContent,
115
- copyable && isLeft && isBottom ? require_CodeBlock_vanilla_css.codeContentBottomPadding : "",
116
- copyable && isLeft && !isBottom ? require_CodeBlock_vanilla_css.codeContentTopPadding : ""
117
- ].filter(Boolean).join(" "),
109
+ className: require_cx.cx(require_CodeBlock_vanilla_css.codeContent, copyable && isLeft && isBottom && "_1krwcuz3", copyable && isLeft && !isBottom && "_1krwcuz4"),
118
110
  children: tokens.map((line, i) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
119
111
  ...getLineProps({ line }),
120
112
  style: wrapText ? {
@@ -1 +1 @@
1
- {"version":3,"file":"CodeBlock.vanilla.cjs","names":["forwardRef","useVanillaExtractTheme","themes","processCSSProp","assignInlineVars","useState","useRef","useCallback","copyButtonWrapperBottomLeft","copyButtonWrapperBottomRight","copyButtonWrapperTopLeft","copyButtonWrapperTop","ButtonVanilla","AccessibleIcon","CheckIcon","CopyIcon","Highlight","Prism","pre","preNoBorder","codeContent","codeContentBottomPadding","codeContentTopPadding"],"sources":["../../../components/CodeBlock/CodeBlock.vanilla.tsx"],"sourcesContent":["import { CheckIcon, CopyIcon } from '@radix-ui/react-icons';\nimport { assignInlineVars } from '@vanilla-extract/dynamic';\nimport { Highlight, Language, themes } from 'prism-react-renderer';\nimport React, { forwardRef, HTMLAttributes, useCallback, useRef, useState } from 'react';\n\nimport { CSSProps, processCSSProp } from '../../styles/cssProps';\nimport { useVanillaExtractTheme } from '../../styles/themeContext';\nimport { useIsomorphicLayoutEffect } from '../../utils/useIsomorphicLayoutEffect';\nimport { AccessibleIcon } from '../AccessibleIcon';\nimport { ButtonVanilla } from '../Button';\nimport {\n codeContent,\n codeContentBottomPadding,\n codeContentTopPadding,\n copyButtonWrapperBottomLeft,\n copyButtonWrapperBottomRight,\n copyButtonWrapperTop,\n copyButtonWrapperTopLeft,\n pre,\n preNoBorder,\n} from './CodeBlock.vanilla.css';\nimport type {\n CodeBlockCopyButtonAlign,\n CodeBlockCopyErrorHandler,\n CodeBlockLanguage,\n} from './index';\nimport { Prism } from './prism-extend';\n\nexport interface CodeBlockVanillaProps\n extends Omit<HTMLAttributes<HTMLPreElement>, 'css'>, CSSProps {\n lang?: CodeBlockLanguage;\n code: string;\n copyable?: boolean;\n copyText?: string;\n copiedText?: string;\n copyButtonAlign?: CodeBlockCopyButtonAlign;\n onCopy?: () => void;\n onCopyError?: CodeBlockCopyErrorHandler;\n noBorder?: boolean;\n wrapText?: boolean;\n colorScheme?: 'light' | 'dark';\n maxHeight?: number | string;\n}\n\nexport const CodeBlockVanilla = forwardRef<HTMLPreElement, CodeBlockVanillaProps>(\n (\n {\n lang = 'text',\n code,\n copyable = false,\n copyText,\n copiedText,\n copyButtonAlign = 'top right',\n onCopy,\n onCopyError,\n noBorder,\n wrapText = false,\n colorScheme,\n maxHeight = 424,\n css,\n style,\n className,\n ...props\n },\n ref,\n ) => {\n const { colors, resolvedTheme } = useVanillaExtractTheme();\n const effectiveScheme = colorScheme ?? resolvedTheme;\n const prismTheme = effectiveScheme === 'dark' ? themes.nightOwl : themes.nightOwlLight;\n\n const isBottom = copyButtonAlign.includes('bottom');\n const isLeft = copyButtonAlign.includes('left');\n\n const { style: cssStyles, vars } = processCSSProp(css, colors);\n const containerStyles = {\n position: 'relative' as const,\n ...cssStyles,\n ...assignInlineVars(vars),\n };\n\n const [copied, setCopied] = useState(false);\n\n const preRef = useRef<HTMLPreElement | null>(\n null,\n ) as React.MutableRefObject<HTMLPreElement | null>;\n const buttonWrapperRef = useRef<HTMLDivElement>(null);\n\n const setPreRef = useCallback(\n (node: HTMLPreElement | null) => {\n preRef.current = node;\n if (typeof ref === 'function') ref(node);\n else if (ref) (ref as React.MutableRefObject<HTMLPreElement | null>).current = node;\n },\n [ref],\n );\n\n useIsomorphicLayoutEffect(() => {\n if (!copyable) return;\n const pre = preRef.current;\n const wrapper = buttonWrapperRef.current;\n if (!pre || !wrapper) return;\n\n const borderH = noBorder ? 0 : 2;\n\n const update = () => {\n if (!isLeft) {\n const vScrollbar = Math.max(0, pre.offsetWidth - pre.clientWidth - borderH);\n wrapper.style.right = `${16 + vScrollbar}px`;\n }\n if (isBottom) {\n const hScrollbar = Math.max(0, pre.offsetHeight - pre.clientHeight - borderH);\n wrapper.style.bottom = `${8 + hScrollbar}px`;\n }\n };\n\n update();\n const observer = new ResizeObserver(update);\n observer.observe(pre);\n return () => observer.disconnect();\n }, [copyable, isBottom, isLeft, noBorder]);\n\n const handleCopy = async () => {\n try {\n try {\n await navigator.clipboard.writeText(code);\n } catch (error) {\n // clipboard write failed (e.g. permission denied) — leave UI unchanged unless a fallback handled it\n if ((await onCopyError?.(error, code)) !== true) return;\n }\n setCopied(true);\n onCopy?.();\n setTimeout(() => setCopied(false), 1500);\n } catch {\n // onCopyError or onCopy threw — leave UI unchanged\n }\n };\n\n const buttonPositionClass = isBottom\n ? isLeft\n ? copyButtonWrapperBottomLeft\n : copyButtonWrapperBottomRight\n : isLeft\n ? copyButtonWrapperTopLeft\n : copyButtonWrapperTop;\n\n const copyButton = copyable ? (\n <ButtonVanilla\n variant=\"secondary\"\n ghost\n size=\"small\"\n type=\"button\"\n onClick={handleCopy}\n css={{\n color: '$hiContrast',\n gap: '$1',\n backgroundColor: '$codeBlockCopyButtonBg',\n height: '32px',\n }}\n >\n <AccessibleIcon label={copied ? 'Copied' : 'Copy'}>\n {copied ? <CheckIcon /> : <CopyIcon />}\n </AccessibleIcon>\n {copied ? copiedText : copyText}\n </ButtonVanilla>\n ) : null;\n\n return (\n <Highlight\n theme={prismTheme}\n code={code}\n language={(Prism.languages[lang] != null ? lang : 'text') as Language}\n >\n {({\n className: highlightClass,\n style: highlightStyle,\n tokens,\n getLineProps,\n getTokenProps,\n }) => (\n <div style={containerStyles}>\n <pre\n ref={setPreRef}\n className={[pre, noBorder ? preNoBorder : '', highlightClass, className]\n .filter(Boolean)\n .join(' ')}\n style={{\n maxHeight,\n ...highlightStyle,\n backgroundColor: 'inherit',\n ...style,\n }}\n {...props}\n >\n <div\n className={[\n codeContent,\n copyable && isLeft && isBottom ? codeContentBottomPadding : '',\n copyable && isLeft && !isBottom ? codeContentTopPadding : '',\n ]\n .filter(Boolean)\n .join(' ')}\n >\n {tokens.map((line, i) => (\n <div\n key={i}\n {...getLineProps({ line })}\n style={\n wrapText ? { whiteSpace: 'pre-wrap', wordBreak: 'break-all' } : undefined\n }\n >\n {line.map((token, key) => (\n <span key={key} {...getTokenProps({ token })} />\n ))}\n </div>\n ))}\n </div>\n </pre>\n {copyButton && (\n <div ref={buttonWrapperRef} className={buttonPositionClass}>\n {copyButton}\n </div>\n )}\n </div>\n )}\n </Highlight>\n );\n },\n);\n\nCodeBlockVanilla.displayName = 'CodeBlockVanilla';\n"],"mappings":";;;;;;;;;;;;;;;AA4CA,IAAa,oBAAA,GAAmBA,MAAAA,WAAAA,EAE5B,EACE,OAAO,QACP,MACA,WAAW,OACX,UACA,YACA,kBAAkB,aAClB,QACA,aACA,UACA,WAAW,OACX,aACA,YAAY,KACZ,KACA,OACA,WACA,GAAG,SAEL,QACG;CACH,MAAM,EAAE,QAAQ,kBAAkBC,qBAAAA,uBAAuB;CAEzD,MAAM,cADkB,eAAe,mBACA,SAASC,qBAAAA,OAAO,WAAWA,qBAAAA,OAAO;CAEzE,MAAM,WAAW,gBAAgB,SAAS,QAAQ;CAClD,MAAM,SAAS,gBAAgB,SAAS,MAAM;CAE9C,MAAM,EAAE,OAAO,WAAW,SAASC,iBAAAA,eAAe,KAAK,MAAM;CAC7D,MAAM,kBAAkB;EACtB,UAAU;EACV,GAAG;EACH,IAAA,GAAGC,yBAAAA,iBAAAA,CAAiB,IAAI;CAC1B;CAEA,MAAM,CAAC,QAAQ,cAAA,GAAaC,MAAAA,SAAAA,CAAS,KAAK;CAE1C,MAAM,UAAA,GAASC,MAAAA,OAAAA,CACb,IACF;CACA,MAAM,oBAAA,GAAmBA,MAAAA,OAAAA,CAAuB,IAAI;CAEpD,MAAM,aAAA,GAAYC,MAAAA,YAAAA,EACf,SAAgC;EAC/B,OAAO,UAAU;EACjB,IAAI,OAAO,QAAQ,YAAY,IAAI,IAAI;OACl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M,CAAC,EAAI,GAApC,GAAoC,CAChD;KACE,GATE,CASF,CACN;IACE,CAAA;GACF,CAAA,GACJ,cACC,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;IAAK,KAAK;IAAkB,WAAW;IACpC,UAAA;GACE,CAAA,CAEJ;;CAEE,CAAA;AAEf,CACF;AAEA,iBAAiB,cAAc"}
1
+ {"version":3,"file":"CodeBlock.vanilla.cjs","names":["forwardRef","useVanillaExtractTheme","themes","processCSSProp","assignInlineVars","useState","useRef","useCallback","copyButtonWrapperBottomLeft","copyButtonWrapperBottomRight","copyButtonWrapperTopLeft","copyButtonWrapperTop","ButtonVanilla","AccessibleIcon","CheckIcon","CopyIcon","Highlight","Prism","cx","pre","codeContent"],"sources":["../../../components/CodeBlock/CodeBlock.vanilla.tsx"],"sourcesContent":["import { CheckIcon, CopyIcon } from '@radix-ui/react-icons';\nimport { assignInlineVars } from '@vanilla-extract/dynamic';\nimport { Highlight, Language, themes } from 'prism-react-renderer';\nimport React, { forwardRef, HTMLAttributes, useCallback, useRef, useState } from 'react';\n\nimport { CSSProps, processCSSProp } from '../../styles/cssProps';\nimport { cx } from '../../styles/cx';\nimport { useVanillaExtractTheme } from '../../styles/themeContext';\nimport { useIsomorphicLayoutEffect } from '../../utils/useIsomorphicLayoutEffect';\nimport { AccessibleIcon } from '../AccessibleIcon';\nimport { ButtonVanilla } from '../Button';\nimport {\n codeContent,\n codeContentBottomPadding,\n codeContentTopPadding,\n copyButtonWrapperBottomLeft,\n copyButtonWrapperBottomRight,\n copyButtonWrapperTop,\n copyButtonWrapperTopLeft,\n pre,\n preNoBorder,\n} from './CodeBlock.vanilla.css';\nimport type {\n CodeBlockCopyButtonAlign,\n CodeBlockCopyErrorHandler,\n CodeBlockLanguage,\n} from './index';\nimport { Prism } from './prism-extend';\n\nexport interface CodeBlockVanillaProps\n extends Omit<HTMLAttributes<HTMLPreElement>, 'css'>, CSSProps {\n lang?: CodeBlockLanguage;\n code: string;\n copyable?: boolean;\n copyText?: string;\n copiedText?: string;\n copyButtonAlign?: CodeBlockCopyButtonAlign;\n onCopy?: () => void;\n onCopyError?: CodeBlockCopyErrorHandler;\n noBorder?: boolean;\n wrapText?: boolean;\n colorScheme?: 'light' | 'dark';\n maxHeight?: number | string;\n}\n\nexport const CodeBlockVanilla = forwardRef<HTMLPreElement, CodeBlockVanillaProps>(\n (\n {\n lang = 'text',\n code,\n copyable = false,\n copyText,\n copiedText,\n copyButtonAlign = 'top right',\n onCopy,\n onCopyError,\n noBorder,\n wrapText = false,\n colorScheme,\n maxHeight = 424,\n css,\n style,\n className,\n ...props\n },\n ref,\n ) => {\n const { colors, resolvedTheme } = useVanillaExtractTheme();\n const effectiveScheme = colorScheme ?? resolvedTheme;\n const prismTheme = effectiveScheme === 'dark' ? themes.nightOwl : themes.nightOwlLight;\n\n const isBottom = copyButtonAlign.includes('bottom');\n const isLeft = copyButtonAlign.includes('left');\n\n const { style: cssStyles, vars } = processCSSProp(css, colors);\n const containerStyles = {\n position: 'relative' as const,\n ...cssStyles,\n ...assignInlineVars(vars),\n };\n\n const [copied, setCopied] = useState(false);\n\n const preRef = useRef<HTMLPreElement | null>(\n null,\n ) as React.MutableRefObject<HTMLPreElement | null>;\n const buttonWrapperRef = useRef<HTMLDivElement>(null);\n\n const setPreRef = useCallback(\n (node: HTMLPreElement | null) => {\n preRef.current = node;\n if (typeof ref === 'function') ref(node);\n else if (ref) (ref as React.MutableRefObject<HTMLPreElement | null>).current = node;\n },\n [ref],\n );\n\n useIsomorphicLayoutEffect(() => {\n if (!copyable) return;\n const pre = preRef.current;\n const wrapper = buttonWrapperRef.current;\n if (!pre || !wrapper) return;\n\n const borderH = noBorder ? 0 : 2;\n\n const update = () => {\n if (!isLeft) {\n const vScrollbar = Math.max(0, pre.offsetWidth - pre.clientWidth - borderH);\n wrapper.style.right = `${16 + vScrollbar}px`;\n }\n if (isBottom) {\n const hScrollbar = Math.max(0, pre.offsetHeight - pre.clientHeight - borderH);\n wrapper.style.bottom = `${8 + hScrollbar}px`;\n }\n };\n\n update();\n const observer = new ResizeObserver(update);\n observer.observe(pre);\n return () => observer.disconnect();\n }, [copyable, isBottom, isLeft, noBorder]);\n\n const handleCopy = async () => {\n try {\n try {\n await navigator.clipboard.writeText(code);\n } catch (error) {\n // clipboard write failed (e.g. permission denied) — leave UI unchanged unless a fallback handled it\n if ((await onCopyError?.(error, code)) !== true) return;\n }\n setCopied(true);\n onCopy?.();\n setTimeout(() => setCopied(false), 1500);\n } catch {\n // onCopyError or onCopy threw — leave UI unchanged\n }\n };\n\n const buttonPositionClass = isBottom\n ? isLeft\n ? copyButtonWrapperBottomLeft\n : copyButtonWrapperBottomRight\n : isLeft\n ? copyButtonWrapperTopLeft\n : copyButtonWrapperTop;\n\n const copyButton = copyable ? (\n <ButtonVanilla\n variant=\"secondary\"\n ghost\n size=\"small\"\n type=\"button\"\n onClick={handleCopy}\n css={{\n color: '$hiContrast',\n gap: '$1',\n backgroundColor: '$codeBlockCopyButtonBg',\n height: '32px',\n }}\n >\n <AccessibleIcon label={copied ? 'Copied' : 'Copy'}>\n {copied ? <CheckIcon /> : <CopyIcon />}\n </AccessibleIcon>\n {copied ? copiedText : copyText}\n </ButtonVanilla>\n ) : null;\n\n return (\n <Highlight\n theme={prismTheme}\n code={code}\n language={(Prism.languages[lang] != null ? lang : 'text') as Language}\n >\n {({\n className: highlightClass,\n style: highlightStyle,\n tokens,\n getLineProps,\n getTokenProps,\n }) => (\n <div style={containerStyles}>\n <pre\n ref={setPreRef}\n className={cx(pre, noBorder && preNoBorder, highlightClass, className)}\n style={{\n maxHeight,\n ...highlightStyle,\n backgroundColor: 'inherit',\n ...style,\n }}\n {...props}\n >\n <div\n className={cx(\n codeContent,\n copyable && isLeft && isBottom && codeContentBottomPadding,\n copyable && isLeft && !isBottom && codeContentTopPadding,\n )}\n >\n {tokens.map((line, i) => (\n <div\n key={i}\n {...getLineProps({ line })}\n style={\n wrapText ? { whiteSpace: 'pre-wrap', wordBreak: 'break-all' } : undefined\n }\n >\n {line.map((token, key) => (\n <span key={key} {...getTokenProps({ token })} />\n ))}\n </div>\n ))}\n </div>\n </pre>\n {copyButton && (\n <div ref={buttonWrapperRef} className={buttonPositionClass}>\n {copyButton}\n </div>\n )}\n </div>\n )}\n </Highlight>\n );\n },\n);\n\nCodeBlockVanilla.displayName = 'CodeBlockVanilla';\n"],"mappings":";;;;;;;;;;;;;;;;AA6CA,IAAa,oBAAA,GAAmBA,MAAAA,WAAAA,EAE5B,EACE,OAAO,QACP,MACA,WAAW,OACX,UACA,YACA,kBAAkB,aAClB,QACA,aACA,UACA,WAAW,OACX,aACA,YAAY,KACZ,KACA,OACA,WACA,GAAG,SAEL,QACG;CACH,MAAM,EAAE,QAAQ,kBAAkBC,qBAAAA,uBAAuB;CAEzD,MAAM,cADkB,eAAe,mBACA,SAASC,qBAAAA,OAAO,WAAWA,qBAAAA,OAAO;CAEzE,MAAM,WAAW,gBAAgB,SAAS,QAAQ;CAClD,MAAM,SAAS,gBAAgB,SAAS,MAAM;CAE9C,MAAM,EAAE,OAAO,WAAW,SAASC,iBAAAA,eAAe,KAAK,MAAM;CAC7D,MAAM,kBAAkB;EACtB,UAAU;EACV,GAAG;EACH,IAAA,GAAGC,yBAAAA,iBAAAA,CAAiB,IAAI;CAC1B;CAEA,MAAM,CAAC,QAAQ,cAAA,GAAaC,MAAAA,SAAAA,CAAS,KAAK;CAE1C,MAAM,UAAA,GAASC,MAAAA,OAAAA,CACb,IACF;CACA,MAAM,oBAAA,GAAmBA,MAAAA,OAAAA,CAAuB,IAAI;CAEpD,MAAM,aAAA,GAAYC,MAAAA,YAAAA,EACf,SAAgC;EAC/B,OAAO,UAAU;EACjB,IAAI,OAAO,QAAQ,YAAY,IAAI,IAAI;OAClC,IAAI,KAAK,IAAuD,UAAU;CACjF,GACA,CAAC,GAAG,CACN;CAEA,kCAAA,gCAAgC;EAC9B,IAAI,CAAC,UAAU;EACf,MAAM,MAAM,OAAO;EACnB,MAAM,UA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../../styles/cssProps.js";
2
+ import { cx } from "../../styles/cx.js";
2
3
  import { useVanillaExtractTheme } from "../../styles/themeContext.js";
3
4
  import { useIsomorphicLayoutEffect } from "../../utils/useIsomorphicLayoutEffect.js";
4
5
  import { AccessibleIcon } from "../AccessibleIcon/AccessibleIcon.js";
5
6
  import { ButtonVanilla } from "../Button/Button.vanilla.js";
6
- import { codeContent, codeContentBottomPadding, codeContentTopPadding, copyButtonWrapperBottomLeft, copyButtonWrapperBottomRight, copyButtonWrapperTop, copyButtonWrapperTopLeft, pre, preNoBorder } from "./CodeBlock.vanilla.css.js";
7
+ import { codeContent, copyButtonWrapperBottomLeft, copyButtonWrapperBottomRight, copyButtonWrapperTop, copyButtonWrapperTopLeft, pre } from "./CodeBlock.vanilla.css.js";
7
8
  import { Prism } from "./prism-extend.js";
8
9
  import { CheckIcon, CopyIcon } from "@radix-ui/react-icons";
9
10
  import { forwardRef, useCallback, useRef, useState } from "react";
@@ -94,12 +95,7 @@ var CodeBlockVanilla = forwardRef(({ lang = "text", code, copyable = false, copy
94
95
  style: containerStyles,
95
96
  children: [/* @__PURE__ */ jsx("pre", {
96
97
  ref: setPreRef,
97
- className: [
98
- pre,
99
- noBorder ? preNoBorder : "",
100
- highlightClass,
101
- className
102
- ].filter(Boolean).join(" "),
98
+ className: cx(pre, noBorder && "_1krwcuz1", highlightClass, className),
103
99
  style: {
104
100
  maxHeight,
105
101
  ...highlightStyle,
@@ -108,11 +104,7 @@ var CodeBlockVanilla = forwardRef(({ lang = "text", code, copyable = false, copy
108
104
  },
109
105
  ...props,
110
106
  children: /* @__PURE__ */ jsx("div", {
111
- className: [
112
- codeContent,
113
- copyable && isLeft && isBottom ? codeContentBottomPadding : "",
114
- copyable && isLeft && !isBottom ? codeContentTopPadding : ""
115
- ].filter(Boolean).join(" "),
107
+ className: cx(codeContent, copyable && isLeft && isBottom && "_1krwcuz3", copyable && isLeft && !isBottom && "_1krwcuz4"),
116
108
  children: tokens.map((line, i) => /* @__PURE__ */ jsx("div", {
117
109
  ...getLineProps({ line }),
118
110
  style: wrapText ? {
@@ -1 +1 @@
1
- {"version":3,"file":"CodeBlock.vanilla.js","names":[],"sources":["../../../components/CodeBlock/CodeBlock.vanilla.tsx"],"sourcesContent":["import { CheckIcon, CopyIcon } from '@radix-ui/react-icons';\nimport { assignInlineVars } from '@vanilla-extract/dynamic';\nimport { Highlight, Language, themes } from 'prism-react-renderer';\nimport React, { forwardRef, HTMLAttributes, useCallback, useRef, useState } from 'react';\n\nimport { CSSProps, processCSSProp } from '../../styles/cssProps';\nimport { useVanillaExtractTheme } from '../../styles/themeContext';\nimport { useIsomorphicLayoutEffect } from '../../utils/useIsomorphicLayoutEffect';\nimport { AccessibleIcon } from '../AccessibleIcon';\nimport { ButtonVanilla } from '../Button';\nimport {\n codeContent,\n codeContentBottomPadding,\n codeContentTopPadding,\n copyButtonWrapperBottomLeft,\n copyButtonWrapperBottomRight,\n copyButtonWrapperTop,\n copyButtonWrapperTopLeft,\n pre,\n preNoBorder,\n} from './CodeBlock.vanilla.css';\nimport type {\n CodeBlockCopyButtonAlign,\n CodeBlockCopyErrorHandler,\n CodeBlockLanguage,\n} from './index';\nimport { Prism } from './prism-extend';\n\nexport interface CodeBlockVanillaProps\n extends Omit<HTMLAttributes<HTMLPreElement>, 'css'>, CSSProps {\n lang?: CodeBlockLanguage;\n code: string;\n copyable?: boolean;\n copyText?: string;\n copiedText?: string;\n copyButtonAlign?: CodeBlockCopyButtonAlign;\n onCopy?: () => void;\n onCopyError?: CodeBlockCopyErrorHandler;\n noBorder?: boolean;\n wrapText?: boolean;\n colorScheme?: 'light' | 'dark';\n maxHeight?: number | string;\n}\n\nexport const CodeBlockVanilla = forwardRef<HTMLPreElement, CodeBlockVanillaProps>(\n (\n {\n lang = 'text',\n code,\n copyable = false,\n copyText,\n copiedText,\n copyButtonAlign = 'top right',\n onCopy,\n onCopyError,\n noBorder,\n wrapText = false,\n colorScheme,\n maxHeight = 424,\n css,\n style,\n className,\n ...props\n },\n ref,\n ) => {\n const { colors, resolvedTheme } = useVanillaExtractTheme();\n const effectiveScheme = colorScheme ?? resolvedTheme;\n const prismTheme = effectiveScheme === 'dark' ? themes.nightOwl : themes.nightOwlLight;\n\n const isBottom = copyButtonAlign.includes('bottom');\n const isLeft = copyButtonAlign.includes('left');\n\n const { style: cssStyles, vars } = processCSSProp(css, colors);\n const containerStyles = {\n position: 'relative' as const,\n ...cssStyles,\n ...assignInlineVars(vars),\n };\n\n const [copied, setCopied] = useState(false);\n\n const preRef = useRef<HTMLPreElement | null>(\n null,\n ) as React.MutableRefObject<HTMLPreElement | null>;\n const buttonWrapperRef = useRef<HTMLDivElement>(null);\n\n const setPreRef = useCallback(\n (node: HTMLPreElement | null) => {\n preRef.current = node;\n if (typeof ref === 'function') ref(node);\n else if (ref) (ref as React.MutableRefObject<HTMLPreElement | null>).current = node;\n },\n [ref],\n );\n\n useIsomorphicLayoutEffect(() => {\n if (!copyable) return;\n const pre = preRef.current;\n const wrapper = buttonWrapperRef.current;\n if (!pre || !wrapper) return;\n\n const borderH = noBorder ? 0 : 2;\n\n const update = () => {\n if (!isLeft) {\n const vScrollbar = Math.max(0, pre.offsetWidth - pre.clientWidth - borderH);\n wrapper.style.right = `${16 + vScrollbar}px`;\n }\n if (isBottom) {\n const hScrollbar = Math.max(0, pre.offsetHeight - pre.clientHeight - borderH);\n wrapper.style.bottom = `${8 + hScrollbar}px`;\n }\n };\n\n update();\n const observer = new ResizeObserver(update);\n observer.observe(pre);\n return () => observer.disconnect();\n }, [copyable, isBottom, isLeft, noBorder]);\n\n const handleCopy = async () => {\n try {\n try {\n await navigator.clipboard.writeText(code);\n } catch (error) {\n // clipboard write failed (e.g. permission denied) — leave UI unchanged unless a fallback handled it\n if ((await onCopyError?.(error, code)) !== true) return;\n }\n setCopied(true);\n onCopy?.();\n setTimeout(() => setCopied(false), 1500);\n } catch {\n // onCopyError or onCopy threw — leave UI unchanged\n }\n };\n\n const buttonPositionClass = isBottom\n ? isLeft\n ? copyButtonWrapperBottomLeft\n : copyButtonWrapperBottomRight\n : isLeft\n ? copyButtonWrapperTopLeft\n : copyButtonWrapperTop;\n\n const copyButton = copyable ? (\n <ButtonVanilla\n variant=\"secondary\"\n ghost\n size=\"small\"\n type=\"button\"\n onClick={handleCopy}\n css={{\n color: '$hiContrast',\n gap: '$1',\n backgroundColor: '$codeBlockCopyButtonBg',\n height: '32px',\n }}\n >\n <AccessibleIcon label={copied ? 'Copied' : 'Copy'}>\n {copied ? <CheckIcon /> : <CopyIcon />}\n </AccessibleIcon>\n {copied ? copiedText : copyText}\n </ButtonVanilla>\n ) : null;\n\n return (\n <Highlight\n theme={prismTheme}\n code={code}\n language={(Prism.languages[lang] != null ? lang : 'text') as Language}\n >\n {({\n className: highlightClass,\n style: highlightStyle,\n tokens,\n getLineProps,\n getTokenProps,\n }) => (\n <div style={containerStyles}>\n <pre\n ref={setPreRef}\n className={[pre, noBorder ? preNoBorder : '', highlightClass, className]\n .filter(Boolean)\n .join(' ')}\n style={{\n maxHeight,\n ...highlightStyle,\n backgroundColor: 'inherit',\n ...style,\n }}\n {...props}\n >\n <div\n className={[\n codeContent,\n copyable && isLeft && isBottom ? codeContentBottomPadding : '',\n copyable && isLeft && !isBottom ? codeContentTopPadding : '',\n ]\n .filter(Boolean)\n .join(' ')}\n >\n {tokens.map((line, i) => (\n <div\n key={i}\n {...getLineProps({ line })}\n style={\n wrapText ? { whiteSpace: 'pre-wrap', wordBreak: 'break-all' } : undefined\n }\n >\n {line.map((token, key) => (\n <span key={key} {...getTokenProps({ token })} />\n ))}\n </div>\n ))}\n </div>\n </pre>\n {copyButton && (\n <div ref={buttonWrapperRef} className={buttonPositionClass}>\n {copyButton}\n </div>\n )}\n </div>\n )}\n </Highlight>\n );\n },\n);\n\nCodeBlockVanilla.displayName = 'CodeBlockVanilla';\n"],"mappings":";;;;;;;;;;;;;AA4CA,IAAa,mBAAmB,YAE5B,EACE,OAAO,QACP,MACA,WAAW,OACX,UACA,Y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AAK,MAAM,MACjB,oBAAC,OAAD;MAEE,GAAI,aAAa,EAAE,KAAK,CAAC;MACzB,OACE,WAAW;OAAE,YAAY;OAAY,WAAW;MAAY,IAAI,KAAA;MAGjE,UAAA,KAAK,KAAK,OAAO,QAChB,oBAAC,QAAD,EAAgB,GAAI,cAAc,EAAE,MAAM,CAAC,EAAI,GAApC,GAAoC,CAChD;KACE,GATE,CASF,CACN;IACE,CAAA;GACF,CAAA,GACJ,cACC,oBAAC,OAAD;IAAK,KAAK;IAAkB,WAAW;IACpC,UAAA;GACE,CAAA,CAEJ;;CAEE,CAAA;AAEf,CACF;AAEA,iBAAiB,cAAc"}
1
+ {"version":3,"file":"CodeBlock.vanilla.js","names":[],"sources":["../../../components/CodeBlock/CodeBlock.vanilla.tsx"],"sourcesContent":["import { CheckIcon, CopyIcon } from '@radix-ui/react-icons';\nimport { assignInlineVars } from '@vanilla-extract/dynamic';\nimport { Highlight, Language, themes } from 'prism-react-renderer';\nimport React, { forwardRef, HTMLAttributes, useCallback, useRef, useState } from 'react';\n\nimport { CSSProps, processCSSProp } from '../../styles/cssProps';\nimport { cx } from '../../styles/cx';\nimport { useVanillaExtractTheme } from '../../styles/themeContext';\nimport { useIsomorphicLayoutEffect } from '../../utils/useIsomorphicLayoutEffect';\nimport { AccessibleIcon } from '../AccessibleIcon';\nimport { ButtonVanilla } from '../Button';\nimport {\n codeContent,\n codeContentBottomPadding,\n codeContentTopPadding,\n copyButtonWrapperBottomLeft,\n copyButtonWrapperBottomRight,\n copyButtonWrapperTop,\n copyButtonWrapperTopLeft,\n pre,\n preNoBorder,\n} from './CodeBlock.vanilla.css';\nimport type {\n CodeBlockCopyButtonAlign,\n CodeBlockCopyErrorHandler,\n CodeBlockLanguage,\n} from './index';\nimport { Prism } from './prism-extend';\n\nexport interface CodeBlockVanillaProps\n extends Omit<HTMLAttributes<HTMLPreElement>, 'css'>, CSSProps {\n lang?: CodeBlockLanguage;\n code: string;\n copyable?: boolean;\n copyText?: string;\n copiedText?: string;\n copyButtonAlign?: CodeBlockCopyButtonAlign;\n onCopy?: () => void;\n onCopyError?: CodeBlockCopyErrorHandler;\n noBorder?: boolean;\n wrapText?: boolean;\n colorScheme?: 'light' | 'dark';\n maxHeight?: number | string;\n}\n\nexport const CodeBlockVanilla = forwardRef<HTMLPreElement, CodeBlockVanillaProps>(\n (\n {\n lang = 'text',\n code,\n copyable = false,\n copyText,\n copiedText,\n copyButtonAlign = 'top right',\n onCopy,\n onCopyError,\n noBorder,\n wrapText = false,\n colorScheme,\n maxHeight = 424,\n css,\n style,\n className,\n ...props\n },\n ref,\n ) => {\n const { colors, resolvedTheme } = useVanillaExtractTheme();\n const effectiveScheme = colorScheme ?? resolvedTheme;\n const prismTheme = effectiveScheme === 'dark' ? themes.nightOwl : themes.nightOwlLight;\n\n const isBottom = copyButtonAlign.includes('bottom');\n const isLeft = copyButtonAlign.includes('left');\n\n const { style: cssStyles, vars } = processCSSProp(css, colors);\n const containerStyles = {\n position: 'relative' as const,\n ...cssStyles,\n ...assignInlineVars(vars),\n };\n\n const [copied, setCopied] = useState(false);\n\n const preRef = useRef<HTMLPreElement | null>(\n null,\n ) as React.MutableRefObject<HTMLPreElement | null>;\n const buttonWrapperRef = useRef<HTMLDivElement>(null);\n\n const setPreRef = useCallback(\n (node: HTMLPreElement | null) => {\n preRef.current = node;\n if (typeof ref === 'function') ref(node);\n else if (ref) (ref as React.MutableRefObject<HTMLPreElement | null>).current = node;\n },\n [ref],\n );\n\n useIsomorphicLayoutEffect(() => {\n if (!copyable) return;\n const pre = preRef.current;\n const wrapper = buttonWrapperRef.current;\n if (!pre || !wrapper) return;\n\n const borderH = noBorder ? 0 : 2;\n\n const update = () => {\n if (!isLeft) {\n const vScrollbar = Math.max(0, pre.offsetWidth - pre.clientWidth - borderH);\n wrapper.style.right = `${16 + vScrollbar}px`;\n }\n if (isBottom) {\n const hScrollbar = Math.max(0, pre.offsetHeight - pre.clientHeight - borderH);\n wrapper.style.bottom = `${8 + hScrollbar}px`;\n }\n };\n\n update();\n const observer = new ResizeObserver(update);\n observer.observe(pre);\n return () => observer.disconnect();\n }, [copyable, isBottom, isLeft, noBorder]);\n\n const handleCopy = async () => {\n try {\n try {\n await navigator.clipboard.writeText(code);\n } catch (error) {\n // clipboard write failed (e.g. permission denied) — leave UI unchanged unless a fallback handled it\n if ((await onCopyError?.(error, code)) !== true) return;\n }\n setCopied(true);\n onCopy?.();\n setTimeout(() => setCopied(false), 1500);\n } catch {\n // onCopyError or onCopy threw — leave UI unchanged\n }\n };\n\n const buttonPositionClass = isBottom\n ? isLeft\n ? copyButtonWrapperBottomLeft\n : copyButtonWrapperBottomRight\n : isLeft\n ? copyButtonWrapperTopLeft\n : copyButtonWrapperTop;\n\n const copyButton = copyable ? (\n <ButtonVanilla\n variant=\"secondary\"\n ghost\n size=\"small\"\n type=\"button\"\n onClick={handleCopy}\n css={{\n color: '$hiContrast',\n gap: '$1',\n backgroundColor: '$codeBlockCopyButtonBg',\n height: '32px',\n }}\n >\n <AccessibleIcon label={copied ? 'Copied' : 'Copy'}>\n {copied ? <CheckIcon /> : <CopyIcon />}\n </AccessibleIcon>\n {copied ? copiedText : copyText}\n </ButtonVanilla>\n ) : null;\n\n return (\n <Highlight\n theme={prismTheme}\n code={code}\n language={(Prism.languages[lang] != null ? lang : 'text') as Language}\n >\n {({\n className: highlightClass,\n style: highlightStyle,\n tokens,\n getLineProps,\n getTokenProps,\n }) => (\n <div style={containerStyles}>\n <pre\n ref={setPreRef}\n className={cx(pre, noBorder && preNoBorder, highlightClass, className)}\n style={{\n maxHeight,\n ...highlightStyle,\n backgroundColor: 'inherit',\n ...style,\n }}\n {...props}\n >\n <div\n className={cx(\n codeContent,\n copyable && isLeft && isBottom && codeContentBottomPadding,\n copyable && isLeft && !isBottom && codeContentTopPadding,\n )}\n >\n {tokens.map((line, i) => (\n <div\n key={i}\n {...getLineProps({ line })}\n style={\n wrapText ? { whiteSpace: 'pre-wrap', wordBreak: 'break-all' } : undefined\n }\n >\n {line.map((token, key) => (\n <span key={key} {...getTokenProps({ token })} />\n ))}\n </div>\n ))}\n </div>\n </pre>\n {copyButton && (\n <div ref={buttonWrapperRef} className={buttonPositionClass}>\n {copyButton}\n </div>\n )}\n </div>\n )}\n </Highlight>\n );\n },\n);\n\nCodeBlockVanilla.displayName = 'CodeBlockVanilla';\n"],"mappings":";;;;;;;;;;;;;;AA6CA,IAAa,mBAAmB,YAE5B,EACE,OAAO,QACP,MACA,WAAW,OACX,UACA,YACA,kBAAkB,aAClB,QACA,aACA,UACA,WAAW,OACX,aACA,YAAY,KACZ,KACA,OACA,WACA,GAAG,SAEL,QACG;CACH,MAAM,EAAE,QAAQ,kBAAkB,uBAAuB;CAEzD,MAAM,cADkB,eAAe,mBACA,SAAS,OAAO,WAAW,OAAO;CAEzE,MAAM,WAAW,gBAAgB,SAAS,QAAQ;CAClD,MAAM,SAAS,gBAAgB,SAAS,MAAM;CAE9C,MAAM,EAAE,OAAO,WAAW,SAAS,eAAe,KAAK,MAAM;CAC7D,MAAM,kBAAkB;EACtB,UAAU;EACV,GAAG;EACH,GAAG,iBAAiB,IAAI;CAC1B;CAEA,MAAM,CAAC,QAAQ,aAAa,SAAS,KAAK;CAE1C,MAAM,SAAS,OACb,IACF;CACA,MAAM,mBAAmB,OAAuB,IAAI;CAEpD,MAAM,YAAY,aACf,SAAgC;EAC/B,OAAO,UAAU;EACjB,IAAI,OAAO,QAAQ,YAAY,IAAI,IAAI;OAClC,IAAI,KAAK,IAAuD,UAAU;CACjF,GACA,CAAC,GAAG,CACN;CAEA,gCAAgC;EAC9B,IAAI,CAAC,UAAU;EACf,MAAM,MAAM,OAAO;EACnB,MAAM,UAAU,iBAAiB;EACjC,IAAI,CAAC,OAAO,CAAC,SAAS;EAEtB,MAAM,UAAU,WAAW,IAAI;EAE/B,MAAM,eAAe;GACnB,IAAI,CAAC,QAAQ;IACX,MAAM,aAAa,KAAK,IAAI,GAAG,IAAI,cAAc,IAAI,cAAc,OAAO;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SAAS;IACrE,OAAO;KACL;KACA,GAAG;KACH,iBAAiB;KACjB,GAAG;IACL;IACA,GAAI;IAEJ,UAAA,oBAAC,OAAD;KACE,WAAW,GACT,aACA,YAAY,UAAU,YAAA,aACtB,YAAY,UAAU,CAAC,YAAA,WACzB;KAEC,UAAA,OAAO,KAAK,MAAM,MACjB,oBAAC,OAAD;MAEE,GAAI,aAAa,EAAE,KAAK,CAAC;MACzB,OACE,WAAW;OAAE,YAAY;OAAY,WAAW;MAAY,IAAI,KAAA;MAGjE,UAAA,KAAK,KAAK,OAAO,QAChB,oBAAC,QAAD,EAAgB,GAAI,cAAc,EAAE,MAAM,CAAC,EAAI,GAApC,GAAoC,CAChD;KACE,GATE,CASF,CACN;IACE,CAAA;GACF,CAAA,GACJ,cACC,oBAAC,OAAD;IAAK,KAAK;IAAkB,WAAW;IACpC,UAAA;GACE,CAAA,CAEJ;;CAEE,CAAA;AAEf,CACF;AAEA,iBAAiB,cAAc"}
@@ -1,5 +1,6 @@
1
1
  const require_runtime = require("../../_virtual/_rolldown/runtime.cjs");
2
2
  const require_cssProps = require("../../styles/cssProps.cjs");
3
+ const require_cx = require("../../styles/cx.cjs");
3
4
  const require_themeContext = require("../../styles/themeContext.cjs");
4
5
  const require_Input_vanilla = require("../Input/Input.vanilla.cjs");
5
6
  const require_Combobox_vanilla_css = require("./Combobox.vanilla.css.cjs");
@@ -10,7 +11,6 @@ let react_jsx_runtime = require("react/jsx-runtime");
10
11
  let _radix_ui_react_popover = require("@radix-ui/react-popover");
11
12
  _radix_ui_react_popover = require_runtime.__toESM(_radix_ui_react_popover, 1);
12
13
  // components/Combobox/Combobox.vanilla.tsx
13
- var joinClassNames = (...classNames) => classNames.filter(Boolean).join(" ");
14
14
  var defaultFilter = (suggestion, query) => suggestion.toLowerCase().includes(query.toLowerCase());
15
15
  var ComboboxVanilla = (0, react.forwardRef)(({ value: valueProp, defaultValue = "", onValueChange, suggestions, emptyText, filter = defaultFilter, openOnFocus = true, id: idProp, size, disabled, readOnly, className, style, css, onFocus, onBlur, onKeyDown, ...props }, ref) => {
16
16
  const { colors } = require_themeContext.useVanillaExtractTheme();
@@ -85,7 +85,7 @@ var ComboboxVanilla = (0, react.forwardRef)(({ value: valueProp, defaultValue =
85
85
  asChild: true,
86
86
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
87
87
  ref: anchorRef,
88
- className: joinClassNames(require_Combobox_vanilla_css.comboboxAnchor, className),
88
+ className: require_cx.cx(require_Combobox_vanilla_css.comboboxAnchor, className),
89
89
  style: {
90
90
  ...cssStyles,
91
91
  ...style,
@@ -1 +1 @@
1
- {"version":3,"file":"Combobox.vanilla.cjs","names":["forwardRef","useVanillaExtractTheme","processCSSProp","useId","useRef","useState","PopoverPrimitive","comboboxAnchor","assignInlineVars","InputVanilla","comboboxContent","comboboxListbox","comboboxOptionRecipe","comboboxEmptyRecipe"],"sources":["../../../components/Combobox/Combobox.vanilla.tsx"],"sourcesContent":["import * as PopoverPrimitive from '@radix-ui/react-popover';\nimport { assignInlineVars } from '@vanilla-extract/dynamic';\nimport React, { forwardRef, useEffect, useId, useRef, useState } from 'react';\n\nimport { CSSProps, processCSSProp } from '../../styles/cssProps';\nimport { useVanillaExtractTheme } from '../../styles/themeContext';\nimport { InputVanilla, InputVanillaHandle, InputVanillaProps } from '../Input/Input.vanilla';\nimport {\n comboboxAnchor,\n comboboxContent,\n comboboxEmptyRecipe,\n comboboxListbox,\n comboboxOptionRecipe,\n} from './Combobox.vanilla.css';\n\nconst joinClassNames = (...classNames: (string | undefined)[]) =>\n classNames.filter(Boolean).join(' ');\n\nconst defaultFilter = (suggestion: string, query: string) =>\n suggestion.toLowerCase().includes(query.toLowerCase());\n\nexport interface ComboboxVanillaProps\n extends\n Omit<InputVanillaProps, 'value' | 'defaultValue' | 'onChange' | 'type' | 'role' | 'css'>,\n CSSProps {\n value?: string;\n defaultValue?: string;\n onValueChange?: (value: string) => void;\n suggestions: string[];\n emptyText?: React.ReactNode;\n filter?: (suggestion: string, query: string) => boolean;\n openOnFocus?: boolean;\n}\n\nexport const ComboboxVanilla = forwardRef<InputVanillaHandle, ComboboxVanillaProps>(\n (\n {\n value: valueProp,\n defaultValue = '',\n onValueChange,\n suggestions,\n emptyText,\n filter = defaultFilter,\n openOnFocus = true,\n id: idProp,\n size,\n disabled,\n readOnly,\n className,\n style,\n css,\n onFocus,\n onBlur,\n onKeyDown,\n ...props\n },\n ref,\n ) => {\n const { colors } = useVanillaExtractTheme();\n const { style: cssStyles, vars } = processCSSProp(css, colors);\n\n const autoId = useId();\n const id = idProp ?? autoId;\n const listId = `${id}-listbox`;\n const optionId = (index: number) => `${id}-option-${index}`;\n\n const anchorRef = useRef<HTMLDivElement>(null);\n const [innerValue, setInnerValue] = useState(defaultValue);\n const value = valueProp ?? innerValue;\n const [open, setOpen] = useState(false);\n const [query, setQuery] = useState('');\n const [highlighted, setHighlighted] = useState(-1);\n\n const shown = query ? suggestions.filter((s) => filter(s, query)) : suggestions;\n const showEmpty = emptyText != null && suggestions.length === 0;\n const popupOpen = open && (shown.length > 0 || showEmpty);\n const listOpen = popupOpen && shown.length > 0;\n const active = listOpen && highlighted < shown.length ? highlighted : -1;\n\n useEffect(() => {\n if (active >= 0) {\n document.getElementById(`${id}-option-${active}`)?.scrollIntoView?.({ block: 'nearest' });\n }\n }, [active, id]);\n\n const setValue = (next: string) => {\n if (valueProp === undefined) setInnerValue(next);\n onValueChange?.(next);\n };\n\n const close = () => {\n setOpen(false);\n setQuery('');\n setHighlighted(-1);\n };\n\n const choose = (suggestion: string) => {\n setValue(suggestion);\n close();\n };\n\n const interactive = !disabled && !readOnly;\n\n const handleKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => {\n onKeyDown?.(e);\n if (e.defaultPrevented || !interactive) return;\n\n const last = shown.length - 1;\n switch (e.key) {\n case 'ArrowDown':\n e.preventDefault();\n if (!open) {\n setOpen(true);\n setHighlighted(e.altKey ? -1 : 0);\n } else if (!e.altKey) {\n setHighlighted(active >= last ? 0 : active + 1);\n }\n break;\n case 'ArrowUp':\n e.preventDefault();\n if (!open) {\n setOpen(true);\n setHighlighted(last);\n } else {\n setHighlighted(active <= 0 ? last : active - 1);\n }\n break;\n case 'Enter':\n if (active >= 0) {\n e.preventDefault();\n choose(shown[active]);\n }\n break;\n case 'Escape':\n if (popupOpen) {\n e.preventDefault();\n close();\n }\n break;\n default:\n break;\n }\n };\n\n return (\n <PopoverPrimitive.Root open={popupOpen} onOpenChange={(next) => !next && close()}>\n <PopoverPrimitive.Anchor asChild>\n <div\n ref={anchorRef}\n className={joinClassNames(comboboxAnchor, className)}\n style={{ ...cssStyles, ...style, ...assignInlineVars(vars) }}\n >\n <InputVanilla\n ref={ref}\n id={id}\n role=\"combobox\"\n aria-autocomplete=\"list\"\n aria-expanded={listOpen}\n aria-controls={listOpen ? listId : undefined}\n aria-activedescendant={active >= 0 ? optionId(active) : undefined}\n autoComplete=\"off\"\n size={size}\n disabled={disabled}\n readOnly={readOnly}\n value={value}\n onChange={(e: React.ChangeEvent<HTMLInputElement>) => {\n setValue(e.target.value);\n setQuery(e.target.value);\n setOpen(true);\n setHighlighted(-1);\n }}\n onFocus={(e: React.FocusEvent<HTMLInputElement>) => {\n onFocus?.(e);\n if (openOnFocus && interactive) {\n setOpen(true);\n setQuery('');\n setHighlighted(-1);\n }\n }}\n onBlur={(e: React.FocusEvent<HTMLInputElement>) => {\n onBlur?.(e);\n close();\n }}\n onKeyDown={handleKeyDown}\n {...props}\n />\n </div>\n </PopoverPrimitive.Anchor>\n <PopoverPrimitive.Portal>\n <PopoverPrimitive.Content\n role={undefined}\n id={undefined}\n className={comboboxContent}\n side=\"bottom\"\n align=\"start\"\n sideOffset={4}\n collisionPadding={8}\n onOpenAutoFocus={(e) => e.preventDefault()}\n onCloseAutoFocus={(e) => e.preventDefault()}\n onInteractOutside={(e) => {\n if (anchorRef.current?.contains(e.target as Node)) e.preventDefault();\n }}\n // Keeps the focus in the input, so a click on an option does not blur it.\n onMouseDown={(e) => e.preventDefault()}\n >\n {listOpen ? (\n <ul\n id={listId}\n role=\"listbox\"\n aria-label={\n props['aria-labelledby'] ? undefined : (props['aria-label'] ?? 'Suggestions')\n }\n aria-labelledby={props['aria-labelledby']}\n className={comboboxListbox}\n >\n {shown.map((suggestion, index) => (\n <li\n key={optionId(index)}\n id={optionId(index)}\n role=\"option\"\n aria-selected={index === active}\n data-highlighted={index === active ? '' : undefined}\n className={comboboxOptionRecipe({ size })}\n onMouseMove={() => index !== active && setHighlighted(index)}\n onClick={() => choose(suggestion)}\n >\n {suggestion}\n </li>\n ))}\n </ul>\n ) : (\n <div role=\"status\" className={comboboxEmptyRecipe({ size })}>\n {emptyText}\n </div>\n )}\n </PopoverPrimitive.Content>\n </PopoverPrimitive.Portal>\n </PopoverPrimitive.Root>\n );\n },\n);\n\nComboboxVanilla.displayName = 'ComboboxVanilla';\n"],"mappings":";;;;;;;;;;;;AAeA,IAAM,kBAAkB,GAAG,eACzB,WAAW,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;AAErC,IAAM,iBAAiB,YAAoB,UACzC,WAAW,YAAY,CAAC,CAAC,SAAS,MAAM,YAAY,CAAC;AAevD,IAAa,mBAAA,GAAkBA,MAAAA,WAAAA,EAE3B,EACE,OAAO,WACP,eAAe,IACf,eACA,aACA,WACA,SAAS,eACT,cAAc,MACd,IAAI,QACJ,MACA,UACA,UACA,WACA,OACA,KACA,SACA,QACA,WACA,GAAG,SAEL,QACG;CACH,MAAM,EAAE,WAAWC,qBAAAA,uBAAuB;CAC1C,MAAM,EAAE,OAAO,WAAW,SAASC,iBAAAA,eAAe,KAAK,MAAM;CAE7D,MAAM,UAAA,GAASC,MAAAA,MAAAA,CAAM;CACrB,MAAM,KAAK,UAAU;CACrB,MAAM,SAAS,GAAG,GAAG;CACrB,MAAM,YAAY,UAAkB,GAAG,GAAG,UAAU;CAEpD,MAAM,aAAA,GAAYC,MAAAA,OAAAA,CAAuB,IAAI;CAC7C,MAAM,C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":["forwardRef","useVanillaExtractTheme","processCSSProp","useId","useRef","useState","PopoverPrimitive","cx","comboboxAnchor","assignInlineVars","InputVanilla","comboboxContent","comboboxListbox","comboboxOptionRecipe","comboboxEmptyRecipe"],"sources":["../../../components/Combobox/Combobox.vanilla.tsx"],"sourcesContent":["import * as PopoverPrimitive from '@radix-ui/react-popover';\nimport { assignInlineVars } from '@vanilla-extract/dynamic';\nimport React, { forwardRef, useEffect, useId, useRef, useState } from 'react';\n\nimport { CSSProps, processCSSProp } from '../../styles/cssProps';\nimport { cx } from '../../styles/cx';\nimport { useVanillaExtractTheme } from '../../styles/themeContext';\nimport { InputVanilla, InputVanillaHandle, InputVanillaProps } from '../Input/Input.vanilla';\nimport {\n comboboxAnchor,\n comboboxContent,\n comboboxEmptyRecipe,\n comboboxListbox,\n comboboxOptionRecipe,\n} from './Combobox.vanilla.css';\n\nconst defaultFilter = (suggestion: string, query: string) =>\n suggestion.toLowerCase().includes(query.toLowerCase());\n\nexport interface ComboboxVanillaProps\n extends\n Omit<InputVanillaProps, 'value' | 'defaultValue' | 'onChange' | 'type' | 'role' | 'css'>,\n CSSProps {\n value?: string;\n defaultValue?: string;\n onValueChange?: (value: string) => void;\n suggestions: string[];\n emptyText?: React.ReactNode;\n filter?: (suggestion: string, query: string) => boolean;\n openOnFocus?: boolean;\n}\n\nexport const ComboboxVanilla = forwardRef<InputVanillaHandle, ComboboxVanillaProps>(\n (\n {\n value: valueProp,\n defaultValue = '',\n onValueChange,\n suggestions,\n emptyText,\n filter = defaultFilter,\n openOnFocus = true,\n id: idProp,\n size,\n disabled,\n readOnly,\n className,\n style,\n css,\n onFocus,\n onBlur,\n onKeyDown,\n ...props\n },\n ref,\n ) => {\n const { colors } = useVanillaExtractTheme();\n const { style: cssStyles, vars } = processCSSProp(css, colors);\n\n const autoId = useId();\n const id = idProp ?? autoId;\n const listId = `${id}-listbox`;\n const optionId = (index: number) => `${id}-option-${index}`;\n\n const anchorRef = useRef<HTMLDivElement>(null);\n const [innerValue, setInnerValue] = useState(defaultValue);\n const value = valueProp ?? innerValue;\n const [open, setOpen] = useState(false);\n const [query, setQuery] = useState('');\n const [highlighted, setHighlighted] = useState(-1);\n\n const shown = query ? suggestions.filter((s) => filter(s, query)) : suggestions;\n const showEmpty = emptyText != null && suggestions.length === 0;\n const popupOpen = open && (shown.length > 0 || showEmpty);\n const listOpen = popupOpen && shown.length > 0;\n const active = listOpen && highlighted < shown.length ? highlighted : -1;\n\n useEffect(() => {\n if (active >= 0) {\n document.getElementById(`${id}-option-${active}`)?.scrollIntoView?.({ block: 'nearest' });\n }\n }, [active, id]);\n\n const setValue = (next: string) => {\n if (valueProp === undefined) setInnerValue(next);\n onValueChange?.(next);\n };\n\n const close = () => {\n setOpen(false);\n setQuery('');\n setHighlighted(-1);\n };\n\n const choose = (suggestion: string) => {\n setValue(suggestion);\n close();\n };\n\n const interactive = !disabled && !readOnly;\n\n const handleKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => {\n onKeyDown?.(e);\n if (e.defaultPrevented || !interactive) return;\n\n const last = shown.length - 1;\n switch (e.key) {\n case 'ArrowDown':\n e.preventDefault();\n if (!open) {\n setOpen(true);\n setHighlighted(e.altKey ? -1 : 0);\n } else if (!e.altKey) {\n setHighlighted(active >= last ? 0 : active + 1);\n }\n break;\n case 'ArrowUp':\n e.preventDefault();\n if (!open) {\n setOpen(true);\n setHighlighted(last);\n } else {\n setHighlighted(active <= 0 ? last : active - 1);\n }\n break;\n case 'Enter':\n if (active >= 0) {\n e.preventDefault();\n choose(shown[active]);\n }\n break;\n case 'Escape':\n if (popupOpen) {\n e.preventDefault();\n close();\n }\n break;\n default:\n break;\n }\n };\n\n return (\n <PopoverPrimitive.Root open={popupOpen} onOpenChange={(next) => !next && close()}>\n <PopoverPrimitive.Anchor asChild>\n <div\n ref={anchorRef}\n className={cx(comboboxAnchor, className)}\n style={{ ...cssStyles, ...style, ...assignInlineVars(vars) }}\n >\n <InputVanilla\n ref={ref}\n id={id}\n role=\"combobox\"\n aria-autocomplete=\"list\"\n aria-expanded={listOpen}\n aria-controls={listOpen ? listId : undefined}\n aria-activedescendant={active >= 0 ? optionId(active) : undefined}\n autoComplete=\"off\"\n size={size}\n disabled={disabled}\n readOnly={readOnly}\n value={value}\n onChange={(e: React.ChangeEvent<HTMLInputElement>) => {\n setValue(e.target.value);\n setQuery(e.target.value);\n setOpen(true);\n setHighlighted(-1);\n }}\n onFocus={(e: React.FocusEvent<HTMLInputElement>) => {\n onFocus?.(e);\n if (openOnFocus && interactive) {\n setOpen(true);\n setQuery('');\n setHighlighted(-1);\n }\n }}\n onBlur={(e: React.FocusEvent<HTMLInputElement>) => {\n onBlur?.(e);\n close();\n }}\n onKeyDown={handleKeyDown}\n {...props}\n />\n </div>\n </PopoverPrimitive.Anchor>\n <PopoverPrimitive.Portal>\n <PopoverPrimitive.Content\n role={undefined}\n id={undefined}\n className={comboboxContent}\n side=\"bottom\"\n align=\"start\"\n sideOffset={4}\n collisionPadding={8}\n onOpenAutoFocus={(e) => e.preventDefault()}\n onCloseAutoFocus={(e) => e.preventDefault()}\n onInteractOutside={(e) => {\n if (anchorRef.current?.contains(e.target as Node)) e.preventDefault();\n }}\n // Keeps the focus in the input, so a click on an option does not blur it.\n onMouseDown={(e) => e.preventDefault()}\n >\n {listOpen ? (\n <ul\n id={listId}\n role=\"listbox\"\n aria-label={\n props['aria-labelledby'] ? undefined : (props['aria-label'] ?? 'Suggestions')\n }\n aria-labelledby={props['aria-labelledby']}\n className={comboboxListbox}\n >\n {shown.map((suggestion, index) => (\n <li\n key={optionId(index)}\n id={optionId(index)}\n role=\"option\"\n aria-selected={index === active}\n data-highlighted={index === active ? '' : undefined}\n className={comboboxOptionRecipe({ size })}\n onMouseMove={() => index !== active && setHighlighted(index)}\n onClick={() => choose(suggestion)}\n >\n {suggestion}\n </li>\n ))}\n </ul>\n ) : (\n <div role=\"status\" className={comboboxEmptyRecipe({ size })}>\n {emptyText}\n </div>\n )}\n </PopoverPrimitive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BAAA,IAAA,CAAC,MAAD;IACE,IAAI;IACJ,MAAK;IACL,cACE,MAAM,qBAAqB,KAAA,IAAa,MAAM,iBAAiB;IAEjE,mBAAiB,MAAM;IACvB,WAAWC,6BAAAA;IAEV,UAAA,MAAM,KAAK,YAAY,UACtB,iBAAA,GAAA,kBAAA,IAAA,CAAC,MAAD;KAEE,IAAI,SAAS,KAAK;KAClB,MAAK;KACL,iBAAe,UAAU;KACzB,oBAAkB,UAAU,SAAS,KAAK,KAAA;KAC1C,WAAWC,6BAAAA,qBAAqB,EAAE,KAAK,CAAC;KACxC,mBAAmB,UAAU,UAAU,eAAe,KAAK;KAC3D,eAAe,OAAO,UAAU;KAE/B,UAAA;IACC,GAVG,SAAS,KAAK,CAUjB,CACL;GACC,CAAA,IAEJ,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;IAAK,MAAK;IAAS,WAAWC,6BAAAA,oBAAoB,EAAE,KAAK,CAAC;IACvD,UAAA;GACE,CAAA;EAEiB,CAAA,EACH,CAAA,CACJ;;AAE3B,CACF;AAEA,gBAAgB,cAAc"}
@@ -1,4 +1,5 @@
1
1
  import { processCSSProp } from "../../styles/cssProps.js";
2
+ import { cx } from "../../styles/cx.js";
2
3
  import { useVanillaExtractTheme } from "../../styles/themeContext.js";
3
4
  import { InputVanilla } from "../Input/Input.vanilla.js";
4
5
  import { comboboxAnchor, comboboxContent, comboboxEmptyRecipe, comboboxListbox, comboboxOptionRecipe } from "./Combobox.vanilla.css.js";
@@ -7,7 +8,6 @@ import { assignInlineVars } from "@vanilla-extract/dynamic";
7
8
  import { jsx, jsxs } from "react/jsx-runtime";
8
9
  import * as PopoverPrimitive from "@radix-ui/react-popover";
9
10
  // components/Combobox/Combobox.vanilla.tsx
10
- var joinClassNames = (...classNames) => classNames.filter(Boolean).join(" ");
11
11
  var defaultFilter = (suggestion, query) => suggestion.toLowerCase().includes(query.toLowerCase());
12
12
  var ComboboxVanilla = forwardRef(({ value: valueProp, defaultValue = "", onValueChange, suggestions, emptyText, filter = defaultFilter, openOnFocus = true, id: idProp, size, disabled, readOnly, className, style, css, onFocus, onBlur, onKeyDown, ...props }, ref) => {
13
13
  const { colors } = useVanillaExtractTheme();
@@ -82,7 +82,7 @@ var ComboboxVanilla = forwardRef(({ value: valueProp, defaultValue = "", onValue
82
82
  asChild: true,
83
83
  children: /* @__PURE__ */ jsx("div", {
84
84
  ref: anchorRef,
85
- className: joinClassNames(comboboxAnchor, className),
85
+ className: cx(comboboxAnchor, className),
86
86
  style: {
87
87
  ...cssStyles,
88
88
  ...style,
@@ -1 +1 @@
1
- {"version":3,"file":"Combobox.vanilla.js","names":[],"sources":["../../../components/Combobox/Combobox.vanilla.tsx"],"sourcesContent":["import * as PopoverPrimitive from '@radix-ui/react-popover';\nimport { assignInlineVars } from '@vanilla-extract/dynamic';\nimport React, { forwardRef, useEffect, useId, useRef, useState } from 'react';\n\nimport { CSSProps, processCSSProp } from '../../styles/cssProps';\nimport { useVanillaExtractTheme } from '../../styles/themeContext';\nimport { InputVanilla, InputVanillaHandle, InputVanillaProps } from '../Input/Input.vanilla';\nimport {\n comboboxAnchor,\n comboboxContent,\n comboboxEmptyRecipe,\n comboboxListbox,\n comboboxOptionRecipe,\n} from './Combobox.vanilla.css';\n\nconst joinClassNames = (...classNames: (string | undefined)[]) =>\n classNames.filter(Boolean).join(' ');\n\nconst defaultFilter = (suggestion: string, query: string) =>\n suggestion.toLowerCase().includes(query.toLowerCase());\n\nexport interface ComboboxVanillaProps\n extends\n Omit<InputVanillaProps, 'value' | 'defaultValue' | 'onChange' | 'type' | 'role' | 'css'>,\n CSSProps {\n value?: string;\n defaultValue?: string;\n onValueChange?: (value: string) => void;\n suggestions: string[];\n emptyText?: React.ReactNode;\n filter?: (suggestion: string, query: string) => boolean;\n openOnFocus?: boolean;\n}\n\nexport const ComboboxVanilla = forwardRef<InputVanillaHandle, ComboboxVanillaProps>(\n (\n {\n value: valueProp,\n defaultValue = '',\n onValueChange,\n suggestions,\n emptyText,\n filter = defaultFilter,\n openOnFocus = true,\n id: idProp,\n size,\n disabled,\n readOnly,\n className,\n style,\n css,\n onFocus,\n onBlur,\n onKeyDown,\n ...props\n },\n ref,\n ) => {\n const { colors } = useVanillaExtractTheme();\n const { style: cssStyles, vars } = processCSSProp(css, colors);\n\n const autoId = useId();\n const id = idProp ?? autoId;\n const listId = `${id}-listbox`;\n const optionId = (index: number) => `${id}-option-${index}`;\n\n const anchorRef = useRef<HTMLDivElement>(null);\n const [innerValue, setInnerValue] = useState(defaultValue);\n const value = valueProp ?? innerValue;\n const [open, setOpen] = useState(false);\n const [query, setQuery] = useState('');\n const [highlighted, setHighlighted] = useState(-1);\n\n const shown = query ? suggestions.filter((s) => filter(s, query)) : suggestions;\n const showEmpty = emptyText != null && suggestions.length === 0;\n const popupOpen = open && (shown.length > 0 || showEmpty);\n const listOpen = popupOpen && shown.length > 0;\n const active = listOpen && highlighted < shown.length ? highlighted : -1;\n\n useEffect(() => {\n if (active >= 0) {\n document.getElementById(`${id}-option-${active}`)?.scrollIntoView?.({ block: 'nearest' });\n }\n }, [active, id]);\n\n const setValue = (next: string) => {\n if (valueProp === undefined) setInnerValue(next);\n onValueChange?.(next);\n };\n\n const close = () => {\n setOpen(false);\n setQuery('');\n setHighlighted(-1);\n };\n\n const choose = (suggestion: string) => {\n setValue(suggestion);\n close();\n };\n\n const interactive = !disabled && !readOnly;\n\n const handleKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => {\n onKeyDown?.(e);\n if (e.defaultPrevented || !interactive) return;\n\n const last = shown.length - 1;\n switch (e.key) {\n case 'ArrowDown':\n e.preventDefault();\n if (!open) {\n setOpen(true);\n setHighlighted(e.altKey ? -1 : 0);\n } else if (!e.altKey) {\n setHighlighted(active >= last ? 0 : active + 1);\n }\n break;\n case 'ArrowUp':\n e.preventDefault();\n if (!open) {\n setOpen(true);\n setHighlighted(last);\n } else {\n setHighlighted(active <= 0 ? last : active - 1);\n }\n break;\n case 'Enter':\n if (active >= 0) {\n e.preventDefault();\n choose(shown[active]);\n }\n break;\n case 'Escape':\n if (popupOpen) {\n e.preventDefault();\n close();\n }\n break;\n default:\n break;\n }\n };\n\n return (\n <PopoverPrimitive.Root open={popupOpen} onOpenChange={(next) => !next && close()}>\n <PopoverPrimitive.Anchor asChild>\n <div\n ref={anchorRef}\n className={joinClassNames(comboboxAnchor, className)}\n style={{ ...cssStyles, ...style, ...assignInlineVars(vars) }}\n >\n <InputVanilla\n ref={ref}\n id={id}\n role=\"combobox\"\n aria-autocomplete=\"list\"\n aria-expanded={listOpen}\n aria-controls={listOpen ? listId : undefined}\n aria-activedescendant={active >= 0 ? optionId(active) : undefined}\n autoComplete=\"off\"\n size={size}\n disabled={disabled}\n readOnly={readOnly}\n value={value}\n onChange={(e: React.ChangeEvent<HTMLInputElement>) => {\n setValue(e.target.value);\n setQuery(e.target.value);\n setOpen(true);\n setHighlighted(-1);\n }}\n onFocus={(e: React.FocusEvent<HTMLInputElement>) => {\n onFocus?.(e);\n if (openOnFocus && interactive) {\n setOpen(true);\n setQuery('');\n setHighlighted(-1);\n }\n }}\n onBlur={(e: React.FocusEvent<HTMLInputElement>) => {\n onBlur?.(e);\n close();\n }}\n onKeyDown={handleKeyDown}\n {...props}\n />\n </div>\n </PopoverPrimitive.Anchor>\n <PopoverPrimitive.Portal>\n <PopoverPrimitive.Content\n role={undefined}\n id={undefined}\n className={comboboxContent}\n side=\"bottom\"\n align=\"start\"\n sideOffset={4}\n collisionPadding={8}\n onOpenAutoFocus={(e) => e.preventDefault()}\n onCloseAutoFocus={(e) => e.preventDefault()}\n onInteractOutside={(e) => {\n if (anchorRef.current?.contains(e.target as Node)) e.preventDefault();\n }}\n // Keeps the focus in the input, so a click on an option does not blur it.\n onMouseDown={(e) => e.preventDefault()}\n >\n {listOpen ? (\n <ul\n id={listId}\n role=\"listbox\"\n aria-label={\n props['aria-labelledby'] ? undefined : (props['aria-label'] ?? 'Suggestions')\n }\n aria-labelledby={props['aria-labelledby']}\n className={comboboxListbox}\n >\n {shown.map((suggestion, index) => (\n <li\n key={optionId(index)}\n id={optionId(index)}\n role=\"option\"\n aria-selected={index === active}\n data-highlighted={index === active ? '' : undefined}\n className={comboboxOptionRecipe({ size })}\n onMouseMove={() => index !== active && setHighlighted(index)}\n onClick={() => choose(suggestion)}\n >\n {suggestion}\n </li>\n ))}\n </ul>\n ) : (\n <div role=\"status\" className={comboboxEmptyRecipe({ size })}>\n {emptyText}\n </div>\n )}\n </PopoverPrimitive.Content>\n </PopoverPrimitive.Portal>\n </PopoverPrimitive.Root>\n );\n },\n);\n\nComboboxVanilla.displayName = 'ComboboxVanilla';\n"],"mappings":";;;;;;;;;AAeA,IAAM,kBAAkB,GAAG,eACzB,WAAW,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;AAErC,IAAM,iBAAiB,YAAoB,UACzC,WAAW,YAAY,CAAC,CAAC,SAAS,MAAM,YAAY,CAAC;AAevD,IAAa,kBAAkB,YAE3B,EACE,OAAO,WACP,eAAe,IACf,eACA,aACA,WACA,SAAS,eACT,cAAc,MACd,IAAI,QACJ,MACA,UACA,UACA,WACA,OACA,KACA,SACA,QACA,WACA,GAAG,SAEL,QACG;CACH,MAAM,EAAE,WAAW,uBAAuB;CAC1C,MAAM,EAAE,OAAO,WAAW,SAAS,eAAe,KAAK,MAAM;CAE7D,MAAM,SAAS,MAAM;CACrB,MAAM,KAAK,UAAU;CACrB,MAAM,SAAS,GAAG,GAAG;CACrB,MAAM,YAAY,UAAkB,GAAG,GAAG,UAAU;CAEpD,MAAM,YAAY,OAAuB,IAAI;CAC7C,MAAM,CAAC,YAAY,iBAAiB,SAAS,YAAY;CACzD,MAAM,QAAQ,aAAa;CAC3B,MAAM,CAAC,MAAM,WAAW,SAAS,KAAK;CACtC,MAAM,CAAC,OAAO,YAAY,SAAS,EAAE;CACrC,MAAM,CAAC,aAAa,kBAAkB,SAAS,EAAE;CAEjD,MAAM,QAAQ,QAAQ,YAAY,QAAQ,MAAM,OAAO,G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,MAAM,qBAAqB,KAAA,IAAa,MAAM,iBAAiB;IAEjE,mBAAiB,MAAM;IACvB,WAAW;IAEV,UAAA,MAAM,KAAK,YAAY,UACtB,oBAAC,MAAD;KAEE,IAAI,SAAS,KAAK;KAClB,MAAK;KACL,iBAAe,UAAU;KACzB,oBAAkB,UAAU,SAAS,KAAK,KAAA;KAC1C,WAAW,qBAAqB,EAAE,KAAK,CAAC;KACxC,mBAAmB,UAAU,UAAU,eAAe,KAAK;KAC3D,eAAe,OAAO,UAAU;KAE/B,UAAA;IACC,GAVG,SAAS,KAAK,CAUjB,CACL;GACC,CAAA,IAEJ,oBAAC,OAAD;IAAK,MAAK;IAAS,WAAW,oBAAoB,EAAE,KAAK,CAAC;IACvD,UAAA;GACE,CAAA;EAEiB,CAAA,EACH,CAAA,CACJ;;AAE3B,CACF;AAEA,gBAAgB,cAAc"}
1
+ {"version":3,"file":"Combobox.vanilla.js","names":[],"sources":["../../../components/Combobox/Combobox.vanilla.tsx"],"sourcesContent":["import * as PopoverPrimitive from '@radix-ui/react-popover';\nimport { assignInlineVars } from '@vanilla-extract/dynamic';\nimport React, { forwardRef, useEffect, useId, useRef, useState } from 'react';\n\nimport { CSSProps, processCSSProp } from '../../styles/cssProps';\nimport { cx } from '../../styles/cx';\nimport { useVanillaExtractTheme } from '../../styles/themeContext';\nimport { InputVanilla, InputVanillaHandle, InputVanillaProps } from '../Input/Input.vanilla';\nimport {\n comboboxAnchor,\n comboboxContent,\n comboboxEmptyRecipe,\n comboboxListbox,\n comboboxOptionRecipe,\n} from './Combobox.vanilla.css';\n\nconst defaultFilter = (suggestion: string, query: string) =>\n suggestion.toLowerCase().includes(query.toLowerCase());\n\nexport interface ComboboxVanillaProps\n extends\n Omit<InputVanillaProps, 'value' | 'defaultValue' | 'onChange' | 'type' | 'role' | 'css'>,\n CSSProps {\n value?: string;\n defaultValue?: string;\n onValueChange?: (value: string) => void;\n suggestions: string[];\n emptyText?: React.ReactNode;\n filter?: (suggestion: string, query: string) => boolean;\n openOnFocus?: boolean;\n}\n\nexport const ComboboxVanilla = forwardRef<InputVanillaHandle, ComboboxVanillaProps>(\n (\n {\n value: valueProp,\n defaultValue = '',\n onValueChange,\n suggestions,\n emptyText,\n filter = defaultFilter,\n openOnFocus = true,\n id: idProp,\n size,\n disabled,\n readOnly,\n className,\n style,\n css,\n onFocus,\n onBlur,\n onKeyDown,\n ...props\n },\n ref,\n ) => {\n const { colors } = useVanillaExtractTheme();\n const { style: cssStyles, vars } = processCSSProp(css, colors);\n\n const autoId = useId();\n const id = idProp ?? autoId;\n const listId = `${id}-listbox`;\n const optionId = (index: number) => `${id}-option-${index}`;\n\n const anchorRef = useRef<HTMLDivElement>(null);\n const [innerValue, setInnerValue] = useState(defaultValue);\n const value = valueProp ?? innerValue;\n const [open, setOpen] = useState(false);\n const [query, setQuery] = useState('');\n const [highlighted, setHighlighted] = useState(-1);\n\n const shown = query ? suggestions.filter((s) => filter(s, query)) : suggestions;\n const showEmpty = emptyText != null && suggestions.length === 0;\n const popupOpen = open && (shown.length > 0 || showEmpty);\n const listOpen = popupOpen && shown.length > 0;\n const active = listOpen && highlighted < shown.length ? highlighted : -1;\n\n useEffect(() => {\n if (active >= 0) {\n document.getElementById(`${id}-option-${active}`)?.scrollIntoView?.({ block: 'nearest' });\n }\n }, [active, id]);\n\n const setValue = (next: string) => {\n if (valueProp === undefined) setInnerValue(next);\n onValueChange?.(next);\n };\n\n const close = () => {\n setOpen(false);\n setQuery('');\n setHighlighted(-1);\n };\n\n const choose = (suggestion: string) => {\n setValue(suggestion);\n close();\n };\n\n const interactive = !disabled && !readOnly;\n\n const handleKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => {\n onKeyDown?.(e);\n if (e.defaultPrevented || !interactive) return;\n\n const last = shown.length - 1;\n switch (e.key) {\n case 'ArrowDown':\n e.preventDefault();\n if (!open) {\n setOpen(true);\n setHighlighted(e.altKey ? -1 : 0);\n } else if (!e.altKey) {\n setHighlighted(active >= last ? 0 : active + 1);\n }\n break;\n case 'ArrowUp':\n e.preventDefault();\n if (!open) {\n setOpen(true);\n setHighlighted(last);\n } else {\n setHighlighted(active <= 0 ? last : active - 1);\n }\n break;\n case 'Enter':\n if (active >= 0) {\n e.preventDefault();\n choose(shown[active]);\n }\n break;\n case 'Escape':\n if (popupOpen) {\n e.preventDefault();\n close();\n }\n break;\n default:\n break;\n }\n };\n\n return (\n <PopoverPrimitive.Root open={popupOpen} onOpenChange={(next) => !next && close()}>\n <PopoverPrimitive.Anchor asChild>\n <div\n ref={anchorRef}\n className={cx(comboboxAnchor, className)}\n style={{ ...cssStyles, ...style, ...assignInlineVars(vars) }}\n >\n <InputVanilla\n ref={ref}\n id={id}\n role=\"combobox\"\n aria-autocomplete=\"list\"\n aria-expanded={listOpen}\n aria-controls={listOpen ? listId : undefined}\n aria-activedescendant={active >= 0 ? optionId(active) : undefined}\n autoComplete=\"off\"\n size={size}\n disabled={disabled}\n readOnly={readOnly}\n value={value}\n onChange={(e: React.ChangeEvent<HTMLInputElement>) => {\n setValue(e.target.value);\n setQuery(e.target.value);\n setOpen(true);\n setHighlighted(-1);\n }}\n onFocus={(e: React.FocusEvent<HTMLInputElement>) => {\n onFocus?.(e);\n if (openOnFocus && interactive) {\n setOpen(true);\n setQuery('');\n setHighlighted(-1);\n }\n }}\n onBlur={(e: React.FocusEvent<HTMLInputElement>) => {\n onBlur?.(e);\n close();\n }}\n onKeyDown={handleKeyDown}\n {...props}\n />\n </div>\n </PopoverPrimitive.Anchor>\n <PopoverPrimitive.Portal>\n <PopoverPrimitive.Content\n role={undefined}\n id={undefined}\n className={comboboxContent}\n side=\"bottom\"\n align=\"start\"\n sideOffset={4}\n collisionPadding={8}\n onOpenAutoFocus={(e) => e.preventDefault()}\n onCloseAutoFocus={(e) => e.preventDefault()}\n onInteractOutside={(e) => {\n if (anchorRef.current?.contains(e.target as Node)) e.preventDefault();\n }}\n // Keeps the focus in the input, so a click on an option does not blur it.\n onMouseDown={(e) => e.preventDefault()}\n >\n {listOpen ? (\n <ul\n id={listId}\n role=\"listbox\"\n aria-label={\n props['aria-labelledby'] ? undefined : (props['aria-label'] ?? 'Suggestions')\n }\n aria-labelledby={props['aria-labelledby']}\n className={comboboxListbox}\n >\n {shown.map((suggestion, index) => (\n <li\n key={optionId(index)}\n id={optionId(index)}\n role=\"option\"\n aria-selected={index === active}\n data-highlighted={index === active ? '' : undefined}\n className={comboboxOptionRecipe({ size })}\n onMouseMove={() => index !== active && setHighlighted(index)}\n onClick={() => choose(suggestion)}\n >\n {suggestion}\n </li>\n ))}\n </ul>\n ) : (\n <div role=\"status\" className={comboboxEmptyRecipe({ size })}>\n {emptyText}\n </div>\n )}\n </PopoverPrimitive.Content>\n </PopoverPrimitive.Portal>\n </PopoverPrimitive.Root>\n );\n },\n);\n\nComboboxVanilla.displayName = 'ComboboxVanilla';\n"],"mappings":";;;;;;;;;;AAgBA,IAAM,iBAAiB,YAAoB,UACzC,WAAW,YAAY,CAAC,CAAC,SAAS,MAAM,YAAY,CAAC;AAevD,IAAa,kBAAkB,YAE3B,EACE,OAAO,WACP,eAAe,IACf,eACA,aACA,WACA,SAAS,eACT,cAAc,MACd,IAAI,QACJ,MACA,UACA,UACA,WACA,OACA,KACA,SACA,QACA,WACA,GAAG,SAEL,QACG;CACH,MAAM,EAAE,WAAW,uBAAuB;CAC1C,MAAM,EAAE,OAAO,WAAW,SAAS,eAAe,KAAK,MAAM;CAE7D,MAAM,SAAS,MAAM;CACrB,MAAM,KAAK,UAAU;CACrB,MAAM,SAAS,GAAG,GAAG;CACrB,MAAM,YAAY,UAAkB,GAAG,GAAG,UAAU;CAEpD,MAAM,YAAY,OAAuB,IAAI;CAC7C,MAAM,CAAC,YAAY,iBAAiB,SAAS,YAAY;CACzD,MAAM,QAAQ,aAAa;CAC3B,MAAM,CAAC,MAAM,WAAW,SAAS,KAAK;CACtC,MAAM,CAAC,OAAO,YAAY,SAAS,EAAE;CACrC,MAAM,CAAC,aAAa,kBAAkB,SAAS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AEpC,UAAA,WACC,oBAAC,MAAD;IACE,IAAI;IACJ,MAAK;IACL,cACE,MAAM,qBAAqB,KAAA,IAAa,MAAM,iBAAiB;IAEjE,mBAAiB,MAAM;IACvB,WAAW;IAEV,UAAA,MAAM,KAAK,YAAY,UACtB,oBAAC,MAAD;KAEE,IAAI,SAAS,KAAK;KAClB,MAAK;KACL,iBAAe,UAAU;KACzB,oBAAkB,UAAU,SAAS,KAAK,KAAA;KAC1C,WAAW,qBAAqB,EAAE,KAAK,CAAC;KACxC,mBAAmB,UAAU,UAAU,eAAe,KAAK;KAC3D,eAAe,OAAO,UAAU;KAE/B,UAAA;IACC,GAVG,SAAS,KAAK,CAUjB,CACL;GACC,CAAA,IAEJ,oBAAC,OAAD;IAAK,MAAK;IAAS,WAAW,oBAAoB,EAAE,KAAK,CAAC;IACvD,UAAA;GACE,CAAA;EAEiB,CAAA,EACH,CAAA,CACJ;;AAE3B,CACF;AAEA,gBAAgB,cAAc"}
@@ -1,5 +1,6 @@
1
1
  const require_runtime = require("../../_virtual/_rolldown/runtime.cjs");
2
2
  const require_cssProps = require("../../styles/cssProps.cjs");
3
+ const require_cx = require("../../styles/cx.cjs");
3
4
  const require_themeContext = require("../../styles/themeContext.cjs");
4
5
  const require_Container_vanilla_css = require("./Container.vanilla.css.cjs");
5
6
  let react = require("react");
@@ -22,7 +23,7 @@ var ContainerVanillaComponent = react.default.forwardRef(({ as, className, css,
22
23
  });
23
24
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Component, {
24
25
  ref,
25
- className: `${recipeClass} ${className || ""}`.trim(),
26
+ className: require_cx.cx(recipeClass, className),
26
27
  style: mergedStyles,
27
28
  ...props
28
29
  });
@@ -1 +1 @@
1
- {"version":3,"file":"Container.vanilla.cjs","names":["React","useVanillaExtractTheme","processCSSProp","assignInlineVars","containerRecipe"],"sources":["../../../components/Container/Container.vanilla.tsx"],"sourcesContent":["import { assignInlineVars } from '@vanilla-extract/dynamic';\nimport React, { ElementType } from 'react';\n\nimport { CSSProps, processCSSProp } from '../../styles/cssProps';\nimport {\n PolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef,\n} from '../../styles/polymorphic';\nimport { useVanillaExtractTheme } from '../../styles/themeContext';\nimport { containerRecipe } from './Container.vanilla.css';\n\ninterface ContainerOwnProps extends CSSProps {\n size?: '1' | '2' | '3' | '4';\n noGutter?: boolean;\n}\n\nexport type ContainerProps<C extends ElementType = 'div'> = PolymorphicComponentProps<\n C,\n ContainerOwnProps\n>;\ntype ContainerComponent = PolymorphicComponent<'div', ContainerProps<ElementType>>;\n\nexport const ContainerVanillaComponent = React.forwardRef(\n <C extends ElementType = 'div'>(\n { as, className, css, style, size, noGutter, ...props }: ContainerProps<C>,\n ref?: PolymorphicRef<C>,\n ) => {\n const Component = as || 'div';\n\n const { colors } = useVanillaExtractTheme();\n\n const { style: cssStyles, vars } = processCSSProp(css, colors);\n\n const mergedStyles = {\n ...cssStyles,\n ...style,\n ...assignInlineVars(vars),\n };\n\n const recipeClass = containerRecipe({ size, noGutter });\n\n return (\n <Component\n ref={ref}\n className={`${recipeClass} ${className || ''}`.trim()}\n style={mergedStyles}\n {...props}\n />\n );\n },\n);\n\nContainerVanillaComponent.displayName = 'ContainerVanilla';\n\nexport const ContainerVanilla = ContainerVanillaComponent as ContainerComponent;\n"],"mappings":";;;;;;;;;AAuBA,IAAa,4BAA4BA,MAAAA,QAAM,YAE3C,EAAE,IAAI,WAAW,KAAK,OAAO,MAAM,UAAU,GAAG,SAChD,QACG;CACH,MAAM,YAAY,MAAM;CAExB,MAAM,EAAE,WAAWC,qBAAAA,uBAAuB;CAE1C,MAAM,EAAE,OAAO,WAAW,SAASC,iBAAAA,eAAe,KAAK,MAAM;CAE7D,MAAM,eAAe;EACnB,GAAG;EACH,GAAG;EACH,IAAA,GAAGC,yBAAAA,iBAAAA,CAAiB,IAAI;CAC1B;CAEA,MAAM,cAAcC,8BAAAA,gBAAgB;EAAE;EAAM;CAAS,CAAC;CAEtD,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,WAAD;EACO;EACL,WAAW,GAAG,YAAY,GAAG,aAAa,KAAK,KAAK;EACpD,OAAO;EACP,GAAI;CACL,CAAA;AAEL,CACF;AAEA,0BAA0B,cAAc;AAExC,IAAa,mBAAmB"}
1
+ {"version":3,"file":"Container.vanilla.cjs","names":["React","useVanillaExtractTheme","processCSSProp","assignInlineVars","containerRecipe","cx"],"sources":["../../../components/Container/Container.vanilla.tsx"],"sourcesContent":["import { assignInlineVars } from '@vanilla-extract/dynamic';\nimport React, { ElementType } from 'react';\n\nimport { CSSProps, processCSSProp } from '../../styles/cssProps';\nimport { cx } from '../../styles/cx';\nimport {\n PolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef,\n} from '../../styles/polymorphic';\nimport { useVanillaExtractTheme } from '../../styles/themeContext';\nimport { containerRecipe } from './Container.vanilla.css';\n\ninterface ContainerOwnProps extends CSSProps {\n size?: '1' | '2' | '3' | '4';\n noGutter?: boolean;\n}\n\nexport type ContainerProps<C extends ElementType = 'div'> = PolymorphicComponentProps<\n C,\n ContainerOwnProps\n>;\ntype ContainerComponent = PolymorphicComponent<'div', ContainerProps<ElementType>>;\n\nexport const ContainerVanillaComponent = React.forwardRef(\n <C extends ElementType = 'div'>(\n { as, className, css, style, size, noGutter, ...props }: ContainerProps<C>,\n ref?: PolymorphicRef<C>,\n ) => {\n const Component = as || 'div';\n\n const { colors } = useVanillaExtractTheme();\n\n const { style: cssStyles, vars } = processCSSProp(css, colors);\n\n const mergedStyles = {\n ...cssStyles,\n ...style,\n ...assignInlineVars(vars),\n };\n\n const recipeClass = containerRecipe({ size, noGutter });\n\n return (\n <Component ref={ref} className={cx(recipeClass, className)} style={mergedStyles} {...props} />\n );\n },\n);\n\nContainerVanillaComponent.displayName = 'ContainerVanilla';\n\nexport const ContainerVanilla = ContainerVanillaComponent as ContainerComponent;\n"],"mappings":";;;;;;;;;;AAwBA,IAAa,4BAA4BA,MAAAA,QAAM,YAE3C,EAAE,IAAI,WAAW,KAAK,OAAO,MAAM,UAAU,GAAG,SAChD,QACG;CACH,MAAM,YAAY,MAAM;CAExB,MAAM,EAAE,WAAWC,qBAAAA,uBAAuB;CAE1C,MAAM,EAAE,OAAO,WAAW,SAASC,iBAAAA,eAAe,KAAK,MAAM;CAE7D,MAAM,eAAe;EACnB,GAAG;EACH,GAAG;EACH,IAAA,GAAGC,yBAAAA,iBAAAA,CAAiB,IAAI;CAC1B;CAEA,MAAM,cAAcC,8BAAAA,gBAAgB;EAAE;EAAM;CAAS,CAAC;CAEtD,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,WAAD;EAAgB;EAAK,WAAWC,WAAAA,GAAG,aAAa,SAAS;EAAG,OAAO;EAAc,GAAI;CAAQ,CAAA;AAEjG,CACF;AAEA,0BAA0B,cAAc;AAExC,IAAa,mBAAmB"}
@@ -1,4 +1,5 @@
1
1
  import { processCSSProp } from "../../styles/cssProps.js";
2
+ import { cx } from "../../styles/cx.js";
2
3
  import { useVanillaExtractTheme } from "../../styles/themeContext.js";
3
4
  import { containerRecipe } from "./Container.vanilla.css.js";
4
5
  import React from "react";
@@ -20,7 +21,7 @@ var ContainerVanillaComponent = React.forwardRef(({ as, className, css, style, s
20
21
  });
21
22
  return /* @__PURE__ */ jsx(Component, {
22
23
  ref,
23
- className: `${recipeClass} ${className || ""}`.trim(),
24
+ className: cx(recipeClass, className),
24
25
  style: mergedStyles,
25
26
  ...props
26
27
  });
@@ -1 +1 @@
1
- {"version":3,"file":"Container.vanilla.js","names":[],"sources":["../../../components/Container/Container.vanilla.tsx"],"sourcesContent":["import { assignInlineVars } from '@vanilla-extract/dynamic';\nimport React, { ElementType } from 'react';\n\nimport { CSSProps, processCSSProp } from '../../styles/cssProps';\nimport {\n PolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef,\n} from '../../styles/polymorphic';\nimport { useVanillaExtractTheme } from '../../styles/themeContext';\nimport { containerRecipe } from './Container.vanilla.css';\n\ninterface ContainerOwnProps extends CSSProps {\n size?: '1' | '2' | '3' | '4';\n noGutter?: boolean;\n}\n\nexport type ContainerProps<C extends ElementType = 'div'> = PolymorphicComponentProps<\n C,\n ContainerOwnProps\n>;\ntype ContainerComponent = PolymorphicComponent<'div', ContainerProps<ElementType>>;\n\nexport const ContainerVanillaComponent = React.forwardRef(\n <C extends ElementType = 'div'>(\n { as, className, css, style, size, noGutter, ...props }: ContainerProps<C>,\n ref?: PolymorphicRef<C>,\n ) => {\n const Component = as || 'div';\n\n const { colors } = useVanillaExtractTheme();\n\n const { style: cssStyles, vars } = processCSSProp(css, colors);\n\n const mergedStyles = {\n ...cssStyles,\n ...style,\n ...assignInlineVars(vars),\n };\n\n const recipeClass = containerRecipe({ size, noGutter });\n\n return (\n <Component\n ref={ref}\n className={`${recipeClass} ${className || ''}`.trim()}\n style={mergedStyles}\n {...props}\n />\n );\n },\n);\n\nContainerVanillaComponent.displayName = 'ContainerVanilla';\n\nexport const ContainerVanilla = ContainerVanillaComponent as ContainerComponent;\n"],"mappings":";;;;;;;AAuBA,IAAa,4BAA4B,MAAM,YAE3C,EAAE,IAAI,WAAW,KAAK,OAAO,MAAM,UAAU,GAAG,SAChD,QACG;CACH,MAAM,YAAY,MAAM;CAExB,MAAM,EAAE,WAAW,uBAAuB;CAE1C,MAAM,EAAE,OAAO,WAAW,SAAS,eAAe,KAAK,MAAM;CAE7D,MAAM,eAAe;EACnB,GAAG;EACH,GAAG;EACH,GAAG,iBAAiB,IAAI;CAC1B;CAEA,MAAM,cAAc,gBAAgB;EAAE;EAAM;CAAS,CAAC;CAEtD,OACE,oBAAC,WAAD;EACO;EACL,WAAW,GAAG,YAAY,GAAG,aAAa,KAAK,KAAK;EACpD,OAAO;EACP,GAAI;CACL,CAAA;AAEL,CACF;AAEA,0BAA0B,cAAc;AAExC,IAAa,mBAAmB"}
1
+ {"version":3,"file":"Container.vanilla.js","names":[],"sources":["../../../components/Container/Container.vanilla.tsx"],"sourcesContent":["import { assignInlineVars } from '@vanilla-extract/dynamic';\nimport React, { ElementType } from 'react';\n\nimport { CSSProps, processCSSProp } from '../../styles/cssProps';\nimport { cx } from '../../styles/cx';\nimport {\n PolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef,\n} from '../../styles/polymorphic';\nimport { useVanillaExtractTheme } from '../../styles/themeContext';\nimport { containerRecipe } from './Container.vanilla.css';\n\ninterface ContainerOwnProps extends CSSProps {\n size?: '1' | '2' | '3' | '4';\n noGutter?: boolean;\n}\n\nexport type ContainerProps<C extends ElementType = 'div'> = PolymorphicComponentProps<\n C,\n ContainerOwnProps\n>;\ntype ContainerComponent = PolymorphicComponent<'div', ContainerProps<ElementType>>;\n\nexport const ContainerVanillaComponent = React.forwardRef(\n <C extends ElementType = 'div'>(\n { as, className, css, style, size, noGutter, ...props }: ContainerProps<C>,\n ref?: PolymorphicRef<C>,\n ) => {\n const Component = as || 'div';\n\n const { colors } = useVanillaExtractTheme();\n\n const { style: cssStyles, vars } = processCSSProp(css, colors);\n\n const mergedStyles = {\n ...cssStyles,\n ...style,\n ...assignInlineVars(vars),\n };\n\n const recipeClass = containerRecipe({ size, noGutter });\n\n return (\n <Component ref={ref} className={cx(recipeClass, className)} style={mergedStyles} {...props} />\n );\n },\n);\n\nContainerVanillaComponent.displayName = 'ContainerVanilla';\n\nexport const ContainerVanilla = ContainerVanillaComponent as ContainerComponent;\n"],"mappings":";;;;;;;;AAwBA,IAAa,4BAA4B,MAAM,YAE3C,EAAE,IAAI,WAAW,KAAK,OAAO,MAAM,UAAU,GAAG,SAChD,QACG;CACH,MAAM,YAAY,MAAM;CAExB,MAAM,EAAE,WAAW,uBAAuB;CAE1C,MAAM,EAAE,OAAO,WAAW,SAAS,eAAe,KAAK,MAAM;CAE7D,MAAM,eAAe;EACnB,GAAG;EACH,GAAG;EACH,GAAG,iBAAiB,IAAI;CAC1B;CAEA,MAAM,cAAc,gBAAgB;EAAE;EAAM;CAAS,CAAC;CAEtD,OACE,oBAAC,WAAD;EAAgB;EAAK,WAAW,GAAG,aAAa,SAAS;EAAG,OAAO;EAAc,GAAI;CAAQ,CAAA;AAEjG,CACF;AAEA,0BAA0B,cAAc;AAExC,IAAa,mBAAmB"}