@traefik-labs/faency 13.7.1 → 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 (157) hide show
  1. package/README.md +1 -2
  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.js +8 -4
  9. package/dist/components/AriaTable/AriaTable.vanilla.js.map +1 -1
  10. package/dist/components/Avatar/Avatar.vanilla.cjs +5 -2
  11. package/dist/components/Avatar/Avatar.vanilla.cjs.map +1 -1
  12. package/dist/components/Avatar/Avatar.vanilla.js +5 -2
  13. package/dist/components/Avatar/Avatar.vanilla.js.map +1 -1
  14. package/dist/components/Badge/Badge.vanilla.cjs +2 -10
  15. package/dist/components/Badge/Badge.vanilla.cjs.map +1 -1
  16. package/dist/components/Badge/Badge.vanilla.js +2 -10
  17. package/dist/components/Badge/Badge.vanilla.js.map +1 -1
  18. package/dist/components/Blockquote/Blockquote.vanilla.cjs +5 -11
  19. package/dist/components/Blockquote/Blockquote.vanilla.cjs.map +1 -1
  20. package/dist/components/Blockquote/Blockquote.vanilla.js +5 -11
  21. package/dist/components/Blockquote/Blockquote.vanilla.js.map +1 -1
  22. package/dist/components/Box/Box.vanilla.cjs +2 -10
  23. package/dist/components/Box/Box.vanilla.cjs.map +1 -1
  24. package/dist/components/Box/Box.vanilla.js +2 -10
  25. package/dist/components/Box/Box.vanilla.js.map +1 -1
  26. package/dist/components/Bubble/Bubble.vanilla.cjs +2 -10
  27. package/dist/components/Bubble/Bubble.vanilla.cjs.map +1 -1
  28. package/dist/components/Bubble/Bubble.vanilla.js +2 -10
  29. package/dist/components/Bubble/Bubble.vanilla.js.map +1 -1
  30. package/dist/components/Button/Button.vanilla.cjs +2 -10
  31. package/dist/components/Button/Button.vanilla.cjs.map +1 -1
  32. package/dist/components/Button/Button.vanilla.js +2 -10
  33. package/dist/components/Button/Button.vanilla.js.map +1 -1
  34. package/dist/components/ButtonSwitch/ButtonSwitch.vanilla.cjs +3 -17
  35. package/dist/components/ButtonSwitch/ButtonSwitch.vanilla.cjs.map +1 -1
  36. package/dist/components/ButtonSwitch/ButtonSwitch.vanilla.js +3 -17
  37. package/dist/components/ButtonSwitch/ButtonSwitch.vanilla.js.map +1 -1
  38. package/dist/components/Card/Card.vanilla.cjs +6 -11
  39. package/dist/components/Card/Card.vanilla.cjs.map +1 -1
  40. package/dist/components/Card/Card.vanilla.js +6 -11
  41. package/dist/components/Card/Card.vanilla.js.map +1 -1
  42. package/dist/components/CodeBlock/CodeBlock.vanilla.cjs +3 -6
  43. package/dist/components/CodeBlock/CodeBlock.vanilla.cjs.map +1 -1
  44. package/dist/components/CodeBlock/CodeBlock.vanilla.js +3 -6
  45. package/dist/components/CodeBlock/CodeBlock.vanilla.js.map +1 -1
  46. package/dist/components/Combobox/Combobox.vanilla.cjs +3 -10
  47. package/dist/components/Combobox/Combobox.vanilla.cjs.map +1 -1
  48. package/dist/components/Combobox/Combobox.vanilla.js +3 -10
  49. package/dist/components/Combobox/Combobox.vanilla.js.map +1 -1
  50. package/dist/components/Container/Container.vanilla.cjs +5 -11
  51. package/dist/components/Container/Container.vanilla.cjs.map +1 -1
  52. package/dist/components/Container/Container.vanilla.js +5 -11
  53. package/dist/components/Container/Container.vanilla.js.map +1 -1
  54. package/dist/components/Elevation/Elevation.vanilla.cjs +5 -11
  55. package/dist/components/Elevation/Elevation.vanilla.cjs.map +1 -1
  56. package/dist/components/Elevation/Elevation.vanilla.js +5 -11
  57. package/dist/components/Elevation/Elevation.vanilla.js.map +1 -1
  58. package/dist/components/Field/Field.vanilla.cjs +3 -9
  59. package/dist/components/Field/Field.vanilla.cjs.map +1 -1
  60. package/dist/components/Field/Field.vanilla.js +3 -9
  61. package/dist/components/Field/Field.vanilla.js.map +1 -1
  62. package/dist/components/Flex/Flex.vanilla.cjs +5 -11
  63. package/dist/components/Flex/Flex.vanilla.cjs.map +1 -1
  64. package/dist/components/Flex/Flex.vanilla.js +5 -11
  65. package/dist/components/Flex/Flex.vanilla.js.map +1 -1
  66. package/dist/components/Grid/Grid.vanilla.cjs +7 -11
  67. package/dist/components/Grid/Grid.vanilla.cjs.map +1 -1
  68. package/dist/components/Grid/Grid.vanilla.js +7 -11
  69. package/dist/components/Grid/Grid.vanilla.js.map +1 -1
  70. package/dist/components/Heading/Heading.vanilla.cjs +35 -0
  71. package/dist/components/Heading/Heading.vanilla.cjs.map +1 -0
  72. package/dist/components/Heading/Heading.vanilla.css.cjs +85 -0
  73. package/dist/components/Heading/Heading.vanilla.css.cjs.map +1 -0
  74. package/dist/components/Heading/Heading.vanilla.css.js +74 -0
  75. package/dist/components/Heading/Heading.vanilla.css.js.map +1 -0
  76. package/dist/components/Heading/Heading.vanilla.js +30 -0
  77. package/dist/components/Heading/Heading.vanilla.js.map +1 -0
  78. package/dist/components/IconButton/IconButton.vanilla.cjs +5 -11
  79. package/dist/components/IconButton/IconButton.vanilla.cjs.map +1 -1
  80. package/dist/components/IconButton/IconButton.vanilla.js +5 -11
  81. package/dist/components/IconButton/IconButton.vanilla.js.map +1 -1
  82. package/dist/components/Image/Image.vanilla.cjs +2 -10
  83. package/dist/components/Image/Image.vanilla.cjs.map +1 -1
  84. package/dist/components/Image/Image.vanilla.js +2 -10
  85. package/dist/components/Image/Image.vanilla.js.map +1 -1
  86. package/dist/components/Input/Input.vanilla.cjs +2 -10
  87. package/dist/components/Input/Input.vanilla.cjs.map +1 -1
  88. package/dist/components/Input/Input.vanilla.js +2 -10
  89. package/dist/components/Input/Input.vanilla.js.map +1 -1
  90. package/dist/components/Label/Label.vanilla.cjs +5 -11
  91. package/dist/components/Label/Label.vanilla.cjs.map +1 -1
  92. package/dist/components/Label/Label.vanilla.js +5 -11
  93. package/dist/components/Label/Label.vanilla.js.map +1 -1
  94. package/dist/components/List/List.vanilla.cjs +10 -18
  95. package/dist/components/List/List.vanilla.cjs.map +1 -1
  96. package/dist/components/List/List.vanilla.js +7 -15
  97. package/dist/components/List/List.vanilla.js.map +1 -1
  98. package/dist/components/Meter/Meter.vanilla.cjs +3 -8
  99. package/dist/components/Meter/Meter.vanilla.cjs.map +1 -1
  100. package/dist/components/Meter/Meter.vanilla.js +3 -8
  101. package/dist/components/Meter/Meter.vanilla.js.map +1 -1
  102. package/dist/components/Panel/Panel.vanilla.cjs +2 -10
  103. package/dist/components/Panel/Panel.vanilla.cjs.map +1 -1
  104. package/dist/components/Panel/Panel.vanilla.js +2 -10
  105. package/dist/components/Panel/Panel.vanilla.js.map +1 -1
  106. package/dist/components/Paragraph/Paragraph.vanilla.cjs +5 -11
  107. package/dist/components/Paragraph/Paragraph.vanilla.cjs.map +1 -1
  108. package/dist/components/Paragraph/Paragraph.vanilla.js +5 -11
  109. package/dist/components/Paragraph/Paragraph.vanilla.js.map +1 -1
  110. package/dist/components/RowLink/RowLink.vanilla.cjs.map +1 -1
  111. package/dist/components/RowLink/RowLink.vanilla.js.map +1 -1
  112. package/dist/components/SegmentedControl/SegmentedControl.vanilla.cjs +3 -14
  113. package/dist/components/SegmentedControl/SegmentedControl.vanilla.cjs.map +1 -1
  114. package/dist/components/SegmentedControl/SegmentedControl.vanilla.js +3 -14
  115. package/dist/components/SegmentedControl/SegmentedControl.vanilla.js.map +1 -1
  116. package/dist/components/Skeleton/Skeleton.vanilla.cjs +2 -10
  117. package/dist/components/Skeleton/Skeleton.vanilla.cjs.map +1 -1
  118. package/dist/components/Skeleton/Skeleton.vanilla.js +2 -10
  119. package/dist/components/Skeleton/Skeleton.vanilla.js.map +1 -1
  120. package/dist/components/Spinner/Spinner.vanilla.cjs +3 -6
  121. package/dist/components/Spinner/Spinner.vanilla.cjs.map +1 -1
  122. package/dist/components/Spinner/Spinner.vanilla.js +3 -6
  123. package/dist/components/Spinner/Spinner.vanilla.js.map +1 -1
  124. package/dist/components/SplitLayout/SplitLayout.vanilla.cjs +3 -10
  125. package/dist/components/SplitLayout/SplitLayout.vanilla.cjs.map +1 -1
  126. package/dist/components/SplitLayout/SplitLayout.vanilla.js +3 -10
  127. package/dist/components/SplitLayout/SplitLayout.vanilla.js.map +1 -1
  128. package/dist/components/Table/Table.vanilla.cjs +8 -4
  129. package/dist/components/Table/Table.vanilla.cjs.map +1 -1
  130. package/dist/components/Table/Table.vanilla.js +8 -4
  131. package/dist/components/Table/Table.vanilla.js.map +1 -1
  132. package/dist/components/Text/Text.vanilla.cjs +5 -11
  133. package/dist/components/Text/Text.vanilla.cjs.map +1 -1
  134. package/dist/components/Text/Text.vanilla.js +5 -11
  135. package/dist/components/Text/Text.vanilla.js.map +1 -1
  136. package/dist/components/TextField/TextField.vanilla.cjs.map +1 -1
  137. package/dist/components/TextField/TextField.vanilla.js.map +1 -1
  138. package/dist/components/Textarea/Textarea.vanilla.cjs +2 -10
  139. package/dist/components/Textarea/Textarea.vanilla.cjs.map +1 -1
  140. package/dist/components/Textarea/Textarea.vanilla.js +2 -10
  141. package/dist/components/Textarea/Textarea.vanilla.js.map +1 -1
  142. package/dist/components/Toast/Toast.vanilla.cjs +4 -15
  143. package/dist/components/Toast/Toast.vanilla.cjs.map +1 -1
  144. package/dist/components/Toast/Toast.vanilla.js +4 -15
  145. package/dist/components/Toast/Toast.vanilla.js.map +1 -1
  146. package/dist/faency.css +118 -2
  147. package/dist/index.cjs +9 -0
  148. package/dist/index.d.cts +36800 -0
  149. package/dist/index.d.ts +248 -94
  150. package/dist/index.js +3 -1
  151. package/dist/styles/recipeVariants.cjs +15 -0
  152. package/dist/styles/recipeVariants.cjs.map +1 -0
  153. package/dist/styles/recipeVariants.js +15 -0
  154. package/dist/styles/recipeVariants.js.map +1 -0
  155. package/dist/styles/themeContext.cjs.map +1 -1
  156. package/dist/styles/themeContext.js.map +1 -1
  157. package/package.json +17 -7
