@traefik-labs/faency 13.7.0 → 13.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (233) hide show
  1. package/README.md +12 -5
  2. package/dist/components/AriaTable/AriaTable.cjs +48 -22
  3. package/dist/components/AriaTable/AriaTable.cjs.map +1 -1
  4. package/dist/components/AriaTable/AriaTable.js +49 -23
  5. package/dist/components/AriaTable/AriaTable.js.map +1 -1
  6. package/dist/components/AriaTable/AriaTable.vanilla.cjs +8 -4
  7. package/dist/components/AriaTable/AriaTable.vanilla.cjs.map +1 -1
  8. package/dist/components/AriaTable/AriaTable.vanilla.css.cjs.map +1 -1
  9. package/dist/components/AriaTable/AriaTable.vanilla.css.js.map +1 -1
  10. package/dist/components/AriaTable/AriaTable.vanilla.js +8 -4
  11. package/dist/components/AriaTable/AriaTable.vanilla.js.map +1 -1
  12. package/dist/components/Avatar/Avatar.vanilla.cjs +5 -2
  13. package/dist/components/Avatar/Avatar.vanilla.cjs.map +1 -1
  14. package/dist/components/Avatar/Avatar.vanilla.css.cjs.map +1 -1
  15. package/dist/components/Avatar/Avatar.vanilla.css.js.map +1 -1
  16. package/dist/components/Avatar/Avatar.vanilla.js +5 -2
  17. package/dist/components/Avatar/Avatar.vanilla.js.map +1 -1
  18. package/dist/components/Badge/Badge.vanilla.cjs +2 -10
  19. package/dist/components/Badge/Badge.vanilla.cjs.map +1 -1
  20. package/dist/components/Badge/Badge.vanilla.css.cjs.map +1 -1
  21. package/dist/components/Badge/Badge.vanilla.css.js.map +1 -1
  22. package/dist/components/Badge/Badge.vanilla.js +2 -10
  23. package/dist/components/Badge/Badge.vanilla.js.map +1 -1
  24. package/dist/components/Blockquote/Blockquote.vanilla.cjs +5 -11
  25. package/dist/components/Blockquote/Blockquote.vanilla.cjs.map +1 -1
  26. package/dist/components/Blockquote/Blockquote.vanilla.css.cjs.map +1 -1
  27. package/dist/components/Blockquote/Blockquote.vanilla.css.js.map +1 -1
  28. package/dist/components/Blockquote/Blockquote.vanilla.js +5 -11
  29. package/dist/components/Blockquote/Blockquote.vanilla.js.map +1 -1
  30. package/dist/components/Box/Box.vanilla.cjs +2 -10
  31. package/dist/components/Box/Box.vanilla.cjs.map +1 -1
  32. package/dist/components/Box/Box.vanilla.css.cjs.map +1 -1
  33. package/dist/components/Box/Box.vanilla.css.js.map +1 -1
  34. package/dist/components/Box/Box.vanilla.js +2 -10
  35. package/dist/components/Box/Box.vanilla.js.map +1 -1
  36. package/dist/components/Bubble/Bubble.vanilla.cjs +2 -10
  37. package/dist/components/Bubble/Bubble.vanilla.cjs.map +1 -1
  38. package/dist/components/Bubble/Bubble.vanilla.css.cjs.map +1 -1
  39. package/dist/components/Bubble/Bubble.vanilla.css.js.map +1 -1
  40. package/dist/components/Bubble/Bubble.vanilla.js +2 -10
  41. package/dist/components/Bubble/Bubble.vanilla.js.map +1 -1
  42. package/dist/components/Button/Button.vanilla.cjs +2 -10
  43. package/dist/components/Button/Button.vanilla.cjs.map +1 -1
  44. package/dist/components/Button/Button.vanilla.css.cjs.map +1 -1
  45. package/dist/components/Button/Button.vanilla.css.js.map +1 -1
  46. package/dist/components/Button/Button.vanilla.js +2 -10
  47. package/dist/components/Button/Button.vanilla.js.map +1 -1
  48. package/dist/components/ButtonSwitch/ButtonSwitch.vanilla.cjs +3 -17
  49. package/dist/components/ButtonSwitch/ButtonSwitch.vanilla.cjs.map +1 -1
  50. package/dist/components/ButtonSwitch/ButtonSwitch.vanilla.css.cjs.map +1 -1
  51. package/dist/components/ButtonSwitch/ButtonSwitch.vanilla.css.js.map +1 -1
  52. package/dist/components/ButtonSwitch/ButtonSwitch.vanilla.js +3 -17
  53. package/dist/components/ButtonSwitch/ButtonSwitch.vanilla.js.map +1 -1
  54. package/dist/components/Card/Card.vanilla.cjs +6 -11
  55. package/dist/components/Card/Card.vanilla.cjs.map +1 -1
  56. package/dist/components/Card/Card.vanilla.css.cjs.map +1 -1
  57. package/dist/components/Card/Card.vanilla.css.js.map +1 -1
  58. package/dist/components/Card/Card.vanilla.js +6 -11
  59. package/dist/components/Card/Card.vanilla.js.map +1 -1
  60. package/dist/components/CodeBlock/CodeBlock.vanilla.cjs +3 -6
  61. package/dist/components/CodeBlock/CodeBlock.vanilla.cjs.map +1 -1
  62. package/dist/components/CodeBlock/CodeBlock.vanilla.css.cjs.map +1 -1
  63. package/dist/components/CodeBlock/CodeBlock.vanilla.css.js.map +1 -1
  64. package/dist/components/CodeBlock/CodeBlock.vanilla.js +3 -6
  65. package/dist/components/CodeBlock/CodeBlock.vanilla.js.map +1 -1
  66. package/dist/components/Combobox/Combobox.vanilla.cjs +3 -10
  67. package/dist/components/Combobox/Combobox.vanilla.cjs.map +1 -1
  68. package/dist/components/Combobox/Combobox.vanilla.css.cjs.map +1 -1
  69. package/dist/components/Combobox/Combobox.vanilla.css.js.map +1 -1
  70. package/dist/components/Combobox/Combobox.vanilla.js +3 -10
  71. package/dist/components/Combobox/Combobox.vanilla.js.map +1 -1
  72. package/dist/components/Container/Container.vanilla.cjs +5 -11
  73. package/dist/components/Container/Container.vanilla.cjs.map +1 -1
  74. package/dist/components/Container/Container.vanilla.css.cjs.map +1 -1
  75. package/dist/components/Container/Container.vanilla.css.js.map +1 -1
  76. package/dist/components/Container/Container.vanilla.js +5 -11
  77. package/dist/components/Container/Container.vanilla.js.map +1 -1
  78. package/dist/components/Elevation/Elevation.vanilla.cjs +5 -11
  79. package/dist/components/Elevation/Elevation.vanilla.cjs.map +1 -1
  80. package/dist/components/Elevation/Elevation.vanilla.css.cjs.map +1 -1
  81. package/dist/components/Elevation/Elevation.vanilla.css.js.map +1 -1
  82. package/dist/components/Elevation/Elevation.vanilla.js +5 -11
  83. package/dist/components/Elevation/Elevation.vanilla.js.map +1 -1
  84. package/dist/components/Field/Field.vanilla.cjs +3 -9
  85. package/dist/components/Field/Field.vanilla.cjs.map +1 -1
  86. package/dist/components/Field/Field.vanilla.css.cjs.map +1 -1
  87. package/dist/components/Field/Field.vanilla.css.js.map +1 -1
  88. package/dist/components/Field/Field.vanilla.js +3 -9
  89. package/dist/components/Field/Field.vanilla.js.map +1 -1
  90. package/dist/components/Flex/Flex.vanilla.cjs +5 -11
  91. package/dist/components/Flex/Flex.vanilla.cjs.map +1 -1
  92. package/dist/components/Flex/Flex.vanilla.css.cjs.map +1 -1
  93. package/dist/components/Flex/Flex.vanilla.css.js.map +1 -1
  94. package/dist/components/Flex/Flex.vanilla.js +5 -11
  95. package/dist/components/Flex/Flex.vanilla.js.map +1 -1
  96. package/dist/components/Grid/Grid.vanilla.cjs +7 -11
  97. package/dist/components/Grid/Grid.vanilla.cjs.map +1 -1
  98. package/dist/components/Grid/Grid.vanilla.css.cjs.map +1 -1
  99. package/dist/components/Grid/Grid.vanilla.css.js.map +1 -1
  100. package/dist/components/Grid/Grid.vanilla.js +7 -11
  101. package/dist/components/Grid/Grid.vanilla.js.map +1 -1
  102. package/dist/components/Heading/Heading.vanilla.cjs +35 -0
  103. package/dist/components/Heading/Heading.vanilla.cjs.map +1 -0
  104. package/dist/components/Heading/Heading.vanilla.css.cjs +85 -0
  105. package/dist/components/Heading/Heading.vanilla.css.cjs.map +1 -0
  106. package/dist/components/Heading/Heading.vanilla.css.js +74 -0
  107. package/dist/components/Heading/Heading.vanilla.css.js.map +1 -0
  108. package/dist/components/Heading/Heading.vanilla.js +30 -0
  109. package/dist/components/Heading/Heading.vanilla.js.map +1 -0
  110. package/dist/components/IconButton/IconButton.vanilla.cjs +5 -11
  111. package/dist/components/IconButton/IconButton.vanilla.cjs.map +1 -1
  112. package/dist/components/IconButton/IconButton.vanilla.css.cjs.map +1 -1
  113. package/dist/components/IconButton/IconButton.vanilla.css.js.map +1 -1
  114. package/dist/components/IconButton/IconButton.vanilla.js +5 -11
  115. package/dist/components/IconButton/IconButton.vanilla.js.map +1 -1
  116. package/dist/components/Image/Image.vanilla.cjs +2 -10
  117. package/dist/components/Image/Image.vanilla.cjs.map +1 -1
  118. package/dist/components/Image/Image.vanilla.css.cjs.map +1 -1
  119. package/dist/components/Image/Image.vanilla.css.js.map +1 -1
  120. package/dist/components/Image/Image.vanilla.js +2 -10
  121. package/dist/components/Image/Image.vanilla.js.map +1 -1
  122. package/dist/components/Input/Input.vanilla.cjs +2 -10
  123. package/dist/components/Input/Input.vanilla.cjs.map +1 -1
  124. package/dist/components/Input/Input.vanilla.css.cjs.map +1 -1
  125. package/dist/components/Input/Input.vanilla.css.js.map +1 -1
  126. package/dist/components/Input/Input.vanilla.js +2 -10
  127. package/dist/components/Input/Input.vanilla.js.map +1 -1
  128. package/dist/components/Label/Label.vanilla.cjs +5 -11
  129. package/dist/components/Label/Label.vanilla.cjs.map +1 -1
  130. package/dist/components/Label/Label.vanilla.css.cjs.map +1 -1
  131. package/dist/components/Label/Label.vanilla.css.js.map +1 -1
  132. package/dist/components/Label/Label.vanilla.js +5 -11
  133. package/dist/components/Label/Label.vanilla.js.map +1 -1
  134. package/dist/components/List/List.vanilla.cjs +10 -18
  135. package/dist/components/List/List.vanilla.cjs.map +1 -1
  136. package/dist/components/List/List.vanilla.css.cjs.map +1 -1
  137. package/dist/components/List/List.vanilla.css.js.map +1 -1
  138. package/dist/components/List/List.vanilla.js +7 -15
  139. package/dist/components/List/List.vanilla.js.map +1 -1
  140. package/dist/components/Meter/Meter.vanilla.cjs +3 -8
  141. package/dist/components/Meter/Meter.vanilla.cjs.map +1 -1
  142. package/dist/components/Meter/Meter.vanilla.css.cjs.map +1 -1
  143. package/dist/components/Meter/Meter.vanilla.css.js.map +1 -1
  144. package/dist/components/Meter/Meter.vanilla.js +3 -8
  145. package/dist/components/Meter/Meter.vanilla.js.map +1 -1
  146. package/dist/components/Panel/Panel.vanilla.cjs +2 -10
  147. package/dist/components/Panel/Panel.vanilla.cjs.map +1 -1
  148. package/dist/components/Panel/Panel.vanilla.css.cjs.map +1 -1
  149. package/dist/components/Panel/Panel.vanilla.css.js.map +1 -1
  150. package/dist/components/Panel/Panel.vanilla.js +2 -10
  151. package/dist/components/Panel/Panel.vanilla.js.map +1 -1
  152. package/dist/components/Paragraph/Paragraph.vanilla.cjs +5 -11
  153. package/dist/components/Paragraph/Paragraph.vanilla.cjs.map +1 -1
  154. package/dist/components/Paragraph/Paragraph.vanilla.css.cjs.map +1 -1
  155. package/dist/components/Paragraph/Paragraph.vanilla.css.js.map +1 -1
  156. package/dist/components/Paragraph/Paragraph.vanilla.js +5 -11
  157. package/dist/components/Paragraph/Paragraph.vanilla.js.map +1 -1
  158. package/dist/components/RowLink/RowLink.vanilla.cjs.map +1 -1
  159. package/dist/components/RowLink/RowLink.vanilla.css.cjs.map +1 -1
  160. package/dist/components/RowLink/RowLink.vanilla.css.js.map +1 -1
  161. package/dist/components/RowLink/RowLink.vanilla.js.map +1 -1
  162. package/dist/components/SegmentedControl/SegmentedControl.vanilla.cjs +3 -14
  163. package/dist/components/SegmentedControl/SegmentedControl.vanilla.cjs.map +1 -1
  164. package/dist/components/SegmentedControl/SegmentedControl.vanilla.css.cjs.map +1 -1
  165. package/dist/components/SegmentedControl/SegmentedControl.vanilla.css.js.map +1 -1
  166. package/dist/components/SegmentedControl/SegmentedControl.vanilla.js +3 -14
  167. package/dist/components/SegmentedControl/SegmentedControl.vanilla.js.map +1 -1
  168. package/dist/components/Skeleton/Skeleton.vanilla.cjs +2 -10
  169. package/dist/components/Skeleton/Skeleton.vanilla.cjs.map +1 -1
  170. package/dist/components/Skeleton/Skeleton.vanilla.css.cjs.map +1 -1
  171. package/dist/components/Skeleton/Skeleton.vanilla.css.js.map +1 -1
  172. package/dist/components/Skeleton/Skeleton.vanilla.js +2 -10
  173. package/dist/components/Skeleton/Skeleton.vanilla.js.map +1 -1
  174. package/dist/components/Spinner/Spinner.vanilla.cjs +3 -6
  175. package/dist/components/Spinner/Spinner.vanilla.cjs.map +1 -1
  176. package/dist/components/Spinner/Spinner.vanilla.css.cjs.map +1 -1
  177. package/dist/components/Spinner/Spinner.vanilla.css.js.map +1 -1
  178. package/dist/components/Spinner/Spinner.vanilla.js +3 -6
  179. package/dist/components/Spinner/Spinner.vanilla.js.map +1 -1
  180. package/dist/components/SplitLayout/SplitLayout.vanilla.cjs +3 -10
  181. package/dist/components/SplitLayout/SplitLayout.vanilla.cjs.map +1 -1
  182. package/dist/components/SplitLayout/SplitLayout.vanilla.css.cjs.map +1 -1
  183. package/dist/components/SplitLayout/SplitLayout.vanilla.css.js.map +1 -1
  184. package/dist/components/SplitLayout/SplitLayout.vanilla.js +3 -10
  185. package/dist/components/SplitLayout/SplitLayout.vanilla.js.map +1 -1
  186. package/dist/components/Table/Table.vanilla.cjs +8 -4
  187. package/dist/components/Table/Table.vanilla.cjs.map +1 -1
  188. package/dist/components/Table/Table.vanilla.css.cjs.map +1 -1
  189. package/dist/components/Table/Table.vanilla.css.js.map +1 -1
  190. package/dist/components/Table/Table.vanilla.js +8 -4
  191. package/dist/components/Table/Table.vanilla.js.map +1 -1
  192. package/dist/components/Text/Text.vanilla.cjs +5 -11
  193. package/dist/components/Text/Text.vanilla.cjs.map +1 -1
  194. package/dist/components/Text/Text.vanilla.css.cjs.map +1 -1
  195. package/dist/components/Text/Text.vanilla.css.js.map +1 -1
  196. package/dist/components/Text/Text.vanilla.js +5 -11
  197. package/dist/components/Text/Text.vanilla.js.map +1 -1
  198. package/dist/components/TextField/TextField.vanilla.cjs.map +1 -1
  199. package/dist/components/TextField/TextField.vanilla.css.cjs.map +1 -1
  200. package/dist/components/TextField/TextField.vanilla.css.js.map +1 -1
  201. package/dist/components/TextField/TextField.vanilla.js.map +1 -1
  202. package/dist/components/Textarea/Textarea.vanilla.cjs +2 -10
  203. package/dist/components/Textarea/Textarea.vanilla.cjs.map +1 -1
  204. package/dist/components/Textarea/Textarea.vanilla.css.cjs.map +1 -1
  205. package/dist/components/Textarea/Textarea.vanilla.css.js.map +1 -1
  206. package/dist/components/Textarea/Textarea.vanilla.js +2 -10
  207. package/dist/components/Textarea/Textarea.vanilla.js.map +1 -1
  208. package/dist/components/Toast/Toast.vanilla.cjs +4 -15
  209. package/dist/components/Toast/Toast.vanilla.cjs.map +1 -1
  210. package/dist/components/Toast/Toast.vanilla.css.cjs.map +1 -1
  211. package/dist/components/Toast/Toast.vanilla.css.js.map +1 -1
  212. package/dist/components/Toast/Toast.vanilla.js +4 -15
  213. package/dist/components/Toast/Toast.vanilla.js.map +1 -1
  214. package/dist/faency.css +118 -2
  215. package/dist/index.cjs +9 -0
  216. package/dist/index.d.cts +36800 -0
  217. package/dist/index.d.ts +248 -94
  218. package/dist/index.js +3 -1
  219. package/dist/styles/recipeVariants.cjs +15 -0
  220. package/dist/styles/recipeVariants.cjs.map +1 -0
  221. package/dist/styles/recipeVariants.js +15 -0
  222. package/dist/styles/recipeVariants.js.map +1 -0
  223. package/dist/styles/themeContext.cjs.map +1 -1
  224. package/dist/styles/themeContext.js.map +1 -1
  225. package/dist/styles/themes.css.cjs.map +1 -1
  226. package/dist/styles/themes.css.js.map +1 -1
  227. package/dist/styles/tokens.css.cjs.map +1 -1
  228. package/dist/styles/tokens.css.js.map +1 -1
  229. package/dist/utils/warnOnce.cjs +8 -1
  230. package/dist/utils/warnOnce.cjs.map +1 -1
  231. package/dist/utils/warnOnce.js +8 -1
  232. package/dist/utils/warnOnce.js.map +1 -1
  233. package/package.json +32 -22
