@astryxdesign/core 0.7.16-canary.ge95b87c → 0.7.16
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/CHANGELOG.md +90 -0
- package/dist/BottomSheet/BottomSheet.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheet.js +38 -88
- package/dist/BottomSheet/BottomSheetPanel.d.ts +14 -6
- package/dist/BottomSheet/BottomSheetPanel.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheetPanel.js +26 -14
- package/dist/Button/Button.d.ts.map +1 -1
- package/dist/Button/Button.js +78 -3
- package/dist/Chat/ChatComposerInput.d.ts.map +1 -1
- package/dist/Chat/ChatComposerInput.js +1 -1
- package/dist/ContextMenu/ContextMenu.d.ts.map +1 -1
- package/dist/ContextMenu/ContextMenu.js +3 -0
- package/dist/DateInput/DateInput.d.ts +24 -0
- package/dist/DateInput/DateInput.d.ts.map +1 -1
- package/dist/DateInput/DateInput.js +12 -5
- package/dist/DateInput/index.d.ts +1 -1
- package/dist/DateInput/index.d.ts.map +1 -1
- package/dist/DateInput/useTypedDate.d.ts +12 -5
- package/dist/DateInput/useTypedDate.d.ts.map +1 -1
- package/dist/DateInput/useTypedDate.js +18 -16
- package/dist/DateTimeInput/DateTimeInput.d.ts +25 -0
- package/dist/DateTimeInput/DateTimeInput.d.ts.map +1 -1
- package/dist/DateTimeInput/DateTimeInput.js +10 -3
- package/dist/DateTimeInput/NativeTimeSegment.d.ts +3 -1
- package/dist/DateTimeInput/NativeTimeSegment.d.ts.map +1 -1
- package/dist/DateTimeInput/NativeTimeSegment.js +10 -1
- package/dist/DateTimeInput/index.d.ts +1 -1
- package/dist/DateTimeInput/index.d.ts.map +1 -1
- package/dist/Dialog/Dialog.d.ts.map +1 -1
- package/dist/Dialog/Dialog.js +3 -2
- package/dist/DropdownMenu/DropdownMenuSubMenu.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuSubMenu.js +3 -0
- package/dist/Field/useEntryErrorBehavior.d.ts +8 -0
- package/dist/Field/useEntryErrorBehavior.d.ts.map +1 -0
- package/dist/Field/useEntryErrorBehavior.js +30 -0
- package/dist/FormLayout/FormLayout.d.ts +21 -2
- package/dist/FormLayout/FormLayout.d.ts.map +1 -1
- package/dist/FormLayout/FormLayout.js +5 -2
- package/dist/FormLayout/FormLayoutContext.d.ts +18 -2
- package/dist/FormLayout/FormLayoutContext.d.ts.map +1 -1
- package/dist/FormLayout/FormLayoutContext.js +22 -4
- package/dist/FormLayout/index.d.ts +1 -1
- package/dist/FormLayout/index.d.ts.map +1 -1
- package/dist/Layer/inputHold.d.ts +11 -1
- package/dist/Layer/inputHold.d.ts.map +1 -1
- package/dist/Layer/inputHold.js +114 -2
- package/dist/Layer/layerEntranceSide.d.ts.map +1 -1
- package/dist/Layer/layerEntranceSide.js +2 -1
- package/dist/Lightbox/Lightbox.d.ts.map +1 -1
- package/dist/Lightbox/Lightbox.js +63 -148
- package/dist/Lightbox/useZoomCore.d.ts +2 -13
- package/dist/Lightbox/useZoomCore.d.ts.map +1 -1
- package/dist/Lightbox/useZoomCore.js +7 -33
- package/dist/Lightbox/useZoomStage.d.ts.map +1 -1
- package/dist/Lightbox/useZoomStage.js +3 -9
- package/dist/Markdown/Markdown.d.ts.map +1 -1
- package/dist/Markdown/Markdown.js +7 -0
- package/dist/MetadataList/MetadataList.d.ts +2 -1
- package/dist/MetadataList/MetadataList.d.ts.map +1 -1
- package/dist/MetadataList/MetadataList.js +1 -1
- package/dist/NumberInput/NumberInput.d.ts +20 -2
- package/dist/NumberInput/NumberInput.d.ts.map +1 -1
- package/dist/NumberInput/NumberInput.js +4 -1
- package/dist/NumberInput/index.d.ts +1 -1
- package/dist/NumberInput/index.d.ts.map +1 -1
- package/dist/Outline/useOutlineFromDOM.d.ts.map +1 -1
- package/dist/Outline/useOutlineFromDOM.js +1 -0
- package/dist/Pagination/Pagination.d.ts.map +1 -1
- package/dist/Pagination/Pagination.js +1 -0
- package/dist/Popover/popoverSurfaceFrame.d.ts +4 -16
- package/dist/Popover/popoverSurfaceFrame.d.ts.map +1 -1
- package/dist/Popover/popoverSurfaceFrame.js +16 -31
- package/dist/Popover/usePopover.d.ts.map +1 -1
- package/dist/Popover/usePopover.js +3 -0
- package/dist/PowerSearch/PowerSearchValueEditor.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearchValueEditor.js +4 -0
- package/dist/SegmentedControl/useSegmentedTouchTracking.d.ts.map +1 -1
- package/dist/SegmentedControl/useSegmentedTouchTracking.js +18 -0
- package/dist/Selector/Selector.d.ts.map +1 -1
- package/dist/Selector/Selector.js +0 -2
- package/dist/Table/plugins/filtering/useTableFiltering.d.ts.map +1 -1
- package/dist/Table/plugins/filtering/useTableFiltering.js +2 -0
- package/dist/Thumbnail/Thumbnail.d.ts +2 -2
- package/dist/TimeInput/TimeInput.d.ts +24 -4
- package/dist/TimeInput/TimeInput.d.ts.map +1 -1
- package/dist/TimeInput/TimeInput.js +10 -4
- package/dist/TimeInput/index.d.ts +1 -1
- package/dist/TimeInput/index.d.ts.map +1 -1
- package/dist/TimeInput/useTypedTime.d.ts +17 -6
- package/dist/TimeInput/useTypedTime.d.ts.map +1 -1
- package/dist/TimeInput/useTypedTime.js +41 -18
- package/dist/Toast/Toast.d.ts +6 -1
- package/dist/Toast/Toast.d.ts.map +1 -1
- package/dist/Toast/Toast.js +17 -1
- package/dist/Toast/ToastViewport.d.ts.map +1 -1
- package/dist/Toast/ToastViewport.js +10 -9
- package/dist/astryx.css +36 -6
- package/dist/hooks/containerReveal.stylex.d.ts.map +1 -1
- package/dist/hooks/containerReveal.stylex.js +18 -15
- package/dist/hooks/useAnnounceRenderedText.d.ts +9 -3
- package/dist/hooks/useAnnounceRenderedText.d.ts.map +1 -1
- package/dist/hooks/useAnnounceRenderedText.js +9 -7
- package/dist/hooks/useContainerReveal.d.ts +8 -5
- package/dist/hooks/useContainerReveal.d.ts.map +1 -1
- package/dist/hooks/useContainerReveal.js +2 -1
- package/dist/i18n/generated-locales/en.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/en.generated.js +1 -0
- package/dist/i18n/generated-locales/pseudo.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/pseudo.generated.js +1 -0
- package/dist/internal/shared-context.d.ts +15 -0
- package/dist/internal/shared-context.d.ts.map +1 -0
- package/dist/internal/shared-context.js +15 -0
- package/dist/motion/animatedLayout.d.ts.map +1 -1
- package/dist/motion/animatedLayout.js +2 -17
- package/dist/motion/linearEasing.d.ts +9 -0
- package/dist/motion/linearEasing.d.ts.map +1 -0
- package/dist/motion/linearEasing.js +32 -0
- package/dist/motion/resolveMotion.d.ts +16 -0
- package/dist/motion/resolveMotion.d.ts.map +1 -1
- package/dist/motion/resolveMotion.js +40 -1
- package/locales/en.json +15 -11
- package/locales/pseudo.json +3 -0
- package/package.json +10 -5
- package/src/BottomSheet/BottomSheet.tsx +43 -101
- package/src/BottomSheet/BottomSheetPanel.tsx +46 -23
- package/src/Button/Button.tsx +132 -5
- package/src/Chat/ChatComposerInput.tsx +4 -0
- package/src/ContextMenu/ContextMenu.tsx +13 -0
- package/src/DateInput/DateInput.doc.mjs +18 -0
- package/src/DateInput/DateInput.tsx +35 -3
- package/src/DateInput/index.ts +1 -0
- package/src/DateInput/useTypedDate.ts +50 -12
- package/src/DateTimeInput/DateTimeInput.doc.mjs +18 -0
- package/src/DateTimeInput/DateTimeInput.tsx +38 -2
- package/src/DateTimeInput/NativeTimeSegment.tsx +16 -1
- package/src/DateTimeInput/index.ts +1 -0
- package/src/Dialog/Dialog.tsx +13 -2
- package/src/DropdownMenu/DropdownMenuSubMenu.tsx +13 -0
- package/src/Field/useEntryErrorBehavior.ts +34 -0
- package/src/FormLayout/FormLayout.doc.mjs +14 -0
- package/src/FormLayout/FormLayout.tsx +24 -2
- package/src/FormLayout/FormLayoutContext.ts +24 -4
- package/src/FormLayout/index.ts +5 -1
- package/src/Layer/inputHold.ts +137 -2
- package/src/Layer/layerEntranceSide.ts +2 -1
- package/src/Lightbox/Lightbox.doc.mjs +1 -1
- package/src/Lightbox/Lightbox.tsx +226 -357
- package/src/Lightbox/useZoomCore.ts +6 -49
- package/src/Lightbox/useZoomStage.ts +7 -17
- package/src/Markdown/Markdown.tsx +6 -0
- package/src/MetadataList/MetadataList.doc.mjs +16 -0
- package/src/MetadataList/MetadataList.tsx +3 -2
- package/src/NumberInput/NumberInput.doc.mjs +18 -0
- package/src/NumberInput/NumberInput.tsx +22 -1
- package/src/NumberInput/index.ts +1 -0
- package/src/Outline/useOutlineFromDOM.doc.mjs +99 -0
- package/src/Outline/useOutlineFromDOM.ts +1 -0
- package/src/Pagination/Pagination.tsx +1 -0
- package/src/Popover/popoverSurfaceFrame.ts +18 -41
- package/src/Popover/usePopover.tsx +13 -0
- package/src/PowerSearch/PowerSearchValueEditor.tsx +4 -0
- package/src/SegmentedControl/useSegmentedTouchTracking.ts +15 -0
- package/src/Selector/Selector.tsx +0 -1
- package/src/Table/plugins/filtering/useTableFiltering.tsx +2 -0
- package/src/Thumbnail/Thumbnail.doc.mjs +2 -2
- package/src/Thumbnail/Thumbnail.tsx +2 -2
- package/src/TimeInput/TimeInput.doc.mjs +21 -3
- package/src/TimeInput/TimeInput.tsx +38 -8
- package/src/TimeInput/index.ts +1 -0
- package/src/TimeInput/useTypedTime.ts +60 -18
- package/src/Toast/Toast.tsx +33 -2
- package/src/Toast/ToastViewport.tsx +14 -9
- package/src/hooks/containerReveal.stylex.ts +17 -15
- package/src/hooks/useAnnounceRenderedText.ts +18 -6
- package/src/hooks/useContainerReveal.doc.mjs +3 -3
- package/src/hooks/useContainerReveal.ts +8 -5
- package/src/i18n/generated-locales/en.generated.ts +1 -0
- package/src/i18n/generated-locales/pseudo.generated.ts +1 -0
- package/src/internal/shared-context.ts +15 -0
- package/src/motion/README.md +1 -0
- package/src/motion/animatedLayout.ts +6 -21
- package/src/motion/linearEasing.ts +35 -0
- package/src/motion/resolveMotion.ts +42 -1
|
@@ -31,9 +31,10 @@ export interface ContainerRevealOptions {
|
|
|
31
31
|
* out). This is the lever for state a caller owns — a motion gate over a
|
|
32
32
|
* list, a scroll in progress, a row whose menu is open and must stay lit.
|
|
33
33
|
*
|
|
34
|
-
* `'inactive'` never overrides keyboard focus or a coarse pointer:
|
|
35
|
-
* container still reveals on :focus-within and stays revealed
|
|
36
|
-
* it cannot hide content from a keyboard or
|
|
34
|
+
* `'inactive'` never overrides keyboard focus or a coarse primary pointer:
|
|
35
|
+
* the container still reveals on :focus-within and stays revealed under a
|
|
36
|
+
* coarse primary pointer, so it cannot hide content from a keyboard or
|
|
37
|
+
* touch-first user.
|
|
37
38
|
*/
|
|
38
39
|
forceState?: 'active' | 'inactive';
|
|
39
40
|
/**
|
|
@@ -53,7 +54,8 @@ export interface ContentRevealOptions {
|
|
|
53
54
|
/**
|
|
54
55
|
* Conceal-on-hover instead of reveal-on-hover: content is visible at rest
|
|
55
56
|
* and fades out while the container is hovered. Mouse-only and visual —
|
|
56
|
-
* stays in the a11y tree, ignores focus-within, stays visible
|
|
57
|
+
* stays in the a11y tree, ignores focus-within, stays visible under a
|
|
58
|
+
* coarse primary pointer.
|
|
57
59
|
* @default false
|
|
58
60
|
*/
|
|
59
61
|
isRevealInverted?: boolean;
|
|
@@ -93,7 +95,8 @@ export interface UseContainerRevealReturn {
|
|
|
93
95
|
* Scoped, CSS-only hover/focus reveal for content inside a container.
|
|
94
96
|
*
|
|
95
97
|
* Revealed content stays in the accessibility tree and the tab order. It
|
|
96
|
-
* shows on :focus-within without a delay, and it always shows
|
|
98
|
+
* shows on :focus-within without a delay, and it always shows under a coarse
|
|
99
|
+
* primary pointer.
|
|
97
100
|
* Concealed content hides only for a mouse. Motion honors
|
|
98
101
|
* prefers-reduced-motion.
|
|
99
102
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useContainerReveal.d.ts","sourceRoot":"","sources":["../../src/hooks/useContainerReveal.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;G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,GAAE,yBAA8B,GACtC,wBAAwB,CA4C1B"}
|
|
@@ -22,7 +22,8 @@ const EMPTY = Object.freeze({});
|
|
|
22
22
|
* Scoped, CSS-only hover/focus reveal for content inside a container.
|
|
23
23
|
*
|
|
24
24
|
* Revealed content stays in the accessibility tree and the tab order. It
|
|
25
|
-
* shows on :focus-within without a delay, and it always shows
|
|
25
|
+
* shows on :focus-within without a delay, and it always shows under a coarse
|
|
26
|
+
* primary pointer.
|
|
26
27
|
* Concealed content hides only for a mouse. Motion honors
|
|
27
28
|
* prefers-reduced-motion.
|
|
28
29
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"en.generated.d.ts","sourceRoot":"","sources":["../../../src/i18n/generated-locales/en.generated.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AAEH,QAAA,MAAM,cAAc,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"en.generated.d.ts","sourceRoot":"","sources":["../../../src/i18n/generated-locales/en.generated.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AAEH,QAAA,MAAM,cAAc,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAsvBpD,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -240,6 +240,7 @@ const runtimeCatalog = {
|
|
|
240
240
|
'@astryx.richTextEditor.link.insertTitle': 'Insert link',
|
|
241
241
|
'@astryx.richTextEditor.link.editTitle': 'Edit link',
|
|
242
242
|
'@astryx.richTextEditor.link.url': 'URL',
|
|
243
|
+
'@astryx.richTextEditor.link.urlPlaceholder': 'example.com',
|
|
243
244
|
'@astryx.richTextEditor.link.invalidUrl': 'Enter a valid http, https, mailto, or tel URL.',
|
|
244
245
|
'@astryx.richTextEditor.link.remove': 'Remove link',
|
|
245
246
|
'@astryx.richTextEditor.link.cancel': 'Cancel',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pseudo.generated.d.ts","sourceRoot":"","sources":["../../../src/i18n/generated-locales/pseudo.generated.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AAEH,QAAA,MAAM,cAAc,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"pseudo.generated.d.ts","sourceRoot":"","sources":["../../../src/i18n/generated-locales/pseudo.generated.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AAEH,QAAA,MAAM,cAAc,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAkwBpD,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -240,6 +240,7 @@ const runtimeCatalog = {
|
|
|
240
240
|
'@astryx.richTextEditor.link.insertTitle': '⟦Íñšéřţ łíñķ⟧',
|
|
241
241
|
'@astryx.richTextEditor.link.editTitle': '⟦Éðíţ łíñķ⟧',
|
|
242
242
|
'@astryx.richTextEditor.link.url': '⟦ÚŘŁ⟧',
|
|
243
|
+
'@astryx.richTextEditor.link.urlPlaceholder': '⟦éẋàɱþłé.çóɱ⟧',
|
|
243
244
|
'@astryx.richTextEditor.link.invalidUrl': '⟦Éñţéř à ṽàłíð ĥţţþ, ĥţţþš, ɱàíłţó, óř ţéł ÚŘŁ.⟧',
|
|
244
245
|
'@astryx.richTextEditor.link.remove': '⟦Řéɱóṽé łíñķ⟧',
|
|
245
246
|
'@astryx.richTextEditor.link.cancel': '⟦Çàñçéł⟧',
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file shared-context.ts
|
|
3
|
+
* @input Core's shared React context helper
|
|
4
|
+
* @output `@astryxdesign/core/internal/shared-context`: createSharedContext,
|
|
5
|
+
* re-exported by name for Lab components
|
|
6
|
+
* @position An internal entry reserved for Astryx's own packages:
|
|
7
|
+
* undocumented, outside the public API and its compatibility promise,
|
|
8
|
+
* versioned in lockstep with Core, and allowed only in Core and Lab by the
|
|
9
|
+
* `@astryx/no-core-internal-import` lint rule. Core components import the
|
|
10
|
+
* same module by relative path. Named re-exports only.
|
|
11
|
+
*
|
|
12
|
+
* SYNC: When modified, update scripts/sync-exports.js.
|
|
13
|
+
*/
|
|
14
|
+
export { createSharedContext } from '../utils/sharedContext.js';
|
|
15
|
+
//# sourceMappingURL=shared-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared-context.d.ts","sourceRoot":"","sources":["../../src/internal/shared-context.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAC,mBAAmB,EAAC,MAAM,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
/**
|
|
3
|
+
* @file shared-context.ts
|
|
4
|
+
* @input Core's shared React context helper
|
|
5
|
+
* @output `@astryxdesign/core/internal/shared-context`: createSharedContext,
|
|
6
|
+
* re-exported by name for Lab components
|
|
7
|
+
* @position An internal entry reserved for Astryx's own packages:
|
|
8
|
+
* undocumented, outside the public API and its compatibility promise,
|
|
9
|
+
* versioned in lockstep with Core, and allowed only in Core and Lab by the
|
|
10
|
+
* `@astryx/no-core-internal-import` lint rule. Core components import the
|
|
11
|
+
* same module by relative path. Named re-exports only.
|
|
12
|
+
*
|
|
13
|
+
* SYNC: When modified, update scripts/sync-exports.js.
|
|
14
|
+
*/
|
|
15
|
+
export { createSharedContext } from "../utils/sharedContext.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"animatedLayout.d.ts","sourceRoot":"","sources":["../../src/motion/animatedLayout.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"animatedLayout.d.ts","sourceRoot":"","sources":["../../src/motion/animatedLayout.ts"],"names":[],"mappings":"AAqGA,OAAO,EAIL,KAAK,iBAAiB,EACvB,MAAM,UAAU,CAAC;AAmBlB,sDAAsD;AACtD,KAAK,YAAY,GACb;I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UAAU,GAAG,IAAI,GACvC,IAAI,CA2BN;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAMtD;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA+B9D;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,OAAO,GAAG,YAAY,CAE3D"}
|
|
@@ -82,6 +82,7 @@
|
|
|
82
82
|
*/
|
|
83
83
|
|
|
84
84
|
import { LATE_START_MS } from "./frameBlock.js";
|
|
85
|
+
import { linearEasing, sampleCount } from "./linearEasing.js";
|
|
85
86
|
import { sharedKey, sharedMap, sharedState, sharedWeakMap, sharedWeakSet } from "../utils/sharedRealm.js";
|
|
86
87
|
import { paintedBackground } from "./inertClone.js";
|
|
87
88
|
import { inertCopy, isCopyable, placeOver, visiblePartCopy, wrapText } from "./transientCopy.js";
|
|
@@ -95,8 +96,6 @@ import { batchPresented, clearPresentedResolve, registerPresentedOffset, writePr
|
|
|
95
96
|
const MIN_SHIFT_PX = 0.5;
|
|
96
97
|
/** The touch cross-fade's cap (`design:reduced-motion` DR2). */
|
|
97
98
|
const CROSS_FADE_CAP_MS = 200;
|
|
98
|
-
/** Keyframes per second the motion is sampled at. */
|
|
99
|
-
const SAMPLES_PER_SECOND = 60;
|
|
100
99
|
|
|
101
100
|
// ---------------------------------------------------------------------------
|
|
102
101
|
// Motion
|
|
@@ -167,21 +166,10 @@ export function springGlide(spring, velocity) {
|
|
|
167
166
|
const remaining = t => t >= durationMs ? 0 : 1 - curve.value(t / 1000);
|
|
168
167
|
return {
|
|
169
168
|
durationMs,
|
|
170
|
-
easing: linearEasing(durationMs, remaining),
|
|
169
|
+
easing: linearEasing(durationMs, t => 1 - remaining(t)),
|
|
171
170
|
remaining
|
|
172
171
|
};
|
|
173
172
|
}
|
|
174
|
-
|
|
175
|
-
/** A move's remaining fraction over time as CSS `linear()` easing text. */
|
|
176
|
-
function linearEasing(durationMs, remaining) {
|
|
177
|
-
const count = sampleCount(durationMs);
|
|
178
|
-
const stops = [];
|
|
179
|
-
for (let i = 0; i < count; i++) {
|
|
180
|
-
const done = 1 - remaining(i / (count - 1) * durationMs);
|
|
181
|
-
stops.push(String(Math.round(done * 10000) / 10000));
|
|
182
|
-
}
|
|
183
|
-
return `linear(${stops.join(', ')})`;
|
|
184
|
-
}
|
|
185
173
|
function releaseGlideFor(area) {
|
|
186
174
|
for (let at = area; at != null; at = at.parentElement) {
|
|
187
175
|
const progress = releaseGlides.get(at);
|
|
@@ -215,9 +203,6 @@ function layoutMotion(area) {
|
|
|
215
203
|
progress
|
|
216
204
|
};
|
|
217
205
|
}
|
|
218
|
-
function sampleCount(durationMs) {
|
|
219
|
-
return Math.max(2, Math.ceil(durationMs / 1000 * SAMPLES_PER_SECOND) + 1);
|
|
220
|
-
}
|
|
221
206
|
|
|
222
207
|
/** Linear keyframes over `durationMs`, one per frame, from `frame(t ms)`. */
|
|
223
208
|
function sampleOver(durationMs, frame) {
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** How many samples cover `durationMs`, both ends included: at least 2. */
|
|
2
|
+
export declare function sampleCount(durationMs: number): number;
|
|
3
|
+
/**
|
|
4
|
+
* The curve `done` traces over `durationMs` as CSS `linear()` easing text,
|
|
5
|
+
* one stop per frame. `done(t)` is the fraction of the move done `t` ms in.
|
|
6
|
+
* A CSS transition with this easing and duration follows the curve.
|
|
7
|
+
*/
|
|
8
|
+
export declare function linearEasing(durationMs: number, done: (t: number) => number): string;
|
|
9
|
+
//# sourceMappingURL=linearEasing.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"linearEasing.d.ts","sourceRoot":"","sources":["../../src/motion/linearEasing.ts"],"names":[],"mappings":"AAaA,2EAA2E;AAC3E,wBAAgB,WAAW,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAEtD;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAC1B,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,GAC1B,MAAM,CAQR"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @file linearEasing.ts
|
|
5
|
+
* @input A duration and the fraction of a move done at each time
|
|
6
|
+
* @output Exports `linearEasing`, that curve as CSS `linear()` easing text,
|
|
7
|
+
* and `sampleCount`, how many samples cover a duration at 60 per second
|
|
8
|
+
* @position Pure math under the motion helpers; no DOM, no React
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
/** Samples per second of a sampled curve: one per frame at 60 Hz. */
|
|
12
|
+
const SAMPLES_PER_SECOND = 60;
|
|
13
|
+
|
|
14
|
+
/** How many samples cover `durationMs`, both ends included: at least 2. */
|
|
15
|
+
export function sampleCount(durationMs) {
|
|
16
|
+
return Math.max(2, Math.ceil(durationMs / 1000 * SAMPLES_PER_SECOND) + 1);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* The curve `done` traces over `durationMs` as CSS `linear()` easing text,
|
|
21
|
+
* one stop per frame. `done(t)` is the fraction of the move done `t` ms in.
|
|
22
|
+
* A CSS transition with this easing and duration follows the curve.
|
|
23
|
+
*/
|
|
24
|
+
export function linearEasing(durationMs, done) {
|
|
25
|
+
const count = sampleCount(durationMs);
|
|
26
|
+
const stops = [];
|
|
27
|
+
for (let i = 0; i < count; i++) {
|
|
28
|
+
const value = done(i / (count - 1) * durationMs);
|
|
29
|
+
stops.push(String(Math.round(value * 10000) / 10000));
|
|
30
|
+
}
|
|
31
|
+
return `linear(${stops.join(', ')})`;
|
|
32
|
+
}
|
|
@@ -42,4 +42,20 @@ export interface SpringMove {
|
|
|
42
42
|
* ```
|
|
43
43
|
*/
|
|
44
44
|
export declare function resolveSettleMs(element: Element | null | undefined, spring: SpringDescription, move?: SpringMove): number;
|
|
45
|
+
/**
|
|
46
|
+
* How `move` on `spring` plays at the tempo of the theme `element` is in: how
|
|
47
|
+
* long it takes, as `resolveSettleMs` gives it, and its progress over that
|
|
48
|
+
* time as CSS `linear()` easing. A CSS part that takes both follows the
|
|
49
|
+
* spring frame by frame, so the two start and land together. A sheet's scrim
|
|
50
|
+
* fades this way under the sheet's close.
|
|
51
|
+
*
|
|
52
|
+
* With `doneAt`, a position between `from` and `to`, the progress is measured
|
|
53
|
+
* toward `doneAt` instead. It reaches 1 the first time the move gets there
|
|
54
|
+
* and stays at 1. A sheet leaves view before its close ends, because its
|
|
55
|
+
* surface reaches below the screen, and its scrim is clear by then.
|
|
56
|
+
*/
|
|
57
|
+
export declare function resolveMoveTiming(element: Element | null | undefined, spring: SpringDescription, move: SpringMove, doneAt?: number): {
|
|
58
|
+
durationMs: number;
|
|
59
|
+
easing: string;
|
|
60
|
+
};
|
|
45
61
|
//# sourceMappingURL=resolveMotion.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolveMotion.d.ts","sourceRoot":"","sources":["../../src/motion/resolveMotion.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"resolveMotion.d.ts","sourceRoot":"","sources":["../../src/motion/resolveMotion.ts"],"names":[],"mappings":"AAiCA,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,SAAS,CAAC;AAC/C,OAAO,EAIL,KAAK,iBAAiB,EACvB,MAAM,UAAU,CAAC;AAoDlB;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,aAAa,CAAC,CAAC,SAAS,iBAAiB,EACvD,OAAO,EAAE,OAAO,GAAG,IAAI,GAAG,SAAS,EACnC,MAAM,EAAE,CAAC,GACR,CAAC,GAAG,iBAAiB,CAAC;AACzB,wBAAgB,aAAa,CAC3B,OAAO,EAAE,OAAO,GAAG,IAAI,GAAG,SAAS,EACnC,KAAK,EAAE,iBAAiB,GACvB,iBAAiB,CAAC;AACrB,wBAAgB,aAAa,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,MAAM,CAAC,GAAG,MAAM,EACxE,OAAO,EAAE,OAAO,GAAG,IAAI,GAAG,SAAS,EACnC,KAAK,EAAE,CAAC,EACR,GAAG,EAAE,CAAC,GACL,CAAC,CAAC,CAAC,CAAC,SAAS,MAAM,GAClB,MAAM,GACN,CAAC,CAAC,CAAC,CAAC,SAAS,iBAAiB,GAC5B,iBAAiB,GACjB,CAAC,CAAC,CAAC,CAAC,GAAG,iBAAiB,CAAC;AA2B/B,yDAAyD;AACzD,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,6DAA6D;IAC7D,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,yDAAyD;IACzD,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,eAAe,CAC7B,OAAO,EAAE,OAAO,GAAG,IAAI,GAAG,SAAS,EACnC,MAAM,EAAE,iBAAiB,EACzB,IAAI,CAAC,EAAE,UAAU,GAChB,MAAM,CAKR;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,OAAO,GAAG,IAAI,GAAG,SAAS,EACnC,MAAM,EAAE,iBAAiB,EACzB,IAAI,EAAE,UAAU,EAChB,MAAM,GAAE,MAAgB,GACvB;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAC,CAoBtC"}
|
|
@@ -7,7 +7,8 @@
|
|
|
7
7
|
* plays on, for its theme's tempo (themeTempo.ts)
|
|
8
8
|
* @output resolveMotion: the role's value at the theme's tempo.
|
|
9
9
|
* resolveSettleMs: how long a spring role, or one move on it, takes to
|
|
10
|
-
* settle there, for a CSS part that plays with it
|
|
10
|
+
* settle there, for a CSS part that plays with it. resolveMoveTiming: that
|
|
11
|
+
* move's duration and its progress as CSS easing
|
|
11
12
|
* @position Motion foundation; the animator resolves every spring and curve
|
|
12
13
|
* it is handed with it, and components resolve the durations they time
|
|
13
14
|
* with it
|
|
@@ -31,6 +32,7 @@
|
|
|
31
32
|
import { motionRoleIn, motionRoleOf } from "./roles.js";
|
|
32
33
|
import { isSpring } from "./roleValue.js";
|
|
33
34
|
import { settlingDuration, solveSpring, toSpring } from "./spring.js";
|
|
35
|
+
import { linearEasing } from "./linearEasing.js";
|
|
34
36
|
import { themeTempo } from "./themeTempo.js";
|
|
35
37
|
|
|
36
38
|
/**
|
|
@@ -130,4 +132,41 @@ export function resolveMotion(element, leafOrGroup, key) {
|
|
|
130
132
|
export function resolveSettleMs(element, spring, move) {
|
|
131
133
|
const resolved = toSpring(resolveMotion(element, spring));
|
|
132
134
|
return move == null ? settlingDuration(resolved) * 1000 : solveSpring(resolved, move).settleTime(move.epsilon) * 1000;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* How `move` on `spring` plays at the tempo of the theme `element` is in: how
|
|
139
|
+
* long it takes, as `resolveSettleMs` gives it, and its progress over that
|
|
140
|
+
* time as CSS `linear()` easing. A CSS part that takes both follows the
|
|
141
|
+
* spring frame by frame, so the two start and land together. A sheet's scrim
|
|
142
|
+
* fades this way under the sheet's close.
|
|
143
|
+
*
|
|
144
|
+
* With `doneAt`, a position between `from` and `to`, the progress is measured
|
|
145
|
+
* toward `doneAt` instead. It reaches 1 the first time the move gets there
|
|
146
|
+
* and stays at 1. A sheet leaves view before its close ends, because its
|
|
147
|
+
* surface reaches below the screen, and its scrim is clear by then.
|
|
148
|
+
*/
|
|
149
|
+
export function resolveMoveTiming(element, spring, move, doneAt = move.to) {
|
|
150
|
+
const curve = solveSpring(toSpring(resolveMotion(element, spring)), move);
|
|
151
|
+
const durationMs = curve.settleTime(move.epsilon) * 1000;
|
|
152
|
+
const span = doneAt - move.from;
|
|
153
|
+
if (span === 0 || durationMs === 0) {
|
|
154
|
+
return {
|
|
155
|
+
durationMs,
|
|
156
|
+
easing: linearEasing(durationMs, () => 1)
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
const progressAt = t => (curve.value(t / 1000) - move.from) / span;
|
|
160
|
+
// The first millisecond at which the move reaches `doneAt`, if it does.
|
|
161
|
+
let reachedAt = Infinity;
|
|
162
|
+
for (let t = 0; t <= durationMs; t++) {
|
|
163
|
+
if (progressAt(t) >= 1) {
|
|
164
|
+
reachedAt = t;
|
|
165
|
+
break;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
return {
|
|
169
|
+
durationMs,
|
|
170
|
+
easing: linearEasing(durationMs, t => t >= reachedAt ? 1 : progressAt(t))
|
|
171
|
+
};
|
|
133
172
|
}
|
package/locales/en.json
CHANGED
|
@@ -917,39 +917,43 @@
|
|
|
917
917
|
},
|
|
918
918
|
"@astryx.richTextEditor.toolbar.link": {
|
|
919
919
|
"defaultMessage": "Link",
|
|
920
|
-
"description": "Label of the toolbar toggle that opens the
|
|
920
|
+
"description": "Label of the toolbar toggle that opens the popover to add or edit a link on selected text."
|
|
921
921
|
},
|
|
922
922
|
"@astryx.richTextEditor.link.insertTitle": {
|
|
923
923
|
"defaultMessage": "Insert link",
|
|
924
|
-
"description": "
|
|
924
|
+
"description": "Screen-reader name of the RichTextEditor link popover when it adds a new link."
|
|
925
925
|
},
|
|
926
926
|
"@astryx.richTextEditor.link.editTitle": {
|
|
927
927
|
"defaultMessage": "Edit link",
|
|
928
|
-
"description": "
|
|
928
|
+
"description": "Screen-reader name of the RichTextEditor link popover when it changes or removes an existing link."
|
|
929
929
|
},
|
|
930
930
|
"@astryx.richTextEditor.link.url": {
|
|
931
931
|
"defaultMessage": "URL",
|
|
932
|
-
"description": "
|
|
932
|
+
"description": "Visually hidden label of the web address field in the RichTextEditor link popover."
|
|
933
|
+
},
|
|
934
|
+
"@astryx.richTextEditor.link.urlPlaceholder": {
|
|
935
|
+
"defaultMessage": "example.com",
|
|
936
|
+
"description": "Placeholder of the web address field in the RichTextEditor link popover: an example address, shown while the field is empty. An address without a scheme is accepted and becomes an https link, so keep it a bare domain."
|
|
933
937
|
},
|
|
934
938
|
"@astryx.richTextEditor.link.invalidUrl": {
|
|
935
939
|
"defaultMessage": "Enter a valid http, https, mailto, or tel URL.",
|
|
936
|
-
"description": "Error under the link
|
|
940
|
+
"description": "Error under the link popover address field when the entered address is not allowed. Keep the scheme names http, https, mailto, and tel untranslated."
|
|
937
941
|
},
|
|
938
942
|
"@astryx.richTextEditor.link.remove": {
|
|
939
943
|
"defaultMessage": "Remove link",
|
|
940
|
-
"description": "
|
|
944
|
+
"description": "Label and tooltip of the icon button in the RichTextEditor link popover that removes the link from the selected text and keeps the text."
|
|
941
945
|
},
|
|
942
946
|
"@astryx.richTextEditor.link.cancel": {
|
|
943
947
|
"defaultMessage": "Cancel",
|
|
944
|
-
"description": "
|
|
948
|
+
"description": "Label and tooltip of the icon button that closes the RichTextEditor link popover without changing anything."
|
|
945
949
|
},
|
|
946
950
|
"@astryx.richTextEditor.link.add": {
|
|
947
951
|
"defaultMessage": "Add link",
|
|
948
|
-
"description": "
|
|
952
|
+
"description": "Label and tooltip of the icon button that applies the address in the RichTextEditor link popover when adding a new link."
|
|
949
953
|
},
|
|
950
954
|
"@astryx.richTextEditor.link.update": {
|
|
951
955
|
"defaultMessage": "Update link",
|
|
952
|
-
"description": "
|
|
956
|
+
"description": "Label and tooltip of the icon button that applies the address in the RichTextEditor link popover when changing an existing link address."
|
|
953
957
|
},
|
|
954
958
|
"@astryx.markdown.taskList": {
|
|
955
959
|
"defaultMessage": "Task list",
|
|
@@ -1697,11 +1701,11 @@
|
|
|
1697
1701
|
},
|
|
1698
1702
|
"@astryx.lightbox.captionMore": {
|
|
1699
1703
|
"defaultMessage": "more",
|
|
1700
|
-
"description": "Visible label of the button after a
|
|
1704
|
+
"description": "Visible label of the button after a Lightbox caption that two lines cut short, for a single photo or a gallery. It opens the full caption over the photo. Pairs with `lightbox.captionLess`."
|
|
1701
1705
|
},
|
|
1702
1706
|
"@astryx.lightbox.captionLess": {
|
|
1703
1707
|
"defaultMessage": "less",
|
|
1704
|
-
"description": "Visible label of the same button while a Lightbox
|
|
1708
|
+
"description": "Visible label of the same button while a Lightbox caption is open in full over the photo. It closes the full caption. Pairs with `lightbox.captionMore`."
|
|
1705
1709
|
},
|
|
1706
1710
|
"@astryx.metadataList.showMore": {
|
|
1707
1711
|
"defaultMessage": "Show more",
|
package/locales/pseudo.json
CHANGED
|
@@ -698,6 +698,9 @@
|
|
|
698
698
|
"@astryx.richTextEditor.link.url": {
|
|
699
699
|
"defaultMessage": "⟦ÚŘŁ⟧"
|
|
700
700
|
},
|
|
701
|
+
"@astryx.richTextEditor.link.urlPlaceholder": {
|
|
702
|
+
"defaultMessage": "⟦éẋàɱþłé.çóɱ⟧"
|
|
703
|
+
},
|
|
701
704
|
"@astryx.richTextEditor.link.invalidUrl": {
|
|
702
705
|
"defaultMessage": "⟦Éñţéř à ṽàłíð ĥţţþ, ĥţţþš, ɱàíłţó, óř ţéł ÚŘŁ.⟧"
|
|
703
706
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astryxdesign/core",
|
|
3
|
-
"version": "0.7.16
|
|
3
|
+
"version": "0.7.16",
|
|
4
4
|
"displayName": "Astryx Core",
|
|
5
5
|
"description": "The component library. Accessible, themeable React components with built-in spacing, dark mode, and StyleX styling.",
|
|
6
6
|
"author": "Meta Open Source",
|
|
@@ -893,6 +893,11 @@
|
|
|
893
893
|
"source": "./src/internal/committed-ref.ts",
|
|
894
894
|
"types": "./dist/internal/committed-ref.d.ts",
|
|
895
895
|
"default": "./dist/internal/committed-ref.js"
|
|
896
|
+
},
|
|
897
|
+
"./internal/shared-context": {
|
|
898
|
+
"source": "./src/internal/shared-context.ts",
|
|
899
|
+
"types": "./dist/internal/shared-context.d.ts",
|
|
900
|
+
"default": "./dist/internal/shared-context.js"
|
|
896
901
|
}
|
|
897
902
|
},
|
|
898
903
|
"files": [
|
|
@@ -925,9 +930,6 @@
|
|
|
925
930
|
"react-dom": ">=19.0.0"
|
|
926
931
|
},
|
|
927
932
|
"devDependencies": {
|
|
928
|
-
"@astryxdesign/a11y-spec": "0.7.16-canary.ge95b87c",
|
|
929
|
-
"@astryxdesign/cli": "0.7.16-canary.ge95b87c",
|
|
930
|
-
"@astryxdesign/interaction-harness": "0.7.16-canary.ge95b87c",
|
|
931
933
|
"@babel/cli": "^7.29.7",
|
|
932
934
|
"@babel/core": "^7.29.7",
|
|
933
935
|
"@babel/preset-react": "^7.29.7",
|
|
@@ -939,7 +941,10 @@
|
|
|
939
941
|
"@testing-library/react": "^16.3.3",
|
|
940
942
|
"@types/babel__core": "^7.20.5",
|
|
941
943
|
"tailwindcss": "^4.3.2",
|
|
942
|
-
"temporal-polyfill": "^1.0.6"
|
|
944
|
+
"temporal-polyfill": "^1.0.6",
|
|
945
|
+
"@astryxdesign/a11y-spec": "0.0.0",
|
|
946
|
+
"@astryxdesign/cli": "0.7.16",
|
|
947
|
+
"@astryxdesign/interaction-harness": "0.0.0"
|
|
943
948
|
},
|
|
944
949
|
"dependencies": {
|
|
945
950
|
"intl-messageformat": "^11.2.9"
|