@betterinternship/components 3.5.0 → 3.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -35,7 +35,7 @@ const CheckboxGroup = ({ options, values, setter, className, hint = null, column
35
35
  ? 'border-primary bg-primary-selected'
36
36
  : 'border-border hover:border-input hover:bg-muted'), children: [jsx(FormFieldReset, { children: jsx(Checkbox, { checked: isChecked, tabIndex: -1, "aria-hidden": "true",
37
37
  // A 16px box centred on the title's first line (2px padding + 20px line).
38
- className: "pointer-events-none mt-1" }) }), jsxs("div", { className: "min-w-0 flex-1 space-y-1 pt-0.5", children: [jsx("span", { className: "block text-field-label leading-5 font-field-label text-foreground", children: option.label }), option.description && (jsx("p", { className: "text-sm text-muted-foreground", children: option.description }))] })] }, option.value));
38
+ className: "pointer-events-none mt-1" }) }), jsxs("div", { className: "min-w-0 flex-1 space-y-1 pt-0.5", children: [jsx("span", { className: "block text-field-label font-medium text-foreground", children: option.label }), option.description && (jsx("p", { className: "text-sm text-muted-foreground", children: option.description }))] })] }, option.value));
39
39
  }) })] }));
40
40
  };
41
41
 
@@ -1 +1 @@
1
- {"version":3,"file":"checkbox-group.js","sources":["../../src/components/checkbox-group.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\n\nimport { cn } from '@/utils';\nimport { Checkbox } from '@/components/checkbox';\nimport { FormFieldReset, useFormFieldControl } from './form-field';\n\nexport interface CheckboxGroupProps {\n options: { value: string | number; label: string; description?: string }[];\n values: (string | number)[];\n setter: (values: (string | number)[]) => void;\n className?: string;\n /** Multi-select hint shown above the options. */\n hint?: React.ReactNode;\n /** Columns on md+ screens. Defaults to 3. */\n columns?: 1 | 2 | 3;\n /** Fired when a single option is toggled, before the setter runs. */\n onToggle?: (value: string | number, checked: boolean) => void;\n id?: string;\n /** Names the group when it has no visible label. Inside a FormField the field label names it. */\n 'aria-label'?: string;\n /** Id of the element naming the group. A surrounding FormField with `group` sets it. */\n 'aria-labelledby'?: string;\n /** Ids of help or error text. A surrounding FormField sets it from `description` and `error`. */\n 'aria-describedby'?: string;\n /** Marks the group invalid. A surrounding FormField sets it when it shows an error. */\n 'aria-invalid'?: React.AriaAttributes['aria-invalid'];\n /** Marks the group required. A surrounding FormField sets it from `required`. */\n 'aria-required'?: React.AriaAttributes['aria-required'];\n}\n\nconst GRID_COLS: Record<1 | 2 | 3, string> = {\n 1: '',\n 2: 'md:grid-cols-2',\n 3: 'md:grid-cols-3',\n};\n\n/**\n * Multi-select option cards. Unlabelled: put it in a `FormField` with `group`\n * for a label that names the whole group.\n */\nexport const CheckboxGroup = ({\n options,\n values,\n setter,\n className,\n hint = null,\n columns = 3,\n onToggle,\n ...ownAria\n}: CheckboxGroupProps) => {\n const aria = useFormFieldControl(ownAria, 'group');\n const handleValueChange = (optionValue: string | number) => {\n const willBeChecked = !values.includes(optionValue);\n onToggle?.(optionValue, willBeChecked);\n setter(\n willBeChecked\n ? [...values, optionValue]\n : values.filter((v) => v !== optionValue),\n );\n };\n\n return (\n <div role=\"group\" {...aria} className={className}>\n {hint && <p className=\"text-xs text-muted-foreground\">{hint}</p>}\n\n <div className={cn('grid grid-cols-1 gap-4', GRID_COLS[columns])}>\n {options.map((option) => {\n const isChecked = values.includes(option.value);\n\n return (\n // The card is the control: focusable, toggled by click, Space or Enter.\n <div\n key={option.value}\n role=\"checkbox\"\n aria-checked={isChecked}\n tabIndex={0}\n onClick={() => handleValueChange(option.value)}\n onKeyDown={(event) => {\n if (event.key !== ' ' && event.key !== 'Enter') return;\n event.preventDefault();\n handleValueChange(option.value);\n }}\n className={cn(\n 'group flex h-fit cursor-pointer items-start gap-3 rounded-control-lg border p-3 transition-colors duration-state ease-out-strong focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring motion-reduce:transition-none',\n isChecked\n ? 'border-primary bg-primary-selected'\n : 'border-border hover:border-input hover:bg-muted',\n )}\n >\n <FormFieldReset>\n <Checkbox\n checked={isChecked}\n tabIndex={-1}\n aria-hidden=\"true\"\n // A 16px box centred on the title's first line (2px padding + 20px line).\n className=\"pointer-events-none mt-1\"\n />\n </FormFieldReset>\n <div className=\"min-w-0 flex-1 space-y-1 pt-0.5\">\n {/* Same size as a field label, but the main text colour: it's the option, not a caption. */}\n <span className=\"block text-field-label leading-5 font-field-label text-foreground\">\n {option.label}\n </span>\n {option.description && (\n <p className=\"text-sm text-muted-foreground\">{option.description}</p>\n )}\n </div>\n </div>\n );\n })}\n </div>\n </div>\n );\n};\n"],"names":[],"mappings":";;;;;;AAgCA;AACE;AACA;AACA;;AAGF;;;AAGG;AACI;;AAWL;;AAEE;AACA;AAEI;AACA;AAEN;AAEA;;;;;;;;AAmBc;AACF;AAII;AACA;;AASA;AAcV;AAIR;;"}
1
+ {"version":3,"file":"checkbox-group.js","sources":["../../src/components/checkbox-group.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\n\nimport { cn } from '@/utils';\nimport { Checkbox } from '@/components/checkbox';\nimport { FormFieldReset, useFormFieldControl } from './form-field';\n\nexport interface CheckboxGroupProps {\n options: { value: string | number; label: string; description?: string }[];\n values: (string | number)[];\n setter: (values: (string | number)[]) => void;\n className?: string;\n /** Multi-select hint shown above the options. */\n hint?: React.ReactNode;\n /** Columns on md+ screens. Defaults to 3. */\n columns?: 1 | 2 | 3;\n /** Fired when a single option is toggled, before the setter runs. */\n onToggle?: (value: string | number, checked: boolean) => void;\n id?: string;\n /** Names the group when it has no visible label. Inside a FormField the field label names it. */\n 'aria-label'?: string;\n /** Id of the element naming the group. A surrounding FormField with `group` sets it. */\n 'aria-labelledby'?: string;\n /** Ids of help or error text. A surrounding FormField sets it from `description` and `error`. */\n 'aria-describedby'?: string;\n /** Marks the group invalid. A surrounding FormField sets it when it shows an error. */\n 'aria-invalid'?: React.AriaAttributes['aria-invalid'];\n /** Marks the group required. A surrounding FormField sets it from `required`. */\n 'aria-required'?: React.AriaAttributes['aria-required'];\n}\n\nconst GRID_COLS: Record<1 | 2 | 3, string> = {\n 1: '',\n 2: 'md:grid-cols-2',\n 3: 'md:grid-cols-3',\n};\n\n/**\n * Multi-select option cards. Unlabelled: put it in a `FormField` with `group`\n * for a label that names the whole group.\n */\nexport const CheckboxGroup = ({\n options,\n values,\n setter,\n className,\n hint = null,\n columns = 3,\n onToggle,\n ...ownAria\n}: CheckboxGroupProps) => {\n const aria = useFormFieldControl(ownAria, 'group');\n const handleValueChange = (optionValue: string | number) => {\n const willBeChecked = !values.includes(optionValue);\n onToggle?.(optionValue, willBeChecked);\n setter(\n willBeChecked\n ? [...values, optionValue]\n : values.filter((v) => v !== optionValue),\n );\n };\n\n return (\n <div role=\"group\" {...aria} className={className}>\n {hint && <p className=\"text-xs text-muted-foreground\">{hint}</p>}\n\n <div className={cn('grid grid-cols-1 gap-4', GRID_COLS[columns])}>\n {options.map((option) => {\n const isChecked = values.includes(option.value);\n\n return (\n // The card is the control: focusable, toggled by click, Space or Enter.\n <div\n key={option.value}\n role=\"checkbox\"\n aria-checked={isChecked}\n tabIndex={0}\n onClick={() => handleValueChange(option.value)}\n onKeyDown={(event) => {\n if (event.key !== ' ' && event.key !== 'Enter') return;\n event.preventDefault();\n handleValueChange(option.value);\n }}\n className={cn(\n 'group flex h-fit cursor-pointer items-start gap-3 rounded-control-lg border p-3 transition-colors duration-state ease-out-strong focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring motion-reduce:transition-none',\n isChecked\n ? 'border-primary bg-primary-selected'\n : 'border-border hover:border-input hover:bg-muted',\n )}\n >\n <FormFieldReset>\n <Checkbox\n checked={isChecked}\n tabIndex={-1}\n aria-hidden=\"true\"\n // A 16px box centred on the title's first line (2px padding + 20px line).\n className=\"pointer-events-none mt-1\"\n />\n </FormFieldReset>\n <div className=\"min-w-0 flex-1 space-y-1 pt-0.5\">\n {/* Same size as a field label, but the main text colour: it's the option, not a caption. */}\n <span className=\"block text-field-label font-medium text-foreground\">\n {option.label}\n </span>\n {option.description && (\n <p className=\"text-sm text-muted-foreground\">{option.description}</p>\n )}\n </div>\n </div>\n );\n })}\n </div>\n </div>\n );\n};\n"],"names":[],"mappings":";;;;;;AAgCA;AACE;AACA;AACA;;AAGF;;;AAGG;AACI;;AAWL;;AAEE;AACA;AAEI;AACA;AAEN;AAEA;;;;;;;;AAmBc;AACF;AAII;AACA;;AASA;AAcV;AAIR;;"}
@@ -5,7 +5,7 @@ import { cn } from '../utils.js';
5
5
  import { Tooltip, TooltipTrigger, TooltipContent } from './tooltip.js';
