@manakind/ui-core 0.21.0 → 0.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -4
- package/dist/button/button.css +16 -0
- package/dist/button/button.d.ts +10 -0
- package/dist/button/button.d.ts.map +1 -1
- package/dist/button/button.js +8 -6
- package/dist/button/button.js.map +1 -1
- package/dist/card/card.css +5 -0
- package/dist/card/card.d.ts +11 -2
- package/dist/card/card.d.ts.map +1 -1
- package/dist/card/card.js +2 -2
- package/dist/card/card.js.map +1 -1
- package/dist/card/index.d.ts +1 -1
- package/dist/card/index.d.ts.map +1 -1
- package/dist/card/index.js.map +1 -1
- package/dist/combobox/combobox.css +169 -2
- package/dist/combobox/combobox.d.ts +80 -15
- package/dist/combobox/combobox.d.ts.map +1 -1
- package/dist/combobox/combobox.js +309 -43
- package/dist/combobox/combobox.js.map +1 -1
- package/dist/combobox/index.d.ts +1 -1
- package/dist/combobox/index.d.ts.map +1 -1
- package/dist/combobox/index.js.map +1 -1
- package/dist/dialog/dialog.css +5 -0
- package/dist/dialog/dialog.d.ts +8 -1
- package/dist/dialog/dialog.d.ts.map +1 -1
- package/dist/dialog/dialog.js +2 -2
- package/dist/dialog/dialog.js.map +1 -1
- package/dist/dialog/index.d.ts +1 -1
- package/dist/dialog/index.d.ts.map +1 -1
- package/dist/fallback-glyphs.d.ts +1 -0
- package/dist/fallback-glyphs.d.ts.map +1 -1
- package/dist/fallback-glyphs.js +2 -0
- package/dist/fallback-glyphs.js.map +1 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/dist/layout/index.d.ts +2 -2
- package/dist/layout/index.d.ts.map +1 -1
- package/dist/layout/index.js +1 -1
- package/dist/layout/index.js.map +1 -1
- package/dist/layout/layout.css +134 -0
- package/dist/layout/layout.d.ts +66 -4
- package/dist/layout/layout.d.ts.map +1 -1
- package/dist/layout/layout.js +58 -10
- package/dist/layout/layout.js.map +1 -1
- package/dist/link/index.d.ts +3 -0
- package/dist/link/index.d.ts.map +1 -0
- package/dist/link/index.js +2 -0
- package/dist/link/index.js.map +1 -0
- package/dist/link/link.css +40 -0
- package/dist/link/link.css.d.ts +2 -0
- package/dist/link/link.d.ts +27 -0
- package/dist/link/link.d.ts.map +1 -0
- package/dist/link/link.js +17 -0
- package/dist/link/link.js.map +1 -0
- package/dist/scroll-area/index.d.ts +3 -0
- package/dist/scroll-area/index.d.ts.map +1 -0
- package/dist/scroll-area/index.js +2 -0
- package/dist/scroll-area/index.js.map +1 -0
- package/dist/scroll-area/scroll-area.css +26 -0
- package/dist/scroll-area/scroll-area.css.d.ts +2 -0
- package/dist/scroll-area/scroll-area.d.ts +26 -0
- package/dist/scroll-area/scroll-area.d.ts.map +1 -0
- package/dist/scroll-area/scroll-area.js +16 -0
- package/dist/scroll-area/scroll-area.js.map +1 -0
- package/dist/section/section.d.ts +8 -2
- package/dist/section/section.d.ts.map +1 -1
- package/dist/section/section.js +2 -2
- package/dist/section/section.js.map +1 -1
- package/dist/segment-group/segment-group.css +5 -0
- package/dist/segment-group/segment-group.d.ts +6 -1
- package/dist/segment-group/segment-group.d.ts.map +1 -1
- package/dist/segment-group/segment-group.js +2 -2
- package/dist/segment-group/segment-group.js.map +1 -1
- package/dist/spinner/index.d.ts +3 -0
- package/dist/spinner/index.d.ts.map +1 -0
- package/dist/spinner/index.js +2 -0
- package/dist/spinner/index.js.map +1 -0
- package/dist/spinner/spinner.css +36 -0
- package/dist/spinner/spinner.css.d.ts +2 -0
- package/dist/spinner/spinner.d.ts +25 -0
- package/dist/spinner/spinner.d.ts.map +1 -0
- package/dist/spinner/spinner.js +17 -0
- package/dist/spinner/spinner.js.map +1 -0
- package/dist/sticky/index.d.ts +3 -0
- package/dist/sticky/index.d.ts.map +1 -0
- package/dist/sticky/index.js +2 -0
- package/dist/sticky/index.js.map +1 -0
- package/dist/sticky/sticky.css +92 -0
- package/dist/sticky/sticky.css.d.ts +2 -0
- package/dist/sticky/sticky.d.ts +47 -0
- package/dist/sticky/sticky.d.ts.map +1 -0
- package/dist/sticky/sticky.js +20 -0
- package/dist/sticky/sticky.js.map +1 -0
- package/dist/text/text.css +20 -0
- package/dist/text/text.d.ts +13 -5
- package/dist/text/text.d.ts.map +1 -1
- package/dist/text/text.js +25 -6
- package/dist/text/text.js.map +1 -1
- package/package.json +37 -4
package/README.md
CHANGED
|
@@ -57,7 +57,7 @@ separately, so an app can load only what it renders.
|
|
|
57
57
|
|
|
58
58
|
| Entry | Contents |
|
|
59
59
|
|---|---|
|
|
60
|
-
| `@manakind/ui-core` | Everything below, plus every prop type, the `cx` helper, and the built-in fallback glyphs (`FallbackChevronLeft`, `FallbackChevronRight`, `FallbackCheck`, `FallbackCross`) for compositions that want the same defaults |
|
|
60
|
+
| `@manakind/ui-core` | Everything below, plus every prop type, the `cx` helper, and the built-in fallback glyphs (`FallbackChevronLeft`, `FallbackChevronRight`, `FallbackCheck`, `FallbackCross`, `FallbackPin`) for compositions that want the same defaults |
|
|
61
61
|
| `@manakind/ui-core/alert` | `Alert` |
|
|
62
62
|
| `@manakind/ui-core/avatar` | `Avatar` + `initialsOf` |
|
|
63
63
|
| `@manakind/ui-core/badge` | `Badge` |
|
|
@@ -71,7 +71,7 @@ separately, so an app can load only what it renders.
|
|
|
71
71
|
| `@manakind/ui-core/menu` | `Menu`, `MenuTrigger`, `ActionMenu`; `MenuItem.icon` adds a decorative glyph before its label |
|
|
72
72
|
| `@manakind/ui-core/popover` | `Popover` |
|
|
73
73
|
| `@manakind/ui-core/checkbox` | `Checkbox` |
|
|
74
|
-
| `@manakind/ui-core/combobox` | `Combobox`; `ComboboxItem.group` collects options under named headings, with keyboard navigation in displayed order |
|
|
74
|
+
| `@manakind/ui-core/combobox` | `Combobox`; `ComboboxItem.group` collects options under named headings, with keyboard navigation in displayed order; `toolbar`, `status` and `facets` put filters, a status line and a pinnable facet column inside the open list |
|
|
75
75
|
| `@manakind/ui-core/date-input` | `DateInput` |
|
|
76
76
|
| `@manakind/ui-core/progress` | `Progress` |
|
|
77
77
|
| `@manakind/ui-core/reorder-control` | `ReorderControl` |
|
|
@@ -80,12 +80,16 @@ separately, so an app can load only what it renders.
|
|
|
80
80
|
| `@manakind/ui-core/switch` | `Switch` |
|
|
81
81
|
| `@manakind/ui-core/field` | `Field`, `Input`, `Textarea`, `useFieldControl` |
|
|
82
82
|
| `@manakind/ui-core/tabs` | `Tabs`, `TabsList`, `TabsTrigger`, `TabsContent` |
|
|
83
|
-
| `@manakind/ui-core/layout` | `Stack`, `Inline`, `Grid`, `Container` and the layout step types |
|
|
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/link` | `Link` |
|
|
85
86
|
| `@manakind/ui-core/divider` | `Divider` |
|
|
86
87
|
| `@manakind/ui-core/show` | `Show` |
|
|
87
88
|
| `@manakind/ui-core/visually-hidden` | `VisuallyHidden` |
|
|
88
89
|
| `@manakind/ui-core/skeleton` | `Skeleton` |
|
|
90
|
+
| `@manakind/ui-core/spinner` | `Spinner` |
|
|
91
|
+
| `@manakind/ui-core/scroll-area` | `ScrollArea` |
|
|
92
|
+
| `@manakind/ui-core/sticky` | `Sticky` |
|
|
89
93
|
| `@manakind/ui-core/empty-state` | `EmptyState` |
|
|
90
94
|
| `@manakind/ui-core/page-layout` | `PageLayout`, `PageHeader`, `PageTitle`, `PageDescription`, `PageActions` |
|
|
91
95
|
| `@manakind/ui-core/section` | `Section` |
|
|
@@ -115,12 +119,16 @@ separately, so an app can load only what it renders.
|
|
|
115
119
|
| `@manakind/ui-core/css/switch` | Switch structural CSS |
|
|
116
120
|
| `@manakind/ui-core/css/field` | Field, Input and Textarea structural CSS |
|
|
117
121
|
| `@manakind/ui-core/css/tabs` | Tabs structural CSS |
|
|
118
|
-
| `@manakind/ui-core/css/layout` | Stack, Inline, Grid and
|
|
122
|
+
| `@manakind/ui-core/css/layout` | Stack, Inline, Grid, Container, Frame and Spacer structural CSS |
|
|
119
123
|
| `@manakind/ui-core/css/text` | Text and Heading structural CSS |
|
|
124
|
+
| `@manakind/ui-core/css/link` | Link structural CSS |
|
|
120
125
|
| `@manakind/ui-core/css/divider` | Divider structural CSS |
|
|
121
126
|
| `@manakind/ui-core/css/show` | Show structural CSS |
|
|
122
127
|
| `@manakind/ui-core/css/visually-hidden` | VisuallyHidden structural CSS |
|
|
123
128
|
| `@manakind/ui-core/css/skeleton` | Skeleton structural CSS |
|
|
129
|
+
| `@manakind/ui-core/css/spinner` | Spinner structural CSS; its label also needs `css/visually-hidden` |
|
|
130
|
+
| `@manakind/ui-core/css/scroll-area` | ScrollArea structural CSS |
|
|
131
|
+
| `@manakind/ui-core/css/sticky` | Sticky structural CSS |
|
|
124
132
|
| `@manakind/ui-core/css/empty-state` | EmptyState structural CSS; its glyph also needs `css/icon` |
|
|
125
133
|
| `@manakind/ui-core/css/page-layout` | PageLayout structural CSS; its title and description also need `css/text` |
|
|
126
134
|
| `@manakind/ui-core/css/section` | Section structural CSS; its title and description also need `css/text` |
|
package/dist/button/button.css
CHANGED
|
@@ -128,6 +128,22 @@
|
|
|
128
128
|
color: transparent;
|
|
129
129
|
}
|
|
130
130
|
|
|
131
|
+
&.ds-button--full-width {
|
|
132
|
+
display: flex;
|
|
133
|
+
width: 100%;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/* The label takes the room, so a trailing icon stays at the end. */
|
|
137
|
+
&.ds-button--align-start {
|
|
138
|
+
justify-content: flex-start;
|
|
139
|
+
|
|
140
|
+
& .ds-button__label {
|
|
141
|
+
flex: 1;
|
|
142
|
+
min-width: 0;
|
|
143
|
+
text-align: start;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
131
147
|
& .ds-button__icon {
|
|
132
148
|
display: inline-flex;
|
|
133
149
|
flex-shrink: 0;
|
package/dist/button/button.d.ts
CHANGED
|
@@ -24,6 +24,16 @@ interface ButtonOwnProps {
|
|
|
24
24
|
* {@link ButtonOwnProps.leadingIcon}.
|
|
25
25
|
*/
|
|
26
26
|
trailingIcon?: IconSource;
|
|
27
|
+
/** Whether the button takes the whole width of its row: a form's submit, a card's one action. */
|
|
28
|
+
fullWidth?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Where the label sits when the button is wider than its content: centred
|
|
31
|
+
* by default, or at the start, with a trailing icon kept at the end, for a
|
|
32
|
+
* trigger that reads as a field (a picker). Inline rather than a named
|
|
33
|
+
* union: `check:variant-parity` would ask the native Button, which has no
|
|
34
|
+
* label alignment, to export the same name.
|
|
35
|
+
*/
|
|
36
|
+
align?: 'center' | 'start';
|
|
27
37
|
}
|
|
28
38
|
type ArkButtonProps = Omit<ComponentProps<typeof ark.button>, 'asChild'>;
|
|
29
39
|
interface ButtonAsButtonProps extends ButtonOwnProps, ArkButtonProps {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../src/button/button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAC5C,OAAO,EACL,KAAK,cAAc,EAInB,KAAK,YAAY,EACjB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,EAAQ,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,cAAc,CAAC;AAGtB,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,WAAW,GAAG,UAAU,GAAG,QAAQ,CAAC;AAC5E,MAAM,MAAM,UAAU,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAE5C,UAAU,cAAc;IACtB,4BAA4B;IAC5B,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,mBAAmB;IACnB,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB;;;;;;;;OAQG;IACH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AAQ,EAAE,YAAY,CAAC;QAAE,SAAS,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,SAAS,CAAA;KAAE,CAAC,CAAC;IACrE,kEAAkE;IAClE,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,MAAM,WAAW,GAAG,mBAAmB,GAAG,kBAAkB,CAAC;AA6GnE;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,WAAW,2CAExC"}
|
package/dist/button/button.js
CHANGED
|
@@ -7,18 +7,20 @@ import { cx } from '../cx';
|
|
|
7
7
|
function ButtonContent({ loading, leadingIcon, trailingIcon, children }) {
|
|
8
8
|
return (_jsxs(_Fragment, { children: [loading && _jsx("span", { className: "ds-button__spinner", "aria-hidden": "true" }), leadingIcon && (_jsx(Icon, { source: leadingIcon, size: "sm", decorative: true, className: "ds-button__icon ds-button__icon--leading" })), _jsx("span", { className: "ds-button__label", children: children }), trailingIcon && (_jsx(Icon, { source: trailingIcon, size: "sm", decorative: true, className: "ds-button__icon ds-button__icon--trailing" }))] }));
|
|
9
9
|
}
|
|
10
|
-
function classesFor(variant, size, className) {
|
|
11
|
-
return cx('ds-button', `ds-button--${variant}`, `ds-button--${size}`, className);
|
|
10
|
+
function classesFor({ variant = 'primary', size = 'md', fullWidth = false, align = 'center' }, className) {
|
|
11
|
+
return cx('ds-button', `ds-button--${variant}`, `ds-button--${size}`, fullWidth && 'ds-button--full-width', align !== 'center' && `ds-button--align-${align}`, className);
|
|
12
12
|
}
|
|
13
|
-
function ButtonAsChild({ variant
|
|
13
|
+
function ButtonAsChild({ variant, size, fullWidth, align, leadingIcon, trailingIcon, className, children, }) {
|
|
14
14
|
if (!isValidElement(children) || children.type === Fragment) {
|
|
15
15
|
throw new Error('Button asChild needs exactly one element as its child, such as <a> or a router link.');
|
|
16
16
|
}
|
|
17
17
|
const content = (_jsx(ButtonContent, { loading: false, leadingIcon: leadingIcon, trailingIcon: trailingIcon, children: children.props.children }));
|
|
18
|
-
return cloneElement(children, {
|
|
18
|
+
return cloneElement(children, {
|
|
19
|
+
className: cx(classesFor({ variant, size, fullWidth, align }, className), children.props.className),
|
|
20
|
+
}, content);
|
|
19
21
|
}
|
|
20
|
-
function ButtonAsButton({ variant
|
|
21
|
-
return (_jsx(ark.button, { disabled: disabled || loading, className: cx(classesFor(variant, size, className), loading && 'ds-button--loading'), ...props, children: _jsx(ButtonContent, { loading: loading, leadingIcon: leadingIcon, trailingIcon: trailingIcon, children: children }) }));
|
|
22
|
+
function ButtonAsButton({ variant, size, fullWidth, align, loading = false, disabled, leadingIcon, trailingIcon, className, children, ...props }) {
|
|
23
|
+
return (_jsx(ark.button, { disabled: disabled || loading, className: cx(classesFor({ variant, size, fullWidth, align }, className), loading && 'ds-button--loading'), ...props, children: _jsx(ButtonContent, { loading: loading, leadingIcon: leadingIcon, trailingIcon: trailingIcon, children: children }) }));
|
|
22
24
|
}
|
|
23
25
|
/**
|
|
24
26
|
* Shared base button for the Manakind design system.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.js","sourceRoot":"","sources":["../../src/button/button.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAC5C,OAAO,EAEL,YAAY,EACZ,QAAQ,EACR,cAAc,GAGf,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,IAAI,EAAmB,MAAM,cAAc,CAAC;AACrD,OAAO,cAAc,CAAC;AACtB,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"button.js","sourceRoot":"","sources":["../../src/button/button.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAC5C,OAAO,EAEL,YAAY,EACZ,QAAQ,EACR,cAAc,GAGf,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,IAAI,EAAmB,MAAM,cAAc,CAAC;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AAE,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,YAAY,EAAE,YAAY,YAChF,QAAQ,CAAC,KAAK,CAAC,QAAQ,GACV,CACjB,CAAC;IAEF,OAAO,YAAY,CACjB,QAAQ,EACR;QACE,SAAS,EAAE,EAAE,CACX,UAAU,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,SAAS,CAAC,EAC1D,QAAQ,CAAC,KAAK,CAAC,SAAS,CACzB;KACF,EACD,OAAO,CACR,CAAC;AACJ,CAAC;AAED,SAAS,cAAc,CAAC,EACtB,OAAO,EACP,IAAI,EACJ,SAAS,EACT,KAAK,EACL,OAAO,GAAG,KAAK,EACf,QAAQ,EACR,WAAW,EACX,YAAY,EACZ,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACY;IACpB,OAAO,CACL,KAAC,GAAG,CAAC,MAAM,IACT,QAAQ,EAAE,QAAQ,IAAI,OAAO,EAC7B,SAAS,EAAE,EAAE,CACX,UAAU,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,SAAS,CAAC,EAC1D,OAAO,IAAI,oBAAoB,CAChC,KACG,KAAK,YAET,KAAC,aAAa,IAAC,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,YAAY,EAAE,YAAY,YAClF,QAAQ,GACK,GACL,CACd,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,UAAU,MAAM,CAAC,KAAkB;IACvC,OAAO,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,KAAC,aAAa,OAAK,KAAK,GAAI,CAAC,CAAC,CAAC,KAAC,cAAc,OAAK,KAAK,GAAI,CAAC;AACtF,CAAC"}
|
package/dist/card/card.css
CHANGED
package/dist/card/card.d.ts
CHANGED
|
@@ -34,9 +34,18 @@ export interface CardProps extends ComponentProps<typeof ark.div> {
|
|
|
34
34
|
* composition layer rather than through this component.
|
|
35
35
|
*/
|
|
36
36
|
export declare function Card({ interactive, className, children, ...props }: CardProps): import("react/jsx-runtime").JSX.Element;
|
|
37
|
-
|
|
37
|
+
/** Where a card header's parts sit: at the start, or centred. */
|
|
38
|
+
export type CardHeaderAlign = 'start' | 'center';
|
|
39
|
+
export interface CardHeaderProps extends ComponentProps<typeof ark.div> {
|
|
40
|
+
/**
|
|
41
|
+
* Where the title, description and anything else in the header sit:
|
|
42
|
+
* at the start by default, or centred, for a card that is the page (a
|
|
43
|
+
* sign-in card with its logo over the title).
|
|
44
|
+
*/
|
|
45
|
+
align?: CardHeaderAlign;
|
|
46
|
+
}
|
|
38
47
|
/** Top region of a card. Stacks its children with the card's gap. */
|
|
39
|
-
export declare function CardHeader({ className, children, ...props }: CardHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
48
|
+
export declare function CardHeader({ align, className, children, ...props }: CardHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
40
49
|
/**
|
|
41
50
|
* The heading levels {@link CardTitle} can render.
|
|
42
51
|
*
|
package/dist/card/card.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"card.d.ts","sourceRoot":"","sources":["../../src/card/card.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAC5C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,YAAY,CAAC;AAGpB,MAAM,WAAW,SAAU,SAAQ,cAAc,CAAC,OAAO,GAAG,CAAC,GAAG,CAAC;IAC/D;;;;;;;;;;;;OAYG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,IAAI,CAAC,EAAE,WAAmB,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,SAAS,2CAUrF;AAED,MAAM,MAAM,eAAe,GAAG,cAAc,CAAC,OAAO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M,aAAa,GAAG,cAAc,CAAC,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC;AAEzD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,wBAAgB,QAAQ,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,aAAa,2CAMxE;AAED,MAAM,MAAM,oBAAoB,GAAG,cAAc,CAAC,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC;AAEhE,yEAAyE;AACzE,wBAAgB,eAAe,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,oBAAoB,2CAMtF;AAED,MAAM,MAAM,gBAAgB,GAAG,cAAc,CAAC,OAAO,GAAG,CAAC,GAAG,CAAC,CAAC;AAE9D,kCAAkC;AAClC,wBAAgB,WAAW,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,gBAAgB,2CAM9E;AAED,MAAM,MAAM,eAAe,GAAG,cAAc,CAAC,OAAO,GAAG,CAAC,GAAG,CAAC,CAAC;AAE7D,+DAA+D;AAC/D,wBAAgB,UAAU,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,eAAe,2CAM5E"}
|
package/dist/card/card.js
CHANGED
|
@@ -22,8 +22,8 @@ export function Card({ interactive = false, className, children, ...props }) {
|
|
|
22
22
|
return (_jsx(ark.div, { className: cx('ds-card', interactive && 'ds-card--interactive', className), ...props, "data-interactive": interactive ? '' : undefined, children: children }));
|
|
23
23
|
}
|
|
24
24
|
/** Top region of a card. Stacks its children with the card's gap. */
|
|
25
|
-
export function CardHeader({ className, children, ...props }) {
|
|
26
|
-
return (_jsx(ark.div, { className: cx('ds-card__header', className), ...props, children: children }));
|
|
25
|
+
export function CardHeader({ align = 'start', className, children, ...props }) {
|
|
26
|
+
return (_jsx(ark.div, { className: cx('ds-card__header', align === 'center' && 'ds-card__header--center', className), ...props, children: children }));
|
|
27
27
|
}
|
|
28
28
|
/** Accessible heading for a card. Renders `h3` unless `as` overrides it. */
|
|
29
29
|
export function CardTitle({ as, className, children, ...props }) {
|
package/dist/card/card.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"card.js","sourceRoot":"","sources":["../../src/card/card.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAE5C,OAAO,YAAY,CAAC;AACpB,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAmB3B;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,IAAI,CAAC,EAAE,WAAW,GAAG,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAa;IACpF,OAAO,CACL,KAAC,GAAG,CAAC,GAAG,IACN,SAAS,EAAE,EAAE,CAAC,SAAS,EAAE,WAAW,IAAI,sBAAsB,EAAE,SAAS,CAAC,KACtE,KAAK,sBACS,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,YAE7C,QAAQ,GACD,CACX,CAAC;AACJ,CAAC;
|
|
1
|
+
{"version":3,"file":"card.js","sourceRoot":"","sources":["../../src/card/card.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAE5C,OAAO,YAAY,CAAC;AACpB,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAmB3B;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,IAAI,CAAC,EAAE,WAAW,GAAG,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAa;IACpF,OAAO,CACL,KAAC,GAAG,CAAC,GAAG,IACN,SAAS,EAAE,EAAE,CAAC,SAAS,EAAE,WAAW,IAAI,sBAAsB,EAAE,SAAS,CAAC,KACtE,KAAK,sBACS,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SA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ACJ,CAAC;AAID,kCAAkC;AAClC,MAAM,UAAU,WAAW,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAoB;IAC7E,OAAO,CACL,KAAC,GAAG,CAAC,GAAG,IAAC,SAAS,EAAE,EAAE,CAAC,kBAAkB,EAAE,SAAS,CAAC,KAAM,KAAK,YAC7D,QAAQ,GACD,CACX,CAAC;AACJ,CAAC;AAID,+DAA+D;AAC/D,MAAM,UAAU,UAAU,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAmB;IAC3E,OAAO,CACL,KAAC,GAAG,CAAC,GAAG,IAAC,SAAS,EAAE,EAAE,CAAC,iBAAiB,EAAE,SAAS,CAAC,KAAM,KAAK,YAC5D,QAAQ,GACD,CACX,CAAC;AACJ,CAAC"}
|
package/dist/card/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export type { CardContentProps, CardDescriptionProps, CardFooterProps, CardHeaderProps, CardHeadingTag, CardLinkProps, CardProps, CardTitleProps, } from './card';
|
|
1
|
+
export type { CardContentProps, CardDescriptionProps, CardFooterProps, CardHeaderAlign, CardHeaderProps, CardHeadingTag, CardLinkProps, CardProps, CardTitleProps, } from './card';
|
|
2
2
|
export { Card, CardContent, CardDescription, CardFooter, CardHeader, CardLink, CardTitle, } from './card';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/card/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/card/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,gBAAgB,EAChB,oBAAoB,EACpB,eAAe,EACf,eAAe,EACf,cAAc,EACd,aAAa,EACb,SAAS,EACT,cAAc,GACf,MAAM,QAAQ,CAAC;AAChB,OAAO,EACL,IAAI,EACJ,WAAW,EACX,eAAe,EACf,UAAU,EACV,UAAU,EACV,QAAQ,EACR,SAAS,GACV,MAAM,QAAQ,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/card/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,gBAAgB,EAChB,oBAAoB,EACpB,eAAe,EACf,eAAe,EACf,eAAe,EACf,cAAc,EACd,aAAa,EACb,SAAS,EACT,cAAc,GACf,MAAM,QAAQ,CAAC;AAChB,OAAO,EACL,IAAI,EACJ,WAAW,EACX,eAAe,EACf,UAAU,EACV,UAAU,EACV,QAAQ,EACR,SAAS,GACV,MAAM,QAAQ,CAAC"}
|
package/dist/card/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/card/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/card/index.ts"],"names":[],"mappings":"AAWA,OAAO,EACL,IAAI,EACJ,WAAW,EACX,eAAe,EACf,UAAU,EACV,UAAU,EACV,QAAQ,EACR,SAAS,GACV,MAAM,QAAQ,CAAC"}
|
|
@@ -12,6 +12,11 @@
|
|
|
12
12
|
display: none;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
+
/*
|
|
16
|
+
* The header stays put and the list under it scrolls, so the controls are
|
|
17
|
+
* always in reach. The popup is no taller than the room the positioner
|
|
18
|
+
* finds below (or above) the field.
|
|
19
|
+
*/
|
|
15
20
|
.ds-combobox__content {
|
|
16
21
|
display: flex;
|
|
17
22
|
flex-direction: column;
|
|
@@ -19,13 +24,87 @@
|
|
|
19
24
|
border: 1px solid var(--ds-select-content-border);
|
|
20
25
|
border-radius: var(--ds-select-content-radius);
|
|
21
26
|
background-color: var(--ds-select-content-bg);
|
|
22
|
-
max-height: 20rem;
|
|
23
|
-
overflow-y: auto;
|
|
27
|
+
max-height: min(20rem, var(--available-height, 20rem));
|
|
24
28
|
overflow-wrap: anywhere;
|
|
25
29
|
/* The `popup` layer in ds-config/scripts/stacking.ts, as Select's list. */
|
|
26
30
|
z-index: 60;
|
|
27
31
|
}
|
|
28
32
|
|
|
33
|
+
.ds-combobox__header {
|
|
34
|
+
display: flex;
|
|
35
|
+
flex-direction: column;
|
|
36
|
+
gap: var(--ds-field-gap);
|
|
37
|
+
flex: none;
|
|
38
|
+
padding: var(--ds-select-item-padding-block) var(--ds-select-item-padding-inline);
|
|
39
|
+
margin-block-end: var(--ds-select-content-padding);
|
|
40
|
+
border-block-end: 1px solid var(--ds-select-content-border);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.ds-combobox__toolbar {
|
|
44
|
+
display: flex;
|
|
45
|
+
flex-wrap: wrap;
|
|
46
|
+
align-items: center;
|
|
47
|
+
justify-content: space-between;
|
|
48
|
+
gap: var(--ds-field-gap);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.ds-combobox__status {
|
|
52
|
+
display: flex;
|
|
53
|
+
flex-wrap: wrap;
|
|
54
|
+
align-items: center;
|
|
55
|
+
gap: var(--ds-field-gap);
|
|
56
|
+
margin: 0;
|
|
57
|
+
color: var(--ds-field-hint-text);
|
|
58
|
+
font-size: var(--ds-field-hint-font-size);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/* A pinned facet: the highlighted-item surface, so it reads as chosen. */
|
|
62
|
+
.ds-combobox__chip {
|
|
63
|
+
display: inline-flex;
|
|
64
|
+
align-items: center;
|
|
65
|
+
gap: var(--ds-field-gap);
|
|
66
|
+
padding-inline-start: var(--ds-select-item-padding-inline);
|
|
67
|
+
border-radius: var(--ds-select-content-radius);
|
|
68
|
+
background-color: var(--ds-select-item-bg-highlighted);
|
|
69
|
+
color: var(--ds-select-item-text-highlighted);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.ds-combobox__chip-remove,
|
|
73
|
+
.ds-combobox__pin {
|
|
74
|
+
display: inline-flex;
|
|
75
|
+
align-items: center;
|
|
76
|
+
justify-content: center;
|
|
77
|
+
padding: var(--ds-select-content-padding);
|
|
78
|
+
border: 0;
|
|
79
|
+
border-radius: var(--ds-select-content-radius);
|
|
80
|
+
background: none;
|
|
81
|
+
color: inherit;
|
|
82
|
+
cursor: pointer;
|
|
83
|
+
|
|
84
|
+
&:focus-visible {
|
|
85
|
+
outline: 2px solid var(--ds-input-focus-ring);
|
|
86
|
+
outline-offset: 1px;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.ds-combobox__list {
|
|
91
|
+
flex: 1 1 auto;
|
|
92
|
+
min-height: 0;
|
|
93
|
+
overflow-y: auto;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/*
|
|
97
|
+
* A block, so it can scroll; its row groups then share one anonymous
|
|
98
|
+
* table, so the columns line up across groups. A container, so the facet
|
|
99
|
+
* column can be capped at a share of its width.
|
|
100
|
+
*/
|
|
101
|
+
.ds-combobox__list--grid {
|
|
102
|
+
display: block;
|
|
103
|
+
container-type: inline-size;
|
|
104
|
+
border-collapse: separate;
|
|
105
|
+
border-spacing: 0;
|
|
106
|
+
}
|
|
107
|
+
|
|
29
108
|
.ds-combobox__item {
|
|
30
109
|
display: flex;
|
|
31
110
|
flex-direction: column;
|
|
@@ -49,6 +128,82 @@
|
|
|
49
128
|
}
|
|
50
129
|
}
|
|
51
130
|
|
|
131
|
+
/*
|
|
132
|
+
* A grid row is a table row, which can't round its corners, so its
|
|
133
|
+
* padding, corners and highlight go on its cells. The facet column is as
|
|
134
|
+
* wide as its longest name and the option column takes the rest.
|
|
135
|
+
*/
|
|
136
|
+
tr.ds-combobox__item {
|
|
137
|
+
display: table-row;
|
|
138
|
+
padding: 0;
|
|
139
|
+
|
|
140
|
+
&[data-highlighted] {
|
|
141
|
+
background-color: transparent;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
& > td {
|
|
145
|
+
padding: var(--ds-select-item-padding-block) var(--ds-select-item-padding-inline);
|
|
146
|
+
vertical-align: middle;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
&[data-highlighted] > td {
|
|
150
|
+
background-color: var(--ds-select-item-bg-highlighted);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
& > td:first-child {
|
|
154
|
+
border-start-start-radius: inherit;
|
|
155
|
+
border-end-start-radius: inherit;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
& > td:last-child {
|
|
159
|
+
border-start-end-radius: inherit;
|
|
160
|
+
border-end-end-radius: inherit;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
.ds-combobox__facet {
|
|
165
|
+
width: 1%;
|
|
166
|
+
color: var(--ds-field-hint-text);
|
|
167
|
+
font-size: var(--ds-field-hint-font-size);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
/*
|
|
171
|
+
* As wide as the facet's name, so a short one never wraps in its 1% wide
|
|
172
|
+
* column, but no wider than two fifths of the list: a long name wraps
|
|
173
|
+
* there and leaves the option column its room.
|
|
174
|
+
*/
|
|
175
|
+
.ds-combobox__facet-content {
|
|
176
|
+
display: inline-flex;
|
|
177
|
+
align-items: center;
|
|
178
|
+
gap: var(--ds-field-gap);
|
|
179
|
+
inline-size: max-content;
|
|
180
|
+
max-inline-size: 40cqi;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
.ds-combobox__facet-label {
|
|
184
|
+
min-width: 0;
|
|
185
|
+
overflow-wrap: anywhere;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
/*
|
|
189
|
+
* The pin answers the keyboard too: with the row's pin cell active, the
|
|
190
|
+
* field keeps focus, so the ring is drawn from `data-active`.
|
|
191
|
+
*/
|
|
192
|
+
.ds-combobox__pin {
|
|
193
|
+
&[data-active] {
|
|
194
|
+
outline: 2px solid var(--ds-input-focus-ring);
|
|
195
|
+
outline-offset: 1px;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
&[aria-pressed="true"] {
|
|
199
|
+
color: var(--ds-select-item-text-highlighted);
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
.ds-combobox__item[data-highlighted] .ds-combobox__facet {
|
|
204
|
+
color: inherit;
|
|
205
|
+
}
|
|
206
|
+
|
|
52
207
|
/*
|
|
53
208
|
* A group of options under its heading, set apart from the group above by
|
|
54
209
|
* more space than separates two options, so the groups read as groups.
|
|
@@ -58,12 +213,18 @@
|
|
|
58
213
|
margin-block-start: var(--ds-combobox-group-gap);
|
|
59
214
|
}
|
|
60
215
|
|
|
216
|
+
/* A grid's row groups take no margin; their heading cell carries the gap. */
|
|
217
|
+
tbody.ds-combobox__group:not(:first-of-type) > tr:first-child > th {
|
|
218
|
+
padding-block-start: calc(var(--ds-select-item-padding-block) + var(--ds-combobox-group-gap));
|
|
219
|
+
}
|
|
220
|
+
|
|
61
221
|
.ds-combobox__group-label {
|
|
62
222
|
display: block;
|
|
63
223
|
padding: var(--ds-select-item-padding-block) var(--ds-select-item-padding-inline);
|
|
64
224
|
color: var(--ds-combobox-group-label-text);
|
|
65
225
|
font-size: var(--ds-combobox-group-label-font-size);
|
|
66
226
|
font-weight: var(--ds-combobox-group-label-font-weight);
|
|
227
|
+
text-align: start;
|
|
67
228
|
}
|
|
68
229
|
|
|
69
230
|
.ds-combobox__item-description {
|
|
@@ -71,6 +232,12 @@
|
|
|
71
232
|
font-size: var(--ds-field-hint-font-size);
|
|
72
233
|
}
|
|
73
234
|
|
|
235
|
+
/* In a grid the label and description stack inside their table cell. */
|
|
236
|
+
.ds-combobox__cell > .ds-combobox__item-label,
|
|
237
|
+
.ds-combobox__cell > .ds-combobox__item-description {
|
|
238
|
+
display: block;
|
|
239
|
+
}
|
|
240
|
+
|
|
74
241
|
/*
|
|
75
242
|
* A highlighted row takes the highlighted text colour, which the hint
|
|
76
243
|
* colour was never measured against; the description follows the row.
|
|
@@ -1,10 +1,21 @@
|
|
|
1
1
|
import { type ReactNode, type Ref } from 'react';
|
|
2
|
+
import { type IconSource } from '../icon/icon';
|
|
3
|
+
import '../visually-hidden/visually-hidden.css';
|
|
2
4
|
import './combobox.css';
|
|
3
5
|
export type ComboboxSize = 'sm' | 'md' | 'lg';
|
|
6
|
+
/** What an option belongs to, shown in a second column: its category, its project. */
|
|
7
|
+
export interface ComboboxFacet {
|
|
8
|
+
/** Stable value reported when the facet is pinned. */
|
|
9
|
+
value: string;
|
|
10
|
+
/** Text in the facet column, and in the pinned chip. */
|
|
11
|
+
label: string;
|
|
12
|
+
/** Decorative mark before the label, such as the category's icon. */
|
|
13
|
+
icon?: ReactNode;
|
|
14
|
+
}
|
|
4
15
|
export interface ComboboxItem {
|
|
5
16
|
/** Stable value reported by `onSelect`. */
|
|
6
17
|
value: string;
|
|
7
|
-
/** Option text, also what
|
|
18
|
+
/** Option text, also what screen readers use. */
|
|
8
19
|
label: string;
|
|
9
20
|
/** Optional secondary line under the label, shown muted. */
|
|
10
21
|
description?: string;
|
|
@@ -17,14 +28,35 @@ export interface ComboboxItem {
|
|
|
17
28
|
* any group.
|
|
18
29
|
*/
|
|
19
30
|
group?: string;
|
|
31
|
+
/** What the option belongs to, shown in the facet column when `facets` is set. */
|
|
32
|
+
facet?: ComboboxFacet;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* A second column naming what each option belongs to, with a pin that
|
|
36
|
+
* narrows the list to it.
|
|
37
|
+
*/
|
|
38
|
+
export interface ComboboxFacets {
|
|
39
|
+
/** Heading of the option column, for assistive tech: "Action". */
|
|
40
|
+
itemLabel: string;
|
|
41
|
+
/** Heading of the facet column, for assistive tech: "Category". */
|
|
42
|
+
label: string;
|
|
43
|
+
/** The facet the list is narrowed to, shown as a removable chip in the status line. */
|
|
44
|
+
pinned?: ComboboxFacet | null;
|
|
45
|
+
/**
|
|
46
|
+
* Pins a row's facet, or unpins it with `null` (its pin pressed again, the
|
|
47
|
+
* chip's remove button, or Backspace in the empty field). The caller does
|
|
48
|
+
* the narrowing. Without it, the facet column shows no pins.
|
|
49
|
+
*/
|
|
50
|
+
onPinnedChange?: (facet: ComboboxFacet | null) => void;
|
|
20
51
|
}
|
|
21
52
|
export interface ComboboxProps {
|
|
22
53
|
/**
|
|
23
54
|
* Suggestions for the current text.
|
|
24
55
|
*
|
|
25
|
-
* The caller filters them; the component does not. What
|
|
26
|
-
* (a prefix, a substring,
|
|
27
|
-
* call, and the list it passes is the
|
|
56
|
+
* The caller filters, sorts and groups them; the component does not. What
|
|
57
|
+
* counts as a match (a prefix, a substring, a category's name, anything
|
|
58
|
+
* not already chosen) is the product's call, and the list it passes is the
|
|
59
|
+
* list that shows.
|
|
28
60
|
*/
|
|
29
61
|
items: ComboboxItem[];
|
|
30
62
|
/** Controlled text in the input. */
|
|
@@ -48,6 +80,23 @@ export interface ComboboxProps {
|
|
|
48
80
|
placeholder?: string;
|
|
49
81
|
/** Shown in the open list when `items` is empty. */
|
|
50
82
|
emptyText?: ReactNode;
|
|
83
|
+
/**
|
|
84
|
+
* Controls at the top of the open list that change what it shows: a
|
|
85
|
+
* `Switch`, a small `SegmentGroup`. One row of them, so the options stay
|
|
86
|
+
* in view; Tab moves into them from the field.
|
|
87
|
+
*/
|
|
88
|
+
toolbar?: ReactNode;
|
|
89
|
+
/**
|
|
90
|
+
* One line under the toolbar saying what the list shows, such as "Showing
|
|
91
|
+
* all actions in Health". Announced politely as it changes.
|
|
92
|
+
*/
|
|
93
|
+
status?: ReactNode;
|
|
94
|
+
/** Adds the facet column, with its pins. The list becomes a grid. */
|
|
95
|
+
facets?: ComboboxFacets;
|
|
96
|
+
/** Glyph of a row's pin. Defaults to the inlined fallback pin. */
|
|
97
|
+
pinIcon?: IconSource;
|
|
98
|
+
/** Glyph of the pinned chip's remove button. Defaults to the inlined fallback cross. */
|
|
99
|
+
removeIcon?: IconSource;
|
|
51
100
|
/** Control height and type scale. */
|
|
52
101
|
size?: ComboboxSize;
|
|
53
102
|
/** Disable the whole control. */
|
|
@@ -60,32 +109,48 @@ export interface ComboboxProps {
|
|
|
60
109
|
inputRef?: Ref<HTMLInputElement>;
|
|
61
110
|
}
|
|
62
111
|
/**
|
|
63
|
-
* A text input that suggests options as you type,
|
|
112
|
+
* A text input that suggests options as you type, with optional controls at
|
|
113
|
+
* the top of the open list.
|
|
64
114
|
*
|
|
65
115
|
* Choosing a suggestion reports it through `onSelect` and empties the input,
|
|
66
116
|
* so the field is ready for the next one: the control for adding items to a
|
|
67
117
|
* list one at a time. It never holds a selection itself; the caller keeps
|
|
68
118
|
* the list. For a field that keeps one choice, use `Select`.
|
|
69
119
|
*
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
* with `Input` and `Select`, and offers a flat `items` API.
|
|
120
|
+
* The open list can carry what narrows it, so nothing sits outside the
|
|
121
|
+
* field: a `toolbar` row of switches or a segment group, a `status` line
|
|
122
|
+
* saying what is shown, and with `facets` a second column naming what each
|
|
123
|
+
* option belongs to, whose pin narrows the list to it.
|
|
75
124
|
*
|
|
76
125
|
* ```tsx
|
|
77
126
|
* <Combobox
|
|
78
|
-
* label="Add
|
|
127
|
+
* label="Add actions"
|
|
79
128
|
* items={matches}
|
|
80
129
|
* inputValue={query}
|
|
81
130
|
* onInputValueChange={setQuery}
|
|
82
131
|
* onSelect={(value) => setPicked((list) => [...list, value])}
|
|
83
|
-
*
|
|
132
|
+
* toolbar={<Switch size="sm" label="Include categories" checked={…} onCheckedChange={…} />}
|
|
133
|
+
* status={`Showing all actions that contain “${query}”`}
|
|
134
|
+
* facets={{ itemLabel: 'Action', label: 'Category', pinned, onPinnedChange: setPinned }}
|
|
84
135
|
* />
|
|
85
136
|
* ```
|
|
86
137
|
*
|
|
87
|
-
* The
|
|
88
|
-
*
|
|
138
|
+
* The field is the APG editable combobox. Focus stays in the input, and the
|
|
139
|
+
* active option is `aria-activedescendant`. Typing highlights the first
|
|
140
|
+
* option, so Enter takes it, and Up and Down walk the options in their drawn
|
|
141
|
+
* order. With `facets` the popup is a grid instead of a listbox: Right, at
|
|
142
|
+
* the end of the text, moves onto the row's pin and Enter then pins it, and
|
|
143
|
+
* Left moves back. Tab moves from the field into the toolbar and the chip,
|
|
144
|
+
* and on out to the next field.
|
|
145
|
+
*
|
|
146
|
+
* The popup is an Ark Popover anchored to the field, so it takes part in
|
|
147
|
+
* the dismiss stack. Escape closes it before a `Dialog` around it, and a
|
|
148
|
+
* click outside closes it. Its wrapper drops the Popover's dialog role, so
|
|
149
|
+
* the listbox or grid inside is the popup assistive tech meets. It portals
|
|
150
|
+
* like `Select`'s list: into `<body>`, or into the panel of the ui-core
|
|
151
|
+
* `Dialog` it opens in, at `z-index: 60`.
|
|
152
|
+
* The field reads the `--ds-input-*` keys and the list the `--ds-select-*`
|
|
153
|
+
* keys, so it reads as one family with `Input` and `Select`.
|
|
89
154
|
*/
|
|
90
|
-
export declare function Combobox({ items, inputValue, onInputValueChange, onSelect, label, 'aria-label': ariaLabel, placeholder, emptyText, size, disabled, invalid, className, inputRef, }: ComboboxProps): import("react/jsx-runtime").JSX.Element;
|
|
155
|
+
export declare function Combobox({ items, inputValue, onInputValueChange, onSelect, label, 'aria-label': ariaLabel, placeholder, emptyText, toolbar, status, facets, pinIcon, removeIcon, size, disabled, invalid, className, inputRef, }: ComboboxProps): import("react/jsx-runtime").JSX.Element;
|
|
91
156
|
//# sourceMappingURL=combobox.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"combobox.d.ts","sourceRoot":"","sources":["../../src/combobox/combobox.tsx"],"names":[],"mappings":"
|
|
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;AAIf,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,aA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