@traefik-labs/faency 13.4.0 → 13.5.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 (65) hide show
  1. package/dist/components/AriaTable/AriaTable.cjs +15 -5
  2. package/dist/components/AriaTable/AriaTable.cjs.map +1 -1
  3. package/dist/components/AriaTable/AriaTable.js +16 -6
  4. package/dist/components/AriaTable/AriaTable.js.map +1 -1
  5. package/dist/components/CodeBlock/CodeBlock.cjs +2 -2
  6. package/dist/components/CodeBlock/CodeBlock.js +2 -2
  7. package/dist/components/CodeBlock/CodeBlock.vanilla.cjs +3 -3
  8. package/dist/components/CodeBlock/CodeBlock.vanilla.js +3 -3
  9. package/dist/components/DateTimePicker/DateTimePicker.cjs +1 -1
  10. package/dist/components/DateTimePicker/DateTimePicker.js +1 -1
  11. package/dist/components/Dialog/Dialog.cjs +1 -1
  12. package/dist/components/Dialog/Dialog.js +1 -1
  13. package/dist/components/Field/Field.cjs +80 -33
  14. package/dist/components/Field/Field.cjs.map +1 -1
  15. package/dist/components/Field/Field.js +80 -33
  16. package/dist/components/Field/Field.js.map +1 -1
  17. package/dist/components/Field/Field.vanilla.cjs +62 -32
  18. package/dist/components/Field/Field.vanilla.cjs.map +1 -1
  19. package/dist/components/Field/Field.vanilla.css.cjs +6 -0
  20. package/dist/components/Field/Field.vanilla.css.cjs.map +1 -1
  21. package/dist/components/Field/Field.vanilla.css.js +4 -1
  22. package/dist/components/Field/Field.vanilla.css.js.map +1 -1
  23. package/dist/components/Field/Field.vanilla.js +63 -33
  24. package/dist/components/Field/Field.vanilla.js.map +1 -1
  25. package/dist/components/Field/FieldContext.cjs +48 -10
  26. package/dist/components/Field/FieldContext.cjs.map +1 -1
  27. package/dist/components/Field/FieldContext.js +48 -10
  28. package/dist/components/Field/FieldContext.js.map +1 -1
  29. package/dist/components/List/List.cjs +1 -1
  30. package/dist/components/List/List.js +1 -1
  31. package/dist/components/Meter/Meter.vanilla.cjs +1 -1
  32. package/dist/components/Meter/Meter.vanilla.js +1 -1
  33. package/dist/components/NavigationTree/NavigationTreeItem.cjs +2 -2
  34. package/dist/components/NavigationTree/NavigationTreeItem.js +2 -2
  35. package/dist/components/RowLink/RowLink.cjs +35 -12
  36. package/dist/components/RowLink/RowLink.cjs.map +1 -1
  37. package/dist/components/RowLink/RowLink.js +34 -12
  38. package/dist/components/RowLink/RowLink.js.map +1 -1
  39. package/dist/components/Select/Select.cjs +1 -1
  40. package/dist/components/Select/Select.js +1 -1
  41. package/dist/components/Spinner/Spinner.vanilla.cjs +1 -1
  42. package/dist/components/Spinner/Spinner.vanilla.js +1 -1
  43. package/dist/components/Table/Table.cjs +13 -4
  44. package/dist/components/Table/Table.cjs.map +1 -1
  45. package/dist/components/Table/Table.js +13 -4
  46. package/dist/components/Table/Table.js.map +1 -1
  47. package/dist/components/TextField/TextField.cjs +1 -1
  48. package/dist/components/TextField/TextField.js +1 -1
  49. package/dist/components/TextField/TextField.vanilla.cjs +1 -1
  50. package/dist/components/TextField/TextField.vanilla.js +1 -1
  51. package/dist/components/Textarea/Textarea.cjs +2 -2
  52. package/dist/components/Textarea/Textarea.js +2 -2
  53. package/dist/components/Textarea/Textarea.vanilla.cjs +2 -2
  54. package/dist/components/Textarea/Textarea.vanilla.js +2 -2
  55. package/dist/components/Toast/ToastProvider.vanilla.cjs +1 -1
  56. package/dist/components/Toast/ToastProvider.vanilla.js +1 -1
  57. package/dist/faency.css +1612 -1597
  58. package/dist/index.cjs +29 -29
  59. package/dist/index.d.ts +26 -7
  60. package/dist/index.js +29 -29
  61. package/dist/utils/warnOnce.cjs +13 -0
  62. package/dist/utils/warnOnce.cjs.map +1 -0
  63. package/dist/utils/warnOnce.js +13 -0
  64. package/dist/utils/warnOnce.js.map +1 -0
  65. package/package.json +10 -17