@@ -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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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}>{collapsedContent}</div>\n </TdVanilla>\n </TrVanilla>\n )}\n </>\n );\n },\n);\n\nTrVanilla.displayName = 'TrVanilla';\n"],"mappings":";;;;;;;;;;;;AAkCA,IAAM,eAAe,gBAAgB,aAAa;AAClD,IAAM,aAAa,gBAAgB,WAAW;AAC9C,IAAM,UAAU,gBAAgB,QAAQ;AAYxC,IAAa,eAAe,YACzB,EAAE,WAAW,WAAW,KAAK,OAAO,GAAG,SAAS,QAC/C,oBAAC,SAAD;CACO;CACL,WAAW,GAAG,WAAW,EAAE,UAAU,CAAC,GAAG,cAAc,SAAS;CAChE,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,aAAa;EAAE;EAAM;EAAQ;EAAS;EAAU;EAAW;CAAO,CAAC,GACnE,SACF;CACA,OAAO,eAAe,KAAK,KAAK;CAChC,GAAI;AACL,CAAA,CAEL;AAEA,eAAe,cAAc;AAI7B,IAAM,WAAW,KAA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,MAAM,cAAc,eAAe,KAAK,KAAK;CAC7C,MAAM,cAAc,CAAC,CAACA;CAEtB,OACE,qBAAAC,YAAA,EAAA,UAAA,CACE,qBAAC,MAAD;EACO;EACL,WAAW,GACT,SAAS;GAAE,aAAa,gBAAgB,SAAS,KAAA,KAAa,KAAA;GAAY;EAAO,CAAC,GAClF,YACA,SACF;EACA,kBAAgB,eAAe,CAAC,SAAS,KAAK,KAAA;EAC9C,OAAO;EACP,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,QAAQ,GAAA,YAAkB,EAAI,CAAA,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,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":";;;;;;;;;;;AA8BA,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,MAAM,cAAcA,MAAAA,QAAM,cAAc;EACtC,IAAI,qBAAqB,KAAA,KAAa,qBAAqB,MACzD;EAEF,IAAI,OAAO,qBAAqB,UAC9B,OAAO;EAET,QAAQ,eAAgC,iBAAA,GAAA,kBAAA,IAAA,CAAC,kBAAD,EAAkB,GAAI,WAAa,CAAA;CAC7E,GAAG,CAAC,gBAAgB,CAAC;CA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,SAAS;GAChB,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAAC,UAAD;IACE,MAAK;IACL,WAAA;IACA,cAAY;IACZ,SAAS;IAET,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAAC,8BAAD,EAA8B,eAAA,KAAa,CAAA;GACrC,CAAA;EACD,CAAA;EAEV,aAAa,CAAC,iBACb,iBAAA,GAAA,kBAAA,IAAA,CAACA,gBAAAA,SAAD;GAAS,SAAQ;GACf,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAAC,UAAD;IACE,MAAK;IACL,WAAA;IACA,cAAW;IACX,SAAS;IAET,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAACC,sBAAAA,kBAAD,EAAkB,eAAA,KAAa,CAAA;GACzB,CAAA;EACD,CAAA;CAEX,EAAA,CAAA;CAGJ,MAAM,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\nTextFie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,CAAA;CAEX,EAAA,CAAA;CAGJ,MAAM,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 +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,OAA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UAAA,oBAAC,8BAAD,EAA8B,eAAA,KAAa,CAAA;GACrC,CAAA;EACD,CAAA;EAEV,aAAa,CAAC,iBACb,oBAAC,SAAD;GAAS,SAAQ;GACf,UAAA,oBAAC,UAAD;IACE,MAAK;IACL,WAAA;IACA,cAAW;IACX,SAAS;IAET,UAAA,oBAAC,kBAAD,EAAkB,eAAA,KAAa,CAAA;GACzB,CAAA;EACD,CAAA;CAEX,EAAA,CAAA;CAGJ,MAAM,QACJ,oBAAC,cAAD;EACM;EACJ,KAAK;EACL,cACE,sBACC,oBAAoB,oBAAC,OAAD;GAAK,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
+ {"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,UA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BAAC,yBAAD;GAAyB,WAAA;GAAwB,eAAA;EAAa,CAAA;EACzE,kBACC,oBAAC,SAAD;GAAS,SAAS;GAChB,UAAA,oBAAC,UAAD;IACE,MAAK;IACL,WAAA;IACA,cAAY;IACZ,SAAS;IAET,UAAA,oBAAC,8BAAD,EAA8B,eAAA,KAAa,CAAA;GACrC,CAAA;EACD,CAAA;EAEV,aAAa,CAAC,iBACb,oBAAC,SAAD;GAAS,SAAQ;GACf,UAAA,oBAAC,UAAD;IACE,MAAK;IACL,WAAA;IACA,cAAW;IACX,SAAS;IAET,UAAA,oBAAC,kBAAD,EAAkB,eAAA,KAAa,CAAA;GACzB,CAAA;EACD,CAAA;CAEX,EAAA,CAAA;CAGJ,MAAM,QACJ,oBAAC,cAAD;EACM;EACJ,KAAK;EACL,cACE,sBACC,oBAAoB,oBAAC,OAAD;GAAK,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 = 'TextareaVanilla';\n"],"mappings":";;;;;;;;;;;;;AAuCA,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,EAAE,WAAWC,qBAAAA,uBAAuB;CAC1C,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,EAAE,OAAO,WAAW,SAASC,iBAAAA,eAAe,KAAK,MAAM;CAC7D,MAAM,eAAe;EAAE,GAAG;EAAW,GAAG;EAAO,IAAA,GAAGC,yBAAAA,iBAAAA,CAAiB,IAAI;CAAE;CAEzE,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,kBAAkBP,MAAAA,QAAM,YAClC,EAAE,OAAO,aAAa,OAAO,eAAe,IAAI,SAAS,OAAO,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,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
@@ -1 +1 @@
1
- {"version":3,"file":"Textarea.vanilla.js","names":[],"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 = 'TextareaVanilla';\n"],"mappings":";;;;;;;;;;;AAuCA,IAAM,yBAAyB,MAAM,YAEjC,EACE,OACA,UACA,IACA,KACA,cACA,SACA,QACA,QACA,WACA,OACA,oBAAoB,iBACpB,gBAAgB,aAChB,GAAG,SAEL,iBACG;CACH,MAAM,EAAE,WAAW,uBAAuB;CAC1C,MAAM,UAAU,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,EAAE,OAAO,WAAW,SAAS,eAAe,KAAK,MAAM;CAC7D,MAAM,eAAe;EAAE,GAAG;EAAW,GAAG;EAAO,GAAG,iBAAiB,IAAI;CAAE;CAEzE,MAAM,uBAAuB,sBAAsB;EACjD,OAAO;EACP,UAAU,QAAQ;CACpB,CAAC;CACD,MAAM,sBAAsB,qBAAqB;EAC/C;EACA,OAAO;EACP;EACA;EACA,cAAc;CAChB,CAAC;CAED,OACE,qBAAC,OAAD;EAAK,WAAW;EAAhB,UAAA,CACE,oBAAC,YAAD;GACE,IAAI,QAAQ;GACZ,UAAU,QAAQ;GAClB,KAAK;GACL,WAAW,GAAG,qBAAqB,SAAS;GAC5C,OAAO;GACP,oBAAkB,QAAQ;GAC1B,gBAAc,QAAQ;GACtB,GAAI;EACL,CAAA,GACA,mBAAmB,oBAAC,OAAD;GAAK,WAAA;GAAiC,UAAA;EAAkB,CAAA,CACzE;;AAET,CACF;AAEA,uBAAuB,cAAc;AAErC,IAAa,kBAAkB,MAAM,YAClC,EAAE,OAAO,aAAa,OAAO,eAAe,IAAI,SAAS,OAAO,GAAG,SAAS,iBAAiB;CAC5F,OACE,oBAAC,cAAD;EACM;EACJ,OACE,WACE,eACA,oBAAC,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,oBAAC,wBAAD;GAAwB,KAAK;GAAkB;GAAW;GAAO,GAAI;EAAQ,CAAA;CACjE,CAAA;AAElB,CACF;AAEA,gBAAgB,cAAc"}
1
+ {"version":3,"file":"Textarea.vanilla.js","names":[],"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,yBAAyB,MAAM,YAEjC,EACE,OACA,UACA,IACA,KACA,cACA,SACA,QACA,QACA,WACA,OACA,oBAAoB,iBACpB,gBAAgB,aAChB,GAAG,SAEL,iBACG;CACH,MAAM,UAAU,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,eAAe,eAAe,KAAK,KAAK;CAE9C,MAAM,uBAAuB,sBAAsB;EACjD,OAAO;EACP,UAAU,QAAQ;CACpB,CAAC;CACD,MAAM,sBAAsB,qBAAqB;EAC/C;EACA,OAAO;EACP;EACA;EACA,cAAc;CAChB,CAAC;CAED,OACE,qBAAC,OAAD;EAAK,WAAW;EAAhB,UAAA,CACE,oBAAC,YAAD;GACE,IAAI,QAAQ;GACZ,UAAU,QAAQ;GAClB,KAAK;GACL,WAAW,GAAG,qBAAqB,SAAS;GAC5C,OAAO;GACP,oBAAkB,QAAQ;GAC1B,gBAAc,QAAQ;GACtB,GAAI;EACL,CAAA,GACA,mBAAmB,oBAAC,OAAD;GAAK,WAAA;GAAiC,UAAA;EAAkB,CAAA,CACzE;;AAET,CACF;AAEA,uBAAuB,cAAc;AAErC,IAAa,kBAAkB,MAAM,YAClC,EAAE,OAAO,aAAa,OAAO,eAAe,IAAI,SAAS,OAAO,GAAG,SAAS,iBAAiB;CAC5F,OACE,oBAAC,cAAD;EACM;EACJ,OACE,WACE,eACA,oBAAC,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,oBAAC,wBAAD;GAAwB,KAAK;GAAkB;GAAW;GAAO,GAAI;EAAQ,CAAA;CACjE,CAAA;AAElB,CACF;AAEA,gBAAgB,cAAc"}
@@ -1,14 +1,12 @@
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_Button_vanilla = require("../Button/Button.vanilla.cjs");
6
5
  const require_IconButton_vanilla = require("../IconButton/IconButton.vanilla.cjs");
