@traefik-labs/faency 13.4.0 → 13.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (229) hide show
  1. package/dist/components/AriaTable/AriaTable.cjs +13 -5
  2. package/dist/components/AriaTable/AriaTable.cjs.map +1 -1
  3. package/dist/components/AriaTable/AriaTable.constants.cjs +5 -0
  4. package/dist/components/AriaTable/AriaTable.constants.cjs.map +1 -0
  5. package/dist/components/AriaTable/AriaTable.constants.js +5 -0
  6. package/dist/components/AriaTable/AriaTable.constants.js.map +1 -0
  7. package/dist/components/AriaTable/AriaTable.js +13 -5
  8. package/dist/components/AriaTable/AriaTable.js.map +1 -1
  9. package/dist/components/AriaTable/AriaTable.vanilla.cjs +194 -0
  10. package/dist/components/AriaTable/AriaTable.vanilla.cjs.map +1 -0
  11. package/dist/components/AriaTable/AriaTable.vanilla.css.cjs +28 -0
  12. package/dist/components/AriaTable/AriaTable.vanilla.css.cjs.map +1 -0
  13. package/dist/components/AriaTable/AriaTable.vanilla.css.js +17 -0
  14. package/dist/components/AriaTable/AriaTable.vanilla.css.js.map +1 -0
  15. package/dist/components/AriaTable/AriaTable.vanilla.js +185 -0
  16. package/dist/components/AriaTable/AriaTable.vanilla.js.map +1 -0
  17. package/dist/components/Badge/Badge.vanilla.cjs +2 -1
  18. package/dist/components/Badge/Badge.vanilla.cjs.map +1 -1
  19. package/dist/components/Badge/Badge.vanilla.js +2 -1
  20. package/dist/components/Badge/Badge.vanilla.js.map +1 -1
  21. package/dist/components/Blockquote/Blockquote.vanilla.cjs +2 -1
  22. package/dist/components/Blockquote/Blockquote.vanilla.cjs.map +1 -1
  23. package/dist/components/Blockquote/Blockquote.vanilla.js +2 -1
  24. package/dist/components/Blockquote/Blockquote.vanilla.js.map +1 -1
  25. package/dist/components/Box/Box.vanilla.cjs +2 -1
  26. package/dist/components/Box/Box.vanilla.cjs.map +1 -1
  27. package/dist/components/Box/Box.vanilla.js +2 -1
  28. package/dist/components/Box/Box.vanilla.js.map +1 -1
  29. package/dist/components/Bubble/Bubble.vanilla.cjs +2 -1
  30. package/dist/components/Bubble/Bubble.vanilla.cjs.map +1 -1
  31. package/dist/components/Bubble/Bubble.vanilla.js +2 -1
  32. package/dist/components/Bubble/Bubble.vanilla.js.map +1 -1
  33. package/dist/components/Button/Button.vanilla.cjs +2 -1
  34. package/dist/components/Button/Button.vanilla.cjs.map +1 -1
  35. package/dist/components/Button/Button.vanilla.js +2 -1
  36. package/dist/components/Button/Button.vanilla.js.map +1 -1
  37. package/dist/components/ButtonSwitch/ButtonSwitch.vanilla.cjs +5 -4
  38. package/dist/components/ButtonSwitch/ButtonSwitch.vanilla.cjs.map +1 -1
  39. package/dist/components/ButtonSwitch/ButtonSwitch.vanilla.js +5 -4
  40. package/dist/components/ButtonSwitch/ButtonSwitch.vanilla.js.map +1 -1
  41. package/dist/components/Card/Card.vanilla.cjs +2 -1
  42. package/dist/components/Card/Card.vanilla.cjs.map +1 -1
  43. package/dist/components/Card/Card.vanilla.js +2 -1
  44. package/dist/components/Card/Card.vanilla.js.map +1 -1
  45. package/dist/components/CodeBlock/CodeBlock.cjs +2 -2
  46. package/dist/components/CodeBlock/CodeBlock.js +2 -2
  47. package/dist/components/CodeBlock/CodeBlock.vanilla.cjs +6 -14
  48. package/dist/components/CodeBlock/CodeBlock.vanilla.cjs.map +1 -1
  49. package/dist/components/CodeBlock/CodeBlock.vanilla.js +6 -14
  50. package/dist/components/CodeBlock/CodeBlock.vanilla.js.map +1 -1
  51. package/dist/components/Combobox/Combobox.vanilla.cjs +2 -2
  52. package/dist/components/Combobox/Combobox.vanilla.cjs.map +1 -1
  53. package/dist/components/Combobox/Combobox.vanilla.js +2 -2
  54. package/dist/components/Combobox/Combobox.vanilla.js.map +1 -1
  55. package/dist/components/Container/Container.vanilla.cjs +2 -1
  56. package/dist/components/Container/Container.vanilla.cjs.map +1 -1
  57. package/dist/components/Container/Container.vanilla.js +2 -1
  58. package/dist/components/Container/Container.vanilla.js.map +1 -1
  59. package/dist/components/DateTimePicker/DateTimePicker.cjs +1 -1
  60. package/dist/components/DateTimePicker/DateTimePicker.js +1 -1
  61. package/dist/components/Dialog/Dialog.cjs +1 -1
  62. package/dist/components/Dialog/Dialog.js +1 -1
  63. package/dist/components/Elevation/Elevation.vanilla.cjs +2 -1
  64. package/dist/components/Elevation/Elevation.vanilla.cjs.map +1 -1
  65. package/dist/components/Elevation/Elevation.vanilla.css.cjs.map +1 -1
  66. package/dist/components/Elevation/Elevation.vanilla.css.js.map +1 -1
  67. package/dist/components/Elevation/Elevation.vanilla.js +2 -1
  68. package/dist/components/Elevation/Elevation.vanilla.js.map +1 -1
  69. package/dist/components/Field/Field.cjs +80 -33
  70. package/dist/components/Field/Field.cjs.map +1 -1
  71. package/dist/components/Field/Field.js +80 -33
  72. package/dist/components/Field/Field.js.map +1 -1
  73. package/dist/components/Field/Field.vanilla.cjs +62 -32
  74. package/dist/components/Field/Field.vanilla.cjs.map +1 -1
  75. package/dist/components/Field/Field.vanilla.css.cjs +6 -0
  76. package/dist/components/Field/Field.vanilla.css.cjs.map +1 -1
  77. package/dist/components/Field/Field.vanilla.css.js +4 -1
  78. package/dist/components/Field/Field.vanilla.css.js.map +1 -1
  79. package/dist/components/Field/Field.vanilla.js +63 -33
  80. package/dist/components/Field/Field.vanilla.js.map +1 -1
  81. package/dist/components/Field/FieldContext.cjs +48 -10
  82. package/dist/components/Field/FieldContext.cjs.map +1 -1
  83. package/dist/components/Field/FieldContext.js +48 -10
  84. package/dist/components/Field/FieldContext.js.map +1 -1
  85. package/dist/components/Flex/Flex.vanilla.cjs +2 -1
  86. package/dist/components/Flex/Flex.vanilla.cjs.map +1 -1
  87. package/dist/components/Flex/Flex.vanilla.js +2 -1
  88. package/dist/components/Flex/Flex.vanilla.js.map +1 -1
  89. package/dist/components/Grid/Grid.vanilla.cjs +2 -1
  90. package/dist/components/Grid/Grid.vanilla.cjs.map +1 -1
  91. package/dist/components/Grid/Grid.vanilla.js +2 -1
  92. package/dist/components/Grid/Grid.vanilla.js.map +1 -1
  93. package/dist/components/IconButton/IconButton.vanilla.cjs +2 -1
  94. package/dist/components/IconButton/IconButton.vanilla.cjs.map +1 -1
  95. package/dist/components/IconButton/IconButton.vanilla.js +2 -1
  96. package/dist/components/IconButton/IconButton.vanilla.js.map +1 -1
  97. package/dist/components/Image/Image.vanilla.cjs +2 -1
  98. package/dist/components/Image/Image.vanilla.cjs.map +1 -1
  99. package/dist/components/Image/Image.vanilla.js +2 -1
  100. package/dist/components/Image/Image.vanilla.js.map +1 -1
  101. package/dist/components/Input/Input.vanilla.cjs +2 -1
  102. package/dist/components/Input/Input.vanilla.cjs.map +1 -1
  103. package/dist/components/Input/Input.vanilla.js +2 -1
  104. package/dist/components/Input/Input.vanilla.js.map +1 -1
  105. package/dist/components/Label/Label.vanilla.cjs +2 -1
  106. package/dist/components/Label/Label.vanilla.cjs.map +1 -1
  107. package/dist/components/Label/Label.vanilla.js +2 -1
  108. package/dist/components/Label/Label.vanilla.js.map +1 -1
  109. package/dist/components/List/List.cjs +1 -1
  110. package/dist/components/List/List.js +1 -1
  111. package/dist/components/Meter/Meter.vanilla.cjs +3 -2
  112. package/dist/components/Meter/Meter.vanilla.cjs.map +1 -1
  113. package/dist/components/Meter/Meter.vanilla.js +3 -2
  114. package/dist/components/Meter/Meter.vanilla.js.map +1 -1
  115. package/dist/components/NavigationTree/NavigationTreeItem.cjs +2 -2
  116. package/dist/components/NavigationTree/NavigationTreeItem.js +2 -2
  117. package/dist/components/Panel/Panel.vanilla.cjs +2 -1
  118. package/dist/components/Panel/Panel.vanilla.cjs.map +1 -1
  119. package/dist/components/Panel/Panel.vanilla.js +2 -1
  120. package/dist/components/Panel/Panel.vanilla.js.map +1 -1
  121. package/dist/components/Paragraph/Paragraph.vanilla.cjs +2 -1
  122. package/dist/components/Paragraph/Paragraph.vanilla.cjs.map +1 -1
  123. package/dist/components/Paragraph/Paragraph.vanilla.js +2 -1
  124. package/dist/components/Paragraph/Paragraph.vanilla.js.map +1 -1
  125. package/dist/components/RowLink/RowLink.cjs +18 -46
  126. package/dist/components/RowLink/RowLink.cjs.map +1 -1
  127. package/dist/components/RowLink/RowLink.constants.cjs +7 -0
  128. package/dist/components/RowLink/RowLink.constants.cjs.map +1 -0
  129. package/dist/components/RowLink/RowLink.constants.js +6 -0
  130. package/dist/components/RowLink/RowLink.constants.js.map +1 -0
  131. package/dist/components/RowLink/RowLink.js +15 -45
  132. package/dist/components/RowLink/RowLink.js.map +1 -1
  133. package/dist/components/RowLink/RowLink.utils.cjs +87 -0
  134. package/dist/components/RowLink/RowLink.utils.cjs.map +1 -0
  135. package/dist/components/RowLink/RowLink.utils.js +83 -0
  136. package/dist/components/RowLink/RowLink.utils.js.map +1 -0
  137. package/dist/components/RowLink/RowLink.vanilla.cjs +21 -0
  138. package/dist/components/RowLink/RowLink.vanilla.cjs.map +1 -0
  139. package/dist/components/RowLink/RowLink.vanilla.css.cjs +10 -0
  140. package/dist/components/RowLink/RowLink.vanilla.css.cjs.map +1 -0
  141. package/dist/components/RowLink/RowLink.vanilla.css.js +8 -0
  142. package/dist/components/RowLink/RowLink.vanilla.css.js.map +1 -0
  143. package/dist/components/RowLink/RowLink.vanilla.js +19 -0
  144. package/dist/components/RowLink/RowLink.vanilla.js.map +1 -0
  145. package/dist/components/SegmentedControl/SegmentedControl.vanilla.cjs +3 -3
  146. package/dist/components/SegmentedControl/SegmentedControl.vanilla.cjs.map +1 -1
  147. package/dist/components/SegmentedControl/SegmentedControl.vanilla.js +3 -3
  148. package/dist/components/SegmentedControl/SegmentedControl.vanilla.js.map +1 -1
  149. package/dist/components/Select/Select.cjs +1 -1
  150. package/dist/components/Select/Select.js +1 -1
  151. package/dist/components/Skeleton/Skeleton.vanilla.cjs +2 -1
  152. package/dist/components/Skeleton/Skeleton.vanilla.cjs.map +1 -1
  153. package/dist/components/Skeleton/Skeleton.vanilla.js +2 -1
  154. package/dist/components/Skeleton/Skeleton.vanilla.js.map +1 -1
  155. package/dist/components/Spinner/Spinner.vanilla.cjs +3 -2
  156. package/dist/components/Spinner/Spinner.vanilla.cjs.map +1 -1
  157. package/dist/components/Spinner/Spinner.vanilla.js +3 -2
  158. package/dist/components/Spinner/Spinner.vanilla.js.map +1 -1
  159. package/dist/components/SplitLayout/SplitLayout.vanilla.cjs +4 -3
  160. package/dist/components/SplitLayout/SplitLayout.vanilla.cjs.map +1 -1
  161. package/dist/components/SplitLayout/SplitLayout.vanilla.js +4 -3
  162. package/dist/components/SplitLayout/SplitLayout.vanilla.js.map +1 -1
  163. package/dist/components/Table/ExpandToggle.vanilla.cjs +30 -0
  164. package/dist/components/Table/ExpandToggle.vanilla.cjs.map +1 -0
  165. package/dist/components/Table/ExpandToggle.vanilla.js +27 -0
  166. package/dist/components/Table/ExpandToggle.vanilla.js.map +1 -0
  167. package/dist/components/Table/SortButton.vanilla.cjs +38 -0
  168. package/dist/components/Table/SortButton.vanilla.cjs.map +1 -0
  169. package/dist/components/Table/SortButton.vanilla.js +35 -0
  170. package/dist/components/Table/SortButton.vanilla.js.map +1 -0
  171. package/dist/components/Table/Table.cjs +11 -4
  172. package/dist/components/Table/Table.cjs.map +1 -1
  173. package/dist/components/Table/Table.js +11 -4
  174. package/dist/components/Table/Table.js.map +1 -1
  175. package/dist/components/Table/Table.vanilla.cjs +142 -0
  176. package/dist/components/Table/Table.vanilla.cjs.map +1 -0
  177. package/dist/components/Table/Table.vanilla.css.cjs +178 -0
  178. package/dist/components/Table/Table.vanilla.css.cjs.map +1 -0
  179. package/dist/components/Table/Table.vanilla.css.js +161 -0
  180. package/dist/components/Table/Table.vanilla.css.js.map +1 -0
  181. package/dist/components/Table/Table.vanilla.js +133 -0
  182. package/dist/components/Table/Table.vanilla.js.map +1 -0
  183. package/dist/components/Table/useTableSort.cjs +60 -0
  184. package/dist/components/Table/useTableSort.cjs.map +1 -0
  185. package/dist/components/Table/useTableSort.js +59 -0
  186. package/dist/components/Table/useTableSort.js.map +1 -0
  187. package/dist/components/Text/Text.vanilla.cjs +2 -1
  188. package/dist/components/Text/Text.vanilla.cjs.map +1 -1
  189. package/dist/components/Text/Text.vanilla.js +2 -1
  190. package/dist/components/Text/Text.vanilla.js.map +1 -1
  191. package/dist/components/TextField/TextField.cjs +1 -1
  192. package/dist/components/TextField/TextField.js +1 -1
  193. package/dist/components/TextField/TextField.vanilla.cjs +1 -1
  194. package/dist/components/TextField/TextField.vanilla.js +1 -1
  195. package/dist/components/Textarea/Textarea.cjs +2 -2
  196. package/dist/components/Textarea/Textarea.js +2 -2
  197. package/dist/components/Textarea/Textarea.vanilla.cjs +4 -3
  198. package/dist/components/Textarea/Textarea.vanilla.cjs.map +1 -1
  199. package/dist/components/Textarea/Textarea.vanilla.js +4 -3
  200. package/dist/components/Textarea/Textarea.vanilla.js.map +1 -1
  201. package/dist/components/Toast/Toast.vanilla.cjs +5 -5
  202. package/dist/components/Toast/Toast.vanilla.cjs.map +1 -1
  203. package/dist/components/Toast/Toast.vanilla.js +5 -5
  204. package/dist/components/Toast/Toast.vanilla.js.map +1 -1
  205. package/dist/components/Toast/ToastProvider.vanilla.cjs +1 -1
  206. package/dist/components/Toast/ToastProvider.vanilla.js +1 -1
  207. package/dist/faency.css +3001 -2303
  208. package/dist/index.cjs +50 -29
  209. package/dist/index.d.ts +570 -24
  210. package/dist/index.js +33 -30
  211. package/dist/styles/cx.cjs +5 -0
  212. package/dist/styles/cx.cjs.map +1 -0
  213. package/dist/styles/cx.js +5 -0
  214. package/dist/styles/cx.js.map +1 -0
  215. package/dist/styles/themes.css.cjs.map +1 -1
  216. package/dist/styles/themes.css.js.map +1 -1
  217. package/dist/styles/tokens.css.cjs +55 -44
  218. package/dist/styles/tokens.css.cjs.map +1 -1
  219. package/dist/styles/tokens.css.js +55 -44
  220. package/dist/styles/tokens.css.js.map +1 -1
  221. package/dist/styles/useInlineStyle.cjs +16 -0
  222. package/dist/styles/useInlineStyle.cjs.map +1 -0
  223. package/dist/styles/useInlineStyle.js +16 -0
  224. package/dist/styles/useInlineStyle.js.map +1 -0
  225. package/dist/utils/warnOnce.cjs +13 -0
  226. package/dist/utils/warnOnce.cjs.map +1 -0
  227. package/dist/utils/warnOnce.js +13 -0
  228. package/dist/utils/warnOnce.js.map +1 -0
  229. package/package.json +10 -17
