@kanso-labs/kanso-ui 0.22.0 → 0.24.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.
package/README.md CHANGED
@@ -6,7 +6,7 @@ sourced from a single
6
6
  [W3C Design Tokens (DTCG)](https://design-tokens.github.io/community-group/format/)
7
7
  file and compiled via [Style Dictionary](https://styledictionary.com).
8
8
 
9
- Every component is documented in Storybook, published from `main` at
9
+ Every component is documented in Storybook, published from the latest release at
10
10
  **[kanso-ui.kansolabs.org](https://kanso-ui.kansolabs.org/)**.
11
11
 
12
12
  ## Installation
@@ -0,0 +1,51 @@
1
+ import { ReactNode } from "react";
2
+ import { ColorFieldProps } from "react-aria-components";
3
+ //#region src/components/color-field/index.d.ts
4
+ type ColorFieldProps$1 = Omit<ColorFieldProps, 'children' | 'className' | 'style'> & {
5
+ /** A function may compute the class from the field's render state. */
6
+ className?: ColorFieldProps['className'];
7
+ /** Supporting text under the field. */
8
+ description?: string;
9
+ /** The message shown instead of the description, which also marks the field invalid. */
10
+ error?: string;
11
+ /**
12
+ * Whether the label floats into the box's top once the field holds a
13
+ * value, rather than sitting above it.
14
+ * @default true
15
+ */
16
+ floatingLabel?: boolean;
17
+ /** What the field is for. Always rendered; never a placeholder. */
18
+ label: string;
19
+ /** An icon at the box's leading end. A `ColorSwatch` shows the value. */
20
+ leadingIcon?: ReactNode;
21
+ /** A function may compute the style from the field's render state. */
22
+ style?: ColorFieldProps['style'];
23
+ /** An icon at the box's trailing end. */
24
+ trailingIcon?: ReactNode;
25
+ /**
26
+ * Which of the text fields page's two boxes to draw.
27
+ * @default 'filled'
28
+ */
29
+ variant?: 'filled' | 'outlined';
30
+ };
31
+ /**
32
+ * A colour typed into a field. The value is React Aria's — pass `value` with
33
+ * `onChange` to control it, or `defaultValue` — as a CSS colour string or a
34
+ * `Color` from `parseColor`, which this package re-exports.
35
+ *
36
+ * ```tsx
37
+ * <ColorField defaultValue="#6750A4" label="Label" />
38
+ * ```
39
+ *
40
+ * Without `channel` the field holds the whole colour and parses what is
41
+ * typed; with one it holds that channel alone as a number. `colorSpace`
42
+ * decides which space a channel belongs to, the same as on `ColorSlider`.
43
+ *
44
+ * The box, label and message are the field chrome in `src/field`, shared
45
+ * with every other field. The call site's `className` and `style` land on
46
+ * the field as a whole, which is the element a layout positions.
47
+ */
48
+ declare function ColorField$1({ description, error, floatingLabel, isDisabled, label, leadingIcon, trailingIcon, variant, ...props }: ColorFieldProps$1): import("react").JSX.Element;
49
+ //#endregion
50
+ export { type ColorFieldProps$1 as ColorFieldProps, ColorField$1 as default };
51
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,49 @@
1
+ import { props } from "../../node_modules/@stylexjs/stylex/lib/es/stylex.js";
2
+ import { mergeStatefulStyles } from "../../styles/merge.js";
3
+ import { fieldStyles, invalidFrom, useFieldValidationBehavior } from "../../field/root.js";
4
+ import { FieldBox, FieldInput, FieldMessage } from "../../field/index.js";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+ import { ColorField } from "react-aria-components";
7
+ //#region src/components/color-field/index.tsx
8
+ /**
9
+ * A colour typed into a field. The value is React Aria's — pass `value` with
10
+ * `onChange` to control it, or `defaultValue` — as a CSS colour string or a
11
+ * `Color` from `parseColor`, which this package re-exports.
12
+ *
13
+ * ```tsx
14
+ * <ColorField defaultValue="#6750A4" label="Label" />
15
+ * ```
16
+ *
17
+ * Without `channel` the field holds the whole colour and parses what is
18
+ * typed; with one it holds that channel alone as a number. `colorSpace`
19
+ * decides which space a channel belongs to, the same as on `ColorSlider`.
20
+ *
21
+ * The box, label and message are the field chrome in `src/field`, shared
22
+ * with every other field. The call site's `className` and `style` land on
23
+ * the field as a whole, which is the element a layout positions.
24
+ */
25
+ function ColorField$1({ description, error, floatingLabel = true, isDisabled = false, label, leadingIcon, trailingIcon, variant = "filled", ...props$1 }) {
26
+ const validationBehavior = useFieldValidationBehavior();
27
+ return /* @__PURE__ */ jsxs(ColorField, {
28
+ isDisabled,
29
+ isInvalid: invalidFrom(error),
30
+ validationBehavior,
31
+ ...props$1,
32
+ ...mergeStatefulStyles(props(fieldStyles.root), props$1),
33
+ children: [/* @__PURE__ */ jsx(FieldBox, {
34
+ floatingLabel,
35
+ label,
36
+ leading: leadingIcon,
37
+ trailing: trailingIcon,
38
+ variant,
39
+ children: /* @__PURE__ */ jsx(FieldInput, {})
40
+ }), /* @__PURE__ */ jsx(FieldMessage, {
41
+ description,
42
+ error
43
+ })]
44
+ });
45
+ }
46
+ //#endregion
47
+ export { ColorField$1 as default };
48
+
49
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../src/components/color-field/index.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport type { ColorFieldProps as RACColorFieldProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { ColorField as RACColorField } from 'react-aria-components';\nimport { FieldBox, FieldInput, FieldMessage } from '../../field';\nimport { fieldStyles, invalidFrom, useFieldValidationBehavior } from '../../field/root';\nimport { mergeStatefulStyles } from '../../styles/merge';\n\n// A colour typed rather than picked. React Aria renders a plain text input\n// holding the colour's own notation, so this is the text fields page's box\n// with nothing added — the same chrome `TextField` draws through, which is\n// what makes a colour field on a form the same shape as the field beside\n// it.\n//\n// Two things are worth knowing about what it holds.\n//\n// **`channel` turns it from a colour into a number.** Without one the field\n// holds the whole colour — `#6750A4` — and parses what is typed. With one\n// it holds that channel alone, as a number a reader can step, which is what\n// a picker's three boxes beside a plane are.\n//\n// **A swatch is the natural leading icon.** The field's value is a colour,\n// and the chrome already has a slot for something at the box's leading end;\n// passing a `ColorSwatch` there is what makes the field show the colour it\n// holds. It is left to the call site rather than drawn here, since a field\n// inside a picker sits beside a swatch already.\n\ntype ColorFieldProps = Omit<RACColorFieldProps, 'children' | 'className' | 'style'> & {\n /** A function may compute the class from the field's render state. */\n className?: RACColorFieldProps['className'];\n /** Supporting text under the field. */\n description?: string;\n /** The message shown instead of the description, which also marks the field invalid. */\n error?: string;\n /**\n * Whether the label floats into the box's top once the field holds a\n * value, rather than sitting above it.\n * @default true\n */\n floatingLabel?: boolean;\n /** What the field is for. Always rendered; never a placeholder. */\n label: string;\n /** An icon at the box's leading end. A `ColorSwatch` shows the value. */\n leadingIcon?: ReactNode;\n /** A function may compute the style from the field's render state. */\n style?: RACColorFieldProps['style'];\n /** An icon at the box's trailing end. */\n trailingIcon?: ReactNode;\n /**\n * Which of the text fields page's two boxes to draw.\n * @default 'filled'\n */\n variant?: 'filled' | 'outlined';\n};\n\n/**\n * A colour typed into a field. The value is React Aria's — pass `value` with\n * `onChange` to control it, or `defaultValue` — as a CSS colour string or a\n * `Color` from `parseColor`, which this package re-exports.\n *\n * ```tsx\n * <ColorField defaultValue=\"#6750A4\" label=\"Label\" />\n * ```\n *\n * Without `channel` the field holds the whole colour and parses what is\n * typed; with one it holds that channel alone as a number. `colorSpace`\n * decides which space a channel belongs to, the same as on `ColorSlider`.\n *\n * The box, label and message are the field chrome in `src/field`, shared\n * with every other field. The call site's `className` and `style` land on\n * the field as a whole, which is the element a layout positions.\n */\nfunction ColorField({\n description,\n error,\n floatingLabel = true,\n isDisabled = false,\n label,\n leadingIcon,\n trailingIcon,\n variant = 'filled',\n ...props\n}: ColorFieldProps) {\n const validationBehavior = useFieldValidationBehavior();\n return <RACColorField isDisabled={isDisabled} isInvalid={invalidFrom(error)} validationBehavior={validationBehavior} {...props} {...mergeStatefulStyles(stylex.props(fieldStyles.root), props)}>\n <FieldBox floatingLabel={floatingLabel} label={label} leading={leadingIcon} trailing={trailingIcon} variant={variant}>\n <FieldInput />\n </FieldBox>\n <FieldMessage description={description} error={error} />\n </RACColorField>;\n}\nexport type { ColorFieldProps };\nexport default ColorField;"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAwEA,SAAS,aAAW,EAClB,aACA,OACA,gBAAgB,MAChB,aAAa,OACb,OACA,aACA,cACA,UAAU,UACV,GAAG,WACe;CAClB,MAAM,qBAAqB,2BAA2B;CACtD,OAAO,qBAAC,YAAD;EAA2B;EAAY,WAAW,YAAY,KAAK;EAAuB;EAAoB,GAAI;EAAO,GAAI,oBAAoB,MAAa,YAAY,IAAI,GAAG,OAAK;EAAtL,UAAA,CACH,oBAAC,UAAD;GAAyB;GAAsB;GAAO,SAAS;GAAa,UAAU;GAAuB;GAC3G,UAAA,oBAAC,YAAD,CAAW,CAAA;EACH,CAAA,GACV,oBAAC,cAAD;GAA2B;GAAoB;EAAM,CAAA,CACxC;;AACnB"}
@@ -0,0 +1,51 @@
1
+ import { ReactNode } from "react";
2
+ import { ColorPickerProps } from "react-aria-components";
3
+ //#region src/components/color-picker/index.d.ts
4
+ type ColorPickerProps$1 = Omit<ColorPickerProps, 'children'> & {
5
+ /** Whether the alpha strip is drawn under the hue one. @default false */
6
+ alpha?: boolean;
7
+ /** Replaces everything on the surface, for a picker that arranges its own parts. */
8
+ children?: ReactNode;
9
+ /** Lands on the trigger, which is the element a layout positions. */
10
+ className?: string;
11
+ /** Whether the surface starts open. Uncontrolled; pair `isOpen` with `onOpenChange` instead. */
12
+ defaultOpen?: boolean;
13
+ /** Whether the whole picker is inert. @default false */
14
+ isDisabled?: boolean;
15
+ /** Whether the surface is open. Controlled; needs `onOpenChange`. */
16
+ isOpen?: boolean;
17
+ /** What the trigger says beside its swatch. Always rendered; it is the button's name. */
18
+ label: string;
19
+ /** Called when the surface opens or closes. */
20
+ onOpenChange?: (isOpen: boolean) => void;
21
+ /** Lands on the trigger, as `className` does. */
22
+ style?: React.CSSProperties;
23
+ };
24
+ /**
25
+ * A colour picked from a plane, a hue strip and a text field, behind a
26
+ * trigger showing the colour. The value is React Aria's: pass `value` with
27
+ * `onChange` to control it, or `defaultValue`, as a CSS colour string or a
28
+ * `Color` from `parseColor`, which this package re-exports.
29
+ *
30
+ * ```tsx
31
+ * <ColorPicker defaultValue="#6750A4" label="Label" />
32
+ * ```
33
+ *
34
+ * `alpha` adds the transparency strip. Above the medium breakpoint the
35
+ * surface is docked to the trigger; below it, it opens centred, the same
36
+ * swap `DatePicker` makes. `defaultOpen`, `isOpen` and `onOpenChange` reach
37
+ * the overlay, since the picker itself carries no open state — React Aria
38
+ * keeps that on the dialog trigger this renders inside.
39
+ *
40
+ * Every part inside is this package's own — `ColorArea`, `ColorSlider`,
41
+ * `ColorField` and `ColorSwatch` — and they share the picker's value
42
+ * through React Aria's context rather than props. Passing `children`
43
+ * replaces all of them, for a picker that wants a different arrangement.
44
+ *
45
+ * The call site's `className` and `style` land on the trigger, which is the
46
+ * element a layout positions.
47
+ */
48
+ declare function ColorPicker$1({ alpha, children, className, defaultOpen, isDisabled, isOpen, label, onOpenChange, style, ...props }: ColorPickerProps$1): import("react").JSX.Element;
49
+ //#endregion
50
+ export { type ColorPickerProps$1 as ColorPickerProps, ColorPicker$1 as default };
51
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,86 @@
1
+ import { props } from "../../node_modules/@stylexjs/stylex/lib/es/stylex.js";
2
+ import { mergeStatefulStyles } from "../../styles/merge.js";
3
+ import ColorArea$1 from "../color-area/index.js";
4
+ import ColorField$1 from "../color-field/index.js";
5
+ import { overlay } from "../../styles/overlay.js";
6
+ import { picker } from "../../styles/picker.js";
7
+ import ColorSlider$1 from "../color-slider/index.js";
8
+ import ColorSwatch$1 from "../color-swatch/index.js";
9
+ import { jsx, jsxs } from "react/jsx-runtime";
10
+ import { Button, ColorPicker, Dialog, DialogTrigger, Popover } from "react-aria-components";
11
+ //#region src/components/color-picker/index.tsx
12
+ /**
13
+ * A colour picked from a plane, a hue strip and a text field, behind a
14
+ * trigger showing the colour. The value is React Aria's: pass `value` with
15
+ * `onChange` to control it, or `defaultValue`, as a CSS colour string or a
16
+ * `Color` from `parseColor`, which this package re-exports.
17
+ *
18
+ * ```tsx
19
+ * <ColorPicker defaultValue="#6750A4" label="Label" />
20
+ * ```
21
+ *
22
+ * `alpha` adds the transparency strip. Above the medium breakpoint the
23
+ * surface is docked to the trigger; below it, it opens centred, the same
24
+ * swap `DatePicker` makes. `defaultOpen`, `isOpen` and `onOpenChange` reach
25
+ * the overlay, since the picker itself carries no open state — React Aria
26
+ * keeps that on the dialog trigger this renders inside.
27
+ *
28
+ * Every part inside is this package's own — `ColorArea`, `ColorSlider`,
29
+ * `ColorField` and `ColorSwatch` — and they share the picker's value
30
+ * through React Aria's context rather than props. Passing `children`
31
+ * replaces all of them, for a picker that wants a different arrangement.
32
+ *
33
+ * The call site's `className` and `style` land on the trigger, which is the
34
+ * element a layout positions.
35
+ */
36
+ function ColorPicker$1({ alpha = false, children, className, defaultOpen, isDisabled = false, isOpen, label, onOpenChange, style, ...props$1 }) {
37
+ return /* @__PURE__ */ jsx(ColorPicker, {
38
+ ...props$1,
39
+ children: /* @__PURE__ */ jsxs(DialogTrigger, {
40
+ defaultOpen,
41
+ isOpen,
42
+ onOpenChange,
43
+ children: [/* @__PURE__ */ jsxs(Button, {
44
+ isDisabled,
45
+ ...mergeStatefulStyles((state) => ({
46
+ 0: { className: "x6s0dn4 xu5m21g x5r8g2b x1vnz5z6 x3y1ksm xc342km x9f619 x139gbkf x1ypdohk x3nfvp2 xkknnkr x14zspaw x1v9cpvo x126z3so x155f00i x1lz68p4 xrgy624 x1hl8ikr x9v5kkp x1t137rt x1de99jn x1cmllll x18fpw6u" },
47
+ 1: { className: "x6s0dn4 x3y1ksm xc342km x9f619 x3nfvp2 xkknnkr x14zspaw x1v9cpvo x126z3so x155f00i x1lz68p4 xrgy624 x1hl8ikr x9v5kkp x1t137rt x1de99jn x1cmllll x18fpw6u x19v6zzp x1xj74d8 x1h6gzvc" }
48
+ })[!!state.isDisabled << 0], {
49
+ className,
50
+ style
51
+ }),
52
+ children: [/* @__PURE__ */ jsx(ColorSwatch$1, { className: "xxk0z11 x2lah0s xvy4d1p" }), label]
53
+ }), /* @__PURE__ */ jsx(Popover, {
54
+ ...props(overlay.popup, picker.popover),
55
+ children: /* @__PURE__ */ jsx(Dialog, {
56
+ ...props(overlay.popupDialog),
57
+ children: children ?? /* @__PURE__ */ jsxs("div", {
58
+ className: "x9f619 x78zum5 xdt5ytf x1gka490 x1dz1jew x193iq5w xgc26li",
59
+ children: [
60
+ /* @__PURE__ */ jsx(ColorArea$1, {
61
+ "aria-label": label,
62
+ colorSpace: "hsl",
63
+ xChannel: "saturation",
64
+ yChannel: "lightness"
65
+ }),
66
+ /* @__PURE__ */ jsx(ColorSlider$1, {
67
+ channel: "hue",
68
+ colorSpace: "hsl",
69
+ label: "Hue"
70
+ }),
71
+ alpha ? /* @__PURE__ */ jsx(ColorSlider$1, {
72
+ channel: "alpha",
73
+ label: "Alpha"
74
+ }) : null,
75
+ /* @__PURE__ */ jsx(ColorField$1, { label })
76
+ ]
77
+ })
78
+ })
79
+ })]
80
+ })
81
+ });
82
+ }
83
+ //#endregion
84
+ export { ColorPicker$1 as default };
85
+
86
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../src/components/color-picker/index.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport type { ButtonRenderProps, ColorPickerProps as RACColorPickerProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { Button as RACButton, ColorPicker as RACColorPicker, Dialog as RACDialog, DialogTrigger as RACDialogTrigger, Popover as RACPopover } from 'react-aria-components';\nimport { mergeStatefulStyles } from '../../styles/merge';\nimport { overlay } from '../../styles/overlay';\nimport { picker } from '../../styles/picker';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, radii, spacing, stateLayerOpacity, typography } from '../../tokens/design.tokens.stylex';\nimport ColorArea from '../color-area';\nimport ColorField from '../color-field';\nimport ColorSlider from '../color-slider';\nimport ColorSwatch from '../color-swatch';\n\n// Everything in this phase, in one control: a swatch and a label as the\n// trigger, and a plane, a hue slider, an alpha slider and a text field on\n// the surface it opens. React Aria's `ColorPicker` renders nothing of its\n// own — it is the state the five share — so what is here is the trigger,\n// the overlay and the arrangement inside it.\n//\n// The design carries no page for a colour picker. What it does carry is the\n// text fields page, which the field inside this one already draws through,\n// and the overlay surface every popover here shares. Three choices are the\n// library's own.\n//\n// **The trigger is a swatch beside a name, not a swatch alone.** A swatch\n// on its own is a coloured square with no affordance — nothing says it can\n// be pressed, and a screen reader is told a colour rather than an action.\n// The label is what makes it a button.\n//\n// **Hue is a slider rather than a wheel here.** A wheel and the plane want\n// the same space and would make the surface square and large; the strip\n// sits under the plane at the width it already has. `ColorWheel` is for a\n// picker that wants to be round, which is a different shape rather than a\n// different control.\n//\n// **It is docked above the medium breakpoint and modal below it**, which is\n// the same swap `DatePicker` and `Sheet` make — the shared one in\n// `src/styles/picker.ts` rather than a third copy. A 280dp surface anchored\n// to a trigger is unreachable at 375px.\n//\n// One thing the picker has to do that its parts do not. **The plane and the\n// hue strip are pinned to HSL.** A channel has to belong to the value's own\n// space or React Aria throws, and a hex parses as RGB, which has no\n// saturation — so `<ColorPicker defaultValue=\"#6750A4\" />`, the call anyone\n// writes first, would throw outright. Converting here is what makes the\n// picker take any notation, and it costs the caller nothing: the value\n// handed back is still in whatever they passed.\n\ntype ColorPickerProps = Omit<RACColorPickerProps, 'children'> & {\n /** Whether the alpha strip is drawn under the hue one. @default false */\n alpha?: boolean;\n /** Replaces everything on the surface, for a picker that arranges its own parts. */\n children?: ReactNode;\n /** Lands on the trigger, which is the element a layout positions. */\n className?: string;\n /** Whether the surface starts open. Uncontrolled; pair `isOpen` with `onOpenChange` instead. */\n defaultOpen?: boolean;\n /** Whether the whole picker is inert. @default false */\n isDisabled?: boolean;\n /** Whether the surface is open. Controlled; needs `onOpenChange`. */\n isOpen?: boolean;\n /** What the trigger says beside its swatch. Always rendered; it is the button's name. */\n label: string;\n /** Called when the surface opens or closes. */\n onOpenChange?: (isOpen: boolean) => void;\n /** Lands on the trigger, as `className` does. */\n style?: React.CSSProperties;\n};\n\n/**\n * A colour picked from a plane, a hue strip and a text field, behind a\n * trigger showing the colour. The value is React Aria's: pass `value` with\n * `onChange` to control it, or `defaultValue`, as a CSS colour string or a\n * `Color` from `parseColor`, which this package re-exports.\n *\n * ```tsx\n * <ColorPicker defaultValue=\"#6750A4\" label=\"Label\" />\n * ```\n *\n * `alpha` adds the transparency strip. Above the medium breakpoint the\n * surface is docked to the trigger; below it, it opens centred, the same\n * swap `DatePicker` makes. `defaultOpen`, `isOpen` and `onOpenChange` reach\n * the overlay, since the picker itself carries no open state — React Aria\n * keeps that on the dialog trigger this renders inside.\n *\n * Every part inside is this package's own — `ColorArea`, `ColorSlider`,\n * `ColorField` and `ColorSwatch` — and they share the picker's value\n * through React Aria's context rather than props. Passing `children`\n * replaces all of them, for a picker that wants a different arrangement.\n *\n * The call site's `className` and `style` land on the trigger, which is the\n * element a layout positions.\n */\nfunction ColorPicker({\n alpha = false,\n children,\n className,\n defaultOpen,\n isDisabled = false,\n isOpen,\n label,\n onOpenChange,\n style,\n ...props\n}: ColorPickerProps) {\n return <RACColorPicker {...props}>\n <RACDialogTrigger defaultOpen={defaultOpen} isOpen={isOpen} onOpenChange={onOpenChange}>\n <RACButton isDisabled={isDisabled} {...mergeStatefulStyles(\n // A function of the state rather than a fixed class, since the\n // trigger is the element a layout positions and the call site's\n // own class has to merge into it — a plain `className` would\n // overwrite one or the other.\n (state: ButtonRenderProps) => ({\n 0: {\n className: \"x6s0dn4 xu5m21g x5r8g2b x1vnz5z6 x3y1ksm xc342km x9f619 x139gbkf x1ypdohk x3nfvp2 xkknnkr x14zspaw x1v9cpvo x126z3so x155f00i x1lz68p4 xrgy624 x1hl8ikr x9v5kkp x1t137rt x1de99jn x1cmllll x18fpw6u\"\n },\n 1: {\n className: \"x6s0dn4 x3y1ksm xc342km x9f619 x3nfvp2 xkknnkr x14zspaw x1v9cpvo x126z3so x155f00i x1lz68p4 xrgy624 x1hl8ikr x9v5kkp x1t137rt x1de99jn x1cmllll x18fpw6u x19v6zzp x1xj74d8 x1h6gzvc\"\n }\n })[!!state.isDisabled << 0], {\n className,\n style\n })}>\n <ColorSwatch className=\"xxk0z11 x2lah0s xvy4d1p\" />\n {label}\n </RACButton>\n <RACPopover {...stylex.props(overlay.popup, picker.popover)}>\n <RACDialog {...stylex.props(overlay.popupDialog)}>\n {children ?? <div className=\"x9f619 x78zum5 xdt5ytf x1gka490 x1dz1jew x193iq5w xgc26li\">\n <ColorArea aria-label={label} colorSpace=\"hsl\" xChannel=\"saturation\" yChannel=\"lightness\" />\n <ColorSlider channel=\"hue\" colorSpace=\"hsl\" label=\"Hue\" />\n {alpha ? <ColorSlider channel=\"alpha\" label=\"Alpha\" /> : null}\n <ColorField label={label} />\n </div>}\n </RACDialog>\n </RACPopover>\n </RACDialogTrigger>\n </RACColorPicker>;\n}\nexport type { ColorPickerProps };\nexport default ColorPicker;"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8FA,SAAS,cAAY,EACnB,QAAQ,OACR,UACA,WACA,aACA,aAAa,OACb,QACA,OACA,cACA,OACA,GAAG,WACgB;CACnB,OAAO,oBAAC,aAAD;EAAgB,GAAI;EACvB,UAAA,qBAAC,eAAD;GAA+B;GAAqB;GAAsB;GAA1E,UAAA,CACE,qBAAC,QAAD;IAAuB;IAAY,GAAI,qBAKxC,WAA8B;KAC7B,GAAG,EACD,WAAW,sMACb;KACA,GAAG,EACD,WAAW,sLACb;IACF,EAAA,CAAG,CAAC,CAAC,MAAM,cAAc,IAAI;KAC3B;KACA;IACF,CAAC;IAfC,UAAA,CAgBE,oBAAC,eAAD,EAAa,WAAU,0BAAyB,CAAA,GAC/C,KACQ;GACX,CAAA,GAAA,oBAAC,SAAD;IAAY,GAAI,MAAa,QAAQ,OAAO,OAAO,OAAO;IACxD,UAAA,oBAAC,QAAD;KAAW,GAAI,MAAa,QAAQ,WAAW;KAC5C,UAAA,YAAY,qBAAC,OAAD;MAAK,WAAU;MAAf,UAAA;OACT,oBAAC,aAAD;QAAW,cAAY;QAAO,YAAW;QAAM,UAAS;QAAa,UAAS;OAAW,CAAA;OACzF,oBAAC,eAAD;QAAa,SAAQ;QAAM,YAAW;QAAM,OAAM;OAAK,CAAA;OACtD,QAAQ,oBAAC,eAAD;QAAa,SAAQ;QAAQ,OAAM;OAAO,CAAA,IAAM;OACzD,oBAAC,cAAD,EAAmB,MAAM,CAAA;MACtB;;IACE,CAAA;GACD,CAAA,CACI;;CACJ,CAAA;AACpB"}
@@ -0,0 +1,44 @@
1
+ import { ColorWheelProps } from "react-aria-components";
2
+ //#region src/components/color-wheel/index.d.ts
3
+ type ColorWheelProps$1 = Omit<ColorWheelProps, 'children' | 'className' | 'innerRadius' | 'outerRadius' | 'style'> & {
4
+ /** A function may compute the class from the wheel's render state. */
5
+ className?: string;
6
+ /**
7
+ * How far the ring reaches from the centre, in pixels. The wheel is twice
8
+ * this across.
9
+ * @default 100
10
+ */
11
+ outerRadius?: number;
12
+ /** Lands on the wheel, as `className` does. */
13
+ style?: React.CSSProperties;
14
+ /**
15
+ * How wide the band is, in pixels. The inner radius is this in from
16
+ * `outerRadius`, so the two cannot disagree.
17
+ * @default 16
18
+ */
19
+ thickness?: number;
20
+ };
21
+ /**
22
+ * Hue as a ring, with a handle on it. The value is React Aria's: pass
23
+ * `value` with `onChange` to control it, or `defaultValue`, as a CSS colour
24
+ * string or a `Color` from `parseColor`, which this package re-exports.
25
+ *
26
+ * ```tsx
27
+ * <ColorWheel defaultValue="hsl(200, 100%, 50%)" />
28
+ * ```
29
+ *
30
+ * A wheel slides hue and nothing else, so unlike `ColorSlider` and
31
+ * `ColorArea` it names no channel and there is no space for one to be
32
+ * missing from — a hex value works here.
33
+ *
34
+ * The middle is genuinely empty rather than filled, so a `ColorArea` or a
35
+ * `ColorSwatch` can sit inside one. React Aria names the handle "Hue" and
36
+ * announces the value; pass `aria-label` to say something else.
37
+ *
38
+ * The call site's `className` and `style` land on the wheel, which is the
39
+ * element a layout positions. Its size comes from `outerRadius`.
40
+ */
41
+ declare function ColorWheel$1({ className, isDisabled, outerRadius, style, thickness, ...props }: ColorWheelProps$1): import("react").JSX.Element;
42
+ //#endregion
43
+ export { type ColorWheelProps$1 as ColorWheelProps, ColorWheel$1 as default };
44
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,64 @@
1
+ import { props } from "../../node_modules/@stylexjs/stylex/lib/es/stylex.js";
2
+ import { mergeStyles } from "../../styles/merge.js";
3
+ import { thumbClassName } from "../../styles/color.js";
4
+ import { jsx, jsxs } from "react/jsx-runtime";
5
+ import { ColorThumb, ColorWheel, ColorWheelTrack } from "react-aria-components";
6
+ //#region src/components/color-wheel/index.tsx
7
+ const DEFAULT_OUTER_RADIUS = 100;
8
+ const DEFAULT_THICKNESS = 16;
9
+ const _temp = {
10
+ kX1K2I: "xwjwp01",
11
+ "$$css": true
12
+ };
13
+ const styles = {
14
+ track: {
15
+ kkrTdU: "x1ypdohk",
16
+ $$css: true
17
+ },
18
+ trackDisabled: {
19
+ kkrTdU: "x1h6gzvc",
20
+ $$css: true
21
+ },
22
+ trackRing: (inner) => [_temp, { "--x-maskImage": `radial-gradient(circle at center, transparent ${Math.max(0, inner - .5)}px, #000 ${inner + .5}px)` != null ? `radial-gradient(circle at center, transparent ${Math.max(0, inner - .5)}px, #000 ${inner + .5}px)` : void 0 }]
23
+ };
24
+ /**
25
+ * Hue as a ring, with a handle on it. The value is React Aria's: pass
26
+ * `value` with `onChange` to control it, or `defaultValue`, as a CSS colour
27
+ * string or a `Color` from `parseColor`, which this package re-exports.
28
+ *
29
+ * ```tsx
30
+ * <ColorWheel defaultValue="hsl(200, 100%, 50%)" />
31
+ * ```
32
+ *
33
+ * A wheel slides hue and nothing else, so unlike `ColorSlider` and
34
+ * `ColorArea` it names no channel and there is no space for one to be
35
+ * missing from — a hex value works here.
36
+ *
37
+ * The middle is genuinely empty rather than filled, so a `ColorArea` or a
38
+ * `ColorSwatch` can sit inside one. React Aria names the handle "Hue" and
39
+ * announces the value; pass `aria-label` to say something else.
40
+ *
41
+ * The call site's `className` and `style` land on the wheel, which is the
42
+ * element a layout positions. Its size comes from `outerRadius`.
43
+ */
44
+ function ColorWheel$1({ className, isDisabled = false, outerRadius = DEFAULT_OUTER_RADIUS, style, thickness = DEFAULT_THICKNESS, ...props$1 }) {
45
+ const innerRadius = Math.max(0, outerRadius - thickness);
46
+ return /* @__PURE__ */ jsxs(ColorWheel, {
47
+ innerRadius,
48
+ isDisabled,
49
+ outerRadius,
50
+ ...props$1,
51
+ ...mergeStyles({
52
+ 0: { className: "x9f619 x1rg5ohu x14ju556" },
53
+ 1: { className: "x9f619 x1rg5ohu x14ju556 x1ppv7y9" }
54
+ }[!!isDisabled << 0], {
55
+ className,
56
+ style
57
+ }),
58
+ children: [/* @__PURE__ */ jsx(ColorWheelTrack, { ...props(styles.track, styles.trackRing(innerRadius), isDisabled && styles.trackDisabled) }), /* @__PURE__ */ jsx(ColorThumb, { className: thumbClassName })]
59
+ });
60
+ }
61
+ //#endregion
62
+ export { ColorWheel$1 as default };
63
+
64
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../src/components/color-wheel/index.tsx"],"sourcesContent":["import type { ColorWheelProps as RACColorWheelProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { ColorThumb as RACColorThumb, ColorWheel as RACColorWheel, ColorWheelTrack as RACColorWheelTrack } from 'react-aria-components';\nimport { thumbClassName } from '../../styles/color';\nimport { mergeStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { stateLayerOpacity } from '../../tokens/design.tokens.stylex';\n\n// Hue as a ring. React Aria paints the conic gradient on the track's own\n// inline `background` and sizes it from `outerRadius`, so what is here is\n// the hole in the middle and the handle `ColorSlider` already draws, from\n// `src/styles/color.ts`.\n//\n// The design carries no page for this. Three things follow, each a choice\n// rather than a reading.\n//\n// **The ring's thickness is the sliders page's 16dp track.** A hue wheel and\n// a hue slider are the same control in two shapes, so the band a reader\n// drags along is the same width in both.\n//\n// **The thickness is a prop and the inner radius is not.** React Aria takes\n// both radii and would accept an inner one larger than the outer, which\n// draws nothing at all; deriving it is what stops the two disagreeing.\n//\n// **The hole is cut with a mask, not drawn with a disc on top.** A disc in\n// the wheel's own surface colour would be opaque, so anything the wheel is\n// placed over — a card, a photograph, another control — would be hidden by\n// a circle nothing explains. The mask leaves the middle genuinely empty,\n// which is also what lets a swatch or an area sit inside one.\n\nconst DEFAULT_OUTER_RADIUS = 100;\n// The sliders page's track, which is what a hue slider draws.\nconst DEFAULT_THICKNESS = 16;\nconst _temp = {\n kX1K2I: \"xwjwp01\",\n \"$$css\": true\n};\nconst styles = {\n track: {\n kkrTdU: \"x1ypdohk\",\n $$css: true\n },\n trackDisabled: {\n kkrTdU: \"x1h6gzvc\",\n $$css: true\n },\n trackRing: (inner: number) => [_temp, {\n \"--x-maskImage\": `radial-gradient(circle at center, transparent ${Math.max(0, inner - 0.5)}px, #000 ${inner + 0.5}px)` != null ? `radial-gradient(circle at center, transparent ${Math.max(0, inner - 0.5)}px, #000 ${inner + 0.5}px)` : undefined\n }]\n};\ntype ColorWheelProps = Omit<RACColorWheelProps, 'children' | 'className' | 'innerRadius' | 'outerRadius' | 'style'> & {\n /** A function may compute the class from the wheel's render state. */\n className?: string;\n /**\n * How far the ring reaches from the centre, in pixels. The wheel is twice\n * this across.\n * @default 100\n */\n outerRadius?: number;\n /** Lands on the wheel, as `className` does. */\n style?: React.CSSProperties;\n /**\n * How wide the band is, in pixels. The inner radius is this in from\n * `outerRadius`, so the two cannot disagree.\n * @default 16\n */\n thickness?: number;\n};\n\n/**\n * Hue as a ring, with a handle on it. The value is React Aria's: pass\n * `value` with `onChange` to control it, or `defaultValue`, as a CSS colour\n * string or a `Color` from `parseColor`, which this package re-exports.\n *\n * ```tsx\n * <ColorWheel defaultValue=\"hsl(200, 100%, 50%)\" />\n * ```\n *\n * A wheel slides hue and nothing else, so unlike `ColorSlider` and\n * `ColorArea` it names no channel and there is no space for one to be\n * missing from — a hex value works here.\n *\n * The middle is genuinely empty rather than filled, so a `ColorArea` or a\n * `ColorSwatch` can sit inside one. React Aria names the handle \"Hue\" and\n * announces the value; pass `aria-label` to say something else.\n *\n * The call site's `className` and `style` land on the wheel, which is the\n * element a layout positions. Its size comes from `outerRadius`.\n */\nfunction ColorWheel({\n className,\n isDisabled = false,\n outerRadius = DEFAULT_OUTER_RADIUS,\n style,\n thickness = DEFAULT_THICKNESS,\n ...props\n}: ColorWheelProps) {\n const innerRadius = Math.max(0, outerRadius - thickness);\n return <RACColorWheel innerRadius={innerRadius} isDisabled={isDisabled} outerRadius={outerRadius} {...props} {...mergeStyles({\n 0: {\n className: \"x9f619 x1rg5ohu x14ju556\"\n },\n 1: {\n className: \"x9f619 x1rg5ohu x14ju556 x1ppv7y9\"\n }\n }[!!isDisabled << 0], {\n className,\n style\n })}>\n <RACColorWheelTrack {...stylex.props(styles.track, styles.trackRing(innerRadius), isDisabled && styles.trackDisabled)} />\n <RACColorThumb className={thumbClassName} />\n </RACColorWheel>;\n}\nexport type { ColorWheelProps };\nexport default ColorWheel;"],"mappings":";;;;;;AA8BA,MAAM,uBAAuB;AAE7B,MAAM,oBAAoB;AAC1B,MAAM,QAAQ;CACZ,QAAQ;CACR,SAAS;AACX;AACA,MAAM,SAAS;CACb,OAAO;EACL,QAAQ;EACR,OAAO;CACT;CACA,eAAe;EACb,QAAQ;EACR,OAAO;CACT;CACA,YAAY,UAAkB,CAAC,OAAO,EACpC,iBAAiB,iDAAiD,KAAK,IAAI,GAAG,QAAQ,EAAG,EAAC,WAAY,QAAQ,GAAG,QAAS,OAAO,iDAAiD,KAAK,IAAI,GAAG,QAAQ,EAAG,EAAC,WAAY,QAAQ,GAAG,OAAQ,KAAA,EAC3O,CAAC;AACH;;;;;;;;;;;;;;;;;;;;;AAwCA,SAAS,aAAW,EAClB,WACA,aAAa,OACb,cAAc,sBACd,OACA,YAAY,mBACZ,GAAG,WACe;CAClB,MAAM,cAAc,KAAK,IAAI,GAAG,cAAc,SAAS;CACvD,OAAO,qBAAC,YAAD;EAA4B;EAAyB;EAAyB;EAAa,GAAI;EAAO,GAAI,YAAY;GAC3H,GAAG,EACD,WAAW,2BACb;GACA,GAAG,EACD,WAAW,oCACb;EACF,EAAE,CAAC,CAAC,cAAc,IAAI;GACpB;GACA;EACF,CAAC;EAVM,UAAA,CAWH,oBAAC,iBAAD,EAAoB,GAAI,MAAa,OAAO,OAAO,OAAO,UAAU,WAAW,GAAG,cAAc,OAAO,aAAa,EAAE,CAAA,GACtH,oBAAC,YAAD,EAAe,WAAW,eAAe,CAAA,CAC5B;;AACnB"}
@@ -5,9 +5,9 @@ import Calendar$1 from "../calendar/index.js";
5
5
  import { fieldStyles, invalidFrom, useFieldValidationBehavior } from "../../field/root.js";
6
6
  import { FieldBox, FieldMessage, FieldValue } from "../../field/index.js";
7
7
  import { overlay } from "../../styles/overlay.js";
8
+ import { picker, triggerClassName } from "../../styles/picker.js";
8
9
  import { segmentStyles } from "../../segments/styles.js";
9
10
  import { renderSegment } from "../../segments/index.js";
10
- import { picker, triggerClassName } from "../../styles/picker.js";
11
11
  import { jsx, jsxs } from "react/jsx-runtime";
12
12
  import { Button, DateInput, DatePicker, Dialog, Group, Popover } from "react-aria-components";
13
13
  //#region src/components/date-picker/index.tsx
@@ -64,7 +64,10 @@ function DatePicker$1({ description, error, floatingLabel = true, isDisabled = f
64
64
  }),
65
65
  /* @__PURE__ */ jsx(Popover, {
66
66
  ...props(overlay.popup, picker.popover),
67
- children: /* @__PURE__ */ jsx(Dialog, { children: /* @__PURE__ */ jsx(Calendar$1, { "aria-label": label }) })
67
+ children: /* @__PURE__ */ jsx(Dialog, {
68
+ ...props(overlay.popupDialog),
69
+ children: /* @__PURE__ */ jsx(Calendar$1, { "aria-label": label })
70
+ })
68
71
  })
69
72
  ]
70
73
  });
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../src/components/date-picker/index.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport type { DateValue, DatePickerProps as RACDatePickerProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { Button as RACButton, DateInput as RACDateInput, DatePicker as RACDatePicker, Dialog as RACDialog, Group as RACGroup, Popover as RACPopover } from 'react-aria-components';\nimport { FieldBox, FieldMessage, FieldValue } from '../../field';\nimport { fieldStyles, invalidFrom, useFieldValidationBehavior } from '../../field/root';\nimport { CalendarGlyph } from '../../glyphs';\nimport { renderSegment } from '../../segments';\nimport { segmentStyles } from '../../segments/styles';\nimport { mergeStatefulStyles } from '../../styles/merge';\nimport { overlay } from '../../styles/overlay';\nimport { picker, triggerClassName } from '../../styles/picker';\nimport Calendar from '../calendar';\n\n// The date pickers page's picker: the date field a date is typed into, with\n// a calendar behind a button for picking it instead. Both halves already\n// exist — the segments are `DateField`'s, from `src/segments`, and the\n// calendar is `Calendar` — so what this adds is the button between them and\n// the surface the calendar opens on.\n//\n// Two things are this component's own.\n//\n// **The picker is one field, not a field beside a button.** React Aria's\n// `Group` is what holds the segments and the trigger together, so the box\n// draws once around both and a reader tabs through the segments and reaches\n// the button at the end of them rather than as a separate control.\n//\n// **It is docked above the medium breakpoint and modal below it**, which is\n// the pairing the page draws and the same swap `Sheet` makes. It is done in\n// CSS rather than by rendering a different tree: a 360dp calendar anchored\n// to a field is unreachable at 375px, and a modal that stayed centred on a\n// desktop would cover a form for no reason. `Sheet` settles this the same\n// way, and doing it twice in two different ways is how the two would drift.\n\ntype DatePickerProps<T extends DateValue> = Omit<RACDatePickerProps<T>, 'children' | 'className' | 'style'> & {\n /** A function may compute the class from the picker's render state. */\n className?: RACDatePickerProps<T>['className'];\n /** Supporting text under the field. */\n description?: string;\n /** The message shown instead of the description, which also marks the field invalid. */\n error?: string;\n /**\n * Whether the label floats into the box's top once the field holds a\n * value, rather than sitting above it.\n * @default true\n */\n floatingLabel?: boolean;\n /** What the field is for. Always rendered; never a placeholder. */\n label: string;\n /** An icon at the box's leading end. */\n leadingIcon?: ReactNode;\n /** A function may compute the style from the picker's render state. */\n style?: RACDatePickerProps<T>['style'];\n /**\n * What the button that opens the calendar is called, for a screen reader.\n * @default 'Choose a date'\n */\n triggerLabel?: string;\n /**\n * Which of the text fields page's two boxes to draw.\n * @default 'filled'\n */\n variant?: 'filled' | 'outlined';\n};\n\n/**\n * A date typed into a field, or picked from a calendar behind a button. The\n * value is React Aria's — pass `value` with `onChange` to control it, or\n * `defaultValue` — as an `@internationalized/date` value from this package's\n * `./date` subpath.\n *\n * ```tsx\n * import { CalendarDate } from '@kanso-labs/kanso-ui/date'\n *\n * <DatePicker defaultValue={new CalendarDate(2026, 9, 15)} label=\"Label\" />\n * ```\n *\n * The segments are `DateField`'s and the calendar is `Calendar`, so\n * `granularity`, `minValue`, `maxValue` and `isDateUnavailable` all behave\n * as they do there. Above the medium breakpoint the calendar is docked to\n * the field; below it, it opens centred, which is the page's modal picker.\n *\n * The call site's `className` and `style` land on the picker as a whole,\n * which is the element a layout positions.\n */\nfunction DatePicker<T extends DateValue>({\n description,\n error,\n floatingLabel = true,\n isDisabled = false,\n label,\n leadingIcon,\n triggerLabel = 'Choose a date',\n variant = 'filled',\n ...props\n}: DatePickerProps<T>) {\n const validationBehavior = useFieldValidationBehavior();\n return <RACDatePicker<T> isDisabled={isDisabled} isInvalid={invalidFrom(error)} validationBehavior={validationBehavior} {...props} {...mergeStatefulStyles(stylex.props(fieldStyles.root), props)}>\n <FieldBox floatingLabel={floatingLabel}\n // Always populated, which buys exactly one thing: the outlined\n // notch. The box decides populated twice over — in CSS for the\n // label's type, and in React for the notch, since CSS cannot cut an\n // outline to a width it has no way to measure. React Aria renders a\n // hidden `<input type=\"date\">` carrying no placeholder, so the CSS\n // half reads as populated on its own; the React half reads React\n // Aria's input context, which a picker does not provide. Without\n // this the notch stays shut across segments already showing\n // `mm/dd/yyyy`.\n isPopulated label={label} leading={leadingIcon} variant={variant}>\n <FieldValue>\n <RACGroup {...stylex.props(picker.group)}>\n <RACDateInput {...stylex.props(segmentStyles.input)}>\n {renderSegment}\n </RACDateInput>\n <RACButton aria-label={triggerLabel} className={triggerClassName}>\n <CalendarGlyph {...stylex.props(picker.triggerGlyph)} />\n </RACButton>\n </RACGroup>\n </FieldValue>\n </FieldBox>\n <FieldMessage description={description} error={error} />\n <RACPopover {...stylex.props(overlay.popup, picker.popover)}>\n <RACDialog>\n <Calendar aria-label={label} />\n </RACDialog>\n </RACPopover>\n </RACDatePicker>;\n}\nexport type { DatePickerProps };\nexport default DatePicker;"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqFA,SAAS,aAAgC,EACvC,aACA,OACA,gBAAgB,MAChB,aAAa,OACb,OACA,aACA,eAAe,iBACf,UAAU,UACV,GAAG,WACkB;CACrB,MAAM,qBAAqB,2BAA2B;CACtD,OAAO,qBAAC,YAAD;EAA8B;EAAY,WAAW,YAAY,KAAK;EAAuB;EAAoB,GAAI;EAAO,GAAI,oBAAoB,MAAa,YAAY,IAAI,GAAG,OAAK;EAAzL,UAAA;GACH,oBAAC,UAAD;IAAyB;IAU3B,aAAA;IAAmB;IAAO,SAAS;IAAsB;IACrD,UAAA,oBAAC,YAAD,EAAA,UACE,qBAAC,OAAD;KAAU,GAAI,MAAa,OAAO,KAAK;KAAvC,UAAA,CACE,oBAAC,WAAD;MAAc,GAAI,MAAa,cAAc,KAAK;MAC/C,UAAA;KACW,CAAA,GACd,oBAAC,QAAD;MAAW,cAAY;MAAc,WAAW;MAC9C,UAAA,oBAAC,eAAD,EAAe,GAAI,MAAa,OAAO,YAAY,EAAE,CAAA;KAC5C,CAAA,CACH;IACA,CAAA,EAAA,CAAA;GACJ,CAAA;GACV,oBAAC,cAAD;IAA2B;IAAoB;GAAM,CAAA;GACrD,oBAAC,SAAD;IAAY,GAAI,MAAa,QAAQ,OAAO,OAAO,OAAO;IACxD,UAAA,oBAAC,QAAD,EAAA,UACE,oBAAC,YAAD,EAAU,cAAY,MAAM,CAAA,EACnB,CAAA;GACD,CAAA;EACC;;AACnB"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../src/components/date-picker/index.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport type { DateValue, DatePickerProps as RACDatePickerProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { Button as RACButton, DateInput as RACDateInput, DatePicker as RACDatePicker, Dialog as RACDialog, Group as RACGroup, Popover as RACPopover } from 'react-aria-components';\nimport { FieldBox, FieldMessage, FieldValue } from '../../field';\nimport { fieldStyles, invalidFrom, useFieldValidationBehavior } from '../../field/root';\nimport { CalendarGlyph } from '../../glyphs';\nimport { renderSegment } from '../../segments';\nimport { segmentStyles } from '../../segments/styles';\nimport { mergeStatefulStyles } from '../../styles/merge';\nimport { overlay } from '../../styles/overlay';\nimport { picker, triggerClassName } from '../../styles/picker';\nimport Calendar from '../calendar';\n\n// The date pickers page's picker: the date field a date is typed into, with\n// a calendar behind a button for picking it instead. Both halves already\n// exist — the segments are `DateField`'s, from `src/segments`, and the\n// calendar is `Calendar` — so what this adds is the button between them and\n// the surface the calendar opens on.\n//\n// Two things are this component's own.\n//\n// **The picker is one field, not a field beside a button.** React Aria's\n// `Group` is what holds the segments and the trigger together, so the box\n// draws once around both and a reader tabs through the segments and reaches\n// the button at the end of them rather than as a separate control.\n//\n// **It is docked above the medium breakpoint and modal below it**, which is\n// the pairing the page draws and the same swap `Sheet` makes. It is done in\n// CSS rather than by rendering a different tree: a 360dp calendar anchored\n// to a field is unreachable at 375px, and a modal that stayed centred on a\n// desktop would cover a form for no reason. `Sheet` settles this the same\n// way, and doing it twice in two different ways is how the two would drift.\n\ntype DatePickerProps<T extends DateValue> = Omit<RACDatePickerProps<T>, 'children' | 'className' | 'style'> & {\n /** A function may compute the class from the picker's render state. */\n className?: RACDatePickerProps<T>['className'];\n /** Supporting text under the field. */\n description?: string;\n /** The message shown instead of the description, which also marks the field invalid. */\n error?: string;\n /**\n * Whether the label floats into the box's top once the field holds a\n * value, rather than sitting above it.\n * @default true\n */\n floatingLabel?: boolean;\n /** What the field is for. Always rendered; never a placeholder. */\n label: string;\n /** An icon at the box's leading end. */\n leadingIcon?: ReactNode;\n /** A function may compute the style from the picker's render state. */\n style?: RACDatePickerProps<T>['style'];\n /**\n * What the button that opens the calendar is called, for a screen reader.\n * @default 'Choose a date'\n */\n triggerLabel?: string;\n /**\n * Which of the text fields page's two boxes to draw.\n * @default 'filled'\n */\n variant?: 'filled' | 'outlined';\n};\n\n/**\n * A date typed into a field, or picked from a calendar behind a button. The\n * value is React Aria's — pass `value` with `onChange` to control it, or\n * `defaultValue` — as an `@internationalized/date` value from this package's\n * `./date` subpath.\n *\n * ```tsx\n * import { CalendarDate } from '@kanso-labs/kanso-ui/date'\n *\n * <DatePicker defaultValue={new CalendarDate(2026, 9, 15)} label=\"Label\" />\n * ```\n *\n * The segments are `DateField`'s and the calendar is `Calendar`, so\n * `granularity`, `minValue`, `maxValue` and `isDateUnavailable` all behave\n * as they do there. Above the medium breakpoint the calendar is docked to\n * the field; below it, it opens centred, which is the page's modal picker.\n *\n * The call site's `className` and `style` land on the picker as a whole,\n * which is the element a layout positions.\n */\nfunction DatePicker<T extends DateValue>({\n description,\n error,\n floatingLabel = true,\n isDisabled = false,\n label,\n leadingIcon,\n triggerLabel = 'Choose a date',\n variant = 'filled',\n ...props\n}: DatePickerProps<T>) {\n const validationBehavior = useFieldValidationBehavior();\n return <RACDatePicker<T> isDisabled={isDisabled} isInvalid={invalidFrom(error)} validationBehavior={validationBehavior} {...props} {...mergeStatefulStyles(stylex.props(fieldStyles.root), props)}>\n <FieldBox floatingLabel={floatingLabel}\n // Always populated, which buys exactly one thing: the outlined\n // notch. The box decides populated twice over — in CSS for the\n // label's type, and in React for the notch, since CSS cannot cut an\n // outline to a width it has no way to measure. React Aria renders a\n // hidden `<input type=\"date\">` carrying no placeholder, so the CSS\n // half reads as populated on its own; the React half reads React\n // Aria's input context, which a picker does not provide. Without\n // this the notch stays shut across segments already showing\n // `mm/dd/yyyy`.\n isPopulated label={label} leading={leadingIcon} variant={variant}>\n <FieldValue>\n <RACGroup {...stylex.props(picker.group)}>\n <RACDateInput {...stylex.props(segmentStyles.input)}>\n {renderSegment}\n </RACDateInput>\n <RACButton aria-label={triggerLabel} className={triggerClassName}>\n <CalendarGlyph {...stylex.props(picker.triggerGlyph)} />\n </RACButton>\n </RACGroup>\n </FieldValue>\n </FieldBox>\n <FieldMessage description={description} error={error} />\n <RACPopover {...stylex.props(overlay.popup, picker.popover)}>\n <RACDialog {...stylex.props(overlay.popupDialog)}>\n <Calendar aria-label={label} />\n </RACDialog>\n </RACPopover>\n </RACDatePicker>;\n}\nexport type { DatePickerProps };\nexport default DatePicker;"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqFA,SAAS,aAAgC,EACvC,aACA,OACA,gBAAgB,MAChB,aAAa,OACb,OACA,aACA,eAAe,iBACf,UAAU,UACV,GAAG,WACkB;CACrB,MAAM,qBAAqB,2BAA2B;CACtD,OAAO,qBAAC,YAAD;EAA8B;EAAY,WAAW,YAAY,KAAK;EAAuB;EAAoB,GAAI;EAAO,GAAI,oBAAoB,MAAa,YAAY,IAAI,GAAG,OAAK;EAAzL,UAAA;GACH,oBAAC,UAAD;IAAyB;IAU3B,aAAA;IAAmB;IAAO,SAAS;IAAsB;IACrD,UAAA,oBAAC,YAAD,EAAA,UACE,qBAAC,OAAD;KAAU,GAAI,MAAa,OAAO,KAAK;KAAvC,UAAA,CACE,oBAAC,WAAD;MAAc,GAAI,MAAa,cAAc,KAAK;MAC/C,UAAA;KACW,CAAA,GACd,oBAAC,QAAD;MAAW,cAAY;MAAc,WAAW;MAC9C,UAAA,oBAAC,eAAD,EAAe,GAAI,MAAa,OAAO,YAAY,EAAE,CAAA;KAC5C,CAAA,CACH;IACA,CAAA,EAAA,CAAA;GACJ,CAAA;GACV,oBAAC,cAAD;IAA2B;IAAoB;GAAM,CAAA;GACrD,oBAAC,SAAD;IAAY,GAAI,MAAa,QAAQ,OAAO,OAAO,OAAO;IACxD,UAAA,oBAAC,QAAD;KAAW,GAAI,MAAa,QAAQ,WAAW;KAC7C,UAAA,oBAAC,YAAD,EAAU,cAAY,MAAM,CAAA;IACnB,CAAA;GACD,CAAA;EACC;;AACnB"}
@@ -4,9 +4,9 @@ import { CalendarGlyph } from "../../glyphs/index.js";
4
4
  import { fieldStyles, invalidFrom, useFieldValidationBehavior } from "../../field/root.js";
5
5
  import { FieldBox, FieldMessage, FieldValue } from "../../field/index.js";
6
6
  import { overlay } from "../../styles/overlay.js";
7
+ import { picker, triggerClassName } from "../../styles/picker.js";
7
8
  import { segmentStyles } from "../../segments/styles.js";
8
9
  import { renderSegment } from "../../segments/index.js";
9
- import { picker, triggerClassName } from "../../styles/picker.js";
10
10
  import RangeCalendar$1 from "../range-calendar/index.js";
11
11
  import { jsx, jsxs } from "react/jsx-runtime";
12
12
  import { Button, DateInput, DateRangePicker, Dialog, Group, Popover } from "react-aria-components";
@@ -84,7 +84,10 @@ function DateRangePicker$1({ description, error, floatingLabel = true, isDisable
84
84
  }),
85
85
  /* @__PURE__ */ jsx(Popover, {
86
86
  ...props(overlay.popup, picker.popover),
87
- children: /* @__PURE__ */ jsx(Dialog, { children: /* @__PURE__ */ jsx(RangeCalendar$1, { "aria-label": label }) })
87
+ children: /* @__PURE__ */ jsx(Dialog, {
88
+ ...props(overlay.popupDialog),
89
+ children: /* @__PURE__ */ jsx(RangeCalendar$1, { "aria-label": label })
90
+ })
88
91
  })
89
92
  ]
90
93
  });
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../src/components/date-range-picker/index.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport type { DateValue, DateRangePickerProps as RACDateRangePickerProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { Button as RACButton, DateInput as RACDateInput, DateRangePicker as RACDateRangePicker, Dialog as RACDialog, Group as RACGroup, Popover as RACPopover } from 'react-aria-components';\nimport { FieldBox, FieldMessage, FieldValue } from '../../field';\nimport { fieldStyles, invalidFrom, useFieldValidationBehavior } from '../../field/root';\nimport { CalendarGlyph } from '../../glyphs';\nimport { renderSegment } from '../../segments';\nimport { segmentStyles } from '../../segments/styles';\nimport { mergeStatefulStyles } from '../../styles/merge';\nimport { overlay } from '../../styles/overlay';\nimport { picker, triggerClassName } from '../../styles/picker';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, typography } from '../../tokens/design.tokens.stylex';\nimport RangeCalendar from '../range-calendar';\n\n// `DatePicker` picking two dates rather than one. Every part it draws is\n// already here — the segments from `src/segments`, the trigger and the\n// overlay from `src/styles/picker`, the calendar from `RangeCalendar` — so\n// the two pickers cannot come apart. What a range adds is a second segment\n// group and the dash between them.\n//\n// The date pickers page draws a range as a configuration of the *modal*\n// picker: a full-screen selector with a header and two text fields, plus a\n// modal date input variant. It carries no docked range picker and no range\n// token of its own — its token set is `docked.*` and `modal.*`, and neither\n// names a range. So the docked shape here follows the docked single picker,\n// the same choice `RangeCalendar` records for the band it draws.\n//\n// Two things are this component's own.\n//\n// **The dash is decoration, not content.** It reads as a range to someone\n// looking, and React Aria has already told a screen reader which group is\n// which — every segment is named \"Start Date\" or \"End Date\" — so repeating\n// it aloud would be a third telling. It is `aria-hidden` and takes the muted\n// role, which is what keeps it quieter than the dates either side.\n//\n// **Both segment groups and the trigger sit in one React Aria `Group`.** The\n// box draws once around all three, so a reader tabs start, end, trigger\n// rather than meeting three controls in a row.\n\ntype DateRangePickerProps<T extends DateValue> = {\n /** A function may compute the class from the picker's render state. */\n className?: RACDateRangePickerProps<T>['className'];\n /** Supporting text under the field. */\n description?: string;\n /** The message shown instead of the description, which also marks the field invalid. */\n error?: string;\n /**\n * Whether the label floats into the box's top once the field holds a\n * value, rather than sitting above it.\n * @default true\n */\n floatingLabel?: boolean;\n /** What the field is for. Always rendered; never a placeholder. */\n label: string;\n /** An icon at the box's leading end. */\n leadingIcon?: ReactNode;\n /**\n * What is drawn between the two segment groups. Decoration — a screen\n * reader is told which group is which by React Aria.\n * @default '–'\n */\n separator?: string;\n /** A function may compute the style from the picker's render state. */\n style?: RACDateRangePickerProps<T>['style'];\n /**\n * What the button that opens the calendar is called, for a screen reader.\n * @default 'Choose a date range'\n */\n triggerLabel?: string;\n /**\n * Which of the text fields page's two boxes to draw.\n * @default 'filled'\n */\n variant?: 'filled' | 'outlined';\n} & Omit<RACDateRangePickerProps<T>, 'children' | 'className' | 'style'>;\n\n/**\n * A date range typed into a field, or picked from a calendar behind a\n * button. The value is React Aria's — pass `value` with `onChange` to\n * control it, or `defaultValue` — as a `{ start, end }` pair of\n * `@internationalized/date` values from this package's `./date` subpath.\n *\n * ```tsx\n * import { CalendarDate } from '@kanso-labs/kanso-ui/date'\n *\n * <DateRangePicker\n * defaultValue={{\n * end: new CalendarDate(2026, 9, 20),\n * start: new CalendarDate(2026, 9, 15),\n * }}\n * label=\"Label\"\n * />\n * ```\n *\n * The segments are `DateField`'s and the calendar is `RangeCalendar`, so\n * `granularity`, `minValue`, `maxValue` and `isDateUnavailable` all behave\n * as they do there. Above the medium breakpoint the calendar is docked to\n * the field; below it, it opens centred, the same swap `DatePicker` makes.\n *\n * The call site's `className` and `style` land on the picker as a whole,\n * which is the element a layout positions.\n */\nfunction DateRangePicker<T extends DateValue>({\n description,\n error,\n floatingLabel = true,\n isDisabled = false,\n label,\n leadingIcon,\n separator = '–',\n triggerLabel = 'Choose a date range',\n variant = 'filled',\n ...props\n}: DateRangePickerProps<T>) {\n const validationBehavior = useFieldValidationBehavior();\n return <RACDateRangePicker<T> isDisabled={isDisabled} isInvalid={invalidFrom(error)} validationBehavior={validationBehavior} {...props} {...mergeStatefulStyles(stylex.props(fieldStyles.root), props)}>\n <FieldBox floatingLabel={floatingLabel}\n // Always populated, which buys exactly one thing: the outlined\n // notch. The box decides populated twice over — in CSS for the\n // label's type, and in React for the notch, since CSS cannot cut an\n // outline to a width it has no way to measure. React Aria renders a\n // hidden input per segment group, neither carrying a placeholder, so\n // the CSS half reads as populated on its own; the React half reads\n // React Aria's input context, which a picker does not provide.\n // Without this the notch stays shut across segments already showing\n // `mm/dd/yyyy`.\n isPopulated label={label} leading={leadingIcon} variant={variant}>\n <FieldValue>\n <RACGroup {...stylex.props(picker.group)}>\n <RACDateInput slot=\"start\" {...stylex.props(segmentStyles.input)}>\n {renderSegment}\n </RACDateInput>\n <span aria-hidden=\"true\" className=\"x1w5n3ug x2lah0s x16svsjw x1848etk xh7dzej\">\n {separator}\n </span>\n <RACDateInput slot=\"end\" {...stylex.props(segmentStyles.input)}>\n {renderSegment}\n </RACDateInput>\n <RACButton aria-label={triggerLabel} className={triggerClassName}>\n <CalendarGlyph {...stylex.props(picker.triggerGlyph)} />\n </RACButton>\n </RACGroup>\n </FieldValue>\n </FieldBox>\n <FieldMessage description={description} error={error} />\n <RACPopover {...stylex.props(overlay.popup, picker.popover)}>\n <RACDialog>\n <RangeCalendar aria-label={label} />\n </RACDialog>\n </RACPopover>\n </RACDateRangePicker>;\n}\nexport type { DateRangePickerProps };\nexport default DateRangePicker;"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwGA,SAAS,kBAAqC,EAC5C,aACA,OACA,gBAAgB,MAChB,aAAa,OACb,OACA,aACA,YAAY,KACZ,eAAe,uBACf,UAAU,UACV,GAAG,WACuB;CAC1B,MAAM,qBAAqB,2BAA2B;CACtD,OAAO,qBAAC,iBAAD;EAAmC;EAAY,WAAW,YAAY,KAAK;EAAuB;EAAoB,GAAI;EAAO,GAAI,oBAAoB,MAAa,YAAY,IAAI,GAAG,OAAK;EAA9L,UAAA;GACH,oBAAC,UAAD;IAAyB;IAU3B,aAAA;IAAmB;IAAO,SAAS;IAAsB;IACrD,UAAA,oBAAC,YAAD,EAAA,UACE,qBAAC,OAAD;KAAU,GAAI,MAAa,OAAO,KAAK;KAAvC,UAAA;MACE,oBAAC,WAAD;OAAc,MAAK;OAAQ,GAAI,MAAa,cAAc,KAAK;OAC5D,UAAA;MACW,CAAA;MACd,oBAAC,QAAD;OAAM,eAAY;OAAO,WAAU;OAChC,UAAA;MACG,CAAA;MACN,oBAAC,WAAD;OAAc,MAAK;OAAM,GAAI,MAAa,cAAc,KAAK;OAC1D,UAAA;MACW,CAAA;MACd,oBAAC,QAAD;OAAW,cAAY;OAAc,WAAW;OAC9C,UAAA,oBAAC,eAAD,EAAe,GAAI,MAAa,OAAO,YAAY,EAAE,CAAA;MAC5C,CAAA;KACH;IACA,CAAA,EAAA,CAAA;GACJ,CAAA;GACV,oBAAC,cAAD;IAA2B;IAAoB;GAAM,CAAA;GACrD,oBAAC,SAAD;IAAY,GAAI,MAAa,QAAQ,OAAO,OAAO,OAAO;IACxD,UAAA,oBAAC,QAAD,EAAA,UACE,oBAAC,iBAAD,EAAe,cAAY,MAAM,CAAA,EACxB,CAAA;GACD,CAAA;EACM;;AACxB"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../src/components/date-range-picker/index.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport type { DateValue, DateRangePickerProps as RACDateRangePickerProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { Button as RACButton, DateInput as RACDateInput, DateRangePicker as RACDateRangePicker, Dialog as RACDialog, Group as RACGroup, Popover as RACPopover } from 'react-aria-components';\nimport { FieldBox, FieldMessage, FieldValue } from '../../field';\nimport { fieldStyles, invalidFrom, useFieldValidationBehavior } from '../../field/root';\nimport { CalendarGlyph } from '../../glyphs';\nimport { renderSegment } from '../../segments';\nimport { segmentStyles } from '../../segments/styles';\nimport { mergeStatefulStyles } from '../../styles/merge';\nimport { overlay } from '../../styles/overlay';\nimport { picker, triggerClassName } from '../../styles/picker';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, typography } from '../../tokens/design.tokens.stylex';\nimport RangeCalendar from '../range-calendar';\n\n// `DatePicker` picking two dates rather than one. Every part it draws is\n// already here — the segments from `src/segments`, the trigger and the\n// overlay from `src/styles/picker`, the calendar from `RangeCalendar` — so\n// the two pickers cannot come apart. What a range adds is a second segment\n// group and the dash between them.\n//\n// The date pickers page draws a range as a configuration of the *modal*\n// picker: a full-screen selector with a header and two text fields, plus a\n// modal date input variant. It carries no docked range picker and no range\n// token of its own — its token set is `docked.*` and `modal.*`, and neither\n// names a range. So the docked shape here follows the docked single picker,\n// the same choice `RangeCalendar` records for the band it draws.\n//\n// Two things are this component's own.\n//\n// **The dash is decoration, not content.** It reads as a range to someone\n// looking, and React Aria has already told a screen reader which group is\n// which — every segment is named \"Start Date\" or \"End Date\" — so repeating\n// it aloud would be a third telling. It is `aria-hidden` and takes the muted\n// role, which is what keeps it quieter than the dates either side.\n//\n// **Both segment groups and the trigger sit in one React Aria `Group`.** The\n// box draws once around all three, so a reader tabs start, end, trigger\n// rather than meeting three controls in a row.\n\ntype DateRangePickerProps<T extends DateValue> = {\n /** A function may compute the class from the picker's render state. */\n className?: RACDateRangePickerProps<T>['className'];\n /** Supporting text under the field. */\n description?: string;\n /** The message shown instead of the description, which also marks the field invalid. */\n error?: string;\n /**\n * Whether the label floats into the box's top once the field holds a\n * value, rather than sitting above it.\n * @default true\n */\n floatingLabel?: boolean;\n /** What the field is for. Always rendered; never a placeholder. */\n label: string;\n /** An icon at the box's leading end. */\n leadingIcon?: ReactNode;\n /**\n * What is drawn between the two segment groups. Decoration — a screen\n * reader is told which group is which by React Aria.\n * @default '–'\n */\n separator?: string;\n /** A function may compute the style from the picker's render state. */\n style?: RACDateRangePickerProps<T>['style'];\n /**\n * What the button that opens the calendar is called, for a screen reader.\n * @default 'Choose a date range'\n */\n triggerLabel?: string;\n /**\n * Which of the text fields page's two boxes to draw.\n * @default 'filled'\n */\n variant?: 'filled' | 'outlined';\n} & Omit<RACDateRangePickerProps<T>, 'children' | 'className' | 'style'>;\n\n/**\n * A date range typed into a field, or picked from a calendar behind a\n * button. The value is React Aria's — pass `value` with `onChange` to\n * control it, or `defaultValue` — as a `{ start, end }` pair of\n * `@internationalized/date` values from this package's `./date` subpath.\n *\n * ```tsx\n * import { CalendarDate } from '@kanso-labs/kanso-ui/date'\n *\n * <DateRangePicker\n * defaultValue={{\n * end: new CalendarDate(2026, 9, 20),\n * start: new CalendarDate(2026, 9, 15),\n * }}\n * label=\"Label\"\n * />\n * ```\n *\n * The segments are `DateField`'s and the calendar is `RangeCalendar`, so\n * `granularity`, `minValue`, `maxValue` and `isDateUnavailable` all behave\n * as they do there. Above the medium breakpoint the calendar is docked to\n * the field; below it, it opens centred, the same swap `DatePicker` makes.\n *\n * The call site's `className` and `style` land on the picker as a whole,\n * which is the element a layout positions.\n */\nfunction DateRangePicker<T extends DateValue>({\n description,\n error,\n floatingLabel = true,\n isDisabled = false,\n label,\n leadingIcon,\n separator = '–',\n triggerLabel = 'Choose a date range',\n variant = 'filled',\n ...props\n}: DateRangePickerProps<T>) {\n const validationBehavior = useFieldValidationBehavior();\n return <RACDateRangePicker<T> isDisabled={isDisabled} isInvalid={invalidFrom(error)} validationBehavior={validationBehavior} {...props} {...mergeStatefulStyles(stylex.props(fieldStyles.root), props)}>\n <FieldBox floatingLabel={floatingLabel}\n // Always populated, which buys exactly one thing: the outlined\n // notch. The box decides populated twice over — in CSS for the\n // label's type, and in React for the notch, since CSS cannot cut an\n // outline to a width it has no way to measure. React Aria renders a\n // hidden input per segment group, neither carrying a placeholder, so\n // the CSS half reads as populated on its own; the React half reads\n // React Aria's input context, which a picker does not provide.\n // Without this the notch stays shut across segments already showing\n // `mm/dd/yyyy`.\n isPopulated label={label} leading={leadingIcon} variant={variant}>\n <FieldValue>\n <RACGroup {...stylex.props(picker.group)}>\n <RACDateInput slot=\"start\" {...stylex.props(segmentStyles.input)}>\n {renderSegment}\n </RACDateInput>\n <span aria-hidden=\"true\" className=\"x1w5n3ug x2lah0s x16svsjw x1848etk xh7dzej\">\n {separator}\n </span>\n <RACDateInput slot=\"end\" {...stylex.props(segmentStyles.input)}>\n {renderSegment}\n </RACDateInput>\n <RACButton aria-label={triggerLabel} className={triggerClassName}>\n <CalendarGlyph {...stylex.props(picker.triggerGlyph)} />\n </RACButton>\n </RACGroup>\n </FieldValue>\n </FieldBox>\n <FieldMessage description={description} error={error} />\n <RACPopover {...stylex.props(overlay.popup, picker.popover)}>\n <RACDialog {...stylex.props(overlay.popupDialog)}>\n <RangeCalendar aria-label={label} />\n </RACDialog>\n </RACPopover>\n </RACDateRangePicker>;\n}\nexport type { DateRangePickerProps };\nexport default DateRangePicker;"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwGA,SAAS,kBAAqC,EAC5C,aACA,OACA,gBAAgB,MAChB,aAAa,OACb,OACA,aACA,YAAY,KACZ,eAAe,uBACf,UAAU,UACV,GAAG,WACuB;CAC1B,MAAM,qBAAqB,2BAA2B;CACtD,OAAO,qBAAC,iBAAD;EAAmC;EAAY,WAAW,YAAY,KAAK;EAAuB;EAAoB,GAAI;EAAO,GAAI,oBAAoB,MAAa,YAAY,IAAI,GAAG,OAAK;EAA9L,UAAA;GACH,oBAAC,UAAD;IAAyB;IAU3B,aAAA;IAAmB;IAAO,SAAS;IAAsB;IACrD,UAAA,oBAAC,YAAD,EAAA,UACE,qBAAC,OAAD;KAAU,GAAI,MAAa,OAAO,KAAK;KAAvC,UAAA;MACE,oBAAC,WAAD;OAAc,MAAK;OAAQ,GAAI,MAAa,cAAc,KAAK;OAC5D,UAAA;MACW,CAAA;MACd,oBAAC,QAAD;OAAM,eAAY;OAAO,WAAU;OAChC,UAAA;MACG,CAAA;MACN,oBAAC,WAAD;OAAc,MAAK;OAAM,GAAI,MAAa,cAAc,KAAK;OAC1D,UAAA;MACW,CAAA;MACd,oBAAC,QAAD;OAAW,cAAY;OAAc,WAAW;OAC9C,UAAA,oBAAC,eAAD,EAAe,GAAI,MAAa,OAAO,YAAY,EAAE,CAAA;MAC5C,CAAA;KACH;IACA,CAAA,EAAA,CAAA;GACJ,CAAA;GACV,oBAAC,cAAD;IAA2B;IAAoB;GAAM,CAAA;GACrD,oBAAC,SAAD;IAAY,GAAI,MAAa,QAAQ,OAAO,OAAO,OAAO;IACxD,UAAA,oBAAC,QAAD;KAAW,GAAI,MAAa,QAAQ,WAAW;KAC7C,UAAA,oBAAC,iBAAD,EAAe,cAAY,MAAM,CAAA;IACxB,CAAA;GACD,CAAA;EACM;;AACxB"}
@@ -11,9 +11,12 @@ import Chip, { ChipProps } from "./chip/index.js";
11
11
  import ChipGroup, { ChipGroupProps } from "./chip-group/index.js";
12
12
  import Code, { CodeProps } from "./code/index.js";
13
13
  import ColorArea, { ColorAreaProps } from "./color-area/index.js";
14
+ import ColorField, { ColorFieldProps } from "./color-field/index.js";
15
+ import ColorPicker, { ColorPickerProps } from "./color-picker/index.js";
14
16
  import ColorSlider, { ColorSliderProps } from "./color-slider/index.js";
15
17
  import ColorSwatch, { ColorSwatchProps } from "./color-swatch/index.js";
16
18
  import ColorSwatchPicker, { ColorSwatchPickerProps } from "./color-swatch-picker/index.js";
19
+ import ColorWheel, { ColorWheelProps } from "./color-wheel/index.js";
17
20
  import ComboBox, { ComboBoxProps } from "./combo-box/index.js";
18
21
  import Container, { ContainerProps } from "./container/index.js";
19
22
  import CopyField, { CopyFieldProps } from "./copy-field/index.js";
@@ -64,4 +67,4 @@ import TokenField, { TokenFieldProps } from "./token-field/index.js";
64
67
  import Toolbar, { ToolbarProps } from "./toolbar/index.js";
65
68
  import Tooltip, { TooltipProps } from "./tooltip/index.js";
66
69
  import Tree, { TreeHeaderProps, TreeItemProps, TreeLoadMoreProps, TreeProps, TreeSectionProps } from "./tree/index.js";
67
- export { AppBar, type AppBarProps, Autocomplete, type AutocompleteProps, Avatar, type AvatarProps, Breadcrumbs, type BreadcrumbsProps, Button, type ButtonProps, Calendar, type CalendarProps, Card, type CardProps, Checkbox, CheckboxGroup, type CheckboxGroupProps, type CheckboxProps, Chip, ChipGroup, type ChipGroupProps, type ChipProps, Code, type CodeProps, ColorArea, type ColorAreaProps, ColorSlider, type ColorSliderProps, ColorSwatch, ColorSwatchPicker, type ColorSwatchPickerProps, type ColorSwatchProps, ComboBox, type ComboBoxProps, Container, type ContainerProps, CopyField, type CopyFieldProps, Currency, type CurrencyProps, DateField, type DateFieldProps, DatePicker, type DatePickerProps, DateRangePicker, type DateRangePickerProps, Dialog, type DialogProps, Disclosure, DisclosureGroup, type DisclosureGroupProps, type DisclosureProps, DropZone, type DropZoneProps, Feed, type FeedProps, FileTrigger, type FileTriggerProps, Form, type FormProps, IconButton, type IconButtonProps, Keycap, type KeycapProps, Link, type LinkProps, List, ListBox, type ListBoxProps, ListDetail, type ListDetailProps, ListItem, type ListItemProps, type ListProps, Menu, type MenuProps, Meter, type MeterProps, NavigationTree, type NavigationTreeHeaderProps, type NavigationTreeItemProps, type NavigationTreeProps, type NavigationTreeSectionProps, NumberField, type NumberFieldProps, Popover, type PopoverProps, ProductIcon, type ProductIconProps, ProgressIndicator, type ProgressIndicatorProps, Radio, RadioGroup, type RadioGroupProps, type RadioProps, RangeCalendar, type RangeCalendarProps, SearchField, type SearchFieldProps, SegmentedButton, type SegmentedButtonProps, type SegmentedButtonSegmentProps, Select, type SelectProps, Separator, type SeparatorProps, Sheet, type SheetProps, Slider, type SliderProps, Snackbar, type SnackbarProps, Stack, type StackAlign, type StackGap, type StackJustify, type StackProps, SupportingPane, type SupportingPaneProps, Switch, type SwitchProps, Table, type TableBodyProps, type TableCellProps, type TableColumnProps, type TableFooterProps, type TableHeaderProps, type TableProps, type TableRowProps, Tabs, type TabsProps, Tag, type TagProps, Text, TextArea, type TextAreaProps, TextField, type TextFieldProps, type TextProps, TimeField, type TimeFieldProps, TokenField, type TokenFieldProps, Toolbar, type ToolbarProps, Tooltip, type TooltipProps, Tree, type TreeHeaderProps, type TreeItemProps, type TreeLoadMoreProps, type TreeProps, type TreeSectionProps };
70
+ export { AppBar, type AppBarProps, Autocomplete, type AutocompleteProps, Avatar, type AvatarProps, Breadcrumbs, type BreadcrumbsProps, Button, type ButtonProps, Calendar, type CalendarProps, Card, type CardProps, Checkbox, CheckboxGroup, type CheckboxGroupProps, type CheckboxProps, Chip, ChipGroup, type ChipGroupProps, type ChipProps, Code, type CodeProps, ColorArea, type ColorAreaProps, ColorField, type ColorFieldProps, ColorPicker, type ColorPickerProps, ColorSlider, type ColorSliderProps, ColorSwatch, ColorSwatchPicker, type ColorSwatchPickerProps, type ColorSwatchProps, ColorWheel, type ColorWheelProps, ComboBox, type ComboBoxProps, Container, type ContainerProps, CopyField, type CopyFieldProps, Currency, type CurrencyProps, DateField, type DateFieldProps, DatePicker, type DatePickerProps, DateRangePicker, type DateRangePickerProps, Dialog, type DialogProps, Disclosure, DisclosureGroup, type DisclosureGroupProps, type DisclosureProps, DropZone, type DropZoneProps, Feed, type FeedProps, FileTrigger, type FileTriggerProps, Form, type FormProps, IconButton, type IconButtonProps, Keycap, type KeycapProps, Link, type LinkProps, List, ListBox, type ListBoxProps, ListDetail, type ListDetailProps, ListItem, type ListItemProps, type ListProps, Menu, type MenuProps, Meter, type MeterProps, NavigationTree, type NavigationTreeHeaderProps, type NavigationTreeItemProps, type NavigationTreeProps, type NavigationTreeSectionProps, NumberField, type NumberFieldProps, Popover, type PopoverProps, ProductIcon, type ProductIconProps, ProgressIndicator, type ProgressIndicatorProps, Radio, RadioGroup, type RadioGroupProps, type RadioProps, RangeCalendar, type RangeCalendarProps, SearchField, type SearchFieldProps, SegmentedButton, type SegmentedButtonProps, type SegmentedButtonSegmentProps, Select, type SelectProps, Separator, type SeparatorProps, Sheet, type SheetProps, Slider, type SliderProps, Snackbar, type SnackbarProps, Stack, type StackAlign, type StackGap, type StackJustify, type StackProps, SupportingPane, type SupportingPaneProps, Switch, type SwitchProps, Table, type TableBodyProps, type TableCellProps, type TableColumnProps, type TableFooterProps, type TableHeaderProps, type TableProps, type TableRowProps, Tabs, type TabsProps, Tag, type TagProps, Text, TextArea, type TextAreaProps, TextField, type TextFieldProps, type TextProps, TimeField, type TimeFieldProps, TokenField, type TokenFieldProps, Toolbar, type ToolbarProps, Tooltip, type TooltipProps, Tree, type TreeHeaderProps, type TreeItemProps, type TreeLoadMoreProps, type TreeProps, type TreeSectionProps };
@@ -1,19 +1,16 @@
1
1
  import { mergeStatefulStyles } from "../../styles/merge.js";
2
2
  import { createContext, useContext, useEffect, useState } from "react";
3
- import { jsx } from "react/jsx-runtime";
3
+ import { jsx, jsxs } from "react/jsx-runtime";
4
4
  import { c } from "react/compiler-runtime";
5
- import { Tab, TabList, TabPanel, Tabs } from "react-aria-components";
5
+ import { SelectionIndicator, Tab, TabList, TabPanel, Tabs } from "react-aria-components";
6
6
  //#region src/components/tabs/index.tsx
7
7
  const NO_PANELS = /* @__PURE__ */ new Set();
8
8
  const PanelsContext = createContext(NO_PANELS);
9
9
  const RegisterPanelContext = createContext(() => () => {});
10
10
  function tabContent(children) {
11
- return (state) => /* @__PURE__ */ jsx("span", {
12
- ...{
13
- 0: { className: "x6s0dn4 x5yr21d x9f619 x3nfvp2 x1n2onr6" },
14
- 1: { className: "x6s0dn4 x5yr21d x9f619 x3nfvp2 x1n2onr6 x1al0t14 xar2jh8 x7ap8th x1rrmwk0 x1s928wv x1lzipow x1xrz1ek xb7ltuz xr7aocx x1mcsf00 x1j6awrg" }
15
- }[!!state.isSelected << 0],
16
- children: typeof children === "function" ? children(state) : children
11
+ return (state) => /* @__PURE__ */ jsxs("span", {
12
+ className: "x6s0dn4 x5yr21d x9f619 x3nfvp2 x1n2onr6",
13
+ children: [typeof children === "function" ? children(state) : children, /* @__PURE__ */ jsx(SelectionIndicator, { className: "x12w9bfk xnety89 xuoj239 x13dhofw xz4iguh x9f619 x17v02zk x1ey2m1c x17y0mx6 xvueqy4 xnei2rj x10l6tqk xioksi3 x1mxbss1 x1seskgd" })]
17
14
  });
18
15
  }
19
16
  function tabRenderer(hasPanel, render) {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["previous","next","register","panels","children"],"sources":["../../../src/components/tabs/index.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport type { Key, TabsProps as RACTabsProps, TabListProps, TabPanelProps, TabProps, TabRenderProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { createContext, useCallback, useContext, useEffect, useState } from 'react';\nimport { Tabs as RACTabs, Tab, TabList, TabPanel } from 'react-aria-components';\nimport { mergeStatefulStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, motion, radii, spacing, stateLayerOpacity, typography } from '../../tokens/design.tokens.stylex';\n\n// The tabs page's primary tabs: a 48dp bar on the surface, divided into equal\n// sections, with a 1dp outline-variant divider inside the bar along its\n// bottom edge and, under the active tab's label, a 3dp primary indicator\n// rounded along its top. The indicator follows the label rather than the\n// tab, inset 2dp from the label's ends and never shorter than 24dp, which is\n// what the page draws.\n//\n// The label is wrapped in a span of its own so the indicator has the label's\n// width to follow: it is the span's `::after`, and the span is as tall as the\n// tab so the indicator reaches the bottom of the bar. Which tab carries it\n// comes from React Aria's render state rather than a selector, since StyleX\n// cannot target [data-selected] on the element it is styling.\n\nconst NO_PANELS: ReadonlySet<Key> = new Set();\n\n// Which panels are mounted, by id. React Aria points a selected tab's\n// `aria-controls` at the panel it would control whether or not one exists,\n// and a strip used on its own — tabs that filter the content below rather\n// than swapping a panel — then references an id nothing carries, which axe\n// reports as an invalid attribute value. Each panel registers itself here so\n// a tab can leave the attribute off when its panel is not there.\nconst PanelsContext = createContext<ReadonlySet<Key>>(NO_PANELS);\nconst RegisterPanelContext = createContext<(id: Key) => () => void>(() => () => {});\n\n// `children` is narrowed to nodes. React Aria also accepts a function there,\n// to hand the children the tabs' render state, and that form cannot be\n// wrapped in a context provider without calling it first — which would be\n// doing React Aria's job with none of its state. Nothing here needs it, so\n// the narrower type says so rather than leaving a signature that type-checks\n// and then fails to render.\ntype TabsProps = Omit<RACTabsProps, 'children'> & {\n children?: ReactNode;\n};\n\n// The label, wrapped so the indicator has its width to follow. Built by a\n// call for the same reason as `tabRenderer` below; React Aria hands the\n// function the tab's state, and it is passed on when the children are a\n// function too.\nfunction tabContent(children: TabProps['children']) {\n return (state: TabRenderProps & {\n defaultChildren: ReactNode;\n }) => <span {...{\n 0: {\n className: \"x6s0dn4 x5yr21d x9f619 x3nfvp2 x1n2onr6\"\n },\n 1: {\n className: \"x6s0dn4 x5yr21d x9f619 x3nfvp2 x1n2onr6 x1al0t14 xar2jh8 x7ap8th x1rrmwk0 x1s928wv x1lzipow x1xrz1ek xb7ltuz xr7aocx x1mcsf00 x1j6awrg\"\n }\n }[!!state.isSelected << 0]}>\n {typeof children === 'function' ? children(state) : children}\n </span>;\n}\n\n// React Aria renders a tab with `href` as an anchor and any other as a div,\n// and expects a `render` function to return the same element it would have.\n// Built by a call rather than written inline at the prop, which is what\n// react-perf's no-new-function-as-prop is after; the React Compiler memoises\n// the result on its two inputs. See PanelsContext for why the attribute is\n// dropped.\nfunction tabRenderer(hasPanel: boolean, render: TabProps['render']): NonNullable<TabProps['render']> {\n return (domProps, state) => {\n const adjusted = hasPanel ? domProps : {\n ...domProps,\n 'aria-controls': undefined\n };\n if (render !== undefined) {\n return render(adjusted, state);\n }\n if ('href' in adjusted) {\n // oxlint-disable-next-line jsx-a11y/anchor-has-content -- filled by React Aria\n return <a {...adjusted} />;\n }\n return <div {...adjusted} />;\n };\n}\n\n/**\n * A tab bar and its panels. Selection is React Aria's `selectedKey`: pass\n * it with `onSelectionChange` to control it, or `defaultSelectedKey` to let\n * it keep its own. Each `Tabs.Tab` names the `Tabs.Panel` it controls through\n * a shared `id`, and a strip may stand alone without panels.\n *\n * Composed rather than configured by props, because the number of tabs and\n * what each panel holds are the call site's to decide — the parts are\n * `Tabs.List`, `Tabs.Tab`, and `Tabs.Panel`.\n */\nfunction Tabs({\n children,\n ...props\n}: TabsProps) {\n const [panels, setPanels] = useState<ReadonlySet<Key>>(NO_PANELS);\n const register = useCallback((id: Key) => {\n setPanels(previous => {\n if (previous.has(id)) {\n return previous;\n }\n const next = new Set(previous);\n next.add(id);\n return next;\n });\n return () => {\n setPanels(previous => {\n if (!previous.has(id)) {\n return previous;\n }\n const next = new Set(previous);\n next.delete(id);\n return next;\n });\n };\n }, []);\n return <RACTabs {...props}>\n <RegisterPanelContext value={register}>\n <PanelsContext value={panels}>{children}</PanelsContext>\n </RegisterPanelContext>\n </RACTabs>;\n}\nfunction TabsList(props: TabsListProps) {\n return <TabList {...props} {...mergeStatefulStyles({\n className: \"xp05xdj x9f619 x78zum5\"\n }, props)} />;\n}\nfunction TabsPanel(props: TabsPanelProps) {\n const register = useContext(RegisterPanelContext);\n const {\n id\n } = props;\n useEffect(() => {\n if (id === undefined) {\n return undefined;\n }\n return register(id);\n }, [id, register]);\n return <TabPanel {...props} {...mergeStatefulStyles({\n className: \"x9f619 xrgy624 x1hl8ikr x9v5kkp x1t137rt x1de99jn\"\n }, props)} />;\n}\nfunction TabsTab({\n children,\n render,\n ...props\n}: TabsTabProps) {\n const panels = useContext(PanelsContext);\n const hasPanel = props.id !== undefined && panels.has(props.id);\n return <Tab {...props} render={tabRenderer(hasPanel, render)} {...mergeStatefulStyles(tabStyles, props)}>\n {tabContent(children)}\n </Tab>;\n}\n\n// StyleX cannot target [data-selected] on the element it is styling, so the\n// active tab cannot be chosen in CSS. React Aria's answer is a className that\n// is a function of the tab's own state, the same mechanism Chip uses —\n// mergeStatefulStyles wraps this one so a tab still keeps a className the call\n// site passed.\nfunction tabStyles(state: TabRenderProps) {\n return {\n 0: {\n className: \"x6s0dn4 xsdox4t xc342km x9f619 x1ypdohk x78zum5 x1r8uery x1iyjqo2 xs83m0k xrgwony x12s497w x1szcwkt xl56j7k xo803ec xyl1r0q xeuugli xrgy624 x2ssjo2 x9v5kkp x1t137rt x1de99jn xt970qd x790zyz x1n2onr6 x1hl2dhg x1qno0dh xs2xxs2 xpc4ca7 x12vej0r x1p2om7n xjbqb8w x1w5n3ug\"\n },\n 2: {\n className: \"x6s0dn4 xsdox4t xc342km x9f619 x1ypdohk x78zum5 x1r8uery x1iyjqo2 xs83m0k xrgwony x12s497w x1szcwkt xl56j7k xo803ec xyl1r0q xeuugli xrgy624 x2ssjo2 x9v5kkp x1t137rt x1de99jn xt970qd x790zyz x1n2onr6 x1hl2dhg x1qno0dh xs2xxs2 xpc4ca7 x12vej0r x14dcer4 xjbqb8w x1mxwv8y\"\n },\n 1: {\n className: \"x6s0dn4 xsdox4t xc342km x9f619 x78zum5 x1r8uery x1iyjqo2 xs83m0k xrgwony x12s497w x1szcwkt xl56j7k xo803ec xyl1r0q xeuugli xrgy624 x2ssjo2 x9v5kkp x1t137rt x1de99jn xt970qd x790zyz x1n2onr6 x1hl2dhg x1qno0dh xs2xxs2 xpc4ca7 xjbqb8w x1xj74d8 x1h6gzvc\"\n },\n 3: {\n className: \"x6s0dn4 xsdox4t xc342km x9f619 x78zum5 x1r8uery x1iyjqo2 xs83m0k xrgwony x12s497w x1szcwkt xl56j7k xo803ec xyl1r0q xeuugli xrgy624 x2ssjo2 x9v5kkp x1t137rt x1de99jn xt970qd x790zyz x1n2onr6 x1hl2dhg x1qno0dh xs2xxs2 xpc4ca7 xjbqb8w x1xj74d8 x1h6gzvc\"\n }\n }[!!state.isSelected << 1 | !!state.isDisabled << 0];\n}\nTabs.List = TabsList;\nTabs.Panel = TabsPanel;\nTabs.Tab = TabsTab;\ntype TabsListProps = TabListProps<object>;\ntype TabsPanelProps = TabPanelProps;\ntype TabsTabProps = TabProps;\nexport type { TabsListProps, TabsPanelProps, TabsProps, TabsTabProps };\nexport default Tabs;"],"mappings":";;;;;;AAsBA,MAAM,4BAA8B,IAAI,IAAI;AAQ5C,MAAM,gBAAgB,cAAgC,SAAS;AAC/D,MAAM,uBAAuB,0BAAmD,CAAC,CAAC;AAgBlF,SAAS,WAAW,UAAgC;CAClD,QAAQ,UAEF,oBAAC,QAAD;EAAM,GAAI;GACd,GAAG,EACD,WAAW,0CACb;GACA,GAAG,EACD,WAAW,yIACb;EACF,EAAE,CAAC,CAAC,MAAM,cAAc;EACnB,UAAA,OAAO,aAAa,aAAa,SAAS,KAAK,IAAI;CAChD,CAAA;AACV;AAQA,SAAS,YAAY,UAAmB,QAA6D;CACnG,QAAQ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CAAC,CAAC,MAAM,cAAc;AACpD;AACA,OAAK,OAAO;AACZ,OAAK,QAAQ;AACb,OAAK,MAAM"}
1
+ {"version":3,"file":"index.js","names":["previous","next","register","panels","children"],"sources":["../../../src/components/tabs/index.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport type { Key, TabsProps as RACTabsProps, TabListProps, TabPanelProps, TabProps, TabRenderProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { createContext, useCallback, useContext, useEffect, useState } from 'react';\nimport { SelectionIndicator as RACSelectionIndicator, Tabs as RACTabs, Tab, TabList, TabPanel } from 'react-aria-components';\nimport { mergeStatefulStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, motion, radii, spacing, stateLayerOpacity, typography } from '../../tokens/design.tokens.stylex';\n\n// The tabs page's primary tabs: a 48dp bar on the surface, divided into equal\n// sections, with a 1dp outline-variant divider inside the bar along its\n// bottom edge and, under the active tab's label, a 3dp primary indicator\n// rounded along its top. The indicator follows the label rather than the\n// tab, inset 2dp from the label's ends and never shorter than 24dp, which is\n// what the page draws.\n//\n// The indicator is React Aria's `SelectionIndicator`, which is a shared\n// element: it is rendered inside every tab but drawn in the selected one,\n// and on a change it keeps the old one until it has finished moving to the\n// new one's place. No `SharedElementTransition` is rendered here — `Tab`\n// scopes its own, and one added around the list changes nothing, which is\n// worth knowing because the primitive throws outside a scope when it is put\n// anywhere else.\n//\n// The label is wrapped in a span of its own so the indicator has the label's\n// width to follow: it is the span's `::after`, and the span is as tall as the\n// tab so the indicator reaches the bottom of the bar. Which tab carries it\n// comes from React Aria's render state rather than a selector, since StyleX\n// cannot target [data-selected] on the element it is styling.\n\nconst NO_PANELS: ReadonlySet<Key> = new Set();\n\n// Which panels are mounted, by id. React Aria points a selected tab's\n// `aria-controls` at the panel it would control whether or not one exists,\n// and a strip used on its own — tabs that filter the content below rather\n// than swapping a panel — then references an id nothing carries, which axe\n// reports as an invalid attribute value. Each panel registers itself here so\n// a tab can leave the attribute off when its panel is not there.\nconst PanelsContext = createContext<ReadonlySet<Key>>(NO_PANELS);\nconst RegisterPanelContext = createContext<(id: Key) => () => void>(() => () => {});\n\n// `children` is narrowed to nodes. React Aria also accepts a function there,\n// to hand the children the tabs' render state, and that form cannot be\n// wrapped in a context provider without calling it first — which would be\n// doing React Aria's job with none of its state. Nothing here needs it, so\n// the narrower type says so rather than leaving a signature that type-checks\n// and then fails to render.\ntype TabsProps = Omit<RACTabsProps, 'children'> & {\n children?: ReactNode;\n};\n\n// The label, wrapped so the indicator has its width to follow. Built by a\n// call for the same reason as `tabRenderer` below; React Aria hands the\n// function the tab's state, and it is passed on when the children are a\n// function too.\nfunction tabContent(children: TabProps['children']) {\n return (state: TabRenderProps & {\n defaultChildren: ReactNode;\n }) => <span className=\"x6s0dn4 x5yr21d x9f619 x3nfvp2 x1n2onr6\">\n {typeof children === 'function' ? children(state) : children}\n <RACSelectionIndicator className=\"x12w9bfk xnety89 xuoj239 x13dhofw xz4iguh x9f619 x17v02zk x1ey2m1c x17y0mx6 xvueqy4 xnei2rj x10l6tqk xioksi3 x1mxbss1 x1seskgd\" />\n </span>;\n}\n\n// React Aria renders a tab with `href` as an anchor and any other as a div,\n// and expects a `render` function to return the same element it would have.\n// Built by a call rather than written inline at the prop, which is what\n// react-perf's no-new-function-as-prop is after; the React Compiler memoises\n// the result on its two inputs. See PanelsContext for why the attribute is\n// dropped.\nfunction tabRenderer(hasPanel: boolean, render: TabProps['render']): NonNullable<TabProps['render']> {\n return (domProps, state) => {\n const adjusted = hasPanel ? domProps : {\n ...domProps,\n 'aria-controls': undefined\n };\n if (render !== undefined) {\n return render(adjusted, state);\n }\n if ('href' in adjusted) {\n // oxlint-disable-next-line jsx-a11y/anchor-has-content -- filled by React Aria\n return <a {...adjusted} />;\n }\n return <div {...adjusted} />;\n };\n}\n\n/**\n * A tab bar and its panels. Selection is React Aria's `selectedKey`: pass\n * it with `onSelectionChange` to control it, or `defaultSelectedKey` to let\n * it keep its own. Each `Tabs.Tab` names the `Tabs.Panel` it controls through\n * a shared `id`, and a strip may stand alone without panels.\n *\n * Composed rather than configured by props, because the number of tabs and\n * what each panel holds are the call site's to decide — the parts are\n * `Tabs.List`, `Tabs.Tab`, and `Tabs.Panel`.\n */\nfunction Tabs({\n children,\n ...props\n}: TabsProps) {\n const [panels, setPanels] = useState<ReadonlySet<Key>>(NO_PANELS);\n const register = useCallback((id: Key) => {\n setPanels(previous => {\n if (previous.has(id)) {\n return previous;\n }\n const next = new Set(previous);\n next.add(id);\n return next;\n });\n return () => {\n setPanels(previous => {\n if (!previous.has(id)) {\n return previous;\n }\n const next = new Set(previous);\n next.delete(id);\n return next;\n });\n };\n }, []);\n return <RACTabs {...props}>\n <RegisterPanelContext value={register}>\n <PanelsContext value={panels}>{children}</PanelsContext>\n </RegisterPanelContext>\n </RACTabs>;\n}\nfunction TabsList(props: TabsListProps) {\n return <TabList {...props} {...mergeStatefulStyles({\n className: \"xp05xdj x9f619 x78zum5\"\n }, props)} />;\n}\nfunction TabsPanel(props: TabsPanelProps) {\n const register = useContext(RegisterPanelContext);\n const {\n id\n } = props;\n useEffect(() => {\n if (id === undefined) {\n return undefined;\n }\n return register(id);\n }, [id, register]);\n return <TabPanel {...props} {...mergeStatefulStyles({\n className: \"x9f619 xrgy624 x1hl8ikr x9v5kkp x1t137rt x1de99jn\"\n }, props)} />;\n}\nfunction TabsTab({\n children,\n render,\n ...props\n}: TabsTabProps) {\n const panels = useContext(PanelsContext);\n const hasPanel = props.id !== undefined && panels.has(props.id);\n return <Tab {...props} render={tabRenderer(hasPanel, render)} {...mergeStatefulStyles(tabStyles, props)}>\n {tabContent(children)}\n </Tab>;\n}\n\n// StyleX cannot target [data-selected] on the element it is styling, so the\n// active tab cannot be chosen in CSS. React Aria's answer is a className that\n// is a function of the tab's own state, the same mechanism Chip uses —\n// mergeStatefulStyles wraps this one so a tab still keeps a className the call\n// site passed.\nfunction tabStyles(state: TabRenderProps) {\n return {\n 0: {\n className: \"x6s0dn4 xsdox4t xc342km x9f619 x1ypdohk x78zum5 x1r8uery x1iyjqo2 xs83m0k xrgwony x12s497w x1szcwkt xl56j7k xo803ec xyl1r0q xeuugli xrgy624 x2ssjo2 x9v5kkp x1t137rt x1de99jn xt970qd x790zyz x1n2onr6 x1hl2dhg x1qno0dh xs2xxs2 xpc4ca7 x12vej0r x1p2om7n xjbqb8w x1w5n3ug\"\n },\n 2: {\n className: \"x6s0dn4 xsdox4t xc342km x9f619 x1ypdohk x78zum5 x1r8uery x1iyjqo2 xs83m0k xrgwony x12s497w x1szcwkt xl56j7k xo803ec xyl1r0q xeuugli xrgy624 x2ssjo2 x9v5kkp x1t137rt x1de99jn xt970qd x790zyz x1n2onr6 x1hl2dhg x1qno0dh xs2xxs2 xpc4ca7 x12vej0r x14dcer4 xjbqb8w x1mxwv8y\"\n },\n 1: {\n className: \"x6s0dn4 xsdox4t xc342km x9f619 x78zum5 x1r8uery x1iyjqo2 xs83m0k xrgwony x12s497w x1szcwkt xl56j7k xo803ec xyl1r0q xeuugli xrgy624 x2ssjo2 x9v5kkp x1t137rt x1de99jn xt970qd x790zyz x1n2onr6 x1hl2dhg x1qno0dh xs2xxs2 xpc4ca7 xjbqb8w x1xj74d8 x1h6gzvc\"\n },\n 3: {\n className: \"x6s0dn4 xsdox4t xc342km x9f619 x78zum5 x1r8uery x1iyjqo2 xs83m0k xrgwony x12s497w x1szcwkt xl56j7k xo803ec xyl1r0q xeuugli xrgy624 x2ssjo2 x9v5kkp x1t137rt x1de99jn xt970qd x790zyz x1n2onr6 x1hl2dhg x1qno0dh xs2xxs2 xpc4ca7 xjbqb8w x1xj74d8 x1h6gzvc\"\n }\n }[!!state.isSelected << 1 | !!state.isDisabled << 0];\n}\nTabs.List = TabsList;\nTabs.Panel = TabsPanel;\nTabs.Tab = TabsTab;\ntype TabsListProps = TabListProps<object>;\ntype TabsPanelProps = TabPanelProps;\ntype TabsTabProps = TabProps;\nexport type { TabsListProps, TabsPanelProps,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AAe,QAAA;GAA6B,GAAM;GAC7D,UAAA;EADM,CAAA;EAEH,EAAA,KAAA;EAAA,EAAA,KAAA;EAAA,EAAA,KAAA;EAAA,EAAA,KAAA;EAAA,EAAA,KAAA;EAAA,EAAA,KAAA;CAAA,OAAA,KAAA,EAAA;CAAA,OAFD;AAEC;AAQV,SAAS,UAAU,OAAuB;CACxC,OAAO;EACL,GAAG,EACD,WAAW,8QACb;EACA,GAAG,EACD,WAAW,8QACb;EACA,GAAG,EACD,WAAW,4PACb;EACA,GAAG,EACD,WAAW,4PACb;CACF,EAAE,CAAC,CAAC,MAAM,cAAc,IAAI,CAAC,CAAC,MAAM,cAAc;AACpD;AACA,OAAK,OAAO;AACZ,OAAK,QAAQ;AACb,OAAK,MAAM"}
package/dist/index.d.ts CHANGED
@@ -11,9 +11,12 @@ import Chip, { ChipProps } from "./components/chip/index.js";
11
11
  import ChipGroup, { ChipGroupProps } from "./components/chip-group/index.js";
12
12
  import Code, { CodeProps } from "./components/code/index.js";
13
13
  import ColorArea, { ColorAreaProps } from "./components/color-area/index.js";
14
+ import ColorField, { ColorFieldProps } from "./components/color-field/index.js";
15
+ import ColorPicker, { ColorPickerProps } from "./components/color-picker/index.js";
14
16
  import ColorSlider, { ColorSliderProps } from "./components/color-slider/index.js";
15
17
  import ColorSwatch, { ColorSwatchProps } from "./components/color-swatch/index.js";
16
18
  import ColorSwatchPicker, { ColorSwatchPickerProps } from "./components/color-swatch-picker/index.js";
19
+ import ColorWheel, { ColorWheelProps } from "./components/color-wheel/index.js";
17
20
  import ComboBox, { ComboBoxProps } from "./components/combo-box/index.js";
18
21
  import Container, { ContainerProps } from "./components/container/index.js";
19
22
  import CopyField, { CopyFieldProps } from "./components/copy-field/index.js";
@@ -69,4 +72,4 @@ import { collectionSizes } from "./layout.js";
69
72
  import { useDragAndDrop } from "./drag/hooks.js";
70
73
  import { Collection, DIRECTORY_DRAG_TYPE, Focusable, GridLayout, I18nProvider, Key, ListLayout, PressEvent, Pressable, RouterProvider, Selection, SortDescriptor, TableLayout, TokenFieldValue, Virtualizer, VisuallyHidden, WaterfallLayout, getColorChannels, isDirectoryDropItem, isFileDropItem, isTextDropItem, parseColor, useAsyncList, useDrag, useDrop, useFilter, useListData, useLocale, useTreeData } from "./react-aria.js";
71
74
  import "./styles.css";
72
- export { AppBar, type AppBarProps, Autocomplete, type AutocompleteProps, Avatar, type AvatarProps, Breadcrumbs, type BreadcrumbsProps, Button, type ButtonProps, Calendar, type CalendarProps, Card, type CardProps, Checkbox, CheckboxGroup, type CheckboxGroupProps, type CheckboxProps, Chip, ChipGroup, type ChipGroupProps, type ChipProps, Code, type CodeProps, Collection, ColorArea, type ColorAreaProps, ColorSlider, type ColorSliderProps, ColorSwatch, ColorSwatchPicker, type ColorSwatchPickerProps, type ColorSwatchProps, ComboBox, type ComboBoxProps, Container, type ContainerProps, CopyField, type CopyFieldProps, Currency, type CurrencyProps, DIRECTORY_DRAG_TYPE, DateField, type DateFieldProps, DatePicker, type DatePickerProps, DateRangePicker, type DateRangePickerProps, Dialog, type DialogProps, Disclosure, DisclosureGroup, type DisclosureGroupProps, type DisclosureProps, DropZone, type DropZoneProps, Feed, type FeedProps, FileTrigger, type FileTriggerProps, Focusable, Form, type FormProps, GridLayout, I18nProvider, IconButton, type IconButtonProps, type Key, Keycap, type KeycapProps, Link, type LinkProps, List, ListBox, type ListBoxProps, ListDetail, type ListDetailProps, ListItem, type ListItemProps, ListLayout, type ListProps, Menu, type MenuProps, Meter, type MeterProps, NavigationTree, type NavigationTreeHeaderProps, type NavigationTreeItemProps, type NavigationTreeProps, type NavigationTreeSectionProps, NumberField, type NumberFieldProps, Popover, type PopoverProps, type PressEvent, Pressable, ProductIcon, type ProductIconProps, ProgressIndicator, type ProgressIndicatorProps, Radio, RadioGroup, type RadioGroupProps, type RadioProps, RangeCalendar, type RangeCalendarProps, RouterProvider, SearchField, type SearchFieldProps, SegmentedButton, type SegmentedButtonProps, type SegmentedButtonSegmentProps, Select, type SelectProps, type Selection, Separator, type SeparatorProps, Sheet, type SheetProps, Slider, type SliderProps, Snackbar, type SnackbarProps, type SortDescriptor, Stack, type StackAlign, type StackGap, type StackJustify, type StackProps, SupportingPane, type SupportingPaneProps, Switch, type SwitchProps, Table, type TableBodyProps, type TableCellProps, type TableColumnProps, type TableFooterProps, type TableHeaderProps, TableLayout, type TableProps, type TableRowProps, Tabs, type TabsProps, Tag, type TagProps, Text, TextArea, type TextAreaProps, TextField, type TextFieldProps, type TextProps, TimeField, type TimeFieldProps, TokenField, type TokenFieldProps, TokenFieldValue, Toolbar, type ToolbarProps, Tooltip, type TooltipProps, Tree, type TreeHeaderProps, type TreeItemProps, type TreeLoadMoreProps, type TreeProps, type TreeSectionProps, Virtualizer, VisuallyHidden, WaterfallLayout, collectionSizes, getColorChannels, isDirectoryDropItem, isFileDropItem, isTextDropItem, parseColor, useAsyncList, useDrag, useDragAndDrop, useDrop, useFilter, useListData, useLocale, useTreeData };
75
+ export { AppBar, type AppBarProps, Autocomplete, type AutocompleteProps, Avatar, type AvatarProps, Breadcrumbs, type BreadcrumbsProps, Button, type ButtonProps, Calendar, type CalendarProps, Card, type CardProps, Checkbox, CheckboxGroup, type CheckboxGroupProps, type CheckboxProps, Chip, ChipGroup, type ChipGroupProps, type ChipProps, Code, type CodeProps, Collection, ColorArea, type ColorAreaProps, ColorField, type ColorFieldProps, ColorPicker, type ColorPickerProps, ColorSlider, type ColorSliderProps, ColorSwatch, ColorSwatchPicker, type ColorSwatchPickerProps, type ColorSwatchProps, ColorWheel, type ColorWheelProps, ComboBox, type ComboBoxProps, Container, type ContainerProps, CopyField, type CopyFieldProps, Currency, type CurrencyProps, DIRECTORY_DRAG_TYPE, DateField, type DateFieldProps, DatePicker, type DatePickerProps, DateRangePicker, type DateRangePickerProps, Dialog, type DialogProps, Disclosure, DisclosureGroup, type DisclosureGroupProps, type DisclosureProps, DropZone, type DropZoneProps, Feed, type FeedProps, FileTrigger, type FileTriggerProps, Focusable, Form, type FormProps, GridLayout, I18nProvider, IconButton, type IconButtonProps, type Key, Keycap, type KeycapProps, Link, type LinkProps, List, ListBox, type ListBoxProps, ListDetail, type ListDetailProps, ListItem, type ListItemProps, ListLayout, type ListProps, Menu, type MenuProps, Meter, type MeterProps, NavigationTree, type NavigationTreeHeaderProps, type NavigationTreeItemProps, type NavigationTreeProps, type NavigationTreeSectionProps, NumberField, type NumberFieldProps, Popover, type PopoverProps, type PressEvent, Pressable, ProductIcon, type ProductIconProps, ProgressIndicator, type ProgressIndicatorProps, Radio, RadioGroup, type RadioGroupProps, type RadioProps, RangeCalendar, type RangeCalendarProps, RouterProvider, SearchField, type SearchFieldProps, SegmentedButton, type SegmentedButtonProps, type SegmentedButtonSegmentProps, Select, type SelectProps, type Selection, Separator, type SeparatorProps, Sheet, type SheetProps, Slider, type SliderProps, Snackbar, type SnackbarProps, type SortDescriptor, Stack, type StackAlign, type StackGap, type StackJustify, type StackProps, SupportingPane, type SupportingPaneProps, Switch, type SwitchProps, Table, type TableBodyProps, type TableCellProps, type TableColumnProps, type TableFooterProps, type TableHeaderProps, TableLayout, type TableProps, type TableRowProps, Tabs, type TabsProps, Tag, type TagProps, Text, TextArea, type TextAreaProps, TextField, type TextFieldProps, type TextProps, TimeField, type TimeFieldProps, TokenField, type TokenFieldProps, TokenFieldValue, Toolbar, type ToolbarProps, Tooltip, type TooltipProps, Tree, type TreeHeaderProps, type TreeItemProps, type TreeLoadMoreProps, type TreeProps, type TreeSectionProps, Virtualizer, VisuallyHidden, WaterfallLayout, collectionSizes, getColorChannels, isDirectoryDropItem, isFileDropItem, isTextDropItem, parseColor, useAsyncList, useDrag, useDragAndDrop, useDrop, useFilter, useListData, useLocale, useTreeData };
package/dist/index.js CHANGED
@@ -14,9 +14,12 @@ import Chip from "./components/chip/index.js";
14
14
  import ChipGroup from "./components/chip-group/index.js";
15
15
  import Code from "./components/code/index.js";
16
16
  import ColorArea from "./components/color-area/index.js";
17
+ import ColorField from "./components/color-field/index.js";
17
18
  import ColorSlider from "./components/color-slider/index.js";
18
19
  import ColorSwatch from "./components/color-swatch/index.js";
20
+ import ColorPicker from "./components/color-picker/index.js";
19
21
  import ColorSwatchPicker from "./components/color-swatch-picker/index.js";
22
+ import ColorWheel from "./components/color-wheel/index.js";
20
23
  import ListBox from "./components/list-box/index.js";
21
24
  import ComboBox from "./components/combo-box/index.js";
22
25
  import Container from "./components/container/index.js";
@@ -68,4 +71,4 @@ import { collectionSizes } from "./layout.js";
68
71
  import { useDragAndDrop } from "./drag/hooks.js";
69
72
  import { Collection, DIRECTORY_DRAG_TYPE, Focusable, GridLayout, I18nProvider, ListLayout, Pressable, RouterProvider, TableLayout, TokenFieldValue, Virtualizer, VisuallyHidden, WaterfallLayout, getColorChannels, isDirectoryDropItem, isFileDropItem, isTextDropItem, parseColor, useAsyncList, useDrag, useDrop, useFilter, useListData, useLocale, useTreeData } from "./react-aria.js";
70
73
  import "./styles.css";
71
- export { AppBar, Autocomplete, Avatar, Breadcrumbs, Button, Calendar, Card, Checkbox, CheckboxGroup, Chip, ChipGroup, Code, Collection, ColorArea, ColorSlider, ColorSwatch, ColorSwatchPicker, ComboBox, Container, CopyField, Currency, DIRECTORY_DRAG_TYPE, DateField, DatePicker, DateRangePicker, Dialog, Disclosure, DisclosureGroup, DropZone, Feed, FileTrigger, Focusable, Form, GridLayout, I18nProvider, IconButton, Keycap, Link, List, ListBox, ListDetail, ListItem, ListLayout, Menu, Meter, NavigationTree, NumberField, Popover, Pressable, ProductIcon, ProgressIndicator, Radio, RadioGroup, RangeCalendar, RouterProvider, SearchField, SegmentedButton, Select, Separator, Sheet, Slider, Snackbar, Stack, SupportingPane, Switch, Table, TableLayout, Tabs, Tag, Text, TextArea, TextField, TimeField, TokenField, TokenFieldValue, Toolbar, Tooltip, Tree, Virtualizer, VisuallyHidden, WaterfallLayout, collectionSizes, getColorChannels, isDirectoryDropItem, isFileDropItem, isTextDropItem, parseColor, useAsyncList, useDrag, useDragAndDrop, useDrop, useFilter, useListData, useLocale, useTreeData };
74
+ export { AppBar, Autocomplete, Avatar, Breadcrumbs, Button, Calendar, Card, Checkbox, CheckboxGroup, Chip, ChipGroup, Code, Collection, ColorArea, ColorField, ColorPicker, ColorSlider, ColorSwatch, ColorSwatchPicker, ColorWheel, ComboBox, Container, CopyField, Currency, DIRECTORY_DRAG_TYPE, DateField, DatePicker, DateRangePicker, Dialog, Disclosure, DisclosureGroup, DropZone, Feed, FileTrigger, Focusable, Form, GridLayout, I18nProvider, IconButton, Keycap, Link, List, ListBox, ListDetail, ListItem, ListLayout, Menu, Meter, NavigationTree, NumberField, Popover, Pressable, ProductIcon, ProgressIndicator, Radio, RadioGroup, RangeCalendar, RouterProvider, SearchField, SegmentedButton, Select, Separator, Sheet, Slider, Snackbar, Stack, SupportingPane, Switch, Table, TableLayout, Tabs, Tag, Text, TextArea, TextField, TimeField, TokenField, TokenFieldValue, Toolbar, Tooltip, Tree, Virtualizer, VisuallyHidden, WaterfallLayout, collectionSizes, getColorChannels, isDirectoryDropItem, isFileDropItem, isTextDropItem, parseColor, useAsyncList, useDrag, useDragAndDrop, useDrop, useFilter, useListData, useLocale, useTreeData };
package/dist/styles.css CHANGED
@@ -1531,6 +1531,11 @@
1531
1531
  margin-inline-start: var(--x3km7fe);
1532
1532
  }
1533
1533
 
1534
+ .xwjwp01 {
1535
+ -webkit-mask-image: var(--x-maskImage);
1536
+ mask-image: var(--x-maskImage);
1537
+ }
1538
+
1534
1539
  .x19kjcj4 {
1535
1540
  object-fit: contain;
1536
1541
  }
@@ -1902,6 +1907,10 @@
1902
1907
  transition-property: transform;
1903
1908
  }
1904
1909
 
1910
+ .x1mxbss1 {
1911
+ transition-property: translate, inline-size;
1912
+ }
1913
+
1905
1914
  .x16pyfke {
1906
1915
  transition-timing-function: cubic-bezier(.4, 0, .6, 1);
1907
1916
  }
@@ -2412,6 +2421,10 @@
2412
2421
  height: 36px;
2413
2422
  }
2414
2423
 
2424
+ .xuoj239 {
2425
+ height: 3px;
2426
+ }
2427
+
2415
2428
  .x1vqgdyp {
2416
2429
  height: 40px;
2417
2430
  }
@@ -2584,6 +2597,10 @@
2584
2597
  min-width: 112px;
2585
2598
  }
