@astryxdesign/core 0.7.1-canary.c2463a6 → 0.7.1-canary.c2e7d8b
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/CommandPalette/CommandPaletteList.js +1 -1
- package/dist/ComplexSelector/ComplexSelector.d.ts +8 -5
- package/dist/ComplexSelector/ComplexSelector.d.ts.map +1 -1
- package/dist/ComplexSelector/ComplexSelector.js +12 -3
- package/dist/DateInput/DateInput.js +1 -1
- package/dist/DropdownMenu/DropdownMenu.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenu.js +140 -63
- package/dist/Grid/Grid.d.ts +13 -4
- package/dist/Grid/Grid.d.ts.map +1 -1
- package/dist/Grid/Grid.js +7 -1
- package/dist/MultiSelector/MultiSelector.d.ts +6 -4
- package/dist/MultiSelector/MultiSelector.d.ts.map +1 -1
- package/dist/MultiSelector/MultiSelector.js +16 -3
- package/dist/Selector/Selector.d.ts +6 -3
- package/dist/Selector/Selector.d.ts.map +1 -1
- package/dist/Selector/Selector.js +20 -6
- package/dist/hooks/useScrollOverflow.d.ts.map +1 -1
- package/dist/hooks/useScrollOverflow.js +55 -12
- package/dist/reset.until-found.a11y.browser.spec.d.ts +2 -0
- package/dist/reset.until-found.a11y.browser.spec.d.ts.map +1 -0
- package/dist/reset.until-found.a11y.browser.spec.js +71 -0
- package/package.json +3 -3
- package/src/Chat/ChatComposerInput.spec.md +86 -50
- package/src/CommandPalette/CommandPaletteList.test.tsx +13 -0
- package/src/CommandPalette/CommandPaletteList.tsx +1 -1
- package/src/ComplexSelector/ComplexSelector.doc.mjs +10 -8
- package/src/ComplexSelector/ComplexSelector.test.tsx +64 -16
- package/src/ComplexSelector/ComplexSelector.tsx +37 -8
- package/src/DateInput/DateInput.test.tsx +38 -0
- package/src/DateInput/DateInput.tsx +1 -1
- package/src/DropdownMenu/DropdownMenu.doc.mjs +2 -2
- package/src/DropdownMenu/DropdownMenu.spec.md +73 -47
- package/src/DropdownMenu/DropdownMenu.test.tsx +239 -23
- package/src/DropdownMenu/DropdownMenu.tsx +189 -79
- package/src/DropdownMenu/__tests__/MenuHeaderFooter.a11y.chromium.spec.ts +40 -5
- package/src/Grid/Grid.doc.mjs +14 -11
- package/src/Grid/Grid.tsx +13 -4
- package/src/MultiSelector/MultiSelector.doc.mjs +8 -8
- package/src/MultiSelector/MultiSelector.test.tsx +138 -20
- package/src/MultiSelector/MultiSelector.tsx +41 -11
- package/src/Selector/Selector.doc.mjs +7 -6
- package/src/Selector/Selector.spec.md +14 -11
- package/src/Selector/Selector.test.tsx +124 -10
- package/src/Selector/Selector.tsx +51 -14
- package/src/Selector/__tests__/Combobox.a11y.known-failures.ts +27 -0
- package/src/Selector/__tests__/Combobox.a11y.states.ts +145 -0
- package/src/Selector/__tests__/Selector.combobox.a11y.chromium.spec.ts +108 -0
- package/src/Selector/__tests__/Selector.combobox.a11y.test.tsx +126 -0
- package/src/hooks/useScrollOverflow.test.tsx +222 -0
- package/src/hooks/useScrollOverflow.ts +55 -13
- package/src/reset.css +4 -2
- package/src/reset.until-found.a11y.browser.spec.ts +75 -0
- package/src/reset.until-found.test.ts +32 -0
|
@@ -68,7 +68,7 @@ export function CommandPaletteList({
|
|
|
68
68
|
return /*#__PURE__*/_jsx("div", {
|
|
69
69
|
ref: ref,
|
|
70
70
|
...props,
|
|
71
|
-
id: ctx?.listId,
|
|
71
|
+
id: ctx?.listId ?? props.id,
|
|
72
72
|
role: "listbox",
|
|
73
73
|
"aria-label": label,
|
|
74
74
|
...mergeProps(themeProps('command-palette-list'), stylex.props(styles.list, xstyle), className, style),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @file ComplexSelector.tsx
|
|
3
3
|
* @input Uses React, StyleX, Field, Icon slots, Layer positioning, and usePopover
|
|
4
|
-
* @output Exports a rich-selector shell with exact token-sized input and ghost triggers, plus an imperative open/close handle
|
|
4
|
+
* @output Exports a rich-selector shell with exact token-sized input, secondary, and ghost triggers, plus an imperative open/close handle
|
|
5
5
|
* @position Core implementation; consumed by index.ts
|
|
6
6
|
*
|
|
7
7
|
* SYNC: When modified, update:
|
|
@@ -18,7 +18,7 @@ import { type FieldStatusVariant } from '../Field';
|
|
|
18
18
|
import { type IconType } from '../Icon';
|
|
19
19
|
import type { LayerAlignment, LayerPlacement } from '../Layer/useLayer';
|
|
20
20
|
import type { SizeValue } from '../utils/types';
|
|
21
|
-
export type ComplexSelectorVariant = 'input' | 'ghost';
|
|
21
|
+
export type ComplexSelectorVariant = 'input' | 'secondary' | 'ghost';
|
|
22
22
|
export type ComplexSelectorSize = 'sm' | 'md' | 'lg';
|
|
23
23
|
/**
|
|
24
24
|
* Props the `renderTrigger` render prop hands to the control the caller
|
|
@@ -126,17 +126,20 @@ export interface ComplexSelectorProps<Value> extends Omit<FieldInputBaseProps, '
|
|
|
126
126
|
status?: ComplexSelectorStatus;
|
|
127
127
|
/**
|
|
128
128
|
* How the status message is placed relative to the input.
|
|
129
|
-
* - 'attached': message overlaps directly below the input (bordered treatment; detached when variant is ghost)
|
|
129
|
+
* - 'attached': message overlaps directly below the input (bordered treatment; detached when variant is secondary or ghost)
|
|
130
130
|
* - 'detached': message floats below as a separate element with spacing
|
|
131
131
|
* - 'tooltip': no message box; the status icon becomes a focusable info-tip button that reveals the message on hover, keyboard focus, or tap
|
|
132
|
-
* @default 'attached'
|
|
132
|
+
* @default 'attached' for input selectors; 'detached' for secondary and ghost selectors
|
|
133
133
|
*/
|
|
134
134
|
statusVariant?: FieldStatusVariant;
|
|
135
135
|
/** Tooltip text displayed next to the label. */
|
|
136
136
|
labelTooltip?: string;
|
|
137
137
|
/** Trigger and field size. */
|
|
138
138
|
size?: ComplexSelectorSize;
|
|
139
|
-
/**
|
|
139
|
+
/**
|
|
140
|
+
* Visual trigger style. Secondary matches secondary buttons; ghost matches
|
|
141
|
+
* ghost buttons.
|
|
142
|
+
*/
|
|
140
143
|
variant?: ComplexSelectorVariant;
|
|
141
144
|
/** Icon displayed at the start of the trigger. */
|
|
142
145
|
startIcon?: ReactNode | IconType;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ComplexSelector.d.ts","sourceRoot":"","sources":["../../src/ComplexSelector/ComplexSelector.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,EAOZ,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAEL,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACzB,MAAM,qBAAqB,CAAC;AAI7B,OAAO,EAA4B,KAAK,kBAAkB,EAAC,MAAM,UAAU,CAAC;AAC5E,OAAO,EAAuB,KAAK,QAAQ,EAAC,MAAM,SAAS,CAAC;AAI5D,OAAO,KAAK,EAAC,cAAc,EAAE,cAAc,EAAC,MAAM,mBAAmB,CAAC;AAmBtE,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"ComplexSelector.d.ts","sourceRoot":"","sources":["../../src/ComplexSelector/ComplexSelector.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,EAOZ,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAEL,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACzB,MAAM,qBAAqB,CAAC;AAI7B,OAAO,EAA4B,KAAK,kBAAkB,EAAC,MAAM,UAAU,CAAC;AAC5E,OAAO,EAAuB,KAAK,QAAQ,EAAC,MAAM,SAAS,CAAC;AAI5D,OAAO,KAAK,EAAC,cAAc,EAAE,cAAc,EAAC,MAAM,mBAAmB,CAAC;AAmBtE,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAwK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ACN,aAA0B,EAC1B,YAAY,EACZ,IAAW,EACX,OAAiB,EACjB,SAAS,EACT,KAAK,EACL,SAAmB,EACnB,SAAmB,EACnB,SAAS,EACT,aAAa,EACb,YAAY,EACZ,aAAa,EACb,eAAe,EACf,kBAAkB,EAClB,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,YAAY,EACZ,GAAG,EACH,EAAE,EACF,OAAO,EAAE,WAAW,EACpB,SAAS,EAAE,aAAa,EACxB,kBAAkB,EAAE,mBAAmB,EACvC,GAAG,SAAS,EACb,EAAE,oBAAoB,CAAC,KAAK,CAAC,qBAoU7B;yBA3We,eAAe"}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @file ComplexSelector.tsx
|
|
7
7
|
* @input Uses React, StyleX, Field, Icon slots, Layer positioning, and usePopover
|
|
8
|
-
* @output Exports a rich-selector shell with exact token-sized input and ghost triggers, plus an imperative open/close handle
|
|
8
|
+
* @output Exports a rich-selector shell with exact token-sized input, secondary, and ghost triggers, plus an imperative open/close handle
|
|
9
9
|
* @position Core implementation; consumed by index.ts
|
|
10
10
|
*
|
|
11
11
|
* SYNC: When modified, update:
|
|
@@ -100,6 +100,15 @@ const styles = {
|
|
|
100
100
|
k3aq6I: "x3oybdh xk4oym4 x5lqen6 x3y5scg",
|
|
101
101
|
$$css: true
|
|
102
102
|
},
|
|
103
|
+
triggerSecondary: {
|
|
104
|
+
kMzoRj: "xc342km",
|
|
105
|
+
kWkggS: "x17x4s8c",
|
|
106
|
+
kGVxlE: "x1gnnqk1 x1s17dad x15ysqaf",
|
|
107
|
+
k63SB2: "x1e4wzip",
|
|
108
|
+
k1ekBW: "xrafxwg",
|
|
109
|
+
k3aq6I: "x3oybdh xk4oym4 x5lqen6 x3y5scg",
|
|
110
|
+
$$css: true
|
|
111
|
+
},
|
|
103
112
|
triggerGhostDisabled: {
|
|
104
113
|
kKwaWg: "x18o3ruo",
|
|
105
114
|
k3aq6I: "x1c071of x1pdlv7q x1ylxtyb",
|
|
@@ -250,7 +259,7 @@ export function ComplexSelector({
|
|
|
250
259
|
isOptional
|
|
251
260
|
});
|
|
252
261
|
const placeholder = placeholderFromProps ?? t('@astryx.selector.placeholder');
|
|
253
|
-
const effectiveStatusVariant = variant
|
|
262
|
+
const effectiveStatusVariant = variant !== 'input' && statusVariant === 'attached' ? 'detached' : statusVariant;
|
|
254
263
|
const generatedTriggerId = useId();
|
|
255
264
|
// A caller's `id` lands on the trigger, so the label wiring must use it.
|
|
256
265
|
const triggerId = id ?? generatedTriggerId;
|
|
@@ -411,7 +420,7 @@ export function ComplexSelector({
|
|
|
411
420
|
// inside it), but it must still be a KEYBOARD ring: `:focus-within`
|
|
412
421
|
// matched a mouse click on the trigger and drew the outline for
|
|
413
422
|
// pointer users too. `focusWithin` here is `:has(:focus-visible)`.
|
|
414
|
-
focusOutlineStyles.focusWithin, variant === '
|
|
423
|
+
focusOutlineStyles.focusWithin, variant === 'secondary' && styles.triggerSecondary, variant === 'ghost' && styles.triggerGhost, variant !== 'input' && interactionOverlayStyles.backgroundImage, isDisabled && inputWrapperStyles.disabled, variant !== 'input' && isDisabled && styles.triggerGhostDisabled, isDisabled && styles.disabled, triggerLabel == null && styles.placeholder, controlXstyle), controlClassName, controlStyle),
|
|
415
424
|
children: [isRenderable(startIconSlot) && startIconSlot, /*#__PURE__*/_jsx("button", {
|
|
416
425
|
...rest,
|
|
417
426
|
ref: triggerButtonRef,
|
|
@@ -526,7 +526,7 @@ function PointerDateField({
|
|
|
526
526
|
}), statusIcon, popover.render(/*#__PURE__*/_jsx(Calendar, {
|
|
527
527
|
handleRef: calendarRef,
|
|
528
528
|
mode: "single",
|
|
529
|
-
value: optimisticValue,
|
|
529
|
+
value: optimisticValue ?? null,
|
|
530
530
|
onChange: handleDateSelect,
|
|
531
531
|
min: min,
|
|
532
532
|
max: max,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownMenu.d.ts","sourceRoot":"","sources":["../../src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iBAAiB,GAC3B,qBAAqB,GAAG,yBAAyB,CAAC;AA8pCpD,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,qBA4CpD;yBA5Ce,YAAY"}
|
|
@@ -83,6 +83,40 @@ const MENU_TRIGGER_OPEN_BACKGROUND = `linear-gradient(${colorVars['--color-overl
|
|
|
83
83
|
* aria-hidden subtrees) are not reachable, judged by the popover focus trap's
|
|
84
84
|
* own test so the two never disagree about where Tab can go.
|
|
85
85
|
*/
|
|
86
|
+
/**
|
|
87
|
+
* Collapse each named radio group to the one Tab stop a browser gives it: the
|
|
88
|
+
* focused radio, else the checked one, else the first radio moving forward or
|
|
89
|
+
* the last moving backward. The stop takes the group's first position.
|
|
90
|
+
*/
|
|
91
|
+
function collapseRadioGroups(elements, active, isBackward) {
|
|
92
|
+
const groups = new Map();
|
|
93
|
+
const groupKey = el => el instanceof HTMLInputElement && el.getAttribute('type') === 'radio' && el.name !== '' ? `${el.form?.id ?? ''}\u0000${el.name}` : null;
|
|
94
|
+
for (const el of elements) {
|
|
95
|
+
const key = groupKey(el);
|
|
96
|
+
if (key != null) {
|
|
97
|
+
const members = groups.get(key) ?? [];
|
|
98
|
+
members.push(el);
|
|
99
|
+
groups.set(key, members);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
const placed = new Set();
|
|
103
|
+
const result = [];
|
|
104
|
+
for (const el of elements) {
|
|
105
|
+
const key = groupKey(el);
|
|
106
|
+
if (key == null) {
|
|
107
|
+
result.push(el);
|
|
108
|
+
continue;
|
|
109
|
+
}
|
|
110
|
+
if (placed.has(key)) {
|
|
111
|
+
continue;
|
|
112
|
+
}
|
|
113
|
+
placed.add(key);
|
|
114
|
+
const members = groups.get(key) ?? [];
|
|
115
|
+
const stop = members.find(radio => radio === active) ?? members.find(radio => radio.checked) ?? (isBackward ? members[members.length - 1] : members[0]);
|
|
116
|
+
result.push(stop);
|
|
117
|
+
}
|
|
118
|
+
return result;
|
|
119
|
+
}
|
|
86
120
|
function tabbablesIn(region) {
|
|
87
121
|
if (region == null) {
|
|
88
122
|
return [];
|
|
@@ -108,8 +142,9 @@ function isInsideHiddenWrapper(element, region) {
|
|
|
108
142
|
}
|
|
109
143
|
|
|
110
144
|
/**
|
|
111
|
-
* Move focus to a
|
|
112
|
-
* caller can
|
|
145
|
+
* Move focus to a Tab stop in the dialog. Reports whether focus actually
|
|
146
|
+
* arrived, so a caller can fall back to the menu instead of stranding focus on
|
|
147
|
+
* the page.
|
|
113
148
|
*/
|
|
114
149
|
function focusRegionControl(element) {
|
|
115
150
|
element.focus();
|
|
@@ -320,6 +355,16 @@ function visibleText(element) {
|
|
|
320
355
|
for (const hidden of copy.querySelectorAll('[aria-hidden="true"]')) {
|
|
321
356
|
hidden.remove();
|
|
322
357
|
}
|
|
358
|
+
// An icon-only control is named by its image's alt, an inner aria-label, or
|
|
359
|
+
// an svg title rather than by text, so those count as its contents too.
|
|
360
|
+
for (const named of copy.querySelectorAll('img[alt], [aria-label]')) {
|
|
361
|
+
const name = named.getAttribute(named.tagName === 'IMG' ? 'alt' : 'aria-label') ?? '';
|
|
362
|
+
named.replaceWith(copy.ownerDocument.createTextNode(` ${name} `));
|
|
363
|
+
}
|
|
364
|
+
for (const svg of copy.querySelectorAll('svg')) {
|
|
365
|
+
const title = svg.querySelector('title')?.textContent ?? '';
|
|
366
|
+
svg.replaceWith(copy.ownerDocument.createTextNode(` ${title} `));
|
|
367
|
+
}
|
|
323
368
|
return (copy.textContent ?? '').replace(/\s+/g, ' ').trim();
|
|
324
369
|
}
|
|
325
370
|
|
|
@@ -343,6 +388,18 @@ function readAccessibleName(element) {
|
|
|
343
388
|
if (label) {
|
|
344
389
|
return label;
|
|
345
390
|
}
|
|
391
|
+
// A form control is named by its own <label>s; an input button by its value.
|
|
392
|
+
const labels = 'labels' in element ? Array.from(element.labels ?? []) : [];
|
|
393
|
+
const labelText = labels.map(visibleText).join(' ').trim();
|
|
394
|
+
if (labelText !== '') {
|
|
395
|
+
return labelText;
|
|
396
|
+
}
|
|
397
|
+
if (element instanceof HTMLInputElement && ['button', 'submit', 'reset'].includes(element.getAttribute('type') ?? '')) {
|
|
398
|
+
const value = element.value.trim();
|
|
399
|
+
if (value !== '') {
|
|
400
|
+
return value;
|
|
401
|
+
}
|
|
402
|
+
}
|
|
346
403
|
const text = visibleText(element);
|
|
347
404
|
if (text !== '') {
|
|
348
405
|
return text;
|
|
@@ -685,6 +742,16 @@ function DropdownMenuPopover({
|
|
|
685
742
|
const openModalityRef = useRef('keyboard');
|
|
686
743
|
// ArrowUp opens with the LAST enabled row highlighted.
|
|
687
744
|
const focusLastOnOpenRef = useRef(false);
|
|
745
|
+
|
|
746
|
+
// Synchronizes the dialog's name from the custom trigger's DOM, an external
|
|
747
|
+
// system React does not own: the rendered control's accessible name is only
|
|
748
|
+
// readable once it mounts. With a header or footer the dialog is named like
|
|
749
|
+
// the menu, so that name is needed before the first open, not only at it.
|
|
750
|
+
useIsomorphicLayoutEffect(() => {
|
|
751
|
+
if (renderTrigger != null && hasRegions && triggerName == null) {
|
|
752
|
+
setTriggerName(readAccessibleName(buttonRef.current));
|
|
753
|
+
}
|
|
754
|
+
}, [renderTrigger, hasRegions, triggerName]);
|
|
688
755
|
const handleLayerShow = useCallback(() => {
|
|
689
756
|
acceptedOpenRef.current = true;
|
|
690
757
|
resetFocusReturn();
|
|
@@ -700,15 +767,29 @@ function DropdownMenuPopover({
|
|
|
700
767
|
setInternalIsOpen(true);
|
|
701
768
|
}
|
|
702
769
|
}, [isControlled, onClick, onOpenChange, renderTrigger, resetFocusReturn]);
|
|
770
|
+
|
|
771
|
+
// The menu's name: the dialog around it with a header or footer, and the
|
|
772
|
+
// Back row of a drilled-in view ("Back to <this>"), both read it.
|
|
773
|
+
// The design system's button names the menu by its label. A custom trigger
|
|
774
|
+
// names it by reference (or the caller's `aria-label` does), so that name
|
|
775
|
+
// is read off the control as the menu opens.
|
|
776
|
+
const callerMenuLabel = rest['aria-label'];
|
|
777
|
+
const menuLabel = renderTrigger != null ? typeof callerMenuLabel === 'string' && callerMenuLabel.trim() !== '' ? callerMenuLabel : triggerName : typeof button.label === 'string' ? button.label : undefined;
|
|
703
778
|
const popover = usePopover({
|
|
704
779
|
onHide: handleLayerHide,
|
|
705
780
|
onShow: handleLayerShow,
|
|
706
781
|
hasLightDismiss: true,
|
|
707
782
|
hasCloseButton: false,
|
|
708
783
|
hasAutoFocus: false,
|
|
709
|
-
//
|
|
710
|
-
//
|
|
711
|
-
|
|
784
|
+
// Without a header or footer the popup's own role="menu" is the exposed
|
|
785
|
+
// semantics; a dialog around it would announce an extra container. With
|
|
786
|
+
// either, the popover holds controls that are not menu items, so it is a
|
|
787
|
+
// modal dialog named like the menu, with the menu inside it. A custom
|
|
788
|
+
// trigger's name is read off the control once it mounts; until then, or
|
|
789
|
+
// when the control exposes no readable name, the dialog takes the default
|
|
790
|
+
// menu label, so it is never unnamed and never loses its role.
|
|
791
|
+
role: hasRegions ? 'dialog' : 'none',
|
|
792
|
+
dialogLabel: hasRegions ? menuLabel ?? t(DEFAULT_BUTTON_I18N_KEY) : undefined
|
|
712
793
|
});
|
|
713
794
|
const closeMenu = useCallback(() => {
|
|
714
795
|
popover.hide();
|
|
@@ -801,6 +882,42 @@ function DropdownMenuPopover({
|
|
|
801
882
|
});
|
|
802
883
|
}, [popover.isOpen, focusFirst, focusLast, listRef]);
|
|
803
884
|
|
|
885
|
+
// With a header or footer the popover is a modal dialog: Tab and Shift+Tab
|
|
886
|
+
// walk the header's controls, the menu as one stop, then the footer's
|
|
887
|
+
// controls, and wrap at either end. The key is handled here in full, so the
|
|
888
|
+
// popover's own focus trap, which listens on the document, never reads it a
|
|
889
|
+
// second time.
|
|
890
|
+
const moveDialogTab = useCallback((e, isFromFlyout = false) => {
|
|
891
|
+
const menu = listRef.current;
|
|
892
|
+
if (menu == null) {
|
|
893
|
+
return;
|
|
894
|
+
}
|
|
895
|
+
e.preventDefault();
|
|
896
|
+
e.stopPropagation();
|
|
897
|
+
// A named radio group is one stop, as the browser's own Tab order has it.
|
|
898
|
+
const cycle = collapseRadioGroups([...tabbablesIn(headerRef.current), menu, ...tabbablesIn(footerRef.current)], document.activeElement, e.shiftKey);
|
|
899
|
+
if (cycle.length === 1) {
|
|
900
|
+
// Nothing else to reach: focus stays in the menu. From a flyout that
|
|
901
|
+
// has just closed itself, that is the menu's own stop.
|
|
902
|
+
if (isFromFlyout) {
|
|
903
|
+
menu.focus();
|
|
904
|
+
}
|
|
905
|
+
return;
|
|
906
|
+
}
|
|
907
|
+
const active = document.activeElement;
|
|
908
|
+
const menuIndex = cycle.indexOf(menu);
|
|
909
|
+
// A row, or a row of an open flyout, counts as the menu's stop.
|
|
910
|
+
let index = menu.contains(active) ? menuIndex : cycle.findIndex(el => el === active || el.contains(active));
|
|
911
|
+
if (index < 0) {
|
|
912
|
+
index = menuIndex;
|
|
913
|
+
}
|
|
914
|
+
const step = e.shiftKey ? -1 : 1;
|
|
915
|
+
const next = cycle[(index + step + cycle.length) % cycle.length];
|
|
916
|
+
if (!focusRegionControl(next)) {
|
|
917
|
+
menu.focus();
|
|
918
|
+
}
|
|
919
|
+
}, [listRef]);
|
|
920
|
+
|
|
804
921
|
// Extend useListFocus with Enter/Space activation + typeahead
|
|
805
922
|
const listKeyDown = useCallback(e => {
|
|
806
923
|
// A submenu flyout renders inline inside this menu; its key events bubble
|
|
@@ -810,16 +927,7 @@ function DropdownMenuPopover({
|
|
|
810
927
|
// itself as the key bubbled up, and the root moves focus on as Tab
|
|
811
928
|
// from one of its own rows would.
|
|
812
929
|
if (e.key === 'Tab' && hasRegions) {
|
|
813
|
-
|
|
814
|
-
const tabbables = tabbablesIn(region);
|
|
815
|
-
e.stopPropagation();
|
|
816
|
-
const target = e.shiftKey ? tabbables[tabbables.length - 1] : tabbables[0];
|
|
817
|
-
if (target != null) {
|
|
818
|
-
e.preventDefault();
|
|
819
|
-
}
|
|
820
|
-
if (target == null || !focusRegionControl(target)) {
|
|
821
|
-
closeMenu();
|
|
822
|
-
}
|
|
930
|
+
moveDialogTab(e, true);
|
|
823
931
|
}
|
|
824
932
|
return;
|
|
825
933
|
}
|
|
@@ -838,30 +946,15 @@ function DropdownMenuPopover({
|
|
|
838
946
|
}
|
|
839
947
|
return;
|
|
840
948
|
}
|
|
841
|
-
//
|
|
842
|
-
//
|
|
843
|
-
//
|
|
844
|
-
//
|
|
845
|
-
//
|
|
846
|
-
//
|
|
847
|
-
// takes the Tab instead, and the menu stays open.
|
|
949
|
+
// With a header or footer the popover is a dialog and Tab wraps inside
|
|
950
|
+
// it. Without either, the APG menu-button pattern: Tab closes the menu.
|
|
951
|
+
// Menu items are tabIndex={-1} so the focus trap has nothing trappable
|
|
952
|
+
// and Tab would otherwise leak into the page while the menu stayed open
|
|
953
|
+
// (menus-5). Do NOT preventDefault — closing restores focus to the
|
|
954
|
+
// trigger, and the browser's default Tab then continues from there.
|
|
848
955
|
if (e.key === 'Tab') {
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
if (tabbables.length > 0) {
|
|
852
|
-
// From a row, the browser's Shift+Tab would stop on the menu element
|
|
853
|
-
// itself — the row's ancestor and a Tab stop — before reaching the
|
|
854
|
-
// header. The menu is one stop, so go straight to the header.
|
|
855
|
-
if (e.shiftKey && e.target !== listRef.current) {
|
|
856
|
-
e.preventDefault();
|
|
857
|
-
// The popover's focus trap listens on the document and would read
|
|
858
|
-
// this same Shift+Tab against the field just focused — the trap's
|
|
859
|
-
// first element — and wrap to the footer. This key is handled.
|
|
860
|
-
e.stopPropagation();
|
|
861
|
-
if (!focusRegionControl(tabbables[tabbables.length - 1])) {
|
|
862
|
-
closeMenu();
|
|
863
|
-
}
|
|
864
|
-
}
|
|
956
|
+
if (hasRegions) {
|
|
957
|
+
moveDialogTab(e);
|
|
865
958
|
return;
|
|
866
959
|
}
|
|
867
960
|
closeMenu();
|
|
@@ -873,24 +966,14 @@ function DropdownMenuPopover({
|
|
|
873
966
|
return;
|
|
874
967
|
}
|
|
875
968
|
listNavKeyDown(e);
|
|
876
|
-
}, [listNavKeyDown, closeMenu, typeahead, ownsEvent,
|
|
969
|
+
}, [listNavKeyDown, closeMenu, typeahead, ownsEvent, hasRegions, moveDialogTab]);
|
|
877
970
|
|
|
878
|
-
// Tab
|
|
879
|
-
// control of the header, leaves the menu as Tab from its rows does: the
|
|
880
|
-
// menu closes, focus returns to the trigger, and the browser's own Tab
|
|
881
|
-
// continues from there. Between the regions, Tab moves through the menu
|
|
882
|
-
// as one stop.
|
|
971
|
+
// Tab from a header or footer control moves through the same dialog cycle.
|
|
883
972
|
const handleRegionKeyDown = useCallback(e => {
|
|
884
|
-
if (e.key
|
|
885
|
-
|
|
886
|
-
}
|
|
887
|
-
const tabbables = tabbablesIn(e.currentTarget);
|
|
888
|
-
const isHeader = e.currentTarget === headerRef.current;
|
|
889
|
-
const exit = isHeader ? e.shiftKey ? tabbables[0] : undefined : e.shiftKey ? undefined : tabbables[tabbables.length - 1];
|
|
890
|
-
if (exit != null && exit === document.activeElement) {
|
|
891
|
-
closeMenu();
|
|
973
|
+
if (e.key === 'Tab') {
|
|
974
|
+
moveDialogTab(e);
|
|
892
975
|
}
|
|
893
|
-
}, [
|
|
976
|
+
}, [moveDialogTab]);
|
|
894
977
|
const openAndFocus = useCallback((modality = 'keyboard', notifyClick = false) => {
|
|
895
978
|
// An unavailable trigger never opens the menu. Button keeps an
|
|
896
979
|
// aria-disabled trigger focusable for its tooltip and swallows only
|
|
@@ -1047,12 +1130,6 @@ function DropdownMenuPopover({
|
|
|
1047
1130
|
drillIn,
|
|
1048
1131
|
wrapContent
|
|
1049
1132
|
} = useMenuDrillIn(isOpen);
|
|
1050
|
-
// The name a drilled-in view's Back row returns to: the menu's own name.
|
|
1051
|
-
// The design system's button names the menu by its label. A custom trigger
|
|
1052
|
-
// names it by reference (or the caller's `aria-label` does), so that name
|
|
1053
|
-
// is read off the control as the menu opens.
|
|
1054
|
-
const callerMenuLabel = rest['aria-label'];
|
|
1055
|
-
const menuLabel = renderTrigger != null ? typeof callerMenuLabel === 'string' && callerMenuLabel.trim() !== '' ? callerMenuLabel : triggerName : typeof button.label === 'string' ? button.label : undefined;
|
|
1056
1133
|
const resolvedMaxHeight = menuMaxHeight == null ? null : `${menuMaxHeight}px`;
|
|
1057
1134
|
// Context for compound items
|
|
1058
1135
|
const contextValue = useMemo(() => ({
|
|
@@ -1101,9 +1178,9 @@ function DropdownMenuPopover({
|
|
|
1101
1178
|
// keeps the browser from drawing one after pointer input (see
|
|
1102
1179
|
// handleLayerHide), so its focus needs no bookkeeping here.
|
|
1103
1180
|
onFocus: () => {},
|
|
1104
|
-
'aria-haspopup': 'menu',
|
|
1181
|
+
'aria-haspopup': hasRegions ? 'dialog' : 'menu',
|
|
1105
1182
|
'aria-expanded': isOpen,
|
|
1106
|
-
'aria-controls': menuId
|
|
1183
|
+
'aria-controls': hasRegions ? popover.id : menuId
|
|
1107
1184
|
};
|
|
1108
1185
|
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
1109
1186
|
children: [renderTrigger != null ? renderTrigger(triggerProps) : /*#__PURE__*/_jsx(Button, {
|
|
@@ -1141,9 +1218,9 @@ function DropdownMenuPopover({
|
|
|
1141
1218
|
button.onFocus?.(event);
|
|
1142
1219
|
onFocusReturnTargetFocus();
|
|
1143
1220
|
},
|
|
1144
|
-
"aria-haspopup":
|
|
1221
|
+
"aria-haspopup": hasRegions ? 'dialog' : 'menu',
|
|
1145
1222
|
"aria-expanded": isOpen,
|
|
1146
|
-
"aria-controls": menuId,
|
|
1223
|
+
"aria-controls": hasRegions ? popover.id : menuId,
|
|
1147
1224
|
"data-testid": testId
|
|
1148
1225
|
}), popover.render(renderWithRegions(/*#__PURE__*/_jsx("div", {
|
|
1149
1226
|
...rest,
|
package/dist/Grid/Grid.d.ts
CHANGED
|
@@ -21,7 +21,13 @@ export type GridAlignment = 'start' | 'center' | 'end' | 'stretch';
|
|
|
21
21
|
/**
|
|
22
22
|
* Column configuration for Grid.
|
|
23
23
|
*
|
|
24
|
-
*
|
|
24
|
+
* A number means exactly N equal columns at every width; it never reflows, so
|
|
25
|
+
* `columns={4}` on a phone renders four narrow tracks. For columns that reflow
|
|
26
|
+
* on small screens, use the object form: `{minWidth: 240, max: 4}` renders at
|
|
27
|
+
* most four columns, each at least 240px, and fewer when the container is
|
|
28
|
+
* narrower.
|
|
29
|
+
*
|
|
30
|
+
* - `number` — exactly N equal-width columns (e.g. `columns={3}`); never reflows
|
|
25
31
|
* - `object` — responsive columns based on minimum child width:
|
|
26
32
|
* - `minWidth` — minimum width (px) for each column track
|
|
27
33
|
* - `repeat` — `'fill'` (default) preserves empty tracks for consistent widths;
|
|
@@ -40,9 +46,12 @@ export interface GridProps extends BaseProps<HTMLDivElement> {
|
|
|
40
46
|
/** Ref forwarded to the root element */
|
|
41
47
|
ref?: React.Ref<HTMLDivElement>;
|
|
42
48
|
/**
|
|
43
|
-
* Column configuration.
|
|
44
|
-
*
|
|
45
|
-
*
|
|
49
|
+
* Column configuration. A number is exactly N equal columns and never
|
|
50
|
+
* reflows; for columns that reflow on small screens, use
|
|
51
|
+
* `{minWidth, max}`.
|
|
52
|
+
* - `number` — exactly N equal-width columns at every width
|
|
53
|
+
* - `{minWidth, max?, repeat?}` — responsive columns with a px floor and an
|
|
54
|
+
* optional cap
|
|
46
55
|
*
|
|
47
56
|
* @see GridColumns
|
|
48
57
|
*/
|
package/dist/Grid/Grid.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Grid.d.ts","sourceRoot":"","sources":["../../src/Grid/Grid.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,OAAO,CAAC;AACrC,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAG5C,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAChD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAI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H,SAAS,CAAC,EAAE,WAAW,CAAC;IAExB;;;;;;;;;;;;OAYG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,KAAK,CAAC,EAAE,aAAa,CAAC;IAEtB;;;OAGG;IACH,OAAO,CAAC,EAAE,aAAa,CAAC;IAExB;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AA2ND;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,IAAI,CAAC,EACnB,OAAO,EACP,SAAS,EACT,KAAK,EACL,MAAM,EACN,QAAQ,EACR,SAAS,EACT,GAAG,EACH,MAAM,EACN,SAAS,EACT,KAAK,EACL,OAAO,EACP,MAAM,EACN,SAAS,EACT,KAAK,EACL,QAAQ,EACR,GAAG,EACH,GAAG,KAAK,EACT,EAAE,SAAS,+BA6EX;yBA/Fe,IAAI"}
|
package/dist/Grid/Grid.js
CHANGED
|
@@ -26,7 +26,13 @@ import { themeProps } from "../utils/themeProps.js";
|
|
|
26
26
|
/**
|
|
27
27
|
* Column configuration for Grid.
|
|
28
28
|
*
|
|
29
|
-
*
|
|
29
|
+
* A number means exactly N equal columns at every width; it never reflows, so
|
|
30
|
+
* `columns={4}` on a phone renders four narrow tracks. For columns that reflow
|
|
31
|
+
* on small screens, use the object form: `{minWidth: 240, max: 4}` renders at
|
|
32
|
+
* most four columns, each at least 240px, and fewer when the container is
|
|
33
|
+
* narrower.
|
|
34
|
+
*
|
|
35
|
+
* - `number` — exactly N equal-width columns (e.g. `columns={3}`); never reflows
|
|
30
36
|
* - `object` — responsive columns based on minimum child width:
|
|
31
37
|
* - `minWidth` — minimum width (px) for each column track
|
|
32
38
|
* - `repeat` — `'fill'` (default) preserves empty tracks for consistent widths;
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @file MultiSelector.tsx
|
|
3
3
|
* @input Uses React, StyleX, usePopover, useTooltip, CheckboxInput, Field, Badge, Icon, InputGroupContext
|
|
4
|
-
* @output Exports MultiSelector
|
|
4
|
+
* @output Exports MultiSelector with input, secondary, and ghost trigger variants
|
|
5
5
|
* @position Core implementation; consumed by index.ts
|
|
6
6
|
*
|
|
7
7
|
* SYNC: When modified, update:
|
|
8
8
|
* - /packages/core/src/MultiSelector/MultiSelector.doc.mjs
|
|
9
9
|
* - /packages/core/src/MultiSelector/MultiSelector.test.tsx
|
|
10
10
|
* - /packages/core/src/MultiSelector/index.ts
|
|
11
|
+
* - /apps/storybook/stories/MultiSelector.stories.tsx
|
|
11
12
|
* - /apps/storybook/stories/InputGroup.stories.tsx
|
|
12
13
|
* - /packages/cli/assets/templates/blocks/components/MultiSelector/ (showcase blocks)
|
|
13
14
|
*/
|
|
@@ -20,7 +21,7 @@ import { type FieldInputBaseProps, type FieldPartStyleProps } from '../Field/fie
|
|
|
20
21
|
import type { SizeValue } from '../utils/types';
|
|
21
22
|
import type { AdaptivePresentation } from '../hooks/useAdaptivePresentation';
|
|
22
23
|
export type MultiSelectorSize = 'sm' | 'md' | 'lg';
|
|
23
|
-
export type MultiSelectorVariant = 'input' | 'ghost';
|
|
24
|
+
export type MultiSelectorVariant = 'input' | 'secondary' | 'ghost';
|
|
24
25
|
export type MultiSelectorPresentation = AdaptivePresentation;
|
|
25
26
|
export type MultiSelectorStatusType = 'warning' | 'error' | 'success';
|
|
26
27
|
export type { MultiSelectorStatus };
|
|
@@ -220,7 +221,8 @@ export interface MultiSelectorProps<T extends MultiSelectorOptionType = MultiSel
|
|
|
220
221
|
/**
|
|
221
222
|
* Visual style of the selector trigger.
|
|
222
223
|
* - 'input': bordered input-style trigger for forms
|
|
223
|
-
* - '
|
|
224
|
+
* - 'secondary': borderless, neutral-filled trigger matching secondary buttons
|
|
225
|
+
* - 'ghost': borderless, transparent trigger matching ghost buttons
|
|
224
226
|
* @default 'input'
|
|
225
227
|
*/
|
|
226
228
|
variant?: MultiSelectorVariant;
|
|
@@ -233,7 +235,7 @@ export interface MultiSelectorProps<T extends MultiSelectorOptionType = MultiSel
|
|
|
233
235
|
* - 'attached': message overlaps directly below the bordered input (input variant only)
|
|
234
236
|
* - 'detached': message floats below as a separate element with spacing
|
|
235
237
|
* - 'tooltip': message is exposed from the on-field status icon
|
|
236
|
-
* @default 'attached' for input selectors; 'detached' for ghost selectors
|
|
238
|
+
* @default 'attached' for input selectors; 'detached' for secondary and ghost selectors
|
|
237
239
|
*/
|
|
238
240
|
statusVariant?: FieldStatusVariant;
|
|
239
241
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MultiSelector.d.ts","sourceRoot":"","sources":["../../src/MultiSelector/MultiSelector.tsx"],"names":[],"mappings":"AAIA
|
|
1
|
+
{"version":3,"file":"MultiSelector.d.ts","sourceRoot":"","sources":["../../src/MultiSelector/MultiSelector.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,EAUZ,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAGf,OAAO,EAAuB,KAAK,QAAQ,EAAC,MAAM,SAAS,CAAC;AAE5D,OAAO,EAKL,KAAK,kBAAkB,EACxB,MAAM,UAAU,CAAC;AAOlB,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,cAAc,CAAC;AAapD,OAAO,KAAK,EACV,uBAAuB,EACvB,uBAAuB,EACvB,mBAAmB,EACpB,MAAM,SAAS,CAAC;AAgBjB,OAAO,EAEL,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACzB,MAAM,qBAAqB,CAAC;AAK7B,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAU9C,OAAO,KAAK,EAAC,oBAAoB,EAAC,MAAM,kCAAkC,CAAC;AAoa3E,MAAM,MAAM,iBAAiB,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAEnD,MAAM,MAAM,oBAAoB,GAAG,OAAO,GAAG,WAAW,GAAG,OAAO,CAAC;AAEnE,MAAM,MAAM,yBAAyB,GA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BAAwB,EACzC,SAAiB,EACjB,cAAwB,EACxB,WAAW,EACX,SAAa,EACb,YAAY,EACZ,iBAA2B,EAC3B,YAAwB,EACxB,aAAqB,EACrB,aAAa,EACb,SAAS,EACT,YAAY,EACZ,QAAQ,EACR,KAAK,EACL,eAAe,EACf,kBAAkB,EAClB,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,YAAY,EACZ,GAAG,EACH,EAAE,EACF,OAAO,EACP,OAAO,EACP,SAAS,EAAE,aAAa,EACxB,kBAAkB,EAAE,mBAAmB,EACvC,GAAG,SAAS,EACb,EAAE,kBAAkB,CAAC,CAAC,CAAC,qBAgjDvB;yBAtmDe,aAAa"}
|
|
@@ -5,13 +5,14 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @file MultiSelector.tsx
|
|
7
7
|
* @input Uses React, StyleX, usePopover, useTooltip, CheckboxInput, Field, Badge, Icon, InputGroupContext
|
|
8
|
-
* @output Exports MultiSelector
|
|
8
|
+
* @output Exports MultiSelector with input, secondary, and ghost trigger variants
|
|
9
9
|
* @position Core implementation; consumed by index.ts
|
|
10
10
|
*
|
|
11
11
|
* SYNC: When modified, update:
|
|
12
12
|
* - /packages/core/src/MultiSelector/MultiSelector.doc.mjs
|
|
13
13
|
* - /packages/core/src/MultiSelector/MultiSelector.test.tsx
|
|
14
14
|
* - /packages/core/src/MultiSelector/index.ts
|
|
15
|
+
* - /apps/storybook/stories/MultiSelector.stories.tsx
|
|
15
16
|
* - /apps/storybook/stories/InputGroup.stories.tsx
|
|
16
17
|
* - /packages/cli/assets/templates/blocks/components/MultiSelector/ (showcase blocks)
|
|
17
18
|
*/
|
|
@@ -113,6 +114,15 @@ const styles = {
|
|
|
113
114
|
k3aq6I: "x3oybdh xk4oym4 x5lqen6 x3y5scg",
|
|
114
115
|
$$css: true
|
|
115
116
|
},
|
|
117
|
+
triggerSecondary: {
|
|
118
|
+
kMzoRj: "xc342km",
|
|
119
|
+
kWkggS: "x17x4s8c",
|
|
120
|
+
kGVxlE: "x1gnnqk1 x1s17dad x15ysqaf",
|
|
121
|
+
k63SB2: "x1e4wzip",
|
|
122
|
+
k1ekBW: "xrafxwg",
|
|
123
|
+
k3aq6I: "x3oybdh xk4oym4 x5lqen6 x3y5scg",
|
|
124
|
+
$$css: true
|
|
125
|
+
},
|
|
116
126
|
triggerGhostDisabled: {
|
|
117
127
|
kKwaWg: "x18o3ruo",
|
|
118
128
|
k3aq6I: "x1c071of x1pdlv7q x1ylxtyb",
|
|
@@ -414,7 +424,7 @@ export function MultiSelector({
|
|
|
414
424
|
const emptyText = emptyTextFromProps ?? t('@astryx.multiSelector.empty');
|
|
415
425
|
const emptySearchText = emptySearchTextFromProps ?? t('@astryx.multiSelector.emptySearchResults');
|
|
416
426
|
const size = useSize(sizeProp, 'md');
|
|
417
|
-
const effectiveStatusVariant = variant
|
|
427
|
+
const effectiveStatusVariant = variant !== 'input' && statusVariant === 'attached' ? 'detached' : statusVariant;
|
|
418
428
|
const isEffectivelyReadOnly = isReadOnly && !isDisabled;
|
|
419
429
|
const generatedTriggerId = useId();
|
|
420
430
|
// A caller's `id` lands on the trigger, so the label and listbox wiring
|
|
@@ -1469,7 +1479,10 @@ export function MultiSelector({
|
|
|
1469
1479
|
status: status?.type ?? null,
|
|
1470
1480
|
disabled: isDisabled ? 'disabled' : null,
|
|
1471
1481
|
readonly: isEffectivelyReadOnly ? 'readonly' : null
|
|
1472
|
-
}), stylex.props(inputWrapperStyles.base, styles.triggerContainer, sizeStyles[size], variant === '
|
|
1482
|
+
}), stylex.props(inputWrapperStyles.base, styles.triggerContainer, sizeStyles[size], variant === 'secondary' && styles.triggerSecondary, variant === 'ghost' && styles.triggerGhost, variant !== 'input' && interactionOverlayStyles.backgroundImage, variant !== 'input' && focusOutlineStyles.focusWithin, surface.isTriggerFocusRingSuppressed && selectorPresentationStyles.pointerRestoredFocus, isDisabled && inputWrapperStyles.disabled, isEffectivelyReadOnly && styles.triggerReadOnly, variant !== 'input' && isDisabled && styles.triggerGhostDisabled, variant !== 'input' && isEffectivelyReadOnly && styles.triggerGhostReadOnly, optimisticValue.length === 0 && styles.triggerPlaceholder, variant === 'input' && status && inputStatusBorderStyles[status.type], variant === 'input' && status && !isDisabled && inputStatusHoverShadowStyles[status.type],
|
|
1483
|
+
// Grouped secondary triggers keep their neutral fill but take the
|
|
1484
|
+
// group's row height, connected edge radii, and focus stacking.
|
|
1485
|
+
variant !== 'ghost' && inputGroup && groupStyles.inGroup, controlXstyle), controlClassName, controlStyle),
|
|
1473
1486
|
children: [startIcon && renderIconSlot(startIcon, {
|
|
1474
1487
|
size: 'sm',
|
|
1475
1488
|
color: 'secondary'
|