7
6
  const require_Toast_vanilla_css = require("./Toast.vanilla.css.cjs");
8
7
  let _radix_ui_react_icons = require("@radix-ui/react-icons");
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
  let _radix_ui_react_toast = require("@radix-ui/react-toast");
14
12
  _radix_ui_react_toast = require_runtime.__toESM(_radix_ui_react_toast, 1);
@@ -20,17 +18,8 @@ var DEFAULT_ICONS = {
20
18
  warning: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_icons.ExclamationTriangleIcon, {}),
21
19
  error: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_icons.CrossCircledIcon, {})
22
20
  };
23
- var useCssProp = (css, style) => {
24
- const { colors } = require_themeContext.useVanillaExtractTheme();
25
- const { style: cssStyles, vars } = require_cssProps.processCSSProp(css, colors);
26
- return {
27
- ...cssStyles,
28
- ...style,
29
- ...(0, _vanilla_extract_dynamic.assignInlineVars)(vars)
30
- };
31
- };
32
21
  var ToastVanilla = (0, react.forwardRef)(({ variant = "gray", icon, closeLabel = "Close", type, className, css, style, children, ...props }, ref) => {
33
- const mergedStyles = useCssProp(css, style);
22
+ const mergedStyles = require_useInlineStyle.useInlineStyle(css, style);
34
23
  const resolvedIcon = icon === void 0 ? DEFAULT_ICONS[variant] : icon;
35
24
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_radix_ui_react_toast.Root, {
36
25
  ref,
@@ -64,14 +53,14 @@ ToastVanilla.displayName = "ToastVanilla";
64
53
  var ToastTitleVanilla = (0, react.forwardRef)(({ className, css, style, ...props }, ref) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_toast.Title, {
65
54
  ref,
66
55
  className: require_cx.cx(require_Toast_vanilla_css.toastTitle, className),
67
- style: useCssProp(css, style),
56
+ style: require_useInlineStyle.useInlineStyle(css, style),
68
57
  ...props
69
58
  }));
70
59
  ToastTitleVanilla.displayName = "ToastTitleVanilla";
71
60
  var ToastDescriptionVanilla = (0, react.forwardRef)(({ className, css, style, ...props }, ref) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_toast.Description, {
72
61
  ref,
73
62
  className: require_cx.cx(require_Toast_vanilla_css.toastDescription, className),
74
- style: useCssProp(css, style),
63
+ style: require_useInlineStyle.useInlineStyle(css, style),
75
64
  ...props
76
65
  }));
77
66
  ToastDescriptionVanilla.displayName = "ToastDescriptionVanilla";
@@ -1 +1 @@
1
- {"version":3,"file":"Toast.vanilla.cjs","names":["InfoCircledIcon","CheckCircledIcon","ExclamationTriangleIcon","CrossCircledIcon","useVanillaExtractTheme","processCSSProp","assignInlineVars","forwardRef","ToastPrimitive","cx","toastRoot","toastIconRecipe","toastContent","IconButtonVanilla","toastClose","Cross2Icon","toastTitle","toastDescription","ButtonVanilla","toastAction"],"sources":["../../../components/Toast/Toast.vanilla.tsx"],"sourcesContent":["import {\n CheckCircledIcon,\n Cross2Icon,\n CrossCircledIcon,\n ExclamationTriangleIcon,\n InfoCircledIcon,\n} from '@radix-ui/react-icons';\nimport * as ToastPrimitive from '@radix-ui/react-toast';\nimport { assignInlineVars } from '@vanilla-extract/dynamic';\nimport React, { ComponentPropsWithoutRef, forwardRef, ReactNode } from 'react';\n\nimport { CSSProps, processCSSProp } from '../../styles/cssProps';\nimport { cx } from '../../styles/cx';\nimport { useVanillaExtractTheme } from '../../styles/themeContext';\nimport { ButtonVanilla } from '../Button/Button.vanilla';\nimport { IconButtonVanilla } from '../IconButton/IconButton.vanilla';\nimport {\n toastAction,\n toastClose,\n toastContent,\n toastDescription,\n toastIconRecipe,\n toastRoot,\n toastTitle,\n ToastVariant,\n} from './Toast.vanilla.css';\n\nexport type { ToastVariant };\n\nconst DEFAULT_ICONS: Record<ToastVariant, ReactNode> = {\n gray: null,\n info: <InfoCircledIcon />,\n success: <CheckCircledIcon />,\n warning: <ExclamationTriangleIcon />,\n error: <CrossCircledIcon />,\n};\n\nconst useCssProp = (css: CSSProps['css'], style?: React.CSSProperties) => {\n const { colors } = useVanillaExtractTheme();\n const { style: cssStyles, vars } = processCSSProp(css, colors);\n return { ...cssStyles, ...style, ...assignInlineVars(vars) };\n};\n\nexport interface ToastVanillaProps\n extends Omit<ComponentPropsWithoutRef<typeof ToastPrimitive.Root>, 'asChild'>, CSSProps {\n variant?: ToastVariant;\n /** Replaces the variant icon. Pass `null` to show no icon. */\n icon?: ReactNode;\n closeLabel?: string;\n}\n\nexport const ToastVanilla = forwardRef<HTMLLIElement, ToastVanillaProps>(\n (\n {\n variant = 'gray',\n icon,\n closeLabel = 'Close',\n type,\n className,\n css,\n style,\n children,\n ...props\n },\n ref,\n ) => {\n const mergedStyles = useCssProp(css, style);\n const resolvedIcon = icon === undefined ? DEFAULT_ICONS[variant] : icon;\n\n return (\n <ToastPrimitive.Root\n ref={ref}\n type={type ?? (variant === 'error' ? 'foreground' : 'background')}\n className={cx(toastRoot, className)}\n style={mergedStyles}\n {...props}\n >\n {resolvedIcon ? (\n <span className={toastIconRecipe({ variant })} aria-hidden>\n {resolvedIcon}\n </span>\n ) : null}\n <div className={toastContent}>{children}</div>\n <ToastPrimitive.Close asChild>\n <IconButtonVanilla size=\"1\" aria-label={closeLabel} className={toastClose}>\n <Cross2Icon aria-hidden />\n </IconButtonVanilla>\n </ToastPrimitive.Close>\n </ToastPrimitive.Root>\n );\n },\n);\n\nToastVanilla.displayName = 'ToastVanilla';\n\nexport interface ToastTitleVanillaProps\n extends Omit<ComponentPropsWithoutRef<typeof ToastPrimitive.Title>, 'asChild'>, CSSProps {}\n\nexport const ToastTitleVanilla = forwardRef<HTMLDivElement, ToastTitleVanillaProps>(\n ({ className, css, style, ...props }, ref) => (\n <ToastPrimitive.Title\n ref={ref}\n className={cx(toastTitle, className)}\n style={useCssProp(css, style)}\n {...props}\n />\n ),\n);\n\nToastTitleVanilla.displayName = 'ToastTitleVanilla';\n\nexport interface ToastDescriptionVanillaProps\n extends Omit<ComponentPropsWithoutRef<typeof ToastPrimitive.Description>, 'asChild'>, CSSProps {}\n\nexport const ToastDescriptionVanilla = forwardRef<HTMLDivElement, ToastDescriptionVanillaProps>(\n ({ className, css, style, ...props }, ref) => (\n <ToastPrimitive.Description\n ref={ref}\n className={cx(toastDescription, className)}\n style={useCssProp(css, style)}\n {...props}\n />\n ),\n);\n\nToastDescriptionVanilla.displayName = 'ToastDescriptionVanilla';\n\nexport interface ToastActionVanillaProps\n extends Omit<ComponentPropsWithoutRef<typeof ToastPrimitive.Action>, 'asChild'>, CSSProps {}\n\nexport const ToastActionVanilla = forwardRef<HTMLButtonElement, ToastActionVanillaProps>(\n ({ altText, className, css, ...props }, ref) => (\n <ToastPrimitive.Action altText={altText} asChild>\n <ButtonVanilla\n ref={ref}\n variant=\"secondary\"\n size=\"small\"\n css={css}\n className={cx(toastAction, className)}\n {...props}\n />\n </ToastPrimitive.Action>\n ),\n);\n\nToastActionVanilla.displayName = 'ToastActionVanilla';\n"],"mappings":";;;;;;;;;;;;;;;AA6BA,IAAM,gBAAiD;CACrD,MAAM;CACN,MAAM,iBAAA,GAAA,kBAAA,IA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AA,mBAAD;KAAmB,MAAK;KAAI,cAAY;KAAY,WAAWC,0BAAAA;KAC7D,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAACC,sBAAAA,YAAD,EAAY,eAAA,KAAa,CAAA;IACR,CAAA;GACC,CAAA;EACH;;AAEzB,CACF;AAEA,aAAa,cAAc;AAK3B,IAAa,qBAAA,GAAoBR,MAAAA,WAAAA,EAC9B,EAAE,WAAW,KAAK,OAAO,GAAG,SAAS,QACpC,iBAAA,GAAA,kBAAA,IAAA,CAACC,sBAAe,OAAhB;CACO;CACL,WAAWC,WAAAA,GAAGO,0BAAAA,YAAY,SAAS;CACnC,OAAO,WAAW,KAAK,KAAK;CAC5B,GAAI;AACL,CAAA,CAEL;AAEA,kBAAkB,cAAc;AAKhC,IAAa,2BAAA,GAA0BT,MAAAA,WAAAA,EACpC,EAAE,WAAW,KAAK,OAAO,GAAG,SAAS,QACpC,iBAAA,GAAA,kBAAA,IAAA,CAACC,sBAAe,aAAhB;CACO;CACL,WAAWC,WAAAA,GAAGQ,0BAAAA,kBAAkB,SAAS;CACzC,OAAO,WAAW,KAAK,KAAK;CAC5B,GAAI;AACL,CAAA,CAEL;AAEA,wBAAwB,cAAc;AAKtC,IAAa,sBAAA,GAAqBV,MAAAA,WAAAA,EAC/B,EAAE,SAAS,WAAW,KAAK,GAAG,SAAS,QACtC,iBAAA,GAAA,kBAAA,IAAA,CAACC,sBAAe,QAAhB;CAAgC;CAAS,SAAA;CACvC,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAACU,uBAAAA,eAAD;EACO;EACL,SAAQ;EACR,MAAK;EACA;EACL,WAAWT,WAAAA,GAAGU,0BAAAA,aAAa,SAAS;EACpC,GAAI;CACL,CAAA;AACoB,CAAA,CAE3B;AAEA,mBAAmB,cAAc"}
1
+ {"version":3,"file":"Toast.vanilla.cjs","names":["InfoCircledIcon","CheckCircledIcon","ExclamationTriangleIcon","CrossCircledIcon","forwardRef","useInlineStyle","ToastPrimitive","cx","toastRoot","toastIconRecipe","toastContent","IconButtonVanilla","toastClose","Cross2Icon","toastTitle","toastDescription","ButtonVanilla","toastAction"],"sources":["../../../components/Toast/Toast.vanilla.tsx"],"sourcesContent":["import {\n CheckCircledIcon,\n Cross2Icon,\n CrossCircledIcon,\n ExclamationTriangleIcon,\n InfoCircledIcon,\n} from '@radix-ui/react-icons';\nimport * as ToastPrimitive from '@radix-ui/react-toast';\nimport React, { ComponentPropsWithoutRef, forwardRef, ReactNode } from 'react';\n\nimport { CSSProps } from '@/styles/cssProps';\nimport { cx } from '@/styles/cx';\nimport { useInlineStyle } from '@/styles/useInlineStyle';\n\nimport { ButtonVanilla } from '@/components/Button/Button.vanilla';\nimport { IconButtonVanilla } from '@/components/IconButton/IconButton.vanilla';\n\nimport {\n toastAction,\n toastClose,\n toastContent,\n toastDescription,\n toastIconRecipe,\n toastRoot,\n toastTitle,\n ToastVariant,\n} from './Toast.vanilla.css';\n\nexport type { ToastVariant };\n\nconst DEFAULT_ICONS: Record<ToastVariant, ReactNode> = {\n gray: null,\n info: <InfoCircledIcon />,\n success: <CheckCircledIcon />,\n warning: <ExclamationTriangleIcon />,\n error: <CrossCircledIcon />,\n};\n\nexport interface ToastVanillaProps\n extends Omit<ComponentPropsWithoutRef<typeof ToastPrimitive.Root>, 'asChild'>, CSSProps {\n variant?: ToastVariant;\n /** Replaces the variant icon. Pass `null` to show no icon. */\n icon?: ReactNode;\n closeLabel?: string;\n}\n\nexport const ToastVanilla = forwardRef<HTMLLIElement, ToastVanillaProps>(\n (\n {\n variant = 'gray',\n icon,\n closeLabel = 'Close',\n type,\n className,\n css,\n style,\n children,\n ...props\n },\n ref,\n ) => {\n const mergedStyles = useInlineStyle(css, style);\n const resolvedIcon = icon === undefined ? DEFAULT_ICONS[variant] : icon;\n\n return (\n <ToastPrimitive.Root\n ref={ref}\n type={type ?? (variant === 'error' ? 'foreground' : 'background')}\n className={cx(toastRoot, className)}\n style={mergedStyles}\n {...props}\n >\n {resolvedIcon ? (\n <span className={toastIconRecipe({ variant })} aria-hidden>\n {resolvedIcon}\n </span>\n ) : null}\n <div className={toastContent}>{children}</div>\n <ToastPrimitive.Close asChild>\n <IconButtonVanilla size=\"1\" aria-label={closeLabel} className={toastClose}>\n <Cross2Icon aria-hidden />\n </IconButtonVanilla>\n </ToastPrimitive.Close>\n </ToastPrimitive.Root>\n );\n },\n);\n\nToastVanilla.displayName = 'ToastVanilla';\n\nexport interface ToastTitleVanillaProps\n extends Omit<ComponentPropsWithoutRef<typeof ToastPrimitive.Title>, 'asChild'>, CSSProps {}\n\nexport const ToastTitleVanilla = forwardRef<HTMLDivElement, ToastTitleVanillaProps>(\n ({ className, css, style, ...props }, ref) => (\n <ToastPrimitive.Title\n ref={ref}\n className={cx(toastTitle, className)}\n style={useInlineStyle(css, style)}\n {...props}\n />\n ),\n);\n\nToastTitleVanilla.displayName = 'ToastTitleVanilla';\n\nexport interface ToastDescriptionVanillaProps\n extends Omit<ComponentPropsWithoutRef<typeof ToastPrimitive.Description>, 'asChild'>, CSSProps {}\n\nexport const ToastDescriptionVanilla = forwardRef<HTMLDivElement, ToastDescriptionVanillaProps>(\n ({ className, css, style, ...props }, ref) => (\n <ToastPrimitive.Description\n ref={ref}\n className={cx(toastDescription, className)}\n style={useInlineStyle(css, style)}\n {...props}\n />\n ),\n);\n\nToastDescriptionVanilla.displayName = 'ToastDescriptionVanilla';\n\nexport interface ToastActionVanillaProps\n extends Omit<ComponentPropsWithoutRef<typeof ToastPrimitive.Action>, 'asChild'>, CSSProps {}\n\nexport const ToastActionVanilla = forwardRef<HTMLButtonElement, ToastActionVanillaProps>(\n ({ altText, className, css, ...props }, ref) => (\n <ToastPrimitive.Action altText={altText} asChild>\n <ButtonVanilla\n ref={ref}\n variant=\"secondary\"\n size=\"small\"\n css={css}\n className={cx(toastAction, className)}\n {...props}\n />\n </ToastPrimitive.Action>\n ),\n);\n\nToastActionVanilla.displayName = 'ToastActionVanilla';\n"],"mappings":";;;;;;;;;;;;;AA8BA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;;AAEzB,CACF;AAEA,aAAa,cAAc;AAK3B,IAAa,qBAAA,GAAoBT,MAAAA,WAAAA,EAC9B,EAAE,WAAW,KAAK,OAAO,GAAG,SAAS,QACpC,iBAAA,GAAA,kBAAA,IAAA,CAACE,sBAAe,OAAhB;CACO;CACL,WAAWC,WAAAA,GAAGO,0BAAAA,YAAY,SAAS;CACnC,OAAOT,uBAAAA,eAAe,KAAK,KAAK;CAChC,GAAI;AACL,CAAA,CAEL;AAEA,kBAAkB,cAAc;AAKhC,IAAa,2BAAA,GAA0BD,MAAAA,WAAAA,EACpC,EAAE,WAAW,KAAK,OAAO,GAAG,SAAS,QACpC,iBAAA,GAAA,kBAAA,IAAA,CAACE,sBAAe,aAAhB;CACO;CACL,WAAWC,WAAAA,GAAGQ,0BAAAA,kBAAkB,SAAS;CACzC,OAAOV,uBAAAA,eAAe,KAAK,KAAK;CAChC,GAAI;AACL,CAAA,CAEL;AAEA,wBAAwB,cAAc;AAKtC,IAAa,sBAAA,GAAqBD,MAAAA,WAAAA,EAC/B,EAAE,SAAS,WAAW,KAAK,GAAG,SAAS,QACtC,iBAAA,GAAA,kBAAA,IAAA,CAACE,sBAAe,QAAhB;CAAgC;CAAS,SAAA;CACvC,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAACU,uBAAAA,eAAD;EACO;EACL,SAAQ;EACR,MAAK;EACA;EACL,WAAWT,WAAAA,GAAGU,0BAAAA,aAAa,SAAS;EACpC,GAAI;CACL,CAAA;AACoB,CAAA,CAE3B;AAEA,mBAAmB,cAAc"}
@@ -1,12 +1,10 @@
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 { ButtonVanilla } from "../Button/Button.vanilla.js";
5
4
  import { IconButtonVanilla } from "../IconButton/IconButton.vanilla.js";
6
5
  import { toastAction, toastClose, toastContent, toastDescription, toastIconRecipe, toastRoot, toastTitle } from "./Toast.vanilla.css.js";
7
6
  import { CheckCircledIcon, Cross2Icon, CrossCircledIcon, ExclamationTriangleIcon, InfoCircledIcon } from "@radix-ui/react-icons";
8
7
  import { forwardRef } from "react";
9
- import { assignInlineVars } from "@vanilla-extract/dynamic";
10
8
  import { jsx, jsxs } from "react/jsx-runtime";
11
9
  import * as ToastPrimitive from "@radix-ui/react-toast";
12
10
  // components/Toast/Toast.vanilla.tsx
@@ -17,17 +15,8 @@ var DEFAULT_ICONS = {
17
15
  warning: /* @__PURE__ */ jsx(ExclamationTriangleIcon, {}),
18
16
  error: /* @__PURE__ */ jsx(CrossCircledIcon, {})
19
17
  };
20
- var useCssProp = (css, style) => {
21
- const { colors } = useVanillaExtractTheme();
22
- const { style: cssStyles, vars } = processCSSProp(css, colors);
23
- return {
24
- ...cssStyles,
25
- ...style,
26
- ...assignInlineVars(vars)
27
- };
28
- };
29
18
  var ToastVanilla = forwardRef(({ variant = "gray", icon, closeLabel = "Close", type, className, css, style, children, ...props }, ref) => {
30
- const mergedStyles = useCssProp(css, style);
19
+ const mergedStyles = useInlineStyle(css, style);
31
20
  const resolvedIcon = icon === void 0 ? DEFAULT_ICONS[variant] : icon;
32
21
  return /* @__PURE__ */ jsxs(ToastPrimitive.Root, {
33
22
  ref,
@@ -61,14 +50,14 @@ ToastVanilla.displayName = "ToastVanilla";
61
50
  var ToastTitleVanilla = forwardRef(({ className, css, style, ...props }, ref) => /* @__PURE__ */ jsx(ToastPrimitive.Title, {
62
51
  ref,
63
52
  className: cx(toastTitle, className),
64
- style: useCssProp(css, style),
53
+ style: useInlineStyle(css, style),
65
54
  ...props
66
55
  }));
67
56
  ToastTitleVanilla.displayName = "ToastTitleVanilla";
68
57
  var ToastDescriptionVanilla = forwardRef(({ className, css, style, ...props }, ref) => /* @__PURE__ */ jsx(ToastPrimitive.Description, {
69
58
  ref,
70
59
  className: cx(toastDescription, className),
71
- style: useCssProp(css, style),
60
+ style: useInlineStyle(css, style),
72
61
  ...props
73
62
  }));
74
63
  ToastDescriptionVanilla.displayName = "ToastDescriptionVanilla";
@@ -1 +1 @@
1
- {"version":3,"file":"Toast.vanilla.js","names":[],"sources":["../../../components/Toast/Toast.vanilla.tsx"],"sourcesContent":["import {\n CheckCircledIcon,\n Cross2Icon,\n CrossCircledIcon,\n ExclamationTriangleIcon,\n InfoCircledIcon,\n} from '@radix-ui/react-icons';\nimport * as ToastPrimitive from '@radix-ui/react-toast';\nimport { assignInlineVars } from '@vanilla-extract/dynamic';\nimport React, { ComponentPropsWithoutRef, forwardRef, ReactNode } from 'react';\n\nimport { CSSProps, processCSSProp } from '../../styles/cssProps';\nimport { cx } from '../../styles/cx';\nimport { useVanillaExtractTheme } from '../../styles/themeContext';\nimport { ButtonVanilla } from '../Button/Button.vanilla';\nimport { IconButtonVanilla } from '../IconButton/IconButton.vanilla';\nimport {\n toastAction,\n toastClose,\n toastContent,\n toastDescription,\n toastIconRecipe,\n toastRoot,\n toastTitle,\n ToastVariant,\n} from './Toast.vanilla.css';\n\nexport type { ToastVariant };\n\nconst DEFAULT_ICONS: Record<ToastVariant, ReactNode> = {\n gray: null,\n info: <InfoCircledIcon />,\n success: <CheckCircledIcon />,\n warning: <ExclamationTriangleIcon />,\n error: <CrossCircledIcon />,\n};\n\nconst useCssProp = (css: CSSProps['css'], style?: React.CSSProperties) => {\n const { colors } = useVanillaExtractTheme();\n const { style: cssStyles, vars } = processCSSProp(css, colors);\n return { ...cssStyles, ...style, ...assignInlineVars(vars) };\n};\n\nexport interface ToastVanillaProps\n extends Omit<ComponentPropsWithoutRef<typeof ToastPrimitive.Root>, 'asChild'>, CSSProps {\n variant?: ToastVariant;\n /** Replaces the variant icon. Pass `null` to show no icon. */\n icon?: ReactNode;\n closeLabel?: string;\n}\n\nexport const ToastVanilla = forwardRef<HTMLLIElement, ToastVanillaProps>(\n (\n {\n variant = 'gray',\n icon,\n closeLabel = 'Close',\n type,\n className,\n css,\n style,\n children,\n ...props\n },\n ref,\n ) => {\n const mergedStyles = useCssProp(css, style);\n const resolvedIcon = icon === undefined ? DEFAULT_ICONS[variant] : icon;\n\n return (\n <ToastPrimitive.Root\n ref={ref}\n type={type ?? (variant === 'error' ? 'foreground' : 'background')}\n className={cx(toastRoot, className)}\n style={mergedStyles}\n {...props}\n >\n {resolvedIcon ? (\n <span className={toastIconRecipe({ variant })} aria-hidden>\n {resolvedIcon}\n </span>\n ) : null}\n <div className={toastContent}>{children}</div>\n <ToastPrimitive.Close asChild>\n <IconButtonVanilla size=\"1\" aria-label={closeLabel} className={toastClose}>\n <Cross2Icon aria-hidden />\n </IconButtonVanilla>\n </ToastPrimitive.Close>\n </ToastPrimitive.Root>\n );\n },\n);\n\nToastVanilla.displayName = 'ToastVanilla';\n\nexport interface ToastTitleVanillaProps\n extends Omit<ComponentPropsWithoutRef<typeof ToastPrimitive.Title>, 'asChild'>, CSSProps {}\n\nexport const ToastTitleVanilla = forwardRef<HTMLDivElement, ToastTitleVanillaProps>(\n ({ className, css, style, ...props }, ref) => (\n <ToastPrimitive.Title\n ref={ref}\n className={cx(toastTitle, className)}\n style={useCssProp(css, style)}\n {...props}\n />\n ),\n);\n\nToastTitleVanilla.displayName = 'ToastTitleVanilla';\n\nexport interface ToastDescriptionVanillaProps\n extends Omit<ComponentPropsWithoutRef<typeof ToastPrimitive.Description>, 'asChild'>, CSSProps {}\n\nexport const ToastDescriptionVanilla = forwardRef<HTMLDivElement, ToastDescriptionVanillaProps>(\n ({ className, css, style, ...props }, ref) => (\n <ToastPrimitive.Description\n ref={ref}\n className={cx(toastDescription, className)}\n style={useCssProp(css, style)}\n {...props}\n />\n ),\n);\n\nToastDescriptionVanilla.displayName = 'ToastDescriptionVanilla';\n\nexport interface ToastActionVanillaProps\n extends Omit<ComponentPropsWithoutRef<typeof ToastPrimitive.Action>, 'asChild'>, CSSProps {}\n\nexport const ToastActionVanilla = forwardRef<HTMLButtonElement, ToastActionVanillaProps>(\n ({ altText, className, css, ...props }, ref) => (\n <ToastPrimitive.Action altText={altText} asChild>\n <ButtonVanilla\n ref={ref}\n variant=\"secondary\"\n size=\"small\"\n css={css}\n className={cx(toastAction, className)}\n {...props}\n />\n </ToastPrimitive.Action>\n ),\n);\n\nToastActionVanilla.displayName = 'ToastActionVanilla';\n"],"mappings":";;;;;;;;;;;;AA6BA,IAAM,gBAAiD;CACrD,MAAM;CACN,MAAM,oBAAC,iBAAD,CAAkB,CAAA;CACxB,SAAS,oBAAC,kBAAD,CAAmB,CAAA;CAC5B,SAAS,oBAAC,yBAAD,CAA0B,CAAA;CACnC,OAAO,oBAAC,kBAAD,CAAmB,CAAA;AAC5B;AAEA,IAAM,cAAc,KAAsB,UAAgC;CACxE,MAAM,EAAE,WAAW,uBAAuB;CAC1C,MAAM,EAAE,OAAO,WAAW,SAAS,eAAe,KAAK,MAAM;CAC7D,OAAO;EAAE,GAAG;EAAW,GAAG;EAAO,GAAG,iBAAiB,IAAI;CAAE;AAC7D;AAUA,IAAa,eAAe,YAExB,EACE,UAAU,QACV,MACA,aAAa,SACb,MACA,WACA,KACA,OACA,UACA,GAAG,SAEL,QACG;CACH,MAAM,eAAe,WAAW,KAAK,KAAK;CAC1C,MAAM,eAAe,SAAS,KAAA,IAAY,cAAc,WAAW;CAEnE,OACE,qBAAC,eAAe,MAAhB;EACO;EACL,MAAM,SAAS,YAAY,UAAU,eAAe;EACpD,WAAW,GAAG,WAAW,SAAS;EAClC,OAAO;EACP,GAAI;EALN,UAAA;GAOG,eACC,oBAAC,QAAD;IAAM,WAAW,gBAAgB,EAAE,QAAQ,CAAC;IAAG,eAAA;IAC5C,UAAA;GACG,CAAA,IACJ;GACJ,oBAAC,OAAD;IAAK,WAAW;IAAe;GAAc,CAAA;GAC7C,oBAAC,eAAe,OAAhB;IAAsB,SAAA;IACpB,UAAA,oBAAC,mBAAD;KAAmB,MAAK;KAAI,cAAY;KAAY,WAAW;KAC7D,UAAA,oBAAC,YAAD,EAAY,eAAA,KAAa,CAAA;IACR,CAAA;GACC,CAAA;EACH;;AAEzB,CACF;AAEA,aAAa,cAAc;AAK3B,IAAa,oBAAoB,YAC9B,EAAE,WAAW,KAAK,OAAO,GAAG,SAAS,QACpC,oBAAC,eAAe,OAAhB;CACO;CACL,WAAW,GAAG,YAAY,SAAS;CACnC,OAAO,WAAW,KAAK,KAAK;CAC5B,GAAI;AACL,CAAA,CAEL;AAEA,kBAAkB,cAAc;AAKhC,IAAa,0BAA0B,YACpC,EAAE,WAAW,KAAK,OAAO,GAAG,SAAS,QACpC,oBAAC,eAAe,aAAhB;CACO;CACL,WAAW,GAAG,kBAAkB,SAAS;CACzC,OAAO,WAAW,KAAK,KAAK;CAC5B,GAAI;AACL,CAAA,CAEL;AAEA,wBAAwB,cAAc;AAKtC,IAAa,qBAAqB,YAC/B,EAAE,SAAS,WAAW,KAAK,GAAG,SAAS,QACtC,oBAAC,eAAe,QAAhB;CAAgC;CAAS,SAAA;CACvC,UAAA,oBAAC,eAAD;EACO;EACL,SAAQ;EACR,MAAK;EACA;EACL,WAAW,GAAG,aAAa,SAAS;EACpC,GAAI;CACL,CAAA;AACoB,CAAA,CAE3B;AAEA,mBAAmB,cAAc"}
1
+ {"version":3,"file":"Toast.vanilla.js","names":[],"sources":["../../../components/Toast/Toast.vanilla.tsx"],"sourcesContent":["import {\n CheckCircledIcon,\n Cross2Icon,\n CrossCircledIcon,\n ExclamationTriangleIcon,\n InfoCircledIcon,\n} from '@radix-ui/react-icons';\nimport * as ToastPrimitive from '@radix-ui/react-toast';\nimport React, { ComponentPropsWithoutRef, forwardRef, ReactNode } from 'react';\n\nimport { CSSProps } from '@/styles/cssProps';\nimport { cx } from '@/styles/cx';\nimport { useInlineStyle } from '@/styles/useInlineStyle';\n\nimport { ButtonVanilla } from '@/components/Button/Button.vanilla';\nimport { IconButtonVanilla } from '@/components/IconButton/IconButton.vanilla';\n\nimport {\n toastAction,\n toastClose,\n toastContent,\n toastDescription,\n toastIconRecipe,\n toastRoot,\n toastTitle,\n ToastVariant,\n} from './Toast.vanilla.css';\n\nexport type { ToastVariant };\n\nconst DEFAULT_ICONS: Record<ToastVariant, ReactNode> = {\n gray: null,\n info: <InfoCircledIcon />,\n success: <CheckCircledIcon />,\n warning: <ExclamationTriangleIcon />,\n error: <CrossCircledIcon />,\n};\n\nexport interface ToastVanillaProps\n extends Omit<ComponentPropsWithoutRef<typeof ToastPrimitive.Root>, 'asChild'>, CSSProps {\n variant?: ToastVariant;\n /** Replaces the variant icon. Pass `null` to show no icon. */\n icon?: ReactNode;\n closeLabel?: string;\n}\n\nexport const ToastVanilla = forwardRef<HTMLLIElement, ToastVanillaProps>(\n (\n {\n variant = 'gray',\n icon,\n closeLabel = 'Close',\n type,\n className,\n css,\n style,\n children,\n ...props\n },\n ref,\n ) => {\n const mergedStyles = useInlineStyle(css, style);\n const resolvedIcon = icon === undefined ? DEFAULT_ICONS[variant] : icon;\n\n return (\n <ToastPrimitive.Root\n ref={ref}\n type={type ?? (variant === 'error' ? 'foreground' : 'background')}\n className={cx(toastRoot, className)}\n style={mergedStyles}\n {...props}\n >\n {resolvedIcon ? (\n <span className={toastIconRecipe({ variant })} aria-hidden>\n {resolvedIcon}\n </span>\n ) : null}\n <div className={toastContent}>{children}</div>\n <ToastPrimitive.Close asChild>\n <IconButtonVanilla size=\"1\" aria-label={closeLabel} className={toastClose}>\n <Cross2Icon aria-hidden />\n </IconButtonVanilla>\n </ToastPrimitive.Close>\n </ToastPrimitive.Root>\n );\n },\n);\n\nToastVanilla.displayName = 'ToastVanilla';\n\nexport interface ToastTitleVanillaProps\n extends Omit<ComponentPropsWithoutRef<typeof ToastPrimitive.Title>, 'asChild'>, CSSProps {}\n\nexport const ToastTitleVanilla = forwardRef<HTMLDivElement, ToastTitleVanillaProps>(\n ({ className, css, style, ...props }, ref) => (\n <ToastPrimitive.Title\n ref={ref}\n className={cx(toastTitle, className)}\n style={useInlineStyle(css, style)}\n {...props}\n />\n ),\n);\n\nToastTitleVanilla.displayName = 'ToastTitleVanilla';\n\nexport interface ToastDescriptionVanillaProps\n extends Omit<ComponentPropsWithoutRef<typeof ToastPrimitive.Description>, 'asChild'>, CSSProps {}\n\nexport const ToastDescriptionVanilla = forwardRef<HTMLDivElement, ToastDescriptionVanillaProps>(\n ({ className, css, style, ...props }, ref) => (\n <ToastPrimitive.Description\n ref={ref}\n className={cx(toastDescription, className)}\n style={useInlineStyle(css, style)}\n {...props}\n />\n ),\n);\n\nToastDescriptionVanilla.displayName = 'ToastDescriptionVanilla';\n\nexport interface ToastActionVanillaProps\n extends Omit<ComponentPropsWithoutRef<typeof ToastPrimitive.Action>, 'asChild'>, CSSProps {}\n\nexport const ToastActionVanilla = forwardRef<HTMLButtonElement, ToastActionVanillaProps>(\n ({ altText, className, css, ...props }, ref) => (\n <ToastPrimitive.Action altText={altText} asChild>\n <ButtonVanilla\n ref={ref}\n variant=\"secondary\"\n size=\"small\"\n css={css}\n className={cx(toastAction, className)}\n {...props}\n />\n </ToastPrimitive.Action>\n ),\n);\n\nToastActionVanilla.displayName = 'ToastActionVanilla';\n"],"mappings":";;;;;;;;;;AA8BA,IAAM,gBAAiD;CACrD,MAAM;CACN,MAAM,oBAAC,iBAAD,CAAkB,CAAA;CACxB,SAAS,oBAAC,kBAAD,CAAmB,CAAA;CAC5B,SAAS,oBAAC,yBAAD,CAA0B,CAAA;CACnC,OAAO,oBAAC,kBAAD,CAAmB,CAAA;AAC5B;AAUA,IAAa,eAAe,YAExB,EACE,UAAU,QACV,MACA,aAAa,SACb,MACA,WACA,KACA,OACA,UACA,GAAG,SAEL,QACG;CACH,MAAM,eAAe,eAAe,KAAK,KAAK;CAC9C,MAAM,eAAe,SAAS,KAAA,IAAY,cAAc,WAAW;CAEnE,OACE,qBAAC,eAAe,MAAhB;EACO;EACL,MAAM,SAAS,YAAY,UAAU,eAAe;EACpD,WAAW,GAAG,WAAW,SAAS;EAClC,OAAO;EACP,GAAI;EALN,UAAA;GAOG,eACC,oBAAC,QAAD;IAAM,WAAW,gBA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