@ansh-ui/react 0.2.0 → 0.3.0
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/{chunk-RHTLNSVW.cjs → chunk-3SWO2M33.cjs} +7 -7
- package/dist/chunk-3SWO2M33.cjs.map +1 -0
- package/dist/{chunk-HO2YSF5O.js → chunk-742E5FQS.js} +3 -3
- package/dist/chunk-742E5FQS.js.map +1 -0
- package/dist/{chunk-EGG4CP7C.js → chunk-BQJ6H3HC.js} +3 -2
- package/dist/chunk-BQJ6H3HC.js.map +1 -0
- package/dist/{chunk-LDCZQP3R.js → chunk-CWYBOVCZ.js} +3 -3
- package/dist/{chunk-LDCZQP3R.js.map → chunk-CWYBOVCZ.js.map} +1 -1
- package/dist/{chunk-AVPEA5PB.cjs → chunk-IZ6T7LO3.cjs} +4 -4
- package/dist/{chunk-AVPEA5PB.cjs.map → chunk-IZ6T7LO3.cjs.map} +1 -1
- package/dist/{chunk-C32LKF23.cjs → chunk-KTLTYHAT.cjs} +3 -3
- package/dist/chunk-KTLTYHAT.cjs.map +1 -0
- package/dist/{chunk-IBXLC5IE.js → chunk-P5MRISBP.js} +19 -3
- package/dist/chunk-P5MRISBP.js.map +1 -0
- package/dist/{chunk-WGYNCSTP.cjs → chunk-PUW6BTPQ.cjs} +3 -2
- package/dist/chunk-PUW6BTPQ.cjs.map +1 -0
- package/dist/{chunk-T4AK2KLM.js → chunk-PVDQPVYF.js} +3 -3
- package/dist/{chunk-T4AK2KLM.js.map → chunk-PVDQPVYF.js.map} +1 -1
- package/dist/{chunk-6VRF7X5C.cjs → chunk-TEPQGFR4.cjs} +19 -2
- package/dist/chunk-TEPQGFR4.cjs.map +1 -0
- package/dist/{chunk-QO3E7TJS.js → chunk-WNWGYXJY.js} +4 -4
- package/dist/chunk-WNWGYXJY.js.map +1 -0
- package/dist/{chunk-C5JG6TMM.cjs → chunk-YACOHFYJ.cjs} +27 -27
- package/dist/{chunk-C5JG6TMM.cjs.map → chunk-YACOHFYJ.cjs.map} +1 -1
- package/dist/data.d.cts +2 -1
- package/dist/data.d.ts +2 -1
- package/dist/form.cjs +37 -37
- package/dist/form.d.cts +2 -1
- package/dist/form.d.ts +2 -1
- package/dist/form.js +2 -2
- package/dist/index.cjs +641 -110
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +220 -7
- package/dist/index.d.ts +220 -7
- package/dist/index.js +526 -11
- package/dist/index.js.map +1 -1
- package/dist/layout.cjs +13 -13
- package/dist/layout.d.cts +11 -2
- package/dist/layout.d.ts +11 -2
- package/dist/layout.js +1 -1
- package/dist/{motion-CQmCq6_k.d.ts → motion-DoT_sTl1.d.ts} +3 -2
- package/dist/{motion-CSX4g2N8.d.cts → motion-DsQPOsTT.d.cts} +3 -2
- package/dist/motion.cjs +19 -19
- package/dist/motion.d.cts +2 -2
- package/dist/motion.d.ts +2 -2
- package/dist/motion.js +2 -2
- package/dist/navigation.d.cts +3 -2
- package/dist/navigation.d.ts +3 -2
- package/dist/overlay.cjs +16 -16
- package/dist/overlay.d.cts +3 -2
- package/dist/overlay.d.ts +3 -2
- package/dist/overlay.js +2 -2
- package/dist/{position-DVScKcaa.d.cts → position-CW6cGpSF.d.cts} +2 -1
- package/dist/{position-DVScKcaa.d.ts → position-CW6cGpSF.d.ts} +2 -1
- package/dist/primitives.cjs +25 -21
- package/dist/primitives.d.cts +5 -4
- package/dist/primitives.d.ts +5 -4
- package/dist/primitives.js +2 -2
- package/dist/{sidebar-D-PafAXw.d.cts → sidebar-Dyt67t2z.d.cts} +2 -1
- package/dist/{sidebar-D-PafAXw.d.ts → sidebar-Dyt67t2z.d.ts} +2 -1
- package/dist/styles.css +464 -0
- package/dist/{use-observers-B9qtimrk.d.cts → use-observers-DvA7hSz4.d.cts} +10 -1
- package/dist/{use-observers-B9qtimrk.d.ts → use-observers-DvA7hSz4.d.ts} +10 -1
- package/package.json +3 -3
- package/dist/chunk-6VRF7X5C.cjs.map +0 -1
- package/dist/chunk-C32LKF23.cjs.map +0 -1
- package/dist/chunk-EGG4CP7C.js.map +0 -1
- package/dist/chunk-HO2YSF5O.js.map +0 -1
- package/dist/chunk-IBXLC5IE.js.map +0 -1
- package/dist/chunk-QO3E7TJS.js.map +0 -1
- package/dist/chunk-RHTLNSVW.cjs.map +0 -1
- package/dist/chunk-WGYNCSTP.cjs.map +0 -1
package/dist/primitives.cjs
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
var chunkOHBWBXLO_cjs = require('./chunk-OHBWBXLO.cjs');
|
|
5
|
-
var
|
|
5
|
+
var chunkKTLTYHAT_cjs = require('./chunk-KTLTYHAT.cjs');
|
|
6
6
|
var chunkXMXECSQO_cjs = require('./chunk-XMXECSQO.cjs');
|
|
7
7
|
var chunkPO5DU3FU_cjs = require('./chunk-PO5DU3FU.cjs');
|
|
8
|
-
var
|
|
8
|
+
var chunkTEPQGFR4_cjs = require('./chunk-TEPQGFR4.cjs');
|
|
9
9
|
var chunkSFU5EPSN_cjs = require('./chunk-SFU5EPSN.cjs');
|
|
10
10
|
|
|
11
11
|
|
|
@@ -36,43 +36,43 @@ Object.defineProperty(exports, "useSpringValue", {
|
|
|
36
36
|
});
|
|
37
37
|
Object.defineProperty(exports, "Presence", {
|
|
38
38
|
enumerable: true,
|
|
39
|
-
get: function () { return
|
|
39
|
+
get: function () { return chunkKTLTYHAT_cjs.Presence; }
|
|
40
40
|
});
|
|
41
41
|
Object.defineProperty(exports, "Slot", {
|
|
42
42
|
enumerable: true,
|
|
43
|
-
get: function () { return
|
|
43
|
+
get: function () { return chunkKTLTYHAT_cjs.Slot; }
|
|
44
44
|
});
|
|
45
45
|
Object.defineProperty(exports, "countElements", {
|
|
46
46
|
enumerable: true,
|
|
47
|
-
get: function () { return
|
|
47
|
+
get: function () { return chunkKTLTYHAT_cjs.countElements; }
|
|
48
48
|
});
|
|
49
49
|
Object.defineProperty(exports, "getTabbable", {
|
|
50
50
|
enumerable: true,
|
|
51
|
-
get: function () { return
|
|
51
|
+
get: function () { return chunkKTLTYHAT_cjs.getTabbable; }
|
|
52
52
|
});
|
|
53
53
|
Object.defineProperty(exports, "slotted", {
|
|
54
54
|
enumerable: true,
|
|
55
|
-
get: function () { return
|
|
55
|
+
get: function () { return chunkKTLTYHAT_cjs.slotted; }
|
|
56
56
|
});
|
|
57
57
|
Object.defineProperty(exports, "useAutoFocus", {
|
|
58
58
|
enumerable: true,
|
|
59
|
-
get: function () { return
|
|
59
|
+
get: function () { return chunkKTLTYHAT_cjs.useAutoFocus; }
|
|
60
60
|
});
|
|
61
61
|
Object.defineProperty(exports, "useFocusRestore", {
|
|
62
62
|
enumerable: true,
|
|
63
|
-
get: function () { return
|
|
63
|
+
get: function () { return chunkKTLTYHAT_cjs.useFocusRestore; }
|
|
64
64
|
});
|
|
65
65
|
Object.defineProperty(exports, "useFocusTrap", {
|
|
66
66
|
enumerable: true,
|
|
67
|
-
get: function () { return
|
|
67
|
+
get: function () { return chunkKTLTYHAT_cjs.useFocusTrap; }
|
|
68
68
|
});
|
|
69
69
|
Object.defineProperty(exports, "usePresence", {
|
|
70
70
|
enumerable: true,
|
|
71
|
-
get: function () { return
|
|
71
|
+
get: function () { return chunkKTLTYHAT_cjs.usePresence; }
|
|
72
72
|
});
|
|
73
73
|
Object.defineProperty(exports, "useRovingFocus", {
|
|
74
74
|
enumerable: true,
|
|
75
|
-
get: function () { return
|
|
75
|
+
get: function () { return chunkKTLTYHAT_cjs.useRovingFocus; }
|
|
76
76
|
});
|
|
77
77
|
Object.defineProperty(exports, "Portal", {
|
|
78
78
|
enumerable: true,
|
|
@@ -104,39 +104,43 @@ Object.defineProperty(exports, "useControllableState", {
|
|
|
104
104
|
});
|
|
105
105
|
Object.defineProperty(exports, "useElementSize", {
|
|
106
106
|
enumerable: true,
|
|
107
|
-
get: function () { return
|
|
107
|
+
get: function () { return chunkTEPQGFR4_cjs.useElementSize; }
|
|
108
108
|
});
|
|
109
109
|
Object.defineProperty(exports, "useFrameBudget", {
|
|
110
110
|
enumerable: true,
|
|
111
|
-
get: function () { return
|
|
111
|
+
get: function () { return chunkTEPQGFR4_cjs.useFrameBudget; }
|
|
112
112
|
});
|
|
113
113
|
Object.defineProperty(exports, "useInView", {
|
|
114
114
|
enumerable: true,
|
|
115
|
-
get: function () { return
|
|
115
|
+
get: function () { return chunkTEPQGFR4_cjs.useInView; }
|
|
116
116
|
});
|
|
117
117
|
Object.defineProperty(exports, "useMergedRef", {
|
|
118
118
|
enumerable: true,
|
|
119
|
-
get: function () { return
|
|
119
|
+
get: function () { return chunkTEPQGFR4_cjs.useMergedRef; }
|
|
120
120
|
});
|
|
121
121
|
Object.defineProperty(exports, "usePointer", {
|
|
122
122
|
enumerable: true,
|
|
123
|
-
get: function () { return
|
|
123
|
+
get: function () { return chunkTEPQGFR4_cjs.usePointer; }
|
|
124
124
|
});
|
|
125
125
|
Object.defineProperty(exports, "useReducedMotion", {
|
|
126
126
|
enumerable: true,
|
|
127
|
-
get: function () { return
|
|
127
|
+
get: function () { return chunkTEPQGFR4_cjs.useReducedMotion; }
|
|
128
128
|
});
|
|
129
129
|
Object.defineProperty(exports, "useScrollProgress", {
|
|
130
130
|
enumerable: true,
|
|
131
|
-
get: function () { return
|
|
131
|
+
get: function () { return chunkTEPQGFR4_cjs.useScrollProgress; }
|
|
132
132
|
});
|
|
133
133
|
Object.defineProperty(exports, "useTicker", {
|
|
134
134
|
enumerable: true,
|
|
135
|
-
get: function () { return
|
|
135
|
+
get: function () { return chunkTEPQGFR4_cjs.useTicker; }
|
|
136
|
+
});
|
|
137
|
+
Object.defineProperty(exports, "useTickerSubscriberCount", {
|
|
138
|
+
enumerable: true,
|
|
139
|
+
get: function () { return chunkTEPQGFR4_cjs.useTickerSubscriberCount; }
|
|
136
140
|
});
|
|
137
141
|
Object.defineProperty(exports, "useWindowScroll", {
|
|
138
142
|
enumerable: true,
|
|
139
|
-
get: function () { return
|
|
143
|
+
get: function () { return chunkTEPQGFR4_cjs.useWindowScroll; }
|
|
140
144
|
});
|
|
141
145
|
Object.defineProperty(exports, "assignRef", {
|
|
142
146
|
enumerable: true,
|
package/dist/primitives.d.cts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { Ref, SyntheticEvent, ReactNode, RefObject, CSSProperties } from 'react';
|
|
3
|
-
import { b as PositionResult, a as PositionOptions } from './position-
|
|
4
|
-
export { A as Align, P as Placement, R as Rect, S as Side, c as computePosition } from './position-
|
|
5
|
-
export { I as InViewOptions, u as useElementSize, a as useFrameBudget, b as useInView, c as useMergedRef, d as usePointer, e as useReducedMotion, f as useScrollProgress, g as useTicker, h as useWindowScroll } from './use-observers-
|
|
3
|
+
import { b as PositionResult, a as PositionOptions } from './position-CW6cGpSF.cjs';
|
|
4
|
+
export { A as Align, P as Placement, R as Rect, S as Side, c as computePosition } from './position-CW6cGpSF.cjs';
|
|
5
|
+
export { I as InViewOptions, u as useElementSize, a as useFrameBudget, b as useInView, c as useMergedRef, d as usePointer, e as useReducedMotion, f as useScrollProgress, g as useTicker, h as useTickerSubscriberCount, i as useWindowScroll } from './use-observers-DvA7hSz4.cjs';
|
|
6
6
|
import * as _ansh_ui_core from '@ansh-ui/core';
|
|
7
7
|
import { MotionValue, AnimationOptions, SpringOptions } from '@ansh-ui/core';
|
|
8
8
|
|
|
@@ -291,4 +291,5 @@ interface AnchoredPosition {
|
|
|
291
291
|
*/
|
|
292
292
|
declare function useAnchoredPosition(anchorRef: RefObject<HTMLElement | null>, floatingRef: RefObject<HTMLElement | null>, open: boolean, options?: AnchoredPositionOptions): AnchoredPosition;
|
|
293
293
|
|
|
294
|
-
export {
|
|
294
|
+
export { Portal, PositionOptions, PositionResult, Presence, Slot, assignRef, composeEventHandlers, countElements, cx, getLayerStack, getTabbable, mergeProps, mergeRefs, slotted, useAnchoredPosition, useAnimate, useAutoFocus, useControllableState, useDismiss, useFocusRestore, useFocusTrap, useIsMounted, useMotionStyle, useMotionValue, useMotionValueState, usePresence, useRovingFocus, useScrollLock, useSpringValue };
|
|
295
|
+
export type { AnchoredPosition, AnchoredPositionOptions, DismissOptions, PortalProps, PresenceProps, SlotProps };
|
package/dist/primitives.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { Ref, SyntheticEvent, ReactNode, RefObject, CSSProperties } from 'react';
|
|
3
|
-
import { b as PositionResult, a as PositionOptions } from './position-
|
|
4
|
-
export { A as Align, P as Placement, R as Rect, S as Side, c as computePosition } from './position-
|
|
5
|
-
export { I as InViewOptions, u as useElementSize, a as useFrameBudget, b as useInView, c as useMergedRef, d as usePointer, e as useReducedMotion, f as useScrollProgress, g as useTicker, h as useWindowScroll } from './use-observers-
|
|
3
|
+
import { b as PositionResult, a as PositionOptions } from './position-CW6cGpSF.js';
|
|
4
|
+
export { A as Align, P as Placement, R as Rect, S as Side, c as computePosition } from './position-CW6cGpSF.js';
|
|
5
|
+
export { I as InViewOptions, u as useElementSize, a as useFrameBudget, b as useInView, c as useMergedRef, d as usePointer, e as useReducedMotion, f as useScrollProgress, g as useTicker, h as useTickerSubscriberCount, i as useWindowScroll } from './use-observers-DvA7hSz4.js';
|
|
6
6
|
import * as _ansh_ui_core from '@ansh-ui/core';
|
|
7
7
|
import { MotionValue, AnimationOptions, SpringOptions } from '@ansh-ui/core';
|
|
8
8
|
|
|
@@ -291,4 +291,5 @@ interface AnchoredPosition {
|
|
|
291
291
|
*/
|
|
292
292
|
declare function useAnchoredPosition(anchorRef: RefObject<HTMLElement | null>, floatingRef: RefObject<HTMLElement | null>, open: boolean, options?: AnchoredPositionOptions): AnchoredPosition;
|
|
293
293
|
|
|
294
|
-
export {
|
|
294
|
+
export { Portal, PositionOptions, PositionResult, Presence, Slot, assignRef, composeEventHandlers, countElements, cx, getLayerStack, getTabbable, mergeProps, mergeRefs, slotted, useAnchoredPosition, useAnimate, useAutoFocus, useControllableState, useDismiss, useFocusRestore, useFocusTrap, useIsMounted, useMotionStyle, useMotionValue, useMotionValueState, usePresence, useRovingFocus, useScrollLock, useSpringValue };
|
|
295
|
+
export type { AnchoredPosition, AnchoredPositionOptions, DismissOptions, PortalProps, PresenceProps, SlotProps };
|
package/dist/primitives.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
export { useAnimate, useIsMounted, useMotionStyle, useMotionValue, useMotionValueState, useSpringValue } from './chunk-O2PX54KX.js';
|
|
3
|
-
export { Presence, Slot, countElements, getTabbable, slotted, useAutoFocus, useFocusRestore, useFocusTrap, usePresence, useRovingFocus } from './chunk-
|
|
3
|
+
export { Presence, Slot, countElements, getTabbable, slotted, useAutoFocus, useFocusRestore, useFocusTrap, usePresence, useRovingFocus } from './chunk-742E5FQS.js';
|
|
4
4
|
export { Portal, computePosition, getLayerStack, useAnchoredPosition, useDismiss, useScrollLock } from './chunk-XEP6P7E6.js';
|
|
5
5
|
export { useControllableState } from './chunk-LXCIXR5T.js';
|
|
6
|
-
export { useElementSize, useFrameBudget, useInView, useMergedRef, usePointer, useReducedMotion, useScrollProgress, useTicker, useWindowScroll } from './chunk-
|
|
6
|
+
export { useElementSize, useFrameBudget, useInView, useMergedRef, usePointer, useReducedMotion, useScrollProgress, useTicker, useTickerSubscriberCount, useWindowScroll } from './chunk-P5MRISBP.js';
|
|
7
7
|
export { assignRef, composeEventHandlers, cx, mergeProps, mergeRefs } from './chunk-H34OXXJU.js';
|
|
8
8
|
//# sourceMappingURL=primitives.js.map
|
|
9
9
|
//# sourceMappingURL=primitives.js.map
|
|
@@ -68,4 +68,5 @@ interface AppShellProps {
|
|
|
68
68
|
*/
|
|
69
69
|
declare function AppShell({ sidebar, header, children, className }: AppShellProps): react.JSX.Element;
|
|
70
70
|
|
|
71
|
-
export { AppShell as A,
|
|
71
|
+
export { AppShell as A, Sidebar as S };
|
|
72
|
+
export type { NavItem as N, AppShellProps as a, NavSection as b, SidebarProps as c };
|
|
@@ -68,4 +68,5 @@ interface AppShellProps {
|
|
|
68
68
|
*/
|
|
69
69
|
declare function AppShell({ sidebar, header, children, className }: AppShellProps): react.JSX.Element;
|
|
70
70
|
|
|
71
|
-
export { AppShell as A,
|
|
71
|
+
export { AppShell as A, Sidebar as S };
|
|
72
|
+
export type { NavItem as N, AppShellProps as a, NavSection as b, SidebarProps as c };
|
package/dist/styles.css
CHANGED
|
@@ -1294,6 +1294,353 @@
|
|
|
1294
1294
|
}
|
|
1295
1295
|
}
|
|
1296
1296
|
|
|
1297
|
+
/* ==========================================================================
|
|
1298
|
+
Motion UI — presentation components with motion of their own.
|
|
1299
|
+
|
|
1300
|
+
Split out of `components.css`, which is already ~830 lines. Everything here targets a plain
|
|
1301
|
+
`ansh-*` class or a `data-*` attribute and contains nothing React-specific, so it is shared
|
|
1302
|
+
verbatim with `@ansh-ui/vue`'s build the same way every other stylesheet in this directory is.
|
|
1303
|
+
========================================================================== */
|
|
1304
|
+
|
|
1305
|
+
/* --- Rotating headline word ---------------------------------------------- */
|
|
1306
|
+
|
|
1307
|
+
/*
|
|
1308
|
+
* Deliberately NOT `overflow: hidden` on this element. An inline-level box with clipped overflow
|
|
1309
|
+
* is baseline-aligned by its bottom margin edge rather than by its text, which drops the rotating
|
|
1310
|
+
* word below the line of the sentence containing it. The clipping happens on `__clip` instead,
|
|
1311
|
+
* which is absolutely positioned and so takes no part in baseline alignment.
|
|
1312
|
+
*/
|
|
1313
|
+
.ansh-rotate {
|
|
1314
|
+
position: relative;
|
|
1315
|
+
display: inline-block;
|
|
1316
|
+
}
|
|
1317
|
+
|
|
1318
|
+
/*
|
|
1319
|
+
* The width and baseline holder, in normal flow. `visibility: hidden` rather than `display: none`
|
|
1320
|
+
* — a display-none element contributes no size, which would defeat the point of measuring the
|
|
1321
|
+
* longest word.
|
|
1322
|
+
*/
|
|
1323
|
+
.ansh-rotate__sizer {
|
|
1324
|
+
display: grid;
|
|
1325
|
+
grid-template-areas: 'word';
|
|
1326
|
+
visibility: hidden;
|
|
1327
|
+
pointer-events: none;
|
|
1328
|
+
}
|
|
1329
|
+
|
|
1330
|
+
.ansh-rotate__ghost {
|
|
1331
|
+
grid-area: word;
|
|
1332
|
+
white-space: nowrap;
|
|
1333
|
+
}
|
|
1334
|
+
|
|
1335
|
+
.ansh-rotate__clip {
|
|
1336
|
+
position: absolute;
|
|
1337
|
+
inset: 0;
|
|
1338
|
+
overflow: hidden;
|
|
1339
|
+
}
|
|
1340
|
+
|
|
1341
|
+
.ansh-rotate__word {
|
|
1342
|
+
display: inline-block;
|
|
1343
|
+
white-space: nowrap;
|
|
1344
|
+
will-change: transform, opacity;
|
|
1345
|
+
}
|
|
1346
|
+
|
|
1347
|
+
.ansh-rotate[data-animation='slide'] .ansh-rotate__word {
|
|
1348
|
+
animation: ansh-rotate-slide var(--ansh-duration-slow, 420ms) var(--ansh-ease-emphasized) both;
|
|
1349
|
+
}
|
|
1350
|
+
|
|
1351
|
+
.ansh-rotate[data-animation='fade'] .ansh-rotate__word {
|
|
1352
|
+
animation: ansh-rotate-fade var(--ansh-duration-slow, 420ms) var(--ansh-ease-standard) both;
|
|
1353
|
+
}
|
|
1354
|
+
|
|
1355
|
+
.ansh-rotate[data-animation='flip'] .ansh-rotate__word {
|
|
1356
|
+
animation: ansh-rotate-flip var(--ansh-duration-slow, 420ms) var(--ansh-ease-emphasized) both;
|
|
1357
|
+
transform-origin: 50% 0;
|
|
1358
|
+
}
|
|
1359
|
+
|
|
1360
|
+
@keyframes ansh-rotate-slide {
|
|
1361
|
+
from {
|
|
1362
|
+
transform: translateY(100%);
|
|
1363
|
+
opacity: 0;
|
|
1364
|
+
}
|
|
1365
|
+
to {
|
|
1366
|
+
transform: translateY(0);
|
|
1367
|
+
opacity: 1;
|
|
1368
|
+
}
|
|
1369
|
+
}
|
|
1370
|
+
|
|
1371
|
+
@keyframes ansh-rotate-fade {
|
|
1372
|
+
from {
|
|
1373
|
+
opacity: 0;
|
|
1374
|
+
}
|
|
1375
|
+
to {
|
|
1376
|
+
opacity: 1;
|
|
1377
|
+
}
|
|
1378
|
+
}
|
|
1379
|
+
|
|
1380
|
+
@keyframes ansh-rotate-flip {
|
|
1381
|
+
from {
|
|
1382
|
+
transform: rotateX(-90deg);
|
|
1383
|
+
opacity: 0;
|
|
1384
|
+
}
|
|
1385
|
+
to {
|
|
1386
|
+
transform: rotateX(0);
|
|
1387
|
+
opacity: 1;
|
|
1388
|
+
}
|
|
1389
|
+
}
|
|
1390
|
+
|
|
1391
|
+
/* --- Before/after comparison --------------------------------------------- */
|
|
1392
|
+
|
|
1393
|
+
.ansh-compare {
|
|
1394
|
+
position: relative;
|
|
1395
|
+
overflow: hidden;
|
|
1396
|
+
border-radius: var(--ansh-radius-lg);
|
|
1397
|
+
/* Without this a drag that starts on the surface scrolls the page on touch instead of moving
|
|
1398
|
+
the divider — the single most common defect in comparison sliders on mobile. */
|
|
1399
|
+
touch-action: none;
|
|
1400
|
+
user-select: none;
|
|
1401
|
+
}
|
|
1402
|
+
|
|
1403
|
+
.ansh-compare__layer {
|
|
1404
|
+
position: absolute;
|
|
1405
|
+
inset: 0;
|
|
1406
|
+
}
|
|
1407
|
+
|
|
1408
|
+
.ansh-compare__layer > * {
|
|
1409
|
+
width: 100%;
|
|
1410
|
+
height: 100%;
|
|
1411
|
+
}
|
|
1412
|
+
|
|
1413
|
+
/*
|
|
1414
|
+
* The revealed layer sits above and is clipped. Clipping rather than resizing is what keeps its
|
|
1415
|
+
* contents from reflowing as the handle moves.
|
|
1416
|
+
*/
|
|
1417
|
+
.ansh-compare__layer--before {
|
|
1418
|
+
z-index: 1;
|
|
1419
|
+
}
|
|
1420
|
+
|
|
1421
|
+
.ansh-compare__handle {
|
|
1422
|
+
position: absolute;
|
|
1423
|
+
top: 0;
|
|
1424
|
+
bottom: 0;
|
|
1425
|
+
z-index: 2;
|
|
1426
|
+
width: 2px;
|
|
1427
|
+
margin-left: -1px;
|
|
1428
|
+
background: var(--ansh-content-primary);
|
|
1429
|
+
cursor: ew-resize;
|
|
1430
|
+
touch-action: none;
|
|
1431
|
+
}
|
|
1432
|
+
|
|
1433
|
+
.ansh-compare__handle:focus-visible {
|
|
1434
|
+
outline: 2px solid var(--ansh-border-focus);
|
|
1435
|
+
outline-offset: 2px;
|
|
1436
|
+
}
|
|
1437
|
+
|
|
1438
|
+
.ansh-compare__grip {
|
|
1439
|
+
position: absolute;
|
|
1440
|
+
top: 50%;
|
|
1441
|
+
left: 50%;
|
|
1442
|
+
width: 2.25rem;
|
|
1443
|
+
height: 2.25rem;
|
|
1444
|
+
transform: translate(-50%, -50%);
|
|
1445
|
+
border-radius: var(--ansh-radius-full);
|
|
1446
|
+
background: var(--ansh-content-primary);
|
|
1447
|
+
box-shadow: var(--ansh-shadow-lg);
|
|
1448
|
+
}
|
|
1449
|
+
|
|
1450
|
+
/* The double chevron, drawn with borders so no icon asset or SVG is needed. */
|
|
1451
|
+
.ansh-compare__grip::before,
|
|
1452
|
+
.ansh-compare__grip::after {
|
|
1453
|
+
content: '';
|
|
1454
|
+
position: absolute;
|
|
1455
|
+
top: 50%;
|
|
1456
|
+
width: 0.4rem;
|
|
1457
|
+
height: 0.4rem;
|
|
1458
|
+
border-top: 2px solid var(--ansh-surface-canvas);
|
|
1459
|
+
border-right: 2px solid var(--ansh-surface-canvas);
|
|
1460
|
+
}
|
|
1461
|
+
|
|
1462
|
+
.ansh-compare__grip::before {
|
|
1463
|
+
left: 30%;
|
|
1464
|
+
transform: translate(0, -50%) rotate(-135deg);
|
|
1465
|
+
}
|
|
1466
|
+
|
|
1467
|
+
.ansh-compare__grip::after {
|
|
1468
|
+
right: 30%;
|
|
1469
|
+
transform: translate(0, -50%) rotate(45deg);
|
|
1470
|
+
}
|
|
1471
|
+
|
|
1472
|
+
.ansh-compare[data-dragging] {
|
|
1473
|
+
cursor: ew-resize;
|
|
1474
|
+
}
|
|
1475
|
+
|
|
1476
|
+
/* --- Device / browser mockup --------------------------------------------- */
|
|
1477
|
+
|
|
1478
|
+
.ansh-mock {
|
|
1479
|
+
display: flex;
|
|
1480
|
+
flex-direction: column;
|
|
1481
|
+
overflow: hidden;
|
|
1482
|
+
background: var(--ansh-surface-raised);
|
|
1483
|
+
border: 1px solid var(--ansh-border-default);
|
|
1484
|
+
box-shadow: var(--ansh-shadow-lg);
|
|
1485
|
+
}
|
|
1486
|
+
|
|
1487
|
+
.ansh-mock--browser,
|
|
1488
|
+
.ansh-mock--window {
|
|
1489
|
+
border-radius: var(--ansh-radius-lg);
|
|
1490
|
+
}
|
|
1491
|
+
|
|
1492
|
+
.ansh-mock__chrome {
|
|
1493
|
+
display: flex;
|
|
1494
|
+
align-items: center;
|
|
1495
|
+
gap: var(--ansh-space-3);
|
|
1496
|
+
padding: var(--ansh-space-3) var(--ansh-space-4);
|
|
1497
|
+
background: var(--ansh-surface-sunken);
|
|
1498
|
+
border-bottom: 1px solid var(--ansh-border-subtle);
|
|
1499
|
+
}
|
|
1500
|
+
|
|
1501
|
+
.ansh-mock__dots {
|
|
1502
|
+
display: flex;
|
|
1503
|
+
gap: var(--ansh-space-2);
|
|
1504
|
+
flex-shrink: 0;
|
|
1505
|
+
}
|
|
1506
|
+
|
|
1507
|
+
.ansh-mock__dots i {
|
|
1508
|
+
width: 0.7rem;
|
|
1509
|
+
height: 0.7rem;
|
|
1510
|
+
border-radius: var(--ansh-radius-full);
|
|
1511
|
+
background: var(--ansh-border-strong);
|
|
1512
|
+
}
|
|
1513
|
+
|
|
1514
|
+
.ansh-mock__url,
|
|
1515
|
+
.ansh-mock__title {
|
|
1516
|
+
flex: 1;
|
|
1517
|
+
min-width: 0;
|
|
1518
|
+
overflow: hidden;
|
|
1519
|
+
text-overflow: ellipsis;
|
|
1520
|
+
white-space: nowrap;
|
|
1521
|
+
font-size: var(--ansh-text-xs);
|
|
1522
|
+
color: var(--ansh-content-tertiary);
|
|
1523
|
+
}
|
|
1524
|
+
|
|
1525
|
+
.ansh-mock__url {
|
|
1526
|
+
padding: var(--ansh-space-1) var(--ansh-space-3);
|
|
1527
|
+
border-radius: var(--ansh-radius-full);
|
|
1528
|
+
background: var(--ansh-surface-raised);
|
|
1529
|
+
font-family: var(--ansh-font-mono);
|
|
1530
|
+
}
|
|
1531
|
+
|
|
1532
|
+
.ansh-mock__title {
|
|
1533
|
+
text-align: center;
|
|
1534
|
+
}
|
|
1535
|
+
|
|
1536
|
+
.ansh-mock__screen {
|
|
1537
|
+
flex: 1;
|
|
1538
|
+
min-height: 0;
|
|
1539
|
+
overflow: hidden;
|
|
1540
|
+
background: var(--ansh-surface-canvas);
|
|
1541
|
+
}
|
|
1542
|
+
|
|
1543
|
+
/* The phone frame: a thick bezel and a notch, no chrome bar. */
|
|
1544
|
+
.ansh-mock--phone {
|
|
1545
|
+
border-radius: 2.25rem;
|
|
1546
|
+
border-width: 0.6rem;
|
|
1547
|
+
border-color: var(--ansh-content-primary);
|
|
1548
|
+
padding: 0;
|
|
1549
|
+
position: relative;
|
|
1550
|
+
}
|
|
1551
|
+
|
|
1552
|
+
.ansh-mock--phone .ansh-mock__screen {
|
|
1553
|
+
border-radius: 1.7rem;
|
|
1554
|
+
}
|
|
1555
|
+
|
|
1556
|
+
.ansh-mock__notch {
|
|
1557
|
+
position: absolute;
|
|
1558
|
+
top: 0;
|
|
1559
|
+
left: 50%;
|
|
1560
|
+
transform: translateX(-50%);
|
|
1561
|
+
z-index: 2;
|
|
1562
|
+
width: 38%;
|
|
1563
|
+
height: 1.1rem;
|
|
1564
|
+
border-radius: 0 0 var(--ansh-radius-lg) var(--ansh-radius-lg);
|
|
1565
|
+
background: var(--ansh-content-primary);
|
|
1566
|
+
}
|
|
1567
|
+
|
|
1568
|
+
/* --- Card stack ----------------------------------------------------------- */
|
|
1569
|
+
|
|
1570
|
+
.ansh-stack {
|
|
1571
|
+
display: flex;
|
|
1572
|
+
flex-direction: column;
|
|
1573
|
+
gap: var(--ansh-space-4);
|
|
1574
|
+
}
|
|
1575
|
+
|
|
1576
|
+
.ansh-stack__deck {
|
|
1577
|
+
position: relative;
|
|
1578
|
+
display: grid;
|
|
1579
|
+
/* One cell: every card stacks in it, and the tallest card sets the height so the deck does not
|
|
1580
|
+
resize as cards advance. */
|
|
1581
|
+
grid-template-areas: 'card';
|
|
1582
|
+
isolation: isolate;
|
|
1583
|
+
}
|
|
1584
|
+
|
|
1585
|
+
.ansh-stack__card {
|
|
1586
|
+
grid-area: card;
|
|
1587
|
+
transition:
|
|
1588
|
+
transform var(--ansh-duration-slow, 420ms) var(--ansh-ease-emphasized),
|
|
1589
|
+
opacity var(--ansh-duration-slow, 420ms) var(--ansh-ease-standard);
|
|
1590
|
+
will-change: transform, opacity;
|
|
1591
|
+
}
|
|
1592
|
+
|
|
1593
|
+
.ansh-stack__controls {
|
|
1594
|
+
display: flex;
|
|
1595
|
+
align-items: center;
|
|
1596
|
+
justify-content: center;
|
|
1597
|
+
gap: var(--ansh-space-3);
|
|
1598
|
+
}
|
|
1599
|
+
|
|
1600
|
+
.ansh-stack__button {
|
|
1601
|
+
display: grid;
|
|
1602
|
+
place-items: center;
|
|
1603
|
+
width: 2rem;
|
|
1604
|
+
height: 2rem;
|
|
1605
|
+
border-radius: var(--ansh-radius-full);
|
|
1606
|
+
border: 1px solid var(--ansh-border-default);
|
|
1607
|
+
background: var(--ansh-surface-raised);
|
|
1608
|
+
color: var(--ansh-content-secondary);
|
|
1609
|
+
font: inherit;
|
|
1610
|
+
font-size: var(--ansh-text-lg);
|
|
1611
|
+
line-height: 1;
|
|
1612
|
+
cursor: pointer;
|
|
1613
|
+
}
|
|
1614
|
+
|
|
1615
|
+
.ansh-stack__button:hover {
|
|
1616
|
+
border-color: var(--ansh-border-strong);
|
|
1617
|
+
color: var(--ansh-content-primary);
|
|
1618
|
+
}
|
|
1619
|
+
|
|
1620
|
+
.ansh-stack__count {
|
|
1621
|
+
font-family: var(--ansh-font-mono);
|
|
1622
|
+
font-size: var(--ansh-text-xs);
|
|
1623
|
+
color: var(--ansh-content-tertiary);
|
|
1624
|
+
min-width: 3.5rem;
|
|
1625
|
+
text-align: center;
|
|
1626
|
+
}
|
|
1627
|
+
|
|
1628
|
+
/*
|
|
1629
|
+
* Reduced motion. The library's kernel handles JS-driven motion, but these components animate in
|
|
1630
|
+
* CSS, so they need their own guard — `@ansh-ui/tokens` neutralises durations globally, and this
|
|
1631
|
+
* additionally removes the transform travel so cards and words change in place rather than
|
|
1632
|
+
* snapping across a distance in 0.01ms.
|
|
1633
|
+
*/
|
|
1634
|
+
@media (prefers-reduced-motion: reduce) {
|
|
1635
|
+
.ansh-rotate__word {
|
|
1636
|
+
animation: none !important;
|
|
1637
|
+
}
|
|
1638
|
+
|
|
1639
|
+
.ansh-stack__card {
|
|
1640
|
+
transition: none !important;
|
|
1641
|
+
}
|
|
1642
|
+
}
|
|
1643
|
+
|
|
1297
1644
|
/* ==========================================================================
|
|
1298
1645
|
Forms
|
|
1299
1646
|
========================================================================== */
|
|
@@ -5363,6 +5710,123 @@ button.ansh-stepper__button:hover {
|
|
|
5363
5710
|
text-underline-offset: 2px;
|
|
5364
5711
|
}
|
|
5365
5712
|
|
|
5713
|
+
/* --- Carousel ------------------------------------------------------------- */
|
|
5714
|
+
|
|
5715
|
+
.ansh-carousel {
|
|
5716
|
+
position: relative;
|
|
5717
|
+
display: flex;
|
|
5718
|
+
flex-direction: column;
|
|
5719
|
+
gap: var(--ansh-space-3);
|
|
5720
|
+
}
|
|
5721
|
+
|
|
5722
|
+
.ansh-carousel__viewport {
|
|
5723
|
+
position: relative;
|
|
5724
|
+
overflow: hidden;
|
|
5725
|
+
border-radius: var(--ansh-radius-lg);
|
|
5726
|
+
/* Without this a horizontal drag scrolls the page on touch instead of moving the track — the
|
|
5727
|
+
same defect the comparison slider guards against. */
|
|
5728
|
+
touch-action: pan-y;
|
|
5729
|
+
}
|
|
5730
|
+
|
|
5731
|
+
.ansh-carousel__track {
|
|
5732
|
+
display: flex;
|
|
5733
|
+
transition: transform var(--ansh-duration-slow, 420ms) var(--ansh-ease-emphasized);
|
|
5734
|
+
will-change: transform;
|
|
5735
|
+
}
|
|
5736
|
+
|
|
5737
|
+
.ansh-carousel__slide {
|
|
5738
|
+
/* `flex: 0 0 100%` rather than `width: 100%`: flex items shrink by default, so eight slides in a
|
|
5739
|
+
row would each collapse to an eighth of the viewport instead of queueing beside it. */
|
|
5740
|
+
flex: 0 0 100%;
|
|
5741
|
+
min-width: 0;
|
|
5742
|
+
}
|
|
5743
|
+
|
|
5744
|
+
.ansh-carousel__viewport[data-dragging] {
|
|
5745
|
+
cursor: grabbing;
|
|
5746
|
+
}
|
|
5747
|
+
|
|
5748
|
+
.ansh-carousel__arrow {
|
|
5749
|
+
position: absolute;
|
|
5750
|
+
top: calc(50% - 1.25rem);
|
|
5751
|
+
display: grid;
|
|
5752
|
+
place-items: center;
|
|
5753
|
+
width: 2.5rem;
|
|
5754
|
+
height: 2.5rem;
|
|
5755
|
+
border-radius: var(--ansh-radius-full);
|
|
5756
|
+
border: 1px solid var(--ansh-border-default);
|
|
5757
|
+
background: var(--ansh-surface-overlay);
|
|
5758
|
+
color: var(--ansh-content-primary);
|
|
5759
|
+
font: inherit;
|
|
5760
|
+
font-size: var(--ansh-text-xl);
|
|
5761
|
+
line-height: 1;
|
|
5762
|
+
cursor: pointer;
|
|
5763
|
+
}
|
|
5764
|
+
|
|
5765
|
+
.ansh-carousel__arrow:hover:not(:disabled) {
|
|
5766
|
+
border-color: var(--ansh-border-strong);
|
|
5767
|
+
}
|
|
5768
|
+
|
|
5769
|
+
.ansh-carousel__arrow:disabled {
|
|
5770
|
+
opacity: 0.4;
|
|
5771
|
+
cursor: default;
|
|
5772
|
+
}
|
|
5773
|
+
|
|
5774
|
+
.ansh-carousel__arrow--prev {
|
|
5775
|
+
left: var(--ansh-space-3);
|
|
5776
|
+
}
|
|
5777
|
+
|
|
5778
|
+
.ansh-carousel__arrow--next {
|
|
5779
|
+
right: var(--ansh-space-3);
|
|
5780
|
+
}
|
|
5781
|
+
|
|
5782
|
+
.ansh-carousel__controls {
|
|
5783
|
+
display: flex;
|
|
5784
|
+
align-items: center;
|
|
5785
|
+
justify-content: center;
|
|
5786
|
+
gap: var(--ansh-space-3);
|
|
5787
|
+
}
|
|
5788
|
+
|
|
5789
|
+
.ansh-carousel__dots {
|
|
5790
|
+
display: flex;
|
|
5791
|
+
gap: var(--ansh-space-2);
|
|
5792
|
+
}
|
|
5793
|
+
|
|
5794
|
+
.ansh-carousel__dot {
|
|
5795
|
+
width: 0.5rem;
|
|
5796
|
+
height: 0.5rem;
|
|
5797
|
+
padding: 0;
|
|
5798
|
+
border: 0;
|
|
5799
|
+
border-radius: var(--ansh-radius-full);
|
|
5800
|
+
background: var(--ansh-border-strong);
|
|
5801
|
+
cursor: pointer;
|
|
5802
|
+
transition: background-color var(--ansh-duration-fast) var(--ansh-ease-standard);
|
|
5803
|
+
}
|
|
5804
|
+
|
|
5805
|
+
.ansh-carousel__dot[aria-current] {
|
|
5806
|
+
background: var(--ansh-accent-default);
|
|
5807
|
+
}
|
|
5808
|
+
|
|
5809
|
+
.ansh-carousel__pause {
|
|
5810
|
+
display: grid;
|
|
5811
|
+
place-items: center;
|
|
5812
|
+
min-width: 1.75rem;
|
|
5813
|
+
height: 1.75rem;
|
|
5814
|
+
padding: 0 var(--ansh-space-2);
|
|
5815
|
+
border-radius: var(--ansh-radius-full);
|
|
5816
|
+
border: 1px solid var(--ansh-border-default);
|
|
5817
|
+
background: transparent;
|
|
5818
|
+
color: var(--ansh-content-secondary);
|
|
5819
|
+
font: inherit;
|
|
5820
|
+
font-size: var(--ansh-text-xs);
|
|
5821
|
+
cursor: pointer;
|
|
5822
|
+
}
|
|
5823
|
+
|
|
5824
|
+
@media (prefers-reduced-motion: reduce) {
|
|
5825
|
+
.ansh-carousel__track {
|
|
5826
|
+
transition: none !important;
|
|
5827
|
+
}
|
|
5828
|
+
}
|
|
5829
|
+
|
|
5366
5830
|
/* ==========================================================================
|
|
5367
5831
|
Feedback — alerts, banners, callouts
|
|
5368
5832
|
========================================================================== */
|
|
@@ -93,7 +93,16 @@ declare function useReducedMotion(): boolean;
|
|
|
93
93
|
* ship in production render paths; the `enabled` flag exists so it can be gated on `NODE_ENV`.
|
|
94
94
|
*/
|
|
95
95
|
declare function useFrameBudget(enabled?: boolean): BudgetReport | null;
|
|
96
|
+
/**
|
|
97
|
+
* Live count of components currently subscribed to the shared ticker.
|
|
98
|
+
*
|
|
99
|
+
* Intended for a devtools-style overlay, alongside `useFrameBudget` — the ticker only exposes
|
|
100
|
+
* `subscriberCount` as a getter with no change event, so this piggybacks on `onBudget`'s existing
|
|
101
|
+
* ~4 Hz sample instead of opening a second interval or rAF loop just to poll one number.
|
|
102
|
+
*/
|
|
103
|
+
declare function useTickerSubscriberCount(enabled?: boolean): number;
|
|
96
104
|
/** Merge several refs into one callback ref, for components that both forward and use a ref. */
|
|
97
105
|
declare function useMergedRef<T>(...refs: Array<React.Ref<T> | undefined | null>): (node: T | null) => void;
|
|
98
106
|
|
|
99
|
-
export {
|
|
107
|
+
export { useFrameBudget as a, useInView as b, useMergedRef as c, usePointer as d, useReducedMotion as e, useScrollProgress as f, useTicker as g, useTickerSubscriberCount as h, useWindowScroll as i, useElementSize as u };
|
|
108
|
+
export type { InViewOptions as I };
|