@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":"Table.vanilla.cjs","names":["forwardRef","cx","tableRecipe","rowLinkTable","useInlineStyle","captionRecipe","thead","tbody","tfoot","ARIA_SORT","thRecipe","SortButtonVanilla","tdRecipe","useState","useId","collapsedContent","_Fragment","trRecipe","rowLinkRow","handleRowClick","stopEvent","ExpandToggleVanilla","mapRowLink","RowLinkVanilla"],"sources":["../../../components/Table/Table.vanilla.tsx"],"sourcesContent":["import { RecipeVariants } from '@vanilla-extract/recipes';\nimport React, { forwardRef, ReactNode, useId, useState } from 'react';\n\nimport { CSSProps } from '../../styles/cssProps';\nimport { cx } from '../../styles/cx';\nimport { useInlineStyle } from '../../styles/useInlineStyle';\nimport {\n handleRowClick,\n mapRowLink,\n openRowLink,\n RowLinkShortcutProps,\n} from '../RowLink/RowLink.utils';\nimport { RowLinkVanilla } from '../RowLink/RowLink.vanilla';\nimport { rowLinkRow, rowLinkTable } from '../RowLink/RowLink.vanilla.css';\nimport { ExpandToggleVanilla, stopEvent } from './ExpandToggle.vanilla';\nimport { ARIA_SORT, SortButtonVanilla } from './SortButton.vanilla';\nimport {\n captionRecipe,\n collapsedCell,\n collapsedContent as collapsedContentClass,\n emptyHeaderCell,\n tableRecipe,\n tbody,\n tdRecipe,\n tfoot,\n thead,\n thRecipe,\n toggleCell,\n trRecipe,\n} from './Table.vanilla.css';\nimport { TableSortProps } from './useTableSort';\n\ntype TableRecipeVariants = NonNullable<RecipeVariants<typeof tableRecipe>>;\ntype CaptionRecipeVariants = NonNullable<RecipeVariants<typeof captionRecipe>>;\ntype TrRecipeVariants = NonNullable<RecipeVariants<typeof trRecipe>>;\ntype ThRecipeVariants = NonNullable<RecipeVariants<typeof thRecipe>>;\ntype TdRecipeVariants = NonNullable<RecipeVariants<typeof tdRecipe>>;\n\nexport type TableVanillaProps = React.TableHTMLAttributes<HTMLTableElement> &\n CSSProps &\n TableRecipeVariants;\n\nexport const TableVanilla = forwardRef<HTMLTableElement, TableVanillaProps>(\n ({ elevation, className, css, style, ...props }, ref) => (\n <table\n ref={ref}\n className={cx(tableRecipe({ elevation }), rowLinkTable, className)}\n style={useInlineStyle(css, style)}\n {...props}\n />\n ),\n);\n\nTableVanilla.displayName = 'TableVanilla';\n\nexport type CaptionVanillaProps = React.HTMLAttributes<HTMLTableCaptionElement> &\n CSSProps &\n CaptionRecipeVariants;\n\nexport const CaptionVanilla = forwardRef<HTMLTableCaptionElement, CaptionVanillaProps>(\n (\n { size, weight, variant, gradient, transform, noWrap, className, css, style, ...props },\n ref,\n ) => (\n <caption\n ref={ref}\n className={cx(\n captionRecipe({ size, weight, variant, gradient, transform, noWrap }),\n className,\n )}\n style={useInlineStyle(css, style)}\n {...props}\n />\n ),\n);\n\nCaptionVanilla.displayName = 'CaptionVanilla';\n\nexport type TableSectionVanillaProps = React.HTMLAttributes<HTMLTableSectionElement> & CSSProps;\n\nconst section = (Tag: 'thead' | 'tbody' | 'tfoot', sectionClass: string, displayName: string) => {\n const Section = forwardRef<HTMLTableSectionElement, TableSectionVanillaProps>(\n ({ className, css, style, ...props }, ref) => (\n <Tag\n ref={ref}\n className={cx(sectionClass, className)}\n style={useInlineStyle(css, style)}\n {...props}\n />\n ),\n );\n Section.displayName = displayName;\n return Section;\n};\n\nexport const TheadVanilla = section('thead', thead, 'TheadVanilla');\nexport const TbodyVanilla = section('tbody', tbody, 'TbodyVanilla');\nexport const TfootVanilla = section('tfoot', tfoot, 'TfootVanilla');\n\nexport type ThVanillaProps = Omit<React.ThHTMLAttributes<HTMLTableCellElement>, 'align'> &\n CSSProps &\n ThRecipeVariants &\n TableSortProps;\n\nexport const ThVanilla = forwardRef<HTMLTableCellElement, ThVanillaProps>(\n (\n {\n size,\n weight,\n variant,\n gradient,\n transform,\n noWrap,\n align,\n sort,\n onSort,\n className,\n css,\n style,\n children,\n ...props\n },\n ref,\n ) => (\n <th\n ref={ref}\n aria-sort={sort && ARIA_SORT[sort]}\n className={cx(\n thRecipe({ size, weight, variant, gradient, transform, noWrap, align }),\n className,\n )}\n style={useInlineStyle(css, style)}\n {...props}\n >\n {onSort ? (\n <SortButtonVanilla sort={sort} onSort={onSort}>\n {children}\n </SortButtonVanilla>\n ) : (\n children\n )}\n </th>\n ),\n);\n\nThVanilla.displayName = 'ThVanilla';\n\nexport type TdVanillaProps = Omit<React.TdHTMLAttributes<HTMLTableCellElement>, 'align'> &\n CSSProps &\n TdRecipeVariants;\n\nexport const TdVanilla = forwardRef<HTMLTableCellElement, TdVanillaProps>(\n ({ subtle, align, className, css, style, ...props }, ref) => (\n <td\n ref={ref}\n className={cx(tdRecipe({ subtle, align }), className)}\n style={useInlineStyle(css, style)}\n {...props}\n />\n ),\n);\n\nTdVanilla.displayName = 'TdVanilla';\n\nexport type TrVanillaProps = React.HTMLAttributes<HTMLTableRowElement> &\n CSSProps &\n TrRecipeVariants &\n RowLinkShortcutProps & {\n /** Content shown in a full-width row below, toggled by a button in a new first cell. */\n collapsedContent?: ReactNode;\n /** Column span of the collapsed content row; set it to the number of columns. */\n collapsedContentColSpan?: number;\n /** Accessible name of the expand button. */\n expandLabel?: string;\n /** Adds an empty first cell, to line up with rows that have an expand button. */\n emptyFirstColumn?: boolean;\n /** Styles the empty first cell as a header, for a row in `TheadVanilla`. */\n tableHead?: boolean;\n };\n\nexport const TrVanilla = forwardRef<HTMLTableRowElement, TrVanillaProps>(\n (\n {\n collapsedContent,\n collapsedContentColSpan = 1,\n expandLabel = 'Expand row',\n emptyFirstColumn = false,\n tableHead = false,\n href,\n linkAs,\n linkCell,\n linkProps,\n linkOverlay,\n interactive,\n active,\n className,\n css,\n style,\n children,\n onClick,\n onAuxClick,\n ...props\n },\n ref,\n ) => {\n const [isOpen, setIsOpen] = useState(false);\n const contentId = useId();\n const inlineStyle = useInlineStyle(css, style);\n const collapsible = !!collapsedContent;\n\n return (\n <>\n <tr\n ref={ref}\n className={cx(\n trRecipe({ interactive: interactive ?? (href !== undefined || undefined), active }),\n rowLinkRow,\n className,\n )}\n data-collapsed={collapsible && !isOpen ? '' : undefined}\n style={inlineStyle}\n onClick={(event) => handleRowClick(event, onClick)}\n onAuxClick={(event) => {\n onAuxClick?.(event);\n openRowLink(event);\n }}\n {...props}\n >\n {emptyFirstColumn &&\n (tableHead ? <td className={cx(thRecipe(), emptyHeaderCell)} /> : <TdVanilla />)}\n {collapsible && (\n <TdVanilla className={toggleCell} onClick={stopEvent}>\n <ExpandToggleVanilla\n label={expandLabel}\n isOpen={isOpen}\n controls={contentId}\n onToggle={() => setIsOpen((open) => !open)}\n />\n </TdVanilla>\n )}\n {mapRowLink(\n children,\n { href, linkAs, linkCell, linkProps, linkOverlay },\n TdVanilla,\n RowLinkVanilla,\n { row: 'TrVanilla', cell: 'TdVanilla' },\n )}\n </tr>\n {collapsible && (\n <TrVanilla>\n <TdVanilla\n id={contentId}\n colSpan={collapsedContentColSpan}\n className={collapsedCell}\n data-closed={isOpen ? undefined : ''}\n >\n <div className={collapsedContentClass}>{collapsedContent}</div>\n </TdVanilla>\n </TrVanilla>\n )}\n </>\n );\n },\n);\n\nTrVanilla.displayName = 'TrVanilla';\n"],"mappings":";;;;;;;;;;;;;AA0CA,IAAa,gBAAA,GAAeA,MAAAA,WAAAA,EACzB,EAAE,WAAW,WAAW,KAAK,OAAO,GAAG,SAAS,QAC/C,iBAAA,GAAA,kBAAA,IAAA,CAAC,SAAD;CACO;CACL,WAAWC,WAAAA,GAAGC,0BAAAA,YAAY,EAAE,UAAU,CAAC,GAAGC,4BAAAA,cAAc,SAAS;CACjE,OAAOC,uBAAAA,eAAe,KAAK,KAAK;CAChC,GAAI;AACL,CAAA,CAEL;AAEA,aAAa,cAAc;AAM3B,IAAa,kBAAA,GAAiBJ,MAAAA,WAAAA,EAE1B,EAAE,MAAM,QAAQ,SAAS,UAAU,WAAW,QAAQ,WAAW,KAAK,OAAO,GAAG,SAChF,QAEA,iBAAA,GAAA,kBAAA,IAAA,CAAC,WAAD;CACO;CACL,WAAWC,WAAAA,GACTI,0BAAAA,cAAc;EAAE;EAAM;EAAQ;EAAS;EAAU;EAAW;CAAO,CAAC,GACpE,SACF;CACA,OAAOD,uBAAAA,eAAe,KAAK,KAAK;CAChC,GAAI;AACL,CAAA,CAEL;AAEA,eAAe,cAAc;AAI7B,IAAM,WAAW,KAAkC,cAAsB,gBAAwB;CAC/F,MAAM,WAAA,GAAUJ,MAAAA,WAAAA,EACb,EAAE,WAAW,KAAK,OAAO,GAAG,SAAS,QACpC,iBAAA,GAAA,kBAAA,IAAA,CAAC,KAAD;EACO;EACL,WAAWC,WAAAA,GAAG,cAAc,SAAS;EACrC,OAAOG,uBAAAA,eAAe,KAAK,KAAK;EAChC,GAAI;CACL,CAAA,CAEL;CACA,QAAQ,cAAc;CACtB,OAAO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,IAAI;EACJ,SAAS;EACT,WAAA;EACA,eAAa,SAAS,KAAA,IAAY;EAElC,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;GAAK,WAAA;GAAmC,UAAAR;EAAsB,CAAA;CACrD,CAAA,EACF,CAAA,CAEb,EAAA,CAAA;AAEN,CACF;AAEA,UAAU,cAAc"}
1
+ {"version":3,"file":"Table.vanilla.cjs","names":["withVariantKeys","captionRecipe","tableRecipe","thRecipe","forwardRef","cx","rowLinkTable","useInlineStyle","thead","tbody","tfoot","ARIA_SORT","SortButtonVanilla","tdRecipe","useState","useId","collapsedContent","_Fragment","trRecipe","rowLinkRow","handleRowClick","stopEvent","ExpandToggleVanilla","mapRowLink","RowLinkVanilla"],"sources":["../../../components/Table/Table.vanilla.tsx"],"sourcesContent":["import React, { forwardRef, ReactNode, useId, useState } from 'react';\n\nimport { CSSProps } from '@/styles/cssProps';\nimport { cx } from '@/styles/cx';\nimport { RecipeVariantProps, withVariantKeys } from '@/styles/recipeVariants';\nimport { useInlineStyle } from '@/styles/useInlineStyle';\n\nimport {\n handleRowClick,\n mapRowLink,\n openRowLink,\n RowLinkShortcutProps,\n} from '@/components/RowLink/RowLink.utils';\nimport { RowLinkVanilla } from '@/components/RowLink/RowLink.vanilla';\nimport { rowLinkRow, rowLinkTable } from '@/components/RowLink/RowLink.vanilla.css';\n\nimport { ExpandToggleVanilla, stopEvent } from './ExpandToggle.vanilla';\nimport { ARIA_SORT, SortButtonVanilla } from './SortButton.vanilla';\nimport {\n captionRecipe,\n collapsedCell,\n collapsedContent as collapsedContentClass,\n emptyHeaderCell,\n tableRecipe,\n tbody,\n tdRecipe,\n tfoot,\n thead,\n thRecipe,\n toggleCell,\n trRecipe,\n} from './Table.vanilla.css';\nimport { TableSortProps } from './useTableSort';\n\nconst captionClass = withVariantKeys(captionRecipe);\nconst tableClass = withVariantKeys(tableRecipe);\nconst thClass = withVariantKeys(thRecipe);\n\ntype TableRecipeVariants = RecipeVariantProps<typeof tableRecipe>;\ntype CaptionRecipeVariants = RecipeVariantProps<typeof captionRecipe>;\ntype TrRecipeVariants = RecipeVariantProps<typeof trRecipe>;\ntype ThRecipeVariants = RecipeVariantProps<typeof thRecipe>;\ntype TdRecipeVariants = RecipeVariantProps<typeof tdRecipe>;\n\nexport type TableVanillaProps = React.TableHTMLAttributes<HTMLTableElement> &\n CSSProps &\n TableRecipeVariants;\n\nexport const TableVanilla = forwardRef<HTMLTableElement, TableVanillaProps>(\n ({ elevation, className, css, style, ...props }, ref) => (\n <table\n ref={ref}\n className={cx(tableClass({ elevation }), rowLinkTable, className)}\n style={useInlineStyle(css, style)}\n {...props}\n />\n ),\n);\n\nTableVanilla.displayName = 'TableVanilla';\n\nexport type CaptionVanillaProps = React.HTMLAttributes<HTMLTableCaptionElement> &\n CSSProps &\n CaptionRecipeVariants;\n\nexport const CaptionVanilla = forwardRef<HTMLTableCaptionElement, CaptionVanillaProps>(\n (\n { size, weight, variant, gradient, transform, noWrap, className, css, style, ...props },\n ref,\n ) => (\n <caption\n ref={ref}\n className={cx(\n captionClass({ size, weight, variant, gradient, transform, noWrap }),\n className,\n )}\n style={useInlineStyle(css, style)}\n {...props}\n />\n ),\n);\n\nCaptionVanilla.displayName = 'CaptionVanilla';\n\nexport type TableSectionVanillaProps = React.HTMLAttributes<HTMLTableSectionElement> & CSSProps;\n\nconst section = (Tag: 'thead' | 'tbody' | 'tfoot', sectionClass: string, displayName: string) => {\n const Section = forwardRef<HTMLTableSectionElement, TableSectionVanillaProps>(\n ({ className, css, style, ...props }, ref) => (\n <Tag\n ref={ref}\n className={cx(sectionClass, className)}\n style={useInlineStyle(css, style)}\n {...props}\n />\n ),\n );\n Section.displayName = displayName;\n return Section;\n};\n\nexport const TheadVanilla = section('thead', thead, 'TheadVanilla');\nexport const TbodyVanilla = section('tbody', tbody, 'TbodyVanilla');\nexport const TfootVanilla = section('tfoot', tfoot, 'TfootVanilla');\n\nexport type ThVanillaProps = Omit<React.ThHTMLAttributes<HTMLTableCellElement>, 'align'> &\n CSSProps &\n ThRecipeVariants &\n TableSortProps;\n\nexport const ThVanilla = forwardRef<HTMLTableCellElement, ThVanillaProps>(\n (\n {\n size,\n weight,\n variant,\n gradient,\n transform,\n noWrap,\n align,\n sort,\n onSort,\n className,\n css,\n style,\n children,\n ...props\n },\n ref,\n ) => (\n <th\n ref={ref}\n aria-sort={sort && ARIA_SORT[sort]}\n className={cx(\n thClass({ size, weight, variant, gradient, transform, noWrap, align }),\n className,\n )}\n style={useInlineStyle(css, style)}\n {...props}\n >\n {onSort ? (\n <SortButtonVanilla sort={sort} onSort={onSort}>\n {children}\n </SortButtonVanilla>\n ) : (\n children\n )}\n </th>\n ),\n);\n\nThVanilla.displayName = 'ThVanilla';\n\nexport type TdVanillaProps = Omit<React.TdHTMLAttributes<HTMLTableCellElement>, 'align'> &\n CSSProps &\n TdRecipeVariants;\n\nexport const TdVanilla = forwardRef<HTMLTableCellElement, TdVanillaProps>(\n ({ subtle, align, className, css, style, ...props }, ref) => (\n <td\n ref={ref}\n className={cx(tdRecipe({ subtle, align }), className)}\n style={useInlineStyle(css, style)}\n {...props}\n />\n ),\n);\n\nTdVanilla.displayName = 'TdVanilla';\n\nexport type TrVanillaProps = React.HTMLAttributes<HTMLTableRowElement> &\n CSSProps &\n TrRecipeVariants &\n RowLinkShortcutProps & {\n /** Content shown in a full-width row below, toggled by a button in a new first cell. */\n collapsedContent?: ReactNode;\n /** Column span of the collapsed content row; set it to the number of columns. */\n collapsedContentColSpan?: number;\n /** Accessible name of the expand button. */\n expandLabel?: string;\n /** Adds an empty first cell, to line up with rows that have an expand button. */\n emptyFirstColumn?: boolean;\n /** Styles the empty first cell as a header, for a row in `TheadVanilla`. */\n tableHead?: boolean;\n };\n\nexport const TrVanilla = forwardRef<HTMLTableRowElement, TrVanillaProps>(\n (\n {\n collapsedContent,\n collapsedContentColSpan = 1,\n expandLabel = 'Expand row',\n emptyFirstColumn = false,\n tableHead = false,\n href,\n linkAs,\n linkCell,\n linkProps,\n linkOverlay,\n interactive,\n active,\n className,\n css,\n style,\n children,\n onClick,\n onAuxClick,\n ...props\n },\n ref,\n ) => {\n const [isOpen, setIsOpen] = useState(false);\n const contentId = useId();\n const inlineStyle = useInlineStyle(css, style);\n const collapsible = !!collapsedContent;\n\n return (\n <>\n <tr\n ref={ref}\n className={cx(\n trRecipe({ interactive: interactive ?? (href !== undefined || undefined), active }),\n rowLinkRow,\n className,\n )}\n data-collapsed={collapsible && !isOpen ? '' : undefined}\n style={inlineStyle}\n onClick={(event) => handleRowClick(event, onClick)}\n onAuxClick={(event) => {\n onAuxClick?.(event);\n openRowLink(event);\n }}\n {...props}\n >\n {emptyFirstColumn &&\n (tableHead ? <td className={cx(thClass(), emptyHeaderCell)} /> : <TdVanilla />)}\n {collapsible && (\n <TdVanilla className={toggleCell} onClick={stopEvent}>\n <ExpandToggleVanilla\n label={expandLabel}\n isOpen={isOpen}\n controls={contentId}\n onToggle={() => setIsOpen((open) => !open)}\n />\n </TdVanilla>\n )}\n {mapRowLink(\n children,\n { href, linkAs, linkCell, linkProps, linkOverlay },\n TdVanilla,\n RowLinkVanilla,\n { row: 'TrVanilla', cell: 'TdVanilla' },\n )}\n </tr>\n {collapsible && (\n <TrVanilla>\n <TdVanilla\n id={contentId}\n colSpan={collapsedContentColSpan}\n className={collapsedCell}\n data-closed={isOpen ? undefined : ''}\n >\n <div className={collapsedContentClass}>{collapsedContent}</div>\n </TdVanilla>\n </TrVanilla>\n )}\n </>\n );\n },\n);\n\nTrVanilla.displayName = 'TrVanilla';\n"],"mappings":";;;;;;;;;;;;;;AAkCA,IAAM,eAAeA,uBAAAA,gBAAgBC,0BAAAA,aAAa;AAClD,IAAM,aAAaD,uBAAAA,gBAAgBE,0BAAAA,WAAW;AAC9C,IAAM,UAAUF,uBAAAA,gBAAgBG,0BAAAA,QAAQ;AAYxC,IAAa,gBAAA,GAAeC,MAAAA,WAAAA,EACzB,EAAE,WAAW,WAAW,KAAK,OAAO,GAAG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C,4BAAAA,YACA,SACF;EACA,kBAAgB,eAAe,CAAC,SAAS,KAAK,KAAA;EAC9C,OAAO;EACP,UAAU,UAAUC,sBAAAA,eAAe,OAAO,OAAO;EACjD,aAAa,UAAU;GACrB,aAAa,KAAK;GAClB,sBAAA,YAAY,KAAK;EACnB;EACA,GAAI;EAdN,UAAA;GAgBG,qBACE,YAAY,iBAAA,GAAA,kBAAA,IAAA,CAAC,MAAD,EAAI,WAAWf,WAAAA,GAAG,QAAQ,GAAA,YAAkB,EAAI,CAAA,IAAI,iBAAA,GAAA,kBAAA,IAAA,CAAC,WAAD,CAAY,CAAA;GAC9E,eACC,iBAAA,GAAA,kBAAA,IAAA,CAAC,WAAD;IAAW,WAAA;IAAuB,SAASgB,6BAAAA;IACzC,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAACC,6BAAAA,qBAAD;KACE,OAAO;KACC;KACR,UAAU;KACV,gBAAgB,WAAW,SAAS,CAAC,IAAI;IAC1C,CAAA;GACQ,CAAA;GAEZC,sBAAAA,WACC,UACA;IAAE;IAAM;IAAQ;IAAU;IAAW;GAAY,GACjD,WACAC,wBAAAA,gBACA;IAAE,KAAK;IAAa,MAAM;GAAY,CACxC;EACE;CACH,CAAA,GAAA,eACC,iBAAA,GAAA,kBAAA,IAAA,CAAC,WAAD,EAAA,UACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,WAAD;EACE,IAAI;EACJ,SAAS;EACT,WAAA;EACA,eAAa,SAAS,KAAA,IAAY;EAElC,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;GAAK,WAAA;GAAmC,UAAAR;EAAsB,CAAA;CACrD,CAAA,EACF,CAAA,CAEb,EAAA,CAAA;AAEN,CACF;AAEA,UAAU,cAAc"}
@@ -1 +1 @@
1
- {"version":3,"file":"Table.vanilla.css.cjs","names":["_7a468"],"sources":["../../../components/Table/Table.vanilla.css.ts"],"sourcesContent":["import { globalStyle, style } from '@vanilla-extract/css';\nimport { recipe } from '@vanilla-extract/recipes';\n\nimport {\n colorVariants,\n gradientVariants,\n noWrapVariants,\n sizeVariants,\n transformVariants,\n weightVariants,\n} from '../../styles/textVariants.css';\nimport { tokens } from '../../styles/tokens.css';\nimport { elevationVariants } from '../Elevation/Elevation.vanilla.css';\nimport { ROW_LINK_CONTROL_Z_INDEX } from '../RowLink/RowLink.constants';\n\nconst rowBorder = `1px solid ${tokens.colors.tableRowBorder}`;\n\nconst alignVariants = {\n start: { textAlign: 'start' },\n center: { textAlign: 'center' },\n end: { textAlign: 'end' },\n} as const;\n\nconst textVariants = {\n size: sizeVariants,\n weight: weightVariants,\n variant: colorVariants,\n gradient: gradientVariants,\n noWrap: noWrapVariants,\n} as const;\n\nconst layer = (backgroundColor: string, borderRadius: Record<string, string>) =>\n ({\n pointerEvents: 'none',\n content: '\"\"',\n position: 'absolute',\n inset: 0,\n backgroundColor,\n ...borderRadius,\n }) as const;\n\nexport const table = style({\n width: '100%',\n tableLayout: 'fixed',\n boxSizing: 'border-box',\n borderCollapse: 'separate',\n borderSpacing: 0,\n fontFamily: tokens.fonts.rubik,\n color: tokens.colors.tableText,\n borderRadius: tokens.radii['3'],\n overflow: 'hidden',\n});\n\nexport const tableRecipe = recipe({\n base: table,\n variants: {\n elevation: elevationVariants,\n },\n defaultVariants: {\n elevation: 1,\n },\n});\n\nconst captionBase = style({\n lineHeight: '1.25',\n margin: '0',\n fontFamily: tokens.fonts.rubik,\n fontVariantNumeric: 'proportional-nums',\n display: 'table-caption',\n textAlign: 'start',\n fontWeight: tokens.fontWeights.medium,\n});\n\nexport const captionRecipe = recipe({\n base: captionBase,\n variants: {\n ...textVariants,\n transform: transformVariants,\n },\n defaultVariants: {\n size: '3',\n variant: 'default',\n },\n});\n\nexport const tbody = style({\n width: '100%',\n verticalAlign: 'middle',\n});\n\nexport const thead = style({\n position: 'relative',\n borderTopLeftRadius: 'inherit',\n borderTopRightRadius: 'inherit',\n verticalAlign: 'middle',\n\n '::after': layer(tokens.colors.tableHeaderLayerBackground, {\n borderTopLeftRadius: 'inherit',\n borderTopRightRadius: 'inherit',\n }),\n});\n\nexport const tfoot = style({\n verticalAlign: 'middle',\n position: 'relative',\n borderRadius: 'inherit',\n\n '::after': layer(tokens.colors.tableFooterLayerBackground, { borderRadius: 'inherit' }),\n\n selectors: {\n [`${table} ${tbody}:not(:empty) ~ &, ${table} ${thead}:not(:empty) ~ &`]: {\n borderTopLeftRadius: '0',\n borderTopRightRadius: '0',\n },\n },\n});\n\nconst tr = style({\n verticalAlign: 'inherit',\n selectors: {\n '&:hover': {\n color: tokens.colors.tableHoverText,\n },\n },\n});\n\nexport const trRecipe = recipe({\n base: tr,\n variants: {\n interactive: {\n true: {\n selectors: {\n '&:hover': {\n backgroundColor: tokens.colors.tableHoverBackground,\n cursor: 'pointer',\n },\n },\n },\n },\n active: {\n true: {\n backgroundColor: tokens.colors.tableHoverBackground,\n color: tokens.colors.tableActiveText,\n fontWeight: tokens.fontWeights.semiBold,\n },\n },\n },\n compoundVariants: [\n {\n variants: { interactive: true, active: true },\n style: {\n selectors: {\n '&:hover': {\n color: tokens.colors.tableActiveHoverText,\n },\n },\n },\n },\n ],\n});\n\n// Text and Label base styles, then the header cell's own.\nconst th = style({\n margin: '0',\n fontFamily: tokens.fonts.rubik,\n fontVariantNumeric: 'tabular-nums',\n cursor: 'default',\n fontWeight: tokens.fontWeights.medium,\n lineHeight: '2.18',\n\n display: 'table-cell',\n verticalAlign: 'inherit',\n borderTopLeftRadius: 'inherit',\n borderTopRightRadius: 'inherit',\n textAlign: 'start',\n padding: `${tokens.space['2']} ${tokens.space['3']}`,\n borderBottom: rowBorder,\n\n selectors: {\n [`${thead} &`]: {\n fontSize: tokens.fontSizes['1'],\n color: tokens.colors.tableHeaderText,\n fontWeight: tokens.fontWeights.light,\n },\n },\n});\n\nexport const thRecipe = recipe({\n base: th,\n variants: {\n ...textVariants,\n transform: {\n ...transformVariants,\n // Label's capitalize sets inline-block; a cell must stay a cell.\n capitalize: { ...transformVariants.capitalize, display: 'table-cell' },\n },\n align: alignVariants,\n },\n defaultVariants: {\n size: '0',\n variant: 'subtle',\n transform: 'capitalize',\n align: 'start',\n },\n});\n\nexport const sortButton = style({\n all: 'unset',\n display: 'inline-flex',\n alignItems: 'center',\n gap: tokens.space['2'],\n borderRadius: tokens.radii['1'],\n cursor: 'pointer',\n selectors: {\n '&:hover': {\n color: tokens.colors.hiContrast,\n },\n '&:focus-visible': {\n outlineWidth: '2px',\n outlineStyle: 'solid',\n outlineColor: tokens.colors.focusOutline,\n outlineOffset: '2px',\n },\n },\n});\n\nexport const sortIcon = style({\n flexShrink: 0,\n});\n\nglobalStyle(`${sortIcon} > path`, {\n opacity: 0.4,\n});\n\nexport const sortIconActive = style({\n selectors: {\n [`${sortIcon} > &`]: {\n opacity: 1,\n },\n },\n});\n\nexport const emptyHeaderCell = style({\n width: 24,\n});\n\nconst td = style({\n boxSizing: 'border-box',\n padding: `${tokens.space['5']} ${tokens.space['3']}`,\n borderBottom: rowBorder,\n fontSize: tokens.fontSizes['3'],\n lineHeight: '16px',\n verticalAlign: 'inherit',\n\n selectors: {\n [`${tr}:last-child > &`]: {\n borderBottom: 'none',\n },\n // A closed collapsible row is followed only by its hidden content row.\n [`${tr}[data-collapsed]:nth-last-child(2) > &`]: {\n borderBottom: 'none',\n },\n [`${tfoot} &`]: {\n fontSize: tokens.fontSizes['1'],\n color: tokens.colors.tableHeaderText,\n fontWeight: tokens.fontWeights.light,\n padding: `${tokens.space['2']} ${tokens.space['3']}`,\n },\n [`${table} ${tbody}:not(:empty) ~ ${tfoot} &`]: {\n borderTop: rowBorder,\n },\n },\n});\n\nexport const tdRecipe = recipe({\n base: td,\n variants: {\n subtle: {\n true: {\n fontWeight: tokens.fontWeights.regular,\n color: tokens.colors.tableSubtleText,\n },\n },\n align: alignVariants,\n },\n defaultVariants: {\n align: 'start',\n },\n});\n\nexport const toggleCell = style({\n selectors: {\n '&&': {\n padding: `0 0 0 ${tokens.space['3']}`,\n },\n },\n});\n\nexport const toggle = style({\n boxSizing: 'border-box',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n position: 'relative',\n zIndex: ROW_LINK_CONTROL_Z_INDEX,\n height: '40px',\n ':hover': {\n color: tokens.colors.tableActiveText,\n },\n});\n\nexport const expandButton = style({\n all: 'unset',\n display: 'inline-flex',\n alignItems: 'center',\n justifyContent: 'center',\n width: '100%',\n height: '100%',\n borderRadius: tokens.radii['1'],\n cursor: 'pointer',\n selectors: {\n '&:focus-visible': {\n outlineWidth: '2px',\n outlineStyle: 'solid',\n outlineColor: tokens.colors.focusOutline,\n outlineOffset: '2px',\n },\n },\n});\n\nexport const chevron = style({\n transition: 'transform 0.2s ease-out',\n selectors: {\n [`${expandButton}[aria-expanded=\"true\"] > &`]: {\n transform: 'rotate(90deg)',\n },\n },\n});\n\n// Visibility switches after the collapse animation, so closed content leaves the tab order.\nexport const collapsedCell = style({\n transition: 'padding 0.2s ease-out, visibility 0s',\n selectors: {\n '&&[data-closed]': {\n transition: 'padding 0.2s ease-out, visibility 0s 0.2s',\n visibility: 'hidden',\n lineHeight: 0,\n fontSize: 0,\n padding: `0px ${tokens.space['3']}`,\n border: 'none',\n },\n },\n});\n\nexport const collapsedContent = style({\n boxSizing: 'border-box',\n transition: 'all 0.2s ease-out',\n selectors: {\n [`${collapsedCell}[data-closed] > &`]: {\n height: 0,\n overflow: 'hidden',\n },\n },\n});\n"],"mappings":""}
1
+ {"version":3,"file":"Table.vanilla.css.cjs","names":[],"sources":[],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"Table.vanilla.css.js","names":["_7a468"],"sources":["../../../components/Table/Table.vanilla.css.ts"],"sourcesContent":["import { globalStyle, style } from '@vanilla-extract/css';\nimport { recipe } from '@vanilla-extract/recipes';\n\nimport {\n colorVariants,\n gradientVariants,\n noWrapVariants,\n sizeVariants,\n transformVariants,\n weightVariants,\n} from '../../styles/textVariants.css';\nimport { tokens } from '../../styles/tokens.css';\nimport { elevationVariants } from '../Elevation/Elevation.vanilla.css';\nimport { ROW_LINK_CONTROL_Z_INDEX } from '../RowLink/RowLink.constants';\n\nconst rowBorder = `1px solid ${tokens.colors.tableRowBorder}`;\n\nconst alignVariants = {\n start: { textAlign: 'start' },\n center: { textAlign: 'center' },\n end: { textAlign: 'end' },\n} as const;\n\nconst textVariants = {\n size: sizeVariants,\n weight: weightVariants,\n variant: colorVariants,\n gradient: gradientVariants,\n noWrap: noWrapVariants,\n} as const;\n\nconst layer = (backgroundColor: string, borderRadius: Record<string, string>) =>\n ({\n pointerEvents: 'none',\n content: '\"\"',\n position: 'absolute',\n inset: 0,\n backgroundColor,\n ...borderRadius,\n }) as const;\n\nexport const table = style({\n width: '100%',\n tableLayout: 'fixed',\n boxSizing: 'border-box',\n borderCollapse: 'separate',\n borderSpacing: 0,\n fontFamily: tokens.fonts.rubik,\n color: tokens.colors.tableText,\n borderRadius: tokens.radii['3'],\n overflow: 'hidden',\n});\n\nexport const tableRecipe = recipe({\n base: table,\n variants: {\n elevation: elevationVariants,\n },\n defaultVariants: {\n elevation: 1,\n },\n});\n\nconst captionBase = style({\n lineHeight: '1.25',\n margin: '0',\n fontFamily: tokens.fonts.rubik,\n fontVariantNumeric: 'proportional-nums',\n display: 'table-caption',\n textAlign: 'start',\n fontWeight: tokens.fontWeights.medium,\n});\n\nexport const captionRecipe = recipe({\n base: captionBase,\n variants: {\n ...textVariants,\n transform: transformVariants,\n },\n defaultVariants: {\n size: '3',\n variant: 'default',\n },\n});\n\nexport const tbody = style({\n width: '100%',\n verticalAlign: 'middle',\n});\n\nexport const thead = style({\n position: 'relative',\n borderTopLeftRadius: 'inherit',\n borderTopRightRadius: 'inherit',\n verticalAlign: 'middle',\n\n '::after': layer(tokens.colors.tableHeaderLayerBackground, {\n borderTopLeftRadius: 'inherit',\n borderTopRightRadius: 'inherit',\n }),\n});\n\nexport const tfoot = style({\n verticalAlign: 'middle',\n position: 'relative',\n borderRadius: 'inherit',\n\n '::after': layer(tokens.colors.tableFooterLayerBackground, { borderRadius: 'inherit' }),\n\n selectors: {\n [`${table} ${tbody}:not(:empty) ~ &, ${table} ${thead}:not(:empty) ~ &`]: {\n borderTopLeftRadius: '0',\n borderTopRightRadius: '0',\n },\n },\n});\n\nconst tr = style({\n verticalAlign: 'inherit',\n selectors: {\n '&:hover': {\n color: tokens.colors.tableHoverText,\n },\n },\n});\n\nexport const trRecipe = recipe({\n base: tr,\n variants: {\n interactive: {\n true: {\n selectors: {\n '&:hover': {\n backgroundColor: tokens.colors.tableHoverBackground,\n cursor: 'pointer',\n },\n },\n },\n },\n active: {\n true: {\n backgroundColor: tokens.colors.tableHoverBackground,\n color: tokens.colors.tableActiveText,\n fontWeight: tokens.fontWeights.semiBold,\n },\n },\n },\n compoundVariants: [\n {\n variants: { interactive: true, active: true },\n style: {\n selectors: {\n '&:hover': {\n color: tokens.colors.tableActiveHoverText,\n },\n },\n },\n },\n ],\n});\n\n// Text and Label base styles, then the header cell's own.\nconst th = style({\n margin: '0',\n fontFamily: tokens.fonts.rubik,\n fontVariantNumeric: 'tabular-nums',\n cursor: 'default',\n fontWeight: tokens.fontWeights.medium,\n lineHeight: '2.18',\n\n display: 'table-cell',\n verticalAlign: 'inherit',\n borderTopLeftRadius: 'inherit',\n borderTopRightRadius: 'inherit',\n textAlign: 'start',\n padding: `${tokens.space['2']} ${tokens.space['3']}`,\n borderBottom: rowBorder,\n\n selectors: {\n [`${thead} &`]: {\n fontSize: tokens.fontSizes['1'],\n color: tokens.colors.tableHeaderText,\n fontWeight: tokens.fontWeights.light,\n },\n },\n});\n\nexport const thRecipe = recipe({\n base: th,\n variants: {\n ...textVariants,\n transform: {\n ...transformVariants,\n // Label's capitalize sets inline-block; a cell must stay a cell.\n capitalize: { ...transformVariants.capitalize, display: 'table-cell' },\n },\n align: alignVariants,\n },\n defaultVariants: {\n size: '0',\n variant: 'subtle',\n transform: 'capitalize',\n align: 'start',\n },\n});\n\nexport const sortButton = style({\n all: 'unset',\n display: 'inline-flex',\n alignItems: 'center',\n gap: tokens.space['2'],\n borderRadius: tokens.radii['1'],\n cursor: 'pointer',\n selectors: {\n '&:hover': {\n color: tokens.colors.hiContrast,\n },\n '&:focus-visible': {\n outlineWidth: '2px',\n outlineStyle: 'solid',\n outlineColor: tokens.colors.focusOutline,\n outlineOffset: '2px',\n },\n },\n});\n\nexport const sortIcon = style({\n flexShrink: 0,\n});\n\nglobalStyle(`${sortIcon} > path`, {\n opacity: 0.4,\n});\n\nexport const sortIconActive = style({\n selectors: {\n [`${sortIcon} > &`]: {\n opacity: 1,\n },\n },\n});\n\nexport const emptyHeaderCell = style({\n width: 24,\n});\n\nconst td = style({\n boxSizing: 'border-box',\n padding: `${tokens.space['5']} ${tokens.space['3']}`,\n borderBottom: rowBorder,\n fontSize: tokens.fontSizes['3'],\n lineHeight: '16px',\n verticalAlign: 'inherit',\n\n selectors: {\n [`${tr}:last-child > &`]: {\n borderBottom: 'none',\n },\n // A closed collapsible row is followed only by its hidden content row.\n [`${tr}[data-collapsed]:nth-last-child(2) > &`]: {\n borderBottom: 'none',\n },\n [`${tfoot} &`]: {\n fontSize: tokens.fontSizes['1'],\n color: tokens.colors.tableHeaderText,\n fontWeight: tokens.fontWeights.light,\n padding: `${tokens.space['2']} ${tokens.space['3']}`,\n },\n [`${table} ${tbody}:not(:empty) ~ ${tfoot} &`]: {\n borderTop: rowBorder,\n },\n },\n});\n\nexport const tdRecipe = recipe({\n base: td,\n variants: {\n subtle: {\n true: {\n fontWeight: tokens.fontWeights.regular,\n color: tokens.colors.tableSubtleText,\n },\n },\n align: alignVariants,\n },\n defaultVariants: {\n align: 'start',\n },\n});\n\nexport const toggleCell = style({\n selectors: {\n '&&': {\n padding: `0 0 0 ${tokens.space['3']}`,\n },\n },\n});\n\nexport const toggle = style({\n boxSizing: 'border-box',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n position: 'relative',\n zIndex: ROW_LINK_CONTROL_Z_INDEX,\n height: '40px',\n ':hover': {\n color: tokens.colors.tableActiveText,\n },\n});\n\nexport const expandButton = style({\n all: 'unset',\n display: 'inline-flex',\n alignItems: 'center',\n justifyContent: 'center',\n width: '100%',\n height: '100%',\n borderRadius: tokens.radii['1'],\n cursor: 'pointer',\n selectors: {\n '&:focus-visible': {\n outlineWidth: '2px',\n outlineStyle: 'solid',\n outlineColor: tokens.colors.focusOutline,\n outlineOffset: '2px',\n },\n },\n});\n\nexport const chevron = style({\n transition: 'transform 0.2s ease-out',\n selectors: {\n [`${expandButton}[aria-expanded=\"true\"] > &`]: {\n transform: 'rotate(90deg)',\n },\n },\n});\n\n// Visibility switches after the collapse animation, so closed content leaves the tab order.\nexport const collapsedCell = style({\n transition: 'padding 0.2s ease-out, visibility 0s',\n selectors: {\n '&&[data-closed]': {\n transition: 'padding 0.2s ease-out, visibility 0s 0.2s',\n visibility: 'hidden',\n lineHeight: 0,\n fontSize: 0,\n padding: `0px ${tokens.space['3']}`,\n border: 'none',\n },\n },\n});\n\nexport const collapsedContent = style({\n boxSizing: 'border-box',\n transition: 'all 0.2s ease-out',\n selectors: {\n [`${collapsedCell}[data-closed] > &`]: {\n height: 0,\n overflow: 'hidden',\n },\n },\n});\n"],"mappings":""}
1
+ {"version":3,"file":"Table.vanilla.css.js","names":[],"sources":[],"mappings":""}
@@ -1,4 +1,5 @@
1
1
  import { cx } from "../../styles/cx.js";