@@ -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,aAC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,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;CAC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,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"}
@@ -2,11 +2,11 @@ const require_runtime = require("../../_virtual/_rolldown/runtime.cjs");
2
2
  const require_cssProps = require("../../styles/cssProps.cjs");
3
3
  const require_themeContext = require("../../styles/themeContext.cjs");
4
4
  const require_Box_vanilla = require("../Box/Box.vanilla.cjs");
5
- const require_Text_vanilla = require("../Text/Text.vanilla.cjs");
6
5
  const require_Label_vanilla = require("../Label/Label.vanilla.cjs");
7
- const require_FieldContext = require("./FieldContext.cjs");
6
+ const require_Text_vanilla = require("../Text/Text.vanilla.cjs");
8
7
  const require_VisuallyHidden = require("../VisuallyHidden/VisuallyHidden.cjs");
9
8
  const require_Field_vanilla_css = require("./Field.vanilla.css.cjs");
9
+ const require_FieldContext = require("./FieldContext.cjs");
10
10
  let react = require("react");
11
11
  react = require_runtime.__toESM(react, 1);
12
12
  let _vanilla_extract_dynamic = require("@vanilla-extract/dynamic");
@@ -15,78 +15,108 @@ let react_jsx_runtime = require("react/jsx-runtime");
15
15
  var MESSAGE_CSS = {
16
16
  display: "block",
17
17
  m: 0,
18
- mt: "$1"
18
+ mt: "$1",
19
+ lineHeight: 1.4
20
+ };
21
+ var COMPACT_LABEL_CSS = { lineHeight: 1.4 };
22
+ var HINT_ABOVE_CONTROL_CSS = {
23
+ ...MESSAGE_CSS,
24
+ mb: "$2"
19
25
  };
20
26
  /**
21
- * Gives a label, a description and an error to the one form control inside it.
22
- * Its label connects to one control, so do not put two controls in one Field.
27
+ * Gives a label, a hint, a description and an error to the one form control inside it.
28
+ * For more than one control, use `group`.
23
29
  */
24
- var FieldVanilla = ({ label, description, error, announceError, labelPosition = "top", children, css, ...props }) => {
25
- const { context, labelFor, labelVariant, hasLabel, hasDescription, hasError, onFocus, onBlur } = require_FieldContext.useFieldRoot({
30
+ var FieldVanilla = ({ label, hint, description, error, announceError, labelPosition = "top", children, css, ...props }) => {
31
+ const { context, ids, groupProps, messageSize, labelFor, labelVariant, hasLabel, hasHint, hasDescription, hasError, onFocus, onBlur } = require_FieldContext.useFieldRoot({
26
32
  label,
33
+ hint,
27
34
  description,
28
35
  error,
29
36
  ...props
30
37
  });
31
- const announcedError = require_FieldContext.useAnnouncedError(Boolean(announceError), hasError ? context.errorId : void 0, context.labelId);
38
+ const announcedError = require_FieldContext.useAnnouncedError(Boolean(announceError), hasError ? ids.errorId : void 0, ids.labelId);
32
39
  const { colors } = require_themeContext.useVanillaExtractTheme();
33
40
  const { style: rootStyle, vars: rootVars } = require_cssProps.processCSSProp(css, colors);
34
41
  const labelNode = react.default.useMemo(() => {
35
- if (!hasLabel || !context.labelId) return null;
42
+ if (!hasLabel || !ids.labelId) return null;
36
43
  if (typeof label === "function") return label({
37
44
  variant: labelVariant,
38
45
  htmlFor: labelFor,
39
- id: context.labelId
46
+ id: ids.labelId
40
47
  });
41
48
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Label_vanilla.LabelVanilla, {
42
49
  variant: labelVariant,
43
50
  htmlFor: labelFor,
44
- id: context.labelId,
51
+ id: ids.labelId,
52
+ css: hasHint || labelPosition === "start" ? COMPACT_LABEL_CSS : void 0,
45
53
  children: label
46
54
  });
47
55
  }, [
48
56
  hasLabel,
57
+ hasHint,
49
58
  label,
59
+ labelPosition,
50
60
  labelVariant,
51
61
  labelFor,
52
- context.labelId
62
+ ids.labelId
53
63
  ]);
54
- const errorNode = hasError && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Text_vanilla.TextVanilla, {
64
+ const hintNode = hasHint && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Text_vanilla.TextVanilla, {
55
65
  as: "p",
56
- id: context.errorId,
57
- size: "0",
66
+ id: ids.hintId,
67
+ size: messageSize,
68
+ variant: "subtle",
69
+ css: labelPosition === "top" ? HINT_ABOVE_CONTROL_CSS : MESSAGE_CSS,
70
+ children: hint
71
+ });
72
+ const messages = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [hasDescription && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Text_vanilla.TextVanilla, {
73
+ as: "p",
74
+ id: ids.descriptionId,
75
+ size: messageSize,
76
+ variant: "subtle",
77
+ css: MESSAGE_CSS,
78
+ children: description
79
+ }), hasError && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Text_vanilla.TextVanilla, {
80
+ as: "p",
81
+ id: ids.errorId,
82
+ size: messageSize,
58
83
  variant: "invalid",
59
84
  css: MESSAGE_CSS,
60
85
  children: error
61
- });
86
+ })] });
62
87
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_FieldContext.FieldContext.Provider, {
63
88
  value: context,
64
89
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
90
+ className: labelPosition === "start" ? require_Field_vanilla_css.startRow : void 0,
65
91
  style: {
66
92
  ...rootStyle,
67
93
  ...(0, _vanilla_extract_dynamic.assignInlineVars)(rootVars)
68
94
  },
69
95
  onFocus,
70
96
  onBlur,
71
- children: [
72
- labelPosition === "end" ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_Box_vanilla.BoxVanilla, {
97
+ ...groupProps,
98
+ children: [labelPosition === "start" ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_Box_vanilla.BoxVanilla, {
99
+ className: require_Field_vanilla_css.startLabel,
100
+ children: [labelNode, hintNode]
101
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_Box_vanilla.BoxVanilla, {
102
+ className: require_Field_vanilla_css.startControl,
103
+ children: [children, messages]
104
+ })] }) : labelPosition === "end" ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
105
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_Box_vanilla.BoxVanilla, {
73
106
  className: require_Field_vanilla_css.endLabelRow,
74
107
  children: [children, labelNode]
75
- }) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [labelNode, children] }),
76
- hasDescription && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Text_vanilla.TextVanilla, {
77
- as: "p",
78
- id: context.descriptionId,
79
- size: "0",
80
- variant: "subtle",
81
- css: MESSAGE_CSS,
82
- children: description
83
108
  }),