@@ -1,4 +1,5 @@
1
1
  import { processCSSProp } from "../../styles/cssProps.js";
2
+ import { cx } from "../../styles/cx.js";
2
3
  import { useVanillaExtractTheme } from "../../styles/themeContext.js";
3
4
  import { containerRecipe } from "./Container.vanilla.css.js";
4
5
  import React from "react";
@@ -20,7 +21,7 @@ var ContainerVanillaComponent = React.forwardRef(({ as, className, css, style, s
20
21
  });
21
22
  return /* @__PURE__ */ jsx(Component, {
22
23
  ref,
23
- className: `${recipeClass} ${className || ""}`.trim(),
24
+ className: cx(recipeClass, className),
24
25
  style: mergedStyles,
25
26
  ...props
26
27
  });
@@ -1 +1 @@
1
- {"version":3,"file":"Container.vanilla.js","names":[],"sources":["../../../components/Container/Container.vanilla.tsx"],"sourcesContent":["import { assignInlineVars } from '@vanilla-extract/dynamic';\nimport React, { ElementType } from 'react';\n\nimport { CSSProps, processCSSProp } from '../../styles/cssProps';\nimport {\n PolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef,\n} from '../../styles/polymorphic';\nimport { useVanillaExtractTheme } from '../../styles/themeContext';\nimport { containerRecipe } from './Container.vanilla.css';\n\ninterface ContainerOwnProps extends CSSProps {\n size?: '1' | '2' | '3' | '4';\n noGutter?: boolean;\n}\n\nexport type ContainerProps<C extends ElementType = 'div'> = PolymorphicComponentProps<\n C,\n ContainerOwnProps\n>;\ntype ContainerComponent = PolymorphicComponent<'div', ContainerProps<ElementType>>;\n\nexport const ContainerVanillaComponent = React.forwardRef(\n <C extends ElementType = 'div'>(\n { as, className, css, style, size, noGutter, ...props }: ContainerProps<C>,\n ref?: PolymorphicRef<C>,\n ) => {\n const Component = as || 'div';\n\n const { colors } = useVanillaExtractTheme();\n\n const { style: cssStyles, vars } = processCSSProp(css, colors);\n\n const mergedStyles = {\n ...cssStyles,\n ...style,\n ...assignInlineVars(vars),\n };\n\n const recipeClass = containerRecipe({ size, noGutter });\n\n return (\n <Component\n ref={ref}\n className={`${recipeClass} ${className || ''}`.trim()}\n style={mergedStyles}\n {...props}\n />\n );\n },\n);\n\nContainerVanillaComponent.displayName = 'ContainerVanilla';\n\nexport const ContainerVanilla = ContainerVanillaComponent as ContainerComponent;\n"],"mappings":";;;;;;;AAuBA,IAAa,4BAA4B,MAAM,YAE3C,EAAE,IAAI,WAAW,KAAK,OAAO,MAAM,UAAU,GAAG,SAChD,QACG;CACH,MAAM,YAAY,MAAM;CAExB,MAAM,EAAE,WAAW,uBAAuB;CAE1C,MAAM,EAAE,OAAO,WAAW,SAAS,eAAe,KAAK,MAAM;CAE7D,MAAM,eAAe;EACnB,GAAG;EACH,GAAG;EACH,GAAG,iBAAiB,IAAI;CAC1B;CAEA,MAAM,cAAc,gBAAgB;EAAE;EAAM;CAAS,CAAC;CAEtD,OACE,oBAAC,WAAD;EACO;EACL,WAAW,GAAG,YAAY,GAAG,aAAa,KAAK,KAAK;EACpD,OAAO;EACP,GAAI;CACL,CAAA;AAEL,CACF;AAEA,0BAA0B,cAAc;AAExC,IAAa,mBAAmB"}
1
+ {"version":3,"file":"Container.vanilla.js","names":[],"sources":["../../../components/Container/Container.vanilla.tsx"],"sourcesContent":["import { assignInlineVars } from '@vanilla-extract/dynamic';\nimport React, { ElementType } from 'react';\n\nimport { CSSProps, processCSSProp } from '../../styles/cssProps';\nimport { cx } from '../../styles/cx';\nimport {\n PolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef,\n} from '../../styles/polymorphic';\nimport { useVanillaExtractTheme } from '../../styles/themeContext';\nimport { containerRecipe } from './Container.vanilla.css';\n\ninterface ContainerOwnProps extends CSSProps {\n size?: '1' | '2' | '3' | '4';\n noGutter?: boolean;\n}\n\nexport type ContainerProps<C extends ElementType = 'div'> = PolymorphicComponentProps<\n C,\n ContainerOwnProps\n>;\ntype ContainerComponent = PolymorphicComponent<'div', ContainerProps<ElementType>>;\n\nexport const ContainerVanillaComponent = React.forwardRef(\n <C extends ElementType = 'div'>(\n { as, className, css, style, size, noGutter, ...props }: ContainerProps<C>,\n ref?: PolymorphicRef<C>,\n ) => {\n const Component = as || 'div';\n\n const { colors } = useVanillaExtractTheme();\n\n const { style: cssStyles, vars } = processCSSProp(css, colors);\n\n const mergedStyles = {\n ...cssStyles,\n ...style,\n ...assignInlineVars(vars),\n };\n\n const recipeClass = containerRecipe({ size, noGutter });\n\n return (\n <Component ref={ref} className={cx(recipeClass, className)} style={mergedStyles} {...props} />\n );\n },\n);\n\nContainerVanillaComponent.displayName = 'ContainerVanilla';\n\nexport const ContainerVanilla = ContainerVanillaComponent as ContainerComponent;\n"],"mappings":";;;;;;;;AAwBA,IAAa,4BAA4B,MAAM,YAE3C,EAAE,IAAI,WAAW,KAAK,OAAO,MAAM,UAAU,GAAG,SAChD,QACG;CACH,MAAM,YAAY,MAAM;CAExB,MAAM,EAAE,WAAW,uBAAuB;CAE1C,MAAM,EAAE,OAAO,WAAW,SAAS,eAAe,KAAK,MAAM;CAE7D,MAAM,eAAe;EACnB,GAAG;EACH,GAAG;EACH,GAAG,iBAAiB,IAAI;CAC1B;CAEA,MAAM,cAAc,gBAAgB;EAAE;EAAM;CAAS,CAAC;CAEtD,OACE,oBAAC,WAAD;EAAgB;EAAK,WAAW,GAAG,aAAa,SAAS;EAAG,OAAO;EAAc,GAAI;CAAQ,CAAA;AAEjG,CACF;AAEA,0BAA0B,cAAc;AAExC,IAAa,mBAAmB"}
@@ -1,9 +1,9 @@
1
1
  const require_runtime = require("../../_virtual/_rolldown/runtime.cjs");
2
2
  const require_stitches_config = require("../../stitches.config.cjs");
3
3
  const require_Box = require("../Box/Box.cjs");
4
+ const require_Button = require("../Button/Button.cjs");
4
5
  const require_Flex = require("../Flex/Flex.cjs");
5
6
  const require_Text = require("../Text/Text.cjs");
6
- const require_Button = require("../Button/Button.cjs");
7
7
  let _radix_ui_react_icons = require("@radix-ui/react-icons");
8
8
  let react = require("react");
9
9
  react = require_runtime.__toESM(react, 1);
@@ -1,8 +1,8 @@
1
1
  import { styled } from "../../stitches.config.js";
2
2
  import { Box } from "../Box/Box.js";
3
+ import { Button } from "../Button/Button.js";
3
4
  import { Flex } from "../Flex/Flex.js";
4
5
  import { Text } from "../Text/Text.js";
5
- import { Button } from "../Button/Button.js";
6
6
  import { ChevronLeftIcon, ChevronRightIcon } from "@radix-ui/react-icons";
7
7
  import React, { useState } from "react";
8
8
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -1,7 +1,7 @@
1
1
  const require_runtime = require("../../_virtual/_rolldown/runtime.cjs");
2
2
  const require_stitches_config = require("../../stitches.config.cjs");
3
- const require_Elevation = require("../Elevation/Elevation.cjs");
4
3
  const require_Card = require("../Card/Card.cjs");
4
+ const require_Elevation = require("../Elevation/Elevation.cjs");
5
5
  const require_IconButton = require("../IconButton/IconButton.cjs");
6
6
  const require_Overlay = require("../Overlay.cjs");
7
7
  let _radix_ui_react_icons = require("@radix-ui/react-icons");
@@ -1,6 +1,6 @@
1
1
  import { styled } from "../../stitches.config.js";
2
- import { elevationVariants } from "../Elevation/Elevation.js";
3
2
  import { Card } from "../Card/Card.js";
3
+ import { elevationVariants } from "../Elevation/Elevation.js";
4
4
  import { IconButton } from "../IconButton/IconButton.js";
5
5
  import { overlayStyles } from "../Overlay.js";
6
6
  import { Cross1Icon } from "@radix-ui/react-icons";
@@ -1,4 +1,5 @@
1
1
  const require_cssProps = require("../../styles/cssProps.cjs");
2
+ const require_cx = require("../../styles/cx.cjs");
2
3
  const require_themeContext = require("../../styles/themeContext.cjs");
3
4
  const require_Elevation_vanilla_css = require("./Elevation.vanilla.css.cjs");
4
5
  let react = require("react");
@@ -17,7 +18,7 @@ var ElevationVanillaComponentImpl = (0, react.forwardRef)(({ as, className, css,
17
18
  const recipeClass = require_Elevation_vanilla_css.elevationRecipe({ variant });
18
19
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Component, {
19
20
  ref,
20
- className: `${recipeClass} ${className || ""}`.trim(),
21
+ className: require_cx.cx(recipeClass, className),
21
22
  style: mergedStyles,
22
23
  ...props
23
24
  });
@@ -1 +1 @@
1
- {"version":3,"file":"Elevation.vanilla.cjs","names":["forwardRef","useVanillaExtractTheme","processCSSProp","assignInlineVars","elevationRecipe"],"sources":["../../../components/Elevation/Elevation.vanilla.tsx"],"sourcesContent":["import { assignInlineVars } from '@vanilla-extract/dynamic';\nimport { RecipeVariants } from '@vanilla-extract/recipes';\nimport { ElementType, forwardRef } from 'react';\n\nimport { CSSProps, processCSSProp } from '../../styles/cssProps';\nimport {\n PolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef,\n} from '../../styles/polymorphic';\nimport { useVanillaExtractTheme } from '../../styles/themeContext';\nimport { elevationRecipe } from './Elevation.vanilla.css';\n\ntype ElevationRecipeVariants = NonNullable<RecipeVariants<typeof elevationRecipe>>;\n\ninterface ElevationOwnProps extends CSSProps {\n variant?: ElevationRecipeVariants['variant'];\n}\n\nexport type ElevationVanillaProps<C extends ElementType = 'div'> = PolymorphicComponentProps<\n C,\n ElevationOwnProps\n>;\n\ntype ElevationVanillaComponent = PolymorphicComponent<'div', ElevationVanillaProps<ElementType>>;\n\nconst ElevationVanillaComponentImpl = forwardRef(\n <C extends ElementType = 'div'>(\n { as, className, css, style, variant, ...props }: ElevationVanillaProps<C>,\n ref?: PolymorphicRef<C>,\n ) => {\n const Component = as || 'div';\n const { colors } = useVanillaExtractTheme();\n const { style: cssStyles, vars } = processCSSProp(css, colors);\n const mergedStyles = { ...cssStyles, ...style, ...assignInlineVars(vars) };\n const recipeClass = elevationRecipe({ variant });\n\n return (\n <Component\n ref={ref}\n className={`${recipeClass} ${className || ''}`.trim()}\n style={mergedStyles}\n {...props}\n />\n );\n },\n);\n\nElevationVanillaComponentImpl.displayName = 'ElevationVanilla';\n\nexport const ElevationVanilla = ElevationVanillaComponentImpl as ElevationVanillaComponent;\n"],"mappings":";;;;;;;AA0BA,IAAM,iCAAA,GAAgCA,MAAAA,WAAAA,EAElC,EAAE,IAAI,WAAW,KAAK,OAAO,SAAS,GAAG,SACzC,QACG;CACH,MAAM,YAAY,MAAM;CACxB,MAAM,EAAE,WAAWC,qBAAAA,uBAAuB;CAC1C,MAAM,EAAE,OAAO,WAAW,SAASC,iBAAAA,eAAe,KAAK,MAAM;CAC7D,MAAM,eAAe;EAAE,GAAG;EAAW,GAAG;EAAO,IAAA,GAAGC,yBAAAA,iBAAAA,CAAiB,IAAI;CAAE;CACzE,MAAM,cAAcC,8BAAAA,gBAAgB,EAAE,QAAQ,CAAC;CAE/C,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,WAAD;EACO;EACL,WAAW,GAAG,YAAY,GAAG,aAAa,KAAK,KAAK;EACpD,OAAO;EACP,GAAI;CACL,CAAA;AAEL,CACF;AAEA,8BAA8B,cAAc;AAE5C,IAAa,mBAAmB"}
1
+ {"version":3,"file":"Elevation.vanilla.cjs","names":["forwardRef","useVanillaExtractTheme","processCSSProp","assignInlineVars","elevationRecipe","cx"],"sources":["../../../components/Elevation/Elevation.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 { elevationRecipe } from './Elevation.vanilla.css';\n\ntype ElevationRecipeVariants = NonNullable<RecipeVariants<typeof elevationRecipe>>;\n\ninterface ElevationOwnProps extends CSSProps {\n variant?: ElevationRecipeVariants['variant'];\n}\n\nexport type ElevationVanillaProps<C extends ElementType = 'div'> = PolymorphicComponentProps<\n C,\n ElevationOwnProps\n>;\n\ntype ElevationVanillaComponent = PolymorphicComponent<'div', ElevationVanillaProps<ElementType>>;\n\nconst ElevationVanillaComponentImpl = forwardRef(\n <C extends ElementType = 'div'>(\n { as, className, css, style, variant, ...props }: ElevationVanillaProps<C>,\n ref?: PolymorphicRef<C>,\n ) => {\n const Component = as || 'div';\n const { colors } = useVanillaExtractTheme();\n const { style: cssStyles, vars } = processCSSProp(css, colors);\n const mergedStyles = { ...cssStyles, ...style, ...assignInlineVars(vars) };\n const recipeClass = elevationRecipe({ variant });\n\n return (\n <Component ref={ref} className={cx(recipeClass, className)} style={mergedStyles} {...props} />\n );\n },\n);\n\nElevationVanillaComponentImpl.displayName = 'ElevationVanilla';\n\nexport const ElevationVanilla = ElevationVanillaComponentImpl as ElevationVanillaComponent;\n"],"mappings":";;;;;;;;AA2BA,IAAM,iCAAA,GAAgCA,MAAAA,WAAAA,EAElC,EAAE,IAAI,WAAW,KAAK,OAAO,SAAS,GAAG,SACzC,QACG;CACH,MAAM,YAAY,MAAM;CACxB,MAAM,EAAE,WAAWC,qBAAAA,uBAAuB;CAC1C,MAAM,EAAE,OAAO,WAAW,SAASC,iBAAAA,eAAe,KAAK,MAAM;CAC7D,MAAM,eAAe;EAAE,GAAG;EAAW,GAAG;EAAO,IAAA,GAAGC,yBAAAA,iBAAAA,CAAiB,IAAI;CAAE;CACzE,MAAM,cAAcC,8BAAAA,gBAAgB,EAAE,QAAQ,CAAC;CAE/C,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,WAAD;EAAgB;EAAK,WAAWC,WAAAA,GAAG,aAAa,SAAS;EAAG,OAAO;EAAc,GAAI;CAAQ,CAAA;AAEjG,CACF;AAEA,8BAA8B,cAAc;AAE5C,IAAa,mBAAmB"}
@@ -1 +1 @@
1
- {"version":3,"file":"Elevation.vanilla.css.cjs","names":["_7a468"],"sources":["../../../components/Elevation/Elevation.vanilla.css.ts"],"sourcesContent":["import { style } from '@vanilla-extract/css';\nimport { recipe } from '@vanilla-extract/recipes';\n\nimport { tokens } from '../../styles/tokens.css';\n\nconst elevationBase = style({\n display: 'inline-block',\n});\n\nexport const elevationRecipe = recipe({\n base: elevationBase,\n\n variants: {\n variant: {\n 0: {\n boxShadow: 'none',\n },\n 1: {\n backgroundColor: tokens.colors['01dp'],\n boxShadow:\n '0 1px 5px 0 hsla(0, 0%, 0%, 0.2), 0 3px 1px -2px hsla(0, 0%, 0%, 0.12), 0 2px 2px 0 hsla(0, 0%, 0%, 0.14)',\n },\n 2: {\n backgroundColor: tokens.colors['02dp'],\n boxShadow:\n '0 2px 4px -1px hsla(0, 0%, 0%, 0.2), 0 1px 10px 0 hsla(0, 0%, 0%, 0.12), 0 4px 5px 0 hsla(0, 0%, 0%, 0.14)',\n },\n 3: {\n backgroundColor: tokens.colors['03dp'],\n boxShadow:\n '0 3px 5px -1px hsla(0, 0%, 0%, 0.2), 0 1px 18px 0 hsla(0, 0%, 0%, 0.12), 0 6px 10px 0 hsla(0, 0%, 0%, 0.14)',\n },\n 4: {\n backgroundColor: tokens.colors['04dp'],\n boxShadow:\n '0 7px 8px -4px hsla(0, 0%, 0%, 0.2), 0 5px 22px 4px hsla(0, 0%, 0%, 0.12), 0 12px 17px 2px hsla(0, 0%, 0%, 0.14)',\n },\n 5: {\n backgroundColor: tokens.colors['05dp'],\n boxShadow:\n '0 11px 15px -7px hsla(0, 0%, 0%, 0.2), 0 9px 46px 8px hsla(0, 0%, 0%, 0.12), 0 24px 38px 3px hsla(0, 0%, 0%, 0.14)',\n },\n },\n },\n\n defaultVariants: {\n variant: 1,\n },\n});\n"],"mappings":""}
1
+ {"version":3,"file":"Elevation.vanilla.css.cjs","names":["_7a468"],"sources":["../../../components/Elevation/Elevation.vanilla.css.ts"],"sourcesContent":["import { style } from '@vanilla-extract/css';\nimport { recipe } from '@vanilla-extract/recipes';\n\nimport { tokens } from '../../styles/tokens.css';\n\nconst elevationBase = style({\n display: 'inline-block',\n});\n\nexport const elevationVariants = {\n 0: {\n boxShadow: 'none',\n },\n 1: {\n backgroundColor: tokens.colors['01dp'],\n boxShadow:\n '0 1px 5px 0 hsla(0, 0%, 0%, 0.2), 0 3px 1px -2px hsla(0, 0%, 0%, 0.12), 0 2px 2px 0 hsla(0, 0%, 0%, 0.14)',\n },\n 2: {\n backgroundColor: tokens.colors['02dp'],\n boxShadow:\n '0 2px 4px -1px hsla(0, 0%, 0%, 0.2), 0 1px 10px 0 hsla(0, 0%, 0%, 0.12), 0 4px 5px 0 hsla(0, 0%, 0%, 0.14)',\n },\n 3: {\n backgroundColor: tokens.colors['03dp'],\n boxShadow:\n '0 3px 5px -1px hsla(0, 0%, 0%, 0.2), 0 1px 18px 0 hsla(0, 0%, 0%, 0.12), 0 6px 10px 0 hsla(0, 0%, 0%, 0.14)',\n },\n 4: {\n backgroundColor: tokens.colors['04dp'],\n boxShadow:\n '0 7px 8px -4px hsla(0, 0%, 0%, 0.2), 0 5px 22px 4px hsla(0, 0%, 0%, 0.12), 0 12px 17px 2px hsla(0, 0%, 0%, 0.14)',\n },\n 5: {\n backgroundColor: tokens.colors['05dp'],\n boxShadow:\n '0 11px 15px -7px hsla(0, 0%, 0%, 0.2), 0 9px 46px 8px hsla(0, 0%, 0%, 0.12), 0 24px 38px 3px hsla(0, 0%, 0%, 0.14)',\n },\n} as const;\n\nexport const elevationRecipe = recipe({\n base: elevationBase,\n\n variants: {\n variant: elevationVariants,\n },\n\n defaultVariants: {\n variant: 1,\n },\n});\n"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"Elevation.vanilla.css.js","names":["_7a468"],"sources":["../../../components/Elevation/Elevation.vanilla.css.ts"],"sourcesContent":["import { style } from '@vanilla-extract/css';\nimport { recipe } from '@vanilla-extract/recipes';\n\nimport { tokens } from '../../styles/tokens.css';\n\nconst elevationBase = style({\n display: 'inline-block',\n});\n\nexport const elevationRecipe = recipe({\n base: elevationBase,\n\n variants: {\n variant: {\n 0: {\n boxShadow: 'none',\n },\n 1: {\n backgroundColor: tokens.colors['01dp'],\n boxShadow:\n '0 1px 5px 0 hsla(0, 0%, 0%, 0.2), 0 3px 1px -2px hsla(0, 0%, 0%, 0.12), 0 2px 2px 0 hsla(0, 0%, 0%, 0.14)',\n },\n 2: {\n backgroundColor: tokens.colors['02dp'],\n boxShadow:\n '0 2px 4px -1px hsla(0, 0%, 0%, 0.2), 0 1px 10px 0 hsla(0, 0%, 0%, 0.12), 0 4px 5px 0 hsla(0, 0%, 0%, 0.14)',\n },\n 3: {\n backgroundColor: tokens.colors['03dp'],\n boxShadow:\n '0 3px 5px -1px hsla(0, 0%, 0%, 0.2), 0 1px 18px 0 hsla(0, 0%, 0%, 0.12), 0 6px 10px 0 hsla(0, 0%, 0%, 0.14)',\n },\n 4: {\n backgroundColor: tokens.colors['04dp'],\n boxShadow:\n '0 7px 8px -4px hsla(0, 0%, 0%, 0.2), 0 5px 22px 4px hsla(0, 0%, 0%, 0.12), 0 12px 17px 2px hsla(0, 0%, 0%, 0.14)',\n },\n 5: {\n backgroundColor: tokens.colors['05dp'],\n boxShadow:\n '0 11px 15px -7px hsla(0, 0%, 0%, 0.2), 0 9px 46px 8px hsla(0, 0%, 0%, 0.12), 0 24px 38px 3px hsla(0, 0%, 0%, 0.14)',\n },\n },\n },\n\n defaultVariants: {\n variant: 1,\n },\n});\n"],"mappings":""}
1
+ {"version":3,"file":"Elevation.vanilla.css.js","names":["_7a468"],"sources":["../../../components/Elevation/Elevation.vanilla.css.ts"],"sourcesContent":["import { style } from '@vanilla-extract/css';\nimport { recipe } from '@vanilla-extract/recipes';\n\nimport { tokens } from '../../styles/tokens.css';\n\nconst elevationBase = style({\n display: 'inline-block',\n});\n\nexport const elevationVariants = {\n 0: {\n boxShadow: 'none',\n },\n 1: {\n backgroundColor: tokens.colors['01dp'],\n boxShadow:\n '0 1px 5px 0 hsla(0, 0%, 0%, 0.2), 0 3px 1px -2px hsla(0, 0%, 0%, 0.12), 0 2px 2px 0 hsla(0, 0%, 0%, 0.14)',\n },\n 2: {\n backgroundColor: tokens.colors['02dp'],\n boxShadow:\n '0 2px 4px -1px hsla(0, 0%, 0%, 0.2), 0 1px 10px 0 hsla(0, 0%, 0%, 0.12), 0 4px 5px 0 hsla(0, 0%, 0%, 0.14)',\n },\n 3: {\n backgroundColor: tokens.colors['03dp'],\n boxShadow:\n '0 3px 5px -1px hsla(0, 0%, 0%, 0.2), 0 1px 18px 0 hsla(0, 0%, 0%, 0.12), 0 6px 10px 0 hsla(0, 0%, 0%, 0.14)',\n },\n 4: {\n backgroundColor: tokens.colors['04dp'],\n boxShadow:\n '0 7px 8px -4px hsla(0, 0%, 0%, 0.2), 0 5px 22px 4px hsla(0, 0%, 0%, 0.12), 0 12px 17px 2px hsla(0, 0%, 0%, 0.14)',\n },\n 5: {\n backgroundColor: tokens.colors['05dp'],\n boxShadow:\n '0 11px 15px -7px hsla(0, 0%, 0%, 0.2), 0 9px 46px 8px hsla(0, 0%, 0%, 0.12), 0 24px 38px 3px hsla(0, 0%, 0%, 0.14)',\n },\n} as const;\n\nexport const elevationRecipe = recipe({\n base: elevationBase,\n\n variants: {\n variant: elevationVariants,\n },\n\n defaultVariants: {\n variant: 1,\n },\n});\n"],"mappings":""}
@@ -1,4 +1,5 @@
1
1
  import { processCSSProp } from "../../styles/cssProps.js";
2
+ import { cx } from "../../styles/cx.js";
2
3
  import { useVanillaExtractTheme } from "../../styles/themeContext.js";
3
4
  import { elevationRecipe } from "./Elevation.vanilla.css.js";
4
5
  import { forwardRef } from "react";
@@ -17,7 +18,7 @@ var ElevationVanillaComponentImpl = forwardRef(({ as, className, css, style, var
17
18
  const recipeClass = elevationRecipe({ variant });
18
19
  return /* @__PURE__ */ jsx(Component, {
19
20
  ref,
20
- className: `${recipeClass} ${className || ""}`.trim(),
21
+ className: cx(recipeClass, className),
21
22
  style: mergedStyles,
22
23
  ...props
23
24
  });
@@ -1 +1 @@
1
- {"version":3,"file":"Elevation.vanilla.js","names":[],"sources":["../../../components/Elevation/Elevation.vanilla.tsx"],"sourcesContent":["import { assignInlineVars } from '@vanilla-extract/dynamic';\nimport { RecipeVariants } from '@vanilla-extract/recipes';\nimport { ElementType, forwardRef } from 'react';\n\nimport { CSSProps, processCSSProp } from '../../styles/cssProps';\nimport {\n PolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef,\n} from '../../styles/polymorphic';\nimport { useVanillaExtractTheme } from '../../styles/themeContext';\nimport { elevationRecipe } from './Elevation.vanilla.css';\n\ntype ElevationRecipeVariants = NonNullable<RecipeVariants<typeof elevationRecipe>>;\n\ninterface ElevationOwnProps extends CSSProps {\n variant?: ElevationRecipeVariants['variant'];\n}\n\nexport type ElevationVanillaProps<C extends ElementType = 'div'> = PolymorphicComponentProps<\n C,\n ElevationOwnProps\n>;\n\ntype ElevationVanillaComponent = PolymorphicComponent<'div', ElevationVanillaProps<ElementType>>;\n\nconst ElevationVanillaComponentImpl = forwardRef(\n <C extends ElementType = 'div'>(\n { as, className, css, style, variant, ...props }: ElevationVanillaProps<C>,\n ref?: PolymorphicRef<C>,\n ) => {\n const Component = as || 'div';\n const { colors } = useVanillaExtractTheme();\n const { style: cssStyles, vars } = processCSSProp(css, colors);\n const mergedStyles = { ...cssStyles, ...style, ...assignInlineVars(vars) };\n const recipeClass = elevationRecipe({ variant });\n\n return (\n <Component\n ref={ref}\n className={`${recipeClass} ${className || ''}`.trim()}\n style={mergedStyles}\n {...props}\n />\n );\n },\n);\n\nElevationVanillaComponentImpl.displayName = 'ElevationVanilla';\n\nexport const ElevationVanilla = ElevationVanillaComponentImpl as ElevationVanillaComponent;\n"],"mappings":";;;;;;;AA0BA,IAAM,gCAAgC,YAElC,EAAE,IAAI,WAAW,KAAK,OAAO,SAAS,GAAG,SACzC,QACG;CACH,MAAM,YAAY,MAAM;CACxB,MAAM,EAAE,WAAW,uBAAuB;CAC1C,MAAM,EAAE,OAAO,WAAW,SAAS,eAAe,KAAK,MAAM;CAC7D,MAAM,eAAe;EAAE,GAAG;EAAW,GAAG;EAAO,GAAG,iBAAiB,IAAI;CAAE;CACzE,MAAM,cAAc,gBAAgB,EAAE,QAAQ,CAAC;CAE/C,OACE,oBAAC,WAAD;EACO;EACL,WAAW,GAAG,YAAY,GAAG,aAAa,KAAK,KAAK;EACpD,OAAO;EACP,GAAI;CACL,CAAA;AAEL,CACF;AAEA,8BAA8B,cAAc;AAE5C,IAAa,mBAAmB"}
1
+ {"version":3,"file":"Elevation.vanilla.js","names":[],"sources":["../../../components/Elevation/Elevation.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 { elevationRecipe } from './Elevation.vanilla.css';\n\ntype ElevationRecipeVariants = NonNullable<RecipeVariants<typeof elevationRecipe>>;\n\ninterface ElevationOwnProps extends CSSProps {\n variant?: ElevationRecipeVariants['variant'];\n}\n\nexport type ElevationVanillaProps<C extends ElementType = 'div'> = PolymorphicComponentProps<\n C,\n ElevationOwnProps\n>;\n\ntype ElevationVanillaComponent = PolymorphicComponent<'div', ElevationVanillaProps<ElementType>>;\n\nconst ElevationVanillaComponentImpl = forwardRef(\n <C extends ElementType = 'div'>(\n { as, className, css, style, variant, ...props }: ElevationVanillaProps<C>,\n ref?: PolymorphicRef<C>,\n ) => {\n const Component = as || 'div';\n const { colors } = useVanillaExtractTheme();\n const { style: cssStyles, vars } = processCSSProp(css, colors);\n const mergedStyles = { ...cssStyles, ...style, ...assignInlineVars(vars) };\n const recipeClass = elevationRecipe({ variant });\n\n return (\n <Component ref={ref} className={cx(recipeClass, className)} style={mergedStyles} {...props} />\n );\n },\n);\n\nElevationVanillaComponentImpl.displayName = 'ElevationVanilla';\n\nexport const ElevationVanilla = ElevationVanillaComponentImpl as ElevationVanillaComponent;\n"],"mappings":";;;;;;;;AA2BA,IAAM,gCAAgC,YAElC,EAAE,IAAI,WAAW,KAAK,OAAO,SAAS,GAAG,SACzC,QACG;CACH,MAAM,YAAY,MAAM;CACxB,MAAM,EAAE,WAAW,uBAAuB;CAC1C,MAAM,EAAE,OAAO,WAAW,SAAS,eAAe,KAAK,MAAM;CAC7D,MAAM,eAAe;EAAE,GAAG;EAAW,GAAG;EAAO,GAAG,iBAAiB,IAAI;CAAE;CACzE,MAAM,cAAc,gBAAgB,EAAE,QAAQ,CAAC;CAE/C,OACE,oBAAC,WAAD;EAAgB;EAAK,WAAW,GAAG,aAAa,SAAS;EAAG,OAAO;EAAc,GAAI;CAAQ,CAAA;AAEjG,CACF;AAEA,8BAA8B,cAAc;AAE5C,IAAa,mBAAmB"}
@@ -1,9 +1,9 @@
1
1
  const require_runtime = require("../../_virtual/_rolldown/runtime.cjs");
2
2
  const require_Box = require("../Box/Box.cjs");
3
- const require_Text = require("../Text/Text.cjs");
4
3
  const require_Label = require("../Label/Label.cjs");
5
- const require_FieldContext = require("./FieldContext.cjs");
4
+ const require_Text = require("../Text/Text.cjs");
6
5
  const require_VisuallyHidden = require("../VisuallyHidden/VisuallyHidden.cjs");
6
+ const require_FieldContext = require("./FieldContext.cjs");
7
7
  let react = require("react");
8
8
  react = require_runtime.__toESM(react, 1);
9
9
  let react_jsx_runtime = require("react/jsx-runtime");
@@ -11,56 +11,106 @@ let react_jsx_runtime = require("react/jsx-runtime");
11
11
  var MESSAGE_CSS = {
12
12
  display: "block",
13
13
  m: 0,
14
- mt: "$1"
14
+ mt: "$1",
15
+ lineHeight: 1.4
16
+ };
17
+ var COMPACT_LABEL_CSS = { lineHeight: 1.4 };
18
+ var HINT_ABOVE_CONTROL_CSS = {
19
+ ...MESSAGE_CSS,
20
+ mb: "$2"
21
+ };
22
+ var START_ROW_CSS = {
23
+ display: "flex",
24
+ flexWrap: "wrap",
25
+ alignItems: "baseline",
26
+ columnGap: "$5",
27
+ rowGap: "$2"
28
+ };
29
+ var START_LABEL_CSS = {
30
+ flex: "1 1 0",
31
+ minWidth: "10rem"
32
+ };
33
+ var START_CONTROL_CSS = {
34
+ flex: "2 1 0",
35
+ minWidth: "16rem"
15
36
  };
16
37
  /**
17
- * Gives a label, a description and an error to the one form control inside it.
18
- * Its label connects to one control, so do not put two controls in one Field.
38
+ * Gives a label, a hint, a description and an error to the one form control inside it.
39
+ * For more than one control, use `group`.
19
40
  */
20
- var Field = ({ label, description, error, announceError, labelPosition = "top", children, css, ...props }) => {
21
- const { context, labelFor, labelVariant, hasLabel, hasDescription, hasError, onFocus, onBlur } = require_FieldContext.useFieldRoot({
41
+ var Field = ({ label, hint, description, error, announceError, labelPosition = "top", children, css, ...props }) => {
42
+ const { context, ids, groupProps, messageSize, labelFor, labelVariant, hasLabel, hasHint, hasDescription, hasError, onFocus, onBlur } = require_FieldContext.useFieldRoot({
22
43
  label,
44
+ hint,
23
45
  description,
24
46
  error,
25
47
  ...props
26
48
  });
27
- const announcedError = require_FieldContext.useAnnouncedError(Boolean(announceError), hasError ? context.errorId : void 0, context.labelId);
49
+ const announcedError = require_FieldContext.useAnnouncedError(Boolean(announceError), hasError ? ids.errorId : void 0, ids.labelId);
28
50
  const labelNode = react.default.useMemo(() => {
29
- if (!hasLabel || !context.labelId) return null;
51
+ if (!hasLabel || !ids.labelId) return null;
30
52
  if (typeof label === "function") return label({
31
53
  variant: labelVariant,
32
54
  htmlFor: labelFor,
33
- id: context.labelId
55
+ id: ids.labelId
34
56
  });
35
57
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Label.Label, {
36
58
  variant: labelVariant,
37
59
  htmlFor: labelFor,
38
- id: context.labelId,
60
+ id: ids.labelId,
61
+ css: hasHint || labelPosition === "start" ? COMPACT_LABEL_CSS : void 0,
39
62
  children: label
40
63
  });
41
64
  }, [
42
65
  hasLabel,
66
+ hasHint,
43
67
  label,
68
+ labelPosition,
44
69
  labelVariant,
45
70
  labelFor,
46
- context.labelId
71
+ ids.labelId
47
72
  ]);
48
- const errorNode = hasError && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Text.Text, {
73
+ const hintNode = hasHint && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Text.Text, {
74
+ as: "p",
75
+ id: ids.hintId,
76
+ size: messageSize,
77
+ variant: "subtle",
78
+ css: labelPosition === "top" ? HINT_ABOVE_CONTROL_CSS : MESSAGE_CSS,
79
+ children: hint
80
+ });
81
+ const messages = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [hasDescription && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Text.Text, {
49
82
  as: "p",
50
- id: context.errorId,
51
- size: "0",
83
+ id: ids.descriptionId,
84
+ size: messageSize,
85
+ variant: "subtle",
86
+ css: MESSAGE_CSS,
87
+ children: description
88
+ }), hasError && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Text.Text, {
89
+ as: "p",
90
+ id: ids.errorId,
91
+ size: messageSize,
52
92
  variant: "invalid",
53
93
  css: MESSAGE_CSS,
54
94
  children: error
55
- });
95
+ })] });
56
96
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_FieldContext.FieldContext.Provider, {
57
97
  value: context,
58
98
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_Box.Box, {
59
- css,
99
+ css: labelPosition === "start" ? {
100
+ ...START_ROW_CSS,
101
+ ...css
102
+ } : css,
60
103
  onFocus,
61
104
  onBlur,
62
- children: [
63
- labelPosition === "end" ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_Box.Box, {
105
+ ...groupProps,
106
+ children: [labelPosition === "start" ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_Box.Box, {
107
+ css: START_LABEL_CSS,
108
+ children: [labelNode, hintNode]
109
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_Box.Box, {
110
+ css: START_CONTROL_CSS,
111
+ children: [children, messages]
112
+ })] }) : labelPosition === "end" ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
113
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_Box.Box, {
64
114
  css: {
65
115
  display: "flex",
66
116
  alignItems: "center",
@@ -68,21 +118,18 @@ var Field = ({ label, description, error, announceError, labelPosition = "top",
68
118
  "& > [role=\"switch\"]": { m: 0 }
69
119
  },
70
120
  children: [children, labelNode]
71
- }) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [labelNode, children] }),
72
- hasDescription && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Text.Text, {
73
- as: "p",
74
- id: context.descriptionId,
75
- size: "0",
76
- variant: "subtle",
77
- css: MESSAGE_CSS,
78
- children: description
79
121
  }),
80
- errorNode,
81
- announceError && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_VisuallyHidden.VisuallyHidden, {
82
- "aria-live": "polite",
83
- children: announcedError
84
- })
85
- ]
122
+ hintNode,
123
+ messages
124
+ ] }) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
125
+ labelNode,
126
+ hintNode,
127
+ children,
128
+ messages
129
+ ] }), announceError && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_VisuallyHidden.VisuallyHidden, {
130
+ "aria-live": "polite",
131
+ children: announcedError
132
+ })]
86
133
  })
