@astryxdesign/core 0.5.0-canary.e5e83ef → 0.5.0-canary.e6507a9
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/Carousel/Carousel.d.ts.map +1 -1
- package/dist/Carousel/Carousel.js +108 -7
- package/dist/Layer/useLayer.d.ts.map +1 -1
- package/dist/Layer/useLayer.js +24 -22
- package/dist/Resizable/useResizable.d.ts.map +1 -1
- package/dist/Resizable/useResizable.js +3 -1
- package/dist/theme/useTheme.d.ts.map +1 -1
- package/dist/theme/useTheme.js +6 -7
- package/locales/af-ZA.json +1 -1
- package/locales/ar-SA.json +1 -1
- package/locales/ca-ES.json +1 -1
- package/locales/cs-CZ.json +1 -1
- package/locales/da-DK.json +1 -1
- package/locales/de-DE.json +1 -1
- package/locales/el-GR.json +1 -1
- package/locales/es-ES.json +1 -1
- package/locales/fi-FI.json +1 -1
- package/locales/fr-FR.json +1 -1
- package/locales/he-IL.json +1 -1
- package/locales/hu-HU.json +1 -1
- package/locales/it-IT.json +1 -1
- package/locales/ja-JP.json +1 -1
- package/locales/ko-KR.json +1 -1
- package/locales/nl-NL.json +1 -1
- package/locales/no-NO.json +1 -1
- package/locales/pl-PL.json +1 -1
- package/locales/pt-BR.json +1 -1
- package/locales/pt-PT.json +1 -1
- package/locales/ro-RO.json +1 -1
- package/locales/ru-RU.json +1 -1
- package/locales/sr-SP.json +1 -1
- package/locales/sv-SE.json +1 -1
- package/locales/tr-TR.json +1 -1
- package/locales/uk-UA.json +1 -1
- package/locales/vi-VN.json +1 -1
- package/locales/zh-CN.json +1 -1
- package/locales/zh-TW.json +1 -1
- package/package.json +2 -2
- 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/Layer/useLayer.test.tsx +44 -1
- package/src/Layer/useLayer.tsx +48 -31
- package/src/Resizable/useResizable.test.ts +19 -0
- package/src/Resizable/useResizable.ts +3 -1
- package/src/theme/useTheme.test.tsx +10 -0
- package/src/theme/useTheme.ts +16 -10
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Carousel.d.ts","sourceRoot":"","sources":["../../src/Carousel/Carousel.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EACL,KAAK,SAAS,EAOf,MAAM,OAAO,CAAC;AAef,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAE5C,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAKhD;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC7B;;;OAGG;IACH,UAAU,IAAI,IAAI,CAAC;IACnB;;;OAGG;IACH,UAAU,IAAI,IAAI,CAAC;IACnB;;;;OAIG;IACH,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B;;;;OAIG;IACH,aAAa,IAAI,OAAO,CAAC;IACzB;;;OAGG;IACH,aAAa,IAAI,OAAO,CAAC;CAC1B;AAED,MAAM,WAAW,aAAc,SAAQ,SAAS,CAAC,cAAc,CAAC;IAC9D,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAChC;;;OAGG;IACH,SAAS,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IACtC,kEAAkE;IAClE,QAAQ,EAAE,SAAS,CAAC;IACpB;;;OAGG;IACH,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,GAAG,CAAC,GAAG,GAAG,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACpC;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;;OAKG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;;;;;;OAQG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;OAGG;IACH,OAAO,CAAC,EAAE,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,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;;;;;OAQG;IACH,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;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":"useLayer.d.ts","sourceRoot":"","sources":["../../src/Layer/useLayer.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,EAOZ,KAAK,SAAS,EACd,KAAK,WAAW,EACjB,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,kBAAkB,CAAC;AAiDnD;;GAEG;AACH,UAAU,kB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B,EACnC,SAAS,GAAE,cAAyB,GACnC,MAAM,CAgBR;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CACnC,EAAE,EAAE,MAAM,EACV,MAAM,EAAE,OAAO,GACd,kBAAkB,CAoCpB;AAshBD,wBAAgB,QAAQ,CAAC,OAAO,EAAE,mBAAmB,GAAG,kBAAkB,CAAC;AAC3E,wBAAgB,QAAQ,CAAC,OAAO,EAAE,iBAAiB,GAAG,gBAAgB,CAAC;AAWvE,8EAA8E;AAC9E,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,mBAAmB,GAC3B,0BAA0B,CAAC;AAC9B,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,iBAAiB,GACzB,wBAAwB,CAAC"}
|
package/dist/Layer/useLayer.js
CHANGED
|
@@ -384,8 +384,8 @@ function useLayerImplementation(options) {
|
|
|
384
384
|
clearContextMount();
|
|
385
385
|
}, [onHide, clearContextMount]);
|
|
386
386
|
|
|
387
|
-
//
|
|
388
|
-
const
|
|
387
|
+
// Stable ref for the trigger element (context mode only).
|
|
388
|
+
const contextRef = useCallback(el => {
|
|
389
389
|
// Remove only THIS layer's anchor name from the previous element so
|
|
390
390
|
// other layers sharing the same trigger keep their anchors.
|
|
391
391
|
if (triggerRef.current && triggerRef.current !== el) {
|
|
@@ -395,7 +395,7 @@ function useLayerImplementation(options) {
|
|
|
395
395
|
addAnchorName(el, anchorId);
|
|
396
396
|
}
|
|
397
397
|
triggerRef.current = el;
|
|
398
|
-
}
|
|
398
|
+
}, [anchorId]);
|
|
399
399
|
|
|
400
400
|
// Arm only when the dismissing gesture's click is still ahead of us. Some
|
|
401
401
|
// engines deliver click first; in that order there is nothing left to absorb.
|
|
@@ -617,19 +617,17 @@ function useLayerImplementation(options) {
|
|
|
617
617
|
children: children
|
|
618
618
|
});
|
|
619
619
|
}, [popoverRefCallback, id, lightDismiss]);
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
}
|
|
632
|
-
return {
|
|
620
|
+
const contextResult = useMemo(() => ({
|
|
621
|
+
ref: contextRef,
|
|
622
|
+
anchorId,
|
|
623
|
+
show,
|
|
624
|
+
hide,
|
|
625
|
+
isOpen,
|
|
626
|
+
wasJustDismissed,
|
|
627
|
+
id,
|
|
628
|
+
render: renderContext
|
|
629
|
+
}), [contextRef, anchorId, show, hide, isOpen, wasJustDismissed, id, renderContext]);
|
|
630
|
+
const fixedResult = useMemo(() => ({
|
|
633
631
|
ref: undefined,
|
|
634
632
|
show,
|
|
635
633
|
hide,
|
|
@@ -637,14 +635,18 @@ function useLayerImplementation(options) {
|
|
|
637
635
|
wasJustDismissed,
|
|
638
636
|
id,
|
|
639
637
|
render: renderFixed
|
|
640
|
-
};
|
|
638
|
+
}), [show, hide, isOpen, wasJustDismissed, id, renderFixed]);
|
|
639
|
+
return mode === 'context' ? contextResult : fixedResult;
|
|
641
640
|
}
|
|
642
641
|
export function useLayer(options) {
|
|
643
|
-
const
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
642
|
+
const internalLayer = useLayerImplementation(options);
|
|
643
|
+
return useMemo(() => {
|
|
644
|
+
const {
|
|
645
|
+
wasJustDismissed: _,
|
|
646
|
+
...layer
|
|
647
|
+
} = internalLayer;
|
|
648
|
+
return layer;
|
|
649
|
+
}, [internalLayer]);
|
|
648
650
|
}
|
|
649
651
|
|
|
650
652
|
/** @internal Shared with usePopover; not exported from the package barrel. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useResizable.d.ts","sourceRoot":"","sources":["../../src/Resizable/useResizable.ts"],"names":[],"mappings":"AAkBA,MAAM,WAAW,qBAAqB;IACpC,iEAAiE;IACjE,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC9B,0CAA0C;IAC1C,SAAS,CAAC,EAAE,MAAM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BAAqB,CAAC,CAAC;IAC/C,+CAA+C;IAC/C,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,eAAe;IAC9B,8BAA8B;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,iDAAiD;IACjD,WAAW,EAAE,OAAO,CAAC;IACrB,4CAA4C;IAC5C,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,mCAAmC;IACnC,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,wCAAwC;IACxC,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,uEAAuE;IACvE,KAAK,EAAE,cAAc,CAAC;CACvB;AAED,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC;IAEd,YAAY,EAAE,OAAO,CAAC;IACtB,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,8CAA8C;IAE9C,YAAY,EAAE,OAAO,CAAC;IACtB,iBAAiB,EAAE,IAAI,CAAC;CACzB;AA2UD,wBAAgB,YAAY,CAAC,MAAM,EAAE,wBAAwB,GAAG,eAAe,CAAC;AAChF,wBAAgB,YAAY,CAC1B,MAAM,EAAE,uBAAuB,GAC9B,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC"}
|
|
@@ -139,13 +139,15 @@ function useSingleResizable(config) {
|
|
|
139
139
|
maxSizePx = Infinity,
|
|
140
140
|
collapsible = false,
|
|
141
141
|
collapsedSize = DEFAULT_COLLAPSED_SIZE,
|
|
142
|
-
snaps
|
|
142
|
+
snaps: configuredSnaps,
|
|
143
143
|
autoSaveId,
|
|
144
144
|
defaultIsCollapsed,
|
|
145
145
|
isCollapsed: controlledIsCollapsed,
|
|
146
146
|
onSizeChange,
|
|
147
147
|
onCollapseChange
|
|
148
148
|
} = config;
|
|
149
|
+
const emptySnapsRef = useRef([]);
|
|
150
|
+
const snaps = configuredSnaps ?? emptySnapsRef.current;
|
|
149
151
|
const resolvedDefault = resolveDefaultSize(defaultSize);
|
|
150
152
|
const persisted = autoSaveId ? loadPersistedState(autoSaveId) : null;
|
|
151
153
|
const initial = persisted?.size ?? resolvedDefault;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTheme.d.ts","sourceRoot":"","sources":["../../src/theme/useTheme.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useTheme.d.ts","sourceRoot":"","sources":["../../src/theme/useTheme.ts"],"names":[],"mappings":"AA8BA,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,SAAS,CAAC;AACvC,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,eAAe,CAAC;AAUhD;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC,+BAA+B;IAC/B,KAAK,EAAE,YAAY,CAAC;IACpB,0CAA0C;IAC1C,IAAI,EAAE,SAAS,CAAC;CACjB;AAED;;;;GAIG;AACH,eAAO,MAAM,YAAY,mDAAgD,CAAC;AAO1E;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,iBAAiB;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,kEAAkE;IAClE,IAAI,EAAE,OAAO,GAAG,MAAM,CAAC;IACvB;;;;;;;;;;;;;OAaG;IACH,KAAK,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;IAChC;;;;;;;OAOG;IACH,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAChC;AA+HD;;;;;;;GAOG;AACH,wBAAgB,YAAY,IAAI,MAAM,GAAG,IAAI,CAM5C;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,QAAQ,IAAI,cAAc,CAmCzC"}
|
package/dist/theme/useTheme.js
CHANGED
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
* SYNC: When modified, update:
|
|
21
21
|
* - /packages/core/src/theme/index.ts
|
|
22
22
|
*/
|
|
23
|
-
import { createContext, use, useMemo, useSyncExternalStore } from 'react';
|
|
23
|
+
import { createContext, use, useCallback, useMemo, useSyncExternalStore } from 'react';
|
|
24
24
|
import { resolveThemeTokens } from "./tokens.js";
|
|
25
25
|
import { getRegisteredTheme } from "./themeRegistry.js";
|
|
26
26
|
import { dataAttr } from "../naming.js";
|
|
@@ -207,13 +207,12 @@ export function useTheme() {
|
|
|
207
207
|
const tokens = useMemo(() => resolveThemeTokens(theme, {
|
|
208
208
|
mode: effectiveMode
|
|
209
209
|
}), [theme, effectiveMode]);
|
|
210
|
-
const token = name =>
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
name: theme?.name ?? 'default',
|
|
210
|
+
const token = useCallback(name => tokens[name] ?? '', [tokens]);
|
|
211
|
+
const name = theme?.name ?? 'default';
|
|
212
|
+
return useMemo(() => ({
|
|
213
|
+
name,
|
|
215
214
|
mode: effectiveMode,
|
|
216
215
|
token,
|
|
217
216
|
tokens
|
|
218
|
-
};
|
|
217
|
+
}), [name, effectiveMode, token, tokens]);
|
|
219
218
|
}
|
package/locales/af-ZA.json
CHANGED
|
@@ -257,7 +257,7 @@
|
|
|
257
257
|
},
|
|
258
258
|
"@astryx.banner.dismiss": {
|
|
259
259
|
"defaultMessage": "Maak toe",
|
|
260
|
-
"description": "\"Dismiss\" = close/hide this notification (not \"reject a person\").
|
|
260
|
+
"description": "\"Dismiss\" = close/hide this notification (not \"reject a person\"). Tooltip on the small X button on a Banner, and its aria label when the banner's title is not plain text."
|
|
261
261
|
},
|
|
262
262
|
"@astryx.calendar.previousMonth": {
|
|
263
263
|
"defaultMessage": "Vorige maand",
|
package/locales/ar-SA.json
CHANGED
|
@@ -281,7 +281,7 @@
|
|
|
281
281
|
},
|
|
282
282
|
"@astryx.banner.dismiss": {
|
|
283
283
|
"defaultMessage": "تجاهل",
|
|
284
|
-
"description": "\"Dismiss\" = close/hide this notification (not \"reject a person\").
|
|
284
|
+
"description": "\"Dismiss\" = close/hide this notification (not \"reject a person\"). Tooltip on the small X button on a Banner, and its aria label when the banner's title is not plain text."
|
|
285
285
|
},
|
|
286
286
|
"@astryx.calendar.previousMonth": {
|
|
287
287
|
"defaultMessage": "الشهر السابق",
|
package/locales/ca-ES.json
CHANGED
|
@@ -273,7 +273,7 @@
|
|
|
273
273
|
},
|
|
274
274
|
"@astryx.banner.dismiss": {
|
|
275
275
|
"defaultMessage": "Descarta",
|
|
276
|
-
"description": "\"Dismiss\" = close/hide this notification (not \"reject a person\").
|
|
276
|
+
"description": "\"Dismiss\" = close/hide this notification (not \"reject a person\"). Tooltip on the small X button on a Banner, and its aria label when the banner's title is not plain text."
|
|
277
277
|
},
|
|
278
278
|
"@astryx.calendar.previousMonth": {
|
|
279
279
|
"defaultMessage": "Mes anterior",
|
package/locales/cs-CZ.json
CHANGED
|
@@ -277,7 +277,7 @@
|
|
|
277
277
|
},
|
|
278
278
|
"@astryx.banner.dismiss": {
|
|
279
279
|
"defaultMessage": "Zavřít",
|
|
280
|
-
"description": "\"Dismiss\" = close/hide this notification (not \"reject a person\").
|
|
280
|
+
"description": "\"Dismiss\" = close/hide this notification (not \"reject a person\"). Tooltip on the small X button on a Banner, and its aria label when the banner's title is not plain text."
|
|
281
281
|
},
|
|
282
282
|
"@astryx.calendar.previousMonth": {
|
|
283
283
|
"defaultMessage": "Předchozí měsíc",
|
package/locales/da-DK.json
CHANGED
|
@@ -273,7 +273,7 @@
|
|
|
273
273
|
},
|
|
274
274
|
"@astryx.banner.dismiss": {
|
|
275
275
|
"defaultMessage": "Luk",
|
|
276
|
-
"description": "\"Dismiss\" = close/hide this notification (not \"reject a person\").
|
|
276
|
+
"description": "\"Dismiss\" = close/hide this notification (not \"reject a person\"). Tooltip on the small X button on a Banner, and its aria label when the banner's title is not plain text."
|
|
277
277
|
},
|
|
278
278
|
"@astryx.calendar.previousMonth": {
|
|
279
279
|
"defaultMessage": "Forrige måned",
|
package/locales/de-DE.json
CHANGED
|
@@ -273,7 +273,7 @@
|
|
|
273
273
|
},
|
|
274
274
|
"@astryx.banner.dismiss": {
|
|
275
275
|
"defaultMessage": "Schließen",
|
|
276
|
-
"description": "\"Dismiss\" = close/hide this notification (not \"reject a person\").
|
|
276
|
+
"description": "\"Dismiss\" = close/hide this notification (not \"reject a person\"). Tooltip on the small X button on a Banner, and its aria label when the banner's title is not plain text."
|
|
277
277
|
},
|
|
278
278
|
"@astryx.calendar.previousMonth": {
|
|
279
279
|
"defaultMessage": "Vorheriger Monat",
|
package/locales/el-GR.json
CHANGED
|
@@ -277,7 +277,7 @@
|
|
|
277
277
|
},
|
|
278
278
|
"@astryx.banner.dismiss": {
|
|
279
279
|
"defaultMessage": "Παράβλεψη",
|
|
280
|
-
"description": "\"Dismiss\" = close/hide this notification (not \"reject a person\").
|
|
280
|
+
"description": "\"Dismiss\" = close/hide this notification (not \"reject a person\"). Tooltip on the small X button on a Banner, and its aria label when the banner's title is not plain text."
|
|
281
281
|
},
|
|
282
282
|
"@astryx.calendar.previousMonth": {
|
|
283
283
|
"defaultMessage": "Προηγούμενος μήνας",
|
package/locales/es-ES.json
CHANGED
|
@@ -277,7 +277,7 @@
|
|
|
277
277
|
},
|
|
278
278
|
"@astryx.banner.dismiss": {
|
|
279
279
|
"defaultMessage": "Descartar",
|
|
280
|
-
"description": "\"Dismiss\" = close/hide this notification (not \"reject a person\").
|
|
280
|
+
"description": "\"Dismiss\" = close/hide this notification (not \"reject a person\"). Tooltip on the small X button on a Banner, and its aria label when the banner's title is not plain text."
|
|
281
281
|
},
|
|
282
282
|
"@astryx.calendar.previousMonth": {
|
|
283
283
|
"defaultMessage": "Mes anterior",
|
package/locales/fi-FI.json
CHANGED
|
@@ -277,7 +277,7 @@
|
|
|
277
277
|
},
|
|
278
278
|
"@astryx.banner.dismiss": {
|
|
279
279
|
"defaultMessage": "Hylkää",
|
|
280
|
-
"description": "\"Dismiss\" = close/hide this notification (not \"reject a person\").
|
|
280
|
+
"description": "\"Dismiss\" = close/hide this notification (not \"reject a person\"). Tooltip on the small X button on a Banner, and its aria label when the banner's title is not plain text."
|
|
281
281
|
},
|
|
282
282
|
"@astryx.calendar.previousMonth": {
|
|
283
283
|
"defaultMessage": "Edellinen kuukausi",
|
package/locales/fr-FR.json
CHANGED
|
@@ -257,7 +257,7 @@
|
|
|
257
257
|
},
|
|
258
258
|
"@astryx.banner.dismiss": {
|
|
259
259
|
"defaultMessage": "Ignorer",
|
|
260
|
-
"description": "\"Dismiss\" = close/hide this notification (not \"reject a person\").
|
|
260
|
+
"description": "\"Dismiss\" = close/hide this notification (not \"reject a person\"). Tooltip on the small X button on a Banner, and its aria label when the banner's title is not plain text."
|
|
261
261
|
},
|
|
262
262
|
"@astryx.calendar.previousMonth": {
|
|
263
263
|
"defaultMessage": "Mois précédent",
|
package/locales/he-IL.json
CHANGED
|
@@ -277,7 +277,7 @@
|
|
|
277
277
|
},
|
|
278
278
|
"@astryx.banner.dismiss": {
|
|
279
279
|
"defaultMessage": "סגור",
|
|
280
|
-
"description": "\"Dismiss\" = close/hide this notification (not \"reject a person\").
|
|
280
|
+
"description": "\"Dismiss\" = close/hide this notification (not \"reject a person\"). Tooltip on the small X button on a Banner, and its aria label when the banner's title is not plain text."
|
|
281
281
|
},
|
|
282
282
|
"@astryx.calendar.previousMonth": {
|
|
283
283
|
"defaultMessage": "החודש הקודם",
|
package/locales/hu-HU.json
CHANGED
|
@@ -277,7 +277,7 @@
|
|
|
277
277
|
},
|
|
278
278
|
"@astryx.banner.dismiss": {
|
|
279
279
|
"defaultMessage": "Elvetés",
|
|
280
|
-
"description": "\"Dismiss\" = close/hide this notification (not \"reject a person\").
|
|
280
|
+
"description": "\"Dismiss\" = close/hide this notification (not \"reject a person\"). Tooltip on the small X button on a Banner, and its aria label when the banner's title is not plain text."
|
|
281
281
|
},
|
|
282
282
|
"@astryx.calendar.previousMonth": {
|
|
283
283
|
"defaultMessage": "Előző hónap",
|
package/locales/it-IT.json
CHANGED
|
@@ -277,7 +277,7 @@
|
|
|
277
277
|
},
|
|
278
278
|
"@astryx.banner.dismiss": {
|
|
279
279
|
"defaultMessage": "Ignora",
|
|
280
|
-
"description": "\"Dismiss\" = close/hide this notification (not \"reject a person\").
|
|
280
|
+
"description": "\"Dismiss\" = close/hide this notification (not \"reject a person\"). Tooltip on the small X button on a Banner, and its aria label when the banner's title is not plain text."
|
|
281
281
|
},
|
|
282
282
|
"@astryx.calendar.previousMonth": {
|
|
283
283
|
"defaultMessage": "Mese precedente",
|
package/locales/ja-JP.json
CHANGED
|
@@ -281,7 +281,7 @@
|
|
|
281
281
|
},
|
|
282
282
|
"@astryx.banner.dismiss": {
|
|
283
283
|
"defaultMessage": "閉じる",
|
|
284
|
-
"description": "\"Dismiss\" = close/hide this notification (not \"reject a person\").
|
|
284
|
+
"description": "\"Dismiss\" = close/hide this notification (not \"reject a person\"). Tooltip on the small X button on a Banner, and its aria label when the banner's title is not plain text."
|
|
285
285
|
},
|
|
286
286
|
"@astryx.calendar.previousMonth": {
|
|
287
287
|
"defaultMessage": "前月",
|
package/locales/ko-KR.json
CHANGED
|
@@ -277,7 +277,7 @@
|
|
|
277
277
|
},
|
|
278
278
|
"@astryx.banner.dismiss": {
|
|
279
279
|
"defaultMessage": "닫기",
|
|
280
|
-
"description": "\"Dismiss\" = close/hide this notification (not \"reject a person\").
|
|
280
|
+
"description": "\"Dismiss\" = close/hide this notification (not \"reject a person\"). Tooltip on the small X button on a Banner, and its aria label when the banner's title is not plain text."
|
|
281
281
|
},
|
|
282
282
|
"@astryx.calendar.previousMonth": {
|
|
283
283
|
"defaultMessage": "이전 달",
|
package/locales/nl-NL.json
CHANGED
|
@@ -253,7 +253,7 @@
|
|
|
253
253
|
},
|
|
254
254
|
"@astryx.banner.dismiss": {
|
|
255
255
|
"defaultMessage": "Sluiten",
|
|
256
|
-
"description": "\"Dismiss\" = close/hide this notification (not \"reject a person\").
|
|
256
|
+
"description": "\"Dismiss\" = close/hide this notification (not \"reject a person\"). Tooltip on the small X button on a Banner, and its aria label when the banner's title is not plain text."
|
|
257
257
|
},
|
|
258
258
|
"@astryx.calendar.previousMonth": {
|
|
259
259
|
"defaultMessage": "Vorige maand",
|
package/locales/no-NO.json
CHANGED
|
@@ -273,7 +273,7 @@
|
|
|
273
273
|
},
|
|
274
274
|
"@astryx.banner.dismiss": {
|
|
275
275
|
"defaultMessage": "Lukk",
|
|
276
|
-
"description": "\"Dismiss\" = close/hide this notification (not \"reject a person\").
|
|
276
|
+
"description": "\"Dismiss\" = close/hide this notification (not \"reject a person\"). Tooltip on the small X button on a Banner, and its aria label when the banner's title is not plain text."
|
|
277
277
|
},
|
|
278
278
|
"@astryx.calendar.previousMonth": {
|
|
279
279
|
"defaultMessage": "Forrige måned",
|
package/locales/pl-PL.json
CHANGED
|
@@ -273,7 +273,7 @@
|
|
|
273
273
|
},
|
|
274
274
|
"@astryx.banner.dismiss": {
|
|
275
275
|
"defaultMessage": "Zamknij",
|
|
276
|
-
"description": "\"Dismiss\" = close/hide this notification (not \"reject a person\").
|
|
276
|
+
"description": "\"Dismiss\" = close/hide this notification (not \"reject a person\"). Tooltip on the small X button on a Banner, and its aria label when the banner's title is not plain text."
|
|
277
277
|
},
|
|
278
278
|
"@astryx.calendar.previousMonth": {
|
|
279
279
|
"defaultMessage": "Poprzedni miesiąc",
|
package/locales/pt-BR.json
CHANGED
|
@@ -277,7 +277,7 @@
|
|
|
277
277
|
},
|
|
278
278
|
"@astryx.banner.dismiss": {
|
|
279
279
|
"defaultMessage": "Dispensar",
|
|
280
|
-
"description": "\"Dismiss\" = close/hide this notification (not \"reject a person\").
|
|
280
|
+
"description": "\"Dismiss\" = close/hide this notification (not \"reject a person\"). Tooltip on the small X button on a Banner, and its aria label when the banner's title is not plain text."
|
|
281
281
|
},
|
|
282
282
|
"@astryx.calendar.previousMonth": {
|
|
283
283
|
"defaultMessage": "Mês anterior",
|
package/locales/pt-PT.json
CHANGED
|
@@ -277,7 +277,7 @@
|
|
|
277
277
|
},
|
|
278
278
|
"@astryx.banner.dismiss": {
|
|
279
279
|
"defaultMessage": "Dispensar",
|
|
280
|
-
"description": "\"Dismiss\" = close/hide this notification (not \"reject a person\").
|
|
280
|
+
"description": "\"Dismiss\" = close/hide this notification (not \"reject a person\"). Tooltip on the small X button on a Banner, and its aria label when the banner's title is not plain text."
|
|
281
281
|
},
|
|
282
282
|
"@astryx.calendar.previousMonth": {
|
|
283
283
|
"defaultMessage": "Mês anterior",
|
package/locales/ro-RO.json
CHANGED
|
@@ -273,7 +273,7 @@
|
|
|
273
273
|
},
|
|
274
274
|
"@astryx.banner.dismiss": {
|
|
275
275
|
"defaultMessage": "Închide",
|
|
276
|
-
"description": "\"Dismiss\" = close/hide this notification (not \"reject a person\").
|
|
276
|
+
"description": "\"Dismiss\" = close/hide this notification (not \"reject a person\"). Tooltip on the small X button on a Banner, and its aria label when the banner's title is not plain text."
|
|
277
277
|
},
|
|
278
278
|
"@astryx.calendar.previousMonth": {
|
|
279
279
|
"defaultMessage": "Luna anterioară",
|
package/locales/ru-RU.json
CHANGED
|
@@ -277,7 +277,7 @@
|
|
|
277
277
|
},
|
|
278
278
|
"@astryx.banner.dismiss": {
|
|
279
279
|
"defaultMessage": "Закрыть",
|
|
280
|
-
"description": "\"Dismiss\" = close/hide this notification (not \"reject a person\").
|
|
280
|
+
"description": "\"Dismiss\" = close/hide this notification (not \"reject a person\"). Tooltip on the small X button on a Banner, and its aria label when the banner's title is not plain text."
|
|
281
281
|
},
|
|
282
282
|
"@astryx.calendar.previousMonth": {
|
|
283
283
|
"defaultMessage": "Предыдущий месяц",
|
package/locales/sr-SP.json
CHANGED
|
@@ -277,7 +277,7 @@
|
|
|
277
277
|
},
|
|
278
278
|
"@astryx.banner.dismiss": {
|
|
279
279
|
"defaultMessage": "Одбаци",
|
|
280
|
-
"description": "\"Dismiss\" = close/hide this notification (not \"reject a person\").
|
|
280
|
+
"description": "\"Dismiss\" = close/hide this notification (not \"reject a person\"). Tooltip on the small X button on a Banner, and its aria label when the banner's title is not plain text."
|
|
281
281
|
},
|
|
282
282
|
"@astryx.calendar.previousMonth": {
|
|
283
283
|
"defaultMessage": "Претходни месец",
|
package/locales/sv-SE.json
CHANGED
|
@@ -273,7 +273,7 @@
|
|
|
273
273
|
},
|
|
274
274
|
"@astryx.banner.dismiss": {
|
|
275
275
|
"defaultMessage": "Stäng",
|
|
276
|
-
"description": "\"Dismiss\" = close/hide this notification (not \"reject a person\").
|
|
276
|
+
"description": "\"Dismiss\" = close/hide this notification (not \"reject a person\"). Tooltip on the small X button on a Banner, and its aria label when the banner's title is not plain text."
|
|
277
277
|
},
|
|
278
278
|
"@astryx.calendar.previousMonth": {
|
|
279
279
|
"defaultMessage": "Föregående månad",
|
package/locales/tr-TR.json
CHANGED
|
@@ -277,7 +277,7 @@
|
|
|
277
277
|
},
|
|
278
278
|
"@astryx.banner.dismiss": {
|
|
279
279
|
"defaultMessage": "Kapat",
|
|
280
|
-
"description": "\"Dismiss\" = close/hide this notification (not \"reject a person\").
|
|
280
|
+
"description": "\"Dismiss\" = close/hide this notification (not \"reject a person\"). Tooltip on the small X button on a Banner, and its aria label when the banner's title is not plain text."
|
|
281
281
|
},
|
|
282
282
|
"@astryx.calendar.previousMonth": {
|
|
283
283
|
"defaultMessage": "Önceki ay",
|
package/locales/uk-UA.json
CHANGED
|
@@ -277,7 +277,7 @@
|
|
|
277
277
|
},
|
|
278
278
|
"@astryx.banner.dismiss": {
|
|
279
279
|
"defaultMessage": "Закрити",
|
|
280
|
-
"description": "\"Dismiss\" = close/hide this notification (not \"reject a person\").
|
|
280
|
+
"description": "\"Dismiss\" = close/hide this notification (not \"reject a person\"). Tooltip on the small X button on a Banner, and its aria label when the banner's title is not plain text."
|
|
281
281
|
},
|
|
282
282
|
"@astryx.calendar.previousMonth": {
|
|
283
283
|
"defaultMessage": "Попередній місяць",
|
package/locales/vi-VN.json
CHANGED
|
@@ -277,7 +277,7 @@
|
|
|
277
277
|
},
|
|
278
278
|
"@astryx.banner.dismiss": {
|
|
279
279
|
"defaultMessage": "Bỏ qua",
|
|
280
|
-
"description": "\"Dismiss\" = close/hide this notification (not \"reject a person\").
|
|
280
|
+
"description": "\"Dismiss\" = close/hide this notification (not \"reject a person\"). Tooltip on the small X button on a Banner, and its aria label when the banner's title is not plain text."
|
|
281
281
|
},
|
|
282
282
|
"@astryx.calendar.previousMonth": {
|
|
283
283
|
"defaultMessage": "Tháng trước",
|