@astryxdesign/core 0.7.7-canary.ae97fa8 → 0.7.7-canary.b377b21
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/AlertDialog/AlertDialog.d.ts +4 -1
- package/dist/AlertDialog/AlertDialog.d.ts.map +1 -1
- package/dist/AlertDialog/AlertDialog.js +36 -6
- package/dist/BottomSheet/BottomSheetPanel.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheetPanel.js +22 -3
- package/dist/BottomSheet/useSheetGestures.d.ts.map +1 -1
- package/dist/BottomSheet/useSheetGestures.js +3 -1
- package/dist/Button/Button.d.ts.map +1 -1
- package/dist/Button/Button.js +17 -1
- package/dist/CheckboxInput/CheckboxInput.d.ts.map +1 -1
- package/dist/CheckboxInput/CheckboxInput.js +13 -2
- package/dist/ComplexSelector/ComplexSelector.d.ts +4 -1
- package/dist/ComplexSelector/ComplexSelector.d.ts.map +1 -1
- package/dist/ComplexSelector/ComplexSelector.js +14 -4
- package/dist/ContextMenu/ContextMenu.js +2 -2
- package/dist/Dialog/Dialog.d.ts.map +1 -1
- package/dist/Dialog/Dialog.js +7 -31
- package/dist/Field/Field.js +2 -2
- package/dist/HoverCard/HoverCard.d.ts +4 -3
- package/dist/HoverCard/HoverCard.d.ts.map +1 -1
- package/dist/HoverCard/useHoverCard.d.ts +5 -4
- package/dist/HoverCard/useHoverCard.d.ts.map +1 -1
- package/dist/HoverCard/useHoverCard.js +17 -31
- package/dist/Icon/Icon.d.ts +5 -1
- package/dist/Icon/Icon.d.ts.map +1 -1
- package/dist/Icon/Icon.js +5 -2
- package/dist/Layer/usePressPin.d.ts +17 -5
- package/dist/Layer/usePressPin.d.ts.map +1 -1
- package/dist/Layer/usePressPin.js +62 -12
- package/dist/Lightbox/Lightbox.d.ts.map +1 -1
- package/dist/Lightbox/Lightbox.js +18 -0
- package/dist/PowerSearch/PowerSearch.d.ts +36 -3
- package/dist/PowerSearch/PowerSearch.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearch.js +433 -127
- package/dist/PowerSearch/PowerSearchBottomSheet.d.ts +100 -0
- package/dist/PowerSearch/PowerSearchBottomSheet.d.ts.map +1 -0
- package/dist/PowerSearch/PowerSearchBottomSheet.js +1913 -0
- package/dist/PowerSearch/PowerSearchEditPopover.d.ts +32 -1
- package/dist/PowerSearch/PowerSearchEditPopover.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearchEditPopover.js +17 -6
- package/dist/PowerSearch/PowerSearchValueEditor.d.ts +38 -3
- package/dist/PowerSearch/PowerSearchValueEditor.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearchValueEditor.js +170 -61
- package/dist/PowerSearch/formatFilterValue.d.ts +7 -0
- package/dist/PowerSearch/formatFilterValue.d.ts.map +1 -1
- package/dist/PowerSearch/formatFilterValue.js +11 -1
- package/dist/PowerSearch/formatTokenValue.d.ts +28 -0
- package/dist/PowerSearch/formatTokenValue.d.ts.map +1 -0
- package/dist/PowerSearch/formatTokenValue.js +160 -0
- package/dist/PowerSearch/powerSearchSheetUtils.d.ts +65 -0
- package/dist/PowerSearch/powerSearchSheetUtils.d.ts.map +1 -0
- package/dist/PowerSearch/powerSearchSheetUtils.js +168 -0
- package/dist/RadioList/RadioList.d.ts.map +1 -1
- package/dist/RadioList/RadioList.js +3 -2
- package/dist/RadioList/RadioListItem.d.ts +1 -1
- package/dist/RadioList/RadioListItem.d.ts.map +1 -1
- package/dist/RadioList/RadioListItem.js +5 -3
- package/dist/Resizable/ResizeHandle.d.ts +2 -1
- package/dist/Resizable/ResizeHandle.d.ts.map +1 -1
- package/dist/Resizable/ResizeHandle.js +99 -77
- package/dist/SegmentedControl/useSegmentedSelectionMotion.d.ts.map +1 -1
- package/dist/SegmentedControl/useSegmentedSelectionMotion.js +3 -3
- package/dist/Slider/sliderTouchController.js +2 -2
- package/dist/Spinner/Spinner.d.ts +1 -1
- package/dist/Spinner/Spinner.d.ts.map +1 -1
- package/dist/Spinner/Spinner.js +60 -58
- package/dist/Switch/useSwitchTouch.js +4 -4
- package/dist/Table/BaseTable.d.ts.map +1 -1
- package/dist/Table/BaseTable.js +29 -8
- package/dist/TextInput/TextInput.d.ts +2 -2
- package/dist/TextInput/TextInput.d.ts.map +1 -1
- package/dist/TextInput/TextInput.js +10 -7
- package/dist/Toast/Toast.d.ts +11 -1
- package/dist/Toast/Toast.d.ts.map +1 -1
- package/dist/Toast/Toast.js +25 -15
- package/dist/Toast/ToastViewport.d.ts.map +1 -1
- package/dist/Toast/ToastViewport.js +94 -34
- package/dist/Toast/types.d.ts +9 -3
- package/dist/Toast/types.d.ts.map +1 -1
- package/dist/Tooltip/useTooltip.d.ts +19 -1
- package/dist/Tooltip/useTooltip.d.ts.map +1 -1
- package/dist/Tooltip/useTooltip.js +34 -53
- package/dist/Typeahead/TypeaheadItem.d.ts +2 -1
- package/dist/Typeahead/TypeaheadItem.d.ts.map +1 -1
- package/dist/animator/createAnimator.d.ts +98 -0
- package/dist/animator/createAnimator.d.ts.map +1 -0
- package/dist/animator/createAnimator.js +259 -0
- package/dist/astryx.css +35 -6
- package/dist/gestures/PressTracker.d.ts.map +1 -1
- package/dist/gestures/PressTracker.js +4 -3
- package/dist/hooks/actionGroupTracker.d.ts +4 -1
- package/dist/hooks/actionGroupTracker.d.ts.map +1 -1
- package/dist/hooks/actionGroupTracker.js +13 -3
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +1 -0
- package/dist/hooks/pressGroupContext.d.ts +6 -0
- package/dist/hooks/pressGroupContext.d.ts.map +1 -0
- package/dist/hooks/pressGroupContext.js +20 -0
- package/dist/hooks/useActionGroupTracking.d.ts +53 -0
- package/dist/hooks/useActionGroupTracking.d.ts.map +1 -0
- package/dist/hooks/useActionGroupTracking.js +174 -0
- package/dist/hooks/useAnimator.d.ts +41 -0
- package/dist/hooks/useAnimator.d.ts.map +1 -0
- package/dist/hooks/useAnimator.js +70 -0
- package/dist/hooks/useAttachment.d.ts +1 -1
- package/dist/hooks/useAttachment.js +1 -1
- package/dist/hooks/useInputStatusIcon.d.ts +1 -1
- package/dist/hooks/useInputStatusIcon.d.ts.map +1 -1
- package/dist/hooks/useInputStatusIcon.js +2 -2
- package/dist/hooks/useLongPress.d.ts +6 -2
- package/dist/hooks/useLongPress.d.ts.map +1 -1
- package/dist/hooks/useLongPress.js +95 -15
- package/dist/i18n/generated-english/PowerSearch/PowerSearchBottomSheet.generated.d.ts +8 -0
- package/dist/i18n/generated-english/PowerSearch/PowerSearchBottomSheet.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/PowerSearch/PowerSearchBottomSheet.generated.js +42 -0
- package/dist/i18n/generated-english/PowerSearch/PowerSearchValueEditor.generated.d.ts.map +1 -1
- package/dist/i18n/generated-english/PowerSearch/PowerSearchValueEditor.generated.js +6 -0
- package/dist/i18n/generated-english/PowerSearch/formatTokenValue.generated.d.ts +8 -0
- package/dist/i18n/generated-english/PowerSearch/formatTokenValue.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/PowerSearch/formatTokenValue.generated.js +14 -0
- package/dist/i18n/generated-locales/en.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/en.generated.js +30 -0
- package/dist/i18n/generated-locales/pseudo.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/pseudo.generated.js +30 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/internal/indicatorPress.stylex.d.ts +20 -0
- package/dist/internal/indicatorPress.stylex.d.ts.map +1 -0
- package/dist/internal/indicatorPress.stylex.js +26 -0
- package/dist/motion/animator.d.ts +14 -14
- package/dist/motion/animator.d.ts.map +1 -1
- package/dist/motion/animator.js +41 -18
- package/dist/motion/uikit/alert.d.ts +41 -0
- package/dist/motion/uikit/alert.d.ts.map +1 -0
- package/dist/motion/uikit/alert.js +43 -0
- package/dist/privateAttributes/pressGroupItem.stylex.d.ts +15 -0
- package/dist/privateAttributes/pressGroupItem.stylex.d.ts.map +1 -0
- package/dist/privateAttributes/pressGroupItem.stylex.js +23 -0
- package/dist/utils/focusReturn.d.ts +15 -0
- package/dist/utils/focusReturn.d.ts.map +1 -1
- package/dist/utils/focusReturn.js +28 -0
- package/dist/utils/interactionOverlay.stylex.d.ts +3 -2
- package/dist/utils/interactionOverlay.stylex.d.ts.map +1 -1
- package/dist/utils/interactionOverlay.stylex.js +3 -2
- package/dist/utils/pressFeedback.d.ts.map +1 -1
- package/dist/utils/pressFeedback.js +19 -6
- package/dist/utils/triggerFocus.d.ts +36 -0
- package/dist/utils/triggerFocus.d.ts.map +1 -0
- package/dist/utils/triggerFocus.js +65 -0
- package/locales/en.json +120 -0
- package/locales/pseudo.json +90 -0
- package/package.json +9 -4
- package/src/AlertDialog/AlertDialog.doc.mjs +2 -2
- package/src/AlertDialog/AlertDialog.tsx +37 -5
- package/src/BottomSheet/BottomSheetPanel.tsx +33 -3
- package/src/BottomSheet/useSheetGestures.ts +3 -1
- package/src/Button/Button.tsx +26 -4
- package/src/CheckboxInput/CheckboxInput.doc.mjs +18 -0
- package/src/CheckboxInput/CheckboxInput.tsx +36 -9
- package/src/ComplexSelector/ComplexSelector.tsx +20 -5
- package/src/ContextMenu/ContextMenu.tsx +2 -2
- package/src/Dialog/Dialog.tsx +10 -31
- package/src/Field/Field.tsx +2 -2
- package/src/HoverCard/HoverCard.doc.mjs +4 -2
- package/src/HoverCard/HoverCard.tsx +4 -3
- package/src/HoverCard/useHoverCard.doc.mjs +178 -36
- package/src/HoverCard/useHoverCard.tsx +46 -52
- package/src/Icon/Icon.doc.mjs +49 -8
- package/src/Icon/Icon.tsx +15 -7
- package/src/Layer/usePressPin.ts +81 -15
- package/src/Lightbox/Lightbox.tsx +18 -0
- package/src/PowerSearch/PowerSearch.doc.mjs +54 -5
- package/src/PowerSearch/PowerSearch.tsx +609 -155
- package/src/PowerSearch/PowerSearchBottomSheet.tsx +2515 -0
- package/src/PowerSearch/PowerSearchEditPopover.tsx +28 -6
- package/src/PowerSearch/PowerSearchValueEditor.tsx +203 -38
- package/src/PowerSearch/formatFilterValue.ts +18 -1
- package/src/PowerSearch/formatTokenValue.ts +215 -0
- package/src/PowerSearch/powerSearchSheetUtils.ts +224 -0
- package/src/RadioList/RadioList.tsx +3 -2
- package/src/RadioList/RadioListItem.tsx +5 -3
- package/src/Resizable/Resizable.doc.mjs +5 -4
- package/src/Resizable/ResizeHandle.tsx +167 -109
- package/src/SegmentedControl/useSegmentedSelectionMotion.ts +6 -3
- package/src/Slider/sliderTouchController.ts +2 -2
- package/src/Spinner/Spinner.tsx +77 -63
- package/src/Switch/useSwitchTouch.ts +4 -4
- package/src/Table/BaseTable.tsx +46 -12
- package/src/TextInput/TextInput.tsx +11 -10
- package/src/Toast/Toast.doc.mjs +4 -3
- package/src/Toast/Toast.tsx +52 -32
- package/src/Toast/ToastViewport.tsx +121 -35
- package/src/Toast/types.ts +9 -3
- package/src/Tooltip/useTooltip.doc.mjs +24 -0
- package/src/Tooltip/useTooltip.tsx +61 -56
- package/src/Typeahead/TypeaheadItem.doc.mjs +6 -3
- package/src/Typeahead/TypeaheadItem.tsx +2 -1
- package/src/animator/createAnimator.doc.mjs +153 -0
- package/src/animator/createAnimator.ts +324 -0
- package/src/gestures/PressTracker.ts +4 -3
- package/src/gestures/README.md +7 -1
- package/src/hooks/actionGroupTracker.ts +20 -5
- package/src/hooks/index.ts +2 -0
- package/src/hooks/pressGroupContext.ts +21 -0
- package/src/hooks/useActionGroupTracking.ts +224 -0
- package/src/hooks/useAnimator.doc.mjs +109 -0
- package/src/hooks/useAnimator.ts +67 -0
- package/src/hooks/useAttachment.ts +1 -1
- package/src/hooks/useInputStatusIcon.tsx +3 -2
- package/src/hooks/useLongPress.doc.mjs +2 -2
- package/src/hooks/useLongPress.ts +136 -15
- package/src/i18n/generated-english/PowerSearch/PowerSearchBottomSheet.generated.ts +43 -0
- package/src/i18n/generated-english/PowerSearch/PowerSearchValueEditor.generated.ts +6 -0
- package/src/i18n/generated-english/PowerSearch/formatTokenValue.generated.ts +15 -0
- package/src/i18n/generated-locales/en.generated.ts +41 -0
- package/src/i18n/generated-locales/pseudo.generated.ts +42 -0
- package/src/index.ts +13 -0
- package/src/internal/indicatorPress.stylex.ts +24 -0
- package/src/motion/README.md +8 -5
- package/src/motion/animator.ts +61 -29
- package/src/motion/uikit/alert.ts +43 -0
- package/src/privateAttributes/pressGroupItem.stylex.ts +23 -0
- package/src/utils/focusReturn.ts +30 -0
- package/src/utils/interactionOverlay.stylex.ts +3 -2
- package/src/utils/pressFeedback.ts +19 -6
- package/src/utils/triggerFocus.ts +80 -0
|
@@ -8,25 +8,8 @@
|
|
|
8
8
|
* @output Styled drag handle with WAI-ARIA separator role and keyboard support
|
|
9
9
|
* @position Between resizable panels; consumed directly by builders
|
|
10
10
|
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* Pill grip indicator can sit on either side of the divider (or centered)
|
|
14
|
-
* via pillPlacement. Default 'auto' places the pill on the panel side and
|
|
15
|
-
* flips when the panel collapses to 0px so it stays accessible.
|
|
16
|
-
*
|
|
17
|
-
* Pill placement uses a single stylex dynamic style that accepts a direction
|
|
18
|
-
* multiplier (-1 or 1). The pill element has its own themeProps
|
|
19
|
-
* ('resize-handle-pill') so themes can target size/shape directly.
|
|
20
|
-
*
|
|
21
|
-
* While the panel is collapsed, aria-valuenow is clamped to aria-valuemin
|
|
22
|
-
* (a value below the minimum is invalid per WCAG 4.1.2) and a localized
|
|
23
|
-
* "Collapsed" aria-valuetext announces the real state.
|
|
24
|
-
*
|
|
25
|
-
* The handle's input (the pointer drag, the keys, the double-click) is
|
|
26
|
-
* resizeGesture.ts. ResizeHandle forwards its React events to it, over the
|
|
27
|
-
* region its `resizable` prop describes. A drag takes pointer capture on the grab zone.
|
|
28
|
-
* The gesture's move, up and cancel events then go there, as in Slider, even
|
|
29
|
-
* over an embedded frame.
|
|
11
|
+
* A drag takes pointer capture on the element it starts on, so moves over an
|
|
12
|
+
* embedded frame still arrive.
|
|
30
13
|
*/
|
|
31
14
|
import { useEffect, useRef, useState } from 'react';
|
|
32
15
|
import * as stylex from '@stylexjs/stylex';
|
|
@@ -53,28 +36,6 @@ function resolveEffectiveSide(pillPlacement, isReversed, isCollapsed) {
|
|
|
53
36
|
}
|
|
54
37
|
return panelSide;
|
|
55
38
|
}
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* Hit-area inline bias, expressed as a fraction of the pill's per-side offset.
|
|
59
|
-
*
|
|
60
|
-
* The visible pill is placed by `pillOffsetX`/`pillOffsetY`: anchored at the
|
|
61
|
-
* divider's inline-start edge and pushed one grip-width-plus-gap toward the
|
|
62
|
-
* panel side via a PHYSICAL translate (dir −1 = start, +1 = end). Because that
|
|
63
|
-
* offset is physical, the pill sits on the same physical side of the divider in
|
|
64
|
-
* both LTR and RTL. The grab zone must sit OVER that pill, so it has to use the
|
|
65
|
-
* exact same anchor + physical-offset construction as the pill (just wider) —
|
|
66
|
-
* anchoring the hit area at the divider centre (`insetInlineStart: 50%`) and
|
|
67
|
-
* biasing with a percentage translate mixes a logical anchor (which flips under
|
|
68
|
-
* RTL) with a physical translate (which doesn't), leaving the grab zone stranded
|
|
69
|
-
* to one side under RTL. Returning the pill's `dir` here lets the hit area reuse
|
|
70
|
-
* `pillOffsetX`/`pillOffsetY` so the two elements are positioned identically.
|
|
71
|
-
*/
|
|
72
|
-
function hitAreaBiasDir(effectiveSide) {
|
|
73
|
-
if (effectiveSide === 'center') {
|
|
74
|
-
return null;
|
|
75
|
-
}
|
|
76
|
-
return effectiveSide === 'start' ? -1 : 1;
|
|
77
|
-
}
|
|
78
39
|
const styles = {
|
|
79
40
|
handle: {
|
|
80
41
|
kVAEAm: "x1n2onr6",
|
|
@@ -108,6 +69,14 @@ const styles = {
|
|
|
108
69
|
kZKoxP: "x5kfih4",
|
|
109
70
|
$$css: true
|
|
110
71
|
},
|
|
72
|
+
overlayHorizontalOnShortPane: {
|
|
73
|
+
kzqmXN: "x1a4a7d3",
|
|
74
|
+
$$css: true
|
|
75
|
+
},
|
|
76
|
+
overlayVerticalOnShortPane: {
|
|
77
|
+
kZKoxP: "xcuarzx",
|
|
78
|
+
$$css: true
|
|
79
|
+
},
|
|
111
80
|
horizontal: {
|
|
112
81
|
kzqmXN: "x1i1rx1s",
|
|
113
82
|
kZKoxP: "x5yr21d",
|
|
@@ -169,10 +138,19 @@ const styles = {
|
|
|
169
138
|
k3aq6I: "x1cb1t30",
|
|
170
139
|
$$css: true
|
|
171
140
|
},
|
|
141
|
+
hitAreaWithinHandleX: {
|
|
142
|
+
kzqmXN: "x5wh7xo",
|
|
143
|
+
$$css: true
|
|
144
|
+
},
|
|
145
|
+
hitAreaWithinHandleY: {
|
|
146
|
+
kZKoxP: "x1tvnn7s",
|
|
147
|
+
$$css: true
|
|
148
|
+
},
|
|
172
149
|
pill: {
|
|
173
150
|
kVAEAm: "x10l6tqk",
|
|
174
151
|
kY2c9j: "xhtitgo",
|
|
175
|
-
|
|
152
|
+
kFalU9: "x5ve5x3",
|
|
153
|
+
kfSwDN: "x87ps6o",
|
|
176
154
|
kaIpWk: "xjspbzw",
|
|
177
155
|
kWkggS: "x1m4xfpy",
|
|
178
156
|
k1ekBW: "x1wbls7o",
|
|
@@ -181,6 +159,14 @@ const styles = {
|
|
|
181
159
|
k87sOh: "xwa60dl",
|
|
182
160
|
$$css: true
|
|
183
161
|
},
|
|
162
|
+
pillGrabHorizontal: {
|
|
163
|
+
kkrTdU: "xicojor x16khyan",
|
|
164
|
+
$$css: true
|
|
165
|
+
},
|
|
166
|
+
pillGrabVertical: {
|
|
167
|
+
kkrTdU: "xyozgr7 x16khyan",
|
|
168
|
+
$$css: true
|
|
169
|
+
},
|
|
184
170
|
pillHorizontal: {
|
|
185
171
|
kzqmXN: "x1g8rjiy",
|
|
186
172
|
kZKoxP: "x18to7ep",
|
|
@@ -193,6 +179,7 @@ const styles = {
|
|
|
193
179
|
},
|
|
194
180
|
pillHidden: {
|
|
195
181
|
kSiTet: "xg01cxk",
|
|
182
|
+
kfzvcC: "x47corl",
|
|
196
183
|
$$css: true
|
|
197
184
|
},
|
|
198
185
|
pillVisible: {
|
|
@@ -201,26 +188,58 @@ const styles = {
|
|
|
201
188
|
},
|
|
202
189
|
pillHover: {
|
|
203
190
|
kSiTet: "x1hc1fzr",
|
|
191
|
+
kfzvcC: "x67bb7w",
|
|
204
192
|
kWkggS: "x1m4xfpy",
|
|
205
193
|
$$css: true
|
|
206
194
|
},
|
|
207
195
|
pillActive: {
|
|
208
196
|
kSiTet: "x1hc1fzr",
|
|
197
|
+
kfzvcC: "x67bb7w",
|
|
209
198
|
kWkggS: "x7njt3n",
|
|
210
199
|
$$css: true
|
|
200
|
+
},
|
|
201
|
+
pillBridgeRight: {
|
|
202
|
+
kgeoSG: "x1cpjm7i",
|
|
203
|
+
kEoFBp: "x1hmns74",
|
|
204
|
+
kGOzcv: "x1nc033x",
|
|
205
|
+
kSJ0CW: "x1682cnc x7my30s",
|
|
206
|
+
koaPKo: "x5ig7ga x3k25x4",
|
|
207
|
+
$$css: true
|
|
208
|
+
},
|
|
209
|
+
pillBridgeLeft: {
|
|
210
|
+
kgeoSG: "x1cpjm7i",
|
|
211
|
+
kEoFBp: "x1hmns74",
|
|
212
|
+
kGOzcv: "x1nc033x",
|
|
213
|
+
kSJ0CW: "x1vl71nl xnx00js",
|
|
214
|
+
koaPKo: "xtyp5od x17kcdp5",
|
|
215
|
+
$$css: true
|
|
216
|
+
},
|
|
217
|
+
pillBridgeDown: {
|
|
218
|
+
kgeoSG: "x1cpjm7i",
|
|
219
|
+
kEoFBp: "x1hmns74",
|
|
220
|
+
kpsdNU: "xm4btww",
|
|
221
|
+
k96MEf: "x1y3wzot",
|
|
222
|
+
k5Ofw7: "xxgnp13",
|
|
223
|
+
$$css: true
|
|
224
|
+
},
|
|
225
|
+
pillBridgeUp: {
|
|
226
|
+
kgeoSG: "x1cpjm7i",
|
|
227
|
+
kEoFBp: "x1hmns74",
|
|
228
|
+
kpsdNU: "xm4btww",
|
|
229
|
+
k96MEf: "x1phjwh8",
|
|
230
|
+
k5Ofw7: "xhq5o37",
|
|
231
|
+
$$css: true
|
|
211
232
|
}
|
|
212
233
|
};
|
|
213
234
|
|
|
214
235
|
// Dynamic styles — avoids inline style overrides.
|
|
215
236
|
// Each axis gets its own function since StyleX requires static structure.
|
|
216
237
|
const _temp = {
|
|
217
|
-
|
|
218
|
-
k3aq6I: "x11wx31z " + "x75qhwu",
|
|
238
|
+
kzqmXN: "x5lhr3w",
|
|
219
239
|
"$$css": true
|
|
220
240
|
};
|
|
221
241
|
const _temp2 = {
|
|
222
|
-
|
|
223
|
-
k3aq6I: "xsqj5wx",
|
|
242
|
+
kZKoxP: "x16ye13r",
|
|
224
243
|
"$$css": true
|
|
225
244
|
};
|
|
226
245
|
const _temp3 = {
|
|
@@ -234,12 +253,11 @@ const _temp4 = {
|
|
|
234
253
|
"$$css": true
|
|
235
254
|
};
|
|
236
255
|
const dynamicStyles = {
|
|
237
|
-
|
|
238
|
-
"--x-
|
|
239
|
-
"--x-sj6hyi": `translateX(calc(${dir} * (3px + ${spacingVars['--spacing-1']}) + 6.5px))` != null ? `translateX(calc(${dir} * (3px + ${spacingVars['--spacing-1']}) + 6.5px))` : undefined
|
|
256
|
+
hitAreaLengthX: pane => [_temp, {
|
|
257
|
+
"--x-width": (val => typeof val === "number" ? val + "px" : val != null ? val : undefined)(`min(${spacingVars['--spacing-4']}, ${pane}px)`)
|
|
240
258
|
}],
|
|
241
|
-
|
|
242
|
-
"--x-
|
|
259
|
+
hitAreaLengthY: pane => [_temp2, {
|
|
260
|
+
"--x-height": (val => typeof val === "number" ? val + "px" : val != null ? val : undefined)(`min(${spacingVars['--spacing-4']}, ${pane}px)`)
|
|
243
261
|
}],
|
|
244
262
|
pillOffsetX: dir => [_temp3, {
|
|
245
263
|
"--x-transform": `translate(calc(${dir} * (100% + ${spacingVars['--spacing-1']})), -50%)` != null ? `translate(calc(${dir} * (100% + ${spacingVars['--spacing-1']})), -50%)` : undefined
|
|
@@ -358,9 +376,11 @@ export function ResizeHandle({
|
|
|
358
376
|
const gesture = resizable != null ? regionGesture : null;
|
|
359
377
|
const isCollapsed = resizable?._isCollapsed ?? false;
|
|
360
378
|
const effectiveSide = resolveEffectiveSide(pillPlacement, isReversed, isCollapsed);
|
|
361
|
-
//
|
|
362
|
-
//
|
|
363
|
-
|
|
379
|
+
// An inline zone reaches at most half of the pane the Handle resizes. An
|
|
380
|
+
// overlay Handle takes at most half of it. A collapsed pane, or one at 0px,
|
|
381
|
+
// has nothing to protect and keeps the whole zone.
|
|
382
|
+
const paneSize = resizable?._size;
|
|
383
|
+
const paneLength = isCollapsed || paneSize == null || paneSize <= 0 ? undefined : paneSize;
|
|
364
384
|
const isInteracting = isHovered || isFocused;
|
|
365
385
|
|
|
366
386
|
// A handle whose axis disagrees with its region drags along one axis while
|
|
@@ -402,6 +422,26 @@ export function ResizeHandle({
|
|
|
402
422
|
const effectiveMax = resizable ? getEffectiveMaxPx(resizable) ?? (resizable._maxSizePx !== Infinity ? resizable._maxSizePx : undefined) : undefined;
|
|
403
423
|
const ariaValueMax = effectiveMax != null && Number.isFinite(effectiveMax) ? effectiveMax : undefined;
|
|
404
424
|
const ariaValueText = resizable != null && isCollapsed ? t('@astryx.resizable.collapsed') : undefined;
|
|
425
|
+
|
|
426
|
+
// The Grip pill takes the pointer as the Grab zone does, so a pill drawn
|
|
427
|
+
// outside the zone still resizes.
|
|
428
|
+
const grabHandlers = {
|
|
429
|
+
onPointerDown: e => {
|
|
430
|
+
if (!isDisabled) {
|
|
431
|
+
gesture?.pointerDown(e);
|
|
432
|
+
}
|
|
433
|
+
},
|
|
434
|
+
onPointerMove: e => gesture?.pointerMove(e),
|
|
435
|
+
onPointerUp: e => gesture?.pointerUp(e),
|
|
436
|
+
onPointerCancel: e => gesture?.pointerCancel(e),
|
|
437
|
+
onLostPointerCapture: e => gesture?.pointerCancel(e),
|
|
438
|
+
onPointerEnter: () => setIsHovered(true),
|
|
439
|
+
onPointerLeave: () => {
|
|
440
|
+
if (!isDragging) {
|
|
441
|
+
setIsHovered(false);
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
};
|
|
405
445
|
return /*#__PURE__*/_jsxs("div", {
|
|
406
446
|
ref: useMergedRefs(ref, handleRef),
|
|
407
447
|
role: "separator",
|
|
@@ -421,7 +461,7 @@ export function ResizeHandle({
|
|
|
421
461
|
onFocus: () => setIsFocused(true),
|
|
422
462
|
onBlur: () => setIsFocused(false),
|
|
423
463
|
"data-resizing": isDragging || undefined,
|
|
424
|
-
...mergeProps(themeProps('resize-handle'), focusOutlineProps.focusVisible(styles.handle, isOverlay && styles.overlay, isOverlay && (isHorizontal ? styles.overlayHorizontal : styles.overlayVertical), !isOverlay && (isHorizontal ? styles.horizontal : styles.vertical), !isOverlay && !hasDivider && (isHorizontal ? styles.noDividerHorizontal : styles.noDividerVertical), !isOverlay && hasDivider && isInteracting && !isDragging && styles.handleHover, !isOverlay && hasDivider && isDragging && styles.handleActive, isDisabled && styles.disabled, xstyle), className),
|
|
464
|
+
...mergeProps(themeProps('resize-handle'), focusOutlineProps.focusVisible(styles.handle, isOverlay && styles.overlay, isOverlay && (isHorizontal ? styles.overlayHorizontal : styles.overlayVertical), isOverlay && paneLength != null && (isHorizontal ? styles.overlayHorizontalOnShortPane : styles.overlayVerticalOnShortPane), !isOverlay && (isHorizontal ? styles.horizontal : styles.vertical), !isOverlay && !hasDivider && (isHorizontal ? styles.noDividerHorizontal : styles.noDividerVertical), !isOverlay && hasDivider && isInteracting && !isDragging && styles.handleHover, !isOverlay && hasDivider && isDragging && styles.handleActive, isDisabled && styles.disabled, xstyle), className),
|
|
425
465
|
...props,
|
|
426
466
|
// Keyboard resizing must fire from the focusable separator, not a child:
|
|
427
467
|
// keydown fires on the focused element and bubbles up, so a handler on a
|
|
@@ -435,29 +475,11 @@ export function ResizeHandle({
|
|
|
435
475
|
}
|
|
436
476
|
},
|
|
437
477
|
children: [/*#__PURE__*/_jsx("div", {
|
|
438
|
-
...stylex.props(styles.hitArea, isHorizontal ? styles.hitAreaHorizontal : styles.hitAreaVertical,
|
|
439
|
-
|
|
440
|
-
// centered (no bias) just center the hit area on the divider; when
|
|
441
|
-
// it's offset to a panel side, reuse the pill's physical-offset
|
|
442
|
-
// construction so the two stay aligned in LTR and RTL alike.
|
|
443
|
-
hitBiasDir == null ? isHorizontal ? rtlStyles.centerInline('0px') : styles.hitAreaCenteredY : isHorizontal ? dynamicStyles.hitAreaOffsetX(hitBiasDir) : dynamicStyles.hitAreaOffsetY(hitBiasDir), isDisabled && styles.disabled),
|
|
444
|
-
onPointerDown: e => {
|
|
445
|
-
if (!isDisabled) {
|
|
446
|
-
gesture?.pointerDown(e);
|
|
447
|
-
}
|
|
448
|
-
},
|
|
449
|
-
onPointerMove: e => gesture?.pointerMove(e),
|
|
450
|
-
onPointerUp: e => gesture?.pointerUp(e),
|
|
451
|
-
onPointerCancel: e => gesture?.pointerCancel(e),
|
|
452
|
-
onLostPointerCapture: e => gesture?.pointerCancel(e),
|
|
453
|
-
onPointerEnter: () => setIsHovered(true),
|
|
454
|
-
onPointerLeave: () => {
|
|
455
|
-
if (!isDragging) {
|
|
456
|
-
setIsHovered(false);
|
|
457
|
-
}
|
|
458
|
-
}
|
|
478
|
+
...stylex.props(styles.hitArea, isHorizontal ? styles.hitAreaHorizontal : styles.hitAreaVertical, isHorizontal ? rtlStyles.centerInline('0px') : styles.hitAreaCenteredY, isOverlay && (isHorizontal ? styles.hitAreaWithinHandleX : styles.hitAreaWithinHandleY), !isOverlay && paneLength != null && (isHorizontal ? dynamicStyles.hitAreaLengthX(paneLength) : dynamicStyles.hitAreaLengthY(paneLength)), isDisabled && styles.disabled),
|
|
479
|
+
...grabHandlers
|
|
459
480
|
}), children ?? /*#__PURE__*/_jsx("div", {
|
|
460
|
-
...mergeProps(themeProps('resize-handle-pill'), stylex.props(styles.pill, isHorizontal ? styles.pillHorizontal : styles.pillVertical, effectiveSide === 'center' ? rtlStyles.centerInline('-50%') : isHorizontal ? dynamicStyles.pillOffsetX(effectiveSide === 'start' ? -1 : 1) : dynamicStyles.pillOffsetY(effectiveSide === 'start' ? -1 : 1), isAlwaysVisible ? styles.pillVisible : styles.pillHidden, isInteracting && !isDragging && styles.pillHover, isDragging && styles.pillActive))
|
|
481
|
+
...mergeProps(themeProps('resize-handle-pill'), stylex.props(styles.pill, isHorizontal ? styles.pillHorizontal : styles.pillVertical, effectiveSide === 'center' ? rtlStyles.centerInline('-50%') : isHorizontal ? dynamicStyles.pillOffsetX(effectiveSide === 'start' ? -1 : 1) : dynamicStyles.pillOffsetY(effectiveSide === 'start' ? -1 : 1), isHorizontal ? styles.pillGrabHorizontal : styles.pillGrabVertical, isAlwaysVisible ? styles.pillVisible : styles.pillHidden, !isAlwaysVisible && effectiveSide !== 'center' && (isHorizontal ? effectiveSide === 'start' ? styles.pillBridgeRight : styles.pillBridgeLeft : effectiveSide === 'start' ? styles.pillBridgeDown : styles.pillBridgeUp), isInteracting && !isDragging && styles.pillHover, isDragging && styles.pillActive, isDisabled && styles.disabled)),
|
|
482
|
+
...grabHandlers
|
|
461
483
|
})]
|
|
462
484
|
});
|
|
463
485
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSegmentedSelectionMotion.d.ts","sourceRoot":"","sources":["../../src/SegmentedControl/useSegmentedSelectionMotion.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAKL,KAAK,WAAW,EAChB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,EAGL,KAAK,QAAQ,EAKd,MAAM,oBAAoB,CAAC;AAa5B,kCAAkC;AAClC,eAAO,MAAM,gBAAgB,iCAA+B,CAAC;AAS7D,6EAA6E;AAC7E,eAAO,MAAM,kBAAkB,EAAE,aAAa,CAAC,MAAM,CA2BpD,CAAC;AAEF;;;;GAIG;AACH,M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,UAAU,EAAE,OAAO,GAClB;IACD,QAAQ,CAAC,SAAS,EAAE,kBAAkB,CAAC;IACvC,4EAA4E;IAC5E,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC,WAAW,CAAC,CAAC;CAChD,CAsDA"}
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
* - /packages/core/src/SegmentedControl/useSegmentedTouchTracking.ts
|
|
17
17
|
*/
|
|
18
18
|
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
19
|
-
import {
|
|
19
|
+
import { createMotionAnimator } from "../motion/animator.js";
|
|
20
20
|
import { registerSegmentedTable, segmentedControl } from "../motion/uikit/segmented.js";
|
|
21
21
|
import { registerSpringsTable, springs } from "../motion/uikit/springs.js";
|
|
22
22
|
import { useIsomorphicLayoutEffect } from "../hooks/useIsomorphicLayoutEffect.js";
|
|
@@ -361,7 +361,7 @@ export class SegmentedSelectionMotion {
|
|
|
361
361
|
|
|
362
362
|
/** The ::after: the surface fading out under Reduced Motion. */
|
|
363
363
|
|
|
364
|
-
constructor(animator =
|
|
364
|
+
constructor(animator = createMotionAnimator(null, {
|
|
365
365
|
pseudoElement: '::before'
|
|
366
366
|
}), options = {}) {
|
|
367
367
|
this.animator = animator;
|
|
@@ -371,7 +371,7 @@ export class SegmentedSelectionMotion {
|
|
|
371
371
|
registerSpringsTable();
|
|
372
372
|
registerSegmentedTable();
|
|
373
373
|
this.now = options.now ?? defaultNow;
|
|
374
|
-
this.after = options.afterAnimator ??
|
|
374
|
+
this.after = options.afterAnimator ?? createMotionAnimator(null, {
|
|
375
375
|
pseudoElement: '::after',
|
|
376
376
|
initial: {
|
|
377
377
|
opacity: 0
|
|
@@ -21,7 +21,7 @@ import { PRESS_PROFILES, createPressTracker } from "../gestures/PressTracker.js"
|
|
|
21
21
|
import { lockSelection } from "../gestures/selectionLock.js";
|
|
22
22
|
import { TapGestureRecognizer } from "../gestures/TapGestureRecognizer.js";
|
|
23
23
|
import { isRtlElement } from "../hooks/isRtlElement.js";
|
|
24
|
-
import {
|
|
24
|
+
import { createMotionAnimator } from "../motion/animator.js";
|
|
25
25
|
import { projectDistance } from "../motion/projection.js";
|
|
26
26
|
import { resolveMotion } from "../motion/resolveMotion.js";
|
|
27
27
|
import { solveSpring, toSpring } from "../motion/spring.js";
|
|
@@ -995,7 +995,7 @@ export class SliderTouchController {
|
|
|
995
995
|
animatorFor(element) {
|
|
996
996
|
let animator = this.animators.get(element);
|
|
997
997
|
if (animator == null) {
|
|
998
|
-
animator =
|
|
998
|
+
animator = createMotionAnimator(element);
|
|
999
999
|
this.animators.set(element, animator);
|
|
1000
1000
|
}
|
|
1001
1001
|
return animator;
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* SYNC: When modified, update these files to stay in sync:
|
|
8
8
|
* - /packages/core/src/Spinner/Spinner.doc.mjs
|
|
9
|
-
* - /packages/core/src/Spinner/Spinner.test.tsx
|
|
9
|
+
* - /packages/core/src/Spinner/Spinner.test.tsx and __tests__/SpinnerMotion.a11y.chromium.spec.ts (rotor timing)
|
|
10
10
|
* - /packages/core/src/Spinner/index.ts
|
|
11
11
|
* - /apps/storybook/stories/Spinner.stories.tsx
|
|
12
12
|
* - /packages/cli/assets/templates/blocks/components/Spinner/ (showcase blocks)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Spinner.d.ts","sourceRoot":"","sources":["../../src/Spinner/Spinner.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAQ,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAG5C,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AA6B5C,QAAA,MAAM,KAAK;;;;;;;;;;;;;;;;;CAKV,CAAC;
|
|
1
|
+
{"version":3,"file":"Spinner.d.ts","sourceRoot":"","sources":["../../src/Spinner/Spinner.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAQ,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAG5C,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AA6B5C,QAAA,MAAM,KAAK;;;;;;;;;;;;;;;;;CAKV,CAAC;AA8XF,MAAM,MAAM,WAAW,GAAG,MAAM,OAAO,KAAK,CAAC;AAE7C,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,SAAS,CAAC;AAExE,MAAM,WAAW,YAAa,SAAQ,SAAS,CAAC,eAAe,CAAC;IAC9D,wCAAwC;IACxC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;IACjC;;;;;;;;;OASG;IACH,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB;;;;;;;;;OASG;IACH,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB;;;;;;;;;;;;;OAaG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAMD;;;;;;;;;;;GAWG;AACH,wBAAgB,OAAO,CAAC,EACtB,IAAW,EACX,KAAiB,EACjB,KAAK,EACL,MAAM,EACN,SAAS,EACT,KAAK,EACL,YAAY,EAAE,SAAS,EACvB,aAAa,EAAE,MAAM,EACrB,GAAG,EACH,GAAG,SAAS,EACb,EAAE,YAAY,+BAqId;yBAhJe,OAAO"}
|
package/dist/Spinner/Spinner.js
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
*
|
|
11
11
|
* SYNC: When modified, update these files to stay in sync:
|
|
12
12
|
* - /packages/core/src/Spinner/Spinner.doc.mjs
|
|
13
|
-
* - /packages/core/src/Spinner/Spinner.test.tsx
|
|
13
|
+
* - /packages/core/src/Spinner/Spinner.test.tsx and __tests__/SpinnerMotion.a11y.chromium.spec.ts (rotor timing)
|
|
14
14
|
* - /packages/core/src/Spinner/index.ts
|
|
15
15
|
* - /apps/storybook/stories/Spinner.stories.tsx
|
|
16
16
|
* - /packages/cli/assets/templates/blocks/components/Spinner/ (showcase blocks)
|
|
@@ -156,59 +156,54 @@ function registerSpinnerVars() {
|
|
|
156
156
|
registerSpinnerVars();
|
|
157
157
|
|
|
158
158
|
/**
|
|
159
|
-
* Pin every ring's
|
|
160
|
-
*
|
|
159
|
+
* Pin every ring's rotation to the document timeline's origin instead of its
|
|
160
|
+
* own start time, so spinners mounted seconds apart stay in phase.
|
|
161
161
|
*
|
|
162
|
-
* Setting `startTime` is exact where arithmetic on a clock read is not
|
|
162
|
+
* Setting `startTime` is exact where arithmetic on a clock read is not. A
|
|
163
163
|
* negative `animation-delay` computed at mount is only as good as the gap
|
|
164
|
-
* between
|
|
165
|
-
*
|
|
166
|
-
* literal rotation; the same drift risk applies to the dash offset now).
|
|
164
|
+
* between the clock read and the frame the animation starts in. At 10x CPU
|
|
165
|
+
* throttling that gap measured 116 degrees of drift.
|
|
167
166
|
*
|
|
168
|
-
*
|
|
169
|
-
*
|
|
170
|
-
*
|
|
171
|
-
*
|
|
167
|
+
* Rotors are collected and pinned in one frame. `getAnimations()` resolves
|
|
168
|
+
* style, and `startTime` dirties it again. So pinning them one at a time makes
|
|
169
|
+
* each mount re-force what the previous one invalidated: 53 style recalcs for
|
|
170
|
+
* 38 spinners, against 19 batched.
|
|
172
171
|
*/
|
|
173
|
-
const
|
|
172
|
+
const pendingRotors = new Set();
|
|
174
173
|
let flushScheduled = false;
|
|
175
|
-
function
|
|
174
|
+
function pinRotorsToTimelineOrigin() {
|
|
176
175
|
flushScheduled = false;
|
|
177
176
|
const animations = [];
|
|
178
|
-
for (const
|
|
179
|
-
|
|
180
|
-
// this ref sits on (#6253), so it needs subtree:true to be found here.
|
|
181
|
-
animations.push(...svg.getAnimations({
|
|
182
|
-
subtree: true
|
|
183
|
-
}));
|
|
177
|
+
for (const rotor of pendingRotors) {
|
|
178
|
+
animations.push(...rotor.getAnimations());
|
|
184
179
|
}
|
|
185
|
-
|
|
180
|
+
pendingRotors.clear();
|
|
186
181
|
for (const animation of animations) {
|
|
187
182
|
animation.startTime = 0;
|
|
188
183
|
}
|
|
189
184
|
}
|
|
190
185
|
|
|
191
186
|
/**
|
|
192
|
-
* Ref callback for the
|
|
187
|
+
* Ref callback for the rotor: the one place a mounted ring touches the DOM.
|
|
193
188
|
*
|
|
194
189
|
* It reads nothing back — the geometry is resolved by the cascade, not in JS.
|
|
195
190
|
*/
|
|
196
|
-
function syncRotationPhase(
|
|
197
|
-
if (
|
|
191
|
+
function syncRotationPhase(rotor) {
|
|
192
|
+
if (rotor == null) {
|
|
198
193
|
return undefined;
|
|
199
194
|
}
|
|
200
195
|
// jsdom implements no Web Animations, and this runs in every consumer's
|
|
201
196
|
// component tests.
|
|
202
|
-
if (typeof
|
|
197
|
+
if (typeof rotor.getAnimations !== 'function') {
|
|
203
198
|
return undefined;
|
|
204
199
|
}
|
|
205
|
-
|
|
200
|
+
pendingRotors.add(rotor);
|
|
206
201
|
if (!flushScheduled) {
|
|
207
202
|
flushScheduled = true;
|
|
208
|
-
requestAnimationFrame(
|
|
203
|
+
requestAnimationFrame(pinRotorsToTimelineOrigin);
|
|
209
204
|
}
|
|
210
205
|
return () => {
|
|
211
|
-
|
|
206
|
+
pendingRotors.delete(rotor);
|
|
212
207
|
};
|
|
213
208
|
}
|
|
214
209
|
|
|
@@ -217,17 +212,11 @@ function syncRotationPhase(svg) {
|
|
|
217
212
|
// =============================================================================
|
|
218
213
|
|
|
219
214
|
/**
|
|
220
|
-
*
|
|
221
|
-
*
|
|
222
|
-
*
|
|
223
|
-
* angle, which reads as a visible wobble on iOS Safari independent of
|
|
224
|
-
* compositing (#6253) — confirmed by a real-device test against this exact
|
|
225
|
-
* fix, since `willChange`/layer promotion alone (the earlier fix for #3617)
|
|
226
|
-
* only smooths the rotation's motion, not the per-frame stroke rasterization.
|
|
227
|
-
* A static circle with an animated `stroke-dashoffset` never rotates, so
|
|
228
|
-
* WebKit never re-rasterizes the cap at an intermediate angle at all.
|
|
215
|
+
* A `transform` animation runs on the compositor, so the ring keeps turning
|
|
216
|
+
* while a script runs. A `stroke-dashoffset` animation would repaint the arc
|
|
217
|
+
* on the main thread every frame, so it would stop while a script runs.
|
|
229
218
|
*/
|
|
230
|
-
const
|
|
219
|
+
const rotation = "xqng64z-B";
|
|
231
220
|
|
|
232
221
|
// =============================================================================
|
|
233
222
|
// Styles
|
|
@@ -412,7 +401,7 @@ export function Spinner({
|
|
|
412
401
|
// localized default. The fallback is AT-facing text, so it goes through the
|
|
413
402
|
// translation runtime like visible text does.
|
|
414
403
|
const resolvedAriaLabel = ariaLabel ?? (typeof label === 'string' ? label : undefined) ?? t('@astryx.spinner.loading');
|
|
415
|
-
const spinner = /*#__PURE__*/
|
|
404
|
+
const spinner = /*#__PURE__*/_jsxs("span", {
|
|
416
405
|
ref: hasLabel ? undefined : ref,
|
|
417
406
|
role: "status",
|
|
418
407
|
"aria-label": namedByVisibleLabel ? undefined : resolvedAriaLabel,
|
|
@@ -441,35 +430,48 @@ export function Spinner({
|
|
|
441
430
|
width: `var(${BOX_SIZE}, ${frameSize}px)`,
|
|
442
431
|
height: `var(${BOX_SIZE}, ${frameSize}px)`
|
|
443
432
|
}),
|
|
444
|
-
children: /*#__PURE__*/
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
height: frameSize,
|
|
433
|
+
children: [/*#__PURE__*/_jsx("svg", {
|
|
434
|
+
width: 0,
|
|
435
|
+
height: 0,
|
|
448
436
|
"aria-hidden": "true",
|
|
449
437
|
...{
|
|
450
|
-
className: "xlp1x4z x1lliihq x6v0vjy x7yyq19 x1rea2x4"
|
|
438
|
+
className: "xlp1x4z x1lliihq x15r89dc x6v0vjy x7yyq19 x1rea2x4"
|
|
451
439
|
},
|
|
452
|
-
children:
|
|
440
|
+
children: /*#__PURE__*/_jsx("circle", {
|
|
453
441
|
cx: "50%",
|
|
454
442
|
cy: "50%",
|
|
455
443
|
r: diameter / 2,
|
|
456
444
|
strokeWidth: border,
|
|
457
445
|
...stylex.props(styles.circle, styles.track, trackOpacityStyles[shade])
|
|
458
|
-
})
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
,
|
|
467
|
-
|
|
446
|
+
})
|
|
447
|
+
}), /*#__PURE__*/_jsx("span", {
|
|
448
|
+
ref: syncRotationPhase,
|
|
449
|
+
"aria-hidden": "true",
|
|
450
|
+
...{
|
|
451
|
+
className: "x1lliihq x15r89dc x6v0vjy x7yyq19 x1so62im x1qcljrn xnh0sag xa4qsjk x1ka1v4i x1esw782"
|
|
452
|
+
},
|
|
453
|
+
children: /*#__PURE__*/_jsx("svg", {
|
|
454
|
+
width: frameSize,
|
|
455
|
+
height: frameSize,
|
|
468
456
|
...{
|
|
469
|
-
className: "
|
|
470
|
-
}
|
|
471
|
-
|
|
472
|
-
|
|
457
|
+
className: "xlp1x4z x1lliihq x15r89dc x6v0vjy x7yyq19 x1rea2x4"
|
|
458
|
+
},
|
|
459
|
+
children: /*#__PURE__*/_jsx("circle", {
|
|
460
|
+
cx: "50%",
|
|
461
|
+
cy: "50%",
|
|
462
|
+
r: diameter / 2,
|
|
463
|
+
strokeWidth: border
|
|
464
|
+
// The size's own dash, for the render with no stylesheet. The rule
|
|
465
|
+
// above composes the same lengths from the resolved diameter, so a
|
|
466
|
+
// themed ring keeps this fraction of arc rather than this length.
|
|
467
|
+
,
|
|
468
|
+
strokeDasharray: `${arcLength} ${circumference - arcLength}`,
|
|
469
|
+
...{
|
|
470
|
+
className: "xbh8q5q x1764fhq x1g0ag68 x1owpc8m xio8zfp xgw3ha0 xtve3lm x9tu13d xdv9ggb"
|
|
471
|
+
}
|
|
472
|
+
})
|
|
473
|
+
})
|
|
474
|
+
})]
|
|
473
475
|
});
|
|
474
476
|
if (!hasLabel) {
|
|
475
477
|
return spinner;
|
|
@@ -20,7 +20,7 @@ import { getGestureHost } from "../gestures/GestureHost.js";
|
|
|
20
20
|
import { createPressTracker } from "../gestures/PressTracker.js";
|
|
21
21
|
import { isRtlElement } from "../hooks/isRtlElement.js";
|
|
22
22
|
import { useIsomorphicLayoutEffect } from "../hooks/useIsomorphicLayoutEffect.js";
|
|
23
|
-
import {
|
|
23
|
+
import { createMotionAnimator } from "../motion/animator.js";
|
|
24
24
|
import { solveSpring, toSpring } from "../motion/spring.js";
|
|
25
25
|
import { UIKIT_GESTURES } from "../motion/uikit/gestures.js";
|
|
26
26
|
import { registerSwitchTable, switchControl } from "../motion/uikit/switch.js";
|
|
@@ -203,10 +203,10 @@ export class SwitchTouchController {
|
|
|
203
203
|
return;
|
|
204
204
|
}
|
|
205
205
|
registerSwitchTable();
|
|
206
|
-
this.thumb =
|
|
206
|
+
this.thumb = createMotionAnimator(elements.thumb);
|
|
207
207
|
// The layer rests clear (its class's opacity 0) while the visuals show
|
|
208
208
|
// the value; from here its opacity is the animator's.
|
|
209
|
-
this.fade =
|
|
209
|
+
this.fade = createMotionAnimator(elements.track, {
|
|
210
210
|
pseudoElement: '::after',
|
|
211
211
|
initial: {
|
|
212
212
|
opacity: 0
|
|
@@ -215,7 +215,7 @@ export class SwitchTouchController {
|
|
|
215
215
|
this.fade.set({
|
|
216
216
|
opacity: 0
|
|
217
217
|
});
|
|
218
|
-
this.shadow =
|
|
218
|
+
this.shadow = createMotionAnimator(elements.thumb, {
|
|
219
219
|
pseudoElement: '::after',
|
|
220
220
|
initial: {
|
|
221
221
|
opacity: 0
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseTable.d.ts","sourceRoot":"","sources":["../../src/Table/BaseTable.tsx"],"names":[],"mappings":"AAGA;;;;;;;;;;;GAWG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"BaseTable.d.ts","sourceRoot":"","sources":["../../src/Table/BaseTable.tsx"],"names":[],"mappings":"AAGA;;;;;;;;;;;GAWG;AAEH,OAAO,EAIL,KAAK,YAAY,EAEjB,KAAK,GAAG,EACT,MAAM,OAAO,CAAC;AAIf,OAAO,KAAK,EACV,cAAc,EAYf,MAAM,SAAS,CAAC;AAkpBjB;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,SAAS,EAAqB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC3E,KAAK,EAAE,cAAc,CAAC,CAAC,CAAC,GAAG;IAAC,GAAG,CAAC,EAAE,GAAG,CAAC,gBAAgB,CAAC,CAAA;CAAC,KACrD,YAAY,CAAC"}
|