84
- errorNode,
85
- announceError && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_VisuallyHidden.VisuallyHidden, {
86
- "aria-live": "polite",
87
- children: announcedError
88
- })
89
- ]
109
+ hintNode,
110
+ messages
111
+ ] }) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
112
+ labelNode,
113
+ hintNode,
114
+ children,
115
+ messages
116
+ ] }), announceError && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_VisuallyHidden.VisuallyHidden, {
117
+ "aria-live": "polite",
118
+ children: announcedError
119
+ })]
90
120
  })
91
121
  });
92
122
  };
@@ -1 +1 @@
1
- {"version":3,"file":"Field.vanilla.cjs","names":["useFieldRoot","useAnnouncedError","useVanillaExtractTheme","processCSSProp","React","LabelVanilla","TextVanilla","FieldContext","assignInlineVars","BoxVanilla","endLabelRow","_Fragment","VisuallyHidden"],"sources":["../../../components/Field/Field.vanilla.tsx"],"sourcesContent":["import { assignInlineVars } from '@vanilla-extract/dynamic';\nimport React from 'react';\n\nimport { CSSProps, processCSSProp } from '../../styles/cssProps';\nimport { useVanillaExtractTheme } from '../../styles/themeContext';\nimport { BoxVanilla } from '../Box';\nimport { LabelVanilla } from '../Label';\nimport { TextVanilla } from '../Text';\nimport { VisuallyHidden } from '../VisuallyHidden';\nimport { endLabelRow } from './Field.vanilla.css';\nimport { FieldBaseProps, FieldContext, useAnnouncedError, useFieldRoot } from './FieldContext';\n\nexport type FieldVanillaProps = FieldBaseProps & { css?: CSSProps['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 FieldVanilla = ({\n label,\n description,\n error,\n announceError,\n labelPosition = 'top',\n children,\n css,\n ...props\n}: FieldVanillaProps) => {\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 const { colors } = useVanillaExtractTheme();\n const { style: rootStyle, vars: rootVars } = processCSSProp(css, colors);\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 <LabelVanilla variant={labelVariant} htmlFor={labelFor} id={context.labelId}>\n {label}\n </LabelVanilla>\n );\n }, [hasLabel, label, labelVariant, labelFor, context.labelId]);\n\n const errorNode = hasError && (\n <TextVanilla as=\"p\" id={context.errorId} size=\"0\" variant=\"invalid\" css={MESSAGE_CSS}>\n {error}\n </TextVanilla>\n );\n\n return (\n <FieldContext.Provider value={context}>\n <div\n style={{ ...rootStyle, ...assignInlineVars(rootVars) }}\n onFocus={onFocus}\n onBlur={onBlur}\n >\n {labelPosition === 'end' ? (\n <BoxVanilla className={endLabelRow}>\n {children}\n {labelNode}\n </BoxVanilla>\n ) : (\n <>\n {labelNode}\n {children}\n </>\n )}\n {hasDescription && (\n <TextVanilla\n as=\"p\"\n id={context.descriptionId}\n size=\"0\"\n variant=\"subtle\"\n css={MESSAGE_CSS}\n >\n {description}\n </TextVanilla>\n )}\n {errorNode}\n {announceError && <VisuallyHidden aria-live=\"polite\">{announcedError}</VisuallyHidden>}\n </div>\n </FieldContext.Provider>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;AAcA,IAAM,cAAc;CAAE,SAAS;CAAS,GAAG;CAAG,IAAI;AAAK;;;;;AAMvD,IAAa,gBAAgB,EAC3B,OACA,aACA,OACA,eACA,gBAAgB,OAChB,UACA,KACA,GAAG,YACoB;CACvB,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;CACA,MAAM,EAAE,WAAWC,qBAAAA,uBAAuB;CAC1C,MAAM,EAAE,OAAO,WAAW,MAAM,aAAaC,iBAAAA,eAAe,KAAK,MAAM;CAEvE,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,sBAAAA,cAAD;GAAc,SAAS;GAAc,SAAS;GAAU,IAAI,QAAQ;GACjE,UAAA;EACW,CAAA;CAElB,GAAG;EAAC;EAAU;EAAO;EAAc;EAAU,QAAQ;CAAO,CAAC;CAE7D,MAAM,YAAY,YAChB,iBAAA,GAAA,kBAAA,IAAA,CAACC,qBAAAA,aAAD;EAAa,IAAG;EAAI,IAAI,QAAQ;EAAS,MAAK;EAAI,SAAQ;EAAU,KAAK;EACtE,UAAA;CACU,CAAA;CAGf,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACC,qBAAAA,aAAa,UAAd;EAAuB,OAAO;EAC5B,UAAA,iBAAA,GAAA,kBAAA,KAAA,CAAC,OAAD;GACE,OAAO;IAAE,GAAG;IAAW,IAAA,GAAGC,yBAAAA,iBAAAA,CAAiB,QAAQ;GAAE;GAC5C;GACD;GAHV,UAAA;IAKG,kBAAkB,QACjB,iBAAA,GAAA,kBAAA,KAAA,CAACC,oBAAAA,YAAD;KAAY,WAAWC,0BAAAA;KAAvB,UAAA,CACG,UACA,SACS;IAEZ,CAAA,IAAA,iBAAA,GAAA,kBAAA,KAAA,CAAAC,kBAAAA,UAAA,EAAA,UAAA,CACG,WACA,QACD,EAAA,CAAA;IAEH,kBACC,iBAAA,GAAA,kBAAA,IAAA,CAACL,qBAAAA,aAAD;KACE,IAAG;KACH,IAAI,QAAQ;KACZ,MAAK;KACL,SAAQ;KACR,KAAK;KAEJ,UAAA;IACU,CAAA;IAEd;IACA,iBAAiB,iBAAA,GAAA,kBAAA,IAAA,CAACM,uBAAAA,gBAAD;KAAgB,aAAU;KAAU,UAAA;IAA+B,CAAA;GAClF;;CACgB,CAAA;AAE3B"}
1
+ {"version":3,"file":"Field.vanilla.cjs","names":["useFieldRoot","useAnnouncedError","useVanillaExtractTheme","processCSSProp","React","LabelVanilla","TextVanilla","_Fragment","FieldContext","startRow","assignInlineVars","BoxVanilla","startLabel","startControl","endLabelRow","VisuallyHidden"],"sources":["../../../components/Field/Field.vanilla.tsx"],"sourcesContent":["import { assignInlineVars } from '@vanilla-extract/dynamic';\nimport React from 'react';\n\nimport { CSSProps, processCSSProp } from '../../styles/cssProps';\nimport { useVanillaExtractTheme } from '../../styles/themeContext';\nimport { BoxVanilla } from '../Box';\nimport { LabelVanilla } from '../Label';\nimport { TextVanilla } from '../Text';\nimport { VisuallyHidden } from '../VisuallyHidden';\nimport { endLabelRow, startControl, startLabel, startRow } from './Field.vanilla.css';\nimport { FieldBaseProps, FieldContext, useAnnouncedError, useFieldRoot } from './FieldContext';\n\nexport type FieldVanillaProps = FieldBaseProps & { css?: CSSProps['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\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 FieldVanilla = ({\n label,\n hint,\n description,\n error,\n announceError,\n labelPosition = 'top',\n children,\n css,\n ...props\n}: FieldVanillaProps) => {\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 const { colors } = useVanillaExtractTheme();\n const { style: rootStyle, vars: rootVars } = processCSSProp(css, colors);\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 <LabelVanilla\n variant={labelVariant}\n htmlFor={labelFor}\n id={ids.labelId}\n css={hasHint || labelPosition === 'start' ? COMPACT_LABEL_CSS : undefined}\n >\n {label}\n </LabelVanilla>\n );\n }, [hasLabel, hasHint, label, labelPosition, labelVariant, labelFor, ids.labelId]);\n\n const hintNode = hasHint && (\n <TextVanilla\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 </TextVanilla>\n );\n\n const messages = (\n <>\n {hasDescription && (\n <TextVanilla\n as=\"p\"\n id={ids.descriptionId}\n size={messageSize}\n variant=\"subtle\"\n css={MESSAGE_CSS}\n >\n {description}\n </TextVanilla>\n )}\n {hasError && (\n <TextVanilla as=\"p\" id={ids.errorId} size={messageSize} variant=\"invalid\" css={MESSAGE_CSS}>\n {error}\n </TextVanilla>\n )}\n </>\n );\n\n return (\n <FieldContext.Provider value={context}>\n <div\n className={labelPosition === 'start' ? startRow : undefined}\n style={{ ...rootStyle, ...assignInlineVars(rootVars) }}\n onFocus={onFocus}\n onBlur={onBlur}\n {...groupProps}\n >\n {labelPosition === 'start' ? (\n <>\n <BoxVanilla className={startLabel}>\n {labelNode}\n {hintNode}\n </BoxVanilla>\n <BoxVanilla className={startControl}>\n {children}\n {messages}\n </BoxVanilla>\n </>\n ) : labelPosition === 'end' ? (\n <>\n <BoxVanilla className={endLabelRow}>\n {children}\n {labelNode}\n </BoxVanilla>\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 </div>\n </FieldContext.Provider>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;AAcA,IAAM,cAAc;CAAE,SAAS;CAAS,GAAG;CAAG,IAAI;CAAM,YAAY;AAAI;AAExE,IAAM,oBAAoB,EAAE,YAAY,IAAI;AAC5C,IA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gBAAD;IAAgB,aAAU;IAAU,UAAA;GAA+B,CAAA,CAClF;;CACgB,CAAA;AAE3B"}
@@ -1,6 +1,12 @@
1
1
  ;/* empty css */
2
2
  // components/Field/Field.vanilla.css.ts
3
3
  var endLabelRow = "qq7v300";
4
+ var startRow = "qq7v301";
5
+ var startLabel = "qq7v302";
6
+ var startControl = "qq7v303";
4
7
  exports.endLabelRow = endLabelRow;
8
+ exports.startControl = startControl;
9
+ exports.startLabel = startLabel;
10
+ exports.startRow = startRow;
5
11
 
6
12
  //# sourceMappingURL=Field.vanilla.css.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Field.vanilla.css.cjs","names":[],"sources":["../../../components/Field/Field.vanilla.css.ts"],"sourcesContent":["import { globalStyle, style } from '@vanilla-extract/css';\n\nimport { tokens } from '../../styles/tokens.css';\n\nexport const endLabelRow = style({\n display: 'flex',\n alignItems: 'center',\n gap: tokens.space['2'],\n});\n\nglobalStyle(`${endLabelRow} > [role=\"switch\"]`, {\n margin: 0,\n});\n"],"mappings":""}
1
+ {"version":3,"file":"Field.vanilla.css.cjs","names":[],"sources":["../../../components/Field/Field.vanilla.css.ts"],"sourcesContent":["import { globalStyle, style } from '@vanilla-extract/css';\n\nimport { tokens } from '../../styles/tokens.css';\n\nexport const endLabelRow = style({\n display: 'flex',\n alignItems: 'center',\n gap: tokens.space['2'],\n});\n\nglobalStyle(`${endLabelRow} > [role=\"switch\"]`, {\n margin: 0,\n});\n\nexport const startRow = style({\n display: 'flex',\n flexWrap: 'wrap',\n alignItems: 'baseline',\n columnGap: tokens.space['5'],\n rowGap: tokens.space['2'],\n});\n\nexport const startLabel = style({\n flex: '1 1 0',\n minWidth: '10rem',\n});\n\nexport const startControl = style({\n flex: '2 1 0',\n minWidth: '16rem',\n});\n"],"mappings":""}
@@ -1,6 +1,9 @@
1
1
  /* empty css */
2
2
  // components/Field/Field.vanilla.css.ts
3
3
  var endLabelRow = "qq7v300";
4
- export { endLabelRow };
4
+ var startRow = "qq7v301";
5
+ var startLabel = "qq7v302";
6
+ var startControl = "qq7v303";
7
+ export { endLabelRow, startControl, startLabel, startRow };
5
8
 
6
9
  //# sourceMappingURL=Field.vanilla.css.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Field.vanilla.css.js","names":[],"sources":["../../../components/Field/Field.vanilla.css.ts"],"sourcesContent":["import { globalStyle, style } from '@vanilla-extract/css';\n\nimport { tokens } from '../../styles/tokens.css';\n\nexport const endLabelRow = style({\n display: 'flex',\n alignItems: 'center',\n gap: tokens.space['2'],\n});\n\nglobalStyle(`${endLabelRow} > [role=\"switch\"]`, {\n margin: 0,\n});\n"],"mappings":""}
1
+ {"version":3,"file":"Field.vanilla.css.js","names":[],"sources":["../../../components/Field/Field.vanilla.css.ts"],"sourcesContent":["import { globalStyle, style } from '@vanilla-extract/css';\n\nimport { tokens } from '../../styles/tokens.css';\n\nexport const endLabelRow = style({\n display: 'flex',\n alignItems: 'center',\n gap: tokens.space['2'],\n});\n\nglobalStyle(`${endLabelRow} > [role=\"switch\"]`, {\n margin: 0,\n});\n\nexport const startRow = style({\n display: 'flex',\n flexWrap: 'wrap',\n alignItems: 'baseline',\n columnGap: tokens.space['5'],\n rowGap: tokens.space['2'],\n});\n\nexport const startLabel = style({\n flex: '1 1 0',\n minWidth: '10rem',\n});\n\nexport const startControl = style({\n flex: '2 1 0',\n minWidth: '16rem',\n});\n"],"mappings":""}
@@ -1,11 +1,11 @@
1
1
  import { processCSSProp } from "../../styles/cssProps.js";
2
2
  import { useVanillaExtractTheme } from "../../styles/themeContext.js";
3
3
  import { BoxVanilla } from "../Box/Box.vanilla.js";
4
- import { TextVanilla } from "../Text/Text.vanilla.js";
5
4
  import { LabelVanilla } from "../Label/Label.vanilla.js";
6
- import { FieldContext, useAnnouncedError, useFieldRoot } from "./FieldContext.js";
5
+ import { TextVanilla } from "../Text/Text.vanilla.js";
7
6
  import { VisuallyHidden } from "../VisuallyHidden/VisuallyHidden.js";
8
- import { endLabelRow } from "./Field.vanilla.css.js";
7
+ import { endLabelRow, startControl, startLabel, startRow } from "./Field.vanilla.css.js";
8
+ import { FieldContext, useAnnouncedError, useFieldRoot } from "./FieldContext.js";
9
9
  import React from "react";
10
10
  import { assignInlineVars } from "@vanilla-extract/dynamic";
11
11
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
@@ -13,78 +13,108 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
13
13
  var MESSAGE_CSS = {
14
14
  display: "block",
15
15
  m: 0,
16
- mt: "$1"
16
+ mt: "$1",
17
+ lineHeight: 1.4
18
+ };
19
+ var COMPACT_LABEL_CSS = { lineHeight: 1.4 };
20
+ var HINT_ABOVE_CONTROL_CSS = {
21
+ ...MESSAGE_CSS,
22
+ mb: "$2"
17
23
  };
18
24
  /**
19
- * Gives a label, a description and an error to the one form control inside it.
20
- * Its label connects to one control, so do not put two controls in one Field.
25
+ * Gives a label, a hint, a description and an error to the one form control inside it.
26
+ * For more than one control, use `group`.
21
27
  */
22
- var FieldVanilla = ({ label, description, error, announceError, labelPosition = "top", children, css, ...props }) => {
23
- const { context, labelFor, labelVariant, hasLabel, hasDescription, hasError, onFocus, onBlur } = useFieldRoot({
28
+ var FieldVanilla = ({ label, hint, description, error, announceError, labelPosition = "top", children, css, ...props }) => {
29
+ const { context, ids, groupProps, messageSize, labelFor, labelVariant, hasLabel, hasHint, hasDescription, hasError, onFocus, onBlur } = useFieldRoot({
24
30
  label,
31
+ hint,
25
32
  description,
26
33
  error,
27
34
  ...props
28
35
  });
29
- const announcedError = useAnnouncedError(Boolean(announceError), hasError ? context.errorId : void 0, context.labelId);
36
+ const announcedError = useAnnouncedError(Boolean(announceError), hasError ? ids.errorId : void 0, ids.labelId);
30
37
  const { colors } = useVanillaExtractTheme();
31
38
  const { style: rootStyle, vars: rootVars } = processCSSProp(css, colors);
32
39
  const labelNode = React.useMemo(() => {
33
- if (!hasLabel || !context.labelId) return null;
40
+ if (!hasLabel || !ids.labelId) return null;
34
41
  if (typeof label === "function") return label({
35
42
  variant: labelVariant,
36
43
  htmlFor: labelFor,
37
- id: context.labelId
44
+ id: ids.labelId
38
45
  });
39
46
  return /* @__PURE__ */ jsx(LabelVanilla, {
40
47
  variant: labelVariant,
41
48
  htmlFor: labelFor,
42
- id: context.labelId,
49
+ id: ids.labelId,
50
+ css: hasHint || labelPosition === "start" ? COMPACT_LABEL_CSS : void 0,
43
51
  children: label
44
52
  });
45
53
  }, [
46
54
  hasLabel,
55
+ hasHint,
47
56
  label,
57
+ labelPosition,
48
58
  labelVariant,
49
59
  labelFor,
50
- context.labelId
60
+ ids.labelId
51
61
  ]);
52
- const errorNode = hasError && /* @__PURE__ */ jsx(TextVanilla, {
62
+ const hintNode = hasHint && /* @__PURE__ */ jsx(TextVanilla, {
53
63
  as: "p",
54
- id: context.errorId,
55
- size: "0",
64
+ id: ids.hintId,
65
+ size: messageSize,
66
+ variant: "subtle",
67
+ css: labelPosition === "top" ? HINT_ABOVE_CONTROL_CSS : MESSAGE_CSS,
68
+ children: hint
69
+ });
70
+ const messages = /* @__PURE__ */ jsxs(Fragment, { children: [hasDescription && /* @__PURE__ */ jsx(TextVanilla, {
71
+ as: "p",
72
+ id: ids.descriptionId,
73
+ size: messageSize,
74
+ variant: "subtle",
75
+ css: MESSAGE_CSS,
76
+ children: description
77
+ }), hasError && /* @__PURE__ */ jsx(TextVanilla, {
78
+ as: "p",
79
+ id: ids.errorId,
80
+ size: messageSize,
56
81
  variant: "invalid",
57
82
  css: MESSAGE_CSS,
58
83
  children: error
59
- });
84
+ })] });
60
85
  return /* @__PURE__ */ jsx(FieldContext.Provider, {
61
86
  value: context,
62
87
  children: /* @__PURE__ */ jsxs("div", {
88
+ className: labelPosition === "start" ? startRow : void 0,
63
89
  style: {
64
90
  ...rootStyle,
65
91
  ...assignInlineVars(rootVars)
66
92
  },
67
93
  onFocus,
68
94
  onBlur,
69
- children: [
70
- labelPosition === "end" ? /* @__PURE__ */ jsxs(BoxVanilla, {
95
+ ...groupProps,
96
+ children: [labelPosition === "start" ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs(BoxVanilla, {
97
+ className: startLabel,
98
+ children: [labelNode, hintNode]
99
+ }), /* @__PURE__ */ jsxs(BoxVanilla, {
100
+ className: startControl,
101
+ children: [children, messages]
102
+ })] }) : labelPosition === "end" ? /* @__PURE__ */ jsxs(Fragment, { children: [
103
+ /* @__PURE__ */ jsxs(BoxVanilla, {
71
104
  className: endLabelRow,
72
105
  children: [children, labelNode]
73
- }) : /* @__PURE__ */ jsxs(Fragment, { children: [labelNode, children] }),
74
- hasDescription && /* @__PURE__ */ jsx(TextVanilla, {
75
- as: "p",
76
- id: context.descriptionId,
77
- size: "0",
78
- variant: "subtle",
79
- css: MESSAGE_CSS,
80
- children: description
81
106
  }),
82
- errorNode,
83
- announceError && /* @__PURE__ */ jsx(VisuallyHidden, {
84
- "aria-live": "polite",
85
- children: announcedError
86
- })
87
- ]
107
+ hintNode,
108
+ messages
109
+ ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
110
+ labelNode,
111
+ hintNode,
112
+ children,
113
+ messages
114
+ ] }), announceError && /* @__PURE__ */ jsx(VisuallyHidden, {
115
+ "aria-live": "polite",
116
+ children: announcedError
117
+ })]
88
118
  })
89
119
  });
90
120
  };
@@ -1 +1 @@
1
- {"version":3,"file":"Field.vanilla.js","names":["_Fragment"],"sources":["../../../components/Field/Field.vanilla.tsx"],"sourcesContent":["import { assignInlineVars } from '@vanilla-extract/dynamic';\nimport React from 'react';\n\nimport { CSSProps, processCSSProp } from '../../styles/cssProps';\nimport { useVanillaExtractTheme } from '../../styles/themeContext';\nimport { BoxVanilla } from '../Box';\nimport { LabelVanilla } from '../Label';\nimport { TextVanilla } from '../Text';\nimport { VisuallyHidden } from '../VisuallyHidden';\nimport { endLabelRow } from './Field.vanilla.css';\nimport { FieldBaseProps, FieldContext, useAnnouncedError, useFieldRoot } from './FieldContext';\n\nexport type FieldVanillaProps = FieldBaseProps & { css?: CSSProps['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 FieldVanilla = ({\n label,\n description,\n error,\n announceError,\n labelPosition = 'top',\n children,\n css,\n ...props\n}: FieldVanillaProps) => {\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 const { colors } = useVanillaExtractTheme();\n const { style: rootStyle, vars: rootVars } = processCSSProp(css, colors);\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 <LabelVanilla variant={labelVariant} htmlFor={labelFor} id={context.labelId}>\n {label}\n </LabelVanilla>\n );\n }, [hasLabel, label, labelVariant, labelFor, context.labelId]);\n\n const errorNode = hasError && (\n <TextVanilla as=\"p\" id={context.errorId} size=\"0\" variant=\"invalid\" css={MESSAGE_CSS}>\n {error}\n </TextVanilla>\n );\n\n return (\n <FieldContext.Provider value={context}>\n <div\n style={{ ...rootStyle, ...assignInlineVars(rootVars) }}\n onFocus={onFocus}\n onBlur={onBlur}\n >\n {labelPosition === 'end' ? (\n <BoxVanilla className={endLabelRow}>\n {children}\n {labelNode}\n </BoxVanilla>\n ) : (\n <>\n {labelNode}\n {children}\n </>\n )}\n {hasDescription && (\n <TextVanilla\n as=\"p\"\n id={context.descriptionId}\n size=\"0\"\n variant=\"subtle\"\n css={MESSAGE_CSS}\n >\n {description}\n </TextVanilla>\n )}\n {errorNode}\n {announceError && <VisuallyHidden aria-live=\"polite\">{announcedError}</VisuallyHidden>}\n </div>\n </FieldContext.Provider>\n );\n};\n"],"mappings":";;;;;;;;;;;;AAcA,IAAM,cAAc;CAAE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AAQ;KACZ,MAAK;KACL,SAAQ;KACR,KAAK;KAEJ,UAAA;IACU,CAAA;IAEd;IACA,iBAAiB,oBAAC,gBAAD;KAAgB,aAAU;KAAU,UAAA;IAA+B,CAAA;GAClF;;CACgB,CAAA;AAE3B"}
1
+ {"version":3,"file":"Field.vanilla.js","names":["_Fragment"],"sources":["../../../components/Field/Field.vanilla.tsx"],"sourcesContent":["import { assignInlineVars } from '@vanilla-extract/dynamic';\nimport React from 'react';\n\nimport { CSSProps, processCSSProp } from '../../styles/cssProps';\nimport { useVanillaExtractTheme } from '../../styles/themeContext';\nimport { BoxVanilla } from '../Box';\nimport { LabelVanilla } from '../Label';\nimport { TextVanilla } from '../Text';\nimport { VisuallyHidden } from '../VisuallyHidden';\nimport { endLabelRow, startControl, startLabel, startRow } from './Field.vanilla.css';\nimport { FieldBaseProps, FieldContext, useAnnouncedError, useFieldRoot } from './FieldContext';\n\nexport type FieldVanillaProps = FieldBaseProps & { css?: CSSProps['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\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 FieldVanilla = ({\n label,\n hint,\n description,\n error,\n announceError,\n labelPosition = 'top',\n children,\n css,\n ...props\n}: FieldVanillaProps) => {\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 const { colors } = useVanillaExtractTheme();\n const { style: rootStyle, vars: rootVars } = processCSSProp(css, colors);\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 <LabelVanilla\n variant={labelVariant}\n htmlFor={labelFor}\n id={ids.labelId}\n css={hasHint || labelPosition === 'start' ? COMPACT_LABEL_CSS : undefined}\n >\n {label}\n </LabelVanilla>\n );\n }, [hasLabel, hasHint, label, labelPosition, labelVariant, labelFor, ids.labelId]);\n\n const hintNode = hasHint && (\n <TextVanilla\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 </TextVanilla>\n );\n\n const messages = (\n <>\n {hasDescription && (\n <TextVanilla\n as=\"p\"\n id={ids.descriptionId}\n size={messageSize}\n variant=\"subtle\"\n css={MESSAGE_CSS}\n >\n {description}\n </TextVanilla>\n )}\n {hasError && (\n <TextVanilla as=\"p\" id={ids.errorId} size={messageSize} variant=\"invalid\" css={MESSAGE_CSS}>\n {error}\n </TextVanilla>\n )}\n </>\n );\n\n return (\n <FieldContext.Provider value={context}>\n <div\n className={labelPosition === 'start' ? startRow : undefined}\n style={{ ...rootStyle, ...assignInlineVars(rootVars) }}\n onFocus={onFocus}\n onBlur={onBlur}\n {...groupProps}\n >\n {labelPosition === 'start' ? (\n <>\n <BoxVanilla className={startLabel}>\n {labelNode}\n {hintNode}\n </BoxVanilla>\n <BoxVanilla className={startControl}>\n {children}\n {messages}\n </BoxVanilla>\n </>\n ) : labelPosition === 'end' ? (\n <>\n <BoxVanilla className={endLabelRow}>\n {children}\n {labelNode}\n </BoxVanilla>\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 </div>\n </FieldContext.Provider>\n );\n};\n"],"mappings":";;;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