2586
2599
 
2600
+ .xnei2rj {
2601
+ min-width: 24px;
2602
+ }
2603
+
2587
2604
  .x1u2d2a2 {
2588
2605
  min-width: 280px;
2589
2606
  }
@@ -2718,6 +2735,10 @@
2718
2735
  width: 24px;
2719
2736
  }
2720
2737
 
2738
+ .x1dz1jew {
2739
+ width: 280px;
2740
+ }
2741
+
2721
2742
  .xgd8bvy {
2722
2743
  width: 28px;
2723
2744
  }
@@ -2770,6 +2791,10 @@
2770
2791
  width: auto;
2771
2792
  }
2772
2793
 
2794
+ .x17v02zk {
2795
+ width: calc(100% - 2 * var(--x1ug6acx));
2796
+ }
2797
+
2773
2798
  .xeq5yr9 {
2774
2799
  width: fit-content;
2775
2800
  }
@@ -2920,14 +2945,10 @@
2920
2945
  inset-block: -14px;
2921
2946
  }
2922
2947
 
2923
- .xb7ltuz:after, .xm4btww:before {
2948
+ .xm4btww:before {
2924
2949
  inset-inline: 0;
2925
2950
  }
2926
2951
 
2927
- .xr7aocx:after {
2928
- margin-inline: auto;
2929
- }
2930
-
2931
2952
  @media (width < 600px) {
2932
2953
  .x11ijow0.x11ijow0 {
2933
2954
  max-height: calc(100dvh - 72px);
@@ -2968,18 +2989,6 @@
2968
2989
  }
2969
2990
 
2970
2991
  @layer priority9 {
2971
- .x1al0t14:after {
2972
- background-color: var(--x1cjupv7);
2973
- }
2974
-
2975
- .x7ap8th:after {
2976
- border-start-end-radius: var(--x1kmbna2);
2977
- }
2978
-
2979
- .x1rrmwk0:after {
2980
- border-start-start-radius: var(--x1kmbna2);
2981
- }
2982
-
2983
2992
  .x7ip5l3::placeholder {
2984
2993
  color: color-mix(in srgb,var(--xn0syi6) calc(var(--xu361ij) * 100%),var(--x1dzgr7y));
2985
2994
  }
@@ -2992,7 +3001,7 @@
2992
3001
  color: var(--x28n2pw);
2993
3002
  }
2994
3003
 
2995
- .x1cpjm7i:before, .x1s928wv:after {
3004
+ .x1cpjm7i:before {
2996
3005
  content: "";
2997
3006
  }
2998
3007
 
@@ -3004,7 +3013,7 @@
3004
3013
  display: none;
3005
3014
  }
3006
3015
 
3007
- .x1hmns74:before, .x1j6awrg:after {
3016
+ .x1hmns74:before {
3008
3017
  position: absolute;
3009
3018
  }
3010
3019
 
@@ -3013,24 +3022,6 @@
3013
3022
  }
3014
3023
  }
3015
3024
 
3016
- @layer priority10 {
3017
- .x1xrz1ek:after {
3018
- bottom: 0;
3019
- }
3020
-
3021
- .xar2jh8:after {
3022
- height: 3px;
3023
- }
3024
-
3025
- .x1mcsf00:after {
3026
- min-width: 24px;
3027
- }
3028
-
3029
- .x1lzipow:after {
3030
- width: calc(100% - 2 * var(--x1ug6acx));
3031
- }
3032
- }
3033
-
3034
3025
  @property --x-blockSize {
3035
3026
  syntax: "*";
3036
3027
  inherits: false
@@ -3066,6 +3057,11 @@
3066
3057
  inherits: false
3067
3058
  }
3068
3059
 
3060
+ @property --x-maskImage {
3061
+ syntax: "*";
3062
+ inherits: false
3063
+ }
3064
+
3069
3065
  @property --x-maxInlineSize {
3070
3066
  syntax: "*";
3071
3067
  inherits: false
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kanso-labs/kanso-ui",
3
- "version": "0.22.0",
3
+ "version": "0.24.0",
4
4
  "description": "A React component library built on React Aria Components primitives and styled with StyleX, with design tokens sourced from a single W3C DTCG file and compiled via Style Dictionary",
5
5
  "keywords": [
6
6
  "react",