@astryxdesign/core 0.5.0-canary.70dea86 → 0.5.0-canary.73b00a5
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/AvatarGroup/AvatarGroupOverflow.d.ts.map +1 -1
- package/dist/AvatarGroup/AvatarGroupOverflow.js +2 -2
- package/dist/Badge/Badge.d.ts.map +1 -1
- package/dist/Badge/Badge.js +26 -2
- package/dist/Banner/Banner.d.ts +10 -1
- package/dist/Banner/Banner.d.ts.map +1 -1
- package/dist/Banner/Banner.js +11 -2
- package/dist/Button/Button.d.ts.map +1 -1
- package/dist/Button/Button.js +2 -5
- package/dist/Calendar/Calendar.d.ts.map +1 -1
- package/dist/Calendar/Calendar.js +2 -1
- package/dist/Calendar/styles.d.ts +0 -6
- package/dist/Calendar/styles.d.ts.map +1 -1
- package/dist/Calendar/styles.js +0 -2
- package/dist/Carousel/Carousel.d.ts.map +1 -1
- package/dist/Carousel/Carousel.js +108 -7
- package/dist/CommandPalette/CommandPaletteItem.d.ts.map +1 -1
- package/dist/CommandPalette/CommandPaletteItem.js +2 -7
- package/dist/ComplexSelector/ComplexSelector.d.ts +10 -2
- package/dist/ComplexSelector/ComplexSelector.d.ts.map +1 -1
- package/dist/ComplexSelector/ComplexSelector.js +14 -7
- package/dist/DateInput/TouchDateField.d.ts.map +1 -1
- package/dist/DateInput/TouchDateField.js +3 -2
- package/dist/DropdownMenu/DropdownMenu.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenu.js +4 -13
- package/dist/Field/InputClearButton.d.ts +9 -3
- package/dist/Field/InputClearButton.d.ts.map +1 -1
- package/dist/Field/InputClearButton.js +14 -3
- package/dist/Icon/Icon.d.ts +4 -2
- package/dist/Icon/Icon.d.ts.map +1 -1
- package/dist/Icon/defaultIcons.d.ts +3 -2
- package/dist/Icon/defaultIcons.d.ts.map +1 -1
- package/dist/Icon/defaultIcons.js +7 -0
- package/dist/Icon/globalIconRegistry.d.ts +13 -0
- package/dist/Icon/globalIconRegistry.d.ts.map +1 -1
- package/dist/Icon/globalIconRegistry.js +34 -6
- package/dist/Icon/index.d.ts +1 -1
- package/dist/Icon/index.d.ts.map +1 -1
- package/dist/Icon/useIcon.d.ts +5 -2
- package/dist/Icon/useIcon.d.ts.map +1 -1
- package/dist/Icon/useIcon.js +3 -0
- package/dist/Item/Item.d.ts.map +1 -1
- package/dist/Item/Item.js +2 -2
- package/dist/Layer/gestureCounter.d.ts +8 -0
- package/dist/Layer/gestureCounter.d.ts.map +1 -0
- package/dist/Layer/gestureCounter.js +53 -0
- package/dist/Layer/useLayer.d.ts +23 -13
- package/dist/Layer/useLayer.d.ts.map +1 -1
- package/dist/Layer/useLayer.js +128 -8
- package/dist/MultiSelector/MultiSelector.d.ts.map +1 -1
- package/dist/MultiSelector/MultiSelector.js +12 -6
- package/dist/MultiSelector/hooks.d.ts +7 -1
- package/dist/MultiSelector/hooks.d.ts.map +1 -1
- package/dist/MultiSelector/hooks.js +3 -2
- package/dist/NavItem/navItemStyles.stylex.d.ts +0 -8
- package/dist/NavItem/navItemStyles.stylex.d.ts.map +1 -1
- package/dist/NavItem/navItemStyles.stylex.js +0 -2
- package/dist/NumberInput/NumberInput.d.ts.map +1 -1
- package/dist/NumberInput/NumberInput.js +41 -22
- package/dist/Outline/Outline.d.ts.map +1 -1
- package/dist/Outline/Outline.js +2 -3
- package/dist/OverflowList/OverflowList.d.ts +41 -1
- package/dist/OverflowList/OverflowList.d.ts.map +1 -1
- package/dist/OverflowList/OverflowList.js +43 -2
- package/dist/Popover/Popover.d.ts.map +1 -1
- package/dist/Popover/Popover.js +8 -14
- package/dist/Popover/usePopover.d.ts +15 -41
- package/dist/Popover/usePopover.d.ts.map +1 -1
- package/dist/Popover/usePopover.js +26 -7
- package/dist/Resizable/useResizable.d.ts +19 -1
- package/dist/Resizable/useResizable.d.ts.map +1 -1
- package/dist/Resizable/useResizable.js +101 -37
- package/dist/Selector/Selector.d.ts +1 -1
- package/dist/Selector/Selector.d.ts.map +1 -1
- package/dist/Selector/Selector.js +16 -7
- package/dist/Selector/hooks.d.ts +7 -1
- package/dist/Selector/hooks.d.ts.map +1 -1
- package/dist/Selector/hooks.js +3 -2
- package/dist/SideNav/SideNav.d.ts +6 -1
- package/dist/SideNav/SideNav.d.ts.map +1 -1
- package/dist/SideNav/SideNav.js +57 -27
- package/dist/SideNav/SideNavHeading.d.ts.map +1 -1
- package/dist/SideNav/SideNavHeading.js +3 -2
- package/dist/SideNav/SideNavItem.d.ts +29 -4
- package/dist/SideNav/SideNavItem.d.ts.map +1 -1
- package/dist/SideNav/SideNavItem.js +75 -20
- package/dist/Spinner/Spinner.d.ts +3 -1
- package/dist/Spinner/Spinner.d.ts.map +1 -1
- package/dist/Spinner/Spinner.js +199 -20
- package/dist/Stepper/Step.d.ts.map +1 -1
- package/dist/Stepper/Step.js +7 -6
- package/dist/Token/Token.d.ts.map +1 -1
- package/dist/Token/Token.js +4 -4
- package/dist/TopNav/TopNavItem.d.ts.map +1 -1
- package/dist/TopNav/TopNavItem.js +3 -3
- package/dist/TopNav/TopNavMegaMenu.d.ts.map +1 -1
- package/dist/TopNav/TopNavMegaMenu.js +2 -1
- package/dist/TopNav/TopNavMegaMenuItem.d.ts.map +1 -1
- package/dist/TopNav/TopNavMegaMenuItem.js +3 -3
- package/dist/TopNav/TopNavMenu.d.ts.map +1 -1
- package/dist/TopNav/TopNavMenu.js +3 -2
- package/dist/TreeList/TreeListItem.d.ts.map +1 -1
- package/dist/TreeList/TreeListItem.js +2 -2
- package/dist/astryx.css +35 -9
- package/dist/hooks/useOverflow.d.ts.map +1 -1
- package/dist/hooks/useOverflow.js +14 -4
- package/dist/theme/defineTheme.d.ts +9 -3
- package/dist/theme/defineTheme.d.ts.map +1 -1
- package/dist/theme/defineTheme.js +5 -0
- package/dist/utils/focusOutline.stylex.d.ts +25 -0
- package/dist/utils/focusOutline.stylex.d.ts.map +1 -1
- package/dist/utils/focusOutline.stylex.js +15 -0
- package/dist/utils/interactionOverlay.stylex.d.ts +26 -0
- package/dist/utils/interactionOverlay.stylex.d.ts.map +1 -0
- package/dist/utils/interactionOverlay.stylex.js +42 -0
- package/locales/en.json +5 -1
- package/locales/pseudo.json +3 -0
- package/package.json +2 -2
- package/src/AvatarGroup/AvatarGroupOverflow.tsx +2 -8
- package/src/Badge/Badge.doc.mjs +3 -2
- package/src/Badge/Badge.test.tsx +32 -3
- package/src/Badge/Badge.tsx +42 -1
- package/src/Banner/Banner.doc.mjs +9 -0
- package/src/Banner/Banner.test.tsx +76 -11
- package/src/Banner/Banner.tsx +21 -2
- package/src/Button/Button.tsx +2 -28
- package/src/Calendar/Calendar.tsx +2 -0
- package/src/Calendar/styles.ts +0 -12
- package/src/Carousel/Carousel.doc.mjs +3 -0
- package/src/Carousel/Carousel.test.tsx +360 -0
- package/src/Carousel/Carousel.tsx +116 -15
- package/src/CommandPalette/CommandPaletteItem.tsx +2 -12
- package/src/ComplexSelector/ComplexSelector.doc.mjs +7 -0
- package/src/ComplexSelector/ComplexSelector.test.tsx +183 -0
- package/src/ComplexSelector/ComplexSelector.tsx +22 -12
- package/src/DateInput/TouchDateField.tsx +7 -10
- package/src/DropdownMenu/DropdownMenu.test.tsx +44 -10
- package/src/DropdownMenu/DropdownMenu.tsx +4 -13
- package/src/Field/InputClearButton.test.tsx +15 -1
- package/src/Field/InputClearButton.tsx +28 -4
- package/src/Icon/Icon.test.tsx +55 -1
- package/src/Icon/Icon.tsx +5 -3
- package/src/Icon/defaultIcons.tsx +11 -2
- package/src/Icon/globalIconRegistry.test.tsx +16 -3
- package/src/Icon/globalIconRegistry.tsx +37 -6
- package/src/Icon/index.ts +1 -0
- package/src/Icon/useIcon.ts +9 -2
- package/src/Item/Item.tsx +2 -7
- package/src/Layer/gestureCounter.ts +57 -0
- package/src/Layer/useLayer.test.tsx +262 -1
- package/src/Layer/useLayer.tsx +164 -8
- package/src/Layout/__tests__/edgeCompensation.test.tsx +1 -1
- package/src/MultiSelector/MultiSelector.test.tsx +34 -0
- package/src/MultiSelector/MultiSelector.tsx +11 -11
- package/src/MultiSelector/hooks.ts +9 -2
- package/src/NavItem/navItemStyles.stylex.ts +0 -8
- package/src/NumberInput/NumberInput.test.tsx +128 -1
- package/src/NumberInput/NumberInput.tsx +15 -17
- package/src/Outline/Outline.tsx +2 -4
- package/src/OverflowList/OverflowList.doc.mjs +102 -21
- package/src/OverflowList/OverflowList.test.tsx +550 -4
- package/src/OverflowList/OverflowList.tsx +100 -2
- package/src/Popover/Popover.doc.mjs +2 -2
- package/src/Popover/Popover.test.tsx +38 -0
- package/src/Popover/Popover.tsx +28 -66
- package/src/Popover/usePopover.tsx +44 -5
- package/src/Resizable/Resizable.doc.mjs +2 -2
- package/src/Resizable/useResizable.doc.mjs +21 -2
- package/src/Resizable/useResizable.test.ts +402 -0
- package/src/Resizable/useResizable.ts +130 -47
- package/src/Selector/Selector.source-build.test.mjs +65 -0
- package/src/Selector/Selector.test.tsx +35 -0
- package/src/Selector/Selector.tsx +17 -17
- package/src/Selector/hooks.ts +17 -2
- package/src/SideNav/SideNav.doc.mjs +2 -2
- package/src/SideNav/SideNav.test.tsx +1069 -6
- package/src/SideNav/SideNav.tsx +109 -38
- package/src/SideNav/SideNavHeading.tsx +3 -0
- package/src/SideNav/SideNavItem.doc.mjs +24 -3
- package/src/SideNav/SideNavItem.tsx +134 -44
- package/src/Spinner/Spinner.doc.mjs +17 -5
- package/src/Spinner/Spinner.test.tsx +164 -0
- package/src/Spinner/Spinner.tsx +252 -22
- package/src/Stepper/Step.tsx +7 -14
- package/src/Table/Table.doc.mjs +2 -2
- package/src/Table/TableFooter.doc.mjs +1 -1
- package/src/Table/useTableSelection.doc.mjs +1 -1
- package/src/Token/Token.tsx +4 -7
- package/src/TopNav/TopNavItem.tsx +3 -7
- package/src/TopNav/TopNavMegaMenu.tsx +2 -0
- package/src/TopNav/TopNavMegaMenuItem.tsx +10 -9
- package/src/TopNav/TopNavMenu.tsx +3 -0
- package/src/TreeList/TreeListItem.tsx +2 -7
- package/src/hooks/useAnnounce.doc.mjs +96 -0
- package/src/hooks/useDevWarning.doc.mjs +96 -0
- package/src/hooks/useIndicatorFocusRing.doc.mjs +104 -0
- package/src/hooks/useInputStatusIcon.doc.mjs +142 -0
- package/src/hooks/useInteractiveRole.doc.mjs +119 -0
- package/src/hooks/useLongPress.doc.mjs +123 -0
- package/src/hooks/useOverflow.doc.mjs +58 -17
- package/src/hooks/useOverflow.ts +16 -4
- package/src/hooks/useTypeahead.doc.mjs +153 -0
- package/src/theme/defineTheme.ts +12 -3
- package/src/theme/derivedVarRegistry.test.ts +57 -0
- package/src/utils/focusOutline.stylex.ts +50 -0
- package/src/utils/interactionOverlay.stylex.ts +74 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AvatarGroupOverflow.d.ts","sourceRoot":"","sources":["../../src/AvatarGroup/AvatarGroupOverflow.tsx"],"names":[],"mappings":"AAGA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,EAAC,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAa5C,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"AvatarGroupOverflow.d.ts","sourceRoot":"","sources":["../../src/AvatarGroup/AvatarGroupOverflow.tsx"],"names":[],"mappings":"AAGA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,EAAC,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAa5C,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAS5C,MAAM,WAAW,wBAAyB,SAAQ,IAAI,CACpD,SAAS,CAAC,WAAW,CAAC,EACtB,SAAS,CACV;IACC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;IAC7B;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IAErB;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAgFD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,GAAG,EACH,KAAK,EACL,OAAO,EACP,QAAQ,EACR,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,IAAI,EACR,EAAE,wBAAwB,GAAG,SAAS,CAmEtC;yBA5Ee,mBAAmB"}
|
|
@@ -22,6 +22,7 @@ import { resolveSize } from "../Avatar/index.js";
|
|
|
22
22
|
import { useAvatarGroup } from "./AvatarGroupContext.js";
|
|
23
23
|
import { themeProps } from "../utils/themeProps.js";
|
|
24
24
|
import { focusOutlineProps } from "../utils/focusOutline.stylex.js";
|
|
25
|
+
import { interactionOverlayStyles } from "../utils/interactionOverlay.stylex.js";
|
|
25
26
|
import { useTranslator } from "../i18n/index.js";
|
|
26
27
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
27
28
|
const BORDER_WIDTH = 2;
|
|
@@ -49,7 +50,6 @@ const styles = {
|
|
|
49
50
|
button: {
|
|
50
51
|
kkrTdU: "x1ypdohk x16khyan",
|
|
51
52
|
k8WAf4: "xt970qd",
|
|
52
|
-
kKwaWg: "x14bno8m x1otsd3y x1nocapi",
|
|
53
53
|
$$css: true
|
|
54
54
|
},
|
|
55
55
|
overlap: {
|
|
@@ -133,7 +133,7 @@ export function AvatarGroupOverflow({
|
|
|
133
133
|
...mergeProps(themeProps('avatar-group-overflow', {
|
|
134
134
|
size,
|
|
135
135
|
shape
|
|
136
|
-
}), focusOutlineProps.focusVisible(styles.base, styles.button, styles.overlap, dynamicStyles.size(numericSize), dynamicStyles.fontSize(numericSize), dynamicStyles.overlap(-overlap), shapeStyles[shape], xstyle), className, style),
|
|
136
|
+
}), focusOutlineProps.focusVisible(styles.base, styles.button, interactionOverlayStyles.backgroundImageOnNeutral, styles.overlap, dynamicStyles.size(numericSize), dynamicStyles.fontSize(numericSize), dynamicStyles.overlap(-overlap), shapeStyles[shape], xstyle), className, style),
|
|
137
137
|
children: content
|
|
138
138
|
});
|
|
139
139
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Badge.d.ts","sourceRoot":"","sources":["../../src/Badge/Badge.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,OAAO,CAAC;AACrC,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAW5C,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"Badge.d.ts","sourceRoot":"","sources":["../../src/Badge/Badge.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,OAAO,CAAC;AACrC,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAW5C,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,SAAS,CAAC;AA0G7C;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG,MAAM,eAAe,CAAC;AAEjD,MAAM,WAAW,UAAW,SAAQ,SAAS,CAAC,eAAe,CAAC;IAC5D,wCAAwC;IACxC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;IACjC;;;OAGG;IACH,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB;;OAEG;IACH,KAAK,EAAE,SAAS,CAAC;IAEjB;;OAEG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;CAClB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,KAAK,CAAC,EACpB,OAAmB,EACnB,KAAK,EACL,IAAI,EACJ,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,EACH,GAAG,KAAK,EACT,EAAE,UAAU,+BAsCZ;yBA/Ce,KAAK"}
|
package/dist/Badge/Badge.js
CHANGED
|
@@ -19,7 +19,7 @@ import "../theme/tokens.stylex.js";
|
|
|
19
19
|
import { colorVars, spacingVars, radiusVars, fontWeightVars, typeScaleVars } from "../theme/tokens.stylex.js";
|
|
20
20
|
import { mergeProps } from "../utils/index.js";
|
|
21
21
|
import { themeProps } from "../utils/themeProps.js";
|
|
22
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
22
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
23
23
|
/**
|
|
24
24
|
* Base badge styles
|
|
25
25
|
*/
|
|
@@ -38,6 +38,8 @@ const styles = {
|
|
|
38
38
|
kLWn49: "x1ltkj2j",
|
|
39
39
|
k63SB2: "x1e4wzip",
|
|
40
40
|
khDVqt: "xuxw1ft",
|
|
41
|
+
ks0D6T: "x193iq5w",
|
|
42
|
+
k7Eaqz: "xeuugli",
|
|
41
43
|
$$css: true
|
|
42
44
|
}
|
|
43
45
|
};
|
|
@@ -148,13 +150,35 @@ export function Badge({
|
|
|
148
150
|
ref,
|
|
149
151
|
...props
|
|
150
152
|
}) {
|
|
153
|
+
// Clipping a label makes its tail unrecoverable, so the full text has to
|
|
154
|
+
// stay reachable somewhere. `title` is the half of that answer which costs
|
|
155
|
+
// nothing: no measurement, no hook, so `Badge` renders the same on the
|
|
156
|
+
// server and stays usable in a server component. It follows the shape
|
|
157
|
+
// `BaseTable` already uses for a truncated header cell (BaseTable.tsx) —
|
|
158
|
+
// string content only, and only when there is something to show.
|
|
159
|
+
//
|
|
160
|
+
// A rich label is left alone: it is a subtree whose text would have to be
|
|
161
|
+
// flattened to a string, and flattening renders a guess — an icon, a
|
|
162
|
+
// `<strong>`, a nested element all read differently.
|
|
163
|
+
//
|
|
164
|
+
// It is set whether or not the label actually fits, because knowing that
|
|
165
|
+
// requires measuring. The refinement — a tooltip only when the text is
|
|
166
|
+
// really cut, reachable by hover and by focus — needs that measurement and
|
|
167
|
+
// a client component, so it is tracked in #5585.
|
|
168
|
+
const labelTitle = typeof label === 'number' ? String(label) : typeof label === 'string' && label.length > 0 ? label : undefined;
|
|
151
169
|
return /*#__PURE__*/_jsxs("span", {
|
|
152
170
|
ref: ref,
|
|
153
171
|
...mergeProps(themeProps('badge', {
|
|
154
172
|
variant
|
|
155
173
|
}), stylex.props(styles.base, variants[variant], xstyle), className, style),
|
|
174
|
+
title: labelTitle,
|
|
156
175
|
...props,
|
|
157
|
-
children: [icon,
|
|
176
|
+
children: [icon, /*#__PURE__*/_jsx("span", {
|
|
177
|
+
...{
|
|
178
|
+
className: "xb3r6kr xlyipyv xeuugli"
|
|
179
|
+
},
|
|
180
|
+
children: label
|
|
181
|
+
})]
|
|
158
182
|
});
|
|
159
183
|
}
|
|
160
184
|
Badge.displayName = 'Badge';
|
package/dist/Banner/Banner.d.ts
CHANGED
|
@@ -86,6 +86,15 @@ export interface BannerProps extends BaseProps<HTMLDivElement> {
|
|
|
86
86
|
* The banner will hide itself regardless of whether this callback is provided.
|
|
87
87
|
*/
|
|
88
88
|
onDismiss?: () => void;
|
|
89
|
+
/**
|
|
90
|
+
* Accessible name and visible tooltip for the dismiss button, replacing the default.
|
|
91
|
+
* Pass an already-translated string.
|
|
92
|
+
*
|
|
93
|
+
* The default is "Dismiss {title}" when `title` is a string, so stacked
|
|
94
|
+
* banners are told apart by a screen reader; a non-string `title` falls back
|
|
95
|
+
* to "Dismiss" and should set this.
|
|
96
|
+
*/
|
|
97
|
+
dismissLabel?: string;
|
|
89
98
|
/**
|
|
90
99
|
* Action button rendered in the header area (end-aligned).
|
|
91
100
|
* Typically an Button with a secondary or ghost variant.
|
|
@@ -191,7 +200,7 @@ export interface BannerProps extends BaseProps<HTMLDivElement> {
|
|
|
191
200
|
* </Banner>
|
|
192
201
|
* ```
|
|
193
202
|
*/
|
|
194
|
-
export declare function Banner({ status, title, description, icon, isDismissable, onDismiss, endContent, container, elevation, collapsible, children, xstyle, className, style, ref, onFocusCapture, onPointerDownCapture, ...rest }: BannerProps): import("react").JSX.Element | null;
|
|
203
|
+
export declare function Banner({ status, title, description, icon, isDismissable, onDismiss, dismissLabel, endContent, container, elevation, collapsible, children, xstyle, className, style, ref, onFocusCapture, onPointerDownCapture, ...rest }: BannerProps): import("react").JSX.Element | null;
|
|
195
204
|
export declare namespace Banner {
|
|
196
205
|
var displayName: string;
|
|
197
206
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Banner.d.ts","sourceRoot":"","sources":["../../src/Banner/Banner.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AAEH,OAAO,EAA0B,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAE9D,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAgB5C,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,+BAA+B,CAAC;AAErE,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAI9C,OAAO,KAAK,EAAC,eAAe,EAAE,kBAAkB,EAAC,MAAM,SAAS,CAAC;AAMjE;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG,MAAM,eAAe,CAAC;AAEjD;;;;;;GAMG;AACH,MAAM,MAAM,eAAe,GAAG,MAAM,kBAAkB,CAAC;AAEvD,MAAM,WAAW,WAAY,SAAQ,SAAS,CAAC,cAAc,CAAC;IAC5D,wCAAwC;IACxC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAChC;;OAEG;IACH,MAAM,EAAE,YAAY,CAAC;IACrB;;OAEG;IACH,KAAK,EAAE,SAAS,CAAC;IACjB;;OAEG;IACH,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB;;OAEG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB;;;;;OAKG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB;;;;;;;;;;;OAWG;IACH,UAAU,CAAC,EAAE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AwC;IACxC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAChC;;OAEG;IACH,MAAM,EAAE,YAAY,CAAC;IACrB;;OAEG;IACH,KAAK,EAAE,SAAS,CAAC;IACjB;;OAEG;IACH,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB;;OAEG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB;;;;;OAKG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB;;;;;;;OAOG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;;;;;;;;;OAWG;IACH,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,eAAe,CAAC;IAC5B;;;;;OAKG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB;;;;;;;;;;;;;;;;;;OAkBG;IACH,WAAW,CAAC,EAAE,OAAO,GAAG,iBAAiB,CAAC;IAC1C;;;;OAIG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAmND;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AACH,wBAAgB,MAAM,CAAC,EACrB,MAAM,EACN,KAAK,EACL,WAAW,EACX,IAAI,EACJ,aAAqB,EACrB,SAAS,EACT,YAAY,EACZ,UAAU,EACV,SAAkB,EAClB,SAAkB,EAClB,WAAkB,EAClB,QAAQ,EACR,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,EACH,cAAc,EACd,oBAAoB,EACpB,GAAG,IAAI,EACR,EAAE,WAAW,sCA6Ob;yBAjQe,MAAM"}
|
package/dist/Banner/Banner.js
CHANGED
|
@@ -279,6 +279,7 @@ export function Banner({
|
|
|
279
279
|
icon,
|
|
280
280
|
isDismissable = false,
|
|
281
281
|
onDismiss,
|
|
282
|
+
dismissLabel,
|
|
282
283
|
endContent,
|
|
283
284
|
container = 'card',
|
|
284
285
|
elevation = 'none',
|
|
@@ -328,6 +329,14 @@ export function Banner({
|
|
|
328
329
|
const role = statusRole[status] ?? FALLBACK_ROLE;
|
|
329
330
|
const iconColor = statusIconColor[status];
|
|
330
331
|
const hasChildren = isRenderable(children);
|
|
332
|
+
// Keep the default tooltip concise while the accessible name identifies
|
|
333
|
+
// the banner; an explicit translated override names both surfaces.
|
|
334
|
+
const dismiss = t('@astryx.banner.dismiss');
|
|
335
|
+
const dismissTooltip = dismissLabel ?? dismiss;
|
|
336
|
+
const dismissName = dismissLabel ?? (typeof title === 'string' ? t('@astryx.banner.dismissTitled', {
|
|
337
|
+
dismiss,
|
|
338
|
+
title
|
|
339
|
+
}) : dismiss);
|
|
331
340
|
if (isDismissed) {
|
|
332
341
|
return null;
|
|
333
342
|
}
|
|
@@ -445,8 +454,8 @@ export function Banner({
|
|
|
445
454
|
}), isDismissable && /*#__PURE__*/_jsx(Button, {
|
|
446
455
|
variant: "ghost",
|
|
447
456
|
size: "sm",
|
|
448
|
-
label:
|
|
449
|
-
tooltip:
|
|
457
|
+
label: dismissName,
|
|
458
|
+
tooltip: dismissTooltip,
|
|
450
459
|
icon: /*#__PURE__*/_jsx(Icon, {
|
|
451
460
|
icon: "close",
|
|
452
461
|
size: "sm",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../src/Button/Button.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAwB,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAC5D,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EAAC,SAAS,EAAE,SAAS,EAAC,MAAM,gBAAgB,CAAC;AACzD,OAAO,KAAK,MAAM,MAAM,kBAAkB,CAAC;AAwB3C,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,eAAe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KAAK,EACL,GAAG,EACH,GAAG,KAAK,EACT,EAAE,WAAW,GAAG,SAAS,CAoPzB;yBA7Qe,MAAM"}
|
package/dist/Button/Button.js
CHANGED
|
@@ -32,6 +32,7 @@ import { useMergedRefs } from "../hooks/useMergedRefs.js";
|
|
|
32
32
|
import { useLinkComponent } from "../Link/useLinkComponent.js";
|
|
33
33
|
import { themeProps } from "../utils/themeProps.js";
|
|
34
34
|
import { focusOutlineProps } from "../utils/focusOutline.stylex.js";
|
|
35
|
+
import { interactionOverlayStyles } from "../utils/interactionOverlay.stylex.js";
|
|
35
36
|
import { useTranslator } from "../i18n/index.js";
|
|
36
37
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
37
38
|
/**
|
|
@@ -188,26 +189,22 @@ const variants = {
|
|
|
188
189
|
primary: {
|
|
189
190
|
kWkggS: "x1ewilqj",
|
|
190
191
|
kMwMTN: "x17wrial",
|
|
191
|
-
kKwaWg: "xmvprkv xq8i9tn",
|
|
192
192
|
$$css: true
|
|
193
193
|
},
|
|
194
194
|
secondary: {
|
|
195
195
|
kWkggS: "x17x4s8c",
|
|
196
196
|
kMwMTN: "x1tgivj0",
|
|
197
|
-
kKwaWg: "xmvprkv xq8i9tn",
|
|
198
197
|
$$css: true
|
|
199
198
|
},
|
|
200
199
|
ghost: {
|
|
201
200
|
kWkggS: "xjbqb8w",
|
|
202
201
|
kMwMTN: "x1tgivj0",
|
|
203
|
-
kKwaWg: "xmvprkv xq8i9tn",
|
|
204
202
|
$$css: true
|
|
205
203
|
},
|
|
206
204
|
destructive: {
|
|
207
205
|
kWkggS: "x1pjz0fi",
|
|
208
206
|
kMwMTN: "x1m024r3",
|
|
209
207
|
kjBf7l: "x1e0x2sz",
|
|
210
|
-
kKwaWg: "xmvprkv xq8i9tn",
|
|
211
208
|
$$css: true
|
|
212
209
|
}
|
|
213
210
|
};
|
|
@@ -437,7 +434,7 @@ export function Button({
|
|
|
437
434
|
} : null;
|
|
438
435
|
|
|
439
436
|
// Shared StyleX props for both button and link rendering
|
|
440
|
-
const sharedStylexProps = focusOutlineProps.focusVisible(styles.base, sizeStyles[size], isIconOnly && styles.iconOnly, buttonDisabled && styles.disabled, useAriaDisabled && styles.ariaDisabled, renderAsLink && styles.link, !buttonGroup && styles.pressable, buttonGroup && (buttonGroup.orientation === 'horizontal' ? groupStyles.horizontal : groupStyles.vertical), buttonGroup && (variant === 'primary' || variant === 'destructive') && (buttonGroup.orientation === 'horizontal' ? groupStyles.onSolidHorizontal : groupStyles.onSolidVertical),
|
|
437
|
+
const sharedStylexProps = focusOutlineProps.focusVisible(styles.base, sizeStyles[size], isIconOnly && styles.iconOnly, interactionOverlayStyles.backgroundImage, buttonDisabled && styles.disabled, useAriaDisabled && styles.ariaDisabled, renderAsLink && styles.link, !buttonGroup && styles.pressable, buttonGroup && (buttonGroup.orientation === 'horizontal' ? groupStyles.horizontal : groupStyles.vertical), buttonGroup && (variant === 'primary' || variant === 'destructive') && (buttonGroup.orientation === 'horizontal' ? groupStyles.onSolidHorizontal : groupStyles.onSolidVertical),
|
|
441
438
|
// Standalone floating buttons only — a grouped button's elevation is owned
|
|
442
439
|
// by the ButtonGroup so the shared surface lifts as one unit.
|
|
443
440
|
!buttonGroup && elevationStyles[elevation], width != null && dynamicStyles.width(width),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Calendar.d.ts","sourceRoot":"","sources":["../../src/Calendar/Calendar.tsx"],"names":[],"mappings":"AA6BA,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"Calendar.d.ts","sourceRoot":"","sources":["../../src/Calendar/Calendar.tsx"],"names":[],"mappings":"AA6BA,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAiD5C,YAAY,EACV,aAAa,EACb,SAAS,EACT,aAAa,EACb,SAAS,GACV,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAC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qB;IACrB,IAAI,CAAC,EAAE,QAAQ,CAAC;IAEhB,+CAA+C;IAC/C,KAAK,CAAC,EAAE,aAAa,CAAC;IAEtB,0CAA0C;IAC1C,YAAY,CAAC,EAAE,aAAa,CAAC;IAE7B,qCAAqC;IACrC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,IAAI,KAAK,IAAI,CAAC;CAC9D;AAED,UAAU,kBAAmB,SAAQ,iBAAiB;IACpD,qBAAqB;IACrB,IAAI,EAAE,OAAO,CAAC;IAEd,0BAA0B;IAC1B,KAAK,CAAC,EAAE,SAAS,CAAC;IAElB,0CAA0C;IAC1C,YAAY,CAAC,EAAE,SAAS,CAAC;IAEzB,sCAAsC;IACtC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,IAAI,CAAC;CACvC;AAED,MAAM,MAAM,aAAa,GAAG,mBAAmB,GAAG,kBAAkB,CAAC;AAMrE;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CAAC,EAAC,GAAG,EAAE,GAAG,KAAK,EAAC,EAAE,aAAa,+BAqXtD;yBArXe,QAAQ"}
|
|
@@ -27,6 +27,7 @@ import { calendarStyles, monthGridStyles, dayCellStyles, dayCellTheme } from "./
|
|
|
27
27
|
import { plainDateFromISO, plainDateToISO, plainDateToDate, plainDateToday, plainDateSetFirstOfMonth, plainDateAddMonths, plainDateAddDays, plainDateIsBefore, plainDateIsEqual, plainDateGetWeekNumber, plainDateFormat, DATE_FORMAT_WITH_WEEKDAY, DATE_FORMAT_MONTH_YEAR } from "../utils/plainDate.js";
|
|
28
28
|
import { mergeProps, composeEventHandlers, rtlStyles } from "../utils/index.js";
|
|
29
29
|
import { focusOutlineProps } from "../utils/focusOutline.stylex.js";
|
|
30
|
+
import { interactionOverlayStyles } from "../utils/interactionOverlay.stylex.js";
|
|
30
31
|
import { getInitialFocusDate } from "./getInitialFocusDate.js";
|
|
31
32
|
import { computeDayCellState, computeRangeRounding, computePreviewRounding, computeDayNeighborContinuity, isEndpoint } from "./dayCellUtils.js";
|
|
32
33
|
|
|
@@ -807,7 +808,7 @@ function DayCell({
|
|
|
807
808
|
// `marker` mirrors the StyleX conditions below exactly, preserving
|
|
808
809
|
// the default rendering.
|
|
809
810
|
marker: markerState
|
|
810
|
-
}), focusOutlineProps.focusVisible(dayCellStyles.day, dayCellTheme.day, isOutside && dayCellStyles.dayOutside, isOutside && dayCellTheme.dayOutside, showsTodayRing && dayCellStyles.dayToday, showsTodayRing && dayCellTheme.dayToday, showsTodayInRangeRing && dayCellStyles.dayTodayInRange, showsTodayInRangeRing && dayCellTheme.dayTodayInRange, endpoint && dayCellStyles.daySelected, endpoint && dayCellTheme.daySelected, state.effectivelyDisabled && dayCellStyles.dayDisabled, state.effectivelyDisabled && dayCellTheme.dayDisabled)),
|
|
811
|
+
}), focusOutlineProps.focusVisible(dayCellStyles.day, dayCellTheme.day, interactionOverlayStyles.backgroundImage, isOutside && dayCellStyles.dayOutside, isOutside && dayCellTheme.dayOutside, showsTodayRing && dayCellStyles.dayToday, showsTodayRing && dayCellTheme.dayToday, showsTodayInRangeRing && dayCellStyles.dayTodayInRange, showsTodayInRangeRing && dayCellTheme.dayTodayInRange, endpoint && dayCellStyles.daySelected, endpoint && dayCellTheme.daySelected, state.effectivelyDisabled && dayCellStyles.dayDisabled, state.effectivelyDisabled && dayCellTheme.dayDisabled)),
|
|
811
812
|
children: dayNumber
|
|
812
813
|
})]
|
|
813
814
|
});
|
|
@@ -185,9 +185,6 @@ export declare const dayCellTheme: Readonly<{
|
|
|
185
185
|
readonly day: Readonly<{
|
|
186
186
|
readonly color: stylex.StyleXClassNameFor<"color", "light-dark(#0A1317, #DFE2E5)">;
|
|
187
187
|
readonly backgroundColor: stylex.StyleXClassNameFor<"backgroundColor", "transparent">;
|
|
188
|
-
readonly backgroundImage: stylex.StyleXClassNameFor<"backgroundImage", {
|
|
189
|
-
readonly '@media (hover: hover)': `linear-gradient(${stylex.StyleXVar<"light-dark(#0536590C, #FFFFFF0C)">}, ${stylex.StyleXVar<"light-dark(#0536590C, #FFFFFF0C)">})`;
|
|
190
|
-
} | null>;
|
|
191
188
|
}>;
|
|
192
189
|
readonly dayOutside: Readonly<{
|
|
193
190
|
readonly color: stylex.StyleXClassNameFor<"color", "light-dark(#4E606F, #AAAFB5)">;
|
|
@@ -202,9 +199,6 @@ export declare const dayCellTheme: Readonly<{
|
|
|
202
199
|
readonly forcedColorAdjust: stylex.StyleXClassNameFor<"forcedColorAdjust", "none">;
|
|
203
200
|
readonly backgroundColor: stylex.StyleXClassNameFor<"backgroundColor", "light-dark(#0064E0, #2694FE)" | "Highlight">;
|
|
204
201
|
readonly color: stylex.StyleXClassNameFor<"color", "light-dark(#FFFFFF, #FFFFFF)" | "HighlightText">;
|
|
205
|
-
readonly backgroundImage: stylex.StyleXClassNameFor<"backgroundImage", {
|
|
206
|
-
readonly '@media (hover: hover)': `linear-gradient(${stylex.StyleXVar<"light-dark(#0536590C, #FFFFFF0C)">}, ${stylex.StyleXVar<"light-dark(#0536590C, #FFFFFF0C)">})`;
|
|
207
|
-
} | null>;
|
|
208
202
|
}>;
|
|
209
203
|
readonly dayDisabled: Readonly<{
|
|
210
204
|
readonly opacity: stylex.StyleXClassNameFor<"opacity", 0.3>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../src/Calendar/styles.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,MAAM,MAAM,kBAAkB,CAAC;AAgB3C,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoCzB,CAAC;AAMH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuC1B,CAAC;AAiBH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+GxB,CAAC;AAMH,eAAO,MAAM,YAAY
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../src/Calendar/styles.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,MAAM,MAAM,kBAAkB,CAAC;AAgB3C,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoCzB,CAAC;AAMH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuC1B,CAAC;AAiBH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+GxB,CAAC;AAMH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8DvB,CAAC"}
|
package/dist/Calendar/styles.js
CHANGED
|
@@ -252,7 +252,6 @@ export const dayCellTheme = {
|
|
|
252
252
|
day: {
|
|
253
253
|
kMwMTN: "x1tgivj0",
|
|
254
254
|
kWkggS: "xjbqb8w",
|
|
255
|
-
kKwaWg: "xmvprkv",
|
|
256
255
|
$$css: true
|
|
257
256
|
},
|
|
258
257
|
dayOutside: {
|
|
@@ -271,7 +270,6 @@ export const dayCellTheme = {
|
|
|
271
270
|
kAXs8y: "x1kzknox",
|
|
272
271
|
kWkggS: "x1ewilqj x1jzqe4",
|
|
273
272
|
kMwMTN: "x17wrial x1k5gbb1",
|
|
274
|
-
kKwaWg: "xmvprkv",
|
|
275
273
|
$$css: true
|
|
276
274
|
},
|
|
277
275
|
dayDisabled: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Carousel.d.ts","sourceRoot":"","sources":["../../src/Carousel/Carousel.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,O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;CACxB;AAyJD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,QAAQ,CAAC,EACvB,GAAG,EACH,SAAS,EACT,QAAQ,EACR,GAAO,EACP,UAAiB,EACjB,WAAkB,EAClB,OAAe,EACf,OAAe,EACf,OAAO,EACP,YAAY,EAAE,kBAAkB,EAChC,MAAM,EACN,SAAS,EACT,KAAK,EACL,aAAa,EAAE,MAAM,EACrB,GAAG,SAAS,EACb,EAAE,aAAa,+BAgYf;yBAhZe,QAAQ"}
|
|
@@ -66,9 +66,6 @@ const styles = {
|
|
|
66
66
|
khEr5k: "xkcv6ua xg83hb1",
|
|
67
67
|
k5wCbM: "x1rohswg",
|
|
68
68
|
kX1K2I: "xw4ya9i",
|
|
69
|
-
k1ekBW: "x157bb6t",
|
|
70
|
-
kIyJzY: "x80gvsz x12w9bfk",
|
|
71
|
-
kAMwcw: "xlr8y92",
|
|
72
69
|
$$css: true
|
|
73
70
|
},
|
|
74
71
|
fadeStart: {
|
|
@@ -229,6 +226,13 @@ export function Carousel({
|
|
|
229
226
|
const t = useTranslator();
|
|
230
227
|
const ariaLabel = ariaLabelFromProps ?? t('@astryx.carousel.label');
|
|
231
228
|
const scrollElRef = useRef(null);
|
|
229
|
+
const startButtonRef = useRef(null);
|
|
230
|
+
const endButtonRef = useRef(null);
|
|
231
|
+
// Which nav button last held focus, and what the overflow state was on the
|
|
232
|
+
// previous render. Together they are how the Effect below recognises the one
|
|
233
|
+
// transition it is allowed to act on.
|
|
234
|
+
const focusedNavRef = useRef(null);
|
|
235
|
+
const prevCanScrollRef = useRef(null);
|
|
232
236
|
const {
|
|
233
237
|
scrollRef,
|
|
234
238
|
overflowStart,
|
|
@@ -359,6 +363,76 @@ export function Carousel({
|
|
|
359
363
|
// something to scroll; without loop they follow the per-edge overflow state.
|
|
360
364
|
const canScrollStart = hasLoop && hasOverflow ? true : overflowStart;
|
|
361
365
|
const canScrollEnd = hasLoop && hasOverflow ? true : overflowEnd;
|
|
366
|
+
|
|
367
|
+
// Keep the keyboard user where they are when a nav button disables under
|
|
368
|
+
// them. The browser drops focus off a control it disables, so reaching an
|
|
369
|
+
// edge used to land the user on <body> and cost them their place in the page.
|
|
370
|
+
//
|
|
371
|
+
// This is an Effect on purpose, and the exception is narrow. The thing that
|
|
372
|
+
// disables the button IS this state transition, so it is the only correct
|
|
373
|
+
// trigger: three attempts to predict it from the press -- the position after
|
|
374
|
+
// the scroll, the position before it plus the step, and the settled position
|
|
375
|
+
// reported by `scrollend` -- were each wrong somewhere, under reduced motion,
|
|
376
|
+
// under mandatory scroll-snap, and on a browser that never fires the event.
|
|
377
|
+
// Running after the commit also makes the opposite button a valid receiver,
|
|
378
|
+
// which it is not during the press: at that moment it is still disabled and
|
|
379
|
+
// focus() on a disabled control does nothing. Ruled acceptable by the
|
|
380
|
+
// maintainer, 2026-08-27, on the conditions encoded below: it acts only on
|
|
381
|
+
// the transition that newly disables the focused button, it moves focus and
|
|
382
|
+
// nothing else, and it cannot fire twice for one transition.
|
|
383
|
+
//
|
|
384
|
+
// Which button the person is on is tracked by the buttons' own focus and blur
|
|
385
|
+
// handlers, and the blur has to ignore the one the commit itself causes: a
|
|
386
|
+
// tracker that outlived the person let a later edge -- a swipe, a resize, no
|
|
387
|
+
// press at all -- pull their focus back onto a control they never chose.
|
|
388
|
+
useEffect(() => {
|
|
389
|
+
const previous = prevCanScrollRef.current;
|
|
390
|
+
prevCanScrollRef.current = {
|
|
391
|
+
start: canScrollStart,
|
|
392
|
+
end: canScrollEnd
|
|
393
|
+
};
|
|
394
|
+
const side = focusedNavRef.current;
|
|
395
|
+
if (previous == null || side == null) {
|
|
396
|
+
return;
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
// Only the edge that just ran out, and only while it held focus. An edge
|
|
400
|
+
// that was already disabled, or one the user was not on, is not ours.
|
|
401
|
+
const wasEnabled = side === 'start' ? previous.start : previous.end;
|
|
402
|
+
const isEnabled = side === 'start' ? canScrollStart : canScrollEnd;
|
|
403
|
+
if (!wasEnabled || isEnabled) {
|
|
404
|
+
return;
|
|
405
|
+
}
|
|
406
|
+
const pressed = side === 'start' ? startButtonRef.current : endButtonRef.current;
|
|
407
|
+
if (pressed == null) {
|
|
408
|
+
return;
|
|
409
|
+
}
|
|
410
|
+
// The browser has already blurred it, so focus reads as the body. Anything
|
|
411
|
+
// else means the user moved on themselves and this is not ours to redirect.
|
|
412
|
+
const active = pressed.ownerDocument.activeElement;
|
|
413
|
+
if (active !== pressed && active !== pressed.ownerDocument.body) {
|
|
414
|
+
return;
|
|
415
|
+
}
|
|
416
|
+
const opposite = side === 'start' ? endButtonRef.current : startButtonRef.current;
|
|
417
|
+
// The opposite button is the receiver. It is disabled only when the
|
|
418
|
+
// carousel stopped overflowing entirely, which happens when its content
|
|
419
|
+
// shrinks; the scroll container is then the nearest tab stop still inside
|
|
420
|
+
// the labelled region.
|
|
421
|
+
const receiver = opposite != null && !opposite.disabled ? opposite : scrollElRef.current;
|
|
422
|
+
if (receiver == null) {
|
|
423
|
+
return;
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
// One move per transition: clearing the tracker first means a re-render or
|
|
427
|
+
// a StrictMode double-invoke re-runs this and returns at the `side == null`
|
|
428
|
+
// guard above. Focusing the receiver sets it again, to the other side.
|
|
429
|
+
focusedNavRef.current = null;
|
|
430
|
+
// preventScroll: a plain focus() scrolls its element into view, which on
|
|
431
|
+
// the scroll container cancels the scroll the press just started.
|
|
432
|
+
receiver.focus({
|
|
433
|
+
preventScroll: true
|
|
434
|
+
});
|
|
435
|
+
}, [canScrollStart, canScrollEnd]);
|
|
362
436
|
const fadeStyle = hasEdgeFade ? hasLoop && hasOverflow || overflowStart && overflowEnd ? styles.fadeBoth : overflowStart ? styles.fadeStart : overflowEnd ? styles.fadeEnd : null : null;
|
|
363
437
|
|
|
364
438
|
// Self-authored position styles (positioning: 'custom' below): a cover
|
|
@@ -380,7 +454,12 @@ export function Carousel({
|
|
|
380
454
|
ref: composedRef,
|
|
381
455
|
tabIndex: 0,
|
|
382
456
|
onWheel: handleWheel,
|
|
383
|
-
...
|
|
457
|
+
...mergeProps(themeProps('carousel-scroller', {
|
|
458
|
+
gap,
|
|
459
|
+
padding,
|
|
460
|
+
snap: hasSnap ? 'snap' : null,
|
|
461
|
+
edgeFade: hasEdgeFade ? 'edge-fade' : null
|
|
462
|
+
}), stylex.props(styles.scroller, gapStyles[gap], padding != null && paddingStyles[padding], hasSnap && styles.snap, fadeStyle)),
|
|
384
463
|
children: slides.map((child, index) =>
|
|
385
464
|
/*#__PURE__*/
|
|
386
465
|
// APG carousel pattern: each slide container is a group with
|
|
@@ -410,6 +489,7 @@ export function Carousel({
|
|
|
410
489
|
}
|
|
411
490
|
}[!!!canScrollStart << 0],
|
|
412
491
|
children: /*#__PURE__*/_jsx(Button, {
|
|
492
|
+
ref: startButtonRef,
|
|
413
493
|
icon: /*#__PURE__*/_jsx(Icon, {
|
|
414
494
|
icon: "chevronLeft",
|
|
415
495
|
size: "xsm",
|
|
@@ -420,11 +500,22 @@ export function Carousel({
|
|
|
420
500
|
size: "sm",
|
|
421
501
|
isIconOnly: true
|
|
422
502
|
// Disabled when there's nothing to scroll toward. Keeps the
|
|
423
|
-
// button mounted (stable layout
|
|
424
|
-
//
|
|
425
|
-
//
|
|
503
|
+
// button mounted (stable layout) but removes it from the tab
|
|
504
|
+
// order and a11y tree while it's visually hidden, so keyboard
|
|
505
|
+
// users don't land on an invisible control. The Effect above
|
|
506
|
+
// hands focus to the other button when the state behind this
|
|
507
|
+
// one flips it disabled.
|
|
426
508
|
,
|
|
427
509
|
isDisabled: !canScrollStart,
|
|
510
|
+
onFocus: () => {
|
|
511
|
+
focusedNavRef.current = 'start';
|
|
512
|
+
},
|
|
513
|
+
onBlur: event => {
|
|
514
|
+
// A disabled button was blurred by the commit, not the person.
|
|
515
|
+
if (!event.currentTarget.disabled) {
|
|
516
|
+
focusedNavRef.current = null;
|
|
517
|
+
}
|
|
518
|
+
},
|
|
428
519
|
onClick: () => scrollBy(-1),
|
|
429
520
|
xstyle: styles.buttonRadiusOverride
|
|
430
521
|
})
|
|
@@ -438,6 +529,7 @@ export function Carousel({
|
|
|
438
529
|
}
|
|
439
530
|
}[!!!canScrollEnd << 0],
|
|
440
531
|
children: /*#__PURE__*/_jsx(Button, {
|
|
532
|
+
ref: endButtonRef,
|
|
441
533
|
icon: /*#__PURE__*/_jsx(Icon, {
|
|
442
534
|
icon: "chevronRight",
|
|
443
535
|
size: "xsm",
|
|
@@ -451,6 +543,15 @@ export function Carousel({
|
|
|
451
543
|
// button stays mounted but out of the tab order / a11y tree.
|
|
452
544
|
,
|
|
453
545
|
isDisabled: !canScrollEnd,
|
|
546
|
+
onFocus: () => {
|
|
547
|
+
focusedNavRef.current = 'end';
|
|
548
|
+
},
|
|
549
|
+
onBlur: event => {
|
|
550
|
+
// A disabled button was blurred by the commit, not the person.
|
|
551
|
+
if (!event.currentTarget.disabled) {
|
|
552
|
+
focusedNavRef.current = null;
|
|
553
|
+
}
|
|
554
|
+
},
|
|
454
555
|
onClick: () => scrollBy(1),
|
|
455
556
|
xstyle: styles.buttonRadiusOverride
|
|
456
557
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CommandPaletteItem.d.ts","sourceRoot":"","sources":["../../src/CommandPalette/CommandPaletteItem.tsx"],"names":[],"mappings":"AAGA;;;;;;;;GAQG;AAEH,OAAO,EAA0C,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAE9E,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"CommandPaletteItem.d.ts","sourceRoot":"","sources":["../../src/CommandPalette/CommandPaletteItem.tsx"],"names":[],"mappings":"AAGA;;;;;;;;GAQG;AAEH,OAAO,EAA0C,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAE9E,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAmD5C,MAAM,WAAW,uBAAwB,SAAQ,IAAI,CACnD,SAAS,CAAC,cAAc,CAAC,EACzB,UAAU,GAAG,UAAU,CACxB;IACC,yCAAyC;IACzC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAChC,qDAAqD;IACrD,KAAK,EAAE,MAAM,CAAC;IACd,8DAA8D;IAC9D,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC;;;;OAIG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,+EAA+E;IAC/E,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,KAAK,EACL,QAAQ,EACR,aAAa,EAAE,qBAAqB,EACpC,UAAU,EAAE,kBAAkB,EAC9B,UAAkB,EAClB,QAAQ,EACR,GAAG,EACH,MAAM,EACN,SAAS,EACT,KAAK,EACL,OAAO,EAAE,WAAW,EACpB,YAAY,EAAE,gBAAgB,EAC9B,GAAG,KAAK,EACT,EAAE,uBAAuB,+BAkFzB;yBAhGe,kBAAkB"}
|
|
@@ -20,9 +20,9 @@ import { colorVars, spacingVars, radiusVars, typographyVars, typeScaleVars } fro
|
|
|
20
20
|
import { useCommandPaletteContext } from "./CommandPaletteContext.js";
|
|
21
21
|
import { useDialogContext } from "../Dialog/DialogContext.js";
|
|
22
22
|
import { themeProps } from "../utils/themeProps.js";
|
|
23
|
+
import { interactionOverlayStyles } from "../utils/interactionOverlay.stylex.js";
|
|
23
24
|
import { useMergedRefs } from "../hooks/useMergedRefs.js";
|
|
24
25
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
25
|
-
const HOVER_HOVER = '@media (hover: hover)';
|
|
26
26
|
const styles = {
|
|
27
27
|
item: {
|
|
28
28
|
k1xSpc: "x78zum5",
|
|
@@ -42,11 +42,6 @@ const styles = {
|
|
|
42
42
|
kfSwDN: "x87ps6o",
|
|
43
43
|
$$css: true
|
|
44
44
|
},
|
|
45
|
-
itemHover: {
|
|
46
|
-
kRL5z6: "xoevpu5",
|
|
47
|
-
kSReZ0: "xyxi2l3",
|
|
48
|
-
$$css: true
|
|
49
|
-
},
|
|
50
45
|
itemHighlighted: {
|
|
51
46
|
kWkggS: "x1lmrjuc",
|
|
52
47
|
$$css: true
|
|
@@ -147,7 +142,7 @@ export function CommandPaletteItem({
|
|
|
147
142
|
"data-value": value,
|
|
148
143
|
onClick: composeEventHandlers(onClickProp, handleClick),
|
|
149
144
|
onMouseEnter: composeEventHandlers(onMouseEnterProp, handleMouseEnter),
|
|
150
|
-
...mergeProps(themeProps('command-palette-item'), stylex.props(styles.item, !isDisabled &&
|
|
145
|
+
...mergeProps(themeProps('command-palette-item'), stylex.props(styles.item, !isDisabled && interactionOverlayStyles.backgroundColor, isHighlighted && styles.itemHighlighted, isSelected && styles.itemSelected, isDisabled && styles.itemDisabled, xstyle), className, style),
|
|
151
146
|
children: children
|
|
152
147
|
});
|
|
153
148
|
}
|
|
@@ -36,7 +36,8 @@ export interface ComplexSelectorRenderState {
|
|
|
36
36
|
* they respect focus restoration, light dismiss, and Escape. Prefer these
|
|
37
37
|
* callbacks over mirroring open state in the parent — the selector owns its
|
|
38
38
|
* visibility, and imperative calls avoid the focus-management pitfalls of
|
|
39
|
-
* syncing an external `isOpen` prop.
|
|
39
|
+
* syncing an external `isOpen` prop. Pair with `onOpenChange` to observe every
|
|
40
|
+
* open and close, including the ones the selector performs itself.
|
|
40
41
|
*/
|
|
41
42
|
export interface ComplexSelectorHandle {
|
|
42
43
|
/** Open the selector surface. No-op when disabled or already open. */
|
|
@@ -103,6 +104,13 @@ export interface ComplexSelectorProps<Value> extends Omit<BaseProps<HTMLDivEleme
|
|
|
103
104
|
* state in the parent — the selector owns its visibility.
|
|
104
105
|
*/
|
|
105
106
|
handleRef?: React.Ref<ComplexSelectorHandle>;
|
|
107
|
+
/**
|
|
108
|
+
* Called whenever the selector surface opens or closes, however it happened
|
|
109
|
+
* — the trigger, the keyboard, a light dismiss, Escape, content that calls
|
|
110
|
+
* `close()`, or the imperative handle. Pair it with `handleRef` to drive the
|
|
111
|
+
* surface from outside without mirroring its state.
|
|
112
|
+
*/
|
|
113
|
+
onOpenChange?: (isOpen: boolean) => void;
|
|
106
114
|
/** StyleX styles for the popup content container. */
|
|
107
115
|
contentXstyle?: StyleXStyles;
|
|
108
116
|
/** Test ID for the trigger container. */
|
|
@@ -135,7 +143,7 @@ export interface ComplexSelectorProps<Value> extends Omit<BaseProps<HTMLDivEleme
|
|
|
135
143
|
* </ComplexSelector>
|
|
136
144
|
* ```
|
|
137
145
|
*/
|
|
138
|
-
export declare function ComplexSelector<Value>({ label, value, onChange, changeAction, children, triggerLabel, placeholder: placeholderFromProps, isLabelHidden, description, isOptional, isRequired, isDisabled, isLoading, status, statusVariant, labelTooltip, size, variant, startIcon, width, placement, alignment, handleRef, contentXstyle, xstyle, className, style, 'data-testid': testId, onClick: onClickProp, ...props }: ComplexSelectorProps<Value>): React.JSX.Element;
|
|
146
|
+
export declare function ComplexSelector<Value>({ label, value, onChange, changeAction, children, triggerLabel, placeholder: placeholderFromProps, isLabelHidden, description, isOptional, isRequired, isDisabled, isLoading, status, statusVariant, labelTooltip, size, variant, startIcon, width, placement, alignment, handleRef, onOpenChange, contentXstyle, xstyle, className, style, 'data-testid': testId, onClick: onClickProp, ...props }: ComplexSelectorProps<Value>): React.JSX.Element;
|
|
139
147
|
export declare namespace ComplexSelector {
|
|
140
148
|
var displayName: string;
|
|
141
149
|
}
|
|
@@ -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,SAA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