87
134
  });
88
135
  };
@@ -1 +1 @@
1
- {"version":3,"file":"Field.cjs","names":["useFieldRoot","useAnnouncedError","React","Label","Text","FieldContext","Box","_Fragment","VisuallyHidden"],"sources":["../../../components/Field/Field.tsx"],"sourcesContent":["import React from 'react';\n\nimport { CSS } from '../../stitches.config';\nimport { Box } from '../Box';\nimport { Label } from '../Label';\nimport { Text } from '../Text';\nimport { VisuallyHidden } from '../VisuallyHidden';\nimport { FieldBaseProps, FieldContext, useAnnouncedError, useFieldRoot } from './FieldContext';\n\nexport type FieldProps = FieldBaseProps & { css?: CSS };\n\nconst MESSAGE_CSS = { display: 'block', m: 0, mt: '$1' };\n\n/**\n * Gives a label, a description and an error to the one form control inside it.\n * Its label connects to one control, so do not put two controls in one Field.\n */\nexport const Field = ({\n label,\n description,\n error,\n announceError,\n labelPosition = 'top',\n children,\n css,\n ...props\n}: FieldProps) => {\n const { context, labelFor, labelVariant, hasLabel, hasDescription, hasError, onFocus, onBlur } =\n useFieldRoot({ label, description, error, ...props });\n const announcedError = useAnnouncedError(\n Boolean(announceError),\n hasError ? context.errorId : undefined,\n context.labelId,\n );\n\n const labelNode = React.useMemo(() => {\n if (!hasLabel || !context.labelId) {\n return null;\n }\n if (typeof label === 'function') {\n return label({ variant: labelVariant, htmlFor: labelFor, id: context.labelId });\n }\n return (\n <Label variant={labelVariant} htmlFor={labelFor} id={context.labelId}>\n {label}\n </Label>\n );\n }, [hasLabel, label, labelVariant, labelFor, context.labelId]);\n\n const errorNode = hasError && (\n <Text as=\"p\" id={context.errorId} size=\"0\" variant=\"invalid\" css={MESSAGE_CSS}>\n {error}\n </Text>\n );\n\n return (\n <FieldContext.Provider value={context}>\n <Box css={css} onFocus={onFocus} onBlur={onBlur}>\n {labelPosition === 'end' ? (\n <Box\n css={{\n display: 'flex',\n alignItems: 'center',\n gap: '$2',\n '& > [role=\"switch\"]': { m: 0 },\n }}\n >\n {children}\n {labelNode}\n </Box>\n ) : (\n <>\n {labelNode}\n {children}\n </>\n )}\n {hasDescription && (\n <Text as=\"p\" id={context.descriptionId} size=\"0\" variant=\"subtle\" css={MESSAGE_CSS}>\n {description}\n </Text>\n )}\n {errorNode}\n {announceError && <VisuallyHidden aria-live=\"polite\">{announcedError}</VisuallyHidden>}\n </Box>\n </FieldContext.Provider>\n );\n};\n"],"mappings":";;;;;;;;;;AAWA,IAAM,cAAc;CAAE,SAAS;CAAS,GAAG;CAAG,IAAI;AAAK;;;;;AAMvD,IAAa,SAAS,EACpB,OACA,aACA,OACA,eACA,gBAAgB,OAChB,UACA,KACA,GAAG,YACa;CAChB,MAAM,EAAE,SAAS,UAAU,cAAc,UAAU,gBAAgB,UAAU,SAAS,WACpFA,qBAAAA,aAAa;EAAE;EAAO;EAAa;EAAO,GAAG;CAAM,CAAC;CACtD,MAAM,iBAAiBC,qBAAAA,kBACrB,QAAQ,aAAa,GACrB,WAAW,QAAQ,UAAU,KAAA,GAC7B,QAAQ,OACV;CAEA,MAAM,YAAYC,MAAAA,QAAM,cAAc;EACpC,IAAI,CAAC,YAAY,CAAC,QAAQ,SACxB,OAAO;EAET,IAAI,OAAO,UAAU,YACnB,OAAO,MAAM;GAAE,SAAS;GAAc,SAAS;GAAU,IAAI,QAAQ;EAAQ,CAAC;EAEhF,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACC,cAAAA,OAAD;GAAO,SAAS;GAAc,SAAS;GAAU,IAAI,QAAQ;GAC1D,UAAA;EACI,CAAA;CAEX,GAAG;EAAC;EAAU;EAAO;EAAc;EAAU,QAAQ;CAAO,CAAC;CAE7D,MAAM,YAAY,YAChB,iBAAA,GAAA,kBAAA,IAAA,CAACC,aAAAA,MAAD;EAAM,IAAG;EAAI,IAAI,QAAQ;EAAS,MAAK;EAAI,SAAQ;EAAU,KAAK;EAC/D,UAAA;CACG,CAAA;CAGR,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACC,qBAAAA,aAAa,UAAd;EAAuB,OAAO;EAC5B,UAAA,iBAAA,GAAA,kBAAA,KAAA,CAACC,YAAAA,KAAD;GAAU;GAAc;GAAiB;GAAzC,UAAA;IACG,kBAAkB,QACjB,iBAAA,GAAA,kBAAA,KAAA,CAACA,YAAAA,KAAD;KACE,KAAK;MACH,SAAS;MACT,YAAY;MACZ,KAAK;MACL,yBAAuB,EAAE,GAAG,EAAE;KAChC;KANF,UAAA,CAQG,UACA,SACE;IAEL,CAAA,IAAA,iBAAA,GAAA,kBAAA,KAAA,CAAAC,kBAAAA,UAAA,EAAA,UAAA,CACG,WACA,QACD,EAAA,CAAA;IAEH,kBACC,iBAAA,GAAA,kBAAA,IAAA,CAACH,aAAAA,MAAD;KAAM,IAAG;KAAI,IAAI,QAAQ;KAAe,MAAK;KAAI,SAAQ;KAAS,KAAK;KACpE,UAAA;IACG,CAAA;IAEP;IACA,iBAAiB,iBAAA,GAAA,kBAAA,IAAA,CAACI,uBAAAA,gBAAD;KAAgB,aAAU;KAAU,UAAA;IAA+B,CAAA;GAClF;;CACgB,CAAA;AAE3B"}
1
+ {"version":3,"file":"Field.cjs","names":["useFieldRoot","useAnnouncedError","React","Label","Text","_Fragment","FieldContext","Box","VisuallyHidden"],"sources":["../../../components/Field/Field.tsx"],"sourcesContent":["import React from 'react';\n\nimport { CSS } from '../../stitches.config';\nimport { Box } from '../Box';\nimport { Label } from '../Label';\nimport { Text } from '../Text';\nimport { VisuallyHidden } from '../VisuallyHidden';\nimport { FieldBaseProps, FieldContext, useAnnouncedError, useFieldRoot } from './FieldContext';\n\nexport type FieldProps = FieldBaseProps & { css?: CSS };\n\nconst MESSAGE_CSS = { display: 'block', m: 0, mt: '$1', lineHeight: 1.4 };\n// The tall line of a label makes room for a control right under it. Before a hint or beside a control, it is a gap.\nconst COMPACT_LABEL_CSS = { lineHeight: 1.4 };\nconst HINT_ABOVE_CONTROL_CSS = { ...MESSAGE_CSS, mb: '$2' };\n\nconst START_ROW_CSS = {\n display: 'flex',\n flexWrap: 'wrap',\n alignItems: 'baseline',\n columnGap: '$5',\n rowGap: '$2',\n};\nconst START_LABEL_CSS = { flex: '1 1 0', minWidth: '10rem' };\nconst START_CONTROL_CSS = { flex: '2 1 0', minWidth: '16rem' };\n\n/**\n * Gives a label, a hint, a description and an error to the one form control inside it.\n * For more than one control, use `group`.\n */\nexport const Field = ({\n label,\n hint,\n description,\n error,\n announceError,\n labelPosition = 'top',\n children,\n css,\n ...props\n}: FieldProps) => {\n const {\n context,\n ids,\n groupProps,\n messageSize,\n labelFor,\n labelVariant,\n hasLabel,\n hasHint,\n hasDescription,\n hasError,\n onFocus,\n onBlur,\n } = useFieldRoot({ label, hint, description, error, ...props });\n const announcedError = useAnnouncedError(\n Boolean(announceError),\n hasError ? ids.errorId : undefined,\n ids.labelId,\n );\n\n const labelNode = React.useMemo(() => {\n if (!hasLabel || !ids.labelId) {\n return null;\n }\n if (typeof label === 'function') {\n return label({ variant: labelVariant, htmlFor: labelFor, id: ids.labelId });\n }\n return (\n <Label\n variant={labelVariant}\n htmlFor={labelFor}\n id={ids.labelId}\n css={hasHint || labelPosition === 'start' ? COMPACT_LABEL_CSS : undefined}\n >\n {label}\n </Label>\n );\n }, [hasLabel, hasHint, label, labelPosition, labelVariant, labelFor, ids.labelId]);\n\n const hintNode = hasHint && (\n <Text\n as=\"p\"\n id={ids.hintId}\n size={messageSize}\n variant=\"subtle\"\n css={labelPosition === 'top' ? HINT_ABOVE_CONTROL_CSS : MESSAGE_CSS}\n >\n {hint}\n </Text>\n );\n\n const messages = (\n <>\n {hasDescription && (\n <Text as=\"p\" id={ids.descriptionId} size={messageSize} variant=\"subtle\" css={MESSAGE_CSS}>\n {description}\n </Text>\n )}\n {hasError && (\n <Text as=\"p\" id={ids.errorId} size={messageSize} variant=\"invalid\" css={MESSAGE_CSS}>\n {error}\n </Text>\n )}\n </>\n );\n\n return (\n <FieldContext.Provider value={context}>\n <Box\n css={labelPosition === 'start' ? { ...START_ROW_CSS, ...css } : css}\n onFocus={onFocus}\n onBlur={onBlur}\n {...groupProps}\n >\n {labelPosition === 'start' ? (\n <>\n <Box css={START_LABEL_CSS}>\n {labelNode}\n {hintNode}\n </Box>\n <Box css={START_CONTROL_CSS}>\n {children}\n {messages}\n </Box>\n </>\n ) : labelPosition === 'end' ? (\n <>\n <Box\n css={{\n display: 'flex',\n alignItems: 'center',\n gap: '$2',\n '& > [role=\"switch\"]': { m: 0 },\n }}\n >\n {children}\n {labelNode}\n </Box>\n {hintNode}\n {messages}\n </>\n ) : (\n <>\n {labelNode}\n {hintNode}\n {children}\n {messages}\n </>\n )}\n {announceError && <VisuallyHidden aria-live=\"polite\">{announcedError}</VisuallyHidden>}\n </Box>\n </FieldContext.Provider>\n );\n};\n"],"mappings":";;;;;;;;;;AAWA,IAAM,cAAc;CAAE,SAAS;CAAS,GAAG;CAAG,IAAI;CAAM,YAAY;AAAI;AAExE,IAAM,oBAAoB,EAAE,YAAY,IAAI;AAC5C,IAAM,yBAAyB;CAAE,GAAG;CAAa,IAAI;AAAK;AAE1D,IAAM,gBAAgB;CACpB,SAAS;CACT,UAAU;CACV,YAAY;CACZ,WAAW;CACX,QAAQ;AACV;AACA,IAAM,kBAAkB;CAAE,MAAM;CAAS,UAAU;AAAQ;AAC3D,IAAM,oBAAoB;CAAE,MAAM;CAAS,UAAU;AAAQ;;;;;AAM7D,IAAa,SAAS,EACpB,OACA,MACA,aACA,OACA,eACA,gBAAgB,OAChB,UACA,KACA,GAAG,YACa;CAChB,MAAM,EACJ,SACA,KACA,YACA,aACA,UACA,cACA,UACA,SACA,gBACA,UACA,SACA,WACEA,qBAAAA,aAAa;EAAE;EAAO;EAAM;EAAa;EAAO,GAAG;CAAM,CAAC;CAC9D,MAAM,iBAAiBC,qBAAAA,kBACrB,QAAQ,aAAa,GACrB,WAAW,IAAI,UAAU,KAAA,GACzB,IAAI,OACN;CAEA,MAAM,YAAYC,MAAAA,QAAM,cAAc;EACpC,IAAI,CAAC,YAAY,CAAC,IAAI,SACpB,OAAO;EAET,IAAI,OAAO,UAAU,YACnB,OAAO,MAAM;GAAE,SAAS;GAAc,SAAS;GAAU,IAAI,IAAI;EAAQ,CAAC;EAE5E,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACC,cAAAA,OAAD;GACE,SAAS;GACT,SAAS;GACT,IAAI,IAAI;GACR,KAAK,WAAW,kBAAkB,UAAU,oBAAoB,KAAA;GAE/D,UAAA;EACI,CAAA;CAEX,GAAG;EAAC;EAAU;EAAS;EAAO;EAAe;EAAc;EAAU,IAAI;CAAO,CAAC;CAEjF,MAAM,WAAW,WACf,iBAAA,GAAA,kBAAA,IAAA,CAACC,aAAAA,MAAD;EACE,IAAG;EACH,IAAI,IAAI;EACR,MAAM;EACN,SAAQ;EACR,KAAK,kBAAkB,QAAQ,yBAAyB;EAEvD,UAAA;CACG,CAAA;CAGR,MAAM,WACJ,iBAAA,GAAA,kBAAA,KAAA,CAAAC,kBAAAA,UAAA,EAAA,UAAA,CACG,kBACC,iBAAA,GAAA,kBAAA,IAAA,CAACD,aAAAA,MAAD;EAAM,IAAG;EAAI,IAAI,IAAI;EAAe,MAAM;EAAa,SAAQ;EAAS,KAAK;EAC1E,UAAA;CACG,CAAA,GAEP,YACC,iBAAA,GAAA,kBAAA,IAAA,CAACA,aAAAA,MAAD;EAAM,IAAG;EAAI,IAAI,IAAI;EAAS,MAAM;EAAa,SAAQ;EAAU,KAAK;EACrE,UAAA;CACG,CAAA,CAER,EAAA,CAAA;CAGJ,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACE,qBAAAA,aAAa,UAAd;EAAuB,OAAO;EAC5B,UAAA,iBAAA,GAAA,kBAAA,KAAA,CAACC,YAAAA,KAAD;GACE,KAAK,kBAAkB,UAAU;IAAE,GAAG;IAAe,GAAG;GAAI,IAAI;GACvD;GACD;GACR,GAAI;GAJN,UAAA,CAMG,kBAAkB,UACjB,iBAAA,GAAA,kBAAA,KAAA,CAAAF,kBAAAA,UAAA,EAAA,UAAA,CACE,iBAAA,GAAA,kBAAA,KAAA,CAACE,YAAAA,KAAD;IAAK,KAAK;IAAV,UAAA,CACG,WACA,QACE;GACL,CAAA,GAAA,iBAAA,GAAA,kBAAA,KAAA,CAACA,YAAAA,KAAD;IAAK,KAAK;IAAV,UAAA,CACG,UACA,QACE;GACL,CAAA,CAAA,EAAA,CAAA,IACA,kBAAkB,QACpB,iBAAA,GAAA,kBAAA,KAAA,CAAAF,kBAAAA,UAAA,EAAA,UAAA;IACE,iBAAA,GAAA,kBAAA,KAAA,CAACE,YAAAA,KAAD;KACE,KAAK;MACH,SAAS;MACT,YAAY;MACZ,KAAK;MACL,yBAAuB,EAAE,GAAG,EAAE;KAChC;KANF,UAAA,CAQG,UACA,SACE;;IACJ;IACA;GACD,EAAA,CAAA,IAEF,iBAAA,GAAA,kBAAA,KAAA,CAAAF,kBAAAA,UAAA,EAAA,UAAA;IACG;IACA;IACA;IACA;GACD,EAAA,CAAA,GAEH,iBAAiB,iBAAA,GAAA,kBAAA,IAAA,CAACG,uBAAAA,gBAAD;IAAgB,aAAU;IAAU,UAAA;GAA+B,CAAA,CAClF;;CACgB,CAAA;AAE3B"}
@@ -1,64 +1,114 @@
1
1
  import { Box } from "../Box/Box.js";
