@astryx-vue/core 0.27.0 → 0.28.1
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/index.js +1 -1
- package/dist/{AlertDialog-CGGkPG4T.js → AlertDialog-B195FgtL.js} +2 -2
- package/dist/AppShell/index.d.ts +1 -1
- package/dist/AppShell/index.js +1 -1
- package/dist/{AppShell-DGJgCvS6.js → AppShell-CxUmt6hX.js} +4 -4
- package/dist/AvatarGroup/index.d.ts +1 -1
- package/dist/Banner/index.d.ts +1 -1
- package/dist/BottomSheet/index.d.ts +1 -1
- package/dist/BottomSheet/index.js +2 -2
- package/dist/{BottomSheet-gctYQ3sV.js → BottomSheet-D3893Ymj.js} +33 -9
- package/dist/{BottomSheet-Dn8gpT4m.js → BottomSheet-DVe5Nw9Z.js} +111 -25
- package/dist/Breadcrumbs/index.d.ts +2 -2
- package/dist/Breadcrumbs/index.js +2 -2
- package/dist/{Breadcrumbs-Bt6Pp3gV.js → Breadcrumbs-CQa-Jjnn.js} +1 -1
- package/dist/Button/index.d.ts +1 -1
- package/dist/ButtonGroup/index.d.ts +1 -1
- package/dist/Calendar/index.d.ts +1 -1
- package/dist/Card/index.d.ts +1 -1
- package/dist/Carousel/index.d.ts +1 -1
- package/dist/Chat/index.d.ts +1 -1
- package/dist/Chat/index.js +1 -1
- package/dist/CheckboxInput/index.d.ts +1 -1
- package/dist/CheckboxList/index.d.ts +1 -1
- package/dist/CheckboxList/index.js +1 -1
- package/dist/{CheckboxList-CWHlG8Jq.js → CheckboxList-DGM-cgX5.js} +2 -2
- package/dist/ClickableCard/index.d.ts +1 -1
- package/dist/ClickableCard/index.js +1 -1
- package/dist/Code/index.d.ts +1 -1
- package/dist/Collapsible/index.d.ts +1 -1
- package/dist/Collapsible/index.js +1 -1
- package/dist/{Collapsible-BSRdsb6w.js → Collapsible-B2vrr_YP.js} +2 -2
- package/dist/ComplexSelector/index.js +1 -1
- package/dist/{ComplexSelector-DI3J30Ho.js → ComplexSelector-CZiUA6Gm.js} +1 -1
- package/dist/ContextMenu/index.d.ts +2 -2
- package/dist/ContextMenu/index.js +2 -2
- package/dist/{ContextMenu-CVf4OqJP.js → ContextMenu-8I420g7H.js} +2 -2
- package/dist/DateInput/index.d.ts +1 -1
- package/dist/DateInput/index.js +1 -1
- package/dist/{DateInput-DK-FI37x.js → DateInput-KZF_A_31.js} +2 -2
- package/dist/DateRangeInput/index.d.ts +1 -1
- package/dist/DateRangeInput/index.js +1 -1
- package/dist/{DateRangeInput-ClriBc4F.js → DateRangeInput-4GCWgLFN.js} +1 -1
- package/dist/DateTimeInput/index.d.ts +1 -1
- package/dist/DateTimeInput/index.js +1 -1
- package/dist/{DateTimeInput-BdXkBBYi.js → DateTimeInput-BGcdOmRp.js} +3 -3
- package/dist/Dialog/index.d.ts +1 -1
- package/dist/Divider/index.d.ts +1 -1
- package/dist/Drawer/index.d.ts +1 -1
- package/dist/DropdownMenu/index.d.ts +2 -2
- package/dist/DropdownMenu/index.js +3 -3
- package/dist/{DropdownMenu-NIGjTT7o.js → DropdownMenu-B-dBiomz.js} +3 -3
- package/dist/{DropdownMenu-CmbnIRug.js → DropdownMenu-CSqkl-Xl.js} +3 -3
- package/dist/{DropdownMenuRadioItem.vue-DINRx71W.d.ts → DropdownMenuRadioItem.vue-C8rePTyz.d.ts} +1 -1
- package/dist/Heading/index.d.ts +1 -1
- package/dist/InfoTip/index.d.ts +1 -1
- package/dist/{Item-DUI1Qnnd.js → Item-C8UAQwFQ.js} +193 -111
- package/dist/Link/index.d.ts +1 -1
- package/dist/List/index.d.ts +2 -2
- package/dist/List/index.js +2 -2
- package/dist/{ListItem-C8SqSrU6.js → ListItem-BlrEngDO.js} +11 -3
- package/dist/MobileNav/index.js +1 -1
- package/dist/{MobileNavToggle-Dx7rmb-V.js → MobileNavToggle-D5yGMHU4.js} +1 -1
- package/dist/MoreMenu/index.d.ts +1 -1
- package/dist/MoreMenu/index.js +1 -1
- package/dist/{MoreMenu-vavlbJ-p.js → MoreMenu-GPcHAauX.js} +1 -1
- package/dist/MultiSelector/index.d.ts +1 -1
- package/dist/MultiSelector/index.js +1 -1
- package/dist/{MultiSelector-BUXFzIla.js → MultiSelector-BSA613nO.js} +1 -1
- package/dist/NavItem/index.d.ts +1 -1
- package/dist/NavItem/index.js +1 -1
- package/dist/NumberInput/index.d.ts +1 -1
- package/dist/Outline/index.js +1 -1
- package/dist/{Outline-DvQbXc_H.js → Outline-DI9MZnuQ.js} +106 -50
- package/dist/OverflowList/index.d.ts +1 -1
- package/dist/Pagination/index.d.ts +1 -1
- package/dist/Pagination/index.js +1 -1
- package/dist/{Pagination-CRrou1P-.js → Pagination-DWfvdCpK.js} +2 -2
- package/dist/Popover/index.d.ts +1 -1
- package/dist/Popover/index.js +1 -1
- package/dist/{Popover-sERt08TR.js → Popover-CB5UYJZc.js} +3 -3
- package/dist/PowerSearch/index.d.ts +1 -1
- package/dist/PowerSearch/index.js +1 -1
- package/dist/{PowerSearch-CUY0iULe.js → PowerSearch-BW0jBC1d.js} +7 -7
- package/dist/ProgressBar/index.d.ts +1 -1
- package/dist/Radio/index.d.ts +1 -1
- package/dist/RadioList/index.d.ts +1 -1
- package/dist/ScrollableArea/index.d.ts +1 -1
- package/dist/SelectableCard/index.d.ts +1 -1
- package/dist/Selector/index.d.ts +1 -1
- package/dist/Selector/index.js +1 -1
- package/dist/{Selector-Bj4q6aT5.js → Selector-4sexgsUO.js} +2 -2
- package/dist/SideNav/index.d.ts +1 -1
- package/dist/SideNav/index.js +2 -2
- package/dist/{SideNav-CHSwzwTt.js → SideNav-B_0Fv-ZU.js} +4 -4
- package/dist/Stack/index.d.ts +1 -1
- package/dist/Switch/index.d.ts +1 -1
- package/dist/TabList/index.d.ts +1 -1
- package/dist/Table/index.d.ts +1 -1
- package/dist/Table/index.js +1 -1
- package/dist/{Table-B7MHrvdy.js → Table-CRLL1RGr.js} +8 -8
- package/dist/Text/index.d.ts +1 -1
- package/dist/TextArea/index.d.ts +1 -1
- package/dist/TextInput/index.d.ts +1 -1
- package/dist/{TimeField-hB88chlQ.js → TimeField-B83zAjAA.js} +1 -1
- package/dist/TimeInput/index.d.ts +1 -1
- package/dist/TimeInput/index.js +1 -1
- package/dist/{TimeInput-JrTs9r66.js → TimeInput-BoIZG-dF.js} +1 -1
- package/dist/Timer/index.d.ts +1 -1
- package/dist/Timestamp/index.d.ts +1 -1
- package/dist/ToggleButton/index.d.ts +1 -1
- package/dist/Token/index.d.ts +1 -1
- package/dist/Tokenizer/index.d.ts +1 -1
- package/dist/Tokenizer/index.js +1 -1
- package/dist/{Tokenizer-iJb-WZ55.js → Tokenizer-DrkIayoF.js} +1 -1
- package/dist/Toolbar/index.d.ts +1 -1
- package/dist/TopNav/index.d.ts +1 -1
- package/dist/TopNav/index.js +1 -1
- package/dist/{TopNav-Ce79A3zT.js → TopNav-Rcz2zriX.js} +2 -2
- package/dist/TreeList/index.js +1 -1
- package/dist/{TreeList-BEPHdVYu.js → TreeList-Dh0uAj2B.js} +48 -7
- package/dist/Typeahead/index.d.ts +1 -1
- package/dist/{animator-BooLoGyI.js → animator-BGq5a6vT.js} +4 -300
- package/dist/{batch-CM-vJhQg.js → batch-BhaAWUIt.js} +3 -2
- package/dist/{bezier-Cts7gENO.js → bezier-Df-yGuNZ.js} +1 -90
- package/dist/composables/index.d.ts +1 -1
- package/dist/composables/index.js +3 -2
- package/dist/{composables-BtqijTIO.js → composables-BTRbNgmR.js} +4 -41
- package/dist/{context-DH8E-qjm.js → context-jtpQfR6F.js} +1 -1
- package/dist/{edge-BYXwSggM.js → edge-CJIswPTX.js} +1 -1
- package/dist/{edgeRide-B5mlN2Q4.js → edgeRide-Drk4V-MC.js} +2 -2
- package/dist/{index-BD-Pxni9.d.ts → index--kbwaSXW.d.ts} +2 -2
- package/dist/{index-BO8V3n98.d.ts → index-0COIBuxA.d.ts} +61 -61
- package/dist/{index-DogWVRJi.d.ts → index-0RIgvtdm.d.ts} +1 -1
- package/dist/{index-X4S7_dmq.d.ts → index-BA8exXNP.d.ts} +1 -1
- package/dist/{index-BR3MOBYd.d.ts → index-BgT6mH3U.d.ts} +2 -2
- package/dist/{index-tpkJfk6X.d.ts → index-Bh-GqMzd.d.ts} +7 -0
- package/dist/{index-Bu4R0WZA.d.ts → index-BqQlY3fL.d.ts} +2 -2
- package/dist/{index-waTkqxTz.d.ts → index-C89cIh4E.d.ts} +1 -1
- package/dist/{index-D05JGsT3.d.ts → index-C8wfe0Mr.d.ts} +1 -1
- package/dist/{index-CRtGmCHi.d.ts → index-CEtFUoIm.d.ts} +1 -1
- package/dist/{index-YKCx03zD.d.ts → index-COgrQZIL.d.ts} +2 -2
- package/dist/{index-Bgk1Rj2A.d.ts → index-CTjkJP4x.d.ts} +1 -1
- package/dist/{index-BO9TY87G.d.ts → index-CUuUoX3h.d.ts} +6 -4
- package/dist/{index-FeZXsFO-.d.ts → index-CbA8rR_b.d.ts} +2 -2
- package/dist/{index-Bzi3A980.d.ts → index-ChqMaV6N.d.ts} +1 -1
- package/dist/{index-C4EuWBql.d.ts → index-ClJINYPl.d.ts} +3 -3
- package/dist/{index-rdwI-mcm.d.ts → index-CtYlR9Cu.d.ts} +1 -1
- package/dist/{index-T5bzxQ30.d.ts → index-DCyYldjP.d.ts} +1 -1
- package/dist/{index-DDVCVpnG.d.ts → index-DE-QPNz0.d.ts} +1 -1
- package/dist/{index-CVNtRsJb.d.ts → index-DW_ASIiu.d.ts} +2 -2
- package/dist/{index-SI2AkpMU.d.ts → index-GyRgg1-v.d.ts} +5 -5
- package/dist/{index-B-oy8Ko6.d.ts → index-MBiq-7Np.d.ts} +6 -6
- package/dist/{index-CfPgindd.d.ts → index-ZKBj_1nu.d.ts} +2 -2
- package/dist/{index-Ea2V_FSK.d.ts → index-aHC2C89h.d.ts} +4 -4
- package/dist/{index-Cm36VS1A.d.ts → index-mK1ICsVg.d.ts} +2 -2
- package/dist/{index-ql9ApSTF.d.ts → index-yQc-te9a.d.ts} +2 -2
- package/dist/index.d.ts +29 -29
- package/dist/index.js +38 -37
- package/dist/{landing-B9Uvex6x.js → landing-CBaXCGEg.js} +2 -2
- package/dist/{lazyBottomSheet-CxEu25bK.js → lazyBottomSheet-BK8yIqcZ.js} +1 -1
- package/dist/resolveMotion-CurhYTVC.js +307 -0
- package/dist/{themeTiming-CWEvdh31.js → themeTiming-BFDOPRjK.js} +1 -1
- package/dist/timing-CSHWQbTJ.js +90 -0
- package/dist/{types-Gw2OjSK9.d.ts → types-ClOMFbqC.d.ts} +2 -2
- package/dist/useAnimatedLayout-DC2l3WrE.js +40 -0
- package/dist/{useMenuDrillIn-CP0P49ej.js → useMenuDrillIn-BQx6lQMz.js} +1 -1
- package/dist/{useRestoreFocus-AeZABFZN.js → useRestoreFocus-DS7uQWok.js} +1 -1
- package/package.json +1 -1
- package/styles/bottom-sheet.css +26 -5
- package/styles/date-input.css +2 -3
- package/styles/list.css +102 -5
- package/styles/metadata-list.css +6 -1
- package/styles/outline.css +2 -1
- package/dist/{Chat-RE_6Ez79.js → Chat-Bg1IuDMt.js} +1 -1
- package/dist/{ClickableCard-CwGxO0GU.js → ClickableCard-ChmOwgYq.js} +1 -1
- package/dist/{NavItem-c1ScHEJY.js → NavItem-kj9FbbFS.js} +1 -1
- package/dist/{index-BqhgeAT4.d.ts → index-D8lv2BiD.d.ts} +1 -1
|
@@ -0,0 +1,307 @@
|
|
|
1
|
+
import { b as isSpring, h as motionRoleOf, m as motionRoleIn } from "./pressGesture-BzIBmKF2.js";
|
|
2
|
+
//#region src/motion/engine/constants.ts
|
|
3
|
+
const PROPERTIES = [
|
|
4
|
+
"x",
|
|
5
|
+
"y",
|
|
6
|
+
"rotate",
|
|
7
|
+
"scaleX",
|
|
8
|
+
"scaleY",
|
|
9
|
+
"opacity"
|
|
10
|
+
];
|
|
11
|
+
/** The axes momentum moves: `decay` takes only these (DR2, DEC-2). */
|
|
12
|
+
const DECAY_PROPERTIES = ["x", "y"];
|
|
13
|
+
const IDENTITY = {
|
|
14
|
+
x: 0,
|
|
15
|
+
y: 0,
|
|
16
|
+
rotate: 0,
|
|
17
|
+
scaleX: 1,
|
|
18
|
+
scaleY: 1,
|
|
19
|
+
opacity: 1
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Keyframes are added until linear interpolation is within this: a quarter of
|
|
23
|
+
* a device pixel (this quarter of a CSS pixel, divided by the device pixel
|
|
24
|
+
* ratio where it is above 1), a twentieth of a degree, a 2000th of the size,
|
|
25
|
+
* about one step of an 8-bit alpha. Every one is below what a moving element
|
|
26
|
+
* can show.
|
|
27
|
+
*/
|
|
28
|
+
const SAMPLE_TOLERANCE = {
|
|
29
|
+
x: .25,
|
|
30
|
+
y: .25,
|
|
31
|
+
rotate: .05,
|
|
32
|
+
scaleX: 5e-4,
|
|
33
|
+
scaleY: 5e-4,
|
|
34
|
+
opacity: .004
|
|
35
|
+
};
|
|
36
|
+
/** Keyframes start on this grid (ms) and are split where the curve needs it. */
|
|
37
|
+
const SAMPLE_GRID_MS = 1e3 / 30;
|
|
38
|
+
/** A curve that has not settled by then (an undamped spring) snaps. */
|
|
39
|
+
const MAX_DURATION_MS = 3e4;
|
|
40
|
+
/**
|
|
41
|
+
* How close a spring's target and a value must be to count as the same, in
|
|
42
|
+
* the property's own units. Only float rounding separates two ways of
|
|
43
|
+
* computing one value, far below anything the screen shows.
|
|
44
|
+
*/
|
|
45
|
+
const SAME_VALUE = 1e-6;
|
|
46
|
+
/** Above this many keyframes the tolerance is relaxed. */
|
|
47
|
+
const MAX_KEYFRAMES = 1200;
|
|
48
|
+
/**
|
|
49
|
+
* The keyframes hold the end state this long after a curve ends. An engine
|
|
50
|
+
* whose compositor ends an animation while the main thread is blocked falls
|
|
51
|
+
* back to the value its main thread last committed, the curve's start
|
|
52
|
+
* (WebKit on Linux); the hold keeps the end state on screen through any such
|
|
53
|
+
* block. It only stretches the last keyframe. The main thread retires the
|
|
54
|
+
* animation as soon as it runs after the curve's end.
|
|
55
|
+
*
|
|
56
|
+
* Why a tail inside the curve's own animation, with a bound (measured Oct 24
|
|
57
|
+
* 2026; do not replace it without these proofs):
|
|
58
|
+
* - WebKit on Linux (WebKitGTK and WPE) ignores `fill` on its compositor:
|
|
59
|
+
* a 400 ms move that ends during a 1 s main-thread block snaps back to the
|
|
60
|
+
* block-start position 13 ms after its end, with `fill: forwards` or with
|
|
61
|
+
* no fill, and holds with this tail. iOS 26.2 Mobile Safari holds the end
|
|
62
|
+
* in all three forms, so there the tail is unneeded but harmless (measured
|
|
63
|
+
* Oct 25 2026). The browser proof "a spring that ends inside the block
|
|
64
|
+
* keeps showing its end state" catches it.
|
|
65
|
+
* - A separate static animation of the end state under the curve would hold
|
|
66
|
+
* it without a bound, but two animations on one property push Chromium to
|
|
67
|
+
* run the curve on the main thread: the 1 s block proof moved in 0 of 57
|
|
68
|
+
* frames, the start-before-a-block proof failed, and seeking the curve
|
|
69
|
+
* broke.
|
|
70
|
+
*/
|
|
71
|
+
const END_HOLD_MS = 6e4;
|
|
72
|
+
/**
|
|
73
|
+
* The soonest a running animation's end is looked for again, ms: a frame at
|
|
74
|
+
* 60 Hz. WebKit moves an animation's currentTime once per frame, so a look
|
|
75
|
+
* within a frame reads the frame's time, a fraction of a ms short of the end,
|
|
76
|
+
* and a timer for that fraction would fire again before anything moved.
|
|
77
|
+
*/
|
|
78
|
+
const END_RECHECK_MS = 1e3 / 60;
|
|
79
|
+
const CHANNELS = {
|
|
80
|
+
translate: ["x", "y"],
|
|
81
|
+
rotate: ["rotate"],
|
|
82
|
+
scale: ["scaleX", "scaleY"],
|
|
83
|
+
opacity: ["opacity"]
|
|
84
|
+
};
|
|
85
|
+
const CHANNEL_OF = {
|
|
86
|
+
x: "translate",
|
|
87
|
+
y: "translate",
|
|
88
|
+
rotate: "rotate",
|
|
89
|
+
scaleX: "scale",
|
|
90
|
+
scaleY: "scale",
|
|
91
|
+
opacity: "opacity"
|
|
92
|
+
};
|
|
93
|
+
/** What `inlineText` writes for each channel at identity. */
|
|
94
|
+
const IDENTITY_TEXT = {
|
|
95
|
+
translate: "none",
|
|
96
|
+
rotate: "none",
|
|
97
|
+
scale: "none",
|
|
98
|
+
opacity: "1"
|
|
99
|
+
};
|
|
100
|
+
/**
|
|
101
|
+
* The transition `decay` hands a Reduce Motion transition curve to: under
|
|
102
|
+
* Reduce Motion `animate` plays no spring (a cross-fade, or at once), so the
|
|
103
|
+
* spring itself is never solved.
|
|
104
|
+
*/
|
|
105
|
+
const REDUCED_TRANSITION = { spring: {
|
|
106
|
+
duration: .5,
|
|
107
|
+
bounce: 0
|
|
108
|
+
} };
|
|
109
|
+
//#endregion
|
|
110
|
+
//#region src/motion/engine/cssValues.ts
|
|
111
|
+
function round(value, digits) {
|
|
112
|
+
return Number(value.toFixed(digits));
|
|
113
|
+
}
|
|
114
|
+
function format(channel, value) {
|
|
115
|
+
switch (channel) {
|
|
116
|
+
case "translate": return `${round(value("x"), 3)}px ${round(value("y"), 3)}px`;
|
|
117
|
+
case "rotate": return `${round(value("rotate"), 4)}deg`;
|
|
118
|
+
case "scale": return `${round(value("scaleX"), 5)} ${round(value("scaleY"), 5)}`;
|
|
119
|
+
case "opacity": return `${round(Math.min(1, Math.max(0, value("opacity"))), 4)}`;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Whether a computed value shows `expected` (`format`'s text). An unset or
|
|
124
|
+
* `none` value is the channel's identity. One value of a two-value channel
|
|
125
|
+
* stands for both (scale), or for x with y at 0 (translate).
|
|
126
|
+
*/
|
|
127
|
+
function sameShown(channel, shown, expected) {
|
|
128
|
+
const numbers = (text) => {
|
|
129
|
+
const list = ((text === "" || text === "none" ? IDENTITY_TEXT[channel] : text).match(/-?\d*\.?\d+(?:e-?\d+)?/g) ?? []).map(Number);
|
|
130
|
+
if (channel === "translate") return [list[0] ?? 0, list[1] ?? 0];
|
|
131
|
+
if (channel === "scale") return [list[0] ?? 1, list[1] ?? list[0] ?? 1];
|
|
132
|
+
return list.length > 0 ? list : [channel === "opacity" ? 1 : 0];
|
|
133
|
+
};
|
|
134
|
+
const a = numbers(shown);
|
|
135
|
+
const b = numbers(expected);
|
|
136
|
+
return a.length === b.length && a.every((value, i) => Math.abs(value - b[i]) < .001);
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* The inline text for a channel: `format`, except that an identity transform
|
|
140
|
+
* is written `none`. Any other value, `translate: 0px 0px` included, makes
|
|
141
|
+
* the element the containing block of its `position: fixed` descendants and
|
|
142
|
+
* a stacking context, so a motion back to identity would leave a fixed child
|
|
143
|
+
* moved with its parent; Mobile Safari also lets no finger scroll a list
|
|
144
|
+
* inside an element left at `scale: 1`. At rest the identity leaves the
|
|
145
|
+
* element entirely when its stylesheet agrees (`releaseIdentity`).
|
|
146
|
+
*/
|
|
147
|
+
function inlineText(channel, value) {
|
|
148
|
+
const at = (property, identity, digits) => round(value(property), digits) === identity;
|
|
149
|
+
switch (channel) {
|
|
150
|
+
case "translate": return at("x", 0, 3) && at("y", 0, 3) ? "none" : format(channel, value);
|
|
151
|
+
case "rotate": return at("rotate", 0, 4) ? "none" : format(channel, value);
|
|
152
|
+
case "scale": return at("scaleX", 1, 5) && at("scaleY", 1, 5) ? "none" : format(channel, value);
|
|
153
|
+
case "opacity": return format(channel, value);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
/** Whether a computed value (or an unset one) is the channel's identity. */
|
|
157
|
+
function isIdentityText(channel, text) {
|
|
158
|
+
const value = text.trim();
|
|
159
|
+
if (value === "" || value === "none") return true;
|
|
160
|
+
const numbers = value.split(/\s+/).map((part) => Number.parseFloat(part));
|
|
161
|
+
if (numbers.some((number) => !Number.isFinite(number))) return false;
|
|
162
|
+
const identity = channel === "scale" || channel === "opacity" ? 1 : 0;
|
|
163
|
+
return numbers.every((number) => Math.abs(number - identity) < 1e-6);
|
|
164
|
+
}
|
|
165
|
+
function expand(values) {
|
|
166
|
+
const out = {};
|
|
167
|
+
for (const [key, value] of Object.entries(values)) {
|
|
168
|
+
if (value == null || !Number.isFinite(value)) continue;
|
|
169
|
+
if (key === "scale") {
|
|
170
|
+
out.scaleX ??= value;
|
|
171
|
+
out.scaleY ??= value;
|
|
172
|
+
} else if (PROPERTIES.includes(key)) out[key] = value;
|
|
173
|
+
}
|
|
174
|
+
return out;
|
|
175
|
+
}
|
|
176
|
+
/** The time the motion clock reads (`performance.now()`'s time base). */
|
|
177
|
+
function motionNow() {
|
|
178
|
+
return typeof performance === "undefined" ? Date.now() : performance.now();
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Whether the user asked for reduced motion (`prefers-reduced-motion:
|
|
182
|
+
* reduce`), read at the moment of the call: the preference the animator uses
|
|
183
|
+
* by default for its Reduce Motion substitution. A component never reads it
|
|
184
|
+
* to pick a curve of its own: its motion settings do not override the
|
|
185
|
+
* policy (design:reduced-motion DR4); `animator.reducedMotion()` or
|
|
186
|
+
* `reducedMotionFade()` gives the policy's answer. False without a window
|
|
187
|
+
* (server rendering).
|
|
188
|
+
*/
|
|
189
|
+
function defaultPrefersReducedMotion() {
|
|
190
|
+
return typeof window !== "undefined" && typeof window.matchMedia === "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
191
|
+
}
|
|
192
|
+
/** Whether the primary pointer is coarse: `(pointer: coarse)`. */
|
|
193
|
+
function defaultIsCoarsePointer() {
|
|
194
|
+
return typeof window !== "undefined" && typeof window.matchMedia === "function" && window.matchMedia("(pointer: coarse)").matches;
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* Registers `name` as an inherited `<length>` (initially 0px) or `<number>`
|
|
198
|
+
* (initially 0) so keyframes interpolate it; an unregistered custom property
|
|
199
|
+
* animates in steps. A property the page already registered is left as it
|
|
200
|
+
* is.
|
|
201
|
+
*/
|
|
202
|
+
function registerCustomProperty(name, syntax) {
|
|
203
|
+
if (typeof CSS === "undefined" || typeof CSS.registerProperty !== "function") return;
|
|
204
|
+
try {
|
|
205
|
+
CSS.registerProperty({
|
|
206
|
+
name,
|
|
207
|
+
syntax,
|
|
208
|
+
inherits: true,
|
|
209
|
+
initialValue: syntax === "<length>" ? "0px" : "0"
|
|
210
|
+
});
|
|
211
|
+
} catch (error) {
|
|
212
|
+
if (!(error instanceof DOMException) || error.name !== "InvalidModificationError") throw error;
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
function expandList(properties) {
|
|
216
|
+
const out = /* @__PURE__ */ new Set();
|
|
217
|
+
for (const property of properties) if (property === "scale") {
|
|
218
|
+
out.add("scaleX");
|
|
219
|
+
out.add("scaleY");
|
|
220
|
+
} else out.add(property);
|
|
221
|
+
return [...out];
|
|
222
|
+
}
|
|
223
|
+
//#endregion
|
|
224
|
+
//#region src/motion/themeTempo.ts
|
|
225
|
+
/**
|
|
226
|
+
* @file themeTempo.ts
|
|
227
|
+
* @input An element on the page
|
|
228
|
+
* @output `themeTempo(element)`: the tempo of the theme the element is in
|
|
229
|
+
* @position Motion foundation; resolveMotion.ts scales a motion role by it,
|
|
230
|
+
* and the pager scales its settle by it, which no role names
|
|
231
|
+
*
|
|
232
|
+
* A theme that sets `tempo` writes it, clamped, to the private custom
|
|
233
|
+
* property `--_astryx-motion-tempo` beside its duration tokens. An
|
|
234
|
+
* adaptation rule writes it where its condition holds, and a nested theme
|
|
235
|
+
* that sets no tempo inherits it. A layer whose durations come from a
|
|
236
|
+
* duration scale writes a tempo of 1, so its springs keep its own pace. One
|
|
237
|
+
* read of a custom property forces no layout.
|
|
238
|
+
* Nothing here imports a theme module, runs on import or runs on the server.
|
|
239
|
+
*/
|
|
240
|
+
/** The property a theme that sets `tempo` writes (theme/themeMotion.ts). */
|
|
241
|
+
const TEMPO_PROPERTY = "--_astryx-motion-tempo";
|
|
242
|
+
/**
|
|
243
|
+
* The tempo motion on `element` plays at: the one its theme or an adaptation
|
|
244
|
+
* rule sets, else 1. Without an element in a document, or with a value that
|
|
245
|
+
* is not a positive number, it is 1.
|
|
246
|
+
*/
|
|
247
|
+
function themeTempo(element) {
|
|
248
|
+
const view = element?.ownerDocument?.defaultView;
|
|
249
|
+
if (element == null || view == null) return 1;
|
|
250
|
+
const text = view.getComputedStyle(element).getPropertyValue(TEMPO_PROPERTY).trim();
|
|
251
|
+
const tempo = text === "" ? NaN : Number(text);
|
|
252
|
+
return Number.isFinite(tempo) && tempo > 0 ? tempo : 1;
|
|
253
|
+
}
|
|
254
|
+
//#endregion
|
|
255
|
+
//#region src/motion/resolveMotion.ts
|
|
256
|
+
/**
|
|
257
|
+
* The roles the tempo leaves as measured: the parts that follow a finger,
|
|
258
|
+
* and ProgressBar's busy loop.
|
|
259
|
+
*/
|
|
260
|
+
const FIXED_ROLES = /* @__PURE__ */ new Set([
|
|
261
|
+
"springs.fingerTracking",
|
|
262
|
+
"switchControl.tracking",
|
|
263
|
+
"progress.reducedMotionPulseMs"
|
|
264
|
+
]);
|
|
265
|
+
/** Each role spring at each tempo, so a role resolves to one object per tempo. */
|
|
266
|
+
const springsAtTempo = /* @__PURE__ */ new WeakMap();
|
|
267
|
+
/**
|
|
268
|
+
* `spring` at `tempo`. In each of its forms, the undamped period grows by the
|
|
269
|
+
* tempo and the damping ratio stays. So the motion keeps its shape and takes
|
|
270
|
+
* `tempo` times as long.
|
|
271
|
+
*/
|
|
272
|
+
function springAtTempo(spring, tempo) {
|
|
273
|
+
let byTempo = springsAtTempo.get(spring);
|
|
274
|
+
if (byTempo == null) {
|
|
275
|
+
byTempo = /* @__PURE__ */ new Map();
|
|
276
|
+
springsAtTempo.set(spring, byTempo);
|
|
277
|
+
}
|
|
278
|
+
let scaled = byTempo.get(tempo);
|
|
279
|
+
if (scaled == null) {
|
|
280
|
+
if ("response" in spring) scaled = {
|
|
281
|
+
response: spring.response * tempo,
|
|
282
|
+
dampingRatio: spring.dampingRatio
|
|
283
|
+
};
|
|
284
|
+
else if ("duration" in spring) scaled = {
|
|
285
|
+
duration: spring.duration * tempo,
|
|
286
|
+
bounce: spring.bounce
|
|
287
|
+
};
|
|
288
|
+
else scaled = {
|
|
289
|
+
...spring.mass == null ? null : { mass: spring.mass },
|
|
290
|
+
stiffness: spring.stiffness / (tempo * tempo),
|
|
291
|
+
damping: spring.damping / tempo
|
|
292
|
+
};
|
|
293
|
+
byTempo.set(tempo, scaled);
|
|
294
|
+
}
|
|
295
|
+
return scaled;
|
|
296
|
+
}
|
|
297
|
+
function resolveMotion(element, leafOrGroup, key) {
|
|
298
|
+
const value = key === void 0 ? leafOrGroup : leafOrGroup[key];
|
|
299
|
+
const role = key === void 0 ? motionRoleOf(leafOrGroup) : motionRoleIn(leafOrGroup, key);
|
|
300
|
+
if (role == null || role.kind === "curve" || FIXED_ROLES.has(role.id)) return value;
|
|
301
|
+
const tempo = themeTempo(element);
|
|
302
|
+
if (tempo === 1) return value;
|
|
303
|
+
if (typeof value === "number") return value * tempo;
|
|
304
|
+
return isSpring(value) ? springAtTempo(value, tempo) : value;
|
|
305
|
+
}
|
|
306
|
+
//#endregion
|
|
307
|
+
export { REDUCED_TRANSITION as C, SAMPLE_TOLERANCE as E, PROPERTIES as S, SAMPLE_GRID_MS as T, END_RECHECK_MS as _, expandList as a, MAX_DURATION_MS as b, isIdentityText as c, round as d, sameShown as f, END_HOLD_MS as g, DECAY_PROPERTIES as h, expand as i, motionNow as l, CHANNEL_OF as m, defaultIsCoarsePointer as n, format as o, CHANNELS as p, defaultPrefersReducedMotion as r, inlineText as s, resolveMotion as t, registerCustomProperty as u, IDENTITY as v, SAME_VALUE as w, MAX_KEYFRAMES as x, IDENTITY_TEXT as y };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { _ as parseMotionRoleValue, g as parseCssEasing } from "./pressGesture-BzIBmKF2.js";
|
|
2
|
-
import { t as cubicBezier } from "./bezier-
|
|
2
|
+
import { t as cubicBezier } from "./bezier-Df-yGuNZ.js";
|
|
3
3
|
import { n as easeDefaults, t as durationDefaults } from "./motionTokenDefaults-EFzpiAF5.js";
|
|
4
4
|
import { n as normalizeTokenName } from "./tokenName-0U-WEH09.js";
|
|
5
5
|
//#region src/Theme/tokenReferences.ts
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { v as registerMotionTable } from "./pressGesture-BzIBmKF2.js";
|
|
2
|
+
//#region src/motion/reducedMotionMark.ts
|
|
3
|
+
/**
|
|
4
|
+
* @file reducedMotionMark.ts
|
|
5
|
+
* @input Whether a theme reduces motion for everyone
|
|
6
|
+
* @output reducedMotionMarkProps and setRootReducedMotionMark, which write the
|
|
7
|
+
* mark, and themeReducesMotion, which reads it
|
|
8
|
+
* @position Owner module of the private reduced-motion attribute: the only
|
|
9
|
+
* file that writes its name. A theme that reduces motion for everyone
|
|
10
|
+
* spreads the mark on its root, and the root theme sets it on `<html>`; the
|
|
11
|
+
* animator and reducedMotionFade read it as the person's Reduce Motion
|
|
12
|
+
* setting. No package entry exports it.
|
|
13
|
+
*/
|
|
14
|
+
const REDUCED_MOTION = "data-astryx-reduced-motion";
|
|
15
|
+
/**
|
|
16
|
+
* Whether the theme `element` is in reduces motion for everyone: its root,
|
|
17
|
+
* or `<html>` for the root theme, carries the mark.
|
|
18
|
+
*/
|
|
19
|
+
function themeReducesMotion(element) {
|
|
20
|
+
return element?.closest?.(`[${REDUCED_MOTION}]`) != null;
|
|
21
|
+
}
|
|
22
|
+
//#endregion
|
|
23
|
+
//#region src/motion/uikit/timing.ts
|
|
24
|
+
/**
|
|
25
|
+
* @file timing.ts
|
|
26
|
+
* @input Nothing; data only
|
|
27
|
+
* @output Exports `timing`: the non-spring clocks and curves UIKit uses
|
|
28
|
+
* (press highlight onset, flash and fade, Core Animation's named Bézier
|
|
29
|
+
* curves, the navigation bar hide/show duration, the keyboard
|
|
30
|
+
* notification duration, the Reduced Motion cross-fade)
|
|
31
|
+
* @position The timing domain of the UIKit constants table (motion/uikit)
|
|
32
|
+
*
|
|
33
|
+
* Every leaf carries one or more `@source` (apple-docs | wwdc | webkit |
|
|
34
|
+
* measured | GUESS); webkit and GUESS values also carry the `@measure` task
|
|
35
|
+
* that will confirm or replace them (MEASUREMENTS.md). uikit.test.ts
|
|
36
|
+
* enforces both.
|
|
37
|
+
*
|
|
38
|
+
* Durations are in ms (the unit of pointer-event timestamps, which these
|
|
39
|
+
* clocks are compared against); curves are cubic-bézier control points
|
|
40
|
+
* [x1, y1, x2, y2].
|
|
41
|
+
*/
|
|
42
|
+
/**
|
|
43
|
+
* The Reduce Motion fade, its own export so the animator reads it without
|
|
44
|
+
* the rest of the table (`architecture:component-style-authoring` INV6).
|
|
45
|
+
* `timing` composes it under its table paths, `reducedMotionCrossFadeMs` and
|
|
46
|
+
* `curves.move`, so their roles are unchanged.
|
|
47
|
+
*/
|
|
48
|
+
const reducedMotionCrossFade = {
|
|
49
|
+
/**
|
|
50
|
+
* The Reduced Motion cross-fade, in ms, on `curves.move`: under
|
|
51
|
+
* Reduce Motion an entrance, exit, presentation switch or state change
|
|
52
|
+
* becomes an opacity-only cross-fade of this length on a coarse pointer
|
|
53
|
+
* (design:reduced-motion DR2 caps it at 200 ms, by owner decision DEC-1
|
|
54
|
+
* of 2026-10-24, departing from UIKit's own navigation cross-fade,
|
|
55
|
+
* measured below at 0.5 s). Not a role: nothing lengthens it (DR4).
|
|
56
|
+
* @source apple-docs https://developer.apple.com/documentation/uikit/uiaccessibility/preferscrossfadetransitions
|
|
57
|
+
* (the setting)
|
|
58
|
+
* @source measured: UIKit lab (injected host app), iOS 26.2 simulator,
|
|
59
|
+
* iPhone 17 Pro, CAAnimation dump with Reduce Motion and Prefer
|
|
60
|
+
* Cross-Fade Transitions on (opacity CABasicAnimation 0.5 s,
|
|
61
|
+
* (0.42, 0, 0.58, 1)), Oct 23 2026
|
|
62
|
+
*/
|
|
63
|
+
durationMs: 200,
|
|
64
|
+
/**
|
|
65
|
+
* `easeInEaseOut`; UIKit's default curve (`UIView.AnimationCurve
|
|
66
|
+
* .easeInOut`, "the default curve for most animations").
|
|
67
|
+
* @source apple-docs https://developer.apple.com/documentation/quartzcore/camediatimingfunctionname/easeineaseout
|
|
68
|
+
* @source measured: UIKit lab (injected host app), iOS 26.2 simulator,
|
|
69
|
+
* iPhone 17 Pro, CAMediaTimingFunction read from UIView.animate,
|
|
70
|
+
* Oct 23 2026
|
|
71
|
+
*/
|
|
72
|
+
curve: [
|
|
73
|
+
.42,
|
|
74
|
+
0,
|
|
75
|
+
.58,
|
|
76
|
+
1
|
|
77
|
+
]
|
|
78
|
+
};
|
|
79
|
+
const { durationMs: reducedMotionCrossFadeMs, curve: move } = reducedMotionCrossFade;
|
|
80
|
+
const reducedMotionCrossFadeRoles = { curves: { move } };
|
|
81
|
+
/**
|
|
82
|
+
* Registers only the Reduce Motion fade's curve as its role,
|
|
83
|
+
* `timing.curves.move`, for code that reads the fade without the rest of the
|
|
84
|
+
* table (the animator, reducedMotionFade()). The fade's length is not a role.
|
|
85
|
+
*/
|
|
86
|
+
function registerReducedMotionCrossFade() {
|
|
87
|
+
registerMotionTable("timing", reducedMotionCrossFadeRoles, { roles: ["curves.move"] });
|
|
88
|
+
}
|
|
89
|
+
//#endregion
|
|
90
|
+
export { registerReducedMotionCrossFade as n, themeReducesMotion as r, reducedMotionCrossFade as t };
|
|
@@ -193,13 +193,13 @@ interface ListItemProps {
|
|
|
193
193
|
swipeBehavior?: ItemSwipeBehavior;
|
|
194
194
|
}
|
|
195
195
|
interface ListItemSlots {
|
|
196
|
-
/**
|
|
196
|
+
/** Content before the label, inside the row: an icon, an avatar, a checkbox. */
|
|
197
197
|
startContent?: () => VNodeChild;
|
|
198
198
|
/** Rich content replacing the `label` prop. */
|
|
199
199
|
label?: () => VNodeChild;
|
|
200
200
|
/** Rich content replacing the `description` prop. */
|
|
201
201
|
description?: () => VNodeChild;
|
|
202
|
-
/**
|
|
202
|
+
/** Content after the label and description, inside the row: a badge, a timestamp, a chevron. */
|
|
203
203
|
endContent?: () => VNodeChild;
|
|
204
204
|
}
|
|
205
205
|
interface ItemProps extends ListItemProps {
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { n as createAnimatedLayout } from "./handle-BazRxHwq.js";
|
|
2
|
+
import { toValue } from "vue";
|
|
3
|
+
//#region src/composables/useAnimatedLayout.ts
|
|
4
|
+
function elementOf(value) {
|
|
5
|
+
if (value == null) return null;
|
|
6
|
+
if (typeof Element !== "undefined" && value instanceof Element) return value;
|
|
7
|
+
const root = value.$el;
|
|
8
|
+
return typeof Element !== "undefined" && root instanceof Element ? root : null;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* 返回一个句柄,交给尺寸会变的组件(例如 TreeList、Collapsible)。组件尺寸变化时,
|
|
12
|
+
* 它和 `containerRef` 里排在它后面的内容按同一条动效一起滑到新位置。固定定位和吸住的
|
|
13
|
+
* 粘性元素不动,滑动从不滚动容器,并遵从「减少动态效果」。
|
|
14
|
+
*
|
|
15
|
+
* 容器在变化发生时才读,所以句柄只创建一次,之后 ref 指向别的元素也能读到。
|
|
16
|
+
* 句柄没有公开成员。服务端渲染时不碰 DOM。
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```vue
|
|
20
|
+
* <script setup lang="ts">
|
|
21
|
+
* import { useAnimatedLayout } from '@astryx-vue/core'
|
|
22
|
+
* import { useTemplateRef } from 'vue'
|
|
23
|
+
*
|
|
24
|
+
* const container = useTemplateRef<HTMLElement>('container')
|
|
25
|
+
* const animatedLayout = useAnimatedLayout({ containerRef: container })
|
|
26
|
+
* <\/script>
|
|
27
|
+
*
|
|
28
|
+
* <template>
|
|
29
|
+
* <div ref="container">
|
|
30
|
+
* <TreeList :items="items" :animated-layout="animatedLayout" />
|
|
31
|
+
* <p>备注</p>
|
|
32
|
+
* </div>
|
|
33
|
+
* </template>
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
function useAnimatedLayout({ containerRef }) {
|
|
37
|
+
return createAnimatedLayout(() => elementOf(toValue(containerRef)));
|
|
38
|
+
}
|
|
39
|
+
//#endregion
|
|
40
|
+
export { useAnimatedLayout as t };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { n as readLayerScoped, t as defineLayerScopedKey } from "./scopedProvide-C-Df7c15.js";
|
|
2
2
|
import { t as _sfc_main$4 } from "./Icon-Dk0jccgU.js";
|
|
3
3
|
import { o as useComponentMessages } from "./context-B8IEFCDR.js";
|
|
4
|
-
import { t as _sfc_main$5 } from "./Item-
|
|
4
|
+
import { t as _sfc_main$5 } from "./Item-C8UAQwFQ.js";
|
|
5
5
|
import { t as _sfc_main$6 } from "./CheckboxIndicator-fH4d-JE1.js";
|
|
6
6
|
import { a as useCompactDefinition, r as readCompactTouch } from "./presentationHold-7IkbR4d8.js";
|
|
7
7
|
import { t as dropdownMenuMessages } from "./dropdown-menu-BDu4gWwQ.js";
|
|
@@ -19,7 +19,7 @@ function useRestoreFocus(options) {
|
|
|
19
19
|
}
|
|
20
20
|
function restore() {
|
|
21
21
|
if (!isEnabled.value || !savedElement) return;
|
|
22
|
-
if (savedElement.isConnected && !savedElement.hasAttribute("disabled")) focusForLastInput(savedElement);
|
|
22
|
+
if (savedElement.isConnected && !savedElement.hasAttribute("disabled")) focusForLastInput(savedElement, options.preventScroll === true ? { preventScroll: true } : void 0);
|
|
23
23
|
savedElement = null;
|
|
24
24
|
}
|
|
25
25
|
watch(shouldRestore, (should) => {
|
package/package.json
CHANGED
package/styles/bottom-sheet.css
CHANGED
|
@@ -224,6 +224,8 @@
|
|
|
224
224
|
justify-content: center;
|
|
225
225
|
height: var(--astryx-spacing-6, 24px);
|
|
226
226
|
background-image: linear-gradient(to bottom, var(--astryx-bottom-sheet-background, var(--astryx-color-background-surface, #fff)) 60%, transparent);
|
|
227
|
+
/* WebKit can draw the bar under the body's layer while the panel's transform animates; a layer of its own keeps the pill above it. */
|
|
228
|
+
will-change: transform;
|
|
227
229
|
touch-action: pinch-zoom;
|
|
228
230
|
cursor: grab;
|
|
229
231
|
}
|
|
@@ -265,28 +267,37 @@
|
|
|
265
267
|
* Omitted `padding` reads the theme's bottom-sheet padding, then spacing 4.
|
|
266
268
|
* An explicit step replaces that chain on every edge. Bleed children read
|
|
267
269
|
* the same variables they sit inside.
|
|
270
|
+
*
|
|
271
|
+
* At the block start the box always leaves the grab bar's band (spacing 6)
|
|
272
|
+
* clear: it applies the band on top of the padding past it, and publishes
|
|
273
|
+
* only the padding past the band. A child escapes the padding, never the
|
|
274
|
+
* band, so the first row never sits under the bar; scrolled content still
|
|
275
|
+
* passes beneath it.
|
|
268
276
|
*/
|
|
269
277
|
.astryx-bottom-sheet__content {
|
|
270
278
|
box-sizing: border-box;
|
|
271
279
|
display: flow-root;
|
|
272
280
|
height: 100%;
|
|
273
|
-
min-
|
|
281
|
+
/* fit-content, not min-content: WebKit ignores min-content on a block's min-height. */
|
|
282
|
+
min-height: fit-content;
|
|
274
283
|
--_sheet-pad-inline-start: var(--astryx-bottom-sheet-padding-inline-start, var(--astryx-bottom-sheet-padding-inline, var(--astryx-bottom-sheet-padding, var(--astryx-spacing-4, 1rem))));
|
|
275
284
|
--_sheet-pad-inline-end: var(--astryx-bottom-sheet-padding-inline-end, var(--astryx-bottom-sheet-padding-inline, var(--astryx-bottom-sheet-padding, var(--astryx-spacing-4, 1rem))));
|
|
276
285
|
--_sheet-pad-block-start: var(--astryx-bottom-sheet-padding-block-start, var(--astryx-bottom-sheet-padding, var(--astryx-spacing-4, 1rem)));
|
|
277
286
|
--_sheet-pad-block-end: var(--astryx-bottom-sheet-padding-block-end, var(--astryx-bottom-sheet-padding, var(--astryx-spacing-4, 1rem)));
|
|
287
|
+
--_sheet-grab-band: var(--astryx-spacing-6, 24px);
|
|
288
|
+
--_sheet-pad-block-start-past-band: max(calc(var(--_sheet-pad-block-start) - var(--_sheet-grab-band)), 0px);
|
|
278
289
|
--container-padding-inline-start: var(--_sheet-pad-inline-start);
|
|
279
290
|
--container-padding-inline-end: var(--_sheet-pad-inline-end);
|
|
280
|
-
--container-padding-block-start: var(--_sheet-pad-block-start);
|
|
291
|
+
--container-padding-block-start: var(--_sheet-pad-block-start-past-band);
|
|
281
292
|
--container-padding-block-end: var(--_sheet-pad-block-end);
|
|
282
293
|
padding-inline: var(--container-padding-inline-start) var(--container-padding-inline-end);
|
|
283
|
-
padding-block: var(--container-padding-block-start) var(--container-padding-block-end);
|
|
294
|
+
padding-block: calc(var(--container-padding-block-start) + var(--_sheet-grab-band)) var(--container-padding-block-end);
|
|
284
295
|
--layout-padding-own-outer-x: initial;
|
|
285
296
|
--layout-padding-own-outer-y: initial;
|
|
286
297
|
--layout-padding-outer-x: var(--_sheet-pad-inline-start);
|
|
287
|
-
--layout-padding-outer-y: var(--
|
|
298
|
+
--layout-padding-outer-y: var(--container-padding-block-start);
|
|
288
299
|
--layout-padding-inner-x: var(--_sheet-pad-inline-start);
|
|
289
|
-
--layout-padding-inner-y: var(--
|
|
300
|
+
--layout-padding-inner-y: var(--container-padding-block-start);
|
|
290
301
|
}
|
|
291
302
|
|
|
292
303
|
.astryx-bottom-sheet__content[data-padding] {
|
|
@@ -358,6 +369,16 @@
|
|
|
358
369
|
-webkit-mask-image: linear-gradient(transparent, transparent);
|
|
359
370
|
}
|
|
360
371
|
|
|
372
|
+
/*
|
|
373
|
+
* A sheet that was open in the server markup opens settled after hydration:
|
|
374
|
+
* the rise and the dim collapse to the near-zero duration reduced motion
|
|
375
|
+
* uses, so their transitions still end. The first close restores the motion.
|
|
376
|
+
*/
|
|
377
|
+
.astryx-bottom-sheet-dialog[data-settled] .astryx-bottom-sheet,
|
|
378
|
+
.astryx-bottom-sheet-dialog[data-settled]::backdrop {
|
|
379
|
+
transition-duration: 0.01s;
|
|
380
|
+
}
|
|
381
|
+
|
|
361
382
|
@media (prefers-reduced-motion: reduce) {
|
|
362
383
|
.astryx-bottom-sheet {
|
|
363
384
|
transition-duration: 0.01s;
|
package/styles/date-input.css
CHANGED
|
@@ -218,12 +218,11 @@
|
|
|
218
218
|
padding: var(--astryx-spacing-3, 12px);
|
|
219
219
|
}
|
|
220
220
|
|
|
221
|
-
/*
|
|
222
|
-
面板自己的上内边距不够 24px 时,差多少这里补多少。 */
|
|
221
|
+
/* 底部面板自己在内容上方留出抓手条的 24px,选择面板的第一行已经落在它下面,不再自己补。 */
|
|
223
222
|
.astryx-date-touch,
|
|
224
223
|
.astryx-time-touch,
|
|
225
224
|
.astryx-date-time-touch-tabs {
|
|
226
|
-
padding-block-start:
|
|
225
|
+
padding-block-start: 0;
|
|
227
226
|
}
|
|
228
227
|
|
|
229
228
|
.astryx-date-time-touch .astryx-date-touch {
|