@@ -1 +1 @@
1
- {"version":3,"file":"Bubble.vanilla.css.cjs","names":["_7a468"],"sources":["../../../components/Bubble/Bubble.vanilla.css.ts"],"sourcesContent":["import { keyframes, style } from '@vanilla-extract/css';\nimport { recipe } from '@vanilla-extract/recipes';\n\nimport { tokens } from '../../styles/tokens.css';\n\nconst bip = keyframes({\n '0%': {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n opacity: 1,\n },\n '100%': {\n top: -8,\n right: -8,\n bottom: -8,\n left: -8,\n opacity: 0,\n },\n});\n\nconst baseBubble = style({\n display: 'inline-block',\n width: tokens.sizes['4'],\n height: tokens.sizes['4'],\n backgroundColor: tokens.colors.red['8'],\n borderRadius: '50%',\n position: 'relative',\n\n selectors: {\n '&::before': {\n animation: `${bip} 1s ease infinite`,\n boxSizing: 'border-box',\n content: '\"\"',\n position: 'absolute',\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n boxShadow: 'inset 0 0 0 1px rgba(255,255,255,.5)',\n borderRadius: '50%',\n pointerEvents: 'none',\n zIndex: -1,\n },\n '&::after': {\n boxSizing: 'border-box',\n content: '\"\"',\n position: 'absolute',\n top: 5,\n right: 5,\n bottom: 5,\n left: 5,\n backgroundColor: 'rgba(255,255,255,.1)',\n borderRadius: '50%',\n pointerEvents: 'none',\n },\n },\n});\n\nexport const bubbleRecipe = recipe({\n base: baseBubble,\n\n variants: {\n variant: {\n red: {\n backgroundColor: tokens.colors.red['8'],\n selectors: {\n '&::before': { backgroundColor: tokens.colors.red['8'] },\n },\n },\n green: {\n backgroundColor: tokens.colors.green['8'],\n selectors: {\n '&::before': { backgroundColor: tokens.colors.green['8'] },\n },\n },\n orange: {\n backgroundColor: tokens.colors.orange['8'],\n selectors: {\n '&::before': { backgroundColor: tokens.colors.orange['8'] },\n },\n },\n blue: {\n backgroundColor: tokens.colors.blue['8'],\n selectors: {\n '&::before': { backgroundColor: tokens.colors.blue['8'] },\n },\n },\n yellow: {\n backgroundColor: tokens.colors.neon['8'],\n selectors: {\n '&::before': { backgroundColor: tokens.colors.neon['8'] },\n },\n },\n purple: {\n backgroundColor: tokens.colors.purple['8'],\n selectors: {\n '&::before': { backgroundColor: tokens.colors.purple['8'] },\n },\n },\n gray: {\n backgroundColor: tokens.colors.slate['8'],\n selectors: {\n '&::before': { backgroundColor: tokens.colors.slate['8'] },\n },\n },\n },\n size: {\n 'x-small': {\n width: tokens.sizes['1'],\n height: tokens.sizes['1'],\n },\n small: {\n width: tokens.sizes['2'],\n height: tokens.sizes['2'],\n },\n medium: {\n width: tokens.sizes['3'],\n height: tokens.sizes['3'],\n },\n large: {\n width: tokens.sizes['4'],\n height: tokens.sizes['4'],\n },\n 'x-large': {\n width: tokens.sizes['5'],\n height: tokens.sizes['5'],\n },\n },\n noAnimation: {\n true: {\n selectors: {\n '&::before': { content: 'none' },\n },\n },\n },\n },\n\n defaultVariants: {\n size: 'small',\n noAnimation: false,\n },\n});\n"],"mappings":""}
1
+ {"version":3,"file":"Bubble.vanilla.css.cjs","names":[],"sources":[],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"Bubble.vanilla.css.js","names":["_7a468"],"sources":["../../../components/Bubble/Bubble.vanilla.css.ts"],"sourcesContent":["import { keyframes, style } from '@vanilla-extract/css';\nimport { recipe } from '@vanilla-extract/recipes';\n\nimport { tokens } from '../../styles/tokens.css';\n\nconst bip = keyframes({\n '0%': {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n opacity: 1,\n },\n '100%': {\n top: -8,\n right: -8,\n bottom: -8,\n left: -8,\n opacity: 0,\n },\n});\n\nconst baseBubble = style({\n display: 'inline-block',\n width: tokens.sizes['4'],\n height: tokens.sizes['4'],\n backgroundColor: tokens.colors.red['8'],\n borderRadius: '50%',\n position: 'relative',\n\n selectors: {\n '&::before': {\n animation: `${bip} 1s ease infinite`,\n boxSizing: 'border-box',\n content: '\"\"',\n position: 'absolute',\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n boxShadow: 'inset 0 0 0 1px rgba(255,255,255,.5)',\n borderRadius: '50%',\n pointerEvents: 'none',\n zIndex: -1,\n },\n '&::after': {\n boxSizing: 'border-box',\n content: '\"\"',\n position: 'absolute',\n top: 5,\n right: 5,\n bottom: 5,\n left: 5,\n backgroundColor: 'rgba(255,255,255,.1)',\n borderRadius: '50%',\n pointerEvents: 'none',\n },\n },\n});\n\nexport const bubbleRecipe = recipe({\n base: baseBubble,\n\n variants: {\n variant: {\n red: {\n backgroundColor: tokens.colors.red['8'],\n selectors: {\n '&::before': { backgroundColor: tokens.colors.red['8'] },\n },\n },\n green: {\n backgroundColor: tokens.colors.green['8'],\n selectors: {\n '&::before': { backgroundColor: tokens.colors.green['8'] },\n },\n },\n orange: {\n backgroundColor: tokens.colors.orange['8'],\n selectors: {\n '&::before': { backgroundColor: tokens.colors.orange['8'] },\n },\n },\n blue: {\n backgroundColor: tokens.colors.blue['8'],\n selectors: {\n '&::before': { backgroundColor: tokens.colors.blue['8'] },\n },\n },\n yellow: {\n backgroundColor: tokens.colors.neon['8'],\n selectors: {\n '&::before': { backgroundColor: tokens.colors.neon['8'] },\n },\n },\n purple: {\n backgroundColor: tokens.colors.purple['8'],\n selectors: {\n '&::before': { backgroundColor: tokens.colors.purple['8'] },\n },\n },\n gray: {\n backgroundColor: tokens.colors.slate['8'],\n selectors: {\n '&::before': { backgroundColor: tokens.colors.slate['8'] },\n },\n },\n },\n size: {\n 'x-small': {\n width: tokens.sizes['1'],\n height: tokens.sizes['1'],\n },\n small: {\n width: tokens.sizes['2'],\n height: tokens.sizes['2'],\n },\n medium: {\n width: tokens.sizes['3'],\n height: tokens.sizes['3'],\n },\n large: {\n width: tokens.sizes['4'],\n height: tokens.sizes['4'],\n },\n 'x-large': {\n width: tokens.sizes['5'],\n height: tokens.sizes['5'],\n },\n },\n noAnimation: {\n true: {\n selectors: {\n '&::before': { content: 'none' },\n },\n },\n },\n },\n\n defaultVariants: {\n size: 'small',\n noAnimation: false,\n },\n});\n"],"mappings":""}
1
+ {"version":3,"file":"Bubble.vanilla.css.js","names":[],"sources":[],"mappings":""}
@@ -1,20 +1,12 @@
1
- import { processCSSProp } from "../../styles/cssProps.js";
2
1
  import { cx } from "../../styles/cx.js";