2
- import { Text } from "../Text/Text.js";
3
2
  import { Label } from "../Label/Label.js";
4
- import { FieldContext, useAnnouncedError, useFieldRoot } from "./FieldContext.js";
3
+ import { Text } from "../Text/Text.js";
5
4
  import { VisuallyHidden } from "../VisuallyHidden/VisuallyHidden.js";
5
+ import { FieldContext, useAnnouncedError, useFieldRoot } from "./FieldContext.js";
6
6
  import React from "react";
7
7
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
8
8
  // components/Field/Field.tsx
9
9
  var MESSAGE_CSS = {
10
10
  display: "block",
11
11
  m: 0,
12
- mt: "$1"
12
+ mt: "$1",
13
+ lineHeight: 1.4
14
+ };
15
+ var COMPACT_LABEL_CSS = { lineHeight: 1.4 };
16
+ var HINT_ABOVE_CONTROL_CSS = {
17
+ ...MESSAGE_CSS,
18
+ mb: "$2"
19
+ };
20
+ var START_ROW_CSS = {
21
+ display: "flex",
22
+ flexWrap: "wrap",
23
+ alignItems: "baseline",
24
+ columnGap: "$5",
25
+ rowGap: "$2"
26
+ };
27
+ var START_LABEL_CSS = {
28
+ flex: "1 1 0",
29
+ minWidth: "10rem"
30
+ };
31
+ var START_CONTROL_CSS = {
32
+ flex: "2 1 0",
33
+ minWidth: "16rem"
13
34
  };
