@nswds/ui 8.3.3 → 8.4.1
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.
- package/dist/components/badge.d.ts +1 -1
- package/dist/components/button.d.ts +3 -3
- package/dist/components/callout.d.ts +2 -2
- package/dist/components/checkbox.js +15 -3
- package/dist/components/checkbox.js.map +1 -1
- package/dist/components/field.d.ts +3 -1
- package/dist/components/field.js +4 -1
- package/dist/components/field.js.map +1 -1
- package/dist/components/header.d.ts +1 -1
- package/dist/components/input-group.d.ts +1 -1
- package/dist/components/masthead.d.ts +1 -1
- package/dist/components/radio-group.js +11 -3
- package/dist/components/radio-group.js.map +1 -1
- package/dist/components/skip-link.d.ts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/src/styles/theme.css +5 -1
|
@@ -6,7 +6,7 @@ import { Link } from './link.js';
|
|
|
6
6
|
|
|
7
7
|
declare const badgeVariants: (props?: ({
|
|
8
8
|
variant?: "solid" | "soft" | "surface" | "outline" | null | undefined;
|
|
9
|
-
color?: "
|
|
9
|
+
color?: "primary/grey" | "light" | "primary/white" | "white" | "grey" | "primary" | "secondary" | "tertiary" | "accent" | null | undefined;
|
|
10
10
|
size?: "default" | "sm" | "lg" | null | undefined;
|
|
11
11
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
12
12
|
type BadgeProps = VariantProps<typeof badgeVariants> & React__default.ComponentPropsWithoutRef<'span'> & {
|
|
@@ -5,8 +5,8 @@ import React__default from 'react';
|
|
|
5
5
|
import { Link } from './link.js';
|
|
6
6
|
|
|
7
7
|
declare const buttonCva: (props?: ({
|
|
8
|
-
variant?: "
|
|
9
|
-
color?: "
|
|
8
|
+
variant?: "solid" | "soft" | "surface" | "outline" | "link" | "ghost" | null | undefined;
|
|
9
|
+
color?: "white" | "grey" | "primary" | "secondary" | "tertiary" | "accent" | "success" | "warning" | "danger" | null | undefined;
|
|
10
10
|
size?: "default" | "sm" | "lg" | "icon" | null | undefined;
|
|
11
11
|
iconOnly?: boolean | null | undefined;
|
|
12
12
|
onTint?: boolean | null | undefined;
|
|
@@ -27,7 +27,7 @@ type ButtonVariantProps = NonNullable<Parameters<typeof buttonCva>[0]>;
|
|
|
27
27
|
*/
|
|
28
28
|
declare function buttonVariants({ onTint, ...props }?: ButtonVariantProps): string;
|
|
29
29
|
declare const buttonColorCva: (props?: ({
|
|
30
|
-
color?: "
|
|
30
|
+
color?: "white" | "grey" | "primary" | "secondary" | "tertiary" | "accent" | "success" | "warning" | "danger" | null | undefined;
|
|
31
31
|
onTint?: boolean | null | undefined;
|
|
32
32
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
33
33
|
/**
|
|
@@ -25,7 +25,7 @@ type CalloutStatus = 'info' | 'success' | 'warning' | 'danger';
|
|
|
25
25
|
* drift out of step with the token library.
|
|
26
26
|
*/
|
|
27
27
|
declare const calloutVariants: (props?: ({
|
|
28
|
-
status?: "
|
|
28
|
+
status?: "success" | "warning" | "danger" | "info" | null | undefined;
|
|
29
29
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
30
30
|
type CalloutProps = Omit<React.ComponentPropsWithoutRef<'div'>, 'title'> & VariantProps<typeof calloutVariants> & {
|
|
31
31
|
/** Optional bold lead line above the body copy. */
|
|
@@ -66,7 +66,7 @@ declare function Callout({ className, status, title, icon, children, ref, ...pro
|
|
|
66
66
|
*/
|
|
67
67
|
declare const Alert: typeof Callout;
|
|
68
68
|
declare const alertVariants: (props?: ({
|
|
69
|
-
status?: "
|
|
69
|
+
status?: "success" | "warning" | "danger" | "info" | null | undefined;
|
|
70
70
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
71
71
|
type AlertProps = CalloutProps;
|
|
72
72
|
type AlertStatus = CalloutStatus;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
3
|
import { Checkbox as Checkbox$1 } from '@base-ui/react/checkbox';
|
|
4
4
|
import { IconCheck } from '../icons/check.js';
|
|
5
|
+
import { IconRemove } from '../icons/remove.js';
|
|
5
6
|
import { cn } from '../lib/utils.js';
|
|
6
7
|
|
|
7
8
|
function Checkbox({ className, ...props }) {
|
|
@@ -10,7 +11,18 @@ function Checkbox({ className, ...props }) {
|
|
|
10
11
|
{
|
|
11
12
|
"data-slot": "checkbox",
|
|
12
13
|
className: cn(
|
|
13
|
-
"peer relative flex size-
|
|
14
|
+
"peer relative inline-flex size-8 shrink-0 items-center justify-center rounded-sm border border-(--text-default) bg-(--input-surface) motion-safe:transition-colors",
|
|
15
|
+
// Use the theme's bridge scale so brand overrides reach both modes.
|
|
16
|
+
// The inset stays centred at 22px even with a 2px invalid border.
|
|
17
|
+
"[--checkbox-ink:var(--color-primary-800)] [--checkbox-mark:var(--surface-default)] dark:not-data-disabled:not-aria-invalid:[--checkbox-ink:var(--color-primary-200)]",
|
|
18
|
+
// A 44px hit area without making the visible 32px control larger.
|
|
19
|
+
"after:absolute after:top-1/2 after:left-1/2 after:size-11 after:-translate-1/2",
|
|
20
|
+
"not-data-disabled:hover:bg-[color-mix(in_srgb,var(--checkbox-ink)_10%,var(--input-surface))]",
|
|
21
|
+
"focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-3 focus-visible:outline-(--checkbox-ink)",
|
|
22
|
+
// Use Input's invalid roles, including its focus and hover treatment.
|
|
23
|
+
"aria-invalid:not-data-disabled:border-2 aria-invalid:not-data-disabled:border-(--input-invalid-border) aria-invalid:not-data-disabled:[--checkbox-ink:var(--danger-solid)] aria-invalid:not-data-disabled:[--checkbox-mark:var(--white)] aria-invalid:not-data-disabled:hover:bg-(--input-invalid-surface-hover) aria-invalid:focus-visible:outline-offset-2 aria-invalid:focus-visible:outline-(--input-invalid-ring)",
|
|
24
|
+
// Base UI renders a span: data-disabled covers both the prop and Field.
|
|
25
|
+
"data-disabled:cursor-not-allowed data-disabled:border-(--text-subtle) data-disabled:[--checkbox-ink:var(--text-subtle)]",
|
|
14
26
|
className
|
|
15
27
|
),
|
|
16
28
|
...props,
|
|
@@ -18,8 +30,8 @@ function Checkbox({ className, ...props }) {
|
|
|
18
30
|
Checkbox$1.Indicator,
|
|
19
31
|
{
|
|
20
32
|
"data-slot": "checkbox-indicator",
|
|
21
|
-
className: "
|
|
22
|
-
children: /* @__PURE__ */ jsx(IconCheck, {})
|
|
33
|
+
className: "pointer-events-none absolute top-1/2 left-1/2 size-5.5 -translate-1/2 bg-(--checkbox-ink) text-(--checkbox-mark) [&>svg]:absolute [&>svg]:top-1/2 [&>svg]:left-1/2 [&>svg]:size-6 [&>svg]:-translate-1/2",
|
|
34
|
+
render: (indicatorProps, state) => /* @__PURE__ */ jsx("span", { ...indicatorProps, children: state.indeterminate ? /* @__PURE__ */ jsx(IconRemove, { "aria-hidden": true }) : /* @__PURE__ */ jsx(IconCheck, { "aria-hidden": true }) })
|
|
23
35
|
}
|
|
24
36
|
)
|
|
25
37
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/checkbox.tsx"],"names":["CheckboxPrimitive"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/components/checkbox.tsx"],"names":["CheckboxPrimitive"],"mappings":";;;;;;AAQA,SAAS,QAAA,CAAS,EAAE,SAAA,EAAW,GAAG,OAAM,EAAiC;AACvE,EAAA,uBACE,GAAA;AAAA,IAACA,UAAA,CAAkB,IAAA;AAAA,IAAlB;AAAA,MACC,WAAA,EAAU,UAAA;AAAA,MACV,SAAA,EAAW,EAAA;AAAA,QACT,oKAAA;AAAA;AAAA;AAAA,QAGA,sKAAA;AAAA;AAAA,QAEA,gFAAA;AAAA,QACA,8FAAA;AAAA,QACA,qHAAA;AAAA;AAAA,QAEA,wZAAA;AAAA;AAAA,QAEA,yHAAA;AAAA,QACA;AAAA,OACF;AAAA,MACC,GAAG,KAAA;AAAA,MAEJ,QAAA,kBAAA,GAAA;AAAA,QAACA,UAAA,CAAkB,SAAA;AAAA,QAAlB;AAAA,UACC,WAAA,EAAU,oBAAA;AAAA,UACV,SAAA,EAAU,0MAAA;AAAA,UACV,QAAQ,CAAC,cAAA,EAAgB,0BACvB,GAAA,CAAC,MAAA,EAAA,EAAM,GAAG,cAAA,EACP,QAAA,EAAA,KAAA,CAAM,gCAAgB,GAAA,CAAC,UAAA,EAAA,EAAW,eAAW,IAAA,EAAC,CAAA,uBAAM,SAAA,EAAA,EAAU,aAAA,EAAW,MAAC,CAAA,EAC7E;AAAA;AAAA;AAEJ;AAAA,GACF;AAEJ","file":"checkbox.js","sourcesContent":["'use client'\n\nimport { Checkbox as CheckboxPrimitive } from '@base-ui/react/checkbox'\n\nimport { IconCheck } from '../icons/check.js'\nimport { IconRemove } from '../icons/remove.js'\nimport { cn } from '../lib/utils.js'\n\nfunction Checkbox({ className, ...props }: CheckboxPrimitive.Root.Props) {\n return (\n <CheckboxPrimitive.Root\n data-slot='checkbox'\n className={cn(\n 'peer relative inline-flex size-8 shrink-0 items-center justify-center rounded-sm border border-(--text-default) bg-(--input-surface) motion-safe:transition-colors',\n // Use the theme's bridge scale so brand overrides reach both modes.\n // The inset stays centred at 22px even with a 2px invalid border.\n '[--checkbox-ink:var(--color-primary-800)] [--checkbox-mark:var(--surface-default)] dark:not-data-disabled:not-aria-invalid:[--checkbox-ink:var(--color-primary-200)]',\n // A 44px hit area without making the visible 32px control larger.\n 'after:absolute after:top-1/2 after:left-1/2 after:size-11 after:-translate-1/2',\n 'not-data-disabled:hover:bg-[color-mix(in_srgb,var(--checkbox-ink)_10%,var(--input-surface))]',\n 'focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-3 focus-visible:outline-(--checkbox-ink)',\n // Use Input's invalid roles, including its focus and hover treatment.\n 'aria-invalid:not-data-disabled:border-2 aria-invalid:not-data-disabled:border-(--input-invalid-border) aria-invalid:not-data-disabled:[--checkbox-ink:var(--danger-solid)] aria-invalid:not-data-disabled:[--checkbox-mark:var(--white)] aria-invalid:not-data-disabled:hover:bg-(--input-invalid-surface-hover) aria-invalid:focus-visible:outline-offset-2 aria-invalid:focus-visible:outline-(--input-invalid-ring)',\n // Base UI renders a span: data-disabled covers both the prop and Field.\n 'data-disabled:cursor-not-allowed data-disabled:border-(--text-subtle) data-disabled:[--checkbox-ink:var(--text-subtle)]',\n className,\n )}\n {...props}\n >\n <CheckboxPrimitive.Indicator\n data-slot='checkbox-indicator'\n className='pointer-events-none absolute top-1/2 left-1/2 size-5.5 -translate-1/2 bg-(--checkbox-ink) text-(--checkbox-mark) [&>svg]:absolute [&>svg]:top-1/2 [&>svg]:left-1/2 [&>svg]:size-6 [&>svg]:-translate-1/2'\n render={(indicatorProps, state) => (\n <span {...indicatorProps}>\n {state.indeterminate ? <IconRemove aria-hidden /> : <IconCheck aria-hidden />}\n </span>\n )}\n />\n </CheckboxPrimitive.Root>\n )\n}\n\nexport { Checkbox }\n"]}
|
|
@@ -14,6 +14,7 @@ declare const fieldVariants: (props?: ({
|
|
|
14
14
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
15
15
|
declare function Field({ className, orientation, ref, children, ...props }: React.ComponentProps<typeof Field$1.Root> & VariantProps<typeof fieldVariants>): React.JSX.Element;
|
|
16
16
|
declare function FieldContent({ className, ref, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
|
|
17
|
+
declare function FieldItem({ ref, ...props }: React.ComponentProps<typeof Field$1.Item>): React.JSX.Element;
|
|
17
18
|
declare function FieldLabel({ className, ref, ...props }: React.ComponentProps<typeof Label>): React.JSX.Element;
|
|
18
19
|
declare function FieldTitle({ className, ref, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
|
|
19
20
|
declare function FieldDescription({ className, ref, ...props }: React.ComponentProps<'p'>): React.JSX.Element;
|
|
@@ -30,6 +31,7 @@ type FieldProps = React.ComponentProps<typeof Field>;
|
|
|
30
31
|
type FieldSetProps = React.ComponentProps<typeof FieldSet>;
|
|
31
32
|
type FieldLegendProps = React.ComponentProps<typeof FieldLegend>;
|
|
32
33
|
type FieldGroupProps = React.ComponentProps<typeof FieldGroup>;
|
|
34
|
+
type FieldItemProps = React.ComponentProps<typeof FieldItem>;
|
|
33
35
|
type FieldContentProps = React.ComponentProps<typeof FieldContent>;
|
|
34
36
|
type FieldLabelProps = React.ComponentProps<typeof FieldLabel>;
|
|
35
37
|
type FieldTitleProps = React.ComponentProps<typeof FieldTitle>;
|
|
@@ -37,4 +39,4 @@ type FieldDescriptionProps = React.ComponentProps<typeof FieldDescription>;
|
|
|
37
39
|
type FieldSeparatorProps = React.ComponentProps<typeof FieldSeparator>;
|
|
38
40
|
type FieldErrorProps = React.ComponentProps<typeof FieldError>;
|
|
39
41
|
|
|
40
|
-
export { Field, FieldContent, type FieldContentProps, FieldDescription, type FieldDescriptionProps, FieldError, type FieldErrorProps, FieldGroup, type FieldGroupProps, FieldLabel, type FieldLabelProps, FieldLegend, type FieldLegendProps, type FieldProps, FieldSeparator, type FieldSeparatorProps, FieldSet, type FieldSetProps, FieldTitle, type FieldTitleProps };
|
|
42
|
+
export { Field, FieldContent, type FieldContentProps, FieldDescription, type FieldDescriptionProps, FieldError, type FieldErrorProps, FieldGroup, type FieldGroupProps, FieldItem, type FieldItemProps, FieldLabel, type FieldLabelProps, FieldLegend, type FieldLegendProps, type FieldProps, FieldSeparator, type FieldSeparatorProps, FieldSet, type FieldSetProps, FieldTitle, type FieldTitleProps };
|
package/dist/components/field.js
CHANGED
|
@@ -109,6 +109,9 @@ function FieldContent({ className, ref, ...props }) {
|
|
|
109
109
|
}
|
|
110
110
|
);
|
|
111
111
|
}
|
|
112
|
+
function FieldItem({ ref, ...props }) {
|
|
113
|
+
return /* @__PURE__ */ jsx(Field$1.Item, { ref, "data-slot": "field-item", ...props });
|
|
114
|
+
}
|
|
112
115
|
const fieldLabelClassName = cn(
|
|
113
116
|
"group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-disabled/field:opacity-50 has-data-checked:bg-primary/5 has-[>[data-slot=field]]:rounded-md has-[>[data-slot=field]]:border *:data-[slot=field]:p-2 dark:has-data-checked:bg-primary/10",
|
|
114
117
|
"has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col"
|
|
@@ -254,6 +257,6 @@ function FieldError({
|
|
|
254
257
|
);
|
|
255
258
|
}
|
|
256
259
|
|
|
257
|
-
export { Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTitle };
|
|
260
|
+
export { Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldItem, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTitle };
|
|
258
261
|
//# sourceMappingURL=field.js.map
|
|
259
262
|
//# sourceMappingURL=field.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/field.tsx"],"names":["FieldPrimitive"],"mappings":";;;;;;;;AAuDA,MAAM,kBAAA,GAAqB,KAAA,CAAM,aAAA,CAAc,KAAK,CAAA;AAEpD,SAAS,SAAS,EAAE,SAAA,EAAW,GAAA,EAAK,GAAG,OAAM,EAAqC;AAChF,EAAA,uBACE,GAAA;AAAA,IAAC,UAAA;AAAA,IAAA;AAAA,MACC,GAAA;AAAA,MACA,WAAA,EAAU,WAAA;AAAA,MACV,SAAA,EAAW,EAAA;AAAA,QACT,kGAAA;AAAA,QACA;AAAA,OACF;AAAA,MACC,GAAG;AAAA;AAAA,GACN;AAEJ;AAEA,SAAS,WAAA,CAAY;AAAA,EACnB,SAAA;AAAA,EACA,OAAA,GAAU,QAAA;AAAA,EACV,GAAA;AAAA,EACA,GAAG;AACL,CAAA,EAAsE;AACpE,EAAA,uBACE,GAAA;AAAA,IAAC,QAAA;AAAA,IAAA;AAAA,MACC,GAAA;AAAA,MACA,WAAA,EAAU,cAAA;AAAA,MACV,cAAA,EAAc,OAAA;AAAA,MACd,SAAA,EAAW,EAAA;AAAA,QACT,qFAAA;AAAA,QACA;AAAA,OACF;AAAA,MACC,GAAG;AAAA;AAAA,GACN;AAE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AA,EAAK,OAAA,EAAQ,WAAA,EAAU,aAAA,EAAc,SAAA,EAAW,cAAA,EAAiB,GAAG,KAAA,EAChF,QAAA,EAAA,OAAA,EACH,CAAA;AAAA,EAEJ;AAEA,EAAA,uBACE,GAAA;AAAA,IAACA,OAAA,CAAe,KAAA;AAAA,IAAf;AAAA,MACC,GAAA;AAAA,MAKA,KAAA,EAAK,IAAA;AAAA,MACL,IAAA,EAAK,OAAA;AAAA,MACL,WAAA,EAAU,aAAA;AAAA,MACV,SAAA,EAAW,cAAA;AAAA,MACV,GAAG,KAAA;AAAA,MAEH,QAAA,EAAA;AAAA;AAAA,GACH;AAEJ","file":"field.js","sourcesContent":["'use client'\n\nimport { Field as FieldPrimitive } from '@base-ui/react/field'\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport * as React from 'react'\n\nimport { Label } from '../components/label.js'\nimport { Separator } from '../components/separator.js'\nimport { cn } from '../lib/utils.js'\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Base UI Field\n// ─────────────────────────────────────────────────────────────────────────────\n//\n// `Field`, `FieldLabel`, `FieldDescription`, and `FieldError` wrap Base UI's\n// Field primitive (@base-ui/react/field). Base UI owns the accessible wiring:\n// the label is associated with the control, and any description/error ids are\n// added to the control's `aria-describedby` automatically — no manual\n// `htmlFor` / `aria-describedby` / `aria-invalid` plumbing required. Set\n// `invalid` on `Field` (e.g. from react-hook-form) and the control receives\n// `aria-invalid` and the wrapper gets `data-invalid` for free.\n//\n// Base UI's Field parts must live inside a `Field.Root`. To keep the previous\n// behaviour where a label/description/error could also be used standalone\n// (e.g. a group-level FieldDescription directly inside a FieldSet), FieldLabel/\n// FieldDescription/FieldError opt into the Base UI part only when they detect a\n// surrounding `Field` (via `InsideFieldContext`) and otherwise render the plain\n// element they did before. Inside a Field they gain the automatic association;\n// outside one they are unchanged.\n//\n// `FieldSet` / `FieldLegend` stay native `<fieldset>` / `<legend>` (already\n// accessible for grouping); `FieldGroup` / `FieldContent` / `FieldSeparator` /\n// `FieldTitle` remain layout-only primitives.\n//\n// ─────────────────────────────────────────────────────────────────────────────\n// Typography hierarchy (deliberate, do not collapse to a single size)\n// ─────────────────────────────────────────────────────────────────────────────\n//\n// FieldLabel inherits its font-size from the Label primitive (`text-base/\n// relaxed` = 16px) — the primary form text users read when scanning a form,\n// kept at the 16px ideal for body copy.\n// Every supporting element in this file uses `text-sm/relaxed` (14px). That\n// is below the 16px body-copy ideal but comfortably above the 12px floor\n// older versions used, so it still reads clearly as secondary information.\n// The 16/14 gap is intentional: it preserves a scannable visual hierarchy\n// (label > description / error / metadata) without shrinking supporting text\n// back down to the previous 12px.\n//\n// If you find yourself wanting to bump these to text-base, do it in\n// `label.tsx` so FieldLabel moves with the family. If you want to drop\n// them to text-xs, please raise that as a design decision — 12px is below\n// the NSW Government digital service standards minimum body-text size.\n// ─────────────────────────────────────────────────────────────────────────────\n\n// True for descendants of our <Field> (which renders Base UI's Field.Root).\nconst InsideFieldContext = React.createContext(false)\n\nfunction FieldSet({ className, ref, ...props }: React.ComponentProps<'fieldset'>) {\n return (\n <fieldset\n ref={ref}\n data-slot='field-set'\n className={cn(\n 'flex flex-col gap-4 has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3',\n className,\n )}\n {...props}\n />\n )\n}\n\nfunction FieldLegend({\n className,\n variant = 'legend',\n ref,\n ...props\n}: React.ComponentProps<'legend'> & { variant?: 'legend' | 'label' }) {\n return (\n <legend\n ref={ref}\n data-slot='field-legend'\n data-variant={variant}\n className={cn(\n 'mb-2 font-medium data-[variant=label]:text-sm/relaxed data-[variant=legend]:text-sm',\n className,\n )}\n {...props}\n />\n )\n}\n\nfunction FieldGroup({ className, ref, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n ref={ref}\n data-slot='field-group'\n className={cn(\n // `has-[>[data-slot=…]]:gap-3` matches when FieldGroup CONTAINS a\n // checkbox/radio group child. The original `data-[slot=checkbox-group]:gap-3`\n // was self-referential (this element's slot is `field-group`) and\n // could never apply. Mirrors the rule on FieldSet above.\n 'group/field-group @container/field-group flex w-full flex-col gap-4 has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3 *:data-[slot=field-group]:gap-4',\n className,\n )}\n {...props}\n />\n )\n}\n\nconst fieldVariants = cva(\n // `data-invalid:` (presence) matches the `data-invalid` attribute Base UI's\n // Field.Root sets when the field is invalid (via the `invalid` prop or native\n // validation) — replacing the old hand-set `data-[invalid=true]`.\n 'group/field flex w-full gap-2 data-invalid:text-destructive',\n {\n variants: {\n orientation: {\n vertical: 'flex-col *:w-full [&>.sr-only]:w-auto',\n horizontal:\n 'flex-row items-center has-[>[data-slot=field-content]]:items-start *:data-[slot=field-label]:flex-auto has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px',\n responsive:\n '@max-md/field-group:flex-col @max-md/field-group:*:w-full @md/field-group:flex-row @md/field-group:items-center @md/field-group:*:w-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:*:data-[slot=field-label]:flex-auto [&>.sr-only]:w-auto @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px',\n },\n },\n defaultVariants: {\n orientation: 'vertical',\n },\n },\n)\n\nfunction Field({\n className,\n orientation = 'vertical',\n ref,\n children,\n ...props\n}: React.ComponentProps<typeof FieldPrimitive.Root> & VariantProps<typeof fieldVariants>) {\n return (\n <FieldPrimitive.Root\n ref={ref}\n // Preserve the explicit group role + data-orientation the layout and the\n // accessibility tests rely on; Base UI's Root renders a bare <div>.\n role='group'\n data-slot='field'\n data-orientation={orientation}\n className={cn(fieldVariants({ orientation }), className)}\n {...props}\n >\n <InsideFieldContext.Provider value={true}>{children}</InsideFieldContext.Provider>\n </FieldPrimitive.Root>\n )\n}\n\nfunction FieldContent({ className, ref, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n ref={ref}\n data-slot='field-content'\n className={cn('group/field-content flex flex-1 flex-col gap-0.5 leading-snug', className)}\n {...props}\n />\n )\n}\n\nconst fieldLabelClassName = cn(\n 'group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-disabled/field:opacity-50 has-data-checked:bg-primary/5 has-[>[data-slot=field]]:rounded-md has-[>[data-slot=field]]:border *:data-[slot=field]:p-2 dark:has-data-checked:bg-primary/10',\n 'has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col',\n)\n\nfunction FieldLabel({ className, ref, ...props }: React.ComponentProps<typeof Label>) {\n const insideField = React.useContext(InsideFieldContext)\n\n // Standalone (no surrounding Field): render the styled Label directly, as\n // before. Base UI's Field.Label would throw without a Field.Root ancestor.\n if (!insideField) {\n return (\n <Label\n ref={ref}\n data-slot='field-label'\n className={cn(fieldLabelClassName, className)}\n {...props}\n />\n )\n }\n\n return (\n <FieldPrimitive.Label\n // Base UI's Field.Label types its ref as HTMLElement (it can render a\n // non-label); here it always renders our <Label>, so the ref is an\n // HTMLLabelElement at runtime.\n ref={ref as React.Ref<HTMLElement>}\n // Render through our styled Label so FieldLabel keeps the Label\n // primitive's typography + data-slot, while Base UI supplies the\n // automatic `htmlFor` association with the field control.\n render={<Label />}\n data-slot='field-label'\n className={cn(fieldLabelClassName, className)}\n {...props}\n />\n )\n}\n\nfunction FieldTitle({ className, ref, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n ref={ref}\n data-slot='field-label'\n className={cn(\n 'flex w-fit items-center gap-2 text-sm/relaxed font-medium group-data-disabled/field:opacity-50',\n className,\n )}\n {...props}\n />\n )\n}\n\nconst fieldDescriptionClassName = cn(\n // `group-data-[orientation=horizontal]/field:` matches the\n // `data-orientation=\"horizontal\"` attribute Field emits.\n 'text-start text-sm/relaxed leading-normal font-normal text-muted-foreground group-data-[orientation=horizontal]/field:text-balance [[data-variant=legend]+&]:-mt-1.5',\n 'last:mt-0 nth-last-2:-mt-1',\n '[&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary',\n)\n\nfunction FieldDescription({ className, ref, ...props }: React.ComponentProps<'p'>) {\n const insideField = React.useContext(InsideFieldContext)\n\n // Standalone (e.g. a group-level description inside a FieldSet): a plain\n // <p>, as before. Inside a Field, Base UI links it to the control via\n // aria-describedby.\n if (!insideField) {\n return (\n <p\n ref={ref}\n data-slot='field-description'\n className={cn(fieldDescriptionClassName, className)}\n {...props}\n />\n )\n }\n\n return (\n <FieldPrimitive.Description\n ref={ref}\n data-slot='field-description'\n className={cn(fieldDescriptionClassName, className)}\n {...props}\n />\n )\n}\n\nfunction FieldSeparator({\n children,\n className,\n ref,\n ...props\n}: React.ComponentProps<'div'> & {\n children?: React.ReactNode\n}) {\n return (\n <div\n ref={ref}\n data-slot='field-separator'\n data-content={!!children}\n className={cn(\n 'relative -my-2 h-5 text-sm/relaxed group-data-[variant=outline]/field-group:-mb-2',\n className,\n )}\n {...props}\n >\n <Separator className='absolute inset-0 top-1/2' />\n {children && (\n <span\n className='relative mx-auto block w-fit bg-background px-2 text-muted-foreground'\n data-slot='field-separator-content'\n >\n {children}\n </span>\n )}\n </div>\n )\n}\n\nfunction FieldError({\n className,\n children,\n errors,\n ref,\n ...props\n}: React.ComponentProps<'div'> & {\n errors?: Array<{ message?: string } | undefined>\n}) {\n const insideField = React.useContext(InsideFieldContext)\n\n const content = React.useMemo(() => {\n if (children) {\n return children\n }\n\n if (!errors?.length) {\n return null\n }\n\n const uniqueErrors = [...new Map(errors.map((error) => [error?.message, error])).values()]\n\n if (uniqueErrors?.length === 1) {\n return uniqueErrors[0]?.message\n }\n\n return (\n <ul className='ms-4 flex list-disc flex-col gap-1'>\n {uniqueErrors.map((error, index) => error?.message && <li key={index}>{error.message}</li>)}\n </ul>\n )\n }, [children, errors])\n\n if (!content) {\n return null\n }\n\n const errorClassName = cn('text-sm/relaxed font-normal text-destructive', className)\n\n // Standalone: a plain alert region, as before. Inside a Field, Base UI links\n // it to the control via aria-describedby.\n if (!insideField) {\n return (\n <div ref={ref} role='alert' data-slot='field-error' className={errorClassName} {...props}>\n {content}\n </div>\n )\n }\n\n return (\n <FieldPrimitive.Error\n ref={ref}\n // `match` lets the `errors` array / external library drive visibility\n // instead of the control's native ValidityState. We only render this when\n // there IS content, so force it visible; Base UI then adds its id to the\n // control's `aria-describedby`.\n match\n role='alert'\n data-slot='field-error'\n className={errorClassName}\n {...props}\n >\n {content}\n </FieldPrimitive.Error>\n )\n}\n\nexport {\n Field,\n FieldContent,\n FieldDescription,\n FieldError,\n FieldGroup,\n FieldLabel,\n FieldLegend,\n FieldSeparator,\n FieldSet,\n FieldTitle,\n}\n\n// Derived prop types — exact component props for consumers wrapping these.\nexport type FieldProps = React.ComponentProps<typeof Field>\nexport type FieldSetProps = React.ComponentProps<typeof FieldSet>\nexport type FieldLegendProps = React.ComponentProps<typeof FieldLegend>\nexport type FieldGroupProps = React.ComponentProps<typeof FieldGroup>\nexport type FieldContentProps = React.ComponentProps<typeof FieldContent>\nexport type FieldLabelProps = React.ComponentProps<typeof FieldLabel>\nexport type FieldTitleProps = React.ComponentProps<typeof FieldTitle>\nexport type FieldDescriptionProps = React.ComponentProps<typeof FieldDescription>\nexport type FieldSeparatorProps = React.ComponentProps<typeof FieldSeparator>\nexport type FieldErrorProps = React.ComponentProps<typeof FieldError>\n"]}
|
|
1
|
+
{"version":3,"sources":["../../src/components/field.tsx"],"names":["FieldPrimitive"],"mappings":";;;;;;;;AAuDA,MAAM,kBAAA,GAAqB,KAAA,CAAM,aAAA,CAAc,KAAK,CAAA;AAEpD,SAAS,SAAS,EAAE,SAAA,EAAW,GAAA,EAAK,GAAG,OAAM,EAAqC;AAChF,EAAA,uBACE,GAAA;AAAA,IAAC,UAAA;AAAA,IAAA;AAAA,MACC,GAAA;AAAA,MACA,WAAA,EAAU,WAAA;AAAA,MACV,SAAA,EAAW,EAAA;AAAA,QACT,kGAAA;AAAA,QACA;AAAA,OACF;AAAA,MACC,GAAG;AAAA;AAAA,GACN;AAEJ;AAEA,SAAS,WAAA,CAAY;AAAA,EACnB,SAAA;AAAA,EACA,OAAA,G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A,EACX,QAAA,EAAA,YAAA,CAAa,IAAI,CAAC,KAAA,EAAO,KAAA,KAAU,KAAA,EAAO,2BAAW,GAAA,CAAC,IAAA,EAAA,EAAgB,gBAAM,OAAA,EAAA,EAAd,KAAsB,CAAK,CAAA,EAC5F,CAAA;AAAA,EAEJ,CAAA,EAAG,CAAC,QAAA,EAAU,MAAM,CAAC,CAAA;AAErB,EAAA,IAAI,CAAC,OAAA,EAAS;AACZ,IAAA,OAAO,IAAA;AAAA,EACT;AAEA,EAAA,MAAM,cAAA,GAAiB,EAAA,CAAG,8CAAA,EAAgD,SAAS,CAAA;AAInF,EAAA,IAAI,CAAC,WAAA,EAAa;AAChB,IAAA,uBACE,GAAA,CAAC,KAAA,EAAA,EAAI,GAAA,EAAU,IAAA,EAAK,OAAA,EAAQ,WAAA,EAAU,aAAA,EAAc,SAAA,EAAW,cAAA,EAAiB,GAAG,KAAA,EAChF,QAAA,EAAA,OAAA,EACH,CAAA;AAAA,EAEJ;AAEA,EAAA,uBACE,GAAA;AAAA,IAACA,OAAA,CAAe,KAAA;AAAA,IAAf;AAAA,MACC,GAAA;AAAA,MAKA,KAAA,EAAK,IAAA;AAAA,MACL,IAAA,EAAK,OAAA;AAAA,MACL,WAAA,EAAU,aAAA;AAAA,MACV,SAAA,EAAW,cAAA;AAAA,MACV,GAAG,KAAA;AAAA,MAEH,QAAA,EAAA;AAAA;AAAA,GACH;AAEJ","file":"field.js","sourcesContent":["'use client'\n\nimport { Field as FieldPrimitive } from '@base-ui/react/field'\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport * as React from 'react'\n\nimport { Label } from '../components/label.js'\nimport { Separator } from '../components/separator.js'\nimport { cn } from '../lib/utils.js'\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Base UI Field\n// ─────────────────────────────────────────────────────────────────────────────\n//\n// `Field`, `FieldLabel`, `FieldDescription`, and `FieldError` wrap Base UI's\n// Field primitive (@base-ui/react/field). Base UI owns the accessible wiring:\n// the label is associated with the control, and any description/error ids are\n// added to the control's `aria-describedby` automatically — no manual\n// `htmlFor` / `aria-describedby` / `aria-invalid` plumbing required. Set\n// `invalid` on `Field` (e.g. from react-hook-form) and the control receives\n// `aria-invalid` and the wrapper gets `data-invalid` for free.\n//\n// Base UI's Field parts must live inside a `Field.Root`. To keep the previous\n// behaviour where a label/description/error could also be used standalone\n// (e.g. a group-level FieldDescription directly inside a FieldSet), FieldLabel/\n// FieldDescription/FieldError opt into the Base UI part only when they detect a\n// surrounding `Field` (via `InsideFieldContext`) and otherwise render the plain\n// element they did before. Inside a Field they gain the automatic association;\n// outside one they are unchanged.\n//\n// `FieldSet` / `FieldLegend` stay native `<fieldset>` / `<legend>` (already\n// accessible for grouping); `FieldGroup` / `FieldContent` / `FieldSeparator` /\n// `FieldTitle` remain layout-only primitives.\n//\n// ─────────────────────────────────────────────────────────────────────────────\n// Typography hierarchy (deliberate, do not collapse to a single size)\n// ─────────────────────────────────────────────────────────────────────────────\n//\n// FieldLabel inherits its font-size from the Label primitive (`text-base/\n// relaxed` = 16px) — the primary form text users read when scanning a form,\n// kept at the 16px ideal for body copy.\n// Every supporting element in this file uses `text-sm/relaxed` (14px). That\n// is below the 16px body-copy ideal but comfortably above the 12px floor\n// older versions used, so it still reads clearly as secondary information.\n// The 16/14 gap is intentional: it preserves a scannable visual hierarchy\n// (label > description / error / metadata) without shrinking supporting text\n// back down to the previous 12px.\n//\n// If you find yourself wanting to bump these to text-base, do it in\n// `label.tsx` so FieldLabel moves with the family. If you want to drop\n// them to text-xs, please raise that as a design decision — 12px is below\n// the NSW Government digital service standards minimum body-text size.\n// ─────────────────────────────────────────────────────────────────────────────\n\n// True for descendants of our <Field> (which renders Base UI's Field.Root).\nconst InsideFieldContext = React.createContext(false)\n\nfunction FieldSet({ className, ref, ...props }: React.ComponentProps<'fieldset'>) {\n return (\n <fieldset\n ref={ref}\n data-slot='field-set'\n className={cn(\n 'flex flex-col gap-4 has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3',\n className,\n )}\n {...props}\n />\n )\n}\n\nfunction FieldLegend({\n className,\n variant = 'legend',\n ref,\n ...props\n}: React.ComponentProps<'legend'> & { variant?: 'legend' | 'label' }) {\n return (\n <legend\n ref={ref}\n data-slot='field-legend'\n data-variant={variant}\n className={cn(\n 'mb-2 font-medium data-[variant=label]:text-sm/relaxed data-[variant=legend]:text-sm',\n className,\n )}\n {...props}\n />\n )\n}\n\nfunction FieldGroup({ className, ref, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n ref={ref}\n data-slot='field-group'\n className={cn(\n // `has-[>[data-slot=…]]:gap-3` matches when FieldGroup CONTAINS a\n // checkbox/radio group child. The original `data-[slot=checkbox-group]:gap-3`\n // was self-referential (this element's slot is `field-group`) and\n // could never apply. Mirrors the rule on FieldSet above.\n 'group/field-group @container/field-group flex w-full flex-col gap-4 has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3 *:data-[slot=field-group]:gap-4',\n className,\n )}\n {...props}\n />\n )\n}\n\nconst fieldVariants = cva(\n // `data-invalid:` (presence) matches the `data-invalid` attribute Base UI's\n // Field.Root sets when the field is invalid (via the `invalid` prop or native\n // validation) — replacing the old hand-set `data-[invalid=true]`.\n 'group/field flex w-full gap-2 data-invalid:text-destructive',\n {\n variants: {\n orientation: {\n vertical: 'flex-col *:w-full [&>.sr-only]:w-auto',\n horizontal:\n 'flex-row items-center has-[>[data-slot=field-content]]:items-start *:data-[slot=field-label]:flex-auto has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px',\n responsive:\n '@max-md/field-group:flex-col @max-md/field-group:*:w-full @md/field-group:flex-row @md/field-group:items-center @md/field-group:*:w-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:*:data-[slot=field-label]:flex-auto [&>.sr-only]:w-auto @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px',\n },\n },\n defaultVariants: {\n orientation: 'vertical',\n },\n },\n)\n\nfunction Field({\n className,\n orientation = 'vertical',\n ref,\n children,\n ...props\n}: React.ComponentProps<typeof FieldPrimitive.Root> & VariantProps<typeof fieldVariants>) {\n return (\n <FieldPrimitive.Root\n ref={ref}\n // Preserve the explicit group role + data-orientation the layout and the\n // accessibility tests rely on; Base UI's Root renders a bare <div>.\n role='group'\n data-slot='field'\n data-orientation={orientation}\n className={cn(fieldVariants({ orientation }), className)}\n {...props}\n >\n <InsideFieldContext.Provider value={true}>{children}</InsideFieldContext.Provider>\n </FieldPrimitive.Root>\n )\n}\n\nfunction FieldContent({ className, ref, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n ref={ref}\n data-slot='field-content'\n className={cn('group/field-content flex flex-1 flex-col gap-0.5 leading-snug', className)}\n {...props}\n />\n )\n}\n\n// Radio/checkbox options need their own label scope inside a shared Field.\n// Base UI keeps the outer validation state while associating each option label.\nfunction FieldItem({ ref, ...props }: React.ComponentProps<typeof FieldPrimitive.Item>) {\n return <FieldPrimitive.Item ref={ref} data-slot='field-item' {...props} />\n}\n\nconst fieldLabelClassName = cn(\n 'group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-disabled/field:opacity-50 has-data-checked:bg-primary/5 has-[>[data-slot=field]]:rounded-md has-[>[data-slot=field]]:border *:data-[slot=field]:p-2 dark:has-data-checked:bg-primary/10',\n 'has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col',\n)\n\nfunction FieldLabel({ className, ref, ...props }: React.ComponentProps<typeof Label>) {\n const insideField = React.useContext(InsideFieldContext)\n\n // Standalone (no surrounding Field): render the styled Label directly, as\n // before. Base UI's Field.Label would throw without a Field.Root ancestor.\n if (!insideField) {\n return (\n <Label\n ref={ref}\n data-slot='field-label'\n className={cn(fieldLabelClassName, className)}\n {...props}\n />\n )\n }\n\n return (\n <FieldPrimitive.Label\n // Base UI's Field.Label types its ref as HTMLElement (it can render a\n // non-label); here it always renders our <Label>, so the ref is an\n // HTMLLabelElement at runtime.\n ref={ref as React.Ref<HTMLElement>}\n // Render through our styled Label so FieldLabel keeps the Label\n // primitive's typography + data-slot, while Base UI supplies the\n // automatic `htmlFor` association with the field control.\n render={<Label />}\n data-slot='field-label'\n className={cn(fieldLabelClassName, className)}\n {...props}\n />\n )\n}\n\nfunction FieldTitle({ className, ref, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n ref={ref}\n data-slot='field-label'\n className={cn(\n 'flex w-fit items-center gap-2 text-sm/relaxed font-medium group-data-disabled/field:opacity-50',\n className,\n )}\n {...props}\n />\n )\n}\n\nconst fieldDescriptionClassName = cn(\n // `group-data-[orientation=horizontal]/field:` matches the\n // `data-orientation=\"horizontal\"` attribute Field emits.\n 'text-start text-sm/relaxed leading-normal font-normal text-muted-foreground group-data-[orientation=horizontal]/field:text-balance [[data-variant=legend]+&]:-mt-1.5',\n 'last:mt-0 nth-last-2:-mt-1',\n '[&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary',\n)\n\nfunction FieldDescription({ className, ref, ...props }: React.ComponentProps<'p'>) {\n const insideField = React.useContext(InsideFieldContext)\n\n // Standalone (e.g. a group-level description inside a FieldSet): a plain\n // <p>, as before. Inside a Field, Base UI links it to the control via\n // aria-describedby.\n if (!insideField) {\n return (\n <p\n ref={ref}\n data-slot='field-description'\n className={cn(fieldDescriptionClassName, className)}\n {...props}\n />\n )\n }\n\n return (\n <FieldPrimitive.Description\n ref={ref}\n data-slot='field-description'\n className={cn(fieldDescriptionClassName, className)}\n {...props}\n />\n )\n}\n\nfunction FieldSeparator({\n children,\n className,\n ref,\n ...props\n}: React.ComponentProps<'div'> & {\n children?: React.ReactNode\n}) {\n return (\n <div\n ref={ref}\n data-slot='field-separator'\n data-content={!!children}\n className={cn(\n 'relative -my-2 h-5 text-sm/relaxed group-data-[variant=outline]/field-group:-mb-2',\n className,\n )}\n {...props}\n >\n <Separator className='absolute inset-0 top-1/2' />\n {children && (\n <span\n className='relative mx-auto block w-fit bg-background px-2 text-muted-foreground'\n data-slot='field-separator-content'\n >\n {children}\n </span>\n )}\n </div>\n )\n}\n\nfunction FieldError({\n className,\n children,\n errors,\n ref,\n ...props\n}: React.ComponentProps<'div'> & {\n errors?: Array<{ message?: string } | undefined>\n}) {\n const insideField = React.useContext(InsideFieldContext)\n\n const content = React.useMemo(() => {\n if (children) {\n return children\n }\n\n if (!errors?.length) {\n return null\n }\n\n const uniqueErrors = [...new Map(errors.map((error) => [error?.message, error])).values()]\n\n if (uniqueErrors?.length === 1) {\n return uniqueErrors[0]?.message\n }\n\n return (\n <ul className='ms-4 flex list-disc flex-col gap-1'>\n {uniqueErrors.map((error, index) => error?.message && <li key={index}>{error.message}</li>)}\n </ul>\n )\n }, [children, errors])\n\n if (!content) {\n return null\n }\n\n const errorClassName = cn('text-sm/relaxed font-normal text-destructive', className)\n\n // Standalone: a plain alert region, as before. Inside a Field, Base UI links\n // it to the control via aria-describedby.\n if (!insideField) {\n return (\n <div ref={ref} role='alert' data-slot='field-error' className={errorClassName} {...props}>\n {content}\n </div>\n )\n }\n\n return (\n <FieldPrimitive.Error\n ref={ref}\n // `match` lets the `errors` array / external library drive visibility\n // instead of the control's native ValidityState. We only render this when\n // there IS content, so force it visible; Base UI then adds its id to the\n // control's `aria-describedby`.\n match\n role='alert'\n data-slot='field-error'\n className={errorClassName}\n {...props}\n >\n {content}\n </FieldPrimitive.Error>\n )\n}\n\nexport {\n Field,\n FieldContent,\n FieldDescription,\n FieldError,\n FieldGroup,\n FieldItem,\n FieldLabel,\n FieldLegend,\n FieldSeparator,\n FieldSet,\n FieldTitle,\n}\n\n// Derived prop types — exact component props for consumers wrapping these.\nexport type FieldProps = React.ComponentProps<typeof Field>\nexport type FieldSetProps = React.ComponentProps<typeof FieldSet>\nexport type FieldLegendProps = React.ComponentProps<typeof FieldLegend>\nexport type FieldGroupProps = React.ComponentProps<typeof FieldGroup>\nexport type FieldItemProps = React.ComponentProps<typeof FieldItem>\nexport type FieldContentProps = React.ComponentProps<typeof FieldContent>\nexport type FieldLabelProps = React.ComponentProps<typeof FieldLabel>\nexport type FieldTitleProps = React.ComponentProps<typeof FieldTitle>\nexport type FieldDescriptionProps = React.ComponentProps<typeof FieldDescription>\nexport type FieldSeparatorProps = React.ComponentProps<typeof FieldSeparator>\nexport type FieldErrorProps = React.ComponentProps<typeof FieldError>\n"]}
|
|
@@ -30,7 +30,7 @@ declare const headerColors: {
|
|
|
30
30
|
};
|
|
31
31
|
type HeaderColor = keyof typeof headerColors;
|
|
32
32
|
declare const headerVariants: (props?: ({
|
|
33
|
-
color?: "
|
|
33
|
+
color?: "light" | "white" | "grey" | "dark" | null | undefined;
|
|
34
34
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
35
35
|
declare const headerContainerVariants: (props?: ({
|
|
36
36
|
container?: "fluid" | "contained" | null | undefined;
|
|
@@ -35,7 +35,7 @@ declare function InputGroupButton({ className, type, variant, size, ...props }:
|
|
|
35
35
|
type?: 'button' | 'submit' | 'reset';
|
|
36
36
|
}): React.JSX.Element;
|
|
37
37
|
declare const inputGroupActionVariants: (props?: ({
|
|
38
|
-
variant?: "
|
|
38
|
+
variant?: "solid" | "open" | "subtle" | null | undefined;
|
|
39
39
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
40
40
|
declare function InputGroupAction({ className, type, variant, ...props }: Omit<React.ComponentProps<typeof Button>, 'size' | 'type' | 'variant'> & VariantProps<typeof inputGroupActionVariants> & {
|
|
41
41
|
type?: 'button' | 'submit' | 'reset';
|
|
@@ -10,7 +10,7 @@ declare const mastheadColors: {
|
|
|
10
10
|
};
|
|
11
11
|
type MastheadColor = keyof typeof mastheadColors;
|
|
12
12
|
declare const mastheadVariants: (props?: ({
|
|
13
|
-
color?: "
|
|
13
|
+
color?: "light" | "white" | "grey" | "dark" | null | undefined;
|
|
14
14
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
15
15
|
declare const mastheadContainerVariants: (props?: ({
|
|
16
16
|
container?: "fluid" | "contained" | null | undefined;
|
|
@@ -20,7 +20,16 @@ function RadioGroupItem({ className, ...props }) {
|
|
|
20
20
|
{
|
|
21
21
|
"data-slot": "radio-group-item",
|
|
22
22
|
className: cn(
|
|
23
|
-
"group/radio-group-item peer relative flex
|
|
23
|
+
"group/radio-group-item peer relative inline-flex size-8 shrink-0 items-center justify-center rounded-full border border-(--text-default) bg-(--input-surface) motion-safe:transition-colors",
|
|
24
|
+
// Read the theme bridge so changing the brand palette updates both modes.
|
|
25
|
+
"[--radio-ink:var(--color-primary-800)] dark:not-data-disabled:not-aria-invalid:[--radio-ink:var(--color-primary-200)]",
|
|
26
|
+
"after:absolute after:top-1/2 after:left-1/2 after:size-11 after:-translate-1/2 after:rounded-full",
|
|
27
|
+
"not-data-disabled:hover:bg-[color-mix(in_srgb,var(--radio-ink)_10%,var(--input-surface))]",
|
|
28
|
+
"focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-3 focus-visible:outline-(--radio-ink)",
|
|
29
|
+
// Match Checkbox and Input, including the selected invalid fill.
|
|
30
|
+
"aria-invalid:not-data-disabled:border-2 aria-invalid:not-data-disabled:border-(--input-invalid-border) aria-invalid:not-data-disabled:[--radio-ink:var(--danger-solid)] aria-invalid:not-data-disabled:hover:bg-(--input-invalid-surface-hover) aria-invalid:focus-visible:outline-offset-2 aria-invalid:focus-visible:outline-(--input-invalid-ring)",
|
|
31
|
+
// Base UI propagates disabled from the item, group or surrounding Field.
|
|
32
|
+
"data-disabled:cursor-not-allowed data-disabled:border-(--text-subtle) data-disabled:[--radio-ink:var(--text-subtle)]",
|
|
24
33
|
className
|
|
25
34
|
),
|
|
26
35
|
...props,
|
|
@@ -28,8 +37,7 @@ function RadioGroupItem({ className, ...props }) {
|
|
|
28
37
|
Radio.Indicator,
|
|
29
38
|
{
|
|
30
39
|
"data-slot": "radio-group-indicator",
|
|
31
|
-
className: "
|
|
32
|
-
children: /* @__PURE__ */ jsx("span", { className: "absolute start-1/2 top-1/2 size-2 -translate-x-1/2 -translate-y-1/2 rounded-full bg-primary-foreground rtl:translate-x-1/2" })
|
|
40
|
+
className: "pointer-events-none absolute top-1/2 left-1/2 size-5.5 -translate-1/2 rounded-full bg-(--radio-ink)"
|
|
33
41
|
}
|
|
34
42
|
)
|
|
35
43
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/radio-group.tsx"],"names":["RadioGroupPrimitive","RadioPrimitive"],"mappings":";;;;;AAOA,SAAS,UAAA,CAAW,EAAE,SAAA,EAAW,GAAG,OAAM,EAA8B;AACtE,EAAA,uBACE,GAAA;AAAA,IAACA,YAAA;AAAA,IAAA;AAAA,MACC,WAAA,EAAU,aAAA;AAAA,MACV,SAAA,EAAW,EAAA,CAAG,mBAAA,EAAqB,SAAS,CAAA;AAAA,MAC3C,GAAG;AAAA;AAAA,GACN;AAEJ;AAEA,SAAS,cAAA,CAAe,EAAE,SAAA,EAAW,GAAG,OAAM,EAA8B;AAC1E,EAAA,uBACE,GAAA;AAAA,IAACC,KAAA,CAAe,IAAA;AAAA,IAAf;AAAA,MACC,WAAA,EAAU,kBAAA;AAAA,MACV,SAAA,EAAW,EAAA;AAAA,QACT,
|
|
1
|
+
{"version":3,"sources":["../../src/components/radio-group.tsx"],"names":["RadioGroupPrimitive","RadioPrimitive"],"mappings":";;;;;AAOA,SAAS,UAAA,CAAW,EAAE,SAAA,EAAW,GAAG,OAAM,EAA8B;AACtE,EAAA,uBACE,GAAA;AAAA,IAACA,YAAA;AAAA,IAAA;AAAA,MACC,WAAA,EAAU,aAAA;AAAA,MACV,SAAA,EAAW,EAAA,CAAG,mBAAA,EAAqB,SAAS,CAAA;AAAA,MAC3C,GAAG;AAAA;AAAA,GACN;AAEJ;AAEA,SAAS,cAAA,CAAe,EAAE,SAAA,EAAW,GAAG,OAAM,EAA8B;AAC1E,EAAA,uBACE,GAAA;AAAA,IAACC,KAAA,CAAe,IAAA;AAAA,IAAf;AAAA,MACC,WAAA,EAAU,kBAAA;AAAA,MACV,SAAA,EAAW,EAAA;AAAA,QACT,6LAAA;AAAA;AAAA,QAEA,uHAAA;AAAA,QACA,mGAAA;AAAA,QACA,2FAAA;AAAA,QACA,kHAAA;AAAA;AAAA,QAEA,uVAAA;AAAA;AAAA,QAEA,sHAAA;AAAA,QACA;AAAA,OACF;AAAA,MACC,GAAG,KAAA;AAAA,MAEJ,QAAA,kBAAA,GAAA;AAAA,QAACA,KAAA,CAAe,SAAA;AAAA,QAAf;AAAA,UACC,WAAA,EAAU,uBAAA;AAAA,UACV,SAAA,EAAU;AAAA;AAAA;AACZ;AAAA,GACF;AAEJ","file":"radio-group.js","sourcesContent":["'use client'\n\nimport { Radio as RadioPrimitive } from '@base-ui/react/radio'\nimport { RadioGroup as RadioGroupPrimitive } from '@base-ui/react/radio-group'\n\nimport { cn } from '../lib/utils.js'\n\nfunction RadioGroup({ className, ...props }: RadioGroupPrimitive.Props) {\n return (\n <RadioGroupPrimitive\n data-slot='radio-group'\n className={cn('grid w-full gap-3', className)}\n {...props}\n />\n )\n}\n\nfunction RadioGroupItem({ className, ...props }: RadioPrimitive.Root.Props) {\n return (\n <RadioPrimitive.Root\n data-slot='radio-group-item'\n className={cn(\n 'group/radio-group-item peer relative inline-flex size-8 shrink-0 items-center justify-center rounded-full border border-(--text-default) bg-(--input-surface) motion-safe:transition-colors',\n // Read the theme bridge so changing the brand palette updates both modes.\n '[--radio-ink:var(--color-primary-800)] dark:not-data-disabled:not-aria-invalid:[--radio-ink:var(--color-primary-200)]',\n 'after:absolute after:top-1/2 after:left-1/2 after:size-11 after:-translate-1/2 after:rounded-full',\n 'not-data-disabled:hover:bg-[color-mix(in_srgb,var(--radio-ink)_10%,var(--input-surface))]',\n 'focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-3 focus-visible:outline-(--radio-ink)',\n // Match Checkbox and Input, including the selected invalid fill.\n 'aria-invalid:not-data-disabled:border-2 aria-invalid:not-data-disabled:border-(--input-invalid-border) aria-invalid:not-data-disabled:[--radio-ink:var(--danger-solid)] aria-invalid:not-data-disabled:hover:bg-(--input-invalid-surface-hover) aria-invalid:focus-visible:outline-offset-2 aria-invalid:focus-visible:outline-(--input-invalid-ring)',\n // Base UI propagates disabled from the item, group or surrounding Field.\n 'data-disabled:cursor-not-allowed data-disabled:border-(--text-subtle) data-disabled:[--radio-ink:var(--text-subtle)]',\n className,\n )}\n {...props}\n >\n <RadioPrimitive.Indicator\n data-slot='radio-group-indicator'\n className='pointer-events-none absolute top-1/2 left-1/2 size-5.5 -translate-1/2 rounded-full bg-(--radio-ink)'\n />\n </RadioPrimitive.Root>\n )\n}\n\nexport { RadioGroup, RadioGroupItem }\n"]}
|
|
@@ -3,7 +3,7 @@ import { VariantProps } from 'class-variance-authority';
|
|
|
3
3
|
import React__default from 'react';
|
|
4
4
|
|
|
5
5
|
declare const skipLinkVariants: (props?: ({
|
|
6
|
-
color?: "
|
|
6
|
+
color?: "light" | "white" | "grey" | "dark" | null | undefined;
|
|
7
7
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
8
8
|
type SkipLinkProps = React__default.ComponentPropsWithoutRef<'a'> & VariantProps<typeof skipLinkVariants> & {
|
|
9
9
|
/** Same-page fragment target, e.g. `"#content"`. */
|
package/dist/index.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ export { Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, Dr
|
|
|
20
20
|
export { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuLinkItem, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, DropdownMenuVariant, dropdownMenuContentVariants } from './components/dropdown-menu.js';
|
|
21
21
|
export { Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle, emptyMediaVariants } from './components/empty.js';
|
|
22
22
|
export { ExpandableSearch, ExpandableSearchButtonProps, ExpandableSearchField, ExpandableSearchFieldProps, ExpandableSearchProps, ExpandableSearchVariant, expandableSearchVariants } from './components/expandable-search.js';
|
|
23
|
-
export { Field, FieldContent, FieldContentProps, FieldDescription, FieldDescriptionProps, FieldError, FieldErrorProps, FieldGroup, FieldGroupProps, FieldLabel, FieldLabelProps, FieldLegend, FieldLegendProps, FieldProps, FieldSeparator, FieldSeparatorProps, FieldSet, FieldSetProps, FieldTitle, FieldTitleProps } from './components/field.js';
|
|
23
|
+
export { Field, FieldContent, FieldContentProps, FieldDescription, FieldDescriptionProps, FieldError, FieldErrorProps, FieldGroup, FieldGroupProps, FieldItem, FieldItemProps, FieldLabel, FieldLabelProps, FieldLegend, FieldLegendProps, FieldProps, FieldSeparator, FieldSeparatorProps, FieldSet, FieldSetProps, FieldTitle, FieldTitleProps } from './components/field.js';
|
|
24
24
|
export { Footer, FooterAcknowledgement, FooterAcknowledgementProps, FooterColor, FooterLegalLinkItem, FooterLegalLinks, FooterLegalLinksProps, FooterLinkItem, FooterNav, FooterNavColumn, FooterNavColumnProps, FooterNavLink, FooterNavLinkProps, FooterNavProps, FooterProps, FooterSmallPrint, FooterSmallPrintProps, FooterSocialLink, FooterSocialLinkItem, FooterSocialLinkProps, footerColors, footerContainerVariants, footerLogoType, footerVariants } from './components/footer.js';
|
|
25
25
|
export { Header, HeaderActions, HeaderActionsProps, HeaderBrand, HeaderBrandProps, HeaderColor, HeaderProps, headerColors, headerContainerVariants, headerVariants } from './components/header.js';
|
|
26
26
|
export { HoverCard, HoverCardContent, HoverCardTrigger } from './components/hover-card.js';
|