3
- import { useVanillaExtractTheme } from "../../styles/themeContext.js";
2
+ import { useInlineStyle } from "../../styles/useInlineStyle.js";
4
3
  import { bubbleRecipe } from "./Bubble.vanilla.css.js";
5
4
  import { forwardRef } from "react";
6
- import { assignInlineVars } from "@vanilla-extract/dynamic";
7
5
  import { jsx } from "react/jsx-runtime";
8
6
  // components/Bubble/Bubble.vanilla.tsx
9
7
  var BubbleVanillaComponentImpl = forwardRef(({ as, className, css, style, size, variant, noAnimation, ...props }, ref) => {
10
8
  const Component = as || "div";
11
- const { colors } = useVanillaExtractTheme();
12
- const { style: cssStyles, vars } = processCSSProp(css, colors);
13
- const mergedStyles = {
14
- ...cssStyles,
15
- ...style,
16
- ...assignInlineVars(vars)
17
- };
9
+ const mergedStyles = useInlineStyle(css, style);
18
10
  const recipeClass = bubbleRecipe({
19
11
  size,
20
12
  variant,
@@ -1 +1 @@
1
- {"version":3,"file":"Bubble.vanilla.js","names":[],"sources":["../../../components/Bubble/Bubble.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 { bubbleRecipe } from './Bubble.vanilla.css';\n\ntype BubbleRecipeVariants = NonNullable<RecipeVariants<typeof bubbleRecipe>>;\n\ninterface BubbleOwnProps extends BubbleRecipeVariants, CSSProps {}\n\nexport type BubbleVanillaProps<C extends ElementType = 'div'> = PolymorphicComponentProps<\n C,\n BubbleOwnProps\n>;\n\ntype BubbleVanillaComponent = PolymorphicComponent<'div', BubbleVanillaProps<ElementType>>;\n\nconst BubbleVanillaComponentImpl = forwardRef(\n <C extends ElementType = 'div'>(\n { as, className, css, style, size, variant, noAnimation, ...props }: BubbleVanillaProps<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 = bubbleRecipe({ size, variant, noAnimation });\n\n return (\n <Component ref={ref} className={cx(recipeClass, className)} style={mergedStyles} {...props} />\n );\n },\n);\n\nBubbleVanillaComponentImpl.displayName = 'BubbleVanilla';\n\nexport const BubbleVanilla = BubbleVanillaComponentImpl as BubbleVanillaComponent;\n"],"mappings":";;;;;;;;AAyBA,IAAM,6BAA6B,YAE/B,EAAE,IAAI,WAAW,KAAK,OAAO,MAAM,SAAS,aAAa,GAAG,SAC5D,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,aAAa;EAAE;EAAM;EAAS;CAAY,CAAC;CAE/D,OACE,oBAAC,WAAD;EAAgB;EAAK,WAAW,GAAG,aAAa,SAAS;EAAG,OAAO;EAAc,GAAI;CAAQ,CAAA;AAEjG,CACF;AAEA,2BAA2B,cAAc;AAEzC,IAAa,gBAAgB"}
1
+ {"version":3,"file":"Bubble.vanilla.js","names":[],"sources":["../../../components/Bubble/Bubble.vanilla.tsx"],"sourcesContent":["import { ElementType, forwardRef } from 'react';\n\nimport { CSSProps } from '@/styles/cssProps';\nimport { cx } from '@/styles/cx';\nimport {\n PolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef,\n} from '@/styles/polymorphic';\nimport type { RecipeVariantProps } from '@/styles/recipeVariants';\nimport { useInlineStyle } from '@/styles/useInlineStyle';\n\nimport { bubbleRecipe } from './Bubble.vanilla.css';\n\ntype BubbleRecipeVariants = RecipeVariantProps<typeof bubbleRecipe>;\n\ninterface BubbleOwnProps extends BubbleRecipeVariants, CSSProps {}\n\nexport type BubbleVanillaProps<C extends ElementType = 'div'> = PolymorphicComponentProps<\n C,\n BubbleOwnProps\n>;\n\ntype BubbleVanillaComponent = PolymorphicComponent<'div', BubbleVanillaProps<ElementType>>;\n\nconst BubbleVanillaComponentImpl = forwardRef(\n <C extends ElementType = 'div'>(\n { as, className, css, style, size, variant, noAnimation, ...props }: BubbleVanillaProps<C>,\n ref?: PolymorphicRef<C>,\n ) => {\n const Component = as || 'div';\n\n const mergedStyles = useInlineStyle(css, style);\n\n const recipeClass = bubbleRecipe({ size, variant, noAnimation });\n\n return (\n <Component ref={ref} className={cx(recipeClass, className)} style={mergedStyles} {...props} />\n );\n },\n);\n\nBubbleVanillaComponentImpl.displayName = 'BubbleVanilla';\n\nexport const BubbleVanilla = BubbleVanillaComponentImpl as BubbleVanillaComponent;\n"],"mappings":";;;;;;AAyBA,IAAM,6BAA6B,YAE/B,EAAE,IAAI,WAAW,KAAK,OAAO,MAAM,SAAS,aAAa,GAAG,SAC5D,QACG;CACH,MAAM,YAAY,MAAM;CAExB,MAAM,eAAe,eAAe,KAAK,KAAK;CAE9C,MAAM,cAAc,aAAa;EAAE;EAAM;EAAS;CAAY,CAAC;CAE/D,OACE,oBAAC,WAAD;EAAgB;EAAK,WAAW,GAAG,aAAa,SAAS;EAAG,OAAO;EAAc,GAAI;CAAQ,CAAA;AAEjG,CACF;AAEA,2BAA2B,cAAc;AAEzC,IAAa,gBAAgB"}
@@ -1,20 +1,12 @@
1
- const require_cssProps = require("../../styles/cssProps.cjs");
2
1
  const require_cx = require("../../styles/cx.cjs");
3
- const require_themeContext = require("../../styles/themeContext.cjs");
2
+ const require_useInlineStyle = require("../../styles/useInlineStyle.cjs");
4
3
  const require_Button_vanilla_css = require("./Button.vanilla.css.cjs");
5
4
  let react = require("react");
6
- let _vanilla_extract_dynamic = require("@vanilla-extract/dynamic");
7
5
  let react_jsx_runtime = require("react/jsx-runtime");
8
6
  // components/Button/Button.vanilla.tsx
9
7
  var ButtonVanillaComponentImpl = (0, react.forwardRef)(({ as, className, css, style, size, variant, state, ghost, rounded, ...props }, ref) => {
10
8
  const Component = as || "button";
11
- const { colors } = require_themeContext.useVanillaExtractTheme();
12
- const { style: cssStyles, vars } = require_cssProps.processCSSProp(css, colors);
13
- const mergedStyles = {
14
- ...cssStyles,
15
- ...style,
16
- ...(0, _vanilla_extract_dynamic.assignInlineVars)(vars)
17
- };
9
+ const mergedStyles = require_useInlineStyle.useInlineStyle(css, style);
18
10
  const recipeClass = require_Button_vanilla_css.buttonRecipe({
19
11
  size,
20
12
  variant,
@@ -1 +1 @@
1
- {"version":3,"file":"Button.vanilla.cjs","names":["forwardRef","useVanillaExtractTheme","processCSSProp","assignInlineVars","buttonRecipe","cx"],"sources":["../../../components/Button/Button.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 { buttonRecipe } from './Button.vanilla.css';\n\ntype ButtonRecipeVariants = RecipeVariants<typeof buttonRecipe>;\n\ninterface ButtonOwnProps extends Omit<ButtonRecipeVariants, never>, CSSProps {}\n\nexport type ButtonVanillaProps<C extends ElementType = 'button'> = PolymorphicComponentProps<\n C,\n ButtonOwnProps\n>;\n\ntype ButtonVanillaComponent = PolymorphicComponent<'button', ButtonVanillaProps<ElementType>>;\n\nconst ButtonVanillaComponentImpl = forwardRef(\n <C extends ElementType = 'button'>(\n {\n as,\n className,\n css,\n style,\n size,\n variant,\n state,\n ghost,\n rounded,\n ...props\n }: ButtonVanillaProps<C>,\n ref?: PolymorphicRef<C>,\n ) => {\n const Component = as || 'button';\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 = buttonRecipe({ size, variant, state, ghost, rounded });\n\n return (\n <Component ref={ref} className={cx(recipeClass, className)} style={mergedStyles} {...props} />\n );\n },\n);\n\nButtonVanillaComponentImpl.displayName = 'ButtonVanilla';\n\nexport const ButtonVanilla = ButtonVanillaComponentImpl as ButtonVanillaComponent;\n"],"mappings":";;;;;;;;AAyBA,IAAM,8BAAA,GAA6BA,MAAAA,WAAAA,EAE/B,EACE,IACA,WACA,KACA,OACA,MACA,SACA,OACA,OACA,SACA,GAAG,SAEL,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,2BAAAA,aAAa;EAAE;EAAM;EAAS;EAAO;EAAO;CAAQ,CAAC;CAEzE,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,WAAD;EAAgB;EAAK,WAAWC,WAAAA,GAAG,aAAa,SAAS;EAAG,OAAO;EAAc,GAAI;CAAQ,CAAA;AAEjG,CACF;AAEA,2BAA2B,cAAc;AAEzC,IAAa,gBAAgB"}
1
+ {"version":3,"file":"Button.vanilla.cjs","names":["forwardRef","useInlineStyle","buttonRecipe","cx"],"sources":["../../../components/Button/Button.vanilla.tsx"],"sourcesContent":["import { ElementType, forwardRef } from 'react';\n\nimport { CSSProps } from '@/styles/cssProps';\nimport { cx } from '@/styles/cx';\nimport {\n PolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef,\n} from '@/styles/polymorphic';\nimport type { RecipeVariantProps } from '@/styles/recipeVariants';\nimport { useInlineStyle } from '@/styles/useInlineStyle';\n\nimport { buttonRecipe } from './Button.vanilla.css';\n\ntype ButtonRecipeVariants = RecipeVariantProps<typeof buttonRecipe>;\n\ninterface ButtonOwnProps extends ButtonRecipeVariants, CSSProps {}\n\nexport type ButtonVanillaProps<C extends ElementType = 'button'> = PolymorphicComponentProps<\n C,\n ButtonOwnProps\n>;\n\ntype ButtonVanillaComponent = PolymorphicComponent<'button', ButtonVanillaProps<ElementType>>;\n\nconst ButtonVanillaComponentImpl = forwardRef(\n <C extends ElementType = 'button'>(\n {\n as,\n className,\n css,\n style,\n size,\n variant,\n state,\n ghost,\n rounded,\n ...props\n }: ButtonVanillaProps<C>,\n ref?: PolymorphicRef<C>,\n ) => {\n const Component = as || 'button';\n\n const mergedStyles = useInlineStyle(css, style);\n\n const recipeClass = buttonRecipe({ size, variant, state, ghost, rounded });\n\n return (\n <Component ref={ref} className={cx(recipeClass, className)} style={mergedStyles} {...props} />\n );\n },\n);\n\nButtonVanillaComponentImpl.displayName = 'ButtonVanilla';\n\nexport const ButtonVanilla = ButtonVanillaComponentImpl as ButtonVanillaComponent;\n"],"mappings":";;;;;;AAyBA,IAAM,8BAAA,GAA6BA,MAAAA,WAAAA,EAE/B,EACE,IACA,WACA,KACA,OACA,MACA,SACA,OACA,OACA,SACA,GAAG,SAEL,QACG;CACH,MAAM,YAAY,MAAM;CAExB,MAAM,eAAeC,uBAAAA,eAAe,KAAK,KAAK;CAE9C,MAAM,cAAcC,2BAAAA,aAAa;EAAE;EAAM;EAAS;EAAO;EAAO;CAAQ,CAAC;CAEzE,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,WAAD;EAAgB;EAAK,WAAWC,WAAAA,GAAG,aAAa,SAAS;EAAG,OAAO;EAAc,GAAI;CAAQ,CAAA;AAEjG,CACF;AAEA,2BAA2B,cAAc;AAEzC,IAAa,gBAAgB"}
@@ -1 +1 @@
1
- {"version":3,"file":"Button.vanilla.css.cjs","names":["_7a468"],"sources":["../../../components/Button/Button.vanilla.css.ts"],"sourcesContent":["import { keyframes, style } from '@vanilla-extract/css';\nimport { recipe, RecipeVariants } from '@vanilla-extract/recipes';\n\nimport { tokens } from '../../styles/tokens.css';\n\n// Background size constants for waiting animation\nconst BG_SIZES = {\n small: tokens.sizes['8'],\n medium: tokens.sizes['9'],\n large: tokens.sizes['10'],\n};\n\n// Keyframe animation for waiting state\nconst backgroundSlide = keyframes({\n '100%': { transform: `translateX(${tokens.sizes['9']})` },\n});\n\nconst backgroundSlideSmall = keyframes({\n '100%': { transform: `translateX(${tokens.sizes['8']})` },\n});\n\nconst backgroundSlideLarge = keyframes({\n '100%': { transform: `translateX(${tokens.sizes['10']})` },\n});\n\n// Base button styles\nconst baseButton = style({\n // Reset\n appearance: 'none',\n all: 'unset',\n boxSizing: 'border-box',\n border: 'none',\n WebkitTapHighlightColor: 'rgba(0,0,0,0)',\n\n // Layout\n display: 'inline-flex',\n alignItems: 'center',\n justifyContent: 'center',\n flexShrink: 0,\n position: 'relative',\n overflow: 'hidden',\n\n // Typography\n fontFamily: tokens.fonts.rubik,\n fontWeight: tokens.fontWeights.medium,\n fontVariantNumeric: 'tabular-nums',\n lineHeight: '1',\n\n // Pseudo-elements for hover/active effects\n selectors: {\n '&::before': {\n boxSizing: 'border-box',\n content: '\"\"',\n position: 'absolute',\n inset: 0,\n },\n '&::after': {\n boxSizing: 'border-box',\n content: '\"\"',\n position: 'absolute',\n inset: 0,\n },\n '&:disabled': {\n pointerEvents: 'none',\n opacity: 0.5,\n },\n '&:focus-visible': {\n boxShadow: `inset 0 0 0 2px ${tokens.colors.focusOutline}`,\n },\n '&:focus-visible::before': {\n backgroundColor: 'rgba(255, 255, 255, 0.15)',\n },\n '&:focus-visible::after': {\n opacity: 0.15,\n },\n '&:active::before': {\n backgroundColor: 'rgba(0, 0, 0, 0.15)',\n },\n },\n\n '@media': {\n '(hover: hover)': {\n selectors: {\n '&:hover': {\n cursor: 'pointer',\n },\n '&:hover::before': {\n backgroundColor: 'rgba(255, 255, 255, 0.15)',\n },\n '&:hover::after': {\n opacity: 0.05,\n },\n },\n },\n },\n});\n\nexport const buttonRecipe = recipe({\n base: baseButton,\n\n variants: {\n size: {\n small: {\n borderRadius: tokens.radii.button,\n height: tokens.sizes['5'],\n paddingLeft: tokens.space['2'],\n paddingRight: tokens.space['2'],\n fontSize: tokens.fontSizes['1'],\n lineHeight: tokens.sizes['5'],\n },\n medium: {\n borderRadius: tokens.radii.button,\n height: tokens.sizes['6'],\n paddingLeft: tokens.space['3'],\n paddingRight: tokens.space['3'],\n fontSize: tokens.fontSizes['3'],\n lineHeight: tokens.sizes['6'],\n },\n large: {\n borderRadius: tokens.radii.button,\n height: tokens.sizes['7'],\n paddingLeft: tokens.space['3'],\n paddingRight: tokens.space['3'],\n fontSize: tokens.fontSizes['3'],\n lineHeight: tokens.sizes['7'],\n },\n },\n variant: {\n primary: {\n backgroundColor: tokens.colors.primary,\n color: tokens.colors.buttonPrimaryText,\n selectors: {\n '&:focus-visible': {\n boxShadow: `inset 0 0 0 2px ${tokens.colors.buttonPrimaryFocusBorder}`,\n },\n },\n '@media': {\n '(hover: hover)': {\n selectors: {\n '&:hover::after': {\n backgroundColor: tokens.colors.primary,\n },\n },\n },\n },\n },\n secondary: {\n backgroundColor: tokens.colors.buttonSecondaryBg,\n color: tokens.colors.buttonSecondaryText,\n boxShadow: `inset 0 0 0 2px ${tokens.colors.buttonSecondaryBorder}`,\n selectors: {\n '&:active': {\n boxShadow: `inset 0 0 0 1px ${tokens.colors.buttonSecondaryBorder}`,\n },\n '&:focus-visible': {\n boxShadow: `inset 0 0 0 2px ${tokens.colors.buttonSecondaryFocusBorder}`,\n },\n },\n '@media': {\n '(hover: hover)': {\n selectors: {\n '&:hover::after': {\n backgroundColor: tokens.colors.primary,\n },\n },\n },\n },\n },\n red: {\n backgroundColor: tokens.colors.buttonRedBg,\n color: tokens.colors.buttonRedText,\n selectors: {\n '&:focus-visible': {\n boxShadow: `inset 0 0 0 2px ${tokens.colors.buttonRedFocusBg}`,\n },\n },\n },\n },\n state: {\n active: {\n backgroundColor: tokens.colors.deepBlue['5'],\n color: tokens.colors.deepBlue['11'],\n selectors: {\n '&:active': {\n backgroundColor: tokens.colors.deepBlue['5'],\n },\n },\n },\n waiting: {\n backgroundColor: tokens.colors.deepBlue['3'],\n boxShadow: `inset 0 0 0 1px ${tokens.colors.deepBlue['4']}`,\n color: 'transparent',\n overflow: 'hidden',\n pointerEvents: 'none',\n selectors: {\n '&::after': {\n left: '-100%',\n width: '200%',\n backgroundSize: BG_SIZES.medium,\n backgroundImage: `linear-gradient(\n -45deg,\n transparent 33%,\n ${tokens.colors.deepBlue['4']} 33%,\n ${tokens.colors.deepBlue['4']} 66%,\n transparent 66%\n )`,\n animation: `${backgroundSlide} 500ms linear infinite`,\n },\n },\n },\n },\n ghost: {\n true: {\n boxShadow: 'none',\n '@media': {\n '(hover: hover)': {\n selectors: {\n '&:hover': {\n boxShadow: 'none',\n },\n },\n },\n },\n },\n },\n rounded: {\n true: {\n borderRadius: tokens.radii.pill,\n },\n },\n },\n\n compoundVariants: [\n // Primary + Ghost\n {\n variants: { variant: 'primary', ghost: true },\n style: {\n color: tokens.colors.primary,\n backgroundColor: 'transparent',\n '@media': {\n '(hover: hover)': {\n selectors: {\n '&:hover': {\n color: tokens.colors.buttonPrimaryGhostHoverText,\n backgroundColor: 'transparent',\n },\n },\n },\n },\n },\n },\n // Primary + Active\n {\n variants: { variant: 'primary', state: 'active' },\n style: {\n backgroundColor: tokens.colors.buttonPrimaryFocusBg,\n color: tokens.colors.buttonPrimaryText,\n boxShadow: 'inset 0 0 0 2px white',\n },\n },\n // Secondary + Waiting\n {\n variants: { variant: 'secondary', state: 'waiting' },\n style: {\n backgroundColor: tokens.colors.deepBlue['3'],\n color: 'transparent',\n },\n },\n // Secondary + Ghost\n {\n variants: { variant: 'secondary', ghost: true },\n style: {\n backgroundColor: 'transparent',\n color: tokens.colors.buttonSecondaryText,\n boxShadow: 'none',\n },\n },\n // Red + Waiting\n {\n variants: { variant: 'red', state: 'waiting' },\n style: {\n backgroundColor: tokens.colors.deepBlue['3'],\n color: 'transparent',\n },\n },\n // Red + Active\n {\n variants: { variant: 'red', state: 'active' },\n style: {\n backgroundColor: tokens.colors.buttonRedFocusBg,\n color: tokens.colors.buttonRedText,\n boxShadow: 'inset 0 0 0 2px white',\n },\n },\n // Red + Ghost\n {\n variants: { variant: 'red', ghost: true },\n style: {\n color: tokens.colors.buttonRedBg,\n backgroundColor: 'transparent',\n '@media': {\n '(hover: hover)': {\n selectors: {\n '&:hover': {\n color: tokens.colors.buttonRedHoverText,\n backgroundColor: 'transparent',\n },\n },\n },\n },\n },\n },\n // Small + Waiting (specific animation)\n {\n variants: { size: 'small', state: 'waiting' },\n style: {\n selectors: {\n '&::after': {\n backgroundSize: BG_SIZES.small,\n animation: `${backgroundSlideSmall} 500ms linear infinite`,\n },\n },\n },\n },\n // Large + Waiting (specific animation)\n {\n variants: { size: 'large', state: 'waiting' },\n style: {\n selectors: {\n '&::after': {\n backgroundSize: BG_SIZES.large,\n animation: `${backgroundSlideLarge} 500ms linear infinite`,\n },\n },\n },\n },\n ],\n\n defaultVariants: {\n size: 'medium',\n variant: 'primary',\n },\n});\n\nexport type ButtonRecipeVariants = RecipeVariants<typeof buttonRecipe>;\n"],"mappings":""}
1
+ {"version":3,"file":"Button.vanilla.css.cjs","names":[],"sources":[],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"Button.vanilla.css.js","names":["_7a468"],"sources":["../../../components/Button/Button.vanilla.css.ts"],"sourcesContent":["import { keyframes, style } from '@vanilla-extract/css';\nimport { recipe, RecipeVariants } from '@vanilla-extract/recipes';\n\nimport { tokens } from '../../styles/tokens.css';\n\n// Background size constants for waiting animation\nconst BG_SIZES = {\n small: tokens.sizes['8'],\n medium: tokens.sizes['9'],\n large: tokens.sizes['10'],\n};\n\n// Keyframe animation for waiting state\nconst backgroundSlide = keyframes({\n '100%': { transform: `translateX(${tokens.sizes['9']})` },\n});\n\nconst backgroundSlideSmall = keyframes({\n '100%': { transform: `translateX(${tokens.sizes['8']})` },\n});\n\nconst backgroundSlideLarge = keyframes({\n '100%': { transform: `translateX(${tokens.sizes['10']})` },\n});\n\n// Base button styles\nconst baseButton = style({\n // Reset\n appearance: 'none',\n all: 'unset',\n boxSizing: 'border-box',\n border: 'none',\n WebkitTapHighlightColor: 'rgba(0,0,0,0)',\n\n // Layout\n display: 'inline-flex',\n alignItems: 'center',\n justifyContent: 'center',\n flexShrink: 0,\n position: 'relative',\n overflow: 'hidden',\n\n // Typography\n fontFamily: tokens.fonts.rubik,\n fontWeight: tokens.fontWeights.medium,\n fontVariantNumeric: 'tabular-nums',\n lineHeight: '1',\n\n // Pseudo-elements for hover/active effects\n selectors: {\n '&::before': {\n boxSizing: 'border-box',\n content: '\"\"',\n position: 'absolute',\n inset: 0,\n },\n '&::after': {\n boxSizing: 'border-box',\n content: '\"\"',\n position: 'absolute',\n inset: 0,\n },\n '&:disabled': {\n pointerEvents: 'none',\n opacity: 0.5,\n },\n '&:focus-visible': {\n boxShadow: `inset 0 0 0 2px ${tokens.colors.focusOutline}`,\n },\n '&:focus-visible::before': {\n backgroundColor: 'rgba(255, 255, 255, 0.15)',\n },\n '&:focus-visible::after': {\n opacity: 0.15,\n },\n '&:active::before': {\n backgroundColor: 'rgba(0, 0, 0, 0.15)',\n },\n },\n\n '@media': {\n '(hover: hover)': {\n selectors: {\n '&:hover': {\n cursor: 'pointer',\n },\n '&:hover::before': {\n backgroundColor: 'rgba(255, 255, 255, 0.15)',\n },\n '&:hover::after': {\n opacity: 0.05,\n },\n },\n },\n },\n});\n\nexport const buttonRecipe = recipe({\n base: baseButton,\n\n variants: {\n size: {\n small: {\n borderRadius: tokens.radii.button,\n height: tokens.sizes['5'],\n paddingLeft: tokens.space['2'],\n paddingRight: tokens.space['2'],\n fontSize: tokens.fontSizes['1'],\n lineHeight: tokens.sizes['5'],\n },\n medium: {\n borderRadius: tokens.radii.button,\n height: tokens.sizes['6'],\n paddingLeft: tokens.space['3'],\n paddingRight: tokens.space['3'],\n fontSize: tokens.fontSizes['3'],\n lineHeight: tokens.sizes['6'],\n },\n large: {\n borderRadius: tokens.radii.button,\n height: tokens.sizes['7'],\n paddingLeft: tokens.space['3'],\n paddingRight: tokens.space['3'],\n fontSize: tokens.fontSizes['3'],\n lineHeight: tokens.sizes['7'],\n },\n },\n variant: {\n primary: {\n backgroundColor: tokens.colors.primary,\n color: tokens.colors.buttonPrimaryText,\n selectors: {\n '&:focus-visible': {\n boxShadow: `inset 0 0 0 2px ${tokens.colors.buttonPrimaryFocusBorder}`,\n },\n },\n '@media': {\n '(hover: hover)': {\n selectors: {\n '&:hover::after': {\n backgroundColor: tokens.colors.primary,\n },\n },\n },\n },\n },\n secondary: {\n backgroundColor: tokens.colors.buttonSecondaryBg,\n color: tokens.colors.buttonSecondaryText,\n boxShadow: `inset 0 0 0 2px ${tokens.colors.buttonSecondaryBorder}`,\n selectors: {\n '&:active': {\n boxShadow: `inset 0 0 0 1px ${tokens.colors.buttonSecondaryBorder}`,\n },\n '&:focus-visible': {\n boxShadow: `inset 0 0 0 2px ${tokens.colors.buttonSecondaryFocusBorder}`,\n },\n },\n '@media': {\n '(hover: hover)': {\n selectors: {\n '&:hover::after': {\n backgroundColor: tokens.colors.primary,\n },\n },\n },\n },\n },\n red: {\n backgroundColor: tokens.colors.buttonRedBg,\n color: tokens.colors.buttonRedText,\n selectors: {\n '&:focus-visible': {\n boxShadow: `inset 0 0 0 2px ${tokens.colors.buttonRedFocusBg}`,\n },\n },\n },\n },\n state: {\n active: {\n backgroundColor: tokens.colors.deepBlue['5'],\n color: tokens.colors.deepBlue['11'],\n selectors: {\n '&:active': {\n backgroundColor: tokens.colors.deepBlue['5'],\n },\n },\n },\n waiting: {\n backgroundColor: tokens.colors.deepBlue['3'],\n boxShadow: `inset 0 0 0 1px ${tokens.colors.deepBlue['4']}`,\n color: 'transparent',\n overflow: 'hidden',\n pointerEvents: 'none',\n selectors: {\n '&::after': {\n left: '-100%',\n width: '200%',\n backgroundSize: BG_SIZES.medium,\n backgroundImage: `linear-gradient(\n -45deg,\n transparent 33%,\n ${tokens.colors.deepBlue['4']} 33%,\n ${tokens.colors.deepBlue['4']} 66%,\n transparent 66%\n )`,\n animation: `${backgroundSlide} 500ms linear infinite`,\n },\n },\n },\n },\n ghost: {\n true: {\n boxShadow: 'none',\n '@media': {\n '(hover: hover)': {\n selectors: {\n '&:hover': {\n boxShadow: 'none',\n },\n },\n },\n },\n },\n },\n rounded: {\n true: {\n borderRadius: tokens.radii.pill,\n },\n },\n },\n\n compoundVariants: [\n // Primary + Ghost\n {\n variants: { variant: 'primary', ghost: true },\n style: {\n color: tokens.colors.primary,\n backgroundColor: 'transparent',\n '@media': {\n '(hover: hover)': {\n selectors: {\n '&:hover': {\n color: tokens.colors.buttonPrimaryGhostHoverText,\n backgroundColor: 'transparent',\n },\n },\n },\n },\n },\n },\n // Primary + Active\n {\n variants: { variant: 'primary', state: 'active' },\n style: {\n backgroundColor: tokens.colors.buttonPrimaryFocusBg,\n color: tokens.colors.buttonPrimaryText,\n boxShadow: 'inset 0 0 0 2px white',\n },\n },\n // Secondary + Waiting\n {\n variants: { variant: 'secondary', state: 'waiting' },\n style: {\n backgroundColor: tokens.colors.deepBlue['3'],\n color: 'transparent',\n },\n },\n // Secondary + Ghost\n {\n variants: { variant: 'secondary', ghost: true },\n style: {\n backgroundColor: 'transparent',\n color: tokens.colors.buttonSecondaryText,\n boxShadow: 'none',\n },\n },\n // Red + Waiting\n {\n variants: { variant: 'red', state: 'waiting' },\n style: {\n backgroundColor: tokens.colors.deepBlue['3'],\n color: 'transparent',\n },\n },\n // Red + Active\n {\n variants: { variant: 'red', state: 'active' },\n style: {\n backgroundColor: tokens.colors.buttonRedFocusBg,\n color: tokens.colors.buttonRedText,\n boxShadow: 'inset 0 0 0 2px white',\n },\n },\n // Red + Ghost\n {\n variants: { variant: 'red', ghost: true },\n style: {\n color: tokens.colors.buttonRedBg,\n backgroundColor: 'transparent',\n '@media': {\n '(hover: hover)': {\n selectors: {\n '&:hover': {\n color: tokens.colors.buttonRedHoverText,\n backgroundColor: 'transparent',\n },\n },\n },\n },\n },\n },\n // Small + Waiting (specific animation)\n {\n variants: { size: 'small', state: 'waiting' },\n style: {\n selectors: {\n '&::after': {\n backgroundSize: BG_SIZES.small,\n animation: `${backgroundSlideSmall} 500ms linear infinite`,\n },\n },\n },\n },\n // Large + Waiting (specific animation)\n {\n variants: { size: 'large', state: 'waiting' },\n style: {\n selectors: {\n '&::after': {\n backgroundSize: BG_SIZES.large,\n animation: `${backgroundSlideLarge} 500ms linear infinite`,\n },\n },\n },\n },\n ],\n\n defaultVariants: {\n size: 'medium',\n variant: 'primary',\n },\n});\n\nexport type ButtonRecipeVariants = RecipeVariants<typeof buttonRecipe>;\n"],"mappings":""}
1
+ {"version":3,"file":"Button.vanilla.css.js","names":[],"sources":[],"mappings":""}
@@ -1,20 +1,12 @@
1
- import { processCSSProp } from "../../styles/cssProps.js";
2
1
  import { cx } from "../../styles/cx.js";
3
- import { useVanillaExtractTheme } from "../../styles/themeContext.js";
2
+ import { useInlineStyle } from "../../styles/useInlineStyle.js";
4
3
  import { buttonRecipe } from "./Button.vanilla.css.js";
5
4
  import { forwardRef } from "react";
6
- import { assignInlineVars } from "@vanilla-extract/dynamic";
7
5
  import { jsx } from "react/jsx-runtime";
8
6
  // components/Button/Button.vanilla.tsx
9
7
  var ButtonVanillaComponentImpl = forwardRef(({ as, className, css, style, size, variant, state, ghost, rounded, ...props }, ref) => {
10
8
  const Component = as || "button";
11
- const { colors } = useVanillaExtractTheme();
12
- const { style: cssStyles, vars } = processCSSProp(css, colors);
13
- const mergedStyles = {
14
- ...cssStyles,
15
- ...style,
16
- ...assignInlineVars(vars)
17
- };
9
+ const mergedStyles = useInlineStyle(css, style);
18
10
  const recipeClass = buttonRecipe({
19
11
  size,
20
12
  variant,
@@ -1 +1 @@
1
- {"version":3,"file":"Button.vanilla.js","names":[],"sources":["../../../components/Button/Button.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 { buttonRecipe } from './Button.vanilla.css';\n\ntype ButtonRecipeVariants = RecipeVariants<typeof buttonRecipe>;\n\ninterface ButtonOwnProps extends Omit<ButtonRecipeVariants, never>, CSSProps {}\n\nexport type ButtonVanillaProps<C extends ElementType = 'button'> = PolymorphicComponentProps<\n C,\n ButtonOwnProps\n>;\n\ntype ButtonVanillaComponent = PolymorphicComponent<'button', ButtonVanillaProps<ElementType>>;\n\nconst ButtonVanillaComponentImpl = forwardRef(\n <C extends ElementType = 'button'>(\n {\n as,\n className,\n css,\n style,\n size,\n variant,\n state,\n ghost,\n rounded,\n ...props\n }: ButtonVanillaProps<C>,\n ref?: PolymorphicRef<C>,\n ) => {\n const Component = as || 'button';\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 = buttonRecipe({ size, variant, state, ghost, rounded });\n\n return (\n <Component ref={ref} className={cx(recipeClass, className)} style={mergedStyles} {...props} />\n );\n },\n);\n\nButtonVanillaComponentImpl.displayName = 'ButtonVanilla';\n\nexport const ButtonVanilla = ButtonVanillaComponentImpl as ButtonVanillaComponent;\n"],"mappings":";;;;;;;;AAyBA,IAAM,6BAA6B,YAE/B,EACE,IACA,WACA,KACA,OACA,MACA,SACA,OACA,OACA,SACA,GAAG,SAEL,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,aAAa;EAAE;EAAM;EAAS;EAAO;EAAO;CAAQ,CAAC;CAEzE,OACE,oBAAC,WAAD;EAAgB;EAAK,WAAW,GAAG,aAAa,SAAS;EAAG,OAAO;EAAc,GAAI;CAAQ,CAAA;AAEjG,CACF;AAEA,2BAA2B,cAAc;AAEzC,IAAa,gBAAgB"}
1
+ {"version":3,"file":"Button.vanilla.js","names":[],"sources":["../../../components/Button/Button.vanilla.tsx"],"sourcesContent":["import { ElementType, forwardRef } from 'react';\n\nimport { CSSProps } from '@/styles/cssProps';\nimport { cx } from '@/styles/cx';\nimport {\n PolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef,\n} from '@/styles/polymorphic';\nimport type { RecipeVariantProps } from '@/styles/recipeVariants';\nimport { useInlineStyle } from '@/styles/useInlineStyle';\n\nimport { buttonRecipe } from './Button.vanilla.css';\n\ntype ButtonRecipeVariants = RecipeVariantProps<typeof buttonRecipe>;\n\ninterface ButtonOwnProps extends ButtonRecipeVariants, CSSProps {}\n\nexport type ButtonVanillaProps<C extends ElementType = 'button'> = PolymorphicComponentProps<\n C,\n ButtonOwnProps\n>;\n\ntype ButtonVanillaComponent = PolymorphicComponent<'button', ButtonVanillaProps<ElementType>>;\n\nconst ButtonVanillaComponentImpl = forwardRef(\n <C extends ElementType = 'button'>(\n {\n as,\n className,\n css,\n style,\n size,\n variant,\n state,\n ghost,\n rounded,\n ...props\n }: ButtonVanillaProps<C>,\n ref?: PolymorphicRef<C>,\n ) => {\n const Component = as || 'button';\n\n const mergedStyles = useInlineStyle(css, style);\n\n const recipeClass = buttonRecipe({ size, variant, state, ghost, rounded });\n\n return (\n <Component ref={ref} className={cx(recipeClass, className)} style={mergedStyles} {...props} />\n );\n },\n);\n\nButtonVanillaComponentImpl.displayName = 'ButtonVanilla';\n\nexport const ButtonVanilla = ButtonVanillaComponentImpl as ButtonVanillaComponent;\n"],"mappings":";;;;;;AAyBA,IAAM,6BAA6B,YAE/B,EACE,IACA,WACA,KACA,OACA,MACA,SACA,OACA,OACA,SACA,GAAG,SAEL,QACG;CACH,MAAM,YAAY,MAAM;CAExB,MAAM,eAAe,eAAe,KAAK,KAAK;CAE9C,MAAM,cAAc,aAAa;EAAE;EAAM;EAAS;EAAO;EAAO;CAAQ,CAAC;CAEzE,OACE,oBAAC,WAAD;EAAgB;EAAK,WAAW,GAAG,aAAa,SAAS;EAAG,OAAO;EAAc,GAAI;CAAQ,CAAA;AAEjG,CACF;AAEA,2BAA2B,cAAc;AAEzC,IAAa,gBAAgB"}
@@ -1,23 +1,15 @@
1
1
  const require_runtime = require("../../_virtual/_rolldown/runtime.cjs");
2
- const require_cssProps = require("../../styles/cssProps.cjs");
3
2
  const require_cx = require("../../styles/cx.cjs");
4
- const require_themeContext = require("../../styles/themeContext.cjs");
3
+ const require_useInlineStyle = require("../../styles/useInlineStyle.cjs");
5
4
  const require_ButtonSwitch_vanilla_css = require("./ButtonSwitch.vanilla.css.cjs");
6
5
  let react = require("react");
7
- let _vanilla_extract_dynamic = require("@vanilla-extract/dynamic");
8
6
  let react_jsx_runtime = require("react/jsx-runtime");
9
7
  let _radix_ui_react_toggle_group = require("@radix-ui/react-toggle-group");
10
8
  _radix_ui_react_toggle_group = require_runtime.__toESM(_radix_ui_react_toggle_group, 1);
11
9
  // components/ButtonSwitch/ButtonSwitch.vanilla.tsx
12
10
  var ButtonSwitchContainerVanillaImpl = (0, react.forwardRef)(({ as, className, css, style, children, ...props }, ref) => {
13
11
  const Component = as || "div";
14
- const { colors } = require_themeContext.useVanillaExtractTheme();
15
- const { style: cssStyles, vars } = require_cssProps.processCSSProp(css, colors);
16
- const mergedStyles = {
17
- ...cssStyles,
18
- ...style,
19
- ...(0, _vanilla_extract_dynamic.assignInlineVars)(vars)
20
- };
12
+ const mergedStyles = require_useInlineStyle.useInlineStyle(css, style);
21
13
  if (as) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Component, {
22
14
  ref,
23
15
  className: require_cx.cx(require_ButtonSwitch_vanilla_css.buttonSwitchContainer, className),
@@ -38,13 +30,7 @@ ButtonSwitchContainerVanillaImpl.displayName = "ButtonSwitchContainerVanilla";
38
30
  var ButtonSwitchContainerVanilla = ButtonSwitchContainerVanillaImpl;
39
31
  var ButtonSwitchItemVanillaImpl = (0, react.forwardRef)(({ as, className, css, style, children, ...props }, ref) => {
40
32
  const Component = as || "button";
41
- const { colors } = require_themeContext.useVanillaExtractTheme();
42
- const { style: cssStyles, vars } = require_cssProps.processCSSProp(css, colors);
43
- const mergedStyles = {
44
- ...cssStyles,
45
- ...style,
46
- ...(0, _vanilla_extract_dynamic.assignInlineVars)(vars)
47
- };
33
+ const mergedStyles = require_useInlineStyle.useInlineStyle(css, style);
48
34
  if (as) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Component, {
49
35
  ref,
50
36
  className: require_cx.cx(require_ButtonSwitch_vanilla_css.buttonSwitchItem, className),
@@ -1 +1 @@
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
+ {"version":3,"file":"ButtonSwitch.vanilla.cjs","names":["forwardRef","useInlineStyle","cx","buttonSwitchContainer","ToggleGroupPrimitive","buttonSwitchItem"],"sources":["../../../components/ButtonSwitch/ButtonSwitch.vanilla.tsx"],"sourcesContent":["import * as ToggleGroupPrimitive from '@radix-ui/react-toggle-group';\nimport { ElementType, forwardRef } from 'react';\n\nimport { CSSProps } from '@/styles/cssProps';\nimport { cx } from '@/styles/cx';\nimport {\n PolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef,\n} from '@/styles/polymorphic';\nimport { useInlineStyle } from '@/styles/useInlineStyle';\n\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 mergedStyles = useInlineStyle(css, style);\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 mergedStyles = useInlineStyle(css, style);\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,eAAeC,uBAAAA,eAAe,KAAK,KAAK;CAE9C,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,GAA8BH,MAAAA,WAAAA,EAEhC,EAAE,IAAI,WAAW,KAAK,OAAO,UAAU,GAAG,SAC1C,QACG;CACH,MAAM,YAAa,MAAM;CACzB,MAAM,eAAeC,uBAAAA,eAAe,KAAK,KAAK;CAE9C,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 +1 @@
1
- {"version":3,"file":"ButtonSwitch.vanilla.css.cjs","names":[],"sources":["../../../components/ButtonSwitch/ButtonSwitch.vanilla.css.ts"],"sourcesContent":["import { style } from '@vanilla-extract/css';\n\nimport { tokens } from '../../styles/tokens.css';\n\nexport const buttonSwitchContainer = style({\n display: 'inline-flex',\n backgroundColor: tokens.colors.buttonSwitchContainerBg,\n borderRadius: tokens.radii['3'],\n padding: '3px',\n gap: tokens.space['1'],\n});\n\nexport const buttonSwitchItem = style({\n display: 'inline-flex',\n backgroundColor: tokens.colors.buttonSwitchOffBg,\n color: tokens.colors.buttonSwitchOffColor,\n padding: tokens.space['1'],\n width: tokens.sizes['10'],\n justifyContent: 'center',\n fontWeight: 600,\n border: 'none',\n position: 'relative',\n\n selectors: {\n '&::before': {\n boxSizing: 'border-box',\n content: '\"\"',\n position: 'absolute',\n inset: 0,\n borderRadius: tokens.radii['3'],\n },\n '&::after': {\n boxSizing: 'border-box',\n content: '\"\"',\n position: 'absolute',\n inset: 0,\n borderRadius: tokens.radii['3'],\n },\n '&:focus-visible': {\n borderRadius: tokens.radii['3'],\n },\n '&:focus-visible::before': {\n backgroundColor: 'rgba(255, 255, 255, 0.15)',\n },\n '&:focus-visible::after': {\n opacity: 0.15,\n },\n '&[data-state=on]': {\n backgroundColor: tokens.colors.buttonSwitchActiveBg,\n color: tokens.colors.buttonSwitchActiveColor,\n borderRadius: tokens.radii['3'],\n },\n },\n\n '@media': {\n '(hover: hover)': {\n selectors: {\n '&:hover': {\n cursor: 'pointer',\n },\n '&:hover::before': {\n backgroundColor: 'rgba(255, 255, 255, 0.15)',\n },\n '&:hover::after': {\n opacity: 0.05,\n },\n },\n },\n },\n});\n"],"mappings":""}
1
+ {"version":3,"file":"ButtonSwitch.vanilla.css.cjs","names":[],"sources":[],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"ButtonSwitch.vanilla.css.js","names":[],"sources":["../../../components/ButtonSwitch/ButtonSwitch.vanilla.css.ts"],"sourcesContent":["import { style } from '@vanilla-extract/css';\n\nimport { tokens } from '../../styles/tokens.css';\n\nexport const buttonSwitchContainer = style({\n display: 'inline-flex',\n backgroundColor: tokens.colors.buttonSwitchContainerBg,\n borderRadius: tokens.radii['3'],\n padding: '3px',\n gap: tokens.space['1'],\n});\n\nexport const buttonSwitchItem = style({\n display: 'inline-flex',\n backgroundColor: tokens.colors.buttonSwitchOffBg,\n color: tokens.colors.buttonSwitchOffColor,\n padding: tokens.space['1'],\n width: tokens.sizes['10'],\n justifyContent: 'center',\n fontWeight: 600,\n border: 'none',\n position: 'relative',\n\n selectors: {\n '&::before': {\n boxSizing: 'border-box',\n content: '\"\"',\n position: 'absolute',\n inset: 0,\n borderRadius: tokens.radii['3'],\n },\n '&::after': {\n boxSizing: 'border-box',\n content: '\"\"',\n position: 'absolute',\n inset: 0,\n borderRadius: tokens.radii['3'],\n },\n '&:focus-visible': {\n borderRadius: tokens.radii['3'],\n },\n '&:focus-visible::before': {\n backgroundColor: 'rgba(255, 255, 255, 0.15)',\n },\n '&:focus-visible::after': {\n opacity: 0.15,\n },\n '&[data-state=on]': {\n backgroundColor: tokens.colors.buttonSwitchActiveBg,\n color: tokens.colors.buttonSwitchActiveColor,\n borderRadius: tokens.radii['3'],\n },\n },\n\n '@media': {\n '(hover: hover)': {\n selectors: {\n '&:hover': {\n cursor: 'pointer',\n },\n '&:hover::before': {\n backgroundColor: 'rgba(255, 255, 255, 0.15)',\n },\n '&:hover::after': {\n opacity: 0.05,\n },\n },\n },\n },\n});\n"],"mappings":""}
1
+ {"version":3,"file":"ButtonSwitch.vanilla.css.js","names":[],"sources":[],"mappings":""}
@@ -1,21 +1,13 @@
1
- import { processCSSProp } from "../../styles/cssProps.js";
2
1
  import { cx } from "../../styles/cx.js";
3
- import { useVanillaExtractTheme } from "../../styles/themeContext.js";
2
+ import { useInlineStyle } from "../../styles/useInlineStyle.js";
4
3
  import { buttonSwitchContainer, buttonSwitchItem } from "./ButtonSwitch.vanilla.css.js";
5
4
  import { forwardRef } from "react";
6
- import { assignInlineVars } from "@vanilla-extract/dynamic";
7
5
  import { jsx } from "react/jsx-runtime";
8
6
  import * as ToggleGroupPrimitive from "@radix-ui/react-toggle-group";
9
7
  // components/ButtonSwitch/ButtonSwitch.vanilla.tsx
10
8
  var ButtonSwitchContainerVanillaImpl = forwardRef(({ as, className, css, style, children, ...props }, ref) => {
11
9
  const Component = as || "div";
12
- const { colors } = useVanillaExtractTheme();
13
- const { style: cssStyles, vars } = processCSSProp(css, colors);
14
- const mergedStyles = {
15
- ...cssStyles,
16
- ...style,
17
- ...assignInlineVars(vars)
18
- };
10
+ const mergedStyles = useInlineStyle(css, style);
19
11
  if (as) return /* @__PURE__ */ jsx(Component, {
20
12
  ref,
21
13
  className: cx(buttonSwitchContainer, className),
@@ -36,13 +28,7 @@ ButtonSwitchContainerVanillaImpl.displayName = "ButtonSwitchContainerVanilla";
36
28
  var ButtonSwitchContainerVanilla = ButtonSwitchContainerVanillaImpl;
37
29
  var ButtonSwitchItemVanillaImpl = forwardRef(({ as, className, css, style, children, ...props }, ref) => {
38
30
  const Component = as || "button";
39
- const { colors } = useVanillaExtractTheme();
40
- const { style: cssStyles, vars } = processCSSProp(css, colors);
41
- const mergedStyles = {
42
- ...cssStyles,
43
- ...style,
44
- ...assignInlineVars(vars)
45
- };
31
+ const mergedStyles = useInlineStyle(css, style);
46
32
  if (as) return /* @__PURE__ */ jsx(Component, {
47
33
  ref,
48
34
  className: cx(buttonSwitchItem, className),
@@ -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 { 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
+ {"version":3,"file":"ButtonSwitch.vanilla.js","names":[],"sources":["../../../components/ButtonSwitch/ButtonSwitch.vanilla.tsx"],"sourcesContent":["import * as ToggleGroupPrimitive from '@radix-ui/react-toggle-group';\nimport { ElementType, forwardRef } from 'react';\n\nimport { CSSProps } from '@/styles/cssProps';\nimport { cx } from '@/styles/cx';\nimport {\n PolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef,\n} from '@/styles/polymorphic';\nimport { useInlineStyle } from '@/styles/useInlineStyle';\n\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 mergedStyles = useInlineStyle(css, style);\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 mergedStyles = useInlineStyle(css, style);\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,eAAe,KAAK,KAAK;CAE9C,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,eAAe,KAAK,KAAK;CAE9C,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,21 +1,16 @@
1
- const require_cssProps = require("../../styles/cssProps.cjs");
2
1
  const require_cx = require("../../styles/cx.cjs");
3
- const require_themeContext = require("../../styles/themeContext.cjs");
2
+ const require_recipeVariants = require("../../styles/recipeVariants.cjs");
3
+ const require_useInlineStyle = require("../../styles/useInlineStyle.cjs");
4
4
  const require_Card_vanilla_css = require("./Card.vanilla.css.cjs");
5
5
  let react = require("react");
6
- let _vanilla_extract_dynamic = require("@vanilla-extract/dynamic");
7
6
  let react_jsx_runtime = require("react/jsx-runtime");
8
7
  // components/Card/Card.vanilla.tsx
8
+ var cardClass = require_recipeVariants.withVariantKeys(require_Card_vanilla_css.cardRecipe);
9
+ var interactiveCardClass = require_recipeVariants.withVariantKeys(require_Card_vanilla_css.interactiveCardRecipe);
9
10
  var CardVanillaComponentImpl = (0, react.forwardRef)(({ as, className, css, style, elevation, variant, active, interactive, ...props }, ref) => {
10
11
  const Component = as || (interactive ? "button" : "div");
11
- const { colors } = require_themeContext.useVanillaExtractTheme();
12
- const { style: cssStyles, vars } = require_cssProps.processCSSProp(css, colors);
13
- const mergedStyles = {
14
- ...cssStyles,
15
- ...style,
16
- ...(0, _vanilla_extract_dynamic.assignInlineVars)(vars)
17
- };
18
- const recipeClass = (interactive ? require_Card_vanilla_css.interactiveCardRecipe : require_Card_vanilla_css.cardRecipe)({
12
+ const mergedStyles = require_useInlineStyle.useInlineStyle(css, style);
13
+ const recipeClass = (interactive ? interactiveCardClass : cardClass)({
19
14
  elevation,
20
15
  variant,
21
16
  active
@@ -1 +1 @@
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
+ {"version":3,"file":"Card.vanilla.cjs","names":["withVariantKeys","cardRecipe","interactiveCardRecipe","forwardRef","useInlineStyle","cx"],"sources":["../../../components/Card/Card.vanilla.tsx"],"sourcesContent":["import { ElementType, forwardRef } from 'react';\n\nimport { CSSProps } from '@/styles/cssProps';\nimport { cx } from '@/styles/cx';\nimport {\n PolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef,\n} from '@/styles/polymorphic';\nimport { RecipeVariantProps, withVariantKeys } from '@/styles/recipeVariants';\nimport { useInlineStyle } from '@/styles/useInlineStyle';\n\nimport { cardRecipe, interactiveCardRecipe } from './Card.vanilla.css';\n\nconst cardClass = withVariantKeys(cardRecipe);\nconst interactiveCardClass = withVariantKeys(interactiveCardRecipe);\n\ntype CardRecipeVariants = RecipeVariantProps<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 mergedStyles = useInlineStyle(css, style);\n\n const recipe = interactive ? interactiveCardClass : cardClass;\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":";;;;;;;AAcA,IAAM,YAAYA,uBAAAA,gBAAgBC,yBAAAA,UAAU;AAC5C,IAAM,uBAAuBD,uBAAAA,gBAAgBE,yBAAAA,qBAAqB;AAkBlE,IAAM,4BAAA,GAA2BC,MAAAA,WAAAA,EAE7B,EACE,IACA,WACA,KACA,OACA,WACA,SACA,QACA,aACA,GAAG,SAEL,QACG;CACH,MAAM,YAAY,OAAO,cAAc,WAAW;CAClD,MAAM,eAAeC,uBAAAA,eAAe,KAAK,KAAK;CAG9C,MAAM,eADS,cAAc,uBAAuB,UAAA,CACzB;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 +1 @@
1
- {"version":3,"file":"Card.vanilla.css.cjs","names":["_7a468"],"sources":["../../../components/Card/Card.vanilla.css.ts"],"sourcesContent":["import { style } from '@vanilla-extract/css';\nimport { recipe } from '@vanilla-extract/recipes';\n\nimport { breakpoints } from '../../styles/breakpoints.css';\nimport { tokens } from '../../styles/tokens.css';\n\n// Elevation variants matching Elevation component\nconst elevationVariants = {\n 0: {\n boxShadow: 'none',\n },\n 1: {\n backgroundColor: tokens.colors['01dp'],\n boxShadow:\n '0 1px 5px 0 hsla(0, 0%, 0%, 0.2), 0 3px 1px -2px hsla(0, 0%, 0%, 0.12), 0 2px 2px 0 hsla(0, 0%, 0%, 0.14)',\n },\n 2: {\n backgroundColor: tokens.colors['02dp'],\n boxShadow:\n '0 2px 4px -1px hsla(0, 0%, 0%, 0.2), 0 1px 10px 0 hsla(0, 0%, 0%, 0.12), 0 4px 5px 0 hsla(0, 0%, 0%, 0.14)',\n },\n 3: {\n backgroundColor: tokens.colors['03dp'],\n boxShadow:\n '0 3px 5px -1px hsla(0, 0%, 0%, 0.2), 0 1px 18px 0 hsla(0, 0%, 0%, 0.12), 0 6px 10px 0 hsla(0, 0%, 0%, 0.14)',\n },\n 4: {\n backgroundColor: tokens.colors['04dp'],\n boxShadow:\n '0 7px 8px -4px hsla(0, 0%, 0%, 0.2), 0 5px 22px 4px hsla(0, 0%, 0%, 0.12), 0 12px 17px 2px hsla(0, 0%, 0%, 0.14)',\n },\n 5: {\n backgroundColor: tokens.colors['05dp'],\n boxShadow:\n '0 11px 15px -7px hsla(0, 0%, 0%, 0.2), 0 9px 46px 8px hsla(0, 0%, 0%, 0.12), 0 24px 38px 3px hsla(0, 0%, 0%, 0.14)',\n },\n} as const;\n\n// Base card styles\nconst cardBase = style({\n appearance: 'none',\n border: 'none',\n boxSizing: 'border-box',\n font: 'inherit',\n lineHeight: '1',\n outline: 'none',\n padding: tokens.space['3'],\n textAlign: 'inherit',\n verticalAlign: 'middle',\n WebkitTapHighlightColor: 'rgba(0, 0, 0, 0)',\n backgroundColor: tokens.colors.cardBackground,\n display: 'block',\n textDecoration: 'none',\n color: 'inherit',\n borderRadius: tokens.radii['3'],\n position: 'relative',\n\n '::before': {\n boxSizing: 'border-box',\n content: '\"\"',\n position: 'absolute',\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n borderRadius: tokens.radii['3'],\n pointerEvents: 'none',\n },\n});\n\nexport const cardRecipe = recipe({\n base: cardBase,\n\n variants: {\n elevation: elevationVariants,\n variant: {\n inner: {\n backgroundColor: tokens.colors.innerCardBgColor,\n },\n ghost: {\n backgroundColor: 'transparent',\n boxShadow: 'none',\n },\n },\n active: {\n true: {\n '::before': {\n outline: `1px solid ${tokens.colors.cardActiveBorder}`,\n backgroundColor: tokens.colors.cardActiveBackground,\n },\n },\n },\n },\n\n defaultVariants: {\n elevation: 1,\n },\n});\n\n// Interactive card styles (for button element)\nconst interactiveCardBase = style([\n cardBase,\n {\n '@media': {\n [breakpoints.hover]: {\n selectors: {\n '&:hover': {\n cursor: 'pointer',\n },\n '&:hover::before': {\n outline: `1px solid ${tokens.colors.cardHoverBorder}`,\n backgroundColor: tokens.colors.cardHoverBackground,\n },\n },\n },\n },\n selectors: {\n '&:focus': {\n outline: `2px solid ${tokens.colors.primary}`,\n },\n '&:active::before': {\n outline: `1px solid ${tokens.colors.cardActiveBorder}`,\n backgroundColor: tokens.colors.cardActiveBackground,\n },\n },\n },\n]);\n\nexport const interactiveCardRecipe = recipe({\n base: interactiveCardBase,\n\n variants: {\n elevation: elevationVariants,\n variant: {\n inner: {\n backgroundColor: tokens.colors.innerCardBgColor,\n },\n ghost: {\n backgroundColor: 'transparent',\n boxShadow: 'none',\n },\n },\n active: {\n true: {\n '::before': {\n outline: `1px solid ${tokens.colors.cardActiveBorder}`,\n backgroundColor: tokens.colors.cardActiveBackground,\n },\n },\n },\n },\n\n defaultVariants: {\n elevation: 1,\n },\n});\n"],"mappings":""}
1
+ {"version":3,"file":"Card.vanilla.css.cjs","names":[],"sources":[],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"Card.vanilla.css.js","names":["_7a468"],"sources":["../../../components/Card/Card.vanilla.css.ts"],"sourcesContent":["import { style } from '@vanilla-extract/css';\nimport { recipe } from '@vanilla-extract/recipes';\n\nimport { breakpoints } from '../../styles/breakpoints.css';\nimport { tokens } from '../../styles/tokens.css';\n\n// Elevation variants matching Elevation component\nconst elevationVariants = {\n 0: {\n boxShadow: 'none',\n },\n 1: {\n backgroundColor: tokens.colors['01dp'],\n boxShadow:\n '0 1px 5px 0 hsla(0, 0%, 0%, 0.2), 0 3px 1px -2px hsla(0, 0%, 0%, 0.12), 0 2px 2px 0 hsla(0, 0%, 0%, 0.14)',\n },\n 2: {\n backgroundColor: tokens.colors['02dp'],\n boxShadow:\n '0 2px 4px -1px hsla(0, 0%, 0%, 0.2), 0 1px 10px 0 hsla(0, 0%, 0%, 0.12), 0 4px 5px 0 hsla(0, 0%, 0%, 0.14)',\n },\n 3: {\n backgroundColor: tokens.colors['03dp'],\n boxShadow:\n '0 3px 5px -1px hsla(0, 0%, 0%, 0.2), 0 1px 18px 0 hsla(0, 0%, 0%, 0.12), 0 6px 10px 0 hsla(0, 0%, 0%, 0.14)',\n },\n 4: {\n backgroundColor: tokens.colors['04dp'],\n boxShadow:\n '0 7px 8px -4px hsla(0, 0%, 0%, 0.2), 0 5px 22px 4px hsla(0, 0%, 0%, 0.12), 0 12px 17px 2px hsla(0, 0%, 0%, 0.14)',\n },\n 5: {\n backgroundColor: tokens.colors['05dp'],\n boxShadow:\n '0 11px 15px -7px hsla(0, 0%, 0%, 0.2), 0 9px 46px 8px hsla(0, 0%, 0%, 0.12), 0 24px 38px 3px hsla(0, 0%, 0%, 0.14)',\n },\n} as const;\n\n// Base card styles\nconst cardBase = style({\n appearance: 'none',\n border: 'none',\n boxSizing: 'border-box',\n font: 'inherit',\n lineHeight: '1',\n outline: 'none',\n padding: tokens.space['3'],\n textAlign: 'inherit',\n verticalAlign: 'middle',\n WebkitTapHighlightColor: 'rgba(0, 0, 0, 0)',\n backgroundColor: tokens.colors.cardBackground,\n display: 'block',\n textDecoration: 'none',\n color: 'inherit',\n borderRadius: tokens.radii['3'],\n position: 'relative',\n\n '::before': {\n boxSizing: 'border-box',\n content: '\"\"',\n position: 'absolute',\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n borderRadius: tokens.radii['3'],\n pointerEvents: 'none',\n },\n});\n\nexport const cardRecipe = recipe({\n base: cardBase,\n\n variants: {\n elevation: elevationVariants,\n variant: {\n inner: {\n backgroundColor: tokens.colors.innerCardBgColor,\n },\n ghost: {\n backgroundColor: 'transparent',\n boxShadow: 'none',\n },\n },\n active: {\n true: {\n '::before': {\n outline: `1px solid ${tokens.colors.cardActiveBorder}`,\n backgroundColor: tokens.colors.cardActiveBackground,\n },\n },\n },\n },\n\n defaultVariants: {\n elevation: 1,\n },\n});\n\n// Interactive card styles (for button element)\nconst interactiveCardBase = style([\n cardBase,\n {\n '@media': {\n [breakpoints.hover]: {\n selectors: {\n '&:hover': {\n cursor: 'pointer',\n },\n '&:hover::before': {\n outline: `1px solid ${tokens.colors.cardHoverBorder}`,\n backgroundColor: tokens.colors.cardHoverBackground,\n },\n },\n },\n },\n selectors: {\n '&:focus': {\n outline: `2px solid ${tokens.colors.primary}`,\n },\n '&:active::before': {\n outline: `1px solid ${tokens.colors.cardActiveBorder}`,\n backgroundColor: tokens.colors.cardActiveBackground,\n },\n },\n },\n]);\n\nexport const interactiveCardRecipe = recipe({\n base: interactiveCardBase,\n\n variants: {\n elevation: elevationVariants,\n variant: {\n inner: {\n backgroundColor: tokens.colors.innerCardBgColor,\n },\n ghost: {\n backgroundColor: 'transparent',\n boxShadow: 'none',\n },\n },\n active: {\n true: {\n '::before': {\n outline: `1px solid ${tokens.colors.cardActiveBorder}`,\n backgroundColor: tokens.colors.cardActiveBackground,\n },\n },\n },\n },\n\n defaultVariants: {\n elevation: 1,\n },\n});\n"],"mappings":""}
1
+ {"version":3,"file":"Card.vanilla.css.js","names":[],"sources":[],"mappings":""}
@@ -1,21 +1,16 @@
1
- import { processCSSProp } from "../../styles/cssProps.js";
2
1
  import { cx } from "../../styles/cx.js";
3
- import { useVanillaExtractTheme } from "../../styles/themeContext.js";
2
+ import { withVariantKeys } from "../../styles/recipeVariants.js";
3
+ import { useInlineStyle } from "../../styles/useInlineStyle.js";
4
4
  import { cardRecipe, interactiveCardRecipe } from "./Card.vanilla.css.js";
5
5
  import { forwardRef } from "react";
6
- import { assignInlineVars } from "@vanilla-extract/dynamic";
7
6
  import { jsx } from "react/jsx-runtime";
8
7
  // components/Card/Card.vanilla.tsx
8
+ var cardClass = withVariantKeys(cardRecipe);
9
+ var interactiveCardClass = withVariantKeys(interactiveCardRecipe);
9
10
  var CardVanillaComponentImpl = forwardRef(({ as, className, css, style, elevation, variant, active, interactive, ...props }, ref) => {
10
11
  const Component = as || (interactive ? "button" : "div");
11
- const { colors } = useVanillaExtractTheme();
12
- const { style: cssStyles, vars } = processCSSProp(css, colors);
13
- const mergedStyles = {
14
- ...cssStyles,
15
- ...style,
16
- ...assignInlineVars(vars)
17
- };
18
- const recipeClass = (interactive ? interactiveCardRecipe : cardRecipe)({
12
+ const mergedStyles = useInlineStyle(css, style);
13
+ const recipeClass = (interactive ? interactiveCardClass : cardClass)({
19
14
  elevation,
20
15
  variant,
21
16
  active
@@ -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 { 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
+ {"version":3,"file":"Card.vanilla.js","names":[],"sources":["../../../components/Card/Card.vanilla.tsx"],"sourcesContent":["import { ElementType, forwardRef } from 'react';\n\nimport { CSSProps } from '@/styles/cssProps';\nimport { cx } from '@/styles/cx';\nimport {\n PolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef,\n} from '@/styles/polymorphic';\nimport { RecipeVariantProps, withVariantKeys } from '@/styles/recipeVariants';\nimport { useInlineStyle } from '@/styles/useInlineStyle';\n\nimport { cardRecipe, interactiveCardRecipe } from './Card.vanilla.css';\n\nconst cardClass = withVariantKeys(cardRecipe);\nconst interactiveCardClass = withVariantKeys(interactiveCardRecipe);\n\ntype CardRecipeVariants = RecipeVariantProps<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 mergedStyles = useInlineStyle(css, style);\n\n const recipe = interactive ? interactiveCardClass : cardClass;\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":";;;;;;;AAcA,IAAM,YAAY,gBAAgB,UAAU;AAC5C,IAAM,uBAAuB,gBAAgB,qBAAqB;AAkBlE,IAAM,2BAA2B,YAE7B,EACE,IACA,WACA,KACA,OACA,WACA,SACA,QACA,aACA,GAAG,SAEL,QACG;CACH,MAAM,YAAY,OAAO,cAAc,WAAW;CAClD,MAAM,eAAe,eAAe,KAAK,KAAK;CAG9C,MAAM,eADS,cAAc,uBAAuB,UAAA,CACzB;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,7 +1,7 @@
1
1
  const require_runtime = require("../../_virtual/_rolldown/runtime.cjs");
2
- const require_cssProps = require("../../styles/cssProps.cjs");
3
2
  const require_cx = require("../../styles/cx.cjs");
4
3
  const require_themeContext = require("../../styles/themeContext.cjs");
4
+ const require_useInlineStyle = require("../../styles/useInlineStyle.cjs");
5
5
  const require_useIsomorphicLayoutEffect = require("../../utils/useIsomorphicLayoutEffect.cjs");
6
6
  const require_AccessibleIcon = require("../AccessibleIcon/AccessibleIcon.cjs");
7
7
  const require_Button_vanilla = require("../Button/Button.vanilla.cjs");
@@ -10,20 +10,17 @@ require("./prism-extend.cjs");
10
10
  let _radix_ui_react_icons = require("@radix-ui/react-icons");
11
11
  let react = require("react");
12
12
  react = require_runtime.__toESM(react, 1);
13
- let _vanilla_extract_dynamic = require("@vanilla-extract/dynamic");
14
13
  let react_jsx_runtime = require("react/jsx-runtime");
15
14
  let prism_react_renderer = require("prism-react-renderer");
16
15
  // components/CodeBlock/CodeBlock.vanilla.tsx
17
16
  var CodeBlockVanilla = (0, react.forwardRef)(({ lang = "text", code, copyable = false, copyText, copiedText, copyButtonAlign = "top right", onCopy, onCopyError, noBorder, wrapText = false, colorScheme, maxHeight = 424, css, style, className, ...props }, ref) => {
18
- const { colors, resolvedTheme } = require_themeContext.useVanillaExtractTheme();
17
+ const { resolvedTheme } = require_themeContext.useVanillaExtractTheme();
19
18
  const prismTheme = (colorScheme ?? resolvedTheme) === "dark" ? prism_react_renderer.themes.nightOwl : prism_react_renderer.themes.nightOwlLight;
20
19
  const isBottom = copyButtonAlign.includes("bottom");
21
20
  const isLeft = copyButtonAlign.includes("left");
22
- const { style: cssStyles, vars } = require_cssProps.processCSSProp(css, colors);
23
21
  const containerStyles = {
24
22
  position: "relative",
25
- ...cssStyles,
26
- ...(0, _vanilla_extract_dynamic.assignInlineVars)(vars)
23
+ ...require_useInlineStyle.useInlineStyle(css)
27
24
  };
28
25
  const [copied, setCopied] = (0, react.useState)(false);
29
26
  const preRef = (0, react.useRef)(null);
@@ -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","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":"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"}
1
+ {"version":3,"file":"CodeBlock.vanilla.cjs","names":["forwardRef","useVanillaExtractTheme","themes","useInlineStyle","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 { Highlight, Language, themes } from 'prism-react-renderer';\nimport React, { forwardRef, HTMLAttributes, useCallback, useRef, useState } from 'react';\n\nimport { CSSProps } from '@/styles/cssProps';\nimport { cx } from '@/styles/cx';\nimport { useVanillaExtractTheme } from '@/styles/themeContext';\nimport { useInlineStyle } from '@/styles/useInlineStyle';\nimport { useIsomorphicLayoutEffect } from '@/utils/useIsomorphicLayoutEffect';\n\nimport { AccessibleIcon } from '@/components/AccessibleIcon';\nimport { ButtonVanilla } from '@/components/Button';\n\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 { 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 inlineStyle = useInlineStyle(css);\n const containerStyles = { position: 'relative' as const, ...inlineStyle };\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":";;;;;;;;;;;;;;;AA+CA,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,kBAAkBC,qBAAAA,uBAAuB;CAEjD,MAAM,cADkB,eAAe,mBACA,SAASC,qBAAAA,OAAO,WAAWA,qBAAAA,OAAO;CAEzE,MAAM,WAAW,gBAAgB,SAAS,QAAQ;CAClD,MAAM,SAAS,gBAAgB,SAAS,MAAM;CAG9C,MAAM,kBAAkB;EAAE,UAAU;EAAqB,GADrCC,uBAAAA,eAAe,GACyB;CAAY;CAExE,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,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;IAC1E,QAAQ,MAAM,QAAQ,GAAG,KAAK,WAAW;GAC3C;GACA,IAAI,UAAU;IACZ,MAAM,aAAa,KAAK,IAAI,GAAG,IAAI,eAAe,IAAI,eAAe,OAAO;IAC5E,QAAQ,MAAM,SAAS,GAAG,IAAI,WAAW;GAC3C;EACF;EAEA,OAAO;EACP,MAAM,WAAW,IAAI,eAAe,MAAM;EAC1C,SAAS,QAAQ,GAAG;EACpB,aAAa,SAAS,WAAW;CACnC,GAAG;EAAC;EAAU;EAAU;EAAQ;CAAQ,CAAC;CAEzC,MAAM,aAAa,YAAY;EAC7B,IAAI;GACF,IAAI;IACF,MAAM,UAAU,UAAU,UAAU,IAAI;GAC1C,SAAS,OAAO;IAEd,IAAK,MAAM,cAAc,OAAO,IAAI,MAAO,MAAM;GACnD;GACA,UAAU,IAAI;GACd,SAAS;GACT,iBAAiB,UAAU,KAAK,GAAG,IAAI;EACzC,QAAQ,CAER;CACF;CAEA,MAAM,sBAAsB,WACxB,SACEC,8BAAAA,8BACAC,8BAAAA,+BACF,SACEC,8BAAAA,2BACAC,8BAAAA;CAEN,MAAM,aAAa,WACjB,iBAAA,GAAA,kBAAA,KAAA,CAACC,uBAAAA,eAAD;EACE,SAAQ;EACR,OAAA;EACA,MAAK;EACL,MAAK;EACL,SAAS;EACT,KAAK;GACH,OAAO;GACP,KAAK;GACL,iBAAiB;GACjB,QAAQ;EACV;EAXF,UAAA,CAaE,iBAAA,GAAA,kBAAA,IAAA,CAACC,uBAAAA,gBAAD;GAAgB,OAAO,SAAS,WAAW;GACxC,UAAA,SAAS,iBAAA,GAAA,kBAAA,IAAA,CAACC,sBAAAA,WAAD,CAAY,CAAA,IAAI,iBAAA,GAAA,kBAAA,IAAA,CAACC,sBAAAA,UAAD,CAAW,CAAA;EACvB,CAAA,GACf,SAAS,aAAa,QACV;CACb,CAAA,IAAA;CAEJ,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACC,qBAAAA,WAAD;EACE,OAAO;EACD;EACN,UAAWC,qBAAAA,MAAM,UAAU,SAAS,OAAO,OAAO;EAEhD,WAAA,EACA,WAAW,gBACX,OAAO,gBACP,QACA,cACA,oBAEA,iBAAA,GAAA,kBAAA,KAAA,CAAC,OAAD;GAAK,OAAO;GAAZ,UAAA,CACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;IACE,KAAK;IACL,WAAWC,WAAAA,GAAGC,8BAAAA,KAAK,YAAA,aAAyB,gBAAgB,SAAS;IACrE,OAAO;KACL;KACA,GAAG;KACH,iBAAiB;KACjB,GAAG;IACL;IACA,GAAI;IAEJ,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;KACE,WAAWD,WAAAA,GACTE,8BAAAA,aACA,YAAY,UAAU,YAAA,aACtB,YAAY,UAAU,CAAC,YAAA,WACzB;KAEC,UAAA,OAAO,KAAK,MAAM,MACjB,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;MAEE,GAAI,aAAa,EAAE,KAAK,CAAC;MACzB,OACE,WAAW;OAAE,YAAY;OAAY,WAAW;MAAY,IAAI,KAAA;MAGjE,UAAA,KAAK,KAAK,OAAO,QAChB,iBAAA,GAAA,kBAAA,IAAA,CAAC,QAAD,EAAgB,GAAI,cAAc,EAAE,MAAM,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 +1 @@
1
- {"version":3,"file":"CodeBlock.vanilla.css.cjs","names":[],"sources":["../../../components/CodeBlock/CodeBlock.vanilla.css.ts"],"sourcesContent":["import { style } from '@vanilla-extract/css';\n\nimport { tokens } from '../../styles/tokens.css';\n\nexport const pre = style({\n margin: 0,\n borderRadius: tokens.radii['2'],\n overflow: 'auto',\n border: `1px solid ${tokens.colors.deepBlue['3']}`,\n fontSize: tokens.fontSizes['2'],\n lineHeight: '1.6',\n});\n\nexport const preNoBorder = style({\n border: 'none',\n});\n\nexport const codeContent = style({\n padding: tokens.space['4'],\n});\n\nexport const codeContentBottomPadding = style({\n paddingBottom: tokens.space['7'],\n});\n\nexport const codeContentTopPadding = style({\n paddingTop: tokens.space['7'],\n});\n\nexport const copyButtonWrapperTop = style({\n position: 'absolute',\n zIndex: 1,\n top: tokens.space['2'],\n right: tokens.space['3'],\n});\n\nexport const copyButtonWrapperTopLeft = style({\n position: 'absolute',\n zIndex: 1,\n top: tokens.space['2'],\n left: tokens.space['3'],\n});\n\nexport const copyButtonWrapperBottomRight = style({\n position: 'absolute',\n zIndex: 1,\n bottom: tokens.space['2'],\n right: tokens.space['3'],\n});\n\nexport const copyButtonWrapperBottomLeft = style({\n position: 'absolute',\n zIndex: 1,\n bottom: tokens.space['2'],\n left: tokens.space['3'],\n});\n"],"mappings":""}
1
+ {"version":3,"file":"CodeBlock.vanilla.css.cjs","names":[],"sources":[],"mappings":""}