14
35
  /**
15
- * Gives a label, a description and an error to the one form control inside it.
16
- * Its label connects to one control, so do not put two controls in one Field.
36
+ * Gives a label, a hint, a description and an error to the one form control inside it.
37
+ * For more than one control, use `group`.
17
38
  */
18
- var Field = ({ label, description, error, announceError, labelPosition = "top", children, css, ...props }) => {
19
- const { context, labelFor, labelVariant, hasLabel, hasDescription, hasError, onFocus, onBlur } = useFieldRoot({
39
+ var Field = ({ label, hint, description, error, announceError, labelPosition = "top", children, css, ...props }) => {
40
+ const { context, ids, groupProps, messageSize, labelFor, labelVariant, hasLabel, hasHint, hasDescription, hasError, onFocus, onBlur } = useFieldRoot({
20
41
  label,
42
+ hint,
21
43
  description,
22
44
  error,
23
45
  ...props
24
46
  });
25
- const announcedError = useAnnouncedError(Boolean(announceError), hasError ? context.errorId : void 0, context.labelId);
47
+ const announcedError = useAnnouncedError(Boolean(announceError), hasError ? ids.errorId : void 0, ids.labelId);
26
48
  const labelNode = React.useMemo(() => {
27
- if (!hasLabel || !context.labelId) return null;
49
+ if (!hasLabel || !ids.labelId) return null;
28
50
  if (typeof label === "function") return label({
29
51
  variant: labelVariant,
30
52
  htmlFor: labelFor,
31
- id: context.labelId
53
+ id: ids.labelId
32
54
  });
33
55
  return /* @__PURE__ */ jsx(Label, {
34
56
  variant: labelVariant,
35
57
  htmlFor: labelFor,
36
- id: context.labelId,
58
+ id: ids.labelId,
59
+ css: hasHint || labelPosition === "start" ? COMPACT_LABEL_CSS : void 0,
37
60
  children: label
38
61
  });
39
62
  }, [
40
63
  hasLabel,
64
+ hasHint,
41
65
  label,
66
+ labelPosition,
42
67
  labelVariant,
43
68
  labelFor,
44
- context.labelId
69
+ ids.labelId
45
70
  ]);
46
- const errorNode = hasError && /* @__PURE__ */ jsx(Text, {
71
+ const hintNode = hasHint && /* @__PURE__ */ jsx(Text, {
72
+ as: "p",
73
+ id: ids.hintId,
74
+ size: messageSize,
75
+ variant: "subtle",
76
+ css: labelPosition === "top" ? HINT_ABOVE_CONTROL_CSS : MESSAGE_CSS,
77
+ children: hint
78
+ });
79
+ const messages = /* @__PURE__ */ jsxs(Fragment, { children: [hasDescription && /* @__PURE__ */ jsx(Text, {
47
80
  as: "p",
48
- id: context.errorId,
49
- size: "0",
81
+ id: ids.descriptionId,
82
+ size: messageSize,
83
+ variant: "subtle",
84
+ css: MESSAGE_CSS,
85
+ children: description
86
+ }), hasError && /* @__PURE__ */ jsx(Text, {
87
+ as: "p",
88
+ id: ids.errorId,
89
+ size: messageSize,
50
90
  variant: "invalid",
51
91
  css: MESSAGE_CSS,
52
92
  children: error
53
- });
93
+ })] });
54
94
  return /* @__PURE__ */ jsx(FieldContext.Provider, {
55
95
  value: context,
56
96
  children: /* @__PURE__ */ jsxs(Box, {
57
- css,
97
+ css: labelPosition === "start" ? {
98
+ ...START_ROW_CSS,
99
+ ...css
100
+ } : css,
58
101
  onFocus,
59
102
  onBlur,
60
- children: [
61
- labelPosition === "end" ? /* @__PURE__ */ jsxs(Box, {
103
+ ...groupProps,
104
+ children: [labelPosition === "start" ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs(Box, {
105
+ css: START_LABEL_CSS,
106
+ children: [labelNode, hintNode]
107
+ }), /* @__PURE__ */ jsxs(Box, {
108
+ css: START_CONTROL_CSS,
109
+ children: [children, messages]
110
+ })] }) : labelPosition === "end" ? /* @__PURE__ */ jsxs(Fragment, { children: [
111
+ /* @__PURE__ */ jsxs(Box, {
62
112
  css: {
63
113
  display: "flex",
64
114
  alignItems: "center",
@@ -66,21 +116,18 @@ var Field = ({ label, description, error, announceError, labelPosition = "top",
66
116
  "& > [role=\"switch\"]": { m: 0 }
67
117
  },
68
118
  children: [children, labelNode]
69
- }) : /* @__PURE__ */ jsxs(Fragment, { children: [labelNode, children] }),
70
- hasDescription && /* @__PURE__ */ jsx(Text, {
71
- as: "p",
72
- id: context.descriptionId,
73
- size: "0",
74
- variant: "subtle",
75
- css: MESSAGE_CSS,
76
- children: description
77
119
  }),
78
- errorNode,
79
- announceError && /* @__PURE__ */ jsx(VisuallyHidden, {
80
- "aria-live": "polite",
81
- children: announcedError
82
- })
83
- ]
120
+ hintNode,
121
+ messages
122
+ ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
123
+ labelNode,
124
+ hintNode,
125
+ children,
126
+ messages
127
+ ] }), announceError && /* @__PURE__ */ jsx(VisuallyHidden, {
128
+ "aria-live": "polite",
129
+ children: announcedError
130
+ })]
84
131
  })
85
132
  });
86
133
  };
@@ -1 +1 @@
1
- {"version":3,"file":"Field.js","names":["_Fragment"],"sources":["../../../components/Field/Field.tsx"],"sourcesContent":["import React from 'react';\n\nimport { CSS } from '../../stitches.config';\nimport { Box } from '../Box';\nimport { Label } from '../Label';\nimport { Text } from '../Text';\nimport { VisuallyHidden } from '../VisuallyHidden';\nimport { FieldBaseProps, FieldContext, useAnnouncedError, useFieldRoot } from './FieldContext';\n\nexport type FieldProps = FieldBaseProps & { css?: CSS };\n\nconst MESSAGE_CSS = { display: 'block', m: 0, mt: '$1' };\n\n/**\n * Gives a label, a description and an error to the one form control inside it.\n * Its label connects to one control, so do not put two controls in one Field.\n */\nexport const Field = ({\n label,\n description,\n error,\n announceError,\n labelPosition = 'top',\n children,\n css,\n ...props\n}: FieldProps) => {\n const { context, labelFor, labelVariant, hasLabel, hasDescription, hasError, onFocus, onBlur } =\n useFieldRoot({ label, description, error, ...props });\n const announcedError = useAnnouncedError(\n Boolean(announceError),\n hasError ? context.errorId : undefined,\n context.labelId,\n );\n\n const labelNode = React.useMemo(() => {\n if (!hasLabel || !context.labelId) {\n return null;\n }\n if (typeof label === 'function') {\n return label({ variant: labelVariant, htmlFor: labelFor, id: context.labelId });\n }\n return (\n <Label variant={labelVariant} htmlFor={labelFor} id={context.labelId}>\n {label}\n </Label>\n );\n }, [hasLabel, label, labelVariant, labelFor, context.labelId]);\n\n const errorNode = hasError && (\n <Text as=\"p\" id={context.errorId} size=\"0\" variant=\"invalid\" css={MESSAGE_CSS}>\n {error}\n </Text>\n );\n\n return (\n <FieldContext.Provider value={context}>\n <Box css={css} onFocus={onFocus} onBlur={onBlur}>\n {labelPosition === 'end' ? (\n <Box\n css={{\n display: 'flex',\n alignItems: 'center',\n gap: '$2',\n '& > [role=\"switch\"]': { m: 0 },\n }}\n >\n {children}\n {labelNode}\n </Box>\n ) : (\n <>\n {labelNode}\n {children}\n </>\n )}\n {hasDescription && (\n <Text as=\"p\" id={context.descriptionId} size=\"0\" variant=\"subtle\" css={MESSAGE_CSS}>\n {description}\n </Text>\n )}\n {errorNode}\n {announceError && <VisuallyHidden aria-live=\"polite\">{announcedError}</VisuallyHidden>}\n </Box>\n </FieldContext.Provider>\n );\n};\n"],"mappings":";;;;;;;;AAWA,IAAM,cAAc;CAAE,SAAS;CAAS,GAAG;CAAG,IAAI;AAAK;;;;;AAMvD,IAAa,SAAS,EACpB,OACA,aACA,OACA,eACA,gBAAgB,OAChB,UACA,KACA,GAAG,YACa;CAChB,MAAM,EAAE,SAAS,UAAU,cAAc,UAAU,gBAAgB,UAAU,SAAS,WACpF,aAAa;EAAE;EAAO;EAAa;EAAO,GAAG;CAAM,CAAC;CACtD,MAAM,iBAAiB,kBACrB,QAAQ,aAAa,GACrB,WAAW,QAAQ,UAAU,KAAA,GAC7B,QAAQ,OACV;CAEA,MAAM,YAAY,MAAM,cAAc;EACpC,IAAI,CAAC,YAAY,CAAC,QAAQ,SACxB,OAAO;EAET,IAAI,OAAO,UAAU,YACnB,OAAO,MAAM;GAAE,SAAS;GAAc,SAAS;GAAU,IAAI,QAAQ;EAAQ,CAAC;EAEhF,OACE,oBAAC,OAAD;GAAO,SAAS;GAAc,SAAS;GAAU,IAAI,QAAQ;GAC1D,UAAA;EACI,CAAA;CAEX,GAAG;EAAC;EAAU;EAAO;EAAc;EAAU,QAAQ;CAAO,CAAC;CAE7D,MAAM,YAAY,YAChB,oBAAC,MAAD;EAAM,IAAG;EAAI,IAAI,QAAQ;EAAS,MAAK;EAAI,SAAQ;EAAU,KAAK;EAC/D,UAAA;CACG,CAAA;CAGR,OACE,oBAAC,aAAa,UAAd;EAAuB,OAAO;EAC5B,UAAA,qBAAC,KAAD;GAAU;GAAc;GAAiB;GAAzC,UAAA;IACG,kBAAkB,QACjB,qBAAC,KAAD;KACE,KAAK;MACH,SAAS;MACT,YAAY;MACZ,KAAK;MACL,yBAAuB,EAAE,GAAG,EAAE;KAChC;KANF,UAAA,CAQG,UACA,SACE;IAEL,CAAA,IAAA,qBAAAA,UAAA,EAAA,UAAA,CACG,WACA,QACD,EAAA,CAAA;IAEH,kBACC,oBAAC,MAAD;KAAM,IAAG;KAAI,IAAI,QAAQ;KAAe,MAAK;KAAI,SAAQ;KAAS,KAAK;KACpE,UAAA;IACG,CAAA;IAEP;IACA,iBAAiB,oBAAC,gBAAD;KAAgB,aAAU;KAAU,UAAA;IAA+B,CAAA;GAClF;;CACgB,CAAA;AAE3B"}
1
+ {"version":3,"file":"Field.js","names":["_Fragment"],"sources":["../../../components/Field/Field.tsx"],"sourcesContent":["import React from 'react';\n\nimport { CSS } from '../../stitches.config';\nimport { Box } from '../Box';\nimport { Label } from '../Label';\nimport { Text } from '../Text';\nimport { VisuallyHidden } from '../VisuallyHidden';\nimport { FieldBaseProps, FieldContext, useAnnouncedError, useFieldRoot } from './FieldContext';\n\nexport type FieldProps = FieldBaseProps & { css?: CSS };\n\nconst MESSAGE_CSS = { display: 'block', m: 0, mt: '$1', lineHeight: 1.4 };\n// The tall line of a label makes room for a control right under it. Before a hint or beside a control, it is a gap.\nconst COMPACT_LABEL_CSS = { lineHeight: 1.4 };\nconst HINT_ABOVE_CONTROL_CSS = { ...MESSAGE_CSS, mb: '$2' };\n\nconst START_ROW_CSS = {\n display: 'flex',\n flexWrap: 'wrap',\n alignItems: 'baseline',\n columnGap: '$5',\n rowGap: '$2',\n};\nconst START_LABEL_CSS = { flex: '1 1 0', minWidth: '10rem' };\nconst START_CONTROL_CSS = { flex: '2 1 0', minWidth: '16rem' };\n\n/**\n * Gives a label, a hint, a description and an error to the one form control inside it.\n * For more than one control, use `group`.\n */\nexport const Field = ({\n label,\n hint,\n description,\n error,\n announceError,\n labelPosition = 'top',\n children,\n css,\n ...props\n}: FieldProps) => {\n const {\n context,\n ids,\n groupProps,\n messageSize,\n labelFor,\n labelVariant,\n hasLabel,\n hasHint,\n hasDescription,\n hasError,\n onFocus,\n onBlur,\n } = useFieldRoot({ label, hint, description, error, ...props });\n const announcedError = useAnnouncedError(\n Boolean(announceError),\n hasError ? ids.errorId : undefined,\n ids.labelId,\n );\n\n const labelNode = React.useMemo(() => {\n if (!hasLabel || !ids.labelId) {\n return null;\n }\n if (typeof label === 'function') {\n return label({ variant: labelVariant, htmlFor: labelFor, id: ids.labelId });\n }\n return (\n <Label\n variant={labelVariant}\n htmlFor={labelFor}\n id={ids.labelId}\n css={hasHint || labelPosition === 'start' ? COMPACT_LABEL_CSS : undefined}\n >\n {label}\n </Label>\n );\n }, [hasLabel, hasHint, label, labelPosition, labelVariant, labelFor, ids.labelId]);\n\n const hintNode = hasHint && (\n <Text\n as=\"p\"\n id={ids.hintId}\n size={messageSize}\n variant=\"subtle\"\n css={labelPosition === 'top' ? HINT_ABOVE_CONTROL_CSS : MESSAGE_CSS}\n >\n {hint}\n </Text>\n );\n\n const messages = (\n <>\n {hasDescription && (\n <Text as=\"p\" id={ids.descriptionId} size={messageSize} variant=\"subtle\" css={MESSAGE_CSS}>\n {description}\n </Text>\n )}\n {hasError && (\n <Text as=\"p\" id={ids.errorId} size={messageSize} variant=\"invalid\" css={MESSAGE_CSS}>\n {error}\n </Text>\n )}\n </>\n );\n\n return (\n <FieldContext.Provider value={context}>\n <Box\n css={labelPosition === 'start' ? { ...START_ROW_CSS, ...css } : css}\n onFocus={onFocus}\n onBlur={onBlur}\n {...groupProps}\n >\n {labelPosition === 'start' ? (\n <>\n <Box css={START_LABEL_CSS}>\n {labelNode}\n {hintNode}\n </Box>\n <Box css={START_CONTROL_CSS}>\n {children}\n {messages}\n </Box>\n </>\n ) : labelPosition === 'end' ? (\n <>\n <Box\n css={{\n display: 'flex',\n alignItems: 'center',\n gap: '$2',\n '& > [role=\"switch\"]': { m: 0 },\n }}\n >\n {children}\n {labelNode}\n </Box>\n {hintNode}\n {messages}\n </>\n ) : (\n <>\n {labelNode}\n {hintNode}\n {children}\n {messages}\n </>\n )}\n {announceError && <VisuallyHidden aria-live=\"polite\">{announcedError}</VisuallyHidden>}\n </Box>\n </FieldContext.Provider>\n );\n};\n"],"mappings":";;;;;;;;AAWA,IAAM,cAAc;CAAE,SAAS;CAAS,GAAG;CAAG,IAAI;CAAM,YAAY;AAAI;AAExE,IAAM,oBAAoB,EAAE,YAAY,IAAI;AAC5C,IAAM,yBAAyB;CAAE,GAAG;CAAa,IAAI;AAAK;AAE1D,IAAM,gBAAgB;CACpB,SAAS;CACT,UAAU;CACV,YAAY;CACZ,WAAW;CACX,QAAQ;AACV;AACA,IAAM,kBAAkB;CAAE,MAAM;CAAS,UAAU;AAAQ;AAC3D,IAAM,oBAAoB;CAAE,MAAM;CAAS,UAAU;AAAQ;;;;;AAM7D,IAAa,SAAS,EACpB,OACA,MACA,aACA,OACA,eACA,gBAAgB,OAChB,UACA,KACA,GAAG,YACa;CAChB,MAAM,EACJ,SACA,KACA,YACA,aACA,UACA,cACA,UACA,SACA,gBACA,UACA,SACA,WACE,aAAa;EAAE;EAAO;EAAM;EAAa;EAAO,GAAG;CAAM,CAAC;CAC9D,MAAM,iBAAiB,kBACrB,QAAQ,aAAa,GACrB,WAAW,IAAI,UAAU,KAAA,GACzB,IAAI,OACN;CAEA,MAAM,YAAY,MAAM,cAAc;EACpC,IAAI,CAAC,YAAY,CAAC,IAAI,SACpB,OAAO;EAET,IAAI,OAAO,UAAU,YACnB,OAAO,MAAM;GAAE,SAAS;GAAc,SAAS;GAAU,IAAI,IAAI;EAAQ,CAAC;EAE5E,OACE,oBAAC,OAAD;GACE,SAAS;GACT,SAAS;GACT,IAAI,IAAI;GACR,KAAK,WAAW,kBAAkB,UAAU,oBAAoB,KAAA;GAE/D,UAAA;EACI,CAAA;CAEX,GAAG;EAAC;EAAU;EAAS;EAAO;EAAe;EAAc;EAAU,IAAI;CAAO,CAAC;CAEjF,MAAM,WAAW,WACf,oBAAC,MAAD;EACE,IAAG;EACH,IAAI,IAAI;EACR,MAAM;EACN,SAAQ;EACR,KAAK,kBAAkB,QAAQ,yBAAyB;EAEvD,UAAA;CACG,CAAA;CAGR,MAAM,WACJ,qBAAAA,UAAA,EAAA,UAAA,CACG,kBACC,oBAAC,MAAD;EAAM,IAAG;EAAI,IAAI,IAAI;EAAe,MAAM;EAAa,SAAQ;EAAS,KAAK;EAC1E,UAAA;CACG,CAAA,GAEP,YACC,oBAAC,MAAD;EAAM,IAAG;EAAI,IAAI,IAAI;EAAS,MAAM;EAAa,SAAQ;EAAU,KAAK;EACrE,UAAA;CACG,CAAA,CAER,EAAA,CAAA;CAGJ,OACE,oBAAC,aAAa,UAAd;EAAuB,OAAO;EAC5B,UAAA,qBAAC,KAAD;GACE,KAAK,kBAAkB,UAAU;IAAE,GAAG;IAAe,GAAG;GAAI,IAAI;GACvD;GACD;GACR,GAAI;GAJN,UAAA,CAMG,kBAAkB,UACjB,qBAAAA,UAAA,EAAA,UAAA,CACE,qBAAC,KAAD;IAAK,KAAK;IAAV,UAAA,CACG,WACA,QACE;GACL,CAAA,GAAA,qBAAC,KAAD;IAAK,KAAK;IAAV,UAAA,CACG,UACA,QACE;GACL,CAAA,CAAA,EAAA,CAAA,IACA,kBAAkB,QACpB,qBAAAA,UAAA,EAAA,UAAA;IACE,qBAAC,KAAD;KACE,KAAK;MACH,SAAS;MACT,YAAY;MACZ,KAAK;MACL,yBAAuB,EAAE,GAAG,EAAE;KAChC;KANF,UAAA,CAQG,UACA,SACE;;IACJ;IACA;GACD,EAAA,CAAA,IAEF,qBAAAA,UAAA,EAAA,UAAA;IACG;IACA;IACA;IACA;GACD,EAAA,CAAA,GAEH,iBAAiB,oBAAC,gBAAD;IAAgB,aAAU;IAAU,UAAA;GAA+B,CAAA,CAClF;;CACgB,CAAA;AAE3B"}