6
6
 
7
7
  /** Shared label typography with native label association and ref support. */
8
- const FieldLabel = React.forwardRef(({ className, ...props }, ref) => (jsx("label", { ref: ref, className: cn('text-field-label font-field-label text-[color:var(--color-field-label)]', className), ...props })));
8
+ const FieldLabel = React.forwardRef(({ className, ...props }, ref) => (jsx("label", { ref: ref, className: cn('text-field-label font-field-label text-label-foreground', className), ...props })));
9
9
  FieldLabel.displayName = 'FieldLabel';
10
10
  /** The label row shared by every form field: label, help tooltip, addon. */
11
11
  function Label({ label, required, tooltip, labelAddon, labelProps, className, }) {
@@ -1 +1 @@
1
- {"version":3,"file":"label.js","sources":["../../src/components/label.tsx"],"sourcesContent":["import * as React from 'react';\r\nimport { MessageCircleQuestion } from 'lucide-react';\r\n\r\nimport { cn } from '@/utils';\r\nimport {\r\n Tooltip,\r\n TooltipContent,\r\n TooltipTrigger,\r\n} from '@/components/tooltip';\r\n\r\nexport interface LabelProps {\r\n label: React.ReactNode;\r\n required?: boolean;\r\n tooltip?: string;\r\n /** Kept so existing callers still type-check; the Radix tooltip needs no id. */\r\n tooltipId?: string;\r\n labelAddon?: React.ReactNode;\r\n labelProps?: React.ComponentPropsWithRef<'label'>;\r\n className?: string;\r\n}\r\n\r\n/** Shared label typography with native label association and ref support. */\r\nexport const FieldLabel = React.forwardRef<HTMLLabelElement, React.ComponentPropsWithoutRef<'label'>>(\r\n ({ className, ...props }, ref) => (\r\n <label\r\n ref={ref}\r\n className={cn('text-field-label font-field-label text-[color:var(--color-field-label)]', className)}\r\n {...props}\r\n />\r\n ),\r\n);\r\nFieldLabel.displayName = 'FieldLabel';\r\n\r\n/** The label row shared by every form field: label, help tooltip, addon. */\r\nexport function Label({\r\n label,\r\n required,\r\n tooltip,\r\n labelAddon,\r\n labelProps,\r\n className,\r\n}: LabelProps) {\r\n const hasTooltip = !!tooltip?.trim();\r\n\r\n return (\r\n <div className={cn('mb-field-label-gap flex w-full justify-between gap-2 md:items-center', className)}>\r\n <div className=\"flex gap-2 md:items-center\">\r\n <FieldLabel {...labelProps}>\r\n {label} {required && <span className=\"text-destructive\">*</span>}\r\n </FieldLabel>\r\n {hasTooltip ? (\r\n <Tooltip>\r\n <TooltipTrigger asChild>\r\n <button\r\n type=\"button\"\r\n aria-label=\"More information\"\r\n className=\"hover:cursor-help\"\r\n >\r\n <MessageCircleQuestion className=\"text-primary h-3.5 w-3.5\" />\r\n </button>\r\n </TooltipTrigger>\r\n <TooltipContent side=\"bottom\" className=\"z-(--z-tooltip) max-w-[80vw]\">\r\n {tooltip}\r\n </TooltipContent>\r\n </Tooltip>\r\n ) : (\r\n // Reserves the icon's space so labels line up with or without help.\r\n <div aria-hidden=\"true\">\r\n <MessageCircleQuestion className={cn('invisible h-3.5 w-3.5')} />\r\n </div>\r\n )}\r\n </div>\r\n {labelAddon && <div>{labelAddon}</div>}\r\n </div>\r\n );\r\n}\r\n"],"names":["_jsx","_jsxs"],"mappings":";;;;;;AAqBA;AACO,MAAM,UAAU,GAAG,KAAK,CAAC,UAAU,CACxC,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,MAC3BA,eACE,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CAAC,yEAAyE,EAAE,SAAS,CAAC,EAAA,GAC/F,KAAK,EAAA,CACT,CACH;AAEH,UAAU,CAAC,WAAW,GAAG,YAAY;AAErC;AACM,SAAU,KAAK,CAAC,EACpB,KAAK,EACL,QAAQ,EACR,OAAO,EACP,UAAU,EACV,UAAU,EACV,SAAS,GACE,EAAA;IACX,MAAM,UAAU,GAAG,CAAC,CAAC,OAAO,EAAE,IAAI,EAAE;AAEpC,IAAA,QACEC,IAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAE,EAAE,CAAC,sEAAsE,EAAE,SAAS,CAAC,aACnGA,IAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAC,4BAA4B,EAAA,QAAA,EAAA,CACzCA,KAAC,UAAU,EAAA,EAAA,GAAK,UAAU,EAAA,QAAA,EAAA,CACvB,KAAK,EAAA,GAAA,EAAG,QAAQ,IAAID,GAAA,CAAA,MAAA,EAAA,EAAM,SAAS,EAAC,kBAAkB,EAAA,QAAA,EAAA,GAAA,EAAA,CAAS,CAAA,EAAA,CACrD,EACZ,UAAU,IACTC,IAAA,CAAC,OAAO,EAAA,EAAA,QAAA,EAAA,CACND,GAAA,CAAC,cAAc,EAAA,EAAC,OAAO,EAAA,IAAA,EAAA,QAAA,EACrBA,GAAA,CAAA,QAAA,EAAA,EACE,IAAI,EAAC,QAAQ,gBACF,kBAAkB,EAC7B,SAAS,EAAC,mBAAmB,EAAA,QAAA,EAE7BA,GAAA,CAAC,qBAAqB,EAAA,EAAC,SAAS,EAAC,0BAA0B,EAAA,CAAG,EAAA,CACvD,EAAA,CACM,EACjBA,GAAA,CAAC,cAAc,IAAC,IAAI,EAAC,QAAQ,EAAC,SAAS,EAAC,8BAA8B,YACnE,OAAO,EAAA,CACO,IACT;;oBAGVA,GAAA,CAAA,KAAA,EAAA,EAAA,aAAA,EAAiB,MAAM,YACrBA,GAAA,CAAC,qBAAqB,IAAC,SAAS,EAAE,EAAE,CAAC,uBAAuB,CAAC,GAAI,EAAA,CAC7D,CACP,CAAA,EAAA,CACG,EACL,UAAU,IAAIA,uBAAM,UAAU,EAAA,CAAO,CAAA,EAAA,CAClC;AAEV;;;;"}
1
+ {"version":3,"file":"label.js","sources":["../../src/components/label.tsx"],"sourcesContent":["import * as React from 'react';\r\nimport { MessageCircleQuestion } from 'lucide-react';\r\n\r\nimport { cn } from '@/utils';\r\nimport {\r\n Tooltip,\r\n TooltipContent,\r\n TooltipTrigger,\r\n} from '@/components/tooltip';\r\n\r\nexport interface LabelProps {\r\n label: React.ReactNode;\r\n required?: boolean;\r\n tooltip?: string;\r\n /** Kept so existing callers still type-check; the Radix tooltip needs no id. */\r\n tooltipId?: string;\r\n labelAddon?: React.ReactNode;\r\n labelProps?: React.ComponentPropsWithRef<'label'>;\r\n className?: string;\r\n}\r\n\r\n/** Shared label typography with native label association and ref support. */\r\nexport const FieldLabel = React.forwardRef<HTMLLabelElement, React.ComponentPropsWithoutRef<'label'>>(\r\n ({ className, ...props }, ref) => (\r\n <label\r\n ref={ref}\r\n className={cn('text-field-label font-field-label text-label-foreground', className)}\r\n {...props}\r\n />\r\n ),\r\n);\r\nFieldLabel.displayName = 'FieldLabel';\r\n\r\n/** The label row shared by every form field: label, help tooltip, addon. */\r\nexport function Label({\r\n label,\r\n required,\r\n tooltip,\r\n labelAddon,\r\n labelProps,\r\n className,\r\n}: LabelProps) {\r\n const hasTooltip = !!tooltip?.trim();\r\n\r\n return (\r\n <div className={cn('mb-field-label-gap flex w-full justify-between gap-2 md:items-center', className)}>\r\n <div className=\"flex gap-2 md:items-center\">\r\n <FieldLabel {...labelProps}>\r\n {label} {required && <span className=\"text-destructive\">*</span>}\r\n </FieldLabel>\r\n {hasTooltip ? (\r\n <Tooltip>\r\n <TooltipTrigger asChild>\r\n <button\r\n type=\"button\"\r\n aria-label=\"More information\"\r\n className=\"hover:cursor-help\"\r\n >\r\n <MessageCircleQuestion className=\"text-primary h-3.5 w-3.5\" />\r\n </button>\r\n </TooltipTrigger>\r\n <TooltipContent side=\"bottom\" className=\"z-(--z-tooltip) max-w-[80vw]\">\r\n {tooltip}\r\n </TooltipContent>\r\n </Tooltip>\r\n ) : (\r\n // Reserves the icon's space so labels line up with or without help.\r\n <div aria-hidden=\"true\">\r\n <MessageCircleQuestion className={cn('invisible h-3.5 w-3.5')} />\r\n </div>\r\n )}\r\n </div>\r\n {labelAddon && <div>{labelAddon}</div>}\r\n </div>\r\n );\r\n}\r\n"],"names":["_jsx","_jsxs"],"mappings":";;;;;;AAqBA;AACO,MAAM,UAAU,GAAG,KAAK,CAAC,UAAU,CACxC,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,MAC3BA,eACE,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CAAC,yDAAyD,EAAE,SAAS,CAAC,EAAA,GAC/E,KAAK,EAAA,CACT,CACH;AAEH,UAAU,CAAC,WAAW,GAAG,YAAY;AAErC;AACM,SAAU,KAAK,CAAC,EACpB,KAAK,EACL,QAAQ,EACR,OAAO,EACP,UAAU,EACV,UAAU,EACV,SAAS,GACE,EAAA;IACX,MAAM,UAAU,GAAG,CAAC,CAAC,OAAO,EAAE,IAAI,EAAE;AAEpC,IAAA,QACEC,IAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAE,EAAE,CAAC,sEAAsE,EAAE,SAAS,CAAC,aACnGA,IAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAC,4BAA4B,EAAA,QAAA,EAAA,CACzCA,KAAC,UAAU,EAAA,EAAA,GAAK,UAAU,EAAA,QAAA,EAAA,CACvB,KAAK,EAAA,GAAA,EAAG,QAAQ,IAAID,GAAA,CAAA,MAAA,EAAA,EAAM,SAAS,EAAC,kBAAkB,EAAA,QAAA,EAAA,GAAA,EAAA,CAAS,CAAA,EAAA,CACrD,EACZ,UAAU,IACTC,IAAA,CAAC,OAAO,EAAA,EAAA,QAAA,EAAA,CACND,GAAA,CAAC,cAAc,EAAA,EAAC,OAAO,EAAA,IAAA,EAAA,QAAA,EACrBA,GAAA,CAAA,QAAA,EAAA,EACE,IAAI,EAAC,QAAQ,gBACF,kBAAkB,EAC7B,SAAS,EAAC,mBAAmB,EAAA,QAAA,EAE7BA,GAAA,CAAC,qBAAqB,EAAA,EAAC,SAAS,EAAC,0BAA0B,EAAA,CAAG,EAAA,CACvD,EAAA,CACM,EACjBA,GAAA,CAAC,cAAc,IAAC,IAAI,EAAC,QAAQ,EAAC,SAAS,EAAC,8BAA8B,YACnE,OAAO,EAAA,CACO,IACT;;oBAGVA,GAAA,CAAA,KAAA,EAAA,EAAA,aAAA,EAAiB,MAAM,YACrBA,GAAA,CAAC,qBAAqB,IAAC,SAAS,EAAE,EAAE,CAAC,uBAAuB,CAAC,GAAI,EAAA,CAC7D,CACP,CAAA,EAAA,CACG,EACL,UAAU,IAAIA,uBAAM,UAAU,EAAA,CAAO,CAAA,EAAA,CAClC;AAEV;;;;"}
@@ -41,7 +41,7 @@ export declare const designTokens: {
41
41
  readonly border: "--color-border";
42
42
  readonly borderControl: "--color-border-control";
43
43
  readonly borderHover: "--color-border-hover";
44
- readonly fieldLabel: "--color-field-label";
44
+ readonly labelForeground: "--color-label-foreground";
45
45
  };
46
46
  readonly radii: {
47
47
  readonly controlSmall: "--radius-control-sm";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@betterinternship/components",
3
- "version": "3.5.0",
3
+ "version": "3.5.2",
4
4
  "workspaces": [
5
5
  "playground"
6
6
  ],
@@ -13,9 +13,10 @@
13
13
  "theme.legacy.css"
14
14
  ],
15
15
  "scripts": {
16
- "build": "npm run typecheck && node -e \"require('node:fs').rmSync('dist', { recursive: true, force: true })\" && npm run check:client && rollup -c rollup.config.mjs && tsc-alias",
16
+ "build": "npm run typecheck && npm run check:theme && node -e \"require('node:fs').rmSync('dist', { recursive: true, force: true })\" && npm run check:client && rollup -c rollup.config.mjs && tsc-alias",
17
17
  "typecheck": "tsc --noEmit -p tsconfig.json",
18
18
  "check:client": "node scripts/check-client-directives.mjs",
19
+ "check:theme": "node scripts/check-theme-tokens.mjs",
19
20
  "prepack": "npm run build",
20
21
  "dev:playground": "npm --prefix playground run dev"
21
22
  },
package/theme.css CHANGED
@@ -139,8 +139,10 @@
139
139
  --spacing-field-padding-x: 0.75rem;
140
140
  --text-field-label: var(--text-sm);
141
141
  --text-field-label--line-height: var(--text-sm--line-height);
142
- --font-weight-field-label: 500;
143
- --color-field-label: var(--muted-foreground);
142
+ --font-weight-field-label: 400;
143
+ /* Named -foreground, not field-label: a --color-field-label would make
144
+ `text-field-label` a colour class and hide the label size. */
145
+ --color-label-foreground: var(--muted-foreground);
144
146
 
145
147
  /* Shared radius scale. Keep component rounding on this scale. */
146
148
  --radius-control-sm: 0.375rem;