@manakind/ui-core 0.25.1 → 0.26.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -82,6 +82,7 @@ separately, so an app can load only what it renders.
82
82
  | `@manakind/ui-core/tabs` | `Tabs`, `TabsList`, `TabsTrigger`, `TabsContent` |
83
83
  | `@manakind/ui-core/layout` | `Stack`, `Inline`, `Grid`, `Container`, `Frame`, `Spacer` and the layout step types |
84
84
  | `@manakind/ui-core/text` | `Text` + `Heading` |
85
+ | `@manakind/ui-core/tooltip` | `Tooltip` |
85
86
  | `@manakind/ui-core/link` | `Link` |
86
87
  | `@manakind/ui-core/divider` | `Divider` |
87
88
  | `@manakind/ui-core/show` | `Show` |
@@ -103,19 +104,19 @@ separately, so an app can load only what it renders.
103
104
  | `@manakind/ui-core/css/avatar` | Avatar structural CSS; its fallback glyph also needs `css/icon` |
104
105
  | `@manakind/ui-core/css/badge` | Badge structural CSS |
105
106
  | `@manakind/ui-core/css/breadcrumb` | Breadcrumb structural CSS; a custom separator also needs `css/icon` |
106
- | `@manakind/ui-core/css/button` | Button + IconButton structural CSS |
107
- | `@manakind/ui-core/css/calendar` | Calendar structural CSS; its paging buttons also need `css/button` and `css/icon` |
107
+ | `@manakind/ui-core/css/button` | Button + IconButton structural CSS; IconButton's caption also needs `css/tooltip` |
108
+ | `@manakind/ui-core/css/calendar` | Calendar structural CSS; its paging buttons also need `css/button`, `css/icon` and `css/tooltip` |
108
109
  | `@manakind/ui-core/css/card` | Card structural CSS |
109
- | `@manakind/ui-core/css/dialog` | Dialog structural CSS; its close button also needs `css/button` and `css/icon` |
110
+ | `@manakind/ui-core/css/dialog` | Dialog structural CSS; its close button also needs `css/button`, `css/icon` and `css/tooltip` |
110
111
  | `@manakind/ui-core/css/icon` | Icon structural CSS |
111
112
  | `@manakind/ui-core/css/illustration` | Illustration structural CSS, including the paint roles |
112
113
  | `@manakind/ui-core/css/menu` | Menu and ActionMenu structural CSS; an ActionMenu's glyphs also need `css/icon` |
113
114
  | `@manakind/ui-core/css/popover` | Popover structural CSS |
114
115
  | `@manakind/ui-core/css/checkbox` | Checkbox structural CSS |
115
- | `@manakind/ui-core/css/combobox` | Combobox structural CSS |
116
+ | `@manakind/ui-core/css/combobox` | Combobox structural CSS; its pin and chip-remove captions also need `css/tooltip` |
116
117
  | `@manakind/ui-core/css/date-input` | DateInput structural CSS |
117
118
  | `@manakind/ui-core/css/progress` | Progress structural CSS |
118
- | `@manakind/ui-core/css/reorder-control` | ReorderControl structural CSS; its handle and input also need `css/button`, `css/icon` and `css/field` |
119
+ | `@manakind/ui-core/css/reorder-control` | ReorderControl structural CSS; its handle and input also need `css/button`, `css/icon`, `css/field` and `css/tooltip` |
119
120
  | `@manakind/ui-core/css/segment-group` | SegmentGroup structural CSS |
120
121
  | `@manakind/ui-core/css/select` | Select structural CSS |
121
122
  | `@manakind/ui-core/css/switch` | Switch structural CSS |
@@ -123,6 +124,7 @@ separately, so an app can load only what it renders.
123
124
  | `@manakind/ui-core/css/tabs` | Tabs structural CSS |
124
125
  | `@manakind/ui-core/css/layout` | Stack, Inline, Grid, Container, Frame and Spacer structural CSS |
125
126
  | `@manakind/ui-core/css/text` | Text and Heading structural CSS |
127
+ | `@manakind/ui-core/css/tooltip` | Tooltip structural CSS |
126
128
  | `@manakind/ui-core/css/link` | Link structural CSS |
127
129
  | `@manakind/ui-core/css/divider` | Divider structural CSS |
128
130
  | `@manakind/ui-core/css/show` | Show structural CSS |
@@ -3,7 +3,7 @@ import type { ComponentProps } from 'react';
3
3
  import { type IconSource } from '../icon/icon';
4
4
  import type { ButtonSize, ButtonVariant } from './button';
5
5
  import './button.css';