2
+ import { withVariantKeys } from "../../styles/recipeVariants.js";
2
3
  import { useInlineStyle } from "../../styles/useInlineStyle.js";
3
4
  import { handleRowClick, mapRowLink, openRowLink } from "../RowLink/RowLink.utils.js";
4
5
  import { RowLinkVanilla } from "../RowLink/RowLink.vanilla.js";
@@ -9,16 +10,19 @@ import { captionRecipe, tableRecipe, tbody, tdRecipe, tfoot, thRecipe, thead, tr
9
10
  import { forwardRef, useId, useState } from "react";
10
11
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
11
12
  // components/Table/Table.vanilla.tsx
13
+ var captionClass = withVariantKeys(captionRecipe);
14
+ var tableClass = withVariantKeys(tableRecipe);
15
+ var thClass = withVariantKeys(thRecipe);
12
16
  var TableVanilla = forwardRef(({ elevation, className, css, style, ...props }, ref) => /* @__PURE__ */ jsx("table", {
13
17
  ref,
14
- className: cx(tableRecipe({ elevation }), rowLinkTable, className),
18
+ className: cx(tableClass({ elevation }), rowLinkTable, className),
15
19
  style: useInlineStyle(css, style),
16
20
  ...props
17
21
  }));
18
22
  TableVanilla.displayName = "TableVanilla";
19
23
  var CaptionVanilla = forwardRef(({ size, weight, variant, gradient, transform, noWrap, className, css, style, ...props }, ref) => /* @__PURE__ */ jsx("caption", {
20
24
  ref,
21
- className: cx(captionRecipe({
25
+ className: cx(captionClass({
22
26
  size,
23
27
  weight,
24
28
  variant,
@@ -46,7 +50,7 @@ var TfootVanilla = section("tfoot", tfoot, "TfootVanilla");
46
50
  var ThVanilla = forwardRef(({ size, weight, variant, gradient, transform, noWrap, align, sort, onSort, className, css, style, children, ...props }, ref) => /* @__PURE__ */ jsx("th", {
47
51
  ref,
48
52
  "aria-sort": sort && ARIA_SORT[sort],
49
- className: cx(thRecipe({
53
+ className: cx(thClass({
50
54
  size,
51
55
  weight,
52
56
  variant,
@@ -94,7 +98,7 @@ var TrVanilla = forwardRef(({ collapsedContent: collapsedContent$1, collapsedCon
94
98
  },
95
99
  ...props,
96
100
  children: [
97
- emptyFirstColumn && (tableHead ? /* @__PURE__ */ jsx("td", { className: cx(thRecipe(), "_1aa2xbm2e") }) : /* @__PURE__ */ jsx(TdVanilla, {})),
101
+ emptyFirstColumn && (tableHead ? /* @__PURE__ */ jsx("td", { className: cx(thClass(), "_1aa2xbm2e") }) : /* @__PURE__ */ jsx(TdVanilla, {})),
98
102
  collapsible && /* @__PURE__ */ jsx(TdVanilla, {
99
103
  className: "_1aa2xbm2l",
100
104
  onClick: stopEvent,
@@ -1 +1 @@
1
- {"version":3,"file":"Table.vanilla.js","names":["collapsedContent","_Fragment"],"sources":["../../../components/Table/Table.vanilla.tsx"],"sourcesContent":["import { RecipeVariants } from '@vanilla-extract/recipes';\nimport React, { forwardRef, ReactNode, useId, useState } from 'react';\n\nimport { CSSProps } from '../../styles/cssProps';\nimport { cx } from '../../styles/cx';\nimport { useInlineStyle } from '../../styles/useInlineStyle';\nimport {\n handleRowClick,\n mapRowLink,\n openRowLink,\n RowLinkShortcutProps,\n} from '../RowLink/RowLink.utils';\nimport { RowLinkVanilla } from '../RowLink/RowLink.vanilla';\nimport { rowLinkRow, rowLinkTable } from '../RowLink/RowLink.vanilla.css';\nimport { ExpandToggleVanilla, stopEvent } from './ExpandToggle.vanilla';\nimport { ARIA_SORT, SortButtonVanilla } from './SortButton.vanilla';\nimport {\n captionRecipe,\n collapsedCell,\n collapsedContent as collapsedContentClass,\n emptyHeaderCell,\n tableRecipe,\n tbody,\n tdRecipe,\n tfoot,\n thead,\n thRecipe,\n toggleCell,\n trRecipe,\n} from './Table.vanilla.css';\nimport { TableSortProps } from './useTableSort';\n\ntype TableRecipeVariants = NonNullable<RecipeVariants<typeof tableRecipe>>;\ntype CaptionRecipeVariants = NonNullable<RecipeVariants<typeof captionRecipe>>;\ntype TrRecipeVariants = NonNullable<RecipeVariants<typeof trRecipe>>;\ntype ThRecipeVariants = NonNullable<RecipeVariants<typeof thRecipe>>;\ntype TdRecipeVariants = NonNullable<RecipeVariants<typeof tdRecipe>>;\n\nexport type TableVanillaProps = React.TableHTMLAttributes<HTMLTableElement> &\n CSSProps &\n TableRecipeVariants;\n\nexport const TableVanilla = forwardRef<HTMLTableElement, TableVanillaProps>(\n ({ elevation, className, css, style, ...props }, ref) => (\n <table\n ref={ref}\n className={cx(tableRecipe({ elevation }), rowLinkTable, className)}\n style={useInlineStyle(css, style)}\n {...props}\n />\n ),\n);\n\nTableVanilla.displayName = 'TableVanilla';\n\nexport type CaptionVanillaProps = React.HTMLAttributes<HTMLTableCaptionElement> &\n CSSProps &\n CaptionRecipeVariants;\n\nexport const CaptionVanilla = forwardRef<HTMLTableCaptionElement, CaptionVanillaProps>(\n (\n { size, weight, variant, gradient, transform, noWrap, className, css, style, ...props },\n ref,\n ) => (\n <caption\n ref={ref}\n className={cx(\n captionRecipe({ size, weight, variant, gradient, transform, noWrap }),\n className,\n )}\n style={useInlineStyle(css, style)}\n {...props}\n />\n ),\n);\n\nCaptionVanilla.displayName = 'CaptionVanilla';\n\nexport type TableSectionVanillaProps = React.HTMLAttributes<HTMLTableSectionElement> & CSSProps;\n\nconst section = (Tag: 'thead' | 'tbody' | 'tfoot', sectionClass: string, displayName: string) => {\n const Section = forwardRef<HTMLTableSectionElement, TableSectionVanillaProps>(\n ({ className, css, style, ...props }, ref) => (\n <Tag\n ref={ref}\n className={cx(sectionClass, className)}\n style={useInlineStyle(css, style)}\n {...props}\n />\n ),\n );\n Section.displayName = displayName;\n return Section;\n};\n\nexport const TheadVanilla = section('thead', thead, 'TheadVanilla');\nexport const TbodyVanilla = section('tbody', tbody, 'TbodyVanilla');\nexport const TfootVanilla = section('tfoot', tfoot, 'TfootVanilla');\n\nexport type ThVanillaProps = Omit<React.ThHTMLAttributes<HTMLTableCellElement>, 'align'> &\n CSSProps &\n ThRecipeVariants &\n TableSortProps;\n\nexport const ThVanilla = forwardRef<HTMLTableCellElement, ThVanillaProps>(\n (\n {\n size,\n weight,\n variant,\n gradient,\n transform,\n noWrap,\n align,\n sort,\n onSort,\n className,\n css,\n style,\n children,\n ...props\n },\n ref,\n ) => (\n <th\n ref={ref}\n aria-sort={sort && ARIA_SORT[sort]}\n className={cx(\n thRecipe({ size, weight, variant, gradient, transform, noWrap, align }),\n className,\n )}\n style={useInlineStyle(css, style)}\n {...props}\n >\n {onSort ? (\n <SortButtonVanilla sort={sort} onSort={onSort}>\n {children}\n </SortButtonVanilla>\n ) : (\n children\n )}\n </th>\n ),\n);\n\nThVanilla.displayName = 'ThVanilla';\n\nexport type TdVanillaProps = Omit<React.TdHTMLAttributes<HTMLTableCellElement>, 'align'> &\n CSSProps &\n TdRecipeVariants;\n\nexport const TdVanilla = forwardRef<HTMLTableCellElement, TdVanillaProps>(\n ({ subtle, align, className, css, style, ...props }, ref) => (\n <td\n ref={ref}\n className={cx(tdRecipe({ subtle, align }), className)}\n style={useInlineStyle(css, style)}\n {...props}\n />\n ),\n);\n\nTdVanilla.displayName = 'TdVanilla';\n\nexport type TrVanillaProps = React.HTMLAttributes<HTMLTableRowElement> &\n CSSProps &\n TrRecipeVariants &\n RowLinkShortcutProps & {\n /** Content shown in a full-width row below, toggled by a button in a new first cell. */\n collapsedContent?: ReactNode;\n /** Column span of the collapsed content row; set it to the number of columns. */\n collapsedContentColSpan?: number;\n /** Accessible name of the expand button. */\n expandLabel?: string;\n /** Adds an empty first cell, to line up with rows that have an expand button. */\n emptyFirstColumn?: boolean;\n /** Styles the empty first cell as a header, for a row in `TheadVanilla`. */\n tableHead?: boolean;\n };\n\nexport const TrVanilla = forwardRef<HTMLTableRowElement, TrVanillaProps>(\n (\n {\n collapsedContent,\n collapsedContentColSpan = 1,\n expandLabel = 'Expand row',\n emptyFirstColumn = false,\n tableHead = false,\n href,\n linkAs,\n linkCell,\n linkProps,\n linkOverlay,\n interactive,\n active,\n className,\n css,\n style,\n children,\n onClick,\n onAuxClick,\n ...props\n },\n ref,\n ) => {\n const [isOpen, setIsOpen] = useState(false);\n const contentId = useId();\n const inlineStyle = useInlineStyle(css, style);\n const collapsible = !!collapsedContent;\n\n return (\n <>\n <tr\n ref={ref}\n className={cx(\n trRecipe({ interactive: interactive ?? (href !== undefined || undefined), active }),\n rowLinkRow,\n className,\n )}\n data-collapsed={collapsible && !isOpen ? '' : undefined}\n style={inlineStyle}\n onClick={(event) => handleRowClick(event, onClick)}\n onAuxClick={(event) => {\n onAuxClick?.(event);\n openRowLink(event);\n }}\n {...props}\n >\n {emptyFirstColumn &&\n (tableHead ? <td className={cx(thRecipe(), emptyHeaderCell)} /> : <TdVanilla />)}\n {collapsible && (\n <TdVanilla className={toggleCell} onClick={stopEvent}>\n <ExpandToggleVanilla\n label={expandLabel}\n isOpen={isOpen}\n controls={contentId}\n onToggle={() => setIsOpen((open) => !open)}\n />\n </TdVanilla>\n )}\n {mapRowLink(\n children,\n { href, linkAs, linkCell, linkProps, linkOverlay },\n TdVanilla,\n RowLinkVanilla,\n { row: 'TrVanilla', cell: 'TdVanilla' },\n )}\n </tr>\n {collapsible && (\n <TrVanilla>\n <TdVanilla\n id={contentId}\n colSpan={collapsedContentColSpan}\n className={collapsedCell}\n data-closed={isOpen ? undefined : ''}\n >\n <div className={collapsedContentClass}>{collapsedContent}</div>\n </TdVanilla>\n </TrVanilla>\n )}\n </>\n );\n },\n);\n\nTrVanilla.displayName = 'TrVanilla';\n"],"mappings":";;;;;;;;;;;AA0CA,IAAa,eAAe,YACzB,EAAE,WAAW,WAAW,KAAK,OAAO,GAAG,SAAS,QAC/C,oBAAC,SAAD;CACO;CACL,WAAW,GAAG,YAAY,EAAE,UAAU,CAAC,GAAG,cAAc,SAAS;CACjE,OAAO,eAAe,KAAK,KAAK;CAChC,GAAI;AACL,CAAA,CAEL;AAEA,aAAa,cAAc;AAM3B,IAAa,iBAAiB,YAE1B,EAAE,MAAM,QAAQ,SAAS,UAAU,WAAW,QAAQ,WAAW,KAAK,OAAO,GAAG,SAChF,QAEA,oBAAC,WAAD;CACO;CACL,WAAW,GACT,cAAc;EAAE;EAAM;EAAQ;EAAS;EAAU;EAAW;CAAO,CAAC,GACpE,SACF;CACA,OAAO,eAAe,KAAK,KAAK;CAChC,GAAI;AACL,CAAA,CAEL;AAEA,eAAe,cAAc;AAI7B,IAAM,WAAW,KAAkC,cAAsB,gBAAwB;CAC/F,MAAM,UAAU,YACb,EAAE,WAAW,KAAK,OAAO,GAAG,SAAS,QACpC,oBAAC,KAAD;EACO;EACL,WAAW,GAAG,cAAc,SAAS;EACrC,OAAO,eAAe,KAAK,KAAK;EAChC,GAAI;CACL,CAAA,CAEL;CACA,QAAQ,cAAc;CACtB,OAAO;AACT;AAEA,IAAa,eAAe,QAAQ,SAAS,OAAO,cAAc;AAClE,IAAa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ACP,UAAU,UAAU,eAAe,OAAO,OAAO;EACjD,aAAa,UAAU;GACrB,aAAa,KAAK;GAClB,YAAY,KAAK;EACnB;EACA,GAAI;EAdN,UAAA;GAgBG,qBACE,YAAY,oBAAC,MAAD,EAAI,WAAW,GAAG,SAAS,GAAA,YAAkB,EAAI,CAAA,IAAI,oBAAC,WAAD,CAAY,CAAA;GAC/E,eACC,oBAAC,WAAD;IAAW,WAAA;IAAuB,SAAS;IACzC,UAAA,oBAAC,qBAAD;KACE,OAAO;KACC;KACR,UAAU;KACV,gBAAgB,WAAW,SAAS,CAAC,IAAI;IAC1C,CAAA;GACQ,CAAA;GAEZ,WACC,UACA;IAAE;IAAM;IAAQ;IAAU;IAAW;GAAY,GACjD,WACA,gBACA;IAAE,KAAK;IAAa,MAAM;GAAY,CACxC;EACE;CACH,CAAA,GAAA,eACC,oBAAC,WAAD,EAAA,UACE,oBAAC,WAAD;EACE,IAAI;EACJ,SAAS;EACT,WAAA;EACA,eAAa,SAAS,KAAA,IAAY;EAElC,UAAA,oBAAC,OAAD;GAAK,WAAA;GAAmC,UAAAD;EAAsB,CAAA;CACrD,CAAA,EACF,CAAA,CAEb,EAAA,CAAA;AAEN,CACF;AAEA,UAAU,cAAc"}
1
+ {"version":3,"file":"Table.vanilla.js","names":["collapsedContent","_Fragment"],"sources":["../../../components/Table/Table.vanilla.tsx"],"sourcesContent":["import React, { forwardRef, ReactNode, useId, useState } from 'react';\n\nimport { CSSProps } from '@/styles/cssProps';\nimport { cx } from '@/styles/cx';\nimport { RecipeVariantProps, withVariantKeys } from '@/styles/recipeVariants';\nimport { useInlineStyle } from '@/styles/useInlineStyle';\n\nimport {\n handleRowClick,\n mapRowLink,\n openRowLink,\n RowLinkShortcutProps,\n} from '@/components/RowLink/RowLink.utils';\nimport { RowLinkVanilla } from '@/components/RowLink/RowLink.vanilla';\nimport { rowLinkRow, rowLinkTable } from '@/components/RowLink/RowLink.vanilla.css';\n\nimport { ExpandToggleVanilla, stopEvent } from './ExpandToggle.vanilla';\nimport { ARIA_SORT, SortButtonVanilla } from './SortButton.vanilla';\nimport {\n captionRecipe,\n collapsedCell,\n collapsedContent as collapsedContentClass,\n emptyHeaderCell,\n tableRecipe,\n tbody,\n tdRecipe,\n tfoot,\n thead,\n thRecipe,\n toggleCell,\n trRecipe,\n} from './Table.vanilla.css';\nimport { TableSortProps } from './useTableSort';\n\nconst captionClass = withVariantKeys(captionRecipe);\nconst tableClass = withVariantKeys(tableRecipe);\nconst thClass = withVariantKeys(thRecipe);\n\ntype TableRecipeVariants = RecipeVariantProps<typeof tableRecipe>;\ntype CaptionRecipeVariants = RecipeVariantProps<typeof captionRecipe>;\ntype TrRecipeVariants = RecipeVariantProps<typeof trRecipe>;\ntype ThRecipeVariants = RecipeVariantProps<typeof thRecipe>;\ntype TdRecipeVariants = RecipeVariantProps<typeof tdRecipe>;\n\nexport type TableVanillaProps = React.TableHTMLAttributes<HTMLTableElement> &\n CSSProps &\n TableRecipeVariants;\n\nexport const TableVanilla = forwardRef<HTMLTableElement, TableVanillaProps>(\n ({ elevation, className, css, style, ...props }, ref) => (\n <table\n ref={ref}\n className={cx(tableClass({ elevation }), rowLinkTable, className)}\n style={useInlineStyle(css, style)}\n {...props}\n />\n ),\n);\n\nTableVanilla.displayName = 'TableVanilla';\n\nexport type CaptionVanillaProps = React.HTMLAttributes<HTMLTableCaptionElement> &\n CSSProps &\n CaptionRecipeVariants;\n\nexport const CaptionVanilla = forwardRef<HTMLTableCaptionElement, CaptionVanillaProps>(\n (\n { size, weight, variant, gradient, transform, noWrap, className, css, style, ...props },\n ref,\n ) => (\n <caption\n ref={ref}\n className={cx(\n captionClass({ size, weight, variant, gradient, transform, noWrap }),\n className,\n )}\n style={useInlineStyle(css, style)}\n {...props}\n />\n ),\n);\n\nCaptionVanilla.displayName = 'CaptionVanilla';\n\nexport type TableSectionVanillaProps = React.HTMLAttributes<HTMLTableSectionElement> & CSSProps;\n\nconst section = (Tag: 'thead' | 'tbody' | 'tfoot', sectionClass: string, displayName: string) => {\n const Section = forwardRef<HTMLTableSectionElement, TableSectionVanillaProps>(\n ({ className, css, style, ...props }, ref) => (\n <Tag\n ref={ref}\n className={cx(sectionClass, className)}\n style={useInlineStyle(css, style)}\n {...props}\n />\n ),\n );\n Section.displayName = displayName;\n return Section;\n};\n\nexport const TheadVanilla = section('thead', thead, 'TheadVanilla');\nexport const TbodyVanilla = section('tbody', tbody, 'TbodyVanilla');\nexport const TfootVanilla = section('tfoot', tfoot, 'TfootVanilla');\n\nexport type ThVanillaProps = Omit<React.ThHTMLAttributes<HTMLTableCellElement>, 'align'> &\n CSSProps &\n ThRecipeVariants &\n TableSortProps;\n\nexport const ThVanilla = forwardRef<HTMLTableCellElement, ThVanillaProps>(\n (\n {\n size,\n weight,\n variant,\n gradient,\n transform,\n noWrap,\n align,\n sort,\n onSort,\n className,\n css,\n style,\n children,\n ...props\n },\n ref,\n ) => (\n <th\n ref={ref}\n aria-sort={sort && ARIA_SORT[sort]}\n className={cx(\n thClass({ size, weight, variant, gradient, transform, noWrap, align }),\n className,\n )}\n style={useInlineStyle(css, style)}\n {...props}\n >\n {onSort ? (\n <SortButtonVanilla sort={sort} onSort={onSort}>\n {children}\n </SortButtonVanilla>\n ) : (\n children\n )}\n </th>\n ),\n);\n\nThVanilla.displayName = 'ThVanilla';\n\nexport type TdVanillaProps = Omit<React.TdHTMLAttributes<HTMLTableCellElement>, 'align'> &\n CSSProps &\n TdRecipeVariants;\n\nexport const TdVanilla = forwardRef<HTMLTableCellElement, TdVanillaProps>(\n ({ subtle, align, className, css, style, ...props }, ref) => (\n <td\n ref={ref}\n className={cx(tdRecipe({ subtle, align }), className)}\n style={useInlineStyle(css, style)}\n {...props}\n />\n ),\n);\n\nTdVanilla.displayName = 'TdVanilla';\n\nexport type TrVanillaProps = React.HTMLAttributes<HTMLTableRowElement> &\n CSSProps &\n TrRecipeVariants &\n RowLinkShortcutProps & {\n /** Content shown in a full-width row below, toggled by a button in a new first cell. */\n collapsedContent?: ReactNode;\n /** Column span of the collapsed content row; set it to the number of columns. */\n collapsedContentColSpan?: number;\n /** Accessible name of the expand button. */\n expandLabel?: string;\n /** Adds an empty first cell, to line up with rows that have an expand button. */\n emptyFirstColumn?: boolean;\n /** Styles the empty first cell as a header, for a row in `TheadVanilla`. */\n tableHead?: boolean;\n };\n\nexport const TrVanilla = forwardRef<HTMLTableRowElement, TrVanillaProps>(\n (\n {\n collapsedContent,\n collapsedContentColSpan = 1,\n expandLabel = 'Expand row',\n emptyFirstColumn = false,\n tableHead = false,\n href,\n linkAs,\n linkCell,\n linkProps,\n linkOverlay,\n interactive,\n active,\n className,\n css,\n style,\n children,\n onClick,\n onAuxClick,\n ...props\n },\n ref,\n ) => {\n const [isOpen, setIsOpen] = useState(false);\n const contentId = useId();\n const inlineStyle = useInlineStyle(css, style);\n const collapsible = !!collapsedContent;\n\n return (\n <>\n <tr\n ref={ref}\n className={cx(\n trRecipe({ interactive: interactive ?? (href !== undefined || undefined), active }),\n rowLinkRow,\n className,\n )}\n data-collapsed={collapsible && !isOpen ? '' : undefined}\n style={inlineStyle}\n onClick={(event) => handleRowClick(event, onClick)}\n onAuxClick={(event) => {\n onAuxClick?.(event);\n openRowLink(event);\n }}\n {...props}\n >\n {emptyFirstColumn &&\n (tableHead ? <td className={cx(thClass(), emptyHeaderCell)} /> : <TdVanilla />)}\n {collapsible && (\n <TdVanilla className={toggleCell} onClick={stopEvent}>\n <ExpandToggleVanilla\n label={expandLabel}\n isOpen={isOpen}\n controls={contentId}\n onToggle={() => setIsOpen((open) => !open)}\n />\n </TdVanilla>\n )}\n {mapRowLink(\n children,\n { href, linkAs, linkCell, linkProps, linkOverlay },\n TdVanilla,\n RowLinkVanilla,\n { row: 'TrVanilla', cell: 'TdVanilla' },\n )}\n </tr>\n {collapsible && (\n <TrVanilla>\n <TdVanilla\n id={contentId}\n colSpan={collapsedContentColSpan}\n className={collapsedCell}\n data-closed={isOpen ? undefined : ''}\n >\n <div className={collapsedContentClass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,IAAI,oBAAC,WAAD,CAAY,CAAA;GAC9E,eACC,oBAAC,WAAD;IAAW,WAAA;IAAuB,SAAS;IACzC,UAAA,oBAAC,qBAAD;KACE,OAAO;KACC;KACR,UAAU;KACV,gBAAgB,WAAW,SAAS,CAAC,IAAI;IAC1C,CAAA;GACQ,CAAA;GAEZ,WACC,UACA;IAAE;IAAM;IAAQ;IAAU;IAAW;GAAY,GACjD,WACA,gBACA;IAAE,KAAK;IAAa,MAAM;GAAY,CACxC;EACE;CACH,CAAA,GAAA,eACC,oBAAC,WAAD,EAAA,UACE,oBAAC,WAAD;EACE,IAAI;EACJ,SAAS;EACT,WAAA;EACA,eAAa,SAAS,KAAA,IAAY;EAElC,UAAA,oBAAC,OAAD;GAAK,WAAA;GAAmC,UAAAD;EAAsB,CAAA;CACrD,CAAA,EACF,CAAA,CAEb,EAAA,CAAA;AAEN,CACF;AAEA,UAAU,cAAc"}
@@ -1,21 +1,15 @@
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_Text_vanilla_css = require("./Text.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/Text/Text.vanilla.tsx
8
+ var textClass = require_recipeVariants.withVariantKeys(require_Text_vanilla_css.textRecipe);
9
9
  var TextVanillaComponentImpl = (0, react.forwardRef)(({ as, className, css, style, size, weight, variant, gradient, transform, noWrap, ...props }, ref) => {
10
10
  const Component = as || "span";
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 = require_Text_vanilla_css.textRecipe({
11
+ const mergedStyles = require_useInlineStyle.useInlineStyle(css, style);
12
+ const recipeClass = textClass({
19
13
  size,
20
14
  weight,
21
15
  variant,
@@ -1 +1 @@
1
- {"version":3,"file":"Text.vanilla.cjs","names":["forwardRef","useVanillaExtractTheme","processCSSProp","assignInlineVars","textRecipe","cx"],"sources":["../../../components/Text/Text.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 { textRecipe } from './Text.vanilla.css';\n\ntype TextRecipeVariants = RecipeVariants<typeof textRecipe>;\n\ninterface TextOwnProps extends Omit<TextRecipeVariants, never>, CSSProps {}\n\nexport type TextVanillaProps<C extends ElementType = 'span'> = PolymorphicComponentProps<\n C,\n TextOwnProps\n>;\n\ntype TextComponent = PolymorphicComponent<'span', TextVanillaProps<ElementType>>;\n\nconst TextVanillaComponentImpl = forwardRef(\n <C extends ElementType = 'span'>(\n {\n as,\n className,\n css,\n style,\n size,\n weight,\n variant,\n gradient,\n transform,\n noWrap,\n ...props\n }: TextVanillaProps<C>,\n ref?: PolymorphicRef<C>,\n ) => {\n const Component = as || 'span';\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 = textRecipe({ size, weight, variant, gradient, transform, noWrap });\n\n return (\n <Component ref={ref} className={cx(recipeClass, className)} style={mergedStyles} {...props} />\n );\n },\n);\n\nTextVanillaComponentImpl.displayName = 'TextVanilla';\n\nexport const TextVanilla = TextVanillaComponentImpl as TextComponent;\n"],"mappings":";;;;;;;;AAyBA,IAAM,4BAAA,GAA2BA,MAAAA,WAAAA,EAE7B,EACE,IACA,WACA,KACA,OACA,MACA,QACA,SACA,UACA,WACA,QACA,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,yBAAAA,WAAW;EAAE;EAAM;EAAQ;EAAS;EAAU;EAAW;CAAO,CAAC;CAErF,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,WAAD;EAAgB;EAAK,WAAWC,WAAAA,GAAG,aAAa,SAAS;EAAG,OAAO;EAAc,GAAI;CAAQ,CAAA;AAEjG,CACF;AAEA,yBAAyB,cAAc;AAEvC,IAAa,cAAc"}
1
+ {"version":3,"file":"Text.vanilla.cjs","names":["withVariantKeys","textRecipe","forwardRef","useInlineStyle","cx"],"sources":["../../../components/Text/Text.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 { textRecipe } from './Text.vanilla.css';\n\nconst textClass = withVariantKeys(textRecipe);\n\ntype TextRecipeVariants = RecipeVariantProps<typeof textRecipe>;\n\ninterface TextOwnProps extends TextRecipeVariants, CSSProps {}\n\nexport type TextVanillaProps<C extends ElementType = 'span'> = PolymorphicComponentProps<\n C,\n TextOwnProps\n>;\n\ntype TextComponent = PolymorphicComponent<'span', TextVanillaProps<ElementType>>;\n\nconst TextVanillaComponentImpl = forwardRef(\n <C extends ElementType = 'span'>(\n {\n as,\n className,\n css,\n style,\n size,\n weight,\n variant,\n gradient,\n transform,\n noWrap,\n ...props\n }: TextVanillaProps<C>,\n ref?: PolymorphicRef<C>,\n ) => {\n const Component = as || 'span';\n\n const mergedStyles = useInlineStyle(css, style);\n\n const recipeClass = textClass({ size, weight, variant, gradient, transform, noWrap });\n\n return (\n <Component ref={ref} className={cx(recipeClass, className)} style={mergedStyles} {...props} />\n );\n },\n);\n\nTextVanillaComponentImpl.displayName = 'TextVanilla';\n\nexport const TextVanilla = TextVanillaComponentImpl as TextComponent;\n"],"mappings":";;;;;;;AAcA,IAAM,YAAYA,uBAAAA,gBAAgBC,yBAAAA,UAAU;AAa5C,IAAM,4BAAA,GAA2BC,MAAAA,WAAAA,EAE7B,EACE,IACA,WACA,KACA,OACA,MACA,QACA,SACA,UACA,WACA,QACA,GAAG,SAEL,QACG;CACH,MAAM,YAAY,MAAM;CAExB,MAAM,eAAeC,uBAAAA,eAAe,KAAK,KAAK;CAE9C,MAAM,cAAc,UAAU;EAAE;EAAM;EAAQ;EAAS;EAAU;EAAW;CAAO,CAAC;CAEpF,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,WAAD;EAAgB;EAAK,WAAWC,WAAAA,GAAG,aAAa,SAAS;EAAG,OAAO;EAAc,GAAI;CAAQ,CAAA;AAEjG,CACF;AAEA,yBAAyB,cAAc;AAEvC,IAAa,cAAc"}
@@ -1 +1 @@
1
- {"version":3,"file":"Text.vanilla.css.cjs","names":["_7a468"],"sources":["../../../components/Text/Text.vanilla.css.ts"],"sourcesContent":["import { style } from '@vanilla-extract/css';\nimport { recipe } from '@vanilla-extract/recipes';\n\nimport { tokens } from '../../styles';\nimport {\n colorVariants,\n gradientVariants,\n noWrapVariants,\n sizeVariants,\n transformVariants,\n weightVariants,\n} from '../../styles/textVariants.css';\n\nconst text = style({\n lineHeight: '1',\n margin: '0',\n fontFamily: tokens.fonts.rubik,\n fontVariantNumeric: 'tabular-nums',\n display: 'inline-block',\n});\n\nexport const textRecipe = recipe({\n base: text,\n\n variants: {\n size: sizeVariants,\n weight: weightVariants,\n variant: colorVariants,\n gradient: gradientVariants,\n transform: transformVariants,\n noWrap: noWrapVariants,\n },\n\n defaultVariants: {\n size: '3',\n variant: 'default',\n },\n});\n"],"mappings":""}
1
+ {"version":3,"file":"Text.vanilla.css.cjs","names":[],"sources":[],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"Text.vanilla.css.js","names":["_7a468"],"sources":["../../../components/Text/Text.vanilla.css.ts"],"sourcesContent":["import { style } from '@vanilla-extract/css';\nimport { recipe } from '@vanilla-extract/recipes';\n\nimport { tokens } from '../../styles';\nimport {\n colorVariants,\n gradientVariants,\n noWrapVariants,\n sizeVariants,\n transformVariants,\n weightVariants,\n} from '../../styles/textVariants.css';\n\nconst text = style({\n lineHeight: '1',\n margin: '0',\n fontFamily: tokens.fonts.rubik,\n fontVariantNumeric: 'tabular-nums',\n display: 'inline-block',\n});\n\nexport const textRecipe = recipe({\n base: text,\n\n variants: {\n size: sizeVariants,\n weight: weightVariants,\n variant: colorVariants,\n gradient: gradientVariants,\n transform: transformVariants,\n noWrap: noWrapVariants,\n },\n\n defaultVariants: {\n size: '3',\n variant: 'default',\n },\n});\n"],"mappings":""}
1
+ {"version":3,"file":"Text.vanilla.css.js","names":[],"sources":[],"mappings":""}
@@ -1,21 +1,15 @@
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 { textRecipe } from "./Text.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/Text/Text.vanilla.tsx
8
+ var textClass = withVariantKeys(textRecipe);
9
9
  var TextVanillaComponentImpl = forwardRef(({ as, className, css, style, size, weight, variant, gradient, transform, noWrap, ...props }, ref) => {
10
10
  const Component = as || "span";
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 = textRecipe({
11
+ const mergedStyles = useInlineStyle(css, style);
12
+ const recipeClass = textClass({
19
13
  size,
20
14
  weight,
21
15
  variant,
@@ -1 +1 @@
1
- {"version":3,"file":"Text.vanilla.js","names":[],"sources":["../../../components/Text/Text.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 { textRecipe } from './Text.vanilla.css';\n\ntype TextRecipeVariants = RecipeVariants<typeof textRecipe>;\n\ninterface TextOwnProps extends Omit<TextRecipeVariants, never>, CSSProps {}\n\nexport type TextVanillaProps<C extends ElementType = 'span'> = PolymorphicComponentProps<\n C,\n TextOwnProps\n>;\n\ntype TextComponent = PolymorphicComponent<'span', TextVanillaProps<ElementType>>;\n\nconst TextVanillaComponentImpl = forwardRef(\n <C extends ElementType = 'span'>(\n {\n as,\n className,\n css,\n style,\n size,\n weight,\n variant,\n gradient,\n transform,\n noWrap,\n ...props\n }: TextVanillaProps<C>,\n ref?: PolymorphicRef<C>,\n ) => {\n const Component = as || 'span';\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 = textRecipe({ size, weight, variant, gradient, transform, noWrap });\n\n return (\n <Component ref={ref} className={cx(recipeClass, className)} style={mergedStyles} {...props} />\n );\n },\n);\n\nTextVanillaComponentImpl.displayName = 'TextVanilla';\n\nexport const TextVanilla = TextVanillaComponentImpl as TextComponent;\n"],"mappings":";;;;;;;;AAyBA,IAAM,2BAA2B,YAE7B,EACE,IACA,WACA,KACA,OACA,MACA,QACA,SACA,UACA,WACA,QACA,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,WAAW;EAAE;EAAM;EAAQ;EAAS;EAAU;EAAW;CAAO,CAAC;CAErF,OACE,oBAAC,WAAD;EAAgB;EAAK,WAAW,GAAG,aAAa,SAAS;EAAG,OAAO;EAAc,GAAI;CAAQ,CAAA;AAEjG,CACF;AAEA,yBAAyB,cAAc;AAEvC,IAAa,cAAc"}
1
+ {"version":3,"file":"Text.vanilla.js","names":[],"sources":["../../../components/Text/Text.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 { textRecipe } from './Text.vanilla.css';\n\nconst textClass = withVariantKeys(textRecipe);\n\ntype TextRecipeVariants = RecipeVariantProps<typeof textRecipe>;\n\ninterface TextOwnProps extends TextRecipeVariants, CSSProps {}\n\nexport type TextVanillaProps<C extends ElementType = 'span'> = PolymorphicComponentProps<\n C,\n TextOwnProps\n>;\n\ntype TextComponent = PolymorphicComponent<'span', TextVanillaProps<ElementType>>;\n\nconst TextVanillaComponentImpl = forwardRef(\n <C extends ElementType = 'span'>(\n {\n as,\n className,\n css,\n style,\n size,\n weight,\n variant,\n gradient,\n transform,\n noWrap,\n ...props\n }: TextVanillaProps<C>,\n ref?: PolymorphicRef<C>,\n ) => {\n const Component = as || 'span';\n\n const mergedStyles = useInlineStyle(css, style);\n\n const recipeClass = textClass({ size, weight, variant, gradient, transform, noWrap });\n\n return (\n <Component ref={ref} className={cx(recipeClass, className)} style={mergedStyles} {...props} />\n );\n },\n);\n\nTextVanillaComponentImpl.displayName = 'TextVanilla';\n\nexport const TextVanilla = TextVanillaComponentImpl as TextComponent;\n"],"mappings":";;;;;;;AAcA,IAAM,YAAY,gBAAgB,UAAU;AAa5C,IAAM,2BAA2B,YAE7B,EACE,IACA,WACA,KACA,OACA,MACA,QACA,SACA,UACA,WACA,QACA,GAAG,SAEL,QACG;CACH,MAAM,YAAY,MAAM;CAExB,MAAM,eAAe,eAAe,KAAK,KAAK;CAE9C,MAAM,cAAc,UAAU;EAAE;EAAM;EAAQ;EAAS;EAAU;EAAW;CAAO,CAAC;CAEpF,OACE,oBAAC,WAAD;EAAgB;EAAK,WAAW,GAAG,aAAa,SAAS;EAAG,OAAO;EAAc,GAAI;CAAQ,CAAA;AAEjG,CACF;AAEA,yBAAyB,cAAc;AAEvC,IAAa,cAAc"}
@@ -1 +1 @@
1
- {"version":3,"file":"TextField.vanilla.cjs","names":["React","useFieldContext","EyeClosedIcon","EyeOpenIcon","_Fragment","ExclamationTriangleIcon","Tooltip","CrossCircledIcon","InputVanilla","FieldVanilla"],"sources":["../../../components/TextField/TextField.vanilla.tsx"],"sourcesContent":["import {\n CrossCircledIcon,\n ExclamationTriangleIcon,\n EyeClosedIcon,\n EyeOpenIcon,\n} from '@radix-ui/react-icons';\nimport React from 'react';\n\nimport { FieldVanilla } from '../Field/Field.vanilla';\nimport { FieldLabelProps, useFieldContext } from '../Field/FieldContext';\nimport { InputVanilla, InputVanillaHandle, InputVanillaProps } from '../Input';\nimport { Tooltip } from '../Tooltip';\nimport { adornmentButton, adornmentGroup, invalidIcon } from './TextField.vanilla.css';\n\n// TYPES\nexport interface TextFieldLabelProps {\n variant: 'invalid' | 'subtle' | 'contrast' | 'default';\n htmlFor?: string;\n id?: string;\n}\n\nexport type TextFieldVanillaProps = InputVanillaProps & {\n type?: string;\n clearable?: boolean;\n label?: string | ((props: TextFieldLabelProps) => JSX.Element);\n description?: React.ReactNode;\n error?: React.ReactNode;\n announceError?: boolean;\n};\n\nexport const TextFieldVanilla = React.forwardRef<\n React.ElementRef<typeof InputVanilla>,\n TextFieldVanillaProps\n>(\n (\n {\n state,\n clearable,\n label: LabelOrComponent,\n description,\n error,\n announceError,\n id,\n type,\n disabled,\n readOnly,\n css,\n ...props\n },\n forwardedRef,\n ) => {\n const inputRef = React.useRef<InputVanillaHandle | null>(null);\n React.useImperativeHandle(forwardedRef, () => inputRef.current as InputVanillaHandle);\n\n const outerField = useFieldContext();\n const [innerType, setInnerType] = React.useState(type);\n const isPasswordVisible = React.useMemo(() => innerType !== 'password', [innerType]);\n\n const invalid = state === 'invalid' || Boolean(error) || Boolean(outerField?.invalid);\n\n const renderLabel = React.useMemo(() => {\n if (LabelOrComponent === undefined || LabelOrComponent === null) {\n return undefined;\n }\n if (typeof LabelOrComponent === 'string') {\n return LabelOrComponent;\n }\n return (labelProps: FieldLabelProps) => <LabelOrComponent {...labelProps} />;\n }, [LabelOrComponent]);\n\n const isPasswordType = React.useMemo(() => type === 'password', [type]);\n\n const typeOrInnerType = React.useMemo(\n () => (isPasswordType ? innerType : type),\n [isPasswordType, type, innerType],\n );\n\n const hasInnerAdornment = React.useMemo(\n () => clearable || isPasswordType || invalid,\n [clearable, isPasswordType, invalid],\n );\n\n const hasAdornmentGroup = React.useMemo(\n () => (clearable && invalid) || (clearable && isPasswordType) || (invalid && isPasswordType),\n [clearable, invalid, isPasswordType],\n );\n\n const clearDisabled = readOnly || disabled || Boolean(outerField?.disabled);\n\n const handleClear = React.useCallback(() => {\n const { current } = inputRef;\n if (current) {\n const setValue = Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, 'value')?.set;\n setValue?.call(current, '');\n current.dispatchEvent(new Event('input', { bubbles: true }));\n current.focus();\n }\n }, [inputRef]);\n\n const togglePasswordVisibility = React.useCallback(() => {\n setInnerType((prevInnerType) => (prevInnerType === 'password' ? undefined : 'password'));\n }, [setInnerType]);\n\n const PasswordVisibilityToggleIcon = isPasswordVisible ? EyeClosedIcon : EyeOpenIcon;\n\n const passwordAction = React.useMemo(\n () => (isPasswordVisible ? 'Hide password' : 'Show password'),\n [isPasswordVisible],\n );\n\n const adornments = (\n <>\n {invalid && <ExclamationTriangleIcon className={invalidIcon} aria-hidden />}\n {isPasswordType && (\n <Tooltip content={passwordAction}>\n <button\n type=\"button\"\n className={adornmentButton}\n aria-label={passwordAction}\n onClick={togglePasswordVisibility}\n >\n <PasswordVisibilityToggleIcon aria-hidden />\n </button>\n </Tooltip>\n )}\n {clearable && !clearDisabled && (\n <Tooltip content=\"Clear\">\n <button\n type=\"button\"\n className={adornmentButton}\n aria-label=\"Clear\"\n onClick={handleClear}\n >\n <CrossCircledIcon aria-hidden />\n </button>\n </Tooltip>\n )}\n </>\n );\n\n const input = (\n <InputVanilla\n id={id}\n ref={inputRef}\n endAdornment={\n hasInnerAdornment &&\n (hasAdornmentGroup ? <div className={adornmentGroup}>{adornments}</div> : adornments)\n }\n state={state}\n type={typeOrInnerType}\n disabled={disabled}\n readOnly={readOnly}\n {...props}\n />\n );\n\n return (\n <FieldVanilla\n id={id}\n label={renderLabel}\n description={description}\n error={error}\n announceError={announceError}\n invalid={state === 'invalid'}\n disabled={disabled}\n css={{ boxSizing: 'border-box', ...css }}\n >\n {input}\n </FieldVanilla>\n );\n },\n);\n\nTextFieldVanilla.displayName = 'TextFieldVanilla';\n"],"mappings":";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QACJ,iBAAA,GAAA,kBAAA,IAAA,CAACC,sBAAAA,cAAD;EACM;EACJ,KAAK;EACL,cACE,sBACC,oBAAoB,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;GAAK,WAAA;GAA4B,UAAA;EAAgB,CAAA,IAAI;EAErE;EACP,MAAM;EACI;EACA;EACV,GAAI;CACL,CAAA;CAGH,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACC,sBAAAA,cAAD;EACM;EACJ,OAAO;EACM;EACN;EACQ;EACf,SAAS,UAAU;EACT;EACV,KAAK;GAAE,WAAW;GAAc,GAAG;EAAI;EAEtC,UAAA;CACW,CAAA;AAElB,CACF;AAEA,iBAAiB,cAAc"}
1
+ {"version":3,"file":"TextField.vanilla.cjs","names":["React","useFieldContext","EyeClosedIcon","EyeOpenIcon","_Fragment","ExclamationTriangleIcon","Tooltip","CrossCircledIcon","InputVanilla","FieldVanilla"],"sources":["../../../components/TextField/TextField.vanilla.tsx"],"sourcesContent":["import {\n CrossCircledIcon,\n ExclamationTriangleIcon,\n EyeClosedIcon,\n EyeOpenIcon,\n} from '@radix-ui/react-icons';\nimport React from 'react';\n\nimport { FieldVanilla } from '@/components/Field/Field.vanilla';\nimport { FieldLabelProps, useFieldContext } from '@/components/Field/FieldContext';\nimport { InputVanilla, InputVanillaHandle, InputVanillaProps } from '@/components/Input';\nimport { Tooltip } from '@/components/Tooltip';\n\nimport { adornmentButton, adornmentGroup, invalidIcon } from './TextField.vanilla.css';\n\n// TYPES\nexport interface TextFieldLabelProps {\n variant: 'invalid' | 'subtle' | 'contrast' | 'default';\n htmlFor?: string;\n id?: string;\n}\n\nexport type TextFieldVanillaProps = InputVanillaProps & {\n type?: string;\n clearable?: boolean;\n label?: string | ((props: TextFieldLabelProps) => JSX.Element);\n description?: React.ReactNode;\n error?: React.ReactNode;\n announceError?: boolean;\n};\n\nexport const TextFieldVanilla = React.forwardRef<\n React.ElementRef<typeof InputVanilla>,\n TextFieldVanillaProps\n>(\n (\n {\n state,\n clearable,\n label: LabelOrComponent,\n description,\n error,\n announceError,\n id,\n type,\n disabled,\n readOnly,\n css,\n ...props\n },\n forwardedRef,\n ) => {\n const inputRef = React.useRef<InputVanillaHandle | null>(null);\n React.useImperativeHandle(forwardedRef, () => inputRef.current as InputVanillaHandle);\n\n const outerField = useFieldContext();\n const [innerType, setInnerType] = React.useState(type);\n const isPasswordVisible = React.useMemo(() => innerType !== 'password', [innerType]);\n\n const invalid = state === 'invalid' || Boolean(error) || Boolean(outerField?.invalid);\n\n const renderLabel = React.useMemo(() => {\n if (LabelOrComponent === undefined || LabelOrComponent === null) {\n return undefined;\n }\n if (typeof LabelOrComponent === 'string') {\n return LabelOrComponent;\n }\n return (labelProps: FieldLabelProps) => <LabelOrComponent {...labelProps} />;\n }, [LabelOrComponent]);\n\n const isPasswordType = React.useMemo(() => type === 'password', [type]);\n\n const typeOrInnerType = React.useMemo(\n () => (isPasswordType ? innerType : type),\n [isPasswordType, type, innerType],\n );\n\n const hasInnerAdornment = React.useMemo(\n () => clearable || isPasswordType || invalid,\n [clearable, isPasswordType, invalid],\n );\n\n const hasAdornmentGroup = React.useMemo(\n () => (clearable && invalid) || (clearable && isPasswordType) || (invalid && isPasswordType),\n [clearable, invalid, isPasswordType],\n );\n\n const clearDisabled = readOnly || disabled || Boolean(outerField?.disabled);\n\n const handleClear = React.useCallback(() => {\n const { current } = inputRef;\n if (current) {\n const setValue = Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, 'value')?.set;\n setValue?.call(current, '');\n current.dispatchEvent(new Event('input', { bubbles: true }));\n current.focus();\n }\n }, [inputRef]);\n\n const togglePasswordVisibility = React.useCallback(() => {\n setInnerType((prevInnerType) => (prevInnerType === 'password' ? undefined : 'password'));\n }, [setInnerType]);\n\n const PasswordVisibilityToggleIcon = isPasswordVisible ? EyeClosedIcon : EyeOpenIcon;\n\n const passwordAction = React.useMemo(\n () => (isPasswordVisible ? 'Hide password' : 'Show password'),\n [isPasswordVisible],\n );\n\n const adornments = (\n <>\n {invalid && <ExclamationTriangleIcon className={invalidIcon} aria-hidden />}\n {isPasswordType && (\n <Tooltip content={passwordAction}>\n <button\n type=\"button\"\n className={adornmentButton}\n aria-label={passwordAction}\n onClick={togglePasswordVisibility}\n >\n <PasswordVisibilityToggleIcon aria-hidden />\n </button>\n </Tooltip>\n )}\n {clearable && !clearDisabled && (\n <Tooltip content=\"Clear\">\n <button\n type=\"button\"\n className={adornmentButton}\n aria-label=\"Clear\"\n onClick={handleClear}\n >\n <CrossCircledIcon aria-hidden />\n </button>\n </Tooltip>\n )}\n </>\n );\n\n const input = (\n <InputVanilla\n id={id}\n ref={inputRef}\n endAdornment={\n hasInnerAdornment &&\n (hasAdornmentGroup ? <div className={adornmentGroup}>{adornments}</div> : adornments)\n }\n state={state}\n type={typeOrInnerType}\n disabled={disabled}\n readOnly={readOnly}\n {...props}\n />\n );\n\n return (\n <FieldVanilla\n id={id}\n label={renderLabel}\n description={description}\n error={error}\n announceError={announceError}\n invalid={state === 'invalid'}\n disabled={disabled}\n css={{ boxSizing: 'border-box', ...css }}\n >\n {input}\n </FieldVanilla>\n );\n },\n);\n\nTextFieldVanilla.displayName = 'TextFieldVanilla';\n"],"mappings":";;;;;;;;;;;AA+BA,IAAa,mBAAmBA,MAAAA,QAAM,YAKlC,EACE,OACA,WACA,OAAO,kBACP,aACA,OACA,eACA,IACA,MACA,UACA,UACA,KACA,GAAG,SAEL,iBACG;CACH,MAAM,WAAWA,MAAAA,QAAM,OAAkC,IAAI;CAC7D,MAAA,QAAM,oBAAoB,oBAAoB,SAAS,OAA6B;CAEpF,MAAM,aAAaC,qBAAAA,gBAAgB;CACnC,MAAM,CAAC,WAAW,gBAAgBD,MAAAA,QAAM,SAAS,IAAI;CACrD,MAAM,oBAAoBA,MAAAA,QAAM,cAAc,cAAc,YAAY,CAAC,SAAS,CAAC;CAEnF,MAAM,UAAU,UAAU,aAAa,QAAQ,KAAK,KAAK,QAAQ,YAAY,OAAO;CAEpF,M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.cjs","names":[],"sources":["../../../components/TextField/TextField.vanilla.css.ts"],"sourcesContent":["import { globalStyle, style } from '@vanilla-extract/css';\n\nimport { tokens } from '../../styles/tokens.css';\n\nexport const adornmentGroup = style({\n display: 'flex',\n flexDirection: 'row',\n alignItems: 'center',\n});\n\nexport const invalidIcon = style({});\n\nglobalStyle(`${invalidIcon} + *`, {\n marginLeft: tokens.space['1'],\n});\n\nexport const adornmentButton = style({\n appearance: 'none',\n background: 'none',\n border: 'none',\n padding: 0,\n font: 'inherit',\n display: 'inline-flex',\n alignItems: 'center',\n justifyContent: 'center',\n borderRadius: tokens.radii['1'],\n color: 'inherit',\n cursor: 'pointer',\n selectors: {\n '&:focus-visible': {\n outline: `2px solid ${tokens.colors.inputFocusBorder}`,\n outlineOffset: '1px',\n },\n },\n});\n"],"mappings":""}
1
+ {"version":3,"file":"TextField.vanilla.css.cjs","names":[],"sources":[],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"TextField.vanilla.css.js","names":[],"sources":["../../../components/TextField/TextField.vanilla.css.ts"],"sourcesContent":["import { globalStyle, style } from '@vanilla-extract/css';\n\nimport { tokens } from '../../styles/tokens.css';\n\nexport const adornmentGroup = style({\n display: 'flex',\n flexDirection: 'row',\n alignItems: 'center',\n});\n\nexport const invalidIcon = style({});\n\nglobalStyle(`${invalidIcon} + *`, {\n marginLeft: tokens.space['1'],\n});\n\nexport const adornmentButton = style({\n appearance: 'none',\n background: 'none',\n border: 'none',\n padding: 0,\n font: 'inherit',\n display: 'inline-flex',\n alignItems: 'center',\n justifyContent: 'center',\n borderRadius: tokens.radii['1'],\n color: 'inherit',\n cursor: 'pointer',\n selectors: {\n '&:focus-visible': {\n outline: `2px solid ${tokens.colors.inputFocusBorder}`,\n outlineOffset: '1px',\n },\n },\n});\n"],"mappings":""}
1
+ {"version":3,"file":"TextField.vanilla.css.js","names":[],"sources":[],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"TextField.vanilla.js","names":["_Fragment"],"sources":["../../../components/TextField/TextField.vanilla.tsx"],"sourcesContent":["import {\n CrossCircledIcon,\n ExclamationTriangleIcon,\n EyeClosedIcon,\n EyeOpenIcon,\n} from '@radix-ui/react-icons';\nimport React from 'react';\n\nimport { FieldVanilla } from '../Field/Field.vanilla';\nimport { FieldLabelProps, useFieldContext } from '../Field/FieldContext';\nimport { InputVanilla, InputVanillaHandle, InputVanillaProps } from '../Input';\nimport { Tooltip } from '../Tooltip';\nimport { adornmentButton, adornmentGroup, invalidIcon } from './TextField.vanilla.css';\n\n// TYPES\nexport interface TextFieldLabelProps {\n variant: 'invalid' | 'subtle' | 'contrast' | 'default';\n htmlFor?: string;\n id?: string;\n}\n\nexport type TextFieldVanillaProps = InputVanillaProps & {\n type?: string;\n clearable?: boolean;\n label?: string | ((props: TextFieldLabelProps) => JSX.Element);\n description?: React.ReactNode;\n error?: React.ReactNode;\n announceError?: boolean;\n};\n\nexport const TextFieldVanilla = React.forwardRef<\n React.ElementRef<typeof InputVanilla>,\n TextFieldVanillaProps\n>(\n (\n {\n state,\n clearable,\n label: LabelOrComponent,\n description,\n error,\n announceError,\n id,\n type,\n disabled,\n readOnly,\n css,\n ...props\n },\n forwardedRef,\n ) => {\n const inputRef = React.useRef<InputVanillaHandle | null>(null);\n React.useImperativeHandle(forwardedRef, () => inputRef.current as InputVanillaHandle);\n\n const outerField = useFieldContext();\n const [innerType, setInnerType] = React.useState(type);\n const isPasswordVisible = React.useMemo(() => innerType !== 'password', [innerType]);\n\n const invalid = state === 'invalid' || Boolean(error) || Boolean(outerField?.invalid);\n\n const renderLabel = React.useMemo(() => {\n if (LabelOrComponent === undefined || LabelOrComponent === null) {\n return undefined;\n }\n if (typeof LabelOrComponent === 'string') {\n return LabelOrComponent;\n }\n return (labelProps: FieldLabelProps) => <LabelOrComponent {...labelProps} />;\n }, [LabelOrComponent]);\n\n const isPasswordType = React.useMemo(() => type === 'password', [type]);\n\n const typeOrInnerType = React.useMemo(\n () => (isPasswordType ? innerType : type),\n [isPasswordType, type, innerType],\n );\n\n const hasInnerAdornment = React.useMemo(\n () => clearable || isPasswordType || invalid,\n [clearable, isPasswordType, invalid],\n );\n\n const hasAdornmentGroup = React.useMemo(\n () => (clearable && invalid) || (clearable && isPasswordType) || (invalid && isPasswordType),\n [clearable, invalid, isPasswordType],\n );\n\n const clearDisabled = readOnly || disabled || Boolean(outerField?.disabled);\n\n const handleClear = React.useCallback(() => {\n const { current } = inputRef;\n if (current) {\n const setValue = Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, 'value')?.set;\n setValue?.call(current, '');\n current.dispatchEvent(new Event('input', { bubbles: true }));\n current.focus();\n }\n }, [inputRef]);\n\n const togglePasswordVisibility = React.useCallback(() => {\n setInnerType((prevInnerType) => (prevInnerType === 'password' ? undefined : 'password'));\n }, [setInnerType]);\n\n const PasswordVisibilityToggleIcon = isPasswordVisible ? EyeClosedIcon : EyeOpenIcon;\n\n const passwordAction = React.useMemo(\n () => (isPasswordVisible ? 'Hide password' : 'Show password'),\n [isPasswordVisible],\n );\n\n const adornments = (\n <>\n {invalid && <ExclamationTriangleIcon className={invalidIcon} aria-hidden />}\n {isPasswordType && (\n <Tooltip content={passwordAction}>\n <button\n type=\"button\"\n className={adornmentButton}\n aria-label={passwordAction}\n onClick={togglePasswordVisibility}\n >\n <PasswordVisibilityToggleIcon aria-hidden />\n </button>\n </Tooltip>\n )}\n {clearable && !clearDisabled && (\n <Tooltip content=\"Clear\">\n <button\n type=\"button\"\n className={adornmentButton}\n aria-label=\"Clear\"\n onClick={handleClear}\n >\n <CrossCircledIcon aria-hidden />\n </button>\n </Tooltip>\n )}\n </>\n );\n\n const input = (\n <InputVanilla\n id={id}\n ref={inputRef}\n endAdornment={\n hasInnerAdornment &&\n (hasAdornmentGroup ? <div className={adornmentGroup}>{adornments}</div> : adornments)\n }\n state={state}\n type={typeOrInnerType}\n disabled={disabled}\n readOnly={readOnly}\n {...props}\n />\n );\n\n return (\n <FieldVanilla\n id={id}\n label={renderLabel}\n description={description}\n error={error}\n announceError={announceError}\n invalid={state === 'invalid'}\n disabled={disabled}\n css={{ boxSizing: 'border-box', ...css }}\n >\n {input}\n </FieldVanilla>\n );\n },\n);\n\nTextFieldVanilla.displayName = 'TextFieldVanilla';\n"],"mappings":";;;;;;;;;AA8BA,IAAa,mBAAmB,MAAM,YAKlC,EACE,OACA,WACA,OAAO,kBACP,aACA,OACA,eACA,IACA,MACA,UACA,UACA,KACA,GAAG,SAEL,iBACG;CACH,MAAM,WAAW,MAAM,OAAkC,IAAI;CAC7D,MAAM,oBAAoB,oBAAoB,SAAS,OAA6B;CAEpF,MAAM,aAAa,gBAAgB;CACnC,MAAM,CAAC,WAAW,gBAAgB,MAAM,SAAS,IAAI;CACrD,MAAM,oBAAoB,MAAM,cAAc,cAAc,YAAY,CAAC,SAAS,CAAC;CAEnF,MAAM,UAAU,UAAU,aAAa,QAAQ,KAAK,KAAK,QAAQ,YAAY,OAAO;CAEpF,MAAM,cAAc,MAAM,cAAc;EACtC,IAAI,qBAAqB,KAAA,KAAa,qBAAqB,MACzD;EAEF,IAAI,OAAO,qBAAqB,UAC9B,OAAO;EAET,QAAQ,eAAgC,oBAAC,kBAAD,EAAkB,GAAI,WAAa,CAAA;CAC7E,GAAG,CAAC,gBAAgB,CAAC;CAErB,MAAM,iBAAiB,MAAM,cAAc,SAAS,YAAY,CAAC,IAAI,CAAC;CAEtE,MAAM,kBAAkB,MAAM,cACrB,iBAAiB,YAAY,MACpC;EAAC;EAAgB;EAAM;CAAS,CAClC;CAEA,MAAM,oBAAoB,MAAM,cACxB,aAAa,kBAAkB,SACrC;EAAC;EAAW;EAAgB;CAAO,CACrC;CAEA,MAAM,oBAAoB,MAAM,cACvB,aAAa,WAAa,aAAa,kBAAoB,WAAW,gBAC7E;EAAC;EAAW;EAAS;CAAc,CACrC;CAEA,MAAM,gBAAgB,YAAY,YAAY,QAAQ,YAAY,QAAQ;CAE1E,MAAM,cAAc,MAAM,kBAAkB;EAC1C,MAAM,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EACT;EACV,KAAK;GAAE,WAAW;GAAc,GAAG;EAAI;EAEtC,UAAA;CACW,CAAA;AAElB,CACF;AAEA,iBAAiB,cAAc"}
1
+ {"version":3,"file":"TextField.vanilla.js","names":["_Fragment"],"sources":["../../../components/TextField/TextField.vanilla.tsx"],"sourcesContent":["import {\n CrossCircledIcon,\n ExclamationTriangleIcon,\n EyeClosedIcon,\n EyeOpenIcon,\n} from '@radix-ui/react-icons';\nimport React from 'react';\n\nimport { FieldVanilla } from '@/components/Field/Field.vanilla';\nimport { FieldLabelProps, useFieldContext } from '@/components/Field/FieldContext';\nimport { InputVanilla, InputVanillaHandle, InputVanillaProps } from '@/components/Input';\nimport { Tooltip } from '@/components/Tooltip';\n\nimport { adornmentButton, adornmentGroup, invalidIcon } from './TextField.vanilla.css';\n\n// TYPES\nexport interface TextFieldLabelProps {\n variant: 'invalid' | 'subtle' | 'contrast' | 'default';\n htmlFor?: string;\n id?: string;\n}\n\nexport type TextFieldVanillaProps = InputVanillaProps & {\n type?: string;\n clearable?: boolean;\n label?: string | ((props: TextFieldLabelProps) => JSX.Element);\n description?: React.ReactNode;\n error?: React.ReactNode;\n announceError?: boolean;\n};\n\nexport const TextFieldVanilla = React.forwardRef<\n React.ElementRef<typeof InputVanilla>,\n TextFieldVanillaProps\n>(\n (\n {\n state,\n clearable,\n label: LabelOrComponent,\n description,\n error,\n announceError,\n id,\n type,\n disabled,\n readOnly,\n css,\n ...props\n },\n forwardedRef,\n ) => {\n const inputRef = React.useRef<InputVanillaHandle | null>(null);\n React.useImperativeHandle(forwardedRef, () => inputRef.current as InputVanillaHandle);\n\n const outerField = useFieldContext();\n const [innerType, setInnerType] = React.useState(type);\n const isPasswordVisible = React.useMemo(() => innerType !== 'password', [innerType]);\n\n const invalid = state === 'invalid' || Boolean(error) || Boolean(outerField?.invalid);\n\n const renderLabel = React.useMemo(() => {\n if (LabelOrComponent === undefined || LabelOrComponent === null) {\n return undefined;\n }\n if (typeof LabelOrComponent === 'string') {\n return LabelOrComponent;\n }\n return (labelProps: FieldLabelProps) => <LabelOrComponent {...labelProps} />;\n }, [LabelOrComponent]);\n\n const isPasswordType = React.useMemo(() => type === 'password', [type]);\n\n const typeOrInnerType = React.useMemo(\n () => (isPasswordType ? innerType : type),\n [isPasswordType, type, innerType],\n );\n\n const hasInnerAdornment = React.useMemo(\n () => clearable || isPasswordType || invalid,\n [clearable, isPasswordType, invalid],\n );\n\n const hasAdornmentGroup = React.useMemo(\n () => (clearable && invalid) || (clearable && isPasswordType) || (invalid && isPasswordType),\n [clearable, invalid, isPasswordType],\n );\n\n const clearDisabled = readOnly || disabled || Boolean(outerField?.disabled);\n\n const handleClear = React.useCallback(() => {\n const { current } = inputRef;\n if (current) {\n const setValue = Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, 'value')?.set;\n setValue?.call(current, '');\n current.dispatchEvent(new Event('input', { bubbles: true }));\n current.focus();\n }\n }, [inputRef]);\n\n const togglePasswordVisibility = React.useCallback(() => {\n setInnerType((prevInnerType) => (prevInnerType === 'password' ? undefined : 'password'));\n }, [setInnerType]);\n\n const PasswordVisibilityToggleIcon = isPasswordVisible ? EyeClosedIcon : EyeOpenIcon;\n\n const passwordAction = React.useMemo(\n () => (isPasswordVisible ? 'Hide password' : 'Show password'),\n [isPasswordVisible],\n );\n\n const adornments = (\n <>\n {invalid && <ExclamationTriangleIcon className={invalidIcon} aria-hidden />}\n {isPasswordType && (\n <Tooltip content={passwordAction}>\n <button\n type=\"button\"\n className={adornmentButton}\n aria-label={passwordAction}\n onClick={togglePasswordVisibility}\n >\n <PasswordVisibilityToggleIcon aria-hidden />\n </button>\n </Tooltip>\n )}\n {clearable && !clearDisabled && (\n <Tooltip content=\"Clear\">\n <button\n type=\"button\"\n className={adornmentButton}\n aria-label=\"Clear\"\n onClick={handleClear}\n >\n <CrossCircledIcon aria-hidden />\n </button>\n </Tooltip>\n )}\n </>\n );\n\n const input = (\n <InputVanilla\n id={id}\n ref={inputRef}\n endAdornment={\n hasInnerAdornment &&\n (hasAdornmentGroup ? <div className={adornmentGroup}>{adornments}</div> : adornments)\n }\n state={state}\n type={typeOrInnerType}\n disabled={disabled}\n readOnly={readOnly}\n {...props}\n />\n );\n\n return (\n <FieldVanilla\n id={id}\n label={renderLabel}\n description={description}\n error={error}\n announceError={announceError}\n invalid={state === 'invalid'}\n disabled={disabled}\n css={{ boxSizing: 'border-box', ...css }}\n >\n {input}\n </FieldVanilla>\n );\n },\n);\n\nTextFieldVanilla.displayName = 'TextFieldVanilla';\n"],"mappings":";;;;;;;;;AA+BA,IAAa,mBAAmB,MAAM,YAKlC,EACE,OACA,WACA,OAAO,kBACP,aACA,OACA,eACA,IACA,MACA,UACA,UACA,KACA,GAAG,SAEL,iBACG;CACH,MAAM,WAAW,MAAM,OAAkC,IAAI;CAC7D,MAAM,oBAAoB,oBAAoB,SAAS,OAA6B;CAEpF,MAAM,aAAa,gBAAgB;CACnC,MAAM,CAAC,WAAW,gBAAgB,MAAM,SAAS,IAAI;CACrD,MAAM,oBAAoB,MAAM,cAAc,cAAc,YAAY,CAAC,SAAS,CAAC;CAEnF,MAAM,UAAU,UAAU,aAAa,QAAQ,KAAK,KAAK,QAAQ,YAAY,OAAO;CAEpF,MAAM,cAAc,MAAM,cAAc;EACtC,IAAI,qBAAqB,KAAA,KAAa,qBAAqB,MACzD;EAEF,IAAI,OAAO,qBAAqB,UAC9B,OAAO;EAET,QAAQ,eAAgC,oBAAC,kBAAD,EAAkB,GAAI,WAAa,CAAA;CAC7E,GAAG,CAAC,gBAAgB,CAAC;CAErB,MAAM,iBAAiB,MAAM,cAAc,SAAS,YAAY,CAAC,IAAI,CAAC;CAEtE,MAAM,kBAAkB,MAAM,cACrB,iBAAiB,YAAY,MACpC;EAAC;EAAgB;EAAM;CAAS,CAClC;CAEA,MAAM,oBAAoB,MAAM,cACxB,aAAa,kBAAkB,SACrC;EAAC;EAAW;EAAgB;CAAO,CACrC;CAEA,MAAM,oBAAoB,MAAM,cACvB,aAAa,W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AK,WAAA;GAA4B,UAAA;EAAgB,CAAA,IAAI;EAErE;EACP,MAAM;EACI;EACA;EACV,GAAI;CACL,CAAA;CAGH,OACE,oBAAC,cAAD;EACM;EACJ,OAAO;EACM;EACN;EACQ;EACf,SAAS,UAAU;EACT;EACV,KAAK;GAAE,WAAW;GAAc,GAAG;EAAI;EAEtC,UAAA;CACW,CAAA;AAElB,CACF;AAEA,iBAAiB,cAAc"}
@@ -1,18 +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_Field_vanilla = require("../Field/Field.vanilla.cjs");
6
5
  const require_FieldContext = require("../Field/FieldContext.cjs");
7
6
  const require_Label_vanilla = require("../Label/Label.vanilla.cjs");
8
7
  const require_Textarea_vanilla_css = require("./Textarea.vanilla.css.cjs");
9
8
  let react = require("react");
10
9
  react = require_runtime.__toESM(react, 1);
11
- let _vanilla_extract_dynamic = require("@vanilla-extract/dynamic");
12
10
  let react_jsx_runtime = require("react/jsx-runtime");
13
11
  // components/Textarea/Textarea.vanilla.tsx
14
12
  var TextareaVanillaControl = react.default.forwardRef(({ state, disabled, id, css, endAdornment, variant, cursor, resize, className, style, "aria-describedby": ariaDescribedBy, "aria-invalid": ariaInvalid, ...props }, forwardedRef) => {
15
- const { colors } = require_themeContext.useVanillaExtractTheme();
16
13
  const control = require_FieldContext.useFieldControl({
17
14
  id,
18
15
  disabled,
@@ -22,12 +19,7 @@ var TextareaVanillaControl = react.default.forwardRef(({ state, disabled, id, cs
22
19
  });
23
20
  const resolvedState = control.invalid ? "invalid" : state;
24
21
  const hasEndAdornment = Boolean(endAdornment);
25
- const { style: cssStyles, vars } = require_cssProps.processCSSProp(css, colors);
26
- const mergedStyles = {
27
- ...cssStyles,
28
- ...style,
29
- ...(0, _vanilla_extract_dynamic.assignInlineVars)(vars)
30
- };
22
+ const mergedStyles = require_useInlineStyle.useInlineStyle(css, style);
31
23
  const textareaWrapperClass = require_Textarea_vanilla_css.textareaWrapperRecipe({
32
24
  state: resolvedState,
33
25
  disabled: control.disabled
@@ -1 +1 @@
1
- {"version":3,"file":"Textarea.vanilla.cjs","names":["React","useVanillaExtractTheme","useFieldControl","processCSSProp","assignInlineVars","textareaWrapperRecipe","styledTextareaRecipe","cx","FieldVanilla","LabelVanilla"],"sources":["../../../components/Textarea/Textarea.vanilla.tsx"],"sourcesContent":["import { assignInlineVars } from '@vanilla-extract/dynamic';\nimport { RecipeVariants } from '@vanilla-extract/recipes';\nimport React from 'react';\n\nimport { CSSProps, processCSSProp } from '../../styles/cssProps';\nimport { cx } from '../../styles/cx';\nimport { useVanillaExtractTheme } from '../../styles/themeContext';\nimport { FieldVanilla } from '../Field/Field.vanilla';\nimport { FieldLabelProps, useFieldControl } from '../Field/FieldContext';\nimport { LabelVanilla } from '../Label';\nimport {\n adornmentWrapperEnd,\n styledTextareaRecipe,\n textareaWrapperRecipe,\n} from './Textarea.vanilla.css';\n\ntype StyledTextareaRecipeVariants = NonNullable<RecipeVariants<typeof styledTextareaRecipe>>;\n\nexport interface TextareaVanillaOwnProps extends CSSProps {\n variant?: StyledTextareaRecipeVariants['variant'];\n state?: StyledTextareaRecipeVariants['state'];\n cursor?: StyledTextareaRecipeVariants['cursor'];\n resize?: StyledTextareaRecipeVariants['resize'];\n label?: string;\n description?: React.ReactNode;\n error?: React.ReactNode;\n announceError?: boolean;\n endAdornment?: React.ReactNode;\n rootCss?: CSSProps['css'];\n}\n\nexport type TextareaVanillaProps = Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, 'size'> &\n TextareaVanillaOwnProps;\n\ntype TextareaVanillaControlProps = Omit<\n TextareaVanillaProps,\n 'label' | 'description' | 'error' | 'announceError' | 'rootCss'\n>;\n\nconst TextareaVanillaControl = React.forwardRef<HTMLTextAreaElement, TextareaVanillaControlProps>(\n (\n {\n state,\n disabled,\n id,\n css,\n endAdornment,\n variant,\n cursor,\n resize,\n className,\n style,\n 'aria-describedby': ariaDescribedBy,\n 'aria-invalid': ariaInvalid,\n ...props\n },\n forwardedRef,\n ) => {\n const { colors } = useVanillaExtractTheme();\n const control = useFieldControl({\n id,\n disabled,\n invalid: state === 'invalid',\n 'aria-describedby': ariaDescribedBy,\n 'aria-invalid': ariaInvalid,\n });\n const resolvedState = control.invalid ? 'invalid' : state;\n const hasEndAdornment = Boolean(endAdornment);\n\n const { style: cssStyles, vars } = processCSSProp(css, colors);\n const mergedStyles = { ...cssStyles, ...style, ...assignInlineVars(vars) };\n\n const textareaWrapperClass = textareaWrapperRecipe({\n state: resolvedState,\n disabled: control.disabled,\n });\n const styledTextareaClass = styledTextareaRecipe({\n variant,\n state: resolvedState,\n cursor,\n resize,\n endAdornment: hasEndAdornment,\n });\n\n return (\n <div className={textareaWrapperClass}>\n <textarea\n id={control.id}\n disabled={control.disabled}\n ref={forwardedRef}\n className={cx(styledTextareaClass, className)}\n style={mergedStyles}\n aria-describedby={control['aria-describedby']}\n aria-invalid={control['aria-invalid']}\n {...props}\n />\n {hasEndAdornment && <div className={adornmentWrapperEnd}>{endAdornment}</div>}\n </div>\n );\n },\n);\n\nTextareaVanillaControl.displayName = 'TextareaVanillaControl';\n\nexport const TextareaVanilla = React.forwardRef<HTMLTextAreaElement, TextareaVanillaProps>(\n ({ label, description, error, announceError, id, rootCss, state, ...props }, forwardedRef) => {\n return (\n <FieldVanilla\n id={id}\n label={\n label &&\n ((labelProps: FieldLabelProps) => (\n <LabelVanilla {...labelProps} css={{ display: 'block' }}>\n {label}\n </LabelVanilla>\n ))\n }\n description={description}\n error={error}\n announceError={announceError}\n invalid={state === 'invalid'}\n disabled={props.disabled}\n css={rootCss}\n >\n <TextareaVanillaControl ref={forwardedRef} id={id} state={state} {...props} />\n </FieldVanilla>\n );\n },\n);\n\nTextareaVanilla.displayName = 'T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,GAAG,SAAS,iBAAiB;CAC5F,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACQ,sBAAAA,cAAD;EACM;EACJ,OACE,WACE,eACA,iBAAA,GAAA,kBAAA,IAAA,CAACC,sBAAAA,cAAD;GAAc,GAAI;GAAY,KAAK,EAAE,SAAS,QAAQ;GACnD,UAAA;EACW,CAAA;EAGL;EACN;EACQ;EACf,SAAS,UAAU;EACnB,UAAU,MAAM;EAChB,KAAK;EAEL,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAAC,wBAAD;GAAwB,KAAK;GAAkB;GAAW;GAAO,GAAI;EAAQ,CAAA;CACjE,CAAA;AAElB,CACF;AAEA,gBAAgB,cAAc"}
1
+ {"version":3,"file":"Textarea.vanilla.cjs","names":["React","useFieldControl","useInlineStyle","textareaWrapperRecipe","styledTextareaRecipe","cx","FieldVanilla","LabelVanilla"],"sources":["../../../components/Textarea/Textarea.vanilla.tsx"],"sourcesContent":["import React from 'react';\n\nimport { CSSProps } from '@/styles/cssProps';\nimport { cx } from '@/styles/cx';\nimport type { RecipeVariantProps } from '@/styles/recipeVariants';\nimport { useInlineStyle } from '@/styles/useInlineStyle';\n\nimport { FieldVanilla } from '@/components/Field/Field.vanilla';\nimport { FieldLabelProps, useFieldControl } from '@/components/Field/FieldContext';\nimport { LabelVanilla } from '@/components/Label';\n\nimport {\n adornmentWrapperEnd,\n styledTextareaRecipe,\n textareaWrapperRecipe,\n} from './Textarea.vanilla.css';\n\ntype StyledTextareaRecipeVariants = RecipeVariantProps<typeof styledTextareaRecipe>;\n\nexport interface TextareaVanillaOwnProps extends CSSProps {\n variant?: StyledTextareaRecipeVariants['variant'];\n state?: StyledTextareaRecipeVariants['state'];\n cursor?: StyledTextareaRecipeVariants['cursor'];\n resize?: StyledTextareaRecipeVariants['resize'];\n label?: string;\n description?: React.ReactNode;\n error?: React.ReactNode;\n announceError?: boolean;\n endAdornment?: React.ReactNode;\n rootCss?: CSSProps['css'];\n}\n\nexport type TextareaVanillaProps = Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, 'size'> &\n TextareaVanillaOwnProps;\n\ntype TextareaVanillaControlProps = Omit<\n TextareaVanillaProps,\n 'label' | 'description' | 'error' | 'announceError' | 'rootCss'\n>;\n\nconst TextareaVanillaControl = React.forwardRef<HTMLTextAreaElement, TextareaVanillaControlProps>(\n (\n {\n state,\n disabled,\n id,\n css,\n endAdornment,\n variant,\n cursor,\n resize,\n className,\n style,\n 'aria-describedby': ariaDescribedBy,\n 'aria-invalid': ariaInvalid,\n ...props\n },\n forwardedRef,\n ) => {\n const control = useFieldControl({\n id,\n disabled,\n invalid: state === 'invalid',\n 'aria-describedby': ariaDescribedBy,\n 'aria-invalid': ariaInvalid,\n });\n const resolvedState = control.invalid ? 'invalid' : state;\n const hasEndAdornment = Boolean(endAdornment);\n\n const mergedStyles = useInlineStyle(css, style);\n\n const textareaWrapperClass = textareaWrapperRecipe({\n state: resolvedState,\n disabled: control.disabled,\n });\n const styledTextareaClass = styledTextareaRecipe({\n variant,\n state: resolvedState,\n cursor,\n resize,\n endAdornment: hasEndAdornment,\n });\n\n return (\n <div className={textareaWrapperClass}>\n <textarea\n id={control.id}\n disabled={control.disabled}\n ref={forwardedRef}\n className={cx(styledTextareaClass, className)}\n style={mergedStyles}\n aria-describedby={control['aria-describedby']}\n aria-invalid={control['aria-invalid']}\n {...props}\n />\n {hasEndAdornment && <div className={adornmentWrapperEnd}>{endAdornment}</div>}\n </div>\n );\n },\n);\n\nTextareaVanillaControl.displayName = 'TextareaVanillaControl';\n\nexport const TextareaVanilla = React.forwardRef<HTMLTextAreaElement, TextareaVanillaProps>(\n ({ label, description, error, announceError, id, rootCss, state, ...props }, forwardedRef) => {\n return (\n <FieldVanilla\n id={id}\n label={\n label &&\n ((labelProps: FieldLabelProps) => (\n <LabelVanilla {...labelProps} css={{ display: 'block' }}>\n {label}\n </LabelVanilla>\n ))\n }\n description={description}\n error={error}\n announceError={announceError}\n invalid={state === 'invalid'}\n disabled={props.disabled}\n css={rootCss}\n >\n <TextareaVanillaControl ref={forwardedRef} id={id} state={state} {...props} />\n </FieldVanilla>\n );\n },\n);\n\nTextareaVanilla.displayName = 'TextareaVanilla';\n"],"mappings":";;;;;;;;;;;AAwCA,IAAM,yBAAyBA,MAAAA,QAAM,YAEjC,EACE,OACA,UACA,IACA,KACA,cACA,SACA,QACA,QACA,WACA,OACA,oBAAoB,iBACpB,gBAAgB,aAChB,GAAG,SAEL,iBACG;CACH,MAAM,UAAUC,qBAAAA,gBAAgB;EAC9B;EACA;EACA,SAAS,UAAU;EACnB,oBAAoB;EACpB,gBAAgB;CAClB,CAAC;CACD,MAAM,gBAAgB,QAAQ,UAAU,YAAY;CACpD,MAAM,kBAAkB,QAAQ,YAAY;CAE5C,MAAM,eAAeC,uBAAAA,eAAe,KAAK,KAAK;CAE9C,MAAM,uBAAuBC,6BAAAA,sBAAsB;EACjD,OAAO;EACP,UAAU,QAAQ;CACpB,CAAC;CACD,MAAM,sBAAsBC,6BAAAA,qBAAqB;EAC/C;EACA,OAAO;EACP;EACA;EACA,cAAc;CAChB,CAAC;CAED,OACE,iBAAA,GAAA,kBAAA,KAAA,CAAC,OAAD;EAAK,WAAW;EAAhB,UAAA,CACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,YAAD;GACE,IAAI,QAAQ;GACZ,UAAU,QAAQ;GAClB,KAAK;GACL,WAAWC,WAAAA,GAAG,qBAAqB,SAAS;GAC5C,OAAO;GACP,oBAAkB,QAAQ;GAC1B,gBAAc,QAAQ;GACtB,GAAI;EACL,CAAA,GACA,mBAAmB,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;GAAK,WAAA;GAAiC,UAAA;EAAkB,CAAA,CACzE;;AAET,CACF;AAEA,uBAAuB,cAAc;AAErC,IAAa,kBAAkBL,MAAAA,QAAM,YAClC,EAAE,OAAO,aAAa,OAAO,eAAe,IAAI,SAAS,OAAO,GAAG,SAAS,iBAAiB;CAC5F,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACM,sBAAAA,cAAD;EACM;EACJ,OACE,WACE,eACA,iBAAA,GAAA,kBAAA,IAAA,CAACC,sBAAAA,cAAD;GAAc,GAAI;GAAY,KAAK,EAAE,SAAS,QAAQ;GACnD,UAAA;EACW,CAAA;EAGL;EACN;EACQ;EACf,SAAS,UAAU;EACnB,UAAU,MAAM;EAChB,KAAK;EAEL,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAAC,wBAAD;GAAwB,KAAK;GAAkB;GAAW;GAAO,GAAI;EAAQ,CAAA;CACjE,CAAA;AAElB,CACF;AAEA,gBAAgB,cAAc"}
@@ -1 +1 @@
1
- {"version":3,"file":"Textarea.vanilla.css.cjs","names":["_7a468"],"sources":["../../../components/Textarea/Textarea.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// CONSTANTS\nconst FOCUS_SHADOW =\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\nconst styledTextareaBase = style({\n // Reset\n appearance: 'none',\n overflow: 'auto',\n borderWidth: '0',\n boxSizing: 'border-box',\n fontFamily: tokens.fonts.rubik,\n margin: '0',\n outline: 'none',\n WebkitTapHighlightColor: 'rgba(0,0,0,0)',\n\n // Custom\n padding: tokens.space['3'],\n position: 'relative',\n flexGrow: 1,\n backgroundColor: 'transparent',\n borderRadius: 'inherit',\n boxShadow: `inset 0 0 0 1px ${tokens.colors.textareaBorder}`,\n color: tokens.colors.textareaText,\n fontVariantNumeric: 'tabular-nums',\n transition: 'box-shadow .1s ease-in-out',\n\n selectors: {\n '&:-webkit-autofill, &:autofill': {\n boxShadow: `inset 0 0 0 1px ${tokens.colors.textareaBorder}, inset 0 0 0 100px ${tokens.colors.textareaBg}`,\n WebkitTextFillColor: tokens.colors.hiContrast,\n },\n '&:-webkit-autofill::first-line, &:autofill::first-line': {\n fontFamily: tokens.fonts.rubik,\n color: tokens.colors.hiContrast,\n },\n '&:focus-visible': {\n boxShadow: `inset 0 0 0 2px ${tokens.colors.textareaFocusBorder}, ${FOCUS_SHADOW}`,\n },\n '&:-webkit-autofill:focus-visible, &:autofill:focus-visible': {\n boxShadow: `inset 0 0 0 2px ${tokens.colors.textareaFocusBorder}, inset 0 0 0 100px ${tokens.colors.textareaBg}, ${FOCUS_SHADOW}`,\n },\n '&::placeholder': {\n color: tokens.colors.textareaPlaceholder,\n },\n '&:read-only:not(:disabled)': {\n boxShadow: 'none',\n },\n '&:disabled': {\n pointerEvents: 'none',\n opacity: '0.7',\n color: tokens.colors.textareaDisabledText,\n },\n },\n});\n\nexport const styledTextareaRecipe = recipe({\n base: styledTextareaBase,\n variants: {\n variant: {\n ghost: {\n boxShadow: 'none',\n backgroundColor: 'transparent',\n selectors: {\n '&:disabled': {\n boxShadow: 'none',\n },\n '&:focus-visible': {\n backgroundColor: tokens.colors.loContrast,\n },\n },\n },\n },\n state: {\n invalid: {\n boxShadow: `inset 0 0 0 1px ${tokens.colors.textareaInvalidBorder}`,\n selectors: {\n '&:-webkit-autofill, &:autofill': {\n boxShadow: `inset 0 0 0 1px ${tokens.colors.textareaInvalidBorder}, inset 0 0 0 100px ${tokens.colors.textareaBg}`,\n },\n '&:focus-visible': {\n boxShadow: `inset 0 0 0 2px ${tokens.colors.textareaInvalidBorder}, ${FOCUS_SHADOW}`,\n },\n '&:-webkit-autofill:focus-visible, &:autofill:focus-visible': {\n boxShadow: `inset 0 0 0 2px ${tokens.colors.textareaInvalidBorder}, inset 0 0 0 100px ${tokens.colors.textareaBg}, ${FOCUS_SHADOW}`,\n },\n },\n '@media': {\n [breakpoints.hover]: {\n selectors: {\n '&:hover::after': {\n backgroundColor: tokens.colors.textareaInvalidBorder,\n },\n },\n },\n },\n },\n },\n cursor: {\n default: {\n cursor: 'default',\n '@media': {\n [breakpoints.hover]: {\n selectors: {\n '&:hover:not(:read-only)': {\n cursor: 'text',\n },\n },\n },\n },\n selectors: {\n '&:focus-visible:not(:read-only)': {\n cursor: 'text',\n },\n },\n },\n text: {\n cursor: 'text',\n },\n },\n resize: {\n none: {\n resize: 'none',\n },\n both: {\n resize: 'both',\n },\n vertical: {\n resize: 'vertical',\n },\n horizontal: {\n resize: 'horizontal',\n },\n },\n endAdornment: {\n true: {\n paddingBottom: tokens.space['5'],\n paddingRight: tokens.space['5'],\n },\n },\n },\n compoundVariants: [\n {\n variants: {\n variant: 'ghost',\n state: 'invalid',\n },\n style: {\n boxShadow: `inset 0 0 0 1px ${tokens.colors.textareaInvalidBorder}`,\n },\n },\n ],\n defaultVariants: {\n cursor: 'default',\n resize: 'both',\n },\n});\n\nconst textareaWrapperBase = style({\n // Reset\n outline: 'none',\n lineHeight: 0,\n\n position: 'relative',\n display: 'inline-flex',\n backgroundColor: tokens.colors.textareaBg,\n color: tokens.colors.textareaPlaceholder,\n borderRadius: tokens.radii['3'],\n\n selectors: {\n '&::before': {\n boxSizing: 'border-box',\n borderRadius: 'inherit',\n content: '\"\"',\n position: 'absolute',\n inset: '0',\n pointerEvents: 'none',\n },\n '&::after': {\n boxSizing: 'border-box',\n borderRadius: 'inherit',\n content: '\"\"',\n position: 'absolute',\n inset: '0',\n pointerEvents: 'none',\n },\n '&:focus-visible::before': {\n backgroundColor: tokens.colors.textareaFocusBg,\n },\n '&:focus-visible::after': {\n backgroundColor: tokens.colors.primary,\n opacity: '0.15',\n },\n },\n '@media': {\n [breakpoints.hover]: {\n selectors: {\n '&:hover::before': {\n backgroundColor: tokens.colors.textareaHoverBg,\n },\n '&:hover::after': {\n backgroundColor: tokens.colors.primary,\n opacity: '0.05',\n },\n },\n },\n },\n});\n\nexport const textareaWrapperRecipe = recipe({\n base: textareaWrapperBase,\n variants: {\n disabled: {\n true: {\n opacity: '0.7',\n color: tokens.colors.textareaDisabledText,\n '@media': {\n [breakpoints.hover]: {\n selectors: {\n '&:hover::before': {\n backgroundColor: 'inherit',\n },\n '&:hover::after': {\n backgroundColor: 'inherit',\n },\n },\n },\n },\n },\n },\n state: {\n invalid: {\n '@media': {\n [breakpoints.hover]: {\n selectors: {\n '&:hover::after': {\n backgroundColor: tokens.colors.textareaInvalidBorder,\n },\n },\n },\n },\n },\n },\n },\n defaultVariants: {\n disabled: false,\n },\n});\n\nexport const adornmentWrapperEnd = style({\n position: 'absolute',\n bottom: tokens.space['2'],\n right: tokens.space['3'],\n minWidth: tokens.sizes['5'],\n minHeight: tokens.sizes['5'],\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n});\n"],"mappings":""}
1
+ {"version":3,"file":"Textarea.vanilla.css.cjs","names":[],"sources":[],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"Textarea.vanilla.css.js","names":["_7a468"],"sources":["../../../components/Textarea/Textarea.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// CONSTANTS\nconst FOCUS_SHADOW =\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\nconst styledTextareaBase = style({\n // Reset\n appearance: 'none',\n overflow: 'auto',\n borderWidth: '0',\n boxSizing: 'border-box',\n fontFamily: tokens.fonts.rubik,\n margin: '0',\n outline: 'none',\n WebkitTapHighlightColor: 'rgba(0,0,0,0)',\n\n // Custom\n padding: tokens.space['3'],\n position: 'relative',\n flexGrow: 1,\n backgroundColor: 'transparent',\n borderRadius: 'inherit',\n boxShadow: `inset 0 0 0 1px ${tokens.colors.textareaBorder}`,\n color: tokens.colors.textareaText,\n fontVariantNumeric: 'tabular-nums',\n transition: 'box-shadow .1s ease-in-out',\n\n selectors: {\n '&:-webkit-autofill, &:autofill': {\n boxShadow: `inset 0 0 0 1px ${tokens.colors.textareaBorder}, inset 0 0 0 100px ${tokens.colors.textareaBg}`,\n WebkitTextFillColor: tokens.colors.hiContrast,\n },\n '&:-webkit-autofill::first-line, &:autofill::first-line': {\n fontFamily: tokens.fonts.rubik,\n color: tokens.colors.hiContrast,\n },\n '&:focus-visible': {\n boxShadow: `inset 0 0 0 2px ${tokens.colors.textareaFocusBorder}, ${FOCUS_SHADOW}`,\n },\n '&:-webkit-autofill:focus-visible, &:autofill:focus-visible': {\n boxShadow: `inset 0 0 0 2px ${tokens.colors.textareaFocusBorder}, inset 0 0 0 100px ${tokens.colors.textareaBg}, ${FOCUS_SHADOW}`,\n },\n '&::placeholder': {\n color: tokens.colors.textareaPlaceholder,\n },\n '&:read-only:not(:disabled)': {\n boxShadow: 'none',\n },\n '&:disabled': {\n pointerEvents: 'none',\n opacity: '0.7',\n color: tokens.colors.textareaDisabledText,\n },\n },\n});\n\nexport const styledTextareaRecipe = recipe({\n base: styledTextareaBase,\n variants: {\n variant: {\n ghost: {\n boxShadow: 'none',\n backgroundColor: 'transparent',\n selectors: {\n '&:disabled': {\n boxShadow: 'none',\n },\n '&:focus-visible': {\n backgroundColor: tokens.colors.loContrast,\n },\n },\n },\n },\n state: {\n invalid: {\n boxShadow: `inset 0 0 0 1px ${tokens.colors.textareaInvalidBorder}`,\n selectors: {\n '&:-webkit-autofill, &:autofill': {\n boxShadow: `inset 0 0 0 1px ${tokens.colors.textareaInvalidBorder}, inset 0 0 0 100px ${tokens.colors.textareaBg}`,\n },\n '&:focus-visible': {\n boxShadow: `inset 0 0 0 2px ${tokens.colors.textareaInvalidBorder}, ${FOCUS_SHADOW}`,\n },\n '&:-webkit-autofill:focus-visible, &:autofill:focus-visible': {\n boxShadow: `inset 0 0 0 2px ${tokens.colors.textareaInvalidBorder}, inset 0 0 0 100px ${tokens.colors.textareaBg}, ${FOCUS_SHADOW}`,\n },\n },\n '@media': {\n [breakpoints.hover]: {\n selectors: {\n '&:hover::after': {\n backgroundColor: tokens.colors.textareaInvalidBorder,\n },\n },\n },\n },\n },\n },\n cursor: {\n default: {\n cursor: 'default',\n '@media': {\n [breakpoints.hover]: {\n selectors: {\n '&:hover:not(:read-only)': {\n cursor: 'text',\n },\n },\n },\n },\n selectors: {\n '&:focus-visible:not(:read-only)': {\n cursor: 'text',\n },\n },\n },\n text: {\n cursor: 'text',\n },\n },\n resize: {\n none: {\n resize: 'none',\n },\n both: {\n resize: 'both',\n },\n vertical: {\n resize: 'vertical',\n },\n horizontal: {\n resize: 'horizontal',\n },\n },\n endAdornment: {\n true: {\n paddingBottom: tokens.space['5'],\n paddingRight: tokens.space['5'],\n },\n },\n },\n compoundVariants: [\n {\n variants: {\n variant: 'ghost',\n state: 'invalid',\n },\n style: {\n boxShadow: `inset 0 0 0 1px ${tokens.colors.textareaInvalidBorder}`,\n },\n },\n ],\n defaultVariants: {\n cursor: 'default',\n resize: 'both',\n },\n});\n\nconst textareaWrapperBase = style({\n // Reset\n outline: 'none',\n lineHeight: 0,\n\n position: 'relative',\n display: 'inline-flex',\n backgroundColor: tokens.colors.textareaBg,\n color: tokens.colors.textareaPlaceholder,\n borderRadius: tokens.radii['3'],\n\n selectors: {\n '&::before': {\n boxSizing: 'border-box',\n borderRadius: 'inherit',\n content: '\"\"',\n position: 'absolute',\n inset: '0',\n pointerEvents: 'none',\n },\n '&::after': {\n boxSizing: 'border-box',\n borderRadius: 'inherit',\n content: '\"\"',\n position: 'absolute',\n inset: '0',\n pointerEvents: 'none',\n },\n '&:focus-visible::before': {\n backgroundColor: tokens.colors.textareaFocusBg,\n },\n '&:focus-visible::after': {\n backgroundColor: tokens.colors.primary,\n opacity: '0.15',\n },\n },\n '@media': {\n [breakpoints.hover]: {\n selectors: {\n '&:hover::before': {\n backgroundColor: tokens.colors.textareaHoverBg,\n },\n '&:hover::after': {\n backgroundColor: tokens.colors.primary,\n opacity: '0.05',\n },\n },\n },\n },\n});\n\nexport const textareaWrapperRecipe = recipe({\n base: textareaWrapperBase,\n variants: {\n disabled: {\n true: {\n opacity: '0.7',\n color: tokens.colors.textareaDisabledText,\n '@media': {\n [breakpoints.hover]: {\n selectors: {\n '&:hover::before': {\n backgroundColor: 'inherit',\n },\n '&:hover::after': {\n backgroundColor: 'inherit',\n },\n },\n },\n },\n },\n },\n state: {\n invalid: {\n '@media': {\n [breakpoints.hover]: {\n selectors: {\n '&:hover::after': {\n backgroundColor: tokens.colors.textareaInvalidBorder,\n },\n },\n },\n },\n },\n },\n },\n defaultVariants: {\n disabled: false,\n },\n});\n\nexport const adornmentWrapperEnd = style({\n position: 'absolute',\n bottom: tokens.space['2'],\n right: tokens.space['3'],\n minWidth: tokens.sizes['5'],\n minHeight: tokens.sizes['5'],\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n});\n"],"mappings":""}
1
+ {"version":3,"file":"Textarea.vanilla.css.js","names":[],"sources":[],"mappings":""}
@@ -1,16 +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 { FieldVanilla } from "../Field/Field.vanilla.js";
5
4
  import { useFieldControl } from "../Field/FieldContext.js";
6
5
  import { LabelVanilla } from "../Label/Label.vanilla.js";
7
6
  import { styledTextareaRecipe, textareaWrapperRecipe } from "./Textarea.vanilla.css.js";
8
7
  import React from "react";
9
- import { assignInlineVars } from "@vanilla-extract/dynamic";
10
8
  import { jsx, jsxs } from "react/jsx-runtime";
11
9
  // components/Textarea/Textarea.vanilla.tsx
12
10
  var TextareaVanillaControl = React.forwardRef(({ state, disabled, id, css, endAdornment, variant, cursor, resize, className, style, "aria-describedby": ariaDescribedBy, "aria-invalid": ariaInvalid, ...props }, forwardedRef) => {
13
- const { colors } = useVanillaExtractTheme();
14
11
  const control = useFieldControl({
15
12
  id,
16
13
  disabled,
@@ -20,12 +17,7 @@ var TextareaVanillaControl = React.forwardRef(({ state, disabled, id, css, endAd
20
17
  });
21
18
  const resolvedState = control.invalid ? "invalid" : state;
22
19
  const hasEndAdornment = Boolean(endAdornment);
23
- const { style: cssStyles, vars } = processCSSProp(css, colors);
24
- const mergedStyles = {
25
- ...cssStyles,
26
- ...style,
27
- ...assignInlineVars(vars)
28
- };
20
+ const mergedStyles = useInlineStyle(css, style);
29
21
  const textareaWrapperClass = textareaWrapperRecipe({
30
22
  state: resolvedState,
31
23
  disabled: control.disabled