6
- export interface IconButtonProps extends Omit<ComponentProps<typeof ark.button>, 'children' | 'aria-label' | 'asChild'> {
6
+ export interface IconButtonProps extends Omit<ComponentProps<typeof ark.button>, 'children' | 'aria-label' | 'asChild' | 'title'> {
7
7
  /** Decorative icon rendered inside the button. */
8
8
  icon: IconSource;
9
9
  /**
@@ -22,6 +22,13 @@ export interface IconButtonProps extends Omit<ComponentProps<typeof ark.button>,
22
22
  size?: ButtonSize;
23
23
  /** Show loading spinner and disable interaction. */
24
24
  loading?: boolean;
25
+ /**
26
+ * The caption shown on hover and keyboard focus. Defaults to `aria-label`;
27
+ * pass a shorter one when the label carries the item's name for a screen
28
+ * reader ("Edit Run 10k") and the caption only needs the verb ("Edit").
29
+ * There is no `title`: the browser's own caption would show beside this one.
30
+ */
31
+ tooltip?: string;
25
32
  }
26
33
  /**
27
34
  * Square, icon-only button for the Manakind design system.
@@ -30,7 +37,8 @@ export interface IconButtonProps extends Omit<ComponentProps<typeof ark.button>,
30
37
  * focus ring, disabled + loading behavior) by reusing the `ds-button`
31
38
  * class plus a `ds-button--icon-only` modifier. The only API difference
32
39
  * is that `aria-label` is required at the type level — an icon-only
33
- * button has no visible text to derive an accessible name from.
40
+ * button has no visible text to derive an accessible name from — and that
41
+ * it shows that name as a tooltip, since the glyph alone may not say it.
34
42
  */
35
- export declare function IconButton({ icon, variant, size, loading, disabled, className, ...props }: IconButtonProps): import("react/jsx-runtime").JSX.Element;
43
+ export declare function IconButton({ icon, variant, size, loading, disabled, className, tooltip, ...props }: IconButtonProps): import("react/jsx-runtime").JSX.Element;
36
44
  //# sourceMappingURL=icon-button.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"icon-button.d.ts","sourceRoot":"","sources":["../../src/button/icon-button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAC5C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAQ,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAC1D,OAAO,cAAc,CAAC;AAGtB,MAAM,WAAW,eACf,SAAQ,IAAI,CAAC,cAAc,CAAC,OA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M,CAAC;CAClB;AAED;;;;;;;;;GASG;AACH,wBAAgB,UAAU,CAAC,EACzB,IAAI,EACJ,OAAmB,EACnB,IAAW,EACX,OAAe,EACf,QAAQ,EACR,SAAS,EACT,OAAO,EACP,GAAG,KAAK,EACT,EAAE,eAAe,2CAoBjB"}
@@ -1,6 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { ark } from '@ark-ui/react/factory';
3
3
  import { Icon } from '../icon/icon';
4
+ import { Tooltip } from '../tooltip/tooltip';
4
5
  import './button.css';
5
6
  import { cx } from '../cx';
6
7
  /**
@@ -10,9 +11,10 @@ import { cx } from '../cx';
10
11
  * focus ring, disabled + loading behavior) by reusing the `ds-button`
11
12
  * class plus a `ds-button--icon-only` modifier. The only API difference
12
13
  * is that `aria-label` is required at the type level — an icon-only
13
- * button has no visible text to derive an accessible name from.
14
+ * button has no visible text to derive an accessible name from — and that
15
+ * it shows that name as a tooltip, since the glyph alone may not say it.
14
16
  */
15
- export function IconButton({ icon, variant = 'primary', size = 'md', loading = false, disabled, className, ...props }) {
16
- return (_jsxs(ark.button, { disabled: disabled || loading, className: cx('ds-button', 'ds-button--icon-only', `ds-button--${variant}`, `ds-button--${size}`, loading && 'ds-button--loading', className), ...props, children: [loading && _jsx("span", { className: "ds-button__spinner", "aria-hidden": "true" }), _jsx(Icon, { source: icon, size: size, decorative: true, className: "ds-button__icon" })] }));
17
+ export function IconButton({ icon, variant = 'primary', size = 'md', loading = false, disabled, className, tooltip, ...props }) {
18
+ return (_jsx(Tooltip, { content: tooltip ?? props['aria-label'], kind: "label", children: _jsxs(ark.button, { disabled: disabled || loading, className: cx('ds-button', 'ds-button--icon-only', `ds-button--${variant}`, `ds-button--${size}`, loading && 'ds-button--loading', className), ...props, children: [loading && _jsx("span", { className: "ds-button__spinner", "aria-hidden": "true" }), _jsx(Icon, { source: icon, size: size, decorative: true, className: "ds-button__icon" })] }) }));
17
19
  }
18
20
  //# sourceMappingURL=icon-button.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"icon-button.js","sourceRoot":"","sources":["../../src/button/icon-button.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAE5C,OAAO,EAAE,IAAI,EAAmB,MAAM,cAAc,CAAC;AAErD,OAAO,cAAc,CAAC;AACtB,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAwB3B;;;;;;;;GAQG;AACH,MAAM,UAAU,UAAU,CAAC,EACzB,IAAI,EACJ,OAAO,GAAG,SAAS,EACnB,IAAI,GAAG,IAAI,EACX,OAAO,GAAG,KAAK,EACf,QAAQ,EACR,SAAS,EACT,GAAG,KAAK,EACQ;IAChB,OAAO,CACL,MAAC,GAAG,CAAC,MAAM,IACT,QAAQ,EAAE,QAAQ,IAAI,OAAO,EAC7B,SAAS,EAAE,EAAE,CACX,WAAW,EACX,sBAAsB,EACtB,cAAc,OAAO,EAAE,EACvB,cAAc,IAAI,EAAE,EACpB,OAAO,IAAI,oBAAoB,EAC/B,SAAS,CACV,KACG,KAAK,aAER,OAAO,IAAI,eAAM,SAAS,EAAC,oBAAoB,iBAAa,MAAM,GAAG,EACtE,KAAC,IAAI,IAAC,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,QAAC,SAAS,EAAC,iBAAiB,GAAG,IAC9D,CACd,CAAC;AACJ,CAAC","sourcesContent":["import { ark } from '@ark-ui/react/factory';\nimport type { ComponentProps } from 'react';\nimport { Icon, type IconSource } from '../icon/icon';\nimport type { ButtonSize, ButtonVariant } from './button';\nimport './button.css';\nimport { cx } from '../cx';\n\nexport interface IconButtonProps\n extends Omit<ComponentProps<typeof ark.button>, 'children' | 'aria-label' | 'asChild'> {\n /** Decorative icon rendered inside the button. */\n icon: IconSource;\n /**\n * Accessible label announced by assistive tech. Required because the\n * button has no visible text content to derive a name from.\n */\n 'aria-label': string;\n /** Visual style variant. Shared with {@link Button}. */\n variant?: ButtonVariant;\n /**\n * Size preset. The icon is the label, so it takes the icon scale's step of\n * the same name (16 / 24 / 32px) and the circle keeps the same inset around\n * it (32 / 40 / 48px). The circle is taller than a text `Button` of the\n * same size from `md` up.\n */\n size?: ButtonSize;\n /** Show loading spinner and disable interaction. */\n loading?: boolean;\n}\n\n/**\n * Square, icon-only button for the Manakind design system.\n *\n * Shares the full visual contract with `Button` (same variants, sizes,\n * focus ring, disabled + loading behavior) by reusing the `ds-button`\n * class plus a `ds-button--icon-only` modifier. The only API difference\n * is that `aria-label` is required at the type level — an icon-only\n * button has no visible text to derive an accessible name from.\n */\nexport function IconButton({\n icon,\n variant = 'primary',\n size = 'md',\n loading = false,\n disabled,\n className,\n ...props\n}: IconButtonProps) {\n return (\n <ark.button\n disabled={disabled || loading}\n className={cx(\n 'ds-button',\n 'ds-button--icon-only',\n `ds-button--${variant}`,\n `ds-button--${size}`,\n loading && 'ds-button--loading',\n className,\n )}\n {...props}\n >\n {loading && <span className=\"ds-button__spinner\" aria-hidden=\"true\" />}\n <Icon source={icon} size={size} decorative className=\"ds-button__icon\" />\n </ark.button>\n );\n}\n"]}
1
+ {"version":3,"file":"icon-button.js","sourceRoot":"","sources":["../../src/button/icon-button.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAE5C,OAAO,EAAE,IAAI,EAAmB,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAE7C,OAAO,cAAc,CAAC;AACtB,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AA+B3B;;;;;;;;;GASG;AACH,MAAM,UAAU,UAAU,CAAC,EACzB,IAAI,EACJ,OAAO,GAAG,SAAS,EACnB,IAAI,GAAG,IAAI,EACX,OAAO,GAAG,KAAK,EACf,QAAQ,EACR,SAAS,EACT,OAAO,EACP,GAAG,KAAK,EACQ;IAChB,OAAO,CACL,KAAC,OAAO,IAAC,OAAO,EAAE,OAAO,IAAI,KAAK,CAAC,YAAY,CAAC,EAAE,IAAI,EAAC,OAAO,YAC5D,MAAC,GAAG,CAAC,MAAM,IACT,QAAQ,EAAE,QAAQ,IAAI,OAAO,EAC7B,SAAS,EAAE,EAAE,CACX,WAAW,EACX,sBAAsB,EACtB,cAAc,OAAO,EAAE,EACvB,cAAc,IAAI,EAAE,EACpB,OAAO,IAAI,oBAAoB,EAC/B,SAAS,CACV,KACG,KAAK,aAER,OAAO,IAAI,eAAM,SAAS,EAAC,oBAAoB,iBAAa,MAAM,GAAG,EACtE,KAAC,IAAI,IAAC,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,QAAC,SAAS,EAAC,iBAAiB,GAAG,IAC9D,GACL,CACX,CAAC;AACJ,CAAC","sourcesContent":["import { ark } from '@ark-ui/react/factory';\nimport type { ComponentProps } from 'react';\nimport { Icon, type IconSource } from '../icon/icon';\nimport { Tooltip } from '../tooltip/tooltip';\nimport type { ButtonSize, ButtonVariant } from './button';\nimport './button.css';\nimport { cx } from '../cx';\n\nexport interface IconButtonProps\n extends Omit<ComponentProps<typeof ark.button>, 'children' | 'aria-label' | 'asChild' | 'title'> {\n /** Decorative icon rendered inside the button. */\n icon: IconSource;\n /**\n * Accessible label announced by assistive tech. Required because the\n * button has no visible text content to derive a name from.\n */\n 'aria-label': string;\n /** Visual style variant. Shared with {@link Button}. */\n variant?: ButtonVariant;\n /**\n * Size preset. The icon is the label, so it takes the icon scale's step of\n * the same name (16 / 24 / 32px) and the circle keeps the same inset around\n * it (32 / 40 / 48px). The circle is taller than a text `Button` of the\n * same size from `md` up.\n */\n size?: ButtonSize;\n /** Show loading spinner and disable interaction. */\n loading?: boolean;\n /**\n * The caption shown on hover and keyboard focus. Defaults to `aria-label`;\n * pass a shorter one when the label carries the item's name for a screen\n * reader (\"Edit Run 10k\") and the caption only needs the verb (\"Edit\").\n * There is no `title`: the browser's own caption would show beside this one.\n */\n tooltip?: string;\n}\n\n/**\n * Square, icon-only button for the Manakind design system.\n *\n * Shares the full visual contract with `Button` (same variants, sizes,\n * focus ring, disabled + loading behavior) by reusing the `ds-button`\n * class plus a `ds-button--icon-only` modifier. The only API difference\n * is that `aria-label` is required at the type level — an icon-only\n * button has no visible text to derive an accessible name from — and that\n * it shows that name as a tooltip, since the glyph alone may not say it.\n */\nexport function IconButton({\n icon,\n variant = 'primary',\n size = 'md',\n loading = false,\n disabled,\n className,\n tooltip,\n ...props\n}: IconButtonProps) {\n return (\n <Tooltip content={tooltip ?? props['aria-label']} kind=\"label\">\n <ark.button\n disabled={disabled || loading}\n className={cx(\n 'ds-button',\n 'ds-button--icon-only',\n `ds-button--${variant}`,\n `ds-button--${size}`,\n loading && 'ds-button--loading',\n className,\n )}\n {...props}\n >\n {loading && <span className=\"ds-button__spinner\" aria-hidden=\"true\" />}\n <Icon source={icon} size={size} decorative className=\"ds-button__icon\" />\n </ark.button>\n </Tooltip>\n );\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"combobox.d.ts","sourceRoot":"","sources":["../../src/combobox/combobox.tsx"],"names":[],"mappings":"AAGA,OAAO,EAKL,KAAK,SAAS,EACd,KAAK,GAAG,EAST,MAAM,OAAO,CAAC;AAKf,OAAO,EAAQ,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AAErD,OAAO,wCAAwC,CAAC;AAChD,OAAO,gBAAgB,CAAC;AAExB,MAAM,MAAM,YAAY,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAE9C,sFAAsF;AACtF,MAAM,WAAW,aAAa;IAC5B,sDAAsD;IACtD,KAAK,EAAE,MAAM,CAAC;IACd,wDAAwD;IACxD,KAAK,EAAE,MAAM,CAAC;IACd,qEAAqE;IACrE,IAAI,CAAC,EAAE,SAAS,CAAC;CAClB;AAED,MAAM,WAAW,YAAY;IAC3B,2CAA2C;IAC3C,KAAK,EAAE,MAAM,CAAC;IACd,iDAAiD;IACjD,KAAK,EAAE,MAAM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U,CAAC;IACxB,qCAAqC;IACrC,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,iCAAiC;IACjC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,8DAA8D;IAC9D,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,gEAAgE;IAChE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gGAAgG;IAChG,QAAQ,CAAC,EAAE,GAAG,CAAC,gBAAgB,CAAC,CAAC;CAClC;AAYD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,wBAAgB,QAAQ,CAAC,EACvB,KAAK,EACL,UAAU,EACV,kBAAkB,EAClB,QAAQ,EACR,KAAK,EACL,YAAY,EAAE,SAAS,EACvB,WAAW,EACX,SAAS,EACT,OAAO,EACP,MAAM,EACN,MAAM,EACN,OAAa,EACb,UAAkB,EAClB,IAAW,EACX,QAAQ,EACR,OAAO,EACP,SAAS,EACT,QAAQ,GACT,EAAE,aAAa,2CA+Uf"}
@@ -9,6 +9,7 @@ import { Cross, Pin } from '../fallback-glyphs';
9
9
  import { groupItems } from '../group-items';
10
10
  import { Icon } from '../icon/icon';
11
11
  import { PortalContainerContext } from '../portal-container';
12
+ import { Tooltip } from '../tooltip/tooltip';
12
13
  import '../visually-hidden/visually-hidden.css';
13
14
  import './combobox.css';
14
15
  // The header's own controls, which a press may focus.
@@ -331,9 +332,9 @@ function GridRow({ row, pinIcon }) {
331
332
  return (_jsxs("tr", { id: row.rowId, className: "ds-combobox__item", ...rowState(row), children: [_jsx(GridCell, { id: row.itemCellId, className: "ds-combobox__cell", "aria-disabled": item.disabled, children: _jsx(ItemText, { item: item }) }), _jsx(GridCell, { id: row.facetCellId, className: "ds-combobox__facet", children: item.facet && _jsx(FacetCell, { facet: item.facet, row: row, pinIcon: pinIcon }) })] }));
332
333
  }
333
334
  function FacetCell({ facet, row, pinIcon, }) {
334
- return (_jsxs("span", { className: "ds-combobox__facet-content", children: [facet.icon, _jsx("span", { className: "ds-combobox__facet-label", children: facet.label }), row.pinnable && (_jsx("button", { type: "button", tabIndex: -1, className: "ds-combobox__pin", "aria-label": `Filter by ${facet.label}`, "aria-pressed": row.pinned, "data-pin": "", "data-active": row.pinActive ? '' : undefined, children: _jsx(Icon, { source: pinIcon, size: "sm", decorative: true }) }))] }));
335
+ return (_jsxs("span", { className: "ds-combobox__facet-content", children: [facet.icon, _jsx("span", { className: "ds-combobox__facet-label", children: facet.label }), row.pinnable && (_jsx(Tooltip, { content: `Filter by ${facet.label}`, kind: "label", children: _jsx("button", { type: "button", tabIndex: -1, className: "ds-combobox__pin", "aria-label": `Filter by ${facet.label}`, "aria-pressed": row.pinned, "data-pin": "", "data-active": row.pinActive ? '' : undefined, children: _jsx(Icon, { source: pinIcon, size: "sm", decorative: true }) }) }))] }));
335
336
  }
336
337
  function PinnedChip({ facet, removeIcon, onRemove }) {
337
- return (_jsxs("span", { className: "ds-combobox__chip", children: [facet.icon, _jsx("span", { children: facet.label }), _jsx("button", { type: "button", className: "ds-combobox__chip-remove", "aria-label": `Stop filtering by ${facet.label}`, onClick: onRemove, children: _jsx(Icon, { source: removeIcon, size: "sm", decorative: true }) })] }));
338
+ return (_jsxs("span", { className: "ds-combobox__chip", children: [facet.icon, _jsx("span", { children: facet.label }), _jsx(Tooltip, { content: "Stop filtering", kind: "label", children: _jsx("button", { type: "button", className: "ds-combobox__chip-remove", "aria-label": `Stop filtering by ${facet.label}`, onClick: onRemove, children: _jsx(Icon, { source: removeIcon, size: "sm", decorative: true }) }) })] }));
338
339
  }
339
340
  //# sourceMappingURL=combobox.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"combobox.js","sourceRoot":"","sources":["../../src/combobox/combobox.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,YA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K,CAAC,KAAK,GAAQ,EAC1B,iBACE,IAAI,EAAC,QAAQ,EACb,SAAS,EAAC,0BAA0B,gBACxB,qBAAqB,KAAK,CAAC,KAAK,EAAE,EAC9C,OAAO,EAAE,QAAQ,YAEjB,KAAC,IAAI,IAAC,MAAM,EAAE,UAAU,EAAE,IAAI,EAAC,IAAI,EAAC,UAAU,SAAG,GAC1C,IACJ,CACR,CAAC;AACJ,CAAC","sourcesContent":["import { Popover as ArkPopover } from '@ark-ui/react/popover';\nimport { Portal } from '@ark-ui/react/portal';\nimport { getTabbableEdges, getTabbables, isComposingEvent } from '@zag-js/dom-query';\nimport {\n type ChangeEvent,\n type KeyboardEvent,\n type MouseEvent,\n type PointerEvent,\n type ReactNode,\n type Ref,\n type TdHTMLAttributes,\n useCallback,\n useContext,\n useEffect,\n useId,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport { flushSync } from 'react-dom';\nimport { cx } from '../cx';\nimport { Cross, Pin } from '../fallback-glyphs';\nimport { groupItems } from '../group-items';\nimport { Icon, type IconSource } from '../icon/icon';\nimport { PortalContainerContext } from '../portal-container';\nimport '../visually-hidden/visually-hidden.css';\nimport './combobox.css';\n\nexport type ComboboxSize = 'sm' | 'md' | 'lg';\n\n/** What an option belongs to, shown in a second column: its category, its project. */\nexport interface ComboboxFacet {\n /** Stable value reported when the facet is pinned. */\n value: string;\n /** Text in the facet column, and in the pinned chip. */\n label: string;\n /** Decorative mark before the label, such as the category's icon. */\n icon?: ReactNode;\n}\n\nexport interface ComboboxItem {\n /** Stable value reported by `onSelect`. */\n value: string;\n /** Option text, also what screen readers use. */\n label: string;\n /** Optional secondary line under the label, shown muted. */\n description?: string;\n /** Individually disable this option without removing it. */\n disabled?: boolean;\n /**\n * The group the option is listed under, by its heading. Options sharing a\n * group are listed together under it, groups in the order they first\n * appear; options without one (or with an empty name) are listed before\n * any group.\n */\n group?: string;\n /** What the option belongs to, shown in the facet column when `facets` is set. */\n facet?: ComboboxFacet;\n}\n\n/**\n * A second column naming what each option belongs to, with a pin that\n * narrows the list to it.\n */\nexport interface ComboboxFacets {\n /** Heading of the option column, for assistive tech: \"Action\". */\n itemLabel: string;\n /** Heading of the facet column, for assistive tech: \"Category\". */\n label: string;\n /** The facet the list is narrowed to, shown as a removable chip in the status line. */\n pinned?: ComboboxFacet | null;\n /**\n * Pins a row's facet, or unpins it with `null` (its pin pressed again, the\n * chip's remove button, or Backspace in the empty field). The caller does\n * the narrowing. Without it, the facet column shows no pins.\n */\n onPinnedChange?: (facet: ComboboxFacet | null) => void;\n}\n\nexport interface ComboboxProps {\n /**\n * Suggestions for the current text.\n *\n * The caller filters, sorts and groups them; the component does not. What\n * counts as a match (a prefix, a substring, a category's name, anything\n * not already chosen) is the product's call, and the list it passes is the\n * list that shows.\n */\n items: ComboboxItem[];\n /** Controlled text in the input. */\n inputValue: string;\n /** Fired with the new text on every keystroke, and with `''` after a choice. */\n onInputValueChange: (value: string) => void;\n /**\n * A suggestion was chosen. The input then clears (`onInputValueChange('')`)\n * and the field holds no value: this is the \"add to a list\" pattern. A\n * field that keeps its choice is a `Select`.\n */\n onSelect: (value: string) => void;\n /**\n * Visible label. Strongly preferred over `aria-label` — a visible label\n * helps everyone, not only screen reader users.\n */\n label?: ReactNode;\n /** Accessible name when no visible `label` is supplied. */\n 'aria-label'?: string;\n /** Text shown in the empty input. */\n placeholder?: string;\n /** Shown in the open list when `items` is empty. */\n emptyText?: ReactNode;\n /**\n * Controls at the top of the open list that change what it shows: a\n * `Switch`, a small `SegmentGroup`. One row of them, so the options stay\n * in view; Tab moves into them from the field.\n */\n toolbar?: ReactNode;\n /**\n * One line under the toolbar saying what the list shows, such as \"Showing\n * all actions in Health\". Announced politely as it changes.\n */\n status?: ReactNode;\n /** Adds the facet column, with its pins. The list becomes a grid. */\n facets?: ComboboxFacets;\n /** Glyph of a row's pin. Defaults to the inlined fallback pin. */\n pinIcon?: IconSource;\n /** Glyph of the pinned chip's remove button. Defaults to the inlined fallback cross. */\n removeIcon?: IconSource;\n /** Control height and type scale. */\n size?: ComboboxSize;\n /** Disable the whole control. */\n disabled?: boolean;\n /** Marks the field invalid for assistive tech and styling. */\n invalid?: boolean;\n /** Extra class names appended after `ds-combobox` modifiers. */\n className?: string;\n /** The text input, for moving focus back to the field, e.g. after removing an item it added. */\n inputRef?: Ref<HTMLInputElement>;\n}\n\ntype Cell = 'item' | 'facet';\n\ninterface Active {\n value: string;\n cell: Cell;\n}\n\n// The header's own controls, which a press may focus.\nconst HEADER_CONTROLS = 'button, input, label, a[href], [tabindex]:not([tabindex=\"-1\"])';\n\n/**\n * A text input that suggests options as you type, with optional controls at\n * the top of the open list.\n *\n * Choosing a suggestion reports it through `onSelect` and empties the input,\n * so the field is ready for the next one: the control for adding items to a\n * list one at a time. It never holds a selection itself; the caller keeps\n * the list. For a field that keeps one choice, use `Select`.\n *\n * The open list can carry what narrows it, so nothing sits outside the\n * field: a `toolbar` row of switches or a segment group, a `status` line\n * saying what is shown, and with `facets` a second column naming what each\n * option belongs to, whose pin narrows the list to it.\n *\n * ```tsx\n * <Combobox\n * label=\"Add actions\"\n * items={matches}\n * inputValue={query}\n * onInputValueChange={setQuery}\n * onSelect={(value) => setPicked((list) => [...list, value])}\n * toolbar={<Switch size=\"sm\" label=\"Include categories\" checked={…} onCheckedChange={…} />}\n * status={`Showing all actions that contain “${query}”`}\n * facets={{ itemLabel: 'Action', label: 'Category', pinned, onPinnedChange: setPinned }}\n * />\n * ```\n *\n * The field is the APG editable combobox. Focus stays in the input, and the\n * active option is `aria-activedescendant`. Typing highlights the first\n * option, so Enter takes it, and Up and Down walk the options in their drawn\n * order. With `facets` the popup is a grid instead of a listbox: Right, at\n * the end of the text, moves onto the row's pin and Enter then pins it, and\n * Left moves back. Tab moves from the field into the toolbar and the chip,\n * and on out to the next field.\n *\n * The popup is an Ark Popover anchored to the field, so it takes part in\n * the dismiss stack. Escape closes it before a `Dialog` around it, and a\n * click outside closes it. Its wrapper drops the Popover's dialog role, so\n * the listbox or grid inside is the popup assistive tech meets. It portals\n * like `Select`'s list: into `<body>`, or into the panel of the ui-core\n * `Dialog` it opens in, at `z-index: 60`.\n * The field reads the `--ds-input-*` keys and the list the `--ds-select-*`\n * keys, so it reads as one family with `Input` and `Select`.\n */\nexport function Combobox({\n items,\n inputValue,\n onInputValueChange,\n onSelect,\n label,\n 'aria-label': ariaLabel,\n placeholder,\n emptyText,\n toolbar,\n status,\n facets,\n pinIcon = Pin,\n removeIcon = Cross,\n size = 'md',\n disabled,\n invalid,\n className,\n inputRef,\n}: ComboboxProps) {\n const id = useId();\n const inputId = `${id}-input`;\n const labelId = `${id}-label`;\n const listId = `${id}-list`;\n const statusId = `${id}-status`;\n const rowId = (index: number) => `${id}-row-${index}`;\n const cellId = (index: number, cell: Cell) => `${id}-cell-${index}-${cell}`;\n\n const rootRef = useRef<HTMLDivElement>(null);\n const contentRef = useRef<HTMLDivElement>(null);\n const headerRef = useRef<HTMLDivElement>(null);\n const inputEl = useRef<HTMLInputElement | null>(null);\n const portalContainer = useContext(PortalContainerContext);\n\n const [open, setOpen] = useState(false);\n const [chosen, setChosen] = useState<Active | null>(null);\n const isOpen = open && !disabled;\n const isGrid = facets !== undefined;\n const pinned = facets?.pinned ?? null;\n const canPin = (item: ComboboxItem) => Boolean(facets?.onPinnedChange && item.facet);\n\n const groups = useMemo(() => groupItems(items), [items]);\n const ordered = useMemo(() => groups.flatMap((group) => group.items), [groups]);\n const navigable = useMemo(() => ordered.filter((item) => !item.disabled), [ordered]);\n\n const chosenItem = chosen && navigable.find((item) => item.value === chosen.value);\n const active: Active | null = chosenItem\n ? {\n value: chosenItem.value,\n cell: chosen?.cell === 'facet' && canPin(chosenItem) ? 'facet' : 'item',\n }\n : inputValue !== '' && navigable[0]\n ? { value: navigable[0].value, cell: 'item' }\n : null;\n const activeIndex = active ? ordered.findIndex((item) => item.value === active.value) : -1;\n const activeDescendant =\n isOpen && active && activeIndex >= 0\n ? isGrid\n ? cellId(activeIndex, active.cell)\n : rowId(activeIndex)\n : undefined;\n\n const setInputRef = useCallback(\n (element: HTMLInputElement | null) => {\n inputEl.current = element;\n if (typeof inputRef === 'function') inputRef(element);\n else if (inputRef) inputRef.current = element;\n },\n [inputRef],\n );\n\n /*\n * The popup portals out of the field, so the browser's Tab order would\n * skip it. While it is open, Tab from the field moves into its header's\n * controls, Tab from the last one moves on to whatever follows the field,\n * and Shift+Tab walks back the same way. Only the header counts, as the\n * pins are reached with the arrows; with no header control, Tab is the\n * browser's. A window listener, so it lives in an effect, and so it runs\n * ahead of a Dialog's focus trap: the popup is the end of the dialog's\n * panel, and the trap would wrap Tab from its last control to the\n * dialog's first.\n */\n useEffect(() => {\n if (!isOpen) return;\n const handleTab = (event: globalThis.KeyboardEvent) => {\n const header = headerRef.current;\n const content = contentRef.current;\n const field = inputEl.current;\n if (event.key !== 'Tab' || !header || !content || !field) return;\n const [first, last] = getTabbableEdges(header);\n if (!first || !last) return;\n const scope = field.closest<HTMLElement>('[aria-modal=\"true\"]') ?? field.ownerDocument.body;\n const tabbables = getTabbables(scope);\n const after = tabbables\n .slice(tabbables.indexOf(field) + 1)\n .find((element) => !content.contains(element));\n const current = field.ownerDocument.activeElement;\n let target: HTMLElement | undefined;\n if (event.shiftKey) target = current === first ? field : current === after ? last : undefined;\n else target = current === field ? first : current === last ? after : undefined;\n if (!target) return;\n event.preventDefault();\n if (target === after) event.stopPropagation();\n target.focus({ preventScroll: true });\n };\n window.addEventListener('keydown', handleTab, true);\n return () => window.removeEventListener('keydown', handleTab, true);\n }, [isOpen]);\n\n const activate = (next: Active | null) => {\n flushSync(() => setChosen(next));\n if (!next) return;\n const index = ordered.findIndex((item) => item.value === next.value);\n document.getElementById(rowId(index))?.scrollIntoView?.({ block: 'nearest' });\n };\n\n const move = (step: 1 | -1) => {\n if (navigable.length === 0) return;\n const from = active ? navigable.findIndex((item) => item.value === active.value) : -1;\n const to =\n from === -1\n ? step === 1\n ? 0\n : navigable.length - 1\n : (from + step + navigable.length) % navigable.length;\n const item = navigable[to];\n activate({\n value: item.value,\n cell: active?.cell === 'facet' && canPin(item) ? 'facet' : 'item',\n });\n };\n\n const focusFieldFromPopup = () => {\n if (contentRef.current?.contains(document.activeElement)) inputEl.current?.focus();\n };\n\n const handleOpenChange = (details: { open: boolean }) => {\n setOpen(details.open);\n if (!details.open) setChosen(null);\n };\n\n const choose = (item: ComboboxItem) => {\n if (item.disabled) return;\n focusFieldFromPopup();\n onSelect(item.value);\n onInputValueChange('');\n setChosen(null);\n setOpen(false);\n };\n\n const togglePin = (facet: ComboboxFacet) => {\n facets?.onPinnedChange?.(pinned?.value === facet.value ? null : facet);\n setChosen(null);\n };\n\n const unpin = () => {\n facets?.onPinnedChange?.(null);\n inputEl.current?.focus();\n };\n\n const handleChange = (event: ChangeEvent<HTMLInputElement>) => {\n setChosen(null);\n setOpen(true);\n onInputValueChange(event.target.value);\n };\n\n const handleKeyDown = (event: KeyboardEvent<HTMLInputElement>) => {\n if (isComposingEvent(event) || event.ctrlKey || event.shiftKey) return;\n const input = event.currentTarget;\n const activeItem = activeIndex >= 0 ? ordered[activeIndex] : undefined;\n const caretAtEnd =\n input.selectionStart === input.value.length && input.selectionEnd === input.value.length;\n\n if (event.key === 'ArrowDown' || event.key === 'ArrowUp') {\n event.preventDefault();\n if (!isOpen) setOpen(true);\n move(event.key === 'ArrowDown' ? 1 : -1);\n } else if (event.key === 'ArrowRight' && isOpen && activeItem && active?.cell === 'item') {\n if (isGrid && canPin(activeItem) && caretAtEnd) {\n event.preventDefault();\n activate({ value: activeItem.value, cell: 'facet' });\n }\n } else if (event.key === 'ArrowLeft' && isOpen && activeItem && active?.cell === 'facet') {\n event.preventDefault();\n activate({ value: activeItem.value, cell: 'item' });\n } else if (event.key === 'Enter' && isOpen && activeItem) {\n event.preventDefault();\n if (active?.cell === 'facet' && activeItem.facet) togglePin(activeItem.facet);\n else choose(activeItem);\n } else if (event.key === 'Backspace' && input.value === '' && pinned) {\n facets?.onPinnedChange?.(null);\n }\n };\n\n const rowIndexOf = (target: EventTarget) => {\n const row = (target as Element).closest<HTMLElement>('[data-index]');\n return row ? Number(row.dataset.index) : -1;\n };\n\n const handleListClick = (event: MouseEvent) => {\n const item = ordered[rowIndexOf(event.target)];\n if (!item) return;\n if ((event.target as Element).closest('[data-pin]') && item.facet) togglePin(item.facet);\n else choose(item);\n };\n\n const handleListPointerMove = (event: PointerEvent) => {\n const item = ordered[rowIndexOf(event.target)];\n if (item && !item.disabled && item.value !== active?.value) {\n setChosen({ value: item.value, cell: 'item' });\n }\n };\n\n const listName = label ? { 'aria-labelledby': labelId } : { 'aria-label': ariaLabel };\n const hasStatus = status !== undefined || pinned !== null;\n const hasHeader = toolbar !== undefined || hasStatus;\n const isEmpty = items.length === 0 && emptyText !== undefined;\n\n const rowOf = (item: ComboboxItem): RowModel => {\n const index = ordered.indexOf(item);\n const isActive = isOpen && index === activeIndex;\n return {\n item,\n index,\n rowId: rowId(index),\n itemCellId: cellId(index, 'item'),\n facetCellId: cellId(index, 'facet'),\n highlighted: isActive,\n pinnable: canPin(item),\n pinned: pinned !== null && pinned.value === item.facet?.value,\n pinActive: isActive && active?.cell === 'facet',\n };\n };\n const sections: Section[] = groups.map((group, groupIndex) => ({\n label: group.label,\n headingId: `${id}-group-${groupIndex}`,\n rows: group.items.map(rowOf),\n }));\n\n /*\n * Mouse input never takes focus from the field, so typing carries on: a\n * press on a row, a pin or the header's background is cancelled. Only the\n * header's own controls (a switch, a segment, the chip's remove button)\n * take focus, as they would anywhere.\n */\n const handleContentMouseDown = (event: MouseEvent) => {\n const target = event.target as Element;\n if (target.closest('.ds-combobox__list') || !target.closest(HEADER_CONTROLS)) {\n event.preventDefault();\n }\n };\n\n return (\n <ArkPopover.Root\n open={isOpen}\n onOpenChange={handleOpenChange}\n lazyMount\n unmountOnExit\n autoFocus={false}\n restoreFocus={false}\n portalled={false}\n persistentElements={[() => rootRef.current]}\n onEscapeKeyDown={focusFieldFromPopup}\n positioning={{ placement: 'bottom-start', sameWidth: true }}\n >\n <div ref={rootRef} className={cx('ds-combobox', `ds-combobox--${size}`, className)}>\n {label && (\n <label\n id={labelId}\n htmlFor={inputId}\n className=\"ds-combobox__label\"\n data-disabled={disabled ? '' : undefined}\n >\n {label}\n </label>\n )}\n <ArkPopover.Anchor className=\"ds-combobox__control\">\n <input\n ref={setInputRef}\n id={inputId}\n type=\"text\"\n role=\"combobox\"\n className=\"ds-combobox__input\"\n value={inputValue}\n placeholder={placeholder}\n aria-label={label ? undefined : ariaLabel}\n aria-autocomplete=\"list\"\n aria-haspopup={isGrid ? 'grid' : 'listbox'}\n aria-expanded={isOpen}\n aria-controls={isOpen ? listId : undefined}\n aria-activedescendant={activeDescendant}\n aria-describedby={isOpen && hasStatus ? statusId : undefined}\n aria-invalid={invalid || undefined}\n data-invalid={invalid ? '' : undefined}\n disabled={disabled}\n autoComplete=\"off\"\n autoCorrect=\"off\"\n autoCapitalize=\"none\"\n spellCheck={false}\n onChange={handleChange}\n onClick={() => setOpen(true)}\n onKeyDown={handleKeyDown}\n />\n </ArkPopover.Anchor>\n </div>\n\n <Portal container={portalContainer}>\n <ArkPopover.Positioner>\n <ArkPopover.Content\n ref={contentRef}\n role=\"presentation\"\n className=\"ds-combobox__content\"\n onMouseDown={handleContentMouseDown}\n onClick={handleListClick}\n onPointerMove={handleListPointerMove}\n >\n {hasHeader && (\n <div ref={headerRef} className=\"ds-combobox__header\">\n {toolbar && <div className=\"ds-combobox__toolbar\">{toolbar}</div>}\n {hasStatus && (\n <p id={statusId} role=\"status\" className=\"ds-combobox__status\">\n {status}\n {pinned && (\n <>\n {' '}\n <PinnedChip facet={pinned} removeIcon={removeIcon} onRemove={unpin} />\n </>\n )}\n </p>\n )}\n </div>\n )}\n {facets ? (\n <GridList\n id={listId}\n name={listName}\n facets={facets}\n sections={sections}\n emptyText={isEmpty ? emptyText : undefined}\n pinIcon={pinIcon}\n />\n ) : (\n <ListboxList\n id={listId}\n name={listName}\n sections={sections}\n emptyText={isEmpty ? emptyText : undefined}\n />\n )}\n </ArkPopover.Content>\n </ArkPopover.Positioner>\n </Portal>\n </ArkPopover.Root>\n );\n}\n\ninterface RowModel {\n item: ComboboxItem;\n index: number;\n rowId: string;\n itemCellId: string;\n facetCellId: string;\n highlighted: boolean;\n pinnable: boolean;\n pinned: boolean;\n pinActive: boolean;\n}\n\ninterface Section {\n label?: string;\n headingId: string;\n rows: RowModel[];\n}\n\ninterface ListProps {\n id: string;\n name: { 'aria-labelledby': string } | { 'aria-label': string | undefined };\n sections: Section[];\n emptyText: ReactNode;\n}\n\nconst rowState = (row: RowModel) => ({\n 'data-index': row.index,\n 'data-highlighted': row.highlighted ? '' : undefined,\n 'data-disabled': row.item.disabled ? '' : undefined,\n});\n\nfunction ItemText({ item }: { item: ComboboxItem }) {\n return (\n <>\n <span className=\"ds-combobox__item-label\">{item.label}</span>\n {item.description && (\n <>\n {' '}\n <span className=\"ds-combobox__item-description\">{item.description}</span>\n </>\n )}\n </>\n );\n}\n\n/*\n * The listbox's options and groups take their roles on plain elements: the\n * field keeps focus and points at an option with aria-activedescendant, so\n * none of them is focusable, and HTML has no element for an option outside\n * a native select. The lint rules asking for focusable or native elements\n * are therefore suppressed here, and only here.\n */\nfunction ListboxList({ id, name, sections, emptyText }: ListProps) {\n const option = (row: RowModel) => (\n // biome-ignore lint/a11y/useFocusableInteractive: reached through aria-activedescendant from the field, never by focus\n <div\n key={row.item.value}\n id={row.rowId}\n role=\"option\"\n aria-selected=\"false\"\n aria-disabled={row.item.disabled}\n className=\"ds-combobox__item\"\n {...rowState(row)}\n >\n <ItemText item={row.item} />\n </div>\n );\n return (\n <div id={id} role=\"listbox\" className=\"ds-combobox__list\" {...name}>\n {sections.map((section) =>\n section.label === undefined ? (\n section.rows.map(option)\n ) : (\n // biome-ignore lint/a11y/useSemanticElements: a fieldset is a form group, not a group of options\n <div\n key={section.label}\n role=\"group\"\n aria-labelledby={section.headingId}\n className=\"ds-combobox__group\"\n >\n <div id={section.headingId} className=\"ds-combobox__group-label\">\n {section.label}\n </div>\n {section.rows.map(option)}\n </div>\n ),\n )}\n {emptyText !== undefined && (\n // biome-ignore lint/a11y/useFocusableInteractive: a disabled option the keyboard never lands on\n <div\n role=\"option\"\n aria-disabled=\"true\"\n aria-selected=\"false\"\n className=\"ds-combobox__empty\"\n >\n {emptyText}\n </div>\n )}\n </div>\n );\n}\n\ninterface GridListProps extends ListProps {\n facets: ComboboxFacets;\n pinIcon: IconSource;\n}\n\n/*\n * A table in the grid role: its rows and cells line up in two columns by\n * themselves, and a group of rows is a `tbody` named by its heading row.\n * The keyboard skips heading rows, as it skips a listbox's group labels.\n */\nfunction GridList({ id, name, facets, sections, emptyText, pinIcon }: GridListProps) {\n const row = (model: RowModel) => <GridRow key={model.item.value} row={model} pinIcon={pinIcon} />;\n return (\n // biome-ignore lint/a11y/noNoninteractiveElementToInteractiveRole: a table in the grid role is the APG grid pattern; its cells line up by themselves\n <table id={id} role=\"grid\" className=\"ds-combobox__list ds-combobox__list--grid\" {...name}>\n <thead className=\"ds-visually-hidden\">\n <tr>\n <th scope=\"col\">{facets.itemLabel}</th>\n <th scope=\"col\">{facets.label}</th>\n </tr>\n </thead>\n {sections.map((section) =>\n section.label === undefined ? (\n <tbody key=\"ungrouped\">{section.rows.map(row)}</tbody>\n ) : (\n <tbody\n key={section.label}\n aria-labelledby={section.headingId}\n className=\"ds-combobox__group\"\n >\n <tr>\n <th\n id={section.headingId}\n colSpan={2}\n scope=\"colgroup\"\n className=\"ds-combobox__group-label\"\n >\n {section.label}\n </th>\n </tr>\n {section.rows.map(row)}\n </tbody>\n ),\n )}\n {emptyText !== undefined && (\n <tbody>\n <tr>\n <GridCell colSpan={2} aria-disabled=\"true\" className=\"ds-combobox__empty\">\n {emptyText}\n </GridCell>\n </tr>\n </tbody>\n )}\n </table>\n );\n}\n\n/*\n * A cell of the grid, named so explicitly: a `td` in a grid table is a\n * gridcell to browsers, but not to every tool, and the field keeps focus\n * and points at the cell with aria-activedescendant, so it is not focusable.\n */\nfunction GridCell(props: TdHTMLAttributes<HTMLTableCellElement>) {\n // biome-ignore lint/a11y/useFocusableInteractive: reached through aria-activedescendant from the field, never by focus\n // biome-ignore lint/a11y/noNoninteractiveElementToInteractiveRole: a td in a grid table is a gridcell; named so for every tool\n return <td role=\"gridcell\" {...props} />;\n}\n\nfunction GridRow({ row, pinIcon }: { row: RowModel; pinIcon: IconSource }) {\n const { item } = row;\n return (\n <tr id={row.rowId} className=\"ds-combobox__item\" {...rowState(row)}>\n <GridCell id={row.itemCellId} className=\"ds-combobox__cell\" aria-disabled={item.disabled}>\n <ItemText item={item} />\n </GridCell>\n <GridCell id={row.facetCellId} className=\"ds-combobox__facet\">\n {item.facet && <FacetCell facet={item.facet} row={row} pinIcon={pinIcon} />}\n </GridCell>\n </tr>\n );\n}\n\nfunction FacetCell({\n facet,\n row,\n pinIcon,\n}: {\n facet: ComboboxFacet;\n row: RowModel;\n pinIcon: IconSource;\n}) {\n return (\n <span className=\"ds-combobox__facet-content\">\n {facet.icon}\n <span className=\"ds-combobox__facet-label\">{facet.label}</span>\n {row.pinnable && (\n <button\n type=\"button\"\n tabIndex={-1}\n className=\"ds-combobox__pin\"\n aria-label={`Filter by ${facet.label}`}\n aria-pressed={row.pinned}\n data-pin=\"\"\n data-active={row.pinActive ? '' : undefined}\n >\n <Icon source={pinIcon} size=\"sm\" decorative />\n </button>\n )}\n </span>\n );\n}\n\ninterface PinnedChipProps {\n facet: ComboboxFacet;\n removeIcon: IconSource;\n onRemove: () => void;\n}\n\nfunction PinnedChip({ facet, removeIcon, onRemove }: PinnedChipProps) {\n return (\n <span className=\"ds-combobox__chip\">\n {facet.icon}\n <span>{facet.label}</span>\n <button\n type=\"button\"\n className=\"ds-combobox__chip-remove\"\n aria-label={`Stop filtering by ${facet.label}`}\n onClick={onRemove}\n >\n <Icon source={removeIcon} size=\"sm\" decorative />\n </button>\n </span>\n );\n}\n"]}
1
+ {"version":3,"file":"combobox.js","sourceRoot":"","sources":["../../src/comb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,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,YAE3C,KAAC,IAAI,IAAC,MAAM,EAAE,OAAO,EAAE,IAAI,EAAC,IAAI,EAAC,UAAU,SAAG,GACvC,GACD,CACX,IACI,CACR,CAAC;AACJ,CAAC;AAQD,SAAS,UAAU,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAmB;IAClE,OAAO,CACL,gBAAM,SAAS,EAAC,mBAAmB,aAChC,KAAK,CAAC,IAAI,EACX,yBAAO,KAAK,CAAC,KAAK,GAAQ,EAC1B,KAAC,OAAO,IAAC,OAAO,EAAC,gBAAgB,EAAC,IAAI,EAAC,OAAO,YAC5C,iBACE,IAAI,EAAC,QAAQ,EACb,SAAS,EAAC,0BAA0B,gBACxB,qBAAqB,KAAK,CAAC,KAAK,EAAE,EAC9C,OAAO,EAAE,QAAQ,YAEjB,KAAC,IAAI,IAAC,MAAM,EAAE,UAAU,EAAE,IAAI,EAAC,IAAI,EAAC,UAAU,SAAG,GAC1C,GACD,IACL,CACR,CAAC;AACJ,CAAC","sourcesContent":["import { Popover as ArkPopover } from '@ark-ui/react/popover';\nimport { Portal } from '@ark-ui/react/portal';\nimport { getTabbableEdges, getTabbables, isComposingEvent } from '@zag-js/dom-query';\nimport {\n type ChangeEvent,\n type KeyboardEvent,\n type MouseEvent,\n type PointerEvent,\n type ReactNode,\n type Ref,\n type TdHTMLAttributes,\n useCallback,\n useContext,\n useEffect,\n useId,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport { flushSync } from 'react-dom';\nimport { cx } from '../cx';\nimport { Cross, Pin } from '../fallback-glyphs';\nimport { groupItems } from '../group-items';\nimport { Icon, type IconSource } from '../icon/icon';\nimport { PortalContainerContext } from '../portal-container';\nimport { Tooltip } from '../tooltip/tooltip';\nimport '../visually-hidden/visually-hidden.css';\nimport './combobox.css';\n\nexport type ComboboxSize = 'sm' | 'md' | 'lg';\n\n/** What an option belongs to, shown in a second column: its category, its project. */\nexport interface ComboboxFacet {\n /** Stable value reported when the facet is pinned. */\n value: string;\n /** Text in the facet column, and in the pinned chip. */\n label: string;\n /** Decorative mark before the label, such as the category's icon. */\n icon?: ReactNode;\n}\n\nexport interface ComboboxItem {\n /** Stable value reported by `onSelect`. */\n value: string;\n /** Option text, also what screen readers use. */\n label: string;\n /** Optional secondary line under the label, shown muted. */\n description?: string;\n /** Individually disable this option without removing it. */\n disabled?: boolean;\n /**\n * The group the option is listed under, by its heading. Options sharing a\n * group are listed together under it, groups in the order they first\n * appear; options without one (or with an empty name) are listed before\n * any group.\n */\n group?: string;\n /** What the option belongs to, shown in the facet column when `facets` is set. */\n facet?: ComboboxFacet;\n}\n\n/**\n * A second column naming what each option belongs to, with a pin that\n * narrows the list to it.\n */\nexport interface ComboboxFacets {\n /** Heading of the option column, for assistive tech: \"Action\". */\n itemLabel: string;\n /** Heading of the facet column, for assistive tech: \"Category\". */\n label: string;\n /** The facet the list is narrowed to, shown as a removable chip in the status line. */\n pinned?: ComboboxFacet | null;\n /**\n * Pins a row's facet, or unpins it with `null` (its pin pressed again, the\n * chip's remove button, or Backspace in the empty field). The caller does\n * the narrowing. Without it, the facet column shows no pins.\n */\n onPinnedChange?: (facet: ComboboxFacet | null) => void;\n}\n\nexport interface ComboboxProps {\n /**\n * Suggestions for the current text.\n *\n * The caller filters, sorts and groups them; the component does not. What\n * counts as a match (a prefix, a substring, a category's name, anything\n * not already chosen) is the product's call, and the list it passes is the\n * list that shows.\n */\n items: ComboboxItem[];\n /** Controlled text in the input. */\n inputValue: string;\n /** Fired with the new text on every keystroke, and with `''` after a choice. */\n onInputValueChange: (value: string) => void;\n /**\n * A suggestion was chosen. The input then clears (`onInputValueChange('')`)\n * and the field holds no value: this is the \"add to a list\" pattern. A\n * field that keeps its choice is a `Select`.\n */\n onSelect: (value: string) => void;\n /**\n * Visible label. Strongly preferred over `aria-label` — a visible label\n * helps everyone, not only screen reader users.\n */\n label?: ReactNode;\n /** Accessible name when no visible `label` is supplied. */\n 'aria-label'?: string;\n /** Text shown in the empty input. */\n placeholder?: string;\n /** Shown in the open list when `items` is empty. */\n emptyText?: ReactNode;\n /**\n * Controls at the top of the open list that change what it shows: a\n * `Switch`, a small `SegmentGroup`. One row of them, so the options stay\n * in view; Tab moves into them from the field.\n */\n toolbar?: ReactNode;\n /**\n * One line under the toolbar saying what the list shows, such as \"Showing\n * all actions in Health\". Announced politely as it changes.\n */\n status?: ReactNode;\n /** Adds the facet column, with its pins. The list becomes a grid. */\n facets?: ComboboxFacets;\n /** Glyph of a row's pin. Defaults to the inlined fallback pin. */\n pinIcon?: IconSource;\n /** Glyph of the pinned chip's remove button. Defaults to the inlined fallback cross. */\n removeIcon?: IconSource;\n /** Control height and type scale. */\n size?: ComboboxSize;\n /** Disable the whole control. */\n disabled?: boolean;\n /** Marks the field invalid for assistive tech and styling. */\n invalid?: boolean;\n /** Extra class names appended after `ds-combobox` modifiers. */\n className?: string;\n /** The text input, for moving focus back to the field, e.g. after removing an item it added. */\n inputRef?: Ref<HTMLInputElement>;\n}\n\ntype Cell = 'item' | 'facet';\n\ninterface Active {\n value: string;\n cell: Cell;\n}\n\n// The header's own controls, which a press may focus.\nconst HEADER_CONTROLS = 'button, input, label, a[href], [tabindex]:not([tabindex=\"-1\"])';\n\n/**\n * A text input that suggests options as you type, with optional controls at\n * the top of the open list.\n *\n * Choosing a suggestion reports it through `onSelect` and empties the input,\n * so the field is ready for the next one: the control for adding items to a\n * list one at a time. It never holds a selection itself; the caller keeps\n * the list. For a field that keeps one choice, use `Select`.\n *\n * The open list can carry what narrows it, so nothing sits outside the\n * field: a `toolbar` row of switches or a segment group, a `status` line\n * saying what is shown, and with `facets` a second column naming what each\n * option belongs to, whose pin narrows the list to it.\n *\n * ```tsx\n * <Combobox\n * label=\"Add actions\"\n * items={matches}\n * inputValue={query}\n * onInputValueChange={setQuery}\n * onSelect={(value) => setPicked((list) => [...list, value])}\n * toolbar={<Switch size=\"sm\" label=\"Include categories\" checked={…} onCheckedChange={…} />}\n * status={`Showing all actions that contain “${query}”`}\n * facets={{ itemLabel: 'Action', label: 'Category', pinned, onPinnedChange: setPinned }}\n * />\n * ```\n *\n * The field is the APG editable combobox. Focus stays in the input, and the\n * active option is `aria-activedescendant`. Typing highlights the first\n * option, so Enter takes it, and Up and Down walk the options in their drawn\n * order. With `facets` the popup is a grid instead of a listbox: Right, at\n * the end of the text, moves onto the row's pin and Enter then pins it, and\n * Left moves back. Tab moves from the field into the toolbar and the chip,\n * and on out to the next field.\n *\n * The popup is an Ark Popover anchored to the field, so it takes part in\n * the dismiss stack. Escape closes it before a `Dialog` around it, and a\n * click outside closes it. Its wrapper drops the Popover's dialog role, so\n * the listbox or grid inside is the popup assistive tech meets. It portals\n * like `Select`'s list: into `<body>`, or into the panel of the ui-core\n * `Dialog` it opens in, at `z-index: 60`.\n * The field reads the `--ds-input-*` keys and the list the `--ds-select-*`\n * keys, so it reads as one family with `Input` and `Select`.\n */\nexport function Combobox({\n items,\n inputValue,\n onInputValueChange,\n onSelect,\n label,\n 'aria-label': ariaLabel,\n placeholder,\n emptyText,\n toolbar,\n status,\n facets,\n pinIcon = Pin,\n removeIcon = Cross,\n size = 'md',\n disabled,\n invalid,\n className,\n inputRef,\n}: ComboboxProps) {\n const id = useId();\n const inputId = `${id}-input`;\n const labelId = `${id}-label`;\n const listId = `${id}-list`;\n const statusId = `${id}-status`;\n const rowId = (index: number) => `${id}-row-${index}`;\n const cellId = (index: number, cell: Cell) => `${id}-cell-${index}-${cell}`;\n\n const rootRef = useRef<HTMLDivElement>(null);\n const contentRef = useRef<HTMLDivElement>(null);\n const headerRef = useRef<HTMLDivElement>(null);\n const inputEl = useRef<HTMLInputElement | null>(null);\n const portalContainer = useContext(PortalContainerContext);\n\n const [open, setOpen] = useState(false);\n const [chosen, setChosen] = useState<Active | null>(null);\n const isOpen = open && !disabled;\n const isGrid = facets !== undefined;\n const pinned = facets?.pinned ?? null;\n const canPin = (item: ComboboxItem) => Boolean(facets?.onPinnedChange && item.facet);\n\n const groups = useMemo(() => groupItems(items), [items]);\n const ordered = useMemo(() => groups.flatMap((group) => group.items), [groups]);\n const navigable = useMemo(() => ordered.filter((item) => !item.disabled), [ordered]);\n\n const chosenItem = chosen && navigable.find((item) => item.value === chosen.value);\n const active: Active | null = chosenItem\n ? {\n value: chosenItem.value,\n cell: chosen?.cell === 'facet' && canPin(chosenItem) ? 'facet' : 'item',\n }\n : inputValue !== '' && navigable[0]\n ? { value: navigable[0].value, cell: 'item' }\n : null;\n const activeIndex = active ? ordered.findIndex((item) => item.value === active.value) : -1;\n const activeDescendant =\n isOpen && active && activeIndex >= 0\n ? isGrid\n ? cellId(activeIndex, active.cell)\n : rowId(activeIndex)\n : undefined;\n\n const setInputRef = useCallback(\n (element: HTMLInputElement | null) => {\n inputEl.current = element;\n if (typeof inputRef === 'function') inputRef(element);\n else if (inputRef) inputRef.current = element;\n },\n [inputRef],\n );\n\n /*\n * The popup portals out of the field, so the browser's Tab order would\n * skip it. While it is open, Tab from the field moves into its header's\n * controls, Tab from the last one moves on to whatever follows the field,\n * and Shift+Tab walks back the same way. Only the header counts, as the\n * pins are reached with the arrows; with no header control, Tab is the\n * browser's. A window listener, so it lives in an effect, and so it runs\n * ahead of a Dialog's focus trap: the popup is the end of the dialog's\n * panel, and the trap would wrap Tab from its last control to the\n * dialog's first.\n */\n useEffect(() => {\n if (!isOpen) return;\n const handleTab = (event: globalThis.KeyboardEvent) => {\n const header = headerRef.current;\n const content = contentRef.current;\n const field = inputEl.current;\n if (event.key !== 'Tab' || !header || !content || !field) return;\n const [first, last] = getTabbableEdges(header);\n if (!first || !last) return;\n const scope = field.closest<HTMLElement>('[aria-modal=\"true\"]') ?? field.ownerDocument.body;\n const tabbables = getTabbables(scope);\n const after = tabbables\n .slice(tabbables.indexOf(field) + 1)\n .find((element) => !content.contains(element));\n const current = field.ownerDocument.activeElement;\n let target: HTMLElement | undefined;\n if (event.shiftKey) target = current === first ? field : current === after ? last : undefined;\n else target = current === field ? first : current === last ? after : undefined;\n if (!target) return;\n event.preventDefault();\n if (target === after) event.stopPropagation();\n target.focus({ preventScroll: true });\n };\n window.addEventListener('keydown', handleTab, true);\n return () => window.removeEventListener('keydown', handleTab, true);\n }, [isOpen]);\n\n const activate = (next: Active | null) => {\n flushSync(() => setChosen(next));\n if (!next) return;\n const index = ordered.findIndex((item) => item.value === next.value);\n document.getElementById(rowId(index))?.scrollIntoView?.({ block: 'nearest' });\n };\n\n const move = (step: 1 | -1) => {\n if (navigable.length === 0) return;\n const from = active ? navigable.findIndex((item) => item.value === active.value) : -1;\n const to =\n from === -1\n ? step === 1\n ? 0\n : navigable.length - 1\n : (from + step + navigable.length) % navigable.length;\n const item = navigable[to];\n activate({\n value: item.value,\n cell: active?.cell === 'facet' && canPin(item) ? 'facet' : 'item',\n });\n };\n\n const focusFieldFromPopup = () => {\n if (contentRef.current?.contains(document.activeElement)) inputEl.current?.focus();\n };\n\n const handleOpenChange = (details: { open: boolean }) => {\n setOpen(details.open);\n if (!details.open) setChosen(null);\n };\n\n const choose = (item: ComboboxItem) => {\n if (item.disabled) return;\n focusFieldFromPopup();\n onSelect(item.value);\n onInputValueChange('');\n setChosen(null);\n setOpen(false);\n };\n\n const togglePin = (facet: ComboboxFacet) => {\n facets?.onPinnedChange?.(pinned?.value === facet.value ? null : facet);\n setChosen(null);\n };\n\n const unpin = () => {\n facets?.onPinnedChange?.(null);\n inputEl.current?.focus();\n };\n\n const handleChange = (event: ChangeEvent<HTMLInputElement>) => {\n setChosen(null);\n setOpen(true);\n onInputValueChange(event.target.value);\n };\n\n const handleKeyDown = (event: KeyboardEvent<HTMLInputElement>) => {\n if (isComposingEvent(event) || event.ctrlKey || event.shiftKey) return;\n const input = event.currentTarget;\n const activeItem = activeIndex >= 0 ? ordered[activeIndex] : undefined;\n const caretAtEnd =\n input.selectionStart === input.value.length && input.selectionEnd === input.value.length;\n\n if (event.key === 'ArrowDown' || event.key === 'ArrowUp') {\n event.preventDefault();\n if (!isOpen) setOpen(true);\n move(event.key === 'ArrowDown' ? 1 : -1);\n } else if (event.key === 'ArrowRight' && isOpen && activeItem && active?.cell === 'item') {\n if (isGrid && canPin(activeItem) && caretAtEnd) {\n event.preventDefault();\n activate({ value: activeItem.value, cell: 'facet' });\n }\n } else if (event.key === 'ArrowLeft' && isOpen && activeItem && active?.cell === 'facet') {\n event.preventDefault();\n activate({ value: activeItem.value, cell: 'item' });\n } else if (event.key === 'Enter' && isOpen && activeItem) {\n event.preventDefault();\n if (active?.cell === 'facet' && activeItem.facet) togglePin(activeItem.facet);\n else choose(activeItem);\n } else if (event.key === 'Backspace' && input.value === '' && pinned) {\n facets?.onPinnedChange?.(null);\n }\n };\n\n const rowIndexOf = (target: EventTarget) => {\n const row = (target as Element).closest<HTMLElement>('[data-index]');\n return row ? Number(row.dataset.index) : -1;\n };\n\n const handleListClick = (event: MouseEvent) => {\n const item = ordered[rowIndexOf(event.target)];\n if (!item) return;\n if ((event.target as Element).closest('[data-pin]') && item.facet) togglePin(item.facet);\n else choose(item);\n };\n\n const handleListPointerMove = (event: PointerEvent) => {\n const item = ordered[rowIndexOf(event.target)];\n if (item && !item.disabled && item.value !== active?.value) {\n setChosen({ value: item.value, cell: 'item' });\n }\n };\n\n const listName = label ? { 'aria-labelledby': labelId } : { 'aria-label': ariaLabel };\n const hasStatus = status !== undefined || pinned !== null;\n const hasHeader = toolbar !== undefined || hasStatus;\n const isEmpty = items.length === 0 && emptyText !== undefined;\n\n const rowOf = (item: ComboboxItem): RowModel => {\n const index = ordered.indexOf(item);\n const isActive = isOpen && index === activeIndex;\n return {\n item,\n index,\n rowId: rowId(index),\n itemCellId: cellId(index, 'item'),\n facetCellId: cellId(index, 'facet'),\n highlighted: isActive,\n pinnable: canPin(item),\n pinned: pinned !== null && pinned.value === item.facet?.value,\n pinActive: isActive && active?.cell === 'facet',\n };\n };\n const sections: Section[] = groups.map((group, groupIndex) => ({\n label: group.label,\n headingId: `${id}-group-${groupIndex}`,\n rows: group.items.map(rowOf),\n }));\n\n /*\n * Mouse input never takes focus from the field, so typing carries on: a\n * press on a row, a pin or the header's background is cancelled. Only the\n * header's own controls (a switch, a segment, the chip's remove button)\n * take focus, as they would anywhere.\n */\n const handleContentMouseDown = (event: MouseEvent) => {\n const target = event.target as Element;\n if (target.closest('.ds-combobox__list') || !target.closest(HEADER_CONTROLS)) {\n event.preventDefault();\n }\n };\n\n return (\n <ArkPopover.Root\n open={isOpen}\n onOpenChange={handleOpenChange}\n lazyMount\n unmountOnExit\n autoFocus={false}\n restoreFocus={false}\n portalled={false}\n persistentElements={[() => rootRef.current]}\n onEscapeKeyDown={focusFieldFromPopup}\n positioning={{ placement: 'bottom-start', sameWidth: true }}\n >\n <div ref={rootRef} className={cx('ds-combobox', `ds-combobox--${size}`, className)}>\n {label && (\n <label\n id={labelId}\n htmlFor={inputId}\n className=\"ds-combobox__label\"\n data-disabled={disabled ? '' : undefined}\n >\n {label}\n </label>\n )}\n <ArkPopover.Anchor className=\"ds-combobox__control\">\n <input\n ref={setInputRef}\n id={inputId}\n type=\"text\"\n role=\"combobox\"\n className=\"ds-combobox__input\"\n value={inputValue}\n placeholder={placeholder}\n aria-label={label ? undefined : ariaLabel}\n aria-autocomplete=\"list\"\n aria-haspopup={isGrid ? 'grid' : 'listbox'}\n aria-expanded={isOpen}\n aria-controls={isOpen ? listId : undefined}\n aria-activedescendant={activeDescendant}\n aria-describedby={isOpen && hasStatus ? statusId : undefined}\n aria-invalid={invalid || undefined}\n data-invalid={invalid ? '' : undefined}\n disabled={disabled}\n autoComplete=\"off\"\n autoCorrect=\"off\"\n autoCapitalize=\"none\"\n spellCheck={false}\n onChange={handleChange}\n onClick={() => setOpen(true)}\n onKeyDown={handleKeyDown}\n />\n </ArkPopover.Anchor>\n </div>\n\n <Portal container={portalContainer}>\n <ArkPopover.Positioner>\n <ArkPopover.Content\n ref={contentRef}\n role=\"presentation\"\n className=\"ds-combobox__content\"\n onMouseDown={handleContentMouseDown}\n onClick={handleListClick}\n onPointerMove={handleListPointerMove}\n >\n {hasHeader && (\n <div ref={headerRef} className=\"ds-combobox__header\">\n {toolbar && <div className=\"ds-combobox__toolbar\">{toolbar}</div>}\n {hasStatus && (\n <p id={statusId} role=\"status\" className=\"ds-combobox__status\">\n {status}\n {pinned && (\n <>\n {' '}\n <PinnedChip facet={pinned} removeIcon={removeIcon} onRemove={unpin} />\n </>\n )}\n </p>\n )}\n </div>\n )}\n {facets ? (\n <GridList\n id={listId}\n name={listName}\n facets={facets}\n sections={sections}\n emptyText={isEmpty ? emptyText : undefined}\n pinIcon={pinIcon}\n />\n ) : (\n <ListboxList\n id={listId}\n name={listName}\n sections={sections}\n emptyText={isEmpty ? emptyText : undefined}\n />\n )}\n </ArkPopover.Content>\n </ArkPopover.Positioner>\n </Portal>\n </ArkPopover.Root>\n );\n}\n\ninterface RowModel {\n item: ComboboxItem;\n index: number;\n rowId: string;\n itemCellId: string;\n facetCellId: string;\n highlighted: boolean;\n pinnable: boolean;\n pinned: boolean;\n pinActive: boolean;\n}\n\ninterface Section {\n label?: string;\n headingId: string;\n rows: RowModel[];\n}\n\ninterface ListProps {\n id: string;\n name: { 'aria-labelledby': string } | { 'aria-label': string | undefined };\n sections: Section[];\n emptyText: ReactNode;\n}\n\nconst rowState = (row: RowModel) => ({\n 'data-index': row.index,\n 'data-highlighted': row.highlighted ? '' : undefined,\n 'data-disabled': row.item.disabled ? '' : undefined,\n});\n\nfunction ItemText({ item }: { item: ComboboxItem }) {\n return (\n <>\n <span className=\"ds-combobox__item-label\">{item.label}</span>\n {item.description && (\n <>\n {' '}\n <span className=\"ds-combobox__item-description\">{item.description}</span>\n </>\n )}\n </>\n );\n}\n\n/*\n * The listbox's options and groups take their roles on plain elements: the\n * field keeps focus and points at an option with aria-activedescendant, so\n * none of them is focusable, and HTML has no element for an option outside\n * a native select. The lint rules asking for focusable or native elements\n * are therefore suppressed here, and only here.\n */\nfunction ListboxList({ id, name, sections, emptyText }: ListProps) {\n const option = (row: RowModel) => (\n // biome-ignore lint/a11y/useFocusableInteractive: reached through aria-activedescendant from the field, never by focus\n <div\n key={row.item.value}\n id={row.rowId}\n role=\"option\"\n aria-selected=\"false\"\n aria-disabled={row.item.disabled}\n className=\"ds-combobox__item\"\n {...rowState(row)}\n >\n <ItemText item={row.item} />\n </div>\n );\n return (\n <div id={id} role=\"listbox\" className=\"ds-combobox__list\" {...name}>\n {sections.map((section) =>\n section.label === undefined ? (\n section.rows.map(option)\n ) : (\n // biome-ignore lint/a11y/useSemanticElements: a fieldset is a form group, not a group of options\n <div\n key={section.label}\n role=\"group\"\n aria-labelledby={section.headingId}\n className=\"ds-combobox__group\"\n >\n <div id={section.headingId} className=\"ds-combobox__group-label\">\n {section.label}\n </div>\n {section.rows.map(option)}\n </div>\n ),\n )}\n {emptyText !== undefined && (\n // biome-ignore lint/a11y/useFocusableInteractive: a disabled option the keyboard never lands on\n <div\n role=\"option\"\n aria-disabled=\"true\"\n aria-selected=\"false\"\n className=\"ds-combobox__empty\"\n >\n {emptyText}\n </div>\n )}\n </div>\n );\n}\n\ninterface GridListProps extends ListProps {\n facets: ComboboxFacets;\n pinIcon: IconSource;\n}\n\n/*\n * A table in the grid role: its rows and cells line up in two columns by\n * themselves, and a group of rows is a `tbody` named by its heading row.\n * The keyboard skips heading rows, as it skips a listbox's group labels.\n */\nfunction GridList({ id, name, facets, sections, emptyText, pinIcon }: GridListProps) {\n const row = (model: RowModel) => <GridRow key={model.item.value} row={model} pinIcon={pinIcon} />;\n return (\n // biome-ignore lint/a11y/noNoninteractiveElementToInteractiveRole: a table in the grid role is the APG grid pattern; its cells line up by themselves\n <table id={id} role=\"grid\" className=\"ds-combobox__list ds-combobox__list--grid\" {...name}>\n <thead className=\"ds-visually-hidden\">\n <tr>\n <th scope=\"col\">{facets.itemLabel}</th>\n <th scope=\"col\">{facets.label}</th>\n </tr>\n </thead>\n {sections.map((section) =>\n section.label === undefined ? (\n <tbody key=\"ungrouped\">{section.rows.map(row)}</tbody>\n ) : (\n <tbody\n key={section.label}\n aria-labelledby={section.headingId}\n className=\"ds-combobox__group\"\n >\n <tr>\n <th\n id={section.headingId}\n colSpan={2}\n scope=\"colgroup\"\n className=\"ds-combobox__group-label\"\n >\n {section.label}\n </th>\n </tr>\n {section.rows.map(row)}\n </tbody>\n ),\n )}\n {emptyText !== undefined && (\n <tbody>\n <tr>\n <GridCell colSpan={2} aria-disabled=\"true\" className=\"ds-combobox__empty\">\n {emptyText}\n </GridCell>\n </tr>\n </tbody>\n )}\n </table>\n );\n}\n\n/*\n * A cell of the grid, named so explicitly: a `td` in a grid table is a\n * gridcell to browsers, but not to every tool, and the field keeps focus\n * and points at the cell with aria-activedescendant, so it is not focusable.\n */\nfunction GridCell(props: TdHTMLAttributes<HTMLTableCellElement>) {\n // biome-ignore lint/a11y/useFocusableInteractive: reached through aria-activedescendant from the field, never by focus\n // biome-ignore lint/a11y/noNoninteractiveElementToInteractiveRole: a td in a grid table is a gridcell; named so for every tool\n return <td role=\"gridcell\" {...props} />;\n}\n\nfunction GridRow({ row, pinIcon }: { row: RowModel; pinIcon: IconSource }) {\n const { item } = row;\n return (\n <tr id={row.rowId} className=\"ds-combobox__item\" {...rowState(row)}>\n <GridCell id={row.itemCellId} className=\"ds-combobox__cell\" aria-disabled={item.disabled}>\n <ItemText item={item} />\n </GridCell>\n <GridCell id={row.facetCellId} className=\"ds-combobox__facet\">\n {item.facet && <FacetCell facet={item.facet} row={row} pinIcon={pinIcon} />}\n </GridCell>\n </tr>\n );\n}\n\nfunction FacetCell({\n facet,\n row,\n pinIcon,\n}: {\n facet: ComboboxFacet;\n row: RowModel;\n pinIcon: IconSource;\n}) {\n return (\n <span className=\"ds-combobox__facet-content\">\n {facet.icon}\n <span className=\"ds-combobox__facet-label\">{facet.label}</span>\n {row.pinnable && (\n <Tooltip content={`Filter by ${facet.label}`} kind=\"label\">\n <button\n type=\"button\"\n tabIndex={-1}\n className=\"ds-combobox__pin\"\n aria-label={`Filter by ${facet.label}`}\n aria-pressed={row.pinned}\n data-pin=\"\"\n data-active={row.pinActive ? '' : undefined}\n >\n <Icon source={pinIcon} size=\"sm\" decorative />\n </button>\n </Tooltip>\n )}\n </span>\n );\n}\n\ninterface PinnedChipProps {\n facet: ComboboxFacet;\n removeIcon: IconSource;\n onRemove: () => void;\n}\n\nfunction PinnedChip({ facet, removeIcon, onRemove }: PinnedChipProps) {\n return (\n <span className=\"ds-combobox__chip\">\n {facet.icon}\n <span>{facet.label}</span>\n <Tooltip content=\"Stop filtering\" kind=\"label\">\n <button\n type=\"button\"\n className=\"ds-combobox__chip-remove\"\n aria-label={`Stop filtering by ${facet.label}`}\n onClick={onRemove}\n >\n <Icon source={removeIcon} size=\"sm\" decorative />\n </button>\n </Tooltip>\n </span>\n );\n}\n"]}
package/dist/index.d.ts CHANGED
@@ -39,6 +39,7 @@ export * from './sticky';
39
39
  export * from './switch';
40
40
  export * from './tabs';
41
41
  export * from './text';
42
+ export * from './tooltip';
42
43
  export * from './visually-hidden';
43
44
  export * from './wizard-layout';
44
45
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,mBAAmB,CAAC;AAClC,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,EAAE,EAAE,MAAM,MAAM,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,OAAO,EACL,KAAK,IAAI,aAAa,EACtB,WAAW,IAAI,mBAAmB,EAClC,YAAY,IAAI,oBAAoB,EACpC,K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c,eAAe,CAAC;AAC9B,OAAO,EACL,KAAK,IAAI,aAAa,EACtB,WAAW,IAAI,mBAAmB,EAClC,YAAY,IAAI,oBAAoB,EACpC,KAAK,IAAI,aAAa,EACtB,GAAG,IAAI,WAAW,GACnB,MAAM,mBAAmB,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC;AAC9B,cAAc,QAAQ,CAAC;AACvB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,YAAY,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAC3D,cAAc,QAAQ,CAAC;AACvB,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC"}
package/dist/index.js CHANGED
@@ -38,6 +38,7 @@ export * from './sticky';
38
38
  export * from './switch';
39
39
  export * from './tabs';
40
40
  export * from './text';
41
+ export * from './tooltip';
41
42
  export * from './visually-hidden';
42
43
  export * from './wizard-layout';
43
44
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,UAA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from './breadcrumb';\nexport * from './button';\nexport * from './calendar';\nexport * from './card';\nexport * from './centered-layout';\nexport * from './checkbox';\nexport * from './combobox';\nexport { cx } from './cx';\nexport * from './date-input';\nexport * from './dialog';\nexport * from './divider';\nexport * from './empty-state';\nexport {\n Check as FallbackCheck,\n ChevronLeft as FallbackChevronLeft,\n ChevronRight as FallbackChevronRight,\n Cross as FallbackCross,\n Pin as FallbackPin,\n} from './fallback-glyphs';\nexport * from './field';\nexport * from './form-layout';\nexport * from './icon';\nexport * from './illustration';\nexport * from './layout';\nexport * from './link';\nexport type { LinkComponentProps } from './link-component';\nexport * from './menu';\nexport * from './page-layout';\nexport * from './popover';\nexport * from './progress';\nexport * from './reorder-control';\nexport * from './scroll-area';\nexport * from './section';\nexport * from './segment-group';\nexport * from './select';\nexport * from './show';\nexport * from './skeleton';\nexport * from './slider';\nexport * from './spinner';\nexport * from './split-layout';\nexport * from './sticky';\nexport * from './switch';\nexport * from './tabs';\nexport * from './text';\nexport * from './visually-hidden';\nexport * from './wizard-layout';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,mBAAmB,CAAC;AAClC,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,EAAE,EAAE,MAAM,MAAM,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,OAAO,EACL,KAAK,IAAI,aAAa,EACtB,WAAW,IAAI,mBAAmB,EAClC,YAAY,IAAI,oBAAoB,EACpC,KAAK,IAAI,aAAa,EACtB,GAAG,IAAI,WAAW,GACnB,MAAM,mBAAmB,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC;AAC9B,cAAc,QAAQ,CAAC;AACvB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AAEvB,cAAc,QAAQ,CAAC;AACvB,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC","sourcesContent":["export * from './alert';\nexport * from './avatar';\nexport * from './badge';\nexport * from './breadcrumb';\nexport * from './button';\nexport * from './calendar';\nexport * from './card';\nexport * from './centered-layout';\nexport * from './checkbox';\nexport * from './combobox';\nexport { cx } from './cx';\nexport * from './date-input';\nexport * from './dialog';\nexport * from './divider';\nexport * from './empty-state';\nexport {\n Check as FallbackCheck,\n ChevronLeft as FallbackChevronLeft,\n ChevronRight as FallbackChevronRight,\n Cross as FallbackCross,\n Pin as FallbackPin,\n} from './fallback-glyphs';\nexport * from './field';\nexport * from './form-layout';\nexport * from './icon';\nexport * from './illustration';\nexport * from './layout';\nexport * from './link';\nexport type { LinkComponentProps } from './link-component';\nexport * from './menu';\nexport * from './page-layout';\nexport * from './popover';\nexport * from './progress';\nexport * from './reorder-control';\nexport * from './scroll-area';\nexport * from './section';\nexport * from './segment-group';\nexport * from './select';\nexport * from './show';\nexport * from './skeleton';\nexport * from './slider';\nexport * from './spinner';\nexport * from './split-layout';\nexport * from './sticky';\nexport * from './switch';\nexport * from './tabs';\nexport * from './text';\nexport * from './tooltip';\nexport * from './visually-hidden';\nexport * from './wizard-layout';\n"]}
@@ -1,2 +1,2 @@
1
- export { SegmentGroup, type SegmentGroupItem, type SegmentGroupProps, type SegmentGroupSize, } from './segment-group';
1
+ export { SegmentGroup, type SegmentGroupCustom, type SegmentGroupItem, type SegmentGroupProps, type SegmentGroupSize, } from './segment-group';
2
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/segment-group/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,GACtB,MAAM,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/segment-group/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,GACtB,MAAM,iBAAiB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/segment-group/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,GAIb,MAAM,iBAAiB,CAAC","sourcesContent":["export {\n SegmentGroup,\n type SegmentGroupItem,\n type SegmentGroupProps,\n type SegmentGroupSize,\n} from './segment-group';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/segment-group/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,GAKb,MAAM,iBAAiB,CAAC","sourcesContent":["export {\n SegmentGroup,\n type SegmentGroupCustom,\n type SegmentGroupItem,\n type SegmentGroupProps,\n type SegmentGroupSize,\n} from './segment-group';\n"]}
@@ -17,11 +17,12 @@
17
17
  calc(var(--ds-segment-group-track-radius) - var(--ds-segment-group-track-padding))
18
18
  );
19
19
 
20
+ /* Field's label, whatever the group's size, as every control a form names. */
20
21
  & .ds-segment-group__label {
21
22
  min-inline-size: 0;
22
- color: var(--ds-segment-group-label-text);
23
- font-size: var(--_segment-group-font-size);
24
- font-weight: var(--ds-segment-group-label-font-weight);
23
+ color: var(--ds-field-label-text);
24
+ font-size: var(--ds-field-label-font-size);
25
+ font-weight: var(--ds-field-label-font-weight);
25
26
  }
26
27
 
27
28
  /*
@@ -96,6 +97,65 @@
96
97
  }
97
98
  }
98
99
 
100
+ /*
101
+ * The custom field sits in the track as one more segment, drawn as a
102
+ * field so it reads as typed rather than chosen. While it is the choice
103
+ * its border takes the checked segment's colour.
104
+ */
105
+ & .ds-segment-group__custom {
106
+ display: inline-flex;
107
+ align-items: center;
108
+ gap: var(--ds-segment-group-custom-gap);
109
+ min-inline-size: 0;
110
+ padding: var(--_segment-group-padding-block) var(--_segment-group-padding-inline);
111
+ border: 1px solid var(--ds-input-border);
112
+ border-radius: var(--_segment-group-inner-radius);
113
+ background-color: var(--ds-input-bg);
114
+ color: var(--ds-input-text);
115
+ font-size: var(--_segment-group-font-size);
116
+ cursor: text;
117
+
118
+ &:hover:not([data-disabled]) {
119
+ border-color: var(--ds-input-border-hover);
120
+ }
121
+
122
+ &[data-state="checked"] {
123
+ border-color: var(--ds-segment-group-item-bg-checked);
124
+ box-shadow: 0 0 0 1px var(--ds-segment-group-item-bg-checked);
125
+ }
126
+
127
+ &:focus-within {
128
+ outline: 2px solid var(--ds-segment-group-focus-ring);
129
+ outline-offset: 3px;
130
+ }
131
+
132
+ &[data-disabled] {
133
+ opacity: var(--ds-opacity-disabled);
134
+ cursor: not-allowed;
135
+ }
136
+ }
137
+
138
+ & .ds-segment-group__custom-input {
139
+ flex: 1 1 auto;
140
+ inline-size: 100%;
141
+ min-inline-size: 3ch;
142
+ padding: 0;
143
+ border: 0;
144
+ background: transparent;
145
+ color: inherit;
146
+ font: inherit;
147
+ outline: none;
148
+
149
+ &::placeholder {
150
+ color: var(--ds-input-placeholder);
151
+ }
152
+ }
153
+
154
+ & .ds-segment-group__custom-unit {
155
+ flex-shrink: 0;
156
+ color: var(--ds-segment-group-item-text);
157
+ }
158
+
99
159
  /*
100
160
  * Content-sized: each segment starts at its label's width and the spare
101
161
  * width is shared out evenly. Short of room the segments shrink, but no
@@ -9,6 +9,26 @@ export interface SegmentGroupItem {
9
9
  /** Individually disable this choice without removing it. */
10
10
  disabled?: boolean;
11
11
  }
12
+ /**
13
+ * A value typed beside the segments, for one no segment offers: the minutes
14
+ * of a duration whose presets are 30 minutes and an hour. The consumer owns
15
+ * both values and keeps them agreeing: a typed value that matches a segment
16
+ * checks that segment, and choosing a segment fills the field with its value.
17
+ */
18
+ export interface SegmentGroupCustom {
19
+ /** What the field holds, `''` when empty. */
20
+ value: string;
21
+ /** Fired with the field's text on every change. */
22
+ onValueChange: (value: string) => void;
23
+ /** The field's accessible name ("Duration in minutes"); it has no visible label of its own. */
24
+ 'aria-label': string;
25
+ /** Shown while the field is empty. */
26
+ placeholder?: string;
27
+ /** A unit written after the value, such as `min`. Decorative: put the unit in `aria-label` too. */
28
+ unit?: string;
29
+ /** The keyboard a phone shows for the field. */
30
+ inputMode?: 'numeric' | 'decimal' | 'text';
31
+ }
12
32
  /**
13
33
  * A segment group has to have a name. A visible `label` is the one to reach
14
34
  * for; expressed as a union so an unnamed group is a compile error rather
@@ -64,6 +84,12 @@ export type SegmentGroupProps = SegmentGroupName & {
64
84
  * a state or effort choice in a form, level with the fields above it.
65
85
  */
66
86
  fullWidth?: boolean;
87
+ /**
88
+ * A field at the end of the track for a value no segment offers. While it
89
+ * holds a value and no segment is checked, it is drawn as the choice and
90
+ * submits under `name`.
91
+ */
92
+ custom?: SegmentGroupCustom;
67
93
  /** Disable every segment. The checked one keeps showing which is set. */
68
94
  disabled?: boolean;
69
95
  /** Name for native form participation through the hidden radio inputs. */
@@ -98,6 +124,6 @@ export type SegmentGroupProps = SegmentGroupName & {
98
124
  * want a `Select`. Panels that change with the choice are `Tabs`; a segment
99
125
  * group changes a value, not what is on the page.
100
126
  */
101
- export declare function SegmentGroup({ label, items, value, defaultValue, onValueChange, size, fit, density, fullWidth, disabled, name, className, 'aria-label': ariaLabel, }: SegmentGroupProps): import("react/jsx-runtime").JSX.Element;
127
+ export declare function SegmentGroup({ label, items, value, defaultValue, onValueChange, size, fit, density, fullWidth, custom, disabled, name, className, 'aria-label': ariaLabel, }: SegmentGroupProps): import("react/jsx-runtime").JSX.Element;
102
128
  export {};
103
129
  //# sourceMappingURL=segment-group.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"segment-group.d.ts","sourceRoot":"","sources":["../../src/segment-group/segment-group.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,SAAS,EAAU,MAAM,OAAO,CAAC;AAC/C,OAAO,qBAAqB,CAAC;AAG7B,MAAM,MAAM,gBAAgB,GAAG,IAAI,GAAG,IAAI,CAAC;AAE3C,MAAM,WAAW,gBAAgB;IAC/B,0EAA0E;IAC1E,KAAK,EAAE,MAAM,CAAC;IACd,kGAAkG;IAClG,KAAK,EAAE,MAAM,CAAC;IACd,4DAA4D;IAC5D,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;;;GAIG;AACH,KAAK,gBAAgB,GACjB;IACE,oEAAoE;IACpE,KAAK,EAAE,SAAS,CAAC;IACjB;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,GACD;IACE,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,2FAA2F;IAC3F,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAEN,MAAM,MAAM,iBAAiB,GAAG,gBAAgB,GAAG;IACjD,qDAAqD;IACrD,KAAK,EAAE,gBAAgB,EAAE,CAAC;IAC1B;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,uCAAuC;IACvC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,4EAA4E;IAC5E,IAAI,CAAC,EAAE,gBAAgB,CAAC;IACxB;;;;;;OAMG;IACH,GAAG,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC1B;;;OAGG;IACH,OAAO,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC;IAC9B;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,yEAAyE;IACzE,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,0EAA0E;IAC1E,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,yEAAyE;IACzE,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,YAAY,CAAC,EAC3B,KAAK,EACL,KAAK,EACL,KAAK,EACL,YAAY,EACZ,aAAa,EACb,IAAW,EACX,GAAa,EACb,OAAmB,EACnB,SAAiB,EACjB,QAAQ,EACR,IAAI,EACJ,SAAS,EACT,YAAY,EAAE,SAAS,GACxB,EAAE,iBAAiB,2CAuEnB"}
1
+ {"version":3,"file":"segment-group.d.ts","sourceRoot":"","sources":["../../src/segment-group/segment-group.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,SAAS,EAAU,MAAM,OAAO,CAAC;AAC/C,OAAO,qBAAqB,CAAC;AAG7B,MAAM,MAAM,gBAAgB,GAAG,IAAI,GAAG,IAAI,CAAC;AAE3C,MAAM,WAAW,gBAAgB;IAC/B,0EAA0E;IAC1E,KAAK,EAAE,MAAM,CAAC;IACd,kGAAkG;IAClG,KAAK,EAAE,MAAM,CAAC;IACd,4DAA4D;IAC5D,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;;;;GAKG;AACH,MAAM,WAAW,kB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0E;IAC1E,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,yEAAyE;IACzE,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,YAAY,CAAC,EAC3B,KAAK,EACL,KAAK,EACL,KAAK,EACL,YAAY,EACZ,aAAa,EACb,IAAW,EACX,GAAa,EACb,OAAmB,EACnB,SAAiB,EACjB,MAAM,EACN,QAAQ,EACR,IAAI,EACJ,SAAS,EACT,YAAY,EAAE,SAAS,GACxB,EAAE,iBAAiB,2CA8GnB"}
@@ -30,7 +30,7 @@ import { cx } from '../cx';
30
30
  * want a `Select`. Panels that change with the choice are `Tabs`; a segment
31
31
  * group changes a value, not what is on the page.
32
32
  */
33
- export function SegmentGroup({ label, items, value, defaultValue, onValueChange, size = 'md', fit = 'equal', density = 'default', fullWidth = false, disabled, name, className, 'aria-label': ariaLabel, }) {
33
+ export function SegmentGroup({ label, items, value, defaultValue, onValueChange, size = 'md', fit = 'equal', density = 'default', fullWidth = false, custom, disabled, name, className, 'aria-label': ariaLabel, }) {
34
34
  const rootRef = useRef(null);
35
35
  /*
36
36
  * Zag reports `null` only when the value is cleared through its API, which
@@ -59,6 +59,15 @@ export function SegmentGroup({ label, items, value, defaultValue, onValueChange,
59
59
  const visibleLabel = label &&
60
60
  (ariaLabel ? (_jsx("span", { className: "ds-segment-group__label", children: label })) : (_jsx(ArkSegmentGroup.Label, { className: "ds-segment-group__label", children: label })));
61
61
  const renderItem = (item) => (_jsxs(ArkSegmentGroup.Item, { value: item.value, disabled: item.disabled, className: "ds-segment-group__item", children: [_jsx(ArkSegmentGroup.ItemText, { className: "ds-segment-group__item-text", children: item.label }), _jsx(ArkSegmentGroup.ItemHiddenInput, {})] }, item.value));
62
- return (_jsxs(ArkSegmentGroup.Root, { ref: rootRef, className: cx('ds-segment-group', `ds-segment-group--${size}`, fit === 'content' && 'ds-segment-group--fit-content', density === 'dense' && 'ds-segment-group--dense', fullWidth && 'ds-segment-group--full-width', className), value: value, defaultValue: defaultValue, onValueChange: handleValueChange, disabled: disabled, name: name, orientation: "horizontal", "aria-label": ariaLabel, children: [visibleLabel, _jsx("div", { className: "ds-segment-group__track", children: items.map(renderItem) })] }));
62
+ /*
63
+ * The field is the choice while it holds a value no segment has. That is
64
+ * read from Ark's own value, so an uncontrolled group draws it right too,
65
+ * and it submits under `name` only then, when no radio is checked.
66
+ */
67
+ const renderCustom = (custom, current) => {
68
+ const chosen = custom.value !== '' && !items.some((item) => item.value === current);
69
+ return (_jsxs("label", { className: "ds-segment-group__custom", "data-state": chosen ? 'checked' : 'unchecked', "data-disabled": disabled ? '' : undefined, children: [_jsx("input", { className: "ds-segment-group__custom-input", value: custom.value, onChange: (event) => custom.onValueChange(event.target.value), "aria-label": custom['aria-label'], placeholder: custom.placeholder, inputMode: custom.inputMode, name: chosen ? name : undefined, disabled: disabled }), custom.unit && (_jsx("span", { className: "ds-segment-group__custom-unit", "aria-hidden": "true", children: custom.unit }))] }));
70
+ };
71
+ return (_jsxs(ArkSegmentGroup.Root, { ref: rootRef, className: cx('ds-segment-group', `ds-segment-group--${size}`, fit === 'content' && 'ds-segment-group--fit-content', density === 'dense' && 'ds-segment-group--dense', fullWidth && 'ds-segment-group--full-width', className), value: value, defaultValue: defaultValue, onValueChange: handleValueChange, disabled: disabled, name: name, orientation: "horizontal", "aria-label": ariaLabel, children: [visibleLabel, _jsxs("div", { className: "ds-segment-group__track", children: [items.map(renderItem), custom && (_jsx(ArkSegmentGroup.Context, { children: (group) => renderCustom(custom, group.value) }))] })] }));
63
72
  }
64
73
  //# sourceMappingURL=segment-group.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"segment-group.js","sourceRoot":"","sources":["../../src/segment-group/segment-group.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,IAAI,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9E,OAAO,EAAkB,MAAM,EAAE,MAAM,OAAO,C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,EACjB,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,SAAS,EAAC,wBAAwB,aAElC,KAAC,eAAe,CAAC,QAAQ,IAAC,SAAS,EAAC,6BAA6B,YAC9D,IAAI,CAAC,KAAK,GACc,EAC3B,KAAC,eAAe,CAAC,eAAe,KAAG,KAR9B,IAAI,CAAC,KAAK,CASM,CACxB,CAAC;IAEF,OAAO,CACL,MAAC,eAAe,CAAC,IAAI,IACnB,GAAG,EAAE,OAAO,EACZ,SAAS,EAAE,EAAE,CACX,kBAAkB,EAClB,qBAAqB,IAAI,EAAE,EAC3B,GAAG,KAAK,SAAS,IAAI,+BAA+B,EACpD,OAAO,KAAK,OAAO,IAAI,yBAAyB,EAChD,SAAS,IAAI,8BAA8B,EAC3C,SAAS,CACV,EACD,KAAK,EAAE,KAAK,EACZ,YAAY,EAAE,YAAY,EAC1B,aAAa,EAAE,iBAAiB,EAChC,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,IAAI,EACV,WAAW,EAAC,YAAY,gBACZ,SAAS,aAEpB,YAAY,EACb,cAAK,SAAS,EAAC,yBAAyB,YAAE,KAAK,CAAC,GAAG,CAAC,UAAU,CAAC,GAAO,IACjD,CACxB,CAAC;AACJ,CAAC","sourcesContent":["import { SegmentGroup as ArkSegmentGroup } from '@ark-ui/react/segment-group';\nimport { type ReactNode, useRef } from 'react';\nimport './segment-group.css';\nimport { cx } from '../cx';\n\nexport type SegmentGroupSize = 'sm' | 'md';\n\nexport interface SegmentGroupItem {\n /** Stable value reported by `onValueChange` and compared with `value`. */\n value: string;\n /** Text shown on the segment. Keep it to a word or two; a longer one wraps inside its segment. */\n label: string;\n /** Individually disable this choice without removing it. */\n disabled?: boolean;\n}\n\n/**\n * A segment group has to have a name. A visible `label` is the one to reach\n * for; expressed as a union so an unnamed group is a compile error rather\n * than an axe finding, as `Checkbox` and `Switch` do.\n */\ntype SegmentGroupName =\n | {\n /** Visible label, rendered above the track and naming the group. */\n label: ReactNode;\n /**\n * A different accessible name when the visible label alone would not\n * say what the choice is. Keep the visible words in it (\"Period\" →\n * \"Reporting period\"), so a voice user can still say what they see.\n */\n 'aria-label'?: string;\n }\n | {\n label?: undefined;\n /** Accessible name when the surrounding heading or row already says what the choice is. */\n 'aria-label': string;\n };\n\nexport type SegmentGroupProps = SegmentGroupName & {\n /** The choices, in order. Exactly one is checked. */\n items: SegmentGroupItem[];\n /**\n * Controlled value. `null` is controlled with nothing checked, for a form\n * that starts without a choice; `undefined` leaves the component to own\n * its value from `defaultValue` onward, as `Select` does.\n */\n value?: string | null;\n /** Initial value when uncontrolled. */\n defaultValue?: string;\n /**\n * Fired with the newly checked value. Choosing the checked segment again\n * does nothing, so a consumer that saves on change never writes twice.\n */\n onValueChange?: (value: string) => void;\n /** Segment height and type scale. `sm` suits a toolbar or a card header. */\n size?: SegmentGroupSize;\n /**\n * How the segments share the track. `equal` (default): every segment as\n * wide as the widest, and a word longer than its column breaks inside it.\n * `content`: each segment as wide as its own label, the spare width shared\n * out, so a group of labels of uneven length fits a narrow container\n * without breaking a word.\n */\n fit?: 'equal' | 'content';\n /**\n * `dense` tightens each segment's inline padding, for a group of many\n * short items (six t-shirt sizes) that has to fit a phone.\n */\n density?: 'default' | 'dense';\n /**\n * Whether the group takes the whole width of its row, the track with it:\n * a state or effort choice in a form, level with the fields above it.\n */\n fullWidth?: boolean;\n /** Disable every segment. The checked one keeps showing which is set. */\n disabled?: boolean;\n /** Name for native form participation through the hidden radio inputs. */\n name?: string;\n /** Extra class names appended after the `ds-segment-group` modifiers. */\n className?: string;\n};\n\n/**\n * One choice among a few, shown as a row of segments, built on Ark UI's\n * SegmentGroup: a radio group whose radios are drawn as one control.\n *\n * Ark owns the behaviour: hidden radio inputs carry the state, the arrow keys\n * move the choice, and the whole segment is its radio's label. This wrapper\n * contributes `ds-` classes, the `--ds-segment-group-*` bindings and a flat\n * `items` API in place of Ark's anatomy.\n *\n * ```tsx\n * <SegmentGroup\n * label=\"Period\"\n * items={[\n * { value: 'today', label: 'Today' },\n * { value: 'week', label: 'Week' },\n * { value: 'month', label: 'Month' },\n * ]}\n * value={period}\n * onValueChange={setPeriod}\n * />\n * ```\n *\n * Reach for it when the choices are few, short and all worth seeing at once:\n * a period, a size, a view. More than five, or labels that need a sentence,\n * want a `Select`. Panels that change with the choice are `Tabs`; a segment\n * group changes a value, not what is on the page.\n */\nexport function SegmentGroup({\n label,\n items,\n value,\n defaultValue,\n onValueChange,\n size = 'md',\n fit = 'equal',\n density = 'default',\n fullWidth = false,\n disabled,\n name,\n className,\n 'aria-label': ariaLabel,\n}: SegmentGroupProps) {\n const rootRef = useRef<HTMLDivElement>(null);\n\n /*\n * Zag reports `null` only when the value is cleared through its API, which\n * this wrapper never calls; a user can only move the choice to a segment.\n *\n * Ark renders the hidden radios uncontrolled and syncs them only when its\n * own state changes, so a controlled parent that declines a choice would\n * leave the native radio checked while the segment shows the old one.\n * Restoring the parent's value after Ark has read the radios keeps the two\n * agreeing, as Checkbox and Switch do.\n */\n const handleValueChange = (details: { value: string | null }) => {\n if (details.value !== null) onValueChange?.(details.value);\n if (value === undefined || !rootRef.current) return;\n for (const input of rootRef.current.querySelectorAll<HTMLInputElement>('input[type=\"radio\"]')) {\n input.checked = input.value === value;\n }\n };\n\n /*\n * Zag always names the root by its label part's id, which would outrank an\n * `aria-label`. With both given, the visible label is plain text instead,\n * so that id resolves to nothing and the `aria-label` is what is announced.\n */\n const visibleLabel =\n label &&\n (ariaLabel ? (\n <span className=\"ds-segment-group__label\">{label}</span>\n ) : (\n <ArkSegmentGroup.Label className=\"ds-segment-group__label\">{label}</ArkSegmentGroup.Label>\n ));\n\n const renderItem = (item: SegmentGroupItem) => (\n <ArkSegmentGroup.Item\n key={item.value}\n value={item.value}\n disabled={item.disabled}\n className=\"ds-segment-group__item\"\n >\n <ArkSegmentGroup.ItemText className=\"ds-segment-group__item-text\">\n {item.label}\n </ArkSegmentGroup.ItemText>\n <ArkSegmentGroup.ItemHiddenInput />\n </ArkSegmentGroup.Item>\n );\n\n return (\n <ArkSegmentGroup.Root\n ref={rootRef}\n className={cx(\n 'ds-segment-group',\n `ds-segment-group--${size}`,\n fit === 'content' && 'ds-segment-group--fit-content',\n density === 'dense' && 'ds-segment-group--dense',\n fullWidth && 'ds-segment-group--full-width',\n className,\n )}\n value={value}\n defaultValue={defaultValue}\n onValueChange={handleValueChange}\n disabled={disabled}\n name={name}\n orientation=\"horizontal\"\n aria-label={ariaLabel}\n >\n {visibleLabel}\n <div className=\"ds-segment-group__track\">{items.map(renderItem)}</div>\n </ArkSegmentGroup.Root>\n );\n}\n"]}
1
+ {"version":3,"file":"segment-group.js","sourceRoot":"","sources":["../../src/segment-group/segment-group.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,IAAI,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9E,OAAO,EAAkB,MAAM,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,qBAAqB,CAAC;AAC7B,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AA0G3B;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,UAAU,YAAY,CAAC,EAC3B,KAAK,EACL,KAAK,EACL,KAAK,EACL,YAAY,EACZ,aAAa,EACb,IAAI,GAAG,IAAI,EACX,GAAG,GAAG,OAAO,EACb,OAAO,GAAG,SAAS,EACnB,SAAS,GAAG,KAAK,EACjB,MAAM,EACN,QAAQ,EACR,IAAI,EACJ,SAAS,EACT,YAAY,EAAE,SAAS,GACL;IAClB,MAAM,OAAO,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;IAE7C;;;;;;;;;OASG;IACH,MAAM,iBAAiB,GAAG,CAAC,OAAiC,EAAE,EAAE;QAC9D,IAAI,OAAO,CAAC,KAAK,KAAK,IAAI;YAAE,aAAa,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QAC3D,IAAI,KAAK,KAAK,SAAS,IAAI,CAAC,OAAO,CAAC,OAAO;YAAE,O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ui/react/segment-group';\nimport { type ReactNode, useRef } from 'react';\nimport './segment-group.css';\nimport { cx } from '../cx';\n\nexport type SegmentGroupSize = 'sm' | 'md';\n\nexport interface SegmentGroupItem {\n /** Stable value reported by `onValueChange` and compared with `value`. */\n value: string;\n /** Text shown on the segment. Keep it to a word or two; a longer one wraps inside its segment. */\n label: string;\n /** Individually disable this choice without removing it. */\n disabled?: boolean;\n}\n\n/**\n * A value typed beside the segments, for one no segment offers: the minutes\n * of a duration whose presets are 30 minutes and an hour. The consumer owns\n * both values and keeps them agreeing: a typed value that matches a segment\n * checks that segment, and choosing a segment fills the field with its value.\n */\nexport interface SegmentGroupCustom {\n /** What the field holds, `''` when empty. */\n value: string;\n /** Fired with the field's text on every change. */\n onValueChange: (value: string) => void;\n /** The field's accessible name (\"Duration in minutes\"); it has no visible label of its own. */\n 'aria-label': string;\n /** Shown while the field is empty. */\n placeholder?: string;\n /** A unit written after the value, such as `min`. Decorative: put the unit in `aria-label` too. */\n unit?: string;\n /** The keyboard a phone shows for the field. */\n inputMode?: 'numeric' | 'decimal' | 'text';\n}\n\n/**\n * A segment group has to have a name. A visible `label` is the one to reach\n * for; expressed as a union so an unnamed group is a compile error rather\n * than an axe finding, as `Checkbox` and `Switch` do.\n */\ntype SegmentGroupName =\n | {\n /** Visible label, rendered above the track and naming the group. */\n label: ReactNode;\n /**\n * A different accessible name when the visible label alone would not\n * say what the choice is. Keep the visible words in it (\"Period\" →\n * \"Reporting period\"), so a voice user can still say what they see.\n */\n 'aria-label'?: string;\n }\n | {\n label?: undefined;\n /** Accessible name when the surrounding heading or row already says what the choice is. */\n 'aria-label': string;\n };\n\nexport type SegmentGroupProps = SegmentGroupName & {\n /** The choices, in order. Exactly one is checked. */\n items: SegmentGroupItem[];\n /**\n * Controlled value. `null` is controlled with nothing checked, for a form\n * that starts without a choice; `undefined` leaves the component to own\n * its value from `defaultValue` onward, as `Select` does.\n */\n value?: string | null;\n /** Initial value when uncontrolled. */\n defaultValue?: string;\n /**\n * Fired with the newly checked value. Choosing the checked segment again\n * does nothing, so a consumer that saves on change never writes twice.\n */\n onValueChange?: (value: string) => void;\n /** Segment height and type scale. `sm` suits a toolbar or a card header. */\n size?: SegmentGroupSize;\n /**\n * How the segments share the track. `equal` (default): every segment as\n * wide as the widest, and a word longer than its column breaks inside it.\n * `content`: each segment as wide as its own label, the spare width shared\n * out, so a group of labels of uneven length fits a narrow container\n * without breaking a word.\n */\n fit?: 'equal' | 'content';\n /**\n * `dense` tightens each segment's inline padding, for a group of many\n * short items (six t-shirt sizes) that has to fit a phone.\n */\n density?: 'default' | 'dense';\n /**\n * Whether the group takes the whole width of its row, the track with it:\n * a state or effort choice in a form, level with the fields above it.\n */\n fullWidth?: boolean;\n /**\n * A field at the end of the track for a value no segment offers. While it\n * holds a value and no segment is checked, it is drawn as the choice and\n * submits under `name`.\n */\n custom?: SegmentGroupCustom;\n /** Disable every segment. The checked one keeps showing which is set. */\n disabled?: boolean;\n /** Name for native form participation through the hidden radio inputs. */\n name?: string;\n /** Extra class names appended after the `ds-segment-group` modifiers. */\n className?: string;\n};\n\n/**\n * One choice among a few, shown as a row of segments, built on Ark UI's\n * SegmentGroup: a radio group whose radios are drawn as one control.\n *\n * Ark owns the behaviour: hidden radio inputs carry the state, the arrow keys\n * move the choice, and the whole segment is its radio's label. This wrapper\n * contributes `ds-` classes, the `--ds-segment-group-*` bindings and a flat\n * `items` API in place of Ark's anatomy.\n *\n * ```tsx\n * <SegmentGroup\n * label=\"Period\"\n * items={[\n * { value: 'today', label: 'Today' },\n * { value: 'week', label: 'Week' },\n * { value: 'month', label: 'Month' },\n * ]}\n * value={period}\n * onValueChange={setPeriod}\n * />\n * ```\n *\n * Reach for it when the choices are few, short and all worth seeing at once:\n * a period, a size, a view. More than five, or labels that need a sentence,\n * want a `Select`. Panels that change with the choice are `Tabs`; a segment\n * group changes a value, not what is on the page.\n */\nexport function SegmentGroup({\n label,\n items,\n value,\n defaultValue,\n onValueChange,\n size = 'md',\n fit = 'equal',\n density = 'default',\n fullWidth = false,\n custom,\n disabled,\n name,\n className,\n 'aria-label': ariaLabel,\n}: SegmentGroupProps) {\n const rootRef = useRef<HTMLDivElement>(null);\n\n /*\n * Zag reports `null` only when the value is cleared through its API, which\n * this wrapper never calls; a user can only move the choice to a segment.\n *\n * Ark renders the hidden radios uncontrolled and syncs them only when its\n * own state changes, so a controlled parent that declines a choice would\n * leave the native radio checked while the segment shows the old one.\n * Restoring the parent's value after Ark has read the radios keeps the two\n * agreeing, as Checkbox and Switch do.\n */\n const handleValueChange = (details: { value: string | null }) => {\n if (details.value !== null) onValueChange?.(details.value);\n if (value === undefined || !rootRef.current) return;\n for (const input of rootRef.current.querySelectorAll<HTMLInputElement>('input[type=\"radio\"]')) {\n input.checked = input.value === value;\n }\n };\n\n /*\n * Zag always names the root by its label part's id, which would outrank an\n * `aria-label`. With both given, the visible label is plain text instead,\n * so that id resolves to nothing and the `aria-label` is what is announced.\n */\n const visibleLabel =\n label &&\n (ariaLabel ? (\n <span className=\"ds-segment-group__label\">{label}</span>\n ) : (\n <ArkSegmentGroup.Label className=\"ds-segment-group__label\">{label}</ArkSegmentGroup.Label>\n ));\n\n const renderItem = (item: SegmentGroupItem) => (\n <ArkSegmentGroup.Item\n key={item.value}\n value={item.value}\n disabled={item.disabled}\n className=\"ds-segment-group__item\"\n >\n <ArkSegmentGroup.ItemText className=\"ds-segment-group__item-text\">\n {item.label}\n </ArkSegmentGroup.ItemText>\n <ArkSegmentGroup.ItemHiddenInput />\n </ArkSegmentGroup.Item>\n );\n\n /*\n * The field is the choice while it holds a value no segment has. That is\n * read from Ark's own value, so an uncontrolled group draws it right too,\n * and it submits under `name` only then, when no radio is checked.\n */\n const renderCustom = (custom: SegmentGroupCustom, current: string | null) => {\n const chosen = custom.value !== '' && !items.some((item) => item.value === current);\n return (\n <label\n className=\"ds-segment-group__custom\"\n data-state={chosen ? 'checked' : 'unchecked'}\n data-disabled={disabled ? '' : undefined}\n >\n <input\n className=\"ds-segment-group__custom-input\"\n value={custom.value}\n onChange={(event) => custom.onValueChange(event.target.value)}\n aria-label={custom['aria-label']}\n placeholder={custom.placeholder}\n inputMode={custom.inputMode}\n name={chosen ? name : undefined}\n disabled={disabled}\n />\n {custom.unit && (\n <span className=\"ds-segment-group__custom-unit\" aria-hidden=\"true\">\n {custom.unit}\n </span>\n )}\n </label>\n );\n };\n\n return (\n <ArkSegmentGroup.Root\n ref={rootRef}\n className={cx(\n 'ds-segment-group',\n `ds-segment-group--${size}`,\n fit === 'content' && 'ds-segment-group--fit-content',\n density === 'dense' && 'ds-segment-group--dense',\n fullWidth && 'ds-segment-group--full-width',\n className,\n )}\n value={value}\n defaultValue={defaultValue}\n onValueChange={handleValueChange}\n disabled={disabled}\n name={name}\n orientation=\"horizontal\"\n aria-label={ariaLabel}\n >\n {visibleLabel}\n <div className=\"ds-segment-group__track\">\n {items.map(renderItem)}\n {custom && (\n <ArkSegmentGroup.Context>\n {(group) => renderCustom(custom, group.value)}\n </ArkSegmentGroup.Context>\n )}\n </div>\n </ArkSegmentGroup.Root>\n );\n}\n"]}
@@ -162,9 +162,9 @@
162
162
  overflow-wrap: anywhere;
163
163
 
164
164
  & .ds-select__label {
165
- color: var(--ds-select-label-text);
166
- font-size: var(--ds-select-label-font-size);
167
- font-weight: var(--ds-select-label-font-weight);
165
+ color: var(--ds-field-label-text);
166
+ font-size: var(--ds-field-label-font-size);
167
+ font-weight: var(--ds-field-label-font-weight);
168
168
  }
169
169
 
170
170
  & .ds-select__trigger {
@@ -18,13 +18,15 @@
18
18
  max-width: 100%;
19
19
  overflow-wrap: anywhere;
20
20
  }
21
+ /* Field's label, as every control a form names; the readout beside it takes its size. */
21
22
  & .ds-slider__label {
22
- color: var(--ds-slider-label-text);
23
- font-size: var(--ds-slider-label-font-size);
23
+ color: var(--ds-field-label-text);
24
+ font-size: var(--ds-field-label-font-size);
25
+ font-weight: var(--ds-field-label-font-weight);
24
26
  }
25
27
  & .ds-slider__value {
26
28
  color: var(--ds-slider-value-text);
27
- font-size: var(--ds-slider-label-font-size);
29
+ font-size: var(--ds-field-label-font-size);
28
30
  font-variant-numeric: tabular-nums;
29
31
  }
30
32
  & .ds-slider__control {
@@ -0,0 +1,2 @@
1
+ export { Tooltip, type TooltipPlacement, type TooltipProps } from './tooltip';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tooltip/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,gBAAgB,EAAE,KAAK,YAAY,EAAE,MAAM,WAAW,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { Tooltip } from './tooltip';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tooltip/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAA4C,MAAM,WAAW,CAAC","sourcesContent":["export { Tooltip, type TooltipPlacement, type TooltipProps } from './tooltip';\n"]}
@@ -0,0 +1,20 @@
1
+ @layer components {
2
+ /* Portalled, so styled at the top level, as Popover's panel is. */
3
+ .ds-tooltip__content {
4
+ box-sizing: border-box;
5
+ padding: var(--ds-tooltip-content-padding-block) var(--ds-tooltip-content-padding-inline);
6
+ border-radius: var(--ds-tooltip-content-radius);
7
+ background-color: var(--ds-tooltip-content-bg);
8
+ color: var(--ds-tooltip-content-text);
9
+ font-size: var(--ds-tooltip-content-font-size);
10
+ max-inline-size: var(--available-width);
11
+ overflow-wrap: anywhere;
12
+ pointer-events: none;
13
+ /*
14
+ * The `tooltip` stacking layer (ds-config/scripts/stacking.ts): Zag
15
+ * copies this onto the positioner, so a caption shows above the popup or
16
+ * dialog its control sits in.
17
+ */
18
+ z-index: 70;
19
+ }
20
+ }
@@ -0,0 +1,2 @@
1
+ /* AUTOGENERATED: types for the stylesheet beside it. */
2
+ export {};
@@ -0,0 +1,38 @@
1
+ import { type ReactElement, type ReactNode } from 'react';
2
+ import './tooltip.css';
3
+ export type TooltipPlacement = 'top' | 'bottom' | 'left' | 'right';
4
+ export interface TooltipProps {
5
+ /** The caption: a few words, never a control. */
6
+ content: ReactNode;
7
+ /** The element it captions. It keeps its own accessible name. */
8
+ children: ReactElement<{
9
+ id?: string;
10
+ }>;
11
+ /**
12
+ * What the caption is to assistive tech. `description` (default) adds it
13
+ * to the trigger's description while it shows. `label` says it repeats the
14
+ * trigger's accessible name, as an icon-only button's caption does, so it
15
+ * is left out and the name is announced once.
16
+ */
17
+ kind?: 'description' | 'label';
18
+ /** Side of the trigger it opens on, flipping when there is no room. */
19
+ placement?: TooltipPlacement;
20
+ }
21
+ /**
22
+ * A caption that shows while the pointer rests on its trigger or the
23
+ * keyboard focuses it, built on Ark UI's Tooltip. Esc and moving away hide
24
+ * it; it never takes focus and holds nothing to click.
25
+ *
26
+ * ```tsx
27
+ * <Tooltip content="Archive">
28
+ * <button type="button" aria-label="Archive Run 10k">…</button>
29
+ * </Tooltip>
30
+ * ```
31
+ *
32
+ * `IconButton` shows one with its label by default. Reach for it directly
33
+ * for another control whose meaning its glyph alone does not say. Anything
34
+ * a user must read to act belongs on the page, not in a tooltip: touch
35
+ * screens never show one.
36
+ */
37
+ export declare function Tooltip({ content, children, kind, placement, }: TooltipProps): import("react/jsx-runtime").JSX.Element;
38
+ //# sourceMappingURL=tooltip.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tooltip.d.ts","sourceRoot":"","sources":["../../src/tooltip/tooltip.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,SAAS,EAAmC,MAAM,OAAO,CAAC;AAE3F,OAAO,eAAe,CAAC;AAEvB,MAAM,MAAM,gBAAgB,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC;AAEnE,MAAM,WAAW,YAAY;IAC3B,iDAAiD;IACjD,OAAO,EAAE,SAAS,CAAC;IACnB,iEAAiE;IACjE,QAAQ,EAAE,YAAY,CAAC;QAAE,EAAE,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACxC;;;;;OAKG;IACH,IAAI,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC;IAC/B,uEAAuE;IACvE,SAAS,CAAC,EAAE,gBAAgB,CAAC;CAC9B;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,OAAO,CAAC,EACtB,OAAO,EACP,QAAQ,EACR,IAAoB,EACpB,SAAiB,GAClB,EAAE,YAAY,2CA0Dd"}
@@ -0,0 +1,58 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Portal } from '@ark-ui/react/portal';
3
+ import { Tooltip as ArkTooltip } from '@ark-ui/react/tooltip';
4
+ import { useContext, useEffect, useState } from 'react';
5
+ import { PortalContainerContext } from '../portal-container';
6
+ import './tooltip.css';
7
+ /**
8
+ * A caption that shows while the pointer rests on its trigger or the
9
+ * keyboard focuses it, built on Ark UI's Tooltip. Esc and moving away hide
10
+ * it; it never takes focus and holds nothing to click.
11
+ *
12
+ * ```tsx
13
+ * <Tooltip content="Archive">
14
+ * <button type="button" aria-label="Archive Run 10k">…</button>
15
+ * </Tooltip>
16
+ * ```
17
+ *
18
+ * `IconButton` shows one with its label by default. Reach for it directly
19
+ * for another control whose meaning its glyph alone does not say. Anything
20
+ * a user must read to act belongs on the page, not in a tooltip: touch
21
+ * screens never show one.
22
+ */
23
+ export function Tooltip({ content, children, kind = 'description', placement = 'top', }) {
24
+ const portalContainer = useContext(PortalContainerContext);
25
+ /*
26
+ * Zag points the trigger's description at the caption while it shows, and
27
+ * only a defined value overrides it, so a label caption passes an empty
28
+ * one. A description the trigger sets itself still wins.
29
+ */
30
+ const triggerDescription = kind === 'label' ? '' : undefined;
31
+ /*
32
+ * A trigger that is itself another part's asChild trigger (a Menu's, a
33
+ * Dialog's close button, a Calendar arrow) takes that part's id, and the
34
+ * child's props win the merge, so Zag would look for its own id and find
35
+ * nothing to place the caption against. Naming the id the trigger ends up
36
+ * with keeps the lookup on the real element.
37
+ */
38
+ const triggerId = children.props.id;
39
+ const [open, setOpen] = useState(false);
40
+ /*
41
+ * Escape hides the caption and goes on to whatever else it means: Zag's
42
+ * own Escape handling stops the key at the document, so a keyboard drag
43
+ * could not be cancelled and a dialog would not close while a caption
44
+ * showed.
45
+ */
46
+ useEffect(() => {
47
+ if (!open)
48
+ return;
49
+ const hide = (event) => {
50
+ if (event.key === 'Escape')
51
+ setOpen(false);
52
+ };
53
+ document.addEventListener('keydown', hide);
54
+ return () => document.removeEventListener('keydown', hide);
55
+ }, [open]);
56
+ return (_jsxs(ArkTooltip.Root, { lazyMount: true, unmountOnExit: true, positioning: { placement, gutter: 6 }, ids: triggerId ? { trigger: triggerId } : undefined, open: open, onOpenChange: (details) => setOpen(details.open), closeOnEscape: false, children: [_jsx(ArkTooltip.Trigger, { asChild: true, "aria-describedby": triggerDescription, children: children }), _jsx(Portal, { container: portalContainer, children: _jsx(ArkTooltip.Positioner, { children: _jsx(ArkTooltip.Content, { className: "ds-tooltip__content", "aria-hidden": kind === 'label' ? true : undefined, children: content }) }) })] }));
57
+ }
58
+ //# sourceMappingURL=tooltip.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tooltip.js","sourceRoot":"","sources":["../../src/tooltip/tooltip.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EAAqC,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC3F,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,eAAe,CAAC;AAoBvB;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,OAAO,CAAC,EACtB,OAAO,EACP,QAAQ,EACR,IAAI,GAAG,aAAa,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AM,IAAC,SAAS,EAAE,eAAe,YAChC,KAAC,UAAU,CAAC,UAAU,cACpB,KAAC,UAAU,CAAC,OAAO,IACjB,SAAS,EAAC,qBAAqB,iBAClB,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,YAE/C,OAAO,GACW,GACC,GACjB,IACO,CACnB,CAAC;AACJ,CAAC","sourcesContent":["import { Portal } from '@ark-ui/react/portal';\nimport { Tooltip as ArkTooltip } from '@ark-ui/react/tooltip';\nimport { type ReactElement, type ReactNode, useContext, useEffect, useState } from 'react';\nimport { PortalContainerContext } from '../portal-container';\nimport './tooltip.css';\n\nexport type TooltipPlacement = 'top' | 'bottom' | 'left' | 'right';\n\nexport interface TooltipProps {\n /** The caption: a few words, never a control. */\n content: ReactNode;\n /** The element it captions. It keeps its own accessible name. */\n children: ReactElement<{ id?: string }>;\n /**\n * What the caption is to assistive tech. `description` (default) adds it\n * to the trigger's description while it shows. `label` says it repeats the\n * trigger's accessible name, as an icon-only button's caption does, so it\n * is left out and the name is announced once.\n */\n kind?: 'description' | 'label';\n /** Side of the trigger it opens on, flipping when there is no room. */\n placement?: TooltipPlacement;\n}\n\n/**\n * A caption that shows while the pointer rests on its trigger or the\n * keyboard focuses it, built on Ark UI's Tooltip. Esc and moving away hide\n * it; it never takes focus and holds nothing to click.\n *\n * ```tsx\n * <Tooltip content=\"Archive\">\n * <button type=\"button\" aria-label=\"Archive Run 10k\">…</button>\n * </Tooltip>\n * ```\n *\n * `IconButton` shows one with its label by default. Reach for it directly\n * for another control whose meaning its glyph alone does not say. Anything\n * a user must read to act belongs on the page, not in a tooltip: touch\n * screens never show one.\n */\nexport function Tooltip({\n content,\n children,\n kind = 'description',\n placement = 'top',\n}: TooltipProps) {\n const portalContainer = useContext(PortalContainerContext);\n /*\n * Zag points the trigger's description at the caption while it shows, and\n * only a defined value overrides it, so a label caption passes an empty\n * one. A description the trigger sets itself still wins.\n */\n const triggerDescription = kind === 'label' ? '' : undefined;\n /*\n * A trigger that is itself another part's asChild trigger (a Menu's, a\n * Dialog's close button, a Calendar arrow) takes that part's id, and the\n * child's props win the merge, so Zag would look for its own id and find\n * nothing to place the caption against. Naming the id the trigger ends up\n * with keeps the lookup on the real element.\n */\n const triggerId = children.props.id;\n const [open, setOpen] = useState(false);\n\n /*\n * Escape hides the caption and goes on to whatever else it means: Zag's\n * own Escape handling stops the key at the document, so a keyboard drag\n * could not be cancelled and a dialog would not close while a caption\n * showed.\n */\n useEffect(() => {\n if (!open) return;\n const hide = (event: KeyboardEvent) => {\n if (event.key === 'Escape') setOpen(false);\n };\n document.addEventListener('keydown', hide);\n return () => document.removeEventListener('keydown', hide);\n }, [open]);\n\n return (\n <ArkTooltip.Root\n lazyMount\n unmountOnExit\n positioning={{ placement, gutter: 6 }}\n ids={triggerId ? { trigger: triggerId } : undefined}\n open={open}\n onOpenChange={(details) => setOpen(details.open)}\n closeOnEscape={false}\n >\n <ArkTooltip.Trigger asChild aria-describedby={triggerDescription}>\n {children}\n </ArkTooltip.Trigger>\n <Portal container={portalContainer}>\n <ArkTooltip.Positioner>\n <ArkTooltip.Content\n className=\"ds-tooltip__content\"\n aria-hidden={kind === 'label' ? true : undefined}\n >\n {content}\n </ArkTooltip.Content>\n </ArkTooltip.Positioner>\n </Portal>\n </ArkTooltip.Root>\n );\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@manakind/ui-core",
3
- "version": "0.25.1",
3
+ "version": "0.26.1",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -172,6 +172,10 @@
172
172
  "types": "./dist/text/index.d.ts",
173
173
  "import": "./dist/text/index.js"
174
174
  },
175
+ "./tooltip": {
176
+ "types": "./dist/tooltip/index.d.ts",
177
+ "import": "./dist/tooltip/index.js"
178
+ },
175
179
  "./visually-hidden": {
176
180
  "types": "./dist/visually-hidden/index.d.ts",
177
181
  "import": "./dist/visually-hidden/index.js"
@@ -328,6 +332,10 @@
328
332
  "types": "./dist/text/text.css.d.ts",
329
333
  "default": "./dist/text/text.css"
330
334
  },
335
+ "./css/tooltip": {
336
+ "types": "./dist/tooltip/tooltip.css.d.ts",
337
+ "default": "./dist/tooltip/tooltip.css"
338
+ },
331
339
  "./css/visually-hidden": {
332
340
  "types": "./dist/visually-hidden/visually-hidden.css.d.ts",
333
341
  "default": "./dist/visually-hidden/visually-hidden.css"
@@ -364,7 +372,7 @@
364
372
  },
365
373
  "devDependencies": {
366
374
  "@manakind/ds-config": "*",
367
- "@manakind/manuia-tokens": "0.24.1",
375
+ "@manakind/manuia-tokens": "0.25.0",
368
376
  "@testing-library/jest-dom": "^6.9.1",
369
377
  "@testing-library/react": "^16.3.2",
370
378
  "@testing-library/user-event": "^14.6.1",