@hanzo/ui 8.8.0 → 8.9.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.
Files changed (80) hide show
  1. package/dist/backends/gui/carousel.cjs +235 -0
  2. package/dist/backends/gui/carousel.d.ts +66 -0
  3. package/dist/backends/gui/carousel.d.ts.map +1 -0
  4. package/dist/backends/gui/carousel.js +197 -0
  5. package/dist/backends/gui/carousel.js.map +1 -0
  6. package/dist/backends/gui/index.cjs +12 -1
  7. package/dist/backends/gui/index.d.ts +3 -0
  8. package/dist/backends/gui/index.d.ts.map +1 -1
  9. package/dist/backends/gui/index.js +3 -0
  10. package/dist/backends/gui/index.js.map +1 -1
  11. package/dist/backends/gui/media-stack.cjs +70 -0
  12. package/dist/backends/gui/media-stack.d.ts +32 -0
  13. package/dist/backends/gui/media-stack.d.ts.map +1 -0
  14. package/dist/backends/gui/media-stack.js +66 -0
  15. package/dist/backends/gui/media-stack.js.map +1 -0
  16. package/dist/backends/gui/skeleton.cjs +14 -0
  17. package/dist/backends/gui/skeleton.d.ts +12 -0
  18. package/dist/backends/gui/skeleton.d.ts.map +1 -0
  19. package/dist/backends/gui/skeleton.js +11 -0
  20. package/dist/backends/gui/skeleton.js.map +1 -0
  21. package/dist/box.cjs +22 -0
  22. package/dist/box.d.ts.map +1 -1
  23. package/dist/box.js +22 -0
  24. package/dist/box.js.map +1 -1
  25. package/dist/gallery.html +23 -1
  26. package/dist/index.cjs +10 -2
  27. package/dist/index.d.ts +2 -2
  28. package/dist/index.d.ts.map +1 -1
  29. package/dist/index.js +1 -1
  30. package/dist/index.js.map +1 -1
  31. package/dist/index.node.js +1 -1
  32. package/dist/primitives/Carousel.cjs +8 -0
  33. package/dist/primitives/Carousel.d.ts +2 -0
  34. package/dist/primitives/Carousel.d.ts.map +1 -0
  35. package/dist/primitives/Carousel.js +5 -0
  36. package/dist/primitives/Carousel.js.map +1 -0
  37. package/dist/primitives/CarouselContent.cjs +8 -0
  38. package/dist/primitives/CarouselContent.d.ts +2 -0
  39. package/dist/primitives/CarouselContent.d.ts.map +1 -0
  40. package/dist/primitives/CarouselContent.js +5 -0
  41. package/dist/primitives/CarouselContent.js.map +1 -0
  42. package/dist/primitives/CarouselItem.cjs +8 -0
  43. package/dist/primitives/CarouselItem.d.ts +2 -0
  44. package/dist/primitives/CarouselItem.d.ts.map +1 -0
  45. package/dist/primitives/CarouselItem.js +5 -0
  46. package/dist/primitives/CarouselItem.js.map +1 -0
  47. package/dist/primitives/CarouselNext.cjs +8 -0
  48. package/dist/primitives/CarouselNext.d.ts +2 -0
  49. package/dist/primitives/CarouselNext.d.ts.map +1 -0
  50. package/dist/primitives/CarouselNext.js +5 -0
  51. package/dist/primitives/CarouselNext.js.map +1 -0
  52. package/dist/primitives/CarouselPrevious.cjs +8 -0
  53. package/dist/primitives/CarouselPrevious.d.ts +2 -0
  54. package/dist/primitives/CarouselPrevious.d.ts.map +1 -0
  55. package/dist/primitives/CarouselPrevious.js +5 -0
  56. package/dist/primitives/CarouselPrevious.js.map +1 -0
  57. package/dist/primitives/MediaStack.cjs +8 -0
  58. package/dist/primitives/MediaStack.d.ts +2 -0
  59. package/dist/primitives/MediaStack.d.ts.map +1 -0
  60. package/dist/primitives/MediaStack.js +5 -0
  61. package/dist/primitives/MediaStack.js.map +1 -0
  62. package/dist/primitives/Skeleton.cjs +8 -0
  63. package/dist/primitives/Skeleton.d.ts +2 -0
  64. package/dist/primitives/Skeleton.d.ts.map +1 -0
  65. package/dist/primitives/Skeleton.js +5 -0
  66. package/dist/primitives/Skeleton.js.map +1 -0
  67. package/dist/primitives/fit.cjs +8 -0
  68. package/dist/primitives/fit.d.ts +2 -0
  69. package/dist/primitives/fit.d.ts.map +1 -0
  70. package/dist/primitives/fit.js +5 -0
  71. package/dist/primitives/fit.js.map +1 -0
  72. package/dist/styles.css +22 -0
  73. package/dist/theme.css +22 -0
  74. package/dist/tw.cjs +35 -2
  75. package/dist/tw.d.ts.map +1 -1
  76. package/dist/tw.js +35 -2
  77. package/dist/tw.js.map +1 -1
  78. package/dist/types.d.ts +37 -0
  79. package/dist/types.d.ts.map +1 -1
  80. package/package.json +1 -1
@@ -0,0 +1,235 @@
1
+ 'use client';"use strict";
2
+ 'use client';
3
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
+ if (k2 === undefined) k2 = k;
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
+ desc = { enumerable: true, get: function() { return m[k]; } };
8
+ }
9
+ Object.defineProperty(o, k2, desc);
10
+ }) : (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ o[k2] = m[k];
13
+ }));
14
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
15
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
16
+ }) : function(o, v) {
17
+ o["default"] = v;
18
+ });
19
+ var __importStar = (this && this.__importStar) || (function () {
20
+ var ownKeys = function(o) {
21
+ ownKeys = Object.getOwnPropertyNames || function (o) {
22
+ var ar = [];
23
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
24
+ return ar;
25
+ };
26
+ return ownKeys(o);
27
+ };
28
+ return function (mod) {
29
+ if (mod && mod.__esModule) return mod;
30
+ var result = {};
31
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
32
+ __setModuleDefault(result, mod);
33
+ return result;
34
+ };
35
+ })();
36
+ Object.defineProperty(exports, "__esModule", { value: true });
37
+ exports.CarouselNext = exports.CarouselPrevious = exports.CarouselItem = exports.CarouselContent = exports.Carousel = void 0;
38
+ const jsx_runtime_1 = require("react/jsx-runtime");
39
+ /**
40
+ * Carousel — a scroller the BROWSER pages.
41
+ *
42
+ * The slides are a grid row that overflows, and `scroll-snap-type: x mandatory`
43
+ * is what makes a drag land on a slide instead of between two. That is the whole
44
+ * mechanism: the platform does the paging, the momentum, the rubber-banding and
45
+ * the pointer/touch/trackpad handling, and this file adds an index, two buttons
46
+ * and a change event on top.
47
+ *
48
+ * The 5.x line did this with embla — 30kB to reimplement scrolling in JS, plus a
49
+ * transform-based track that a screen reader reads as one long row and a
50
+ * keyboard cannot tab through. Scroll-snap is the browser feature that replaced
51
+ * the need for it, so the dependency goes and the accessibility comes back for
52
+ * free: each slide is a real box at a real scroll offset.
53
+ *
54
+ * `CarouselApi` is a stable object that reads the LIVE dom on every call rather
55
+ * than closing over a snapshot, so a caller may hold it across renders and slide
56
+ * changes — which is what `setApi` exists for.
57
+ */
58
+ const React = __importStar(require("react"));
59
+ const lucide_icons_2_1 = require("@hanzogui/lucide-icons-2");
60
+ const box_1 = require("../../box.cjs");
61
+ const cn_1 = require("../../core/cn.cjs");
62
+ const button_1 = require("./button.cjs");
63
+ const slides = (el) => Array.from(el.children);
64
+ /**
65
+ * The slide whose centre is nearest the scroller's.
66
+ *
67
+ * Dividing scrollLeft by a slide width would be shorter and would be wrong the
68
+ * moment two slides differ in width — which they do as soon as one holds a
69
+ * longer title. Measuring centres is right for any widths, including the last
70
+ * slide, which cannot reach the middle and must still be reachable.
71
+ */
72
+ const nearest = (el) => {
73
+ const kids = slides(el);
74
+ if (!kids.length)
75
+ return -1;
76
+ const mid = el.scrollLeft + el.clientWidth / 2;
77
+ let best = 0;
78
+ let bestD = Infinity;
79
+ for (let i = 0; i < kids.length; i++) {
80
+ const d = Math.abs(kids[i].offsetLeft + kids[i].offsetWidth / 2 - mid);
81
+ if (d < bestD) {
82
+ bestD = d;
83
+ best = i;
84
+ }
85
+ }
86
+ return best;
87
+ };
88
+ const CarouselCtx = /* @__PURE__ */ React.createContext(null);
89
+ const useCarousel = () => {
90
+ const c = React.useContext(CarouselCtx);
91
+ if (!c) {
92
+ // A CarouselItem is not named here: it reads nothing from this, and
93
+ // demanding a parent it does not use would reject markup that works.
94
+ throw new Error('CarouselContent, CarouselPrevious and CarouselNext must be inside a <Carousel>');
95
+ }
96
+ return c;
97
+ };
98
+ const Carousel = ({ options, setApi, onCarouselSelect, className, children, ...props }) => {
99
+ const scroller = React.useRef(null);
100
+ const api = React.useRef(null);
101
+ const [selected, setSelected] = React.useState(null);
102
+ const loop = !!options?.loop;
103
+ // Built once and never rebuilt: every method reads `scroller.current` at call
104
+ // time, so the object stays correct as slides come and go.
105
+ if (!api.current) {
106
+ const el = () => scroller.current;
107
+ const count = () => {
108
+ const e = el();
109
+ return e ? slides(e).length : 0;
110
+ };
111
+ const at = () => {
112
+ const e = el();
113
+ return e ? nearest(e) : -1;
114
+ };
115
+ const go = (index) => {
116
+ const e = el();
117
+ if (!e)
118
+ return;
119
+ const kids = slides(e);
120
+ const n = kids.length;
121
+ if (!n)
122
+ return;
123
+ const i = loop ? ((index % n) + n) % n : Math.max(0, Math.min(n - 1, index));
124
+ const k = kids[i];
125
+ // Centre it by setting scrollLeft rather than calling scrollIntoView,
126
+ // which also scrolls every ancestor and would jump the PAGE to bring a
127
+ // carousel deep in a document into view.
128
+ e.scrollTo({ left: k.offsetLeft - (e.clientWidth - k.offsetWidth) / 2, behavior: 'smooth' });
129
+ };
130
+ api.current = {
131
+ scrollTo: go,
132
+ scrollPrev: () => go(at() - 1),
133
+ scrollNext: () => go(at() + 1),
134
+ selectedScrollSnap: at,
135
+ canScrollPrev: () => loop || at() > 0,
136
+ canScrollNext: () => loop || at() < count() - 1,
137
+ slideCount: count,
138
+ };
139
+ }
140
+ // Held in refs so an inline callback — which every call site writes — does not
141
+ // re-run the effects on every render.
142
+ const give = React.useRef(setApi);
143
+ give.current = setApi;
144
+ const announce = React.useRef(onCarouselSelect);
145
+ announce.current = onCarouselSelect;
146
+ React.useEffect(() => {
147
+ if (api.current)
148
+ give.current?.(api.current);
149
+ }, []);
150
+ React.useEffect(() => {
151
+ const e = scroller.current;
152
+ if (!e)
153
+ return;
154
+ // Where we already are. Published WITHOUT announcing: a carousel that fires
155
+ // its select handler on mount tells a page the user chose the first slide
156
+ // when all they did was load it — and in a shop that is a selected sku.
157
+ //
158
+ // Publishing it is also what wakes the arrows. Until this runs there is no
159
+ // scroller to measure, so both are disabled; leaving `selected` at 0 from
160
+ // the start would skip this render and they would STAY disabled — a
161
+ // carousel whose only controls never enable, because the one thing that
162
+ // enables them is the scrolling they exist to do.
163
+ let last = nearest(e);
164
+ setSelected(last);
165
+ let frame = 0;
166
+ const read = () => {
167
+ frame = 0;
168
+ const i = nearest(e);
169
+ if (i === last)
170
+ return;
171
+ last = i;
172
+ setSelected(i);
173
+ if (api.current)
174
+ announce.current?.(api.current);
175
+ };
176
+ // Scroll fires per frame during a drag; coalescing to one rAF keeps the
177
+ // measuring off the critical path.
178
+ const onScroll = () => {
179
+ if (!frame)
180
+ frame = requestAnimationFrame(read);
181
+ };
182
+ e.addEventListener('scroll', onScroll, { passive: true });
183
+ return () => {
184
+ e.removeEventListener('scroll', onScroll);
185
+ if (frame)
186
+ cancelAnimationFrame(frame);
187
+ };
188
+ }, []);
189
+ return ((0, jsx_runtime_1.jsx)(CarouselCtx.Provider, { value: { scroller, api, selected, loop }, children: (0, jsx_runtime_1.jsx)(box_1.Box, { className: (0, cn_1.cn)('relative', className), role: "region", "aria-roledescription": "carousel", ...props, children: children }) }));
190
+ };
191
+ exports.Carousel = Carousel;
192
+ /**
193
+ * The scroller itself: one grid ROW, each slide a full-width column.
194
+ *
195
+ * `auto-cols-[100%]` is the page size. A slide narrower than the carousel wants
196
+ * its own width instead, which is what `basis-*` on the item is for — the column
197
+ * is the floor, not a cage.
198
+ */
199
+ const CarouselContent = ({ className, ...props }) => {
200
+ const { scroller } = useCarousel();
201
+ return ((0, jsx_runtime_1.jsx)(box_1.Box, { ref: scroller, className: (0, cn_1.cn)('hz-scroller grid grid-flow-col auto-cols-[100%] overflow-x-auto overflow-y-hidden snap-x', className),
202
+ // Firefox spells scrollbar suppression as a property and WebKit as a
203
+ // pseudo-element, so one lives here and the other in theme.css.
204
+ style: { scrollbarWidth: 'none' }, ...props }));
205
+ };
206
+ exports.CarouselContent = CarouselContent;
207
+ const CarouselItem = ({ className, ...props }) => ((0, jsx_runtime_1.jsx)(box_1.Box, { role: "group", "aria-roledescription": "slide",
208
+ // `min-w-0` is what lets a long title wrap instead of widening the column.
209
+ className: (0, cn_1.cn)('snap-center min-w-0', className), ...props }));
210
+ exports.CarouselItem = CarouselItem;
211
+ /**
212
+ * The two arrows.
213
+ *
214
+ * Disabled at the ends unless the carousel loops, because an arrow that does
215
+ * nothing when pressed is worse than one that is visibly unavailable.
216
+ */
217
+ const arrow = (name, side, Icon, move, can) => {
218
+ const Arrow = ({ className, ...props }) => {
219
+ // `selected` is not read for its value — it subscribes the arrow to slide
220
+ // changes, which is what re-evaluates `can`. Without it an arrow disabled at
221
+ // slide 0 stays disabled after the user drags away from it.
222
+ const { api, selected } = useCarousel();
223
+ // Before mount there is no scroller, so neither arrow can know whether it
224
+ // has anywhere to go, and disabled is the honest answer.
225
+ const live = selected === null ? null : api.current;
226
+ return ((0, jsx_runtime_1.jsx)(button_1.Button, { variant: "outline", size: "icon", "aria-label": name, disabled: live ? !can(live) : true, onClick: () => {
227
+ if (api.current)
228
+ move(api.current);
229
+ }, className: (0, cn_1.cn)('absolute top-1/2 -translate-y-1/2 rounded-full', side, className), ...props, children: (0, jsx_runtime_1.jsx)(Icon, { size: 16 }) }));
230
+ };
231
+ Arrow.displayName = name;
232
+ return Arrow;
233
+ };
234
+ exports.CarouselPrevious = arrow('Previous slide', 'left-0', lucide_icons_2_1.ChevronLeft, (a) => a.scrollPrev(), (a) => a.canScrollPrev());
235
+ exports.CarouselNext = arrow('Next slide', 'right-0', lucide_icons_2_1.ChevronRight, (a) => a.scrollNext(), (a) => a.canScrollNext());
@@ -0,0 +1,66 @@
1
+ /**
2
+ * Carousel — a scroller the BROWSER pages.
3
+ *
4
+ * The slides are a grid row that overflows, and `scroll-snap-type: x mandatory`
5
+ * is what makes a drag land on a slide instead of between two. That is the whole
6
+ * mechanism: the platform does the paging, the momentum, the rubber-banding and
7
+ * the pointer/touch/trackpad handling, and this file adds an index, two buttons
8
+ * and a change event on top.
9
+ *
10
+ * The 5.x line did this with embla — 30kB to reimplement scrolling in JS, plus a
11
+ * transform-based track that a screen reader reads as one long row and a
12
+ * keyboard cannot tab through. Scroll-snap is the browser feature that replaced
13
+ * the need for it, so the dependency goes and the accessibility comes back for
14
+ * free: each slide is a real box at a real scroll offset.
15
+ *
16
+ * `CarouselApi` is a stable object that reads the LIVE dom on every call rather
17
+ * than closing over a snapshot, so a caller may hold it across renders and slide
18
+ * changes — which is what `setApi` exists for.
19
+ */
20
+ import * as React from 'react';
21
+ import { Box } from '../../box.js';
22
+ import { Button } from './button.js';
23
+ export type CarouselOptions = {
24
+ /** Past the last slide, go to the first — and the reverse. */
25
+ loop?: boolean;
26
+ };
27
+ /** What a caller can ask of a mounted carousel. */
28
+ export type CarouselApi = {
29
+ /** Centre slide `index`. Out of range clamps, or wraps when `loop`. */
30
+ scrollTo: (index: number) => void;
31
+ scrollPrev: () => void;
32
+ scrollNext: () => void;
33
+ /** The slide nearest the centre, or -1 when there are none. */
34
+ selectedScrollSnap: () => number;
35
+ canScrollPrev: () => boolean;
36
+ canScrollNext: () => boolean;
37
+ slideCount: () => number;
38
+ };
39
+ export type CarouselProps = Omit<React.ComponentProps<typeof Box>, 'onSelect'> & {
40
+ options?: CarouselOptions;
41
+ /** Handed the api once, on mount. */
42
+ setApi?: (api: CarouselApi) => void;
43
+ /** Fires when the settled slide CHANGES — not on mount. */
44
+ onCarouselSelect?: (api: CarouselApi) => void;
45
+ };
46
+ export declare const Carousel: ({ options, setApi, onCarouselSelect, className, children, ...props }: CarouselProps) => import("react/jsx-runtime").JSX.Element;
47
+ /**
48
+ * The scroller itself: one grid ROW, each slide a full-width column.
49
+ *
50
+ * `auto-cols-[100%]` is the page size. A slide narrower than the carousel wants
51
+ * its own width instead, which is what `basis-*` on the item is for — the column
52
+ * is the floor, not a cage.
53
+ */
54
+ export declare const CarouselContent: ({ className, ...props }: React.ComponentProps<typeof Box>) => import("react/jsx-runtime").JSX.Element;
55
+ export declare const CarouselItem: ({ className, ...props }: React.ComponentProps<typeof Box>) => import("react/jsx-runtime").JSX.Element;
56
+ type ArrowProps = Omit<React.ComponentProps<typeof Button>, 'onPress' | 'onClick'>;
57
+ export declare const CarouselPrevious: {
58
+ ({ className, ...props }: ArrowProps): import("react/jsx-runtime").JSX.Element;
59
+ displayName: string;
60
+ };
61
+ export declare const CarouselNext: {
62
+ ({ className, ...props }: ArrowProps): import("react/jsx-runtime").JSX.Element;
63
+ displayName: string;
64
+ };
65
+ export {};
66
+ //# sourceMappingURL=carousel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"carousel.d.ts","sourceRoot":"","sources":["../../../src/backends/gui/carousel.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAA;AAE/B,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAEjC,MAAM,MAAM,eAAe,GAAG;IAC5B,8DAA8D;IAC9D,IAAI,CAAC,EAAE,OAAO,CAAA;CACf,CAAA;AAED,mDAAmD;AACnD,MAAM,MAAM,WAAW,GAAG;IACxB,uEAAuE;IACvE,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IACjC,UAAU,EAAE,MAAM,IAAI,CAAA;IACtB,UAAU,EAAE,MAAM,IAAI,CAAA;IACtB,+DAA+D;IAC/D,kBAAkB,EAAE,MAAM,MAAM,CAAA;IAChC,aAAa,EAAE,MAAM,OAAO,CAAA;IAC5B,aAAa,EAAE,MAAM,OAAO,CAAA;IAC5B,UAAU,EAAE,MAAM,MAAM,CAAA;CACzB,CAAA;AAgDD,MAAM,MAAM,aAAa,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,GAAG,CAAC,EAAE,UAAU,CAAC,GAAG;IAC/E,OAAO,CAAC,EAAE,eAAe,CAAA;IACzB,qCAAqC;IACrC,MAAM,CAAC,EAAE,CAAC,GAAG,EAAE,WAAW,KAAK,IAAI,CAAA;IACnC,2DAA2D;IAC3D,gBAAgB,CAAC,EAAE,CAAC,GAAG,EAAE,WAAW,KAAK,IAAI,CAAA;CAC9C,CAAA;AAED,eAAO,MAAM,QAAQ,yEAOlB,aAAa,4CAoGf,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,eAAe,4BAA6B,KAAK,CAAC,cAAc,CAAC,OAAO,GAAG,CAAC,4CAexF,CAAA;AAED,eAAO,MAAM,YAAY,4BAA6B,KAAK,CAAC,cAAc,CAAC,OAAO,GAAG,CAAC,4CAQrF,CAAA;AAED,KAAK,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,MAAM,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC,CAAA;AA2ClF,eAAO,MAAM,gBAAgB;8BA5Ba,UAAU;;CAkCnD,CAAA;AAED,eAAO,MAAM,YAAY;8BApCiB,UAAU;;CA0CnD,CAAA"}
@@ -0,0 +1,197 @@
1
+ 'use client';
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ /**
4
+ * Carousel — a scroller the BROWSER pages.
5
+ *
6
+ * The slides are a grid row that overflows, and `scroll-snap-type: x mandatory`
7
+ * is what makes a drag land on a slide instead of between two. That is the whole
8
+ * mechanism: the platform does the paging, the momentum, the rubber-banding and
9
+ * the pointer/touch/trackpad handling, and this file adds an index, two buttons
10
+ * and a change event on top.
11
+ *
12
+ * The 5.x line did this with embla — 30kB to reimplement scrolling in JS, plus a
13
+ * transform-based track that a screen reader reads as one long row and a
14
+ * keyboard cannot tab through. Scroll-snap is the browser feature that replaced
15
+ * the need for it, so the dependency goes and the accessibility comes back for
16
+ * free: each slide is a real box at a real scroll offset.
17
+ *
18
+ * `CarouselApi` is a stable object that reads the LIVE dom on every call rather
19
+ * than closing over a snapshot, so a caller may hold it across renders and slide
20
+ * changes — which is what `setApi` exists for.
21
+ */
22
+ import * as React from 'react';
23
+ import { ChevronLeft, ChevronRight } from '@hanzogui/lucide-icons-2';
24
+ import { Box } from '../../box.js';
25
+ import { cn } from '../../core/cn.js';
26
+ import { Button } from './button.js';
27
+ const slides = (el) => Array.from(el.children);
28
+ /**
29
+ * The slide whose centre is nearest the scroller's.
30
+ *
31
+ * Dividing scrollLeft by a slide width would be shorter and would be wrong the
32
+ * moment two slides differ in width — which they do as soon as one holds a
33
+ * longer title. Measuring centres is right for any widths, including the last
34
+ * slide, which cannot reach the middle and must still be reachable.
35
+ */
36
+ const nearest = (el) => {
37
+ const kids = slides(el);
38
+ if (!kids.length)
39
+ return -1;
40
+ const mid = el.scrollLeft + el.clientWidth / 2;
41
+ let best = 0;
42
+ let bestD = Infinity;
43
+ for (let i = 0; i < kids.length; i++) {
44
+ const d = Math.abs(kids[i].offsetLeft + kids[i].offsetWidth / 2 - mid);
45
+ if (d < bestD) {
46
+ bestD = d;
47
+ best = i;
48
+ }
49
+ }
50
+ return best;
51
+ };
52
+ const CarouselCtx = /* @__PURE__ */ React.createContext(null);
53
+ const useCarousel = () => {
54
+ const c = React.useContext(CarouselCtx);
55
+ if (!c) {
56
+ // A CarouselItem is not named here: it reads nothing from this, and
57
+ // demanding a parent it does not use would reject markup that works.
58
+ throw new Error('CarouselContent, CarouselPrevious and CarouselNext must be inside a <Carousel>');
59
+ }
60
+ return c;
61
+ };
62
+ export const Carousel = ({ options, setApi, onCarouselSelect, className, children, ...props }) => {
63
+ const scroller = React.useRef(null);
64
+ const api = React.useRef(null);
65
+ const [selected, setSelected] = React.useState(null);
66
+ const loop = !!options?.loop;
67
+ // Built once and never rebuilt: every method reads `scroller.current` at call
68
+ // time, so the object stays correct as slides come and go.
69
+ if (!api.current) {
70
+ const el = () => scroller.current;
71
+ const count = () => {
72
+ const e = el();
73
+ return e ? slides(e).length : 0;
74
+ };
75
+ const at = () => {
76
+ const e = el();
77
+ return e ? nearest(e) : -1;
78
+ };
79
+ const go = (index) => {
80
+ const e = el();
81
+ if (!e)
82
+ return;
83
+ const kids = slides(e);
84
+ const n = kids.length;
85
+ if (!n)
86
+ return;
87
+ const i = loop ? ((index % n) + n) % n : Math.max(0, Math.min(n - 1, index));
88
+ const k = kids[i];
89
+ // Centre it by setting scrollLeft rather than calling scrollIntoView,
90
+ // which also scrolls every ancestor and would jump the PAGE to bring a
91
+ // carousel deep in a document into view.
92
+ e.scrollTo({ left: k.offsetLeft - (e.clientWidth - k.offsetWidth) / 2, behavior: 'smooth' });
93
+ };
94
+ api.current = {
95
+ scrollTo: go,
96
+ scrollPrev: () => go(at() - 1),
97
+ scrollNext: () => go(at() + 1),
98
+ selectedScrollSnap: at,
99
+ canScrollPrev: () => loop || at() > 0,
100
+ canScrollNext: () => loop || at() < count() - 1,
101
+ slideCount: count,
102
+ };
103
+ }
104
+ // Held in refs so an inline callback — which every call site writes — does not
105
+ // re-run the effects on every render.
106
+ const give = React.useRef(setApi);
107
+ give.current = setApi;
108
+ const announce = React.useRef(onCarouselSelect);
109
+ announce.current = onCarouselSelect;
110
+ React.useEffect(() => {
111
+ if (api.current)
112
+ give.current?.(api.current);
113
+ }, []);
114
+ React.useEffect(() => {
115
+ const e = scroller.current;
116
+ if (!e)
117
+ return;
118
+ // Where we already are. Published WITHOUT announcing: a carousel that fires
119
+ // its select handler on mount tells a page the user chose the first slide
120
+ // when all they did was load it — and in a shop that is a selected sku.
121
+ //
122
+ // Publishing it is also what wakes the arrows. Until this runs there is no
123
+ // scroller to measure, so both are disabled; leaving `selected` at 0 from
124
+ // the start would skip this render and they would STAY disabled — a
125
+ // carousel whose only controls never enable, because the one thing that
126
+ // enables them is the scrolling they exist to do.
127
+ let last = nearest(e);
128
+ setSelected(last);
129
+ let frame = 0;
130
+ const read = () => {
131
+ frame = 0;
132
+ const i = nearest(e);
133
+ if (i === last)
134
+ return;
135
+ last = i;
136
+ setSelected(i);
137
+ if (api.current)
138
+ announce.current?.(api.current);
139
+ };
140
+ // Scroll fires per frame during a drag; coalescing to one rAF keeps the
141
+ // measuring off the critical path.
142
+ const onScroll = () => {
143
+ if (!frame)
144
+ frame = requestAnimationFrame(read);
145
+ };
146
+ e.addEventListener('scroll', onScroll, { passive: true });
147
+ return () => {
148
+ e.removeEventListener('scroll', onScroll);
149
+ if (frame)
150
+ cancelAnimationFrame(frame);
151
+ };
152
+ }, []);
153
+ return (_jsx(CarouselCtx.Provider, { value: { scroller, api, selected, loop }, children: _jsx(Box, { className: cn('relative', className), role: "region", "aria-roledescription": "carousel", ...props, children: children }) }));
154
+ };
155
+ /**
156
+ * The scroller itself: one grid ROW, each slide a full-width column.
157
+ *
158
+ * `auto-cols-[100%]` is the page size. A slide narrower than the carousel wants
159
+ * its own width instead, which is what `basis-*` on the item is for — the column
160
+ * is the floor, not a cage.
161
+ */
162
+ export const CarouselContent = ({ className, ...props }) => {
163
+ const { scroller } = useCarousel();
164
+ return (_jsx(Box, { ref: scroller, className: cn('hz-scroller grid grid-flow-col auto-cols-[100%] overflow-x-auto overflow-y-hidden snap-x', className),
165
+ // Firefox spells scrollbar suppression as a property and WebKit as a
166
+ // pseudo-element, so one lives here and the other in theme.css.
167
+ style: { scrollbarWidth: 'none' }, ...props }));
168
+ };
169
+ export const CarouselItem = ({ className, ...props }) => (_jsx(Box, { role: "group", "aria-roledescription": "slide",
170
+ // `min-w-0` is what lets a long title wrap instead of widening the column.
171
+ className: cn('snap-center min-w-0', className), ...props }));
172
+ /**
173
+ * The two arrows.
174
+ *
175
+ * Disabled at the ends unless the carousel loops, because an arrow that does
176
+ * nothing when pressed is worse than one that is visibly unavailable.
177
+ */
178
+ const arrow = (name, side, Icon, move, can) => {
179
+ const Arrow = ({ className, ...props }) => {
180
+ // `selected` is not read for its value — it subscribes the arrow to slide
181
+ // changes, which is what re-evaluates `can`. Without it an arrow disabled at
182
+ // slide 0 stays disabled after the user drags away from it.
183
+ const { api, selected } = useCarousel();
184
+ // Before mount there is no scroller, so neither arrow can know whether it
185
+ // has anywhere to go, and disabled is the honest answer.
186
+ const live = selected === null ? null : api.current;
187
+ return (_jsx(Button, { variant: "outline", size: "icon", "aria-label": name, disabled: live ? !can(live) : true, onClick: () => {
188
+ if (api.current)
189
+ move(api.current);
190
+ }, className: cn('absolute top-1/2 -translate-y-1/2 rounded-full', side, className), ...props, children: _jsx(Icon, { size: 16 }) }));
191
+ };
192
+ Arrow.displayName = name;
193
+ return Arrow;
194
+ };
195
+ export const CarouselPrevious = arrow('Previous slide', 'left-0', ChevronLeft, (a) => a.scrollPrev(), (a) => a.canScrollPrev());
196
+ export const CarouselNext = arrow('Next slide', 'right-0', ChevronRight, (a) => a.scrollNext(), (a) => a.canScrollNext());
197
+ //# sourceMappingURL=carousel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"carousel.js","sourceRoot":"","sources":["../../../src/backends/gui/carousel.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAEpE,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAA;AAC/B,OAAO,EAAE,EAAE,EAAE,MAAM,eAAe,CAAA;AAClC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAoBjC,MAAM,MAAM,GAAG,CAAC,EAAe,EAAiB,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,QAAQ,CAAkB,CAAA;AAE3F;;;;;;;GAOG;AACH,MAAM,OAAO,GAAG,CAAC,EAAe,EAAU,EAAE;IAC1C,MAAM,IAAI,GAAG,MAAM,CAAC,EAAE,CAAC,CAAA;IACvB,IAAI,CAAC,IAAI,CAAC,MAAM;QAAE,OAAO,CAAC,CAAC,CAAA;IAC3B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ACL,KAAC,MAAM,IACL,OAAO,EAAC,SAAS,EACjB,IAAI,EAAC,MAAM,gBACC,IAAI,EAChB,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,EAClC,OAAO,EAAE,GAAG,EAAE;gBACZ,IAAI,GAAG,CAAC,OAAO;oBAAE,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA;YACpC,CAAC,EACD,SAAS,EAAE,EAAE,CAAC,gDAAgD,EAAE,IAAI,EAAE,SAAS,CAAC,KAC5E,KAAK,YAET,KAAC,IAAI,IAAC,IAAI,EAAE,EAAE,GAAI,GACX,CACV,CAAA;IACH,CAAC,CAAA;IACD,KAAK,CAAC,WAAW,GAAG,IAAI,CAAA;IACxB,OAAO,KAAK,CAAA;AACd,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,gBAAgB,GAAG,KAAK,CACnC,gBAAgB,EAChB,QAAQ,EACR,WAAW,EACX,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,EAAE,EACrB,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,aAAa,EAAE,CACzB,CAAA;AAED,MAAM,CAAC,MAAM,YAAY,GAAG,KAAK,CAC/B,YAAY,EACZ,SAAS,EACT,YAAY,EACZ,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,EAAE,EACrB,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,aAAa,EAAE,CACzB,CAAA"}
@@ -19,7 +19,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
19
19
  exports.ContextMenuRadioItem = exports.ContextMenuCheckboxItem = exports.ContextMenuItem = exports.ContextMenuContent = exports.ContextMenuTrigger = exports.ContextMenu = exports.CommandSeparator = exports.CommandShortcut = exports.CommandItem = exports.CommandGroup = exports.CommandEmpty = exports.CommandList = exports.CommandInput = exports.CommandDialog = exports.Command = exports.CollapsibleContent = exports.CollapsibleTrigger = exports.Collapsible = exports.Checkbox = exports.CardMedia = exports.CardContent = exports.CardDescription = exports.CardAction = exports.CardTitle = exports.CardFooter = exports.CardHeader = exports.Card = exports.buttonVariants = exports.Button = exports.badgeVariants = exports.Badge = exports.AvatarFallback = exports.AvatarImage = exports.Avatar = exports.AspectRatio = exports.AlertDialogCancel = exports.AlertDialogAction = exports.AlertDialogDescription = exports.AlertDialogTitle = exports.AlertDialogFooter = exports.AlertDialogHeader = exports.AlertDialogContent = exports.AlertDialogOverlay = exports.AlertDialogPortal = exports.AlertDialogTrigger = exports.AlertDialog = exports.AccordionContent = exports.AccordionTrigger = exports.AccordionItem = exports.Accordion = void 0;
20
20
  exports.ResizablePanel = exports.ResizablePanelGroup = exports.RadioGroupItem = exports.RadioGroup = exports.Progress = exports.PopoverClose = exports.PopoverAnchor = exports.PopoverContent = exports.PopoverTrigger = exports.Popover = exports.Label = exports.Input = exports.HoverCardContent = exports.HoverCardTrigger = exports.HoverCard = exports.Glass = exports.DropdownMenuRadioGroup = exports.DropdownMenuSubTrigger = exports.DropdownMenuSubContent = exports.DropdownMenuSub = exports.DropdownMenuPortal = exports.DropdownMenuGroup = exports.DropdownMenuShortcut = exports.DropdownMenuSeparator = exports.DropdownMenuLabel = exports.DropdownMenuRadioItem = exports.DropdownMenuCheckboxItem = exports.DropdownMenuItem = exports.DropdownMenuContent = exports.DropdownMenuTrigger = exports.DropdownMenu = exports.DialogTrigger = exports.DialogTitle = exports.DialogPortal = exports.DialogOverlay = exports.DialogHeader = exports.DialogFooter = exports.DialogDescription = exports.DialogContent = exports.DialogClose = exports.Dialog = exports.ContextMenuRadioGroup = exports.ContextMenuSubTrigger = exports.ContextMenuSubContent = exports.ContextMenuSub = exports.ContextMenuPortal = exports.ContextMenuGroup = exports.ContextMenuShortcut = exports.ContextMenuSeparator = exports.ContextMenuLabel = void 0;
21
21
  exports.ToggleGroupItem = exports.ToggleGroup = exports.toast = exports.Toaster = exports.Textarea = exports.TabsContent = exports.TabsTrigger = exports.TabsList = exports.Tabs = exports.Switch = exports.Spinner = exports.Slider = exports.Fill = exports.Screen = exports.Band = exports.SelectScrollDownButton = exports.SelectScrollUpButton = exports.SelectSeparator = exports.SelectItem = exports.SelectLabel = exports.SelectContent = exports.SelectTrigger = exports.SelectValue = exports.SelectGroup = exports.Select = exports.ScrollBar = exports.ScrollArea = exports.Text = exports.View = exports.ScrollView = exports.Spacer = exports.Separator = exports.Image = exports.Anchor = exports.Em = exports.Strong = exports.Span = exports.H6 = exports.H5 = exports.H4 = exports.H3 = exports.H2 = exports.H1 = exports.Heading = exports.Paragraph = exports.SizableText = exports.ZStack = exports.YStack = exports.XStack = exports.ResizableHandle = void 0;
22
- exports.YouTubeEmbed = exports.VideoPlayer = exports.LinkElement = exports.MDXLink = exports.useLink = exports.Link = exports.ApplyTypography = exports.useFormField = exports.FormMessage = exports.FormDescription = exports.FormControl = exports.FormLabel = exports.FormItem = exports.FormField = exports.Form = exports.TooltipProvider = exports.TooltipContent = exports.TooltipTrigger = exports.Tooltip = void 0;
22
+ exports.fit = exports.MediaStack = exports.Skeleton = exports.CarouselNext = exports.CarouselPrevious = exports.CarouselItem = exports.CarouselContent = exports.Carousel = exports.YouTubeEmbed = exports.VideoPlayer = exports.LinkElement = exports.MDXLink = exports.useLink = exports.Link = exports.ApplyTypography = exports.useFormField = exports.FormMessage = exports.FormDescription = exports.FormControl = exports.FormLabel = exports.FormItem = exports.FormField = exports.Form = exports.TooltipProvider = exports.TooltipContent = exports.TooltipTrigger = exports.Tooltip = void 0;
23
23
  var accordion_1 = require("./accordion.cjs");
24
24
  Object.defineProperty(exports, "Accordion", { enumerable: true, get: function () { return accordion_1.Accordion; } });
25
25
  Object.defineProperty(exports, "AccordionItem", { enumerable: true, get: function () { return accordion_1.AccordionItem; } });
@@ -237,3 +237,14 @@ Object.defineProperty(exports, "LinkElement", { enumerable: true, get: function
237
237
  var video_1 = require("./video.cjs");
238
238
  Object.defineProperty(exports, "VideoPlayer", { enumerable: true, get: function () { return video_1.VideoPlayer; } });
239
239
  Object.defineProperty(exports, "YouTubeEmbed", { enumerable: true, get: function () { return video_1.YouTubeEmbed; } });
240
+ var carousel_1 = require("./carousel.cjs");
241
+ Object.defineProperty(exports, "Carousel", { enumerable: true, get: function () { return carousel_1.Carousel; } });
242
+ Object.defineProperty(exports, "CarouselContent", { enumerable: true, get: function () { return carousel_1.CarouselContent; } });
243
+ Object.defineProperty(exports, "CarouselItem", { enumerable: true, get: function () { return carousel_1.CarouselItem; } });
244
+ Object.defineProperty(exports, "CarouselPrevious", { enumerable: true, get: function () { return carousel_1.CarouselPrevious; } });
245
+ Object.defineProperty(exports, "CarouselNext", { enumerable: true, get: function () { return carousel_1.CarouselNext; } });
246
+ var skeleton_1 = require("./skeleton.cjs");
247
+ Object.defineProperty(exports, "Skeleton", { enumerable: true, get: function () { return skeleton_1.Skeleton; } });
248
+ var media_stack_1 = require("./media-stack.cjs");
249
+ Object.defineProperty(exports, "MediaStack", { enumerable: true, get: function () { return media_stack_1.MediaStack; } });
250
+ Object.defineProperty(exports, "fit", { enumerable: true, get: function () { return media_stack_1.fit; } });
@@ -36,4 +36,7 @@ export { Form, FormField, FormItem, FormLabel, FormControl, FormDescription, For
36
36
  export { ApplyTypography, type ApplyTypographyProps, type ProseTag, type TypographySize, } from './prose.js';
37
37
  export { Link, useLink, MDXLink, LinkElement, type LinkComponent, type LinkElementProps, } from './link.js';
38
38
  export { VideoPlayer, YouTubeEmbed, type VideoPlayerProps, type YouTubeEmbedProps, } from './video.js';
39
+ export { Carousel, CarouselContent, CarouselItem, CarouselPrevious, CarouselNext, type CarouselApi, type CarouselOptions, type CarouselProps, } from './carousel.js';
40
+ export { Skeleton } from './skeleton.js';
41
+ export { MediaStack, fit, type MediaStackProps } from './media-stack.js';
39
42
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/backends/gui/index.ts"],"names":[],"mappings":"A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AE,MAAM,WAAW,CAAA;AAC1C,OAAO,EACL,WAAW,EACX,eAAe,EACf,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EACvB,KAAK,eAAe,GACrB,MAAM,gBAAgB,CAAA;AACvB,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,WAAW,CAAA;AACpF,OAAO,EACL,IAAI,EACJ,SAAS,EACT,QAAQ,EACR,SAAS,EACT,WAAW,EACX,eAAe,EACf,WAAW,EACX,YAAY,GACb,MAAM,QAAQ,CAAA;AACf,OAAO,EACL,eAAe,EACf,KAAK,oBAAoB,EACzB,KAAK,QAAQ,EACb,KAAK,cAAc,GACpB,MAAM,SAAS,CAAA;AAChB,OAAO,EACL,IAAI,EACJ,OAAO,EACP,OAAO,EACP,WAAW,EACX,KAAK,aAAa,EAClB,KAAK,gBAAgB,GACtB,MAAM,QAAQ,CAAA;AACf,OAAO,EACL,WAAW,EACX,YAAY,EACZ,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,GACvB,MAAM,SAAS,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/backends/gui/index.ts"],"names":[],"mappings":"AAiBA,OAAO,EACL,SAAS,EACT,aAAa,EACb,gBAAgB,EAChB,gBAAgB,EAChB,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,GAC3B,MAAM,aAAa,CAAA;AACpB,OAAO,EACL,WAAW,EACX,kBAAkB,EAClB,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,sBAAsB,EACtB,iBAAiB,EACjB,iBAAiB,EACjB,KAAK,gBAAgB,EACrB,KAAK,uBAAuB,EAC5B,KAAK,uBAAuB,EAC5B,KAAK,uBAAuB,GAC7B,MAAM,gBAAgB,CAAA;AACvB,OAAO,EAAE,WA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CAAA;AAChB,OAAO,EACL,IAAI,EACJ,OAAO,EACP,OAAO,EACP,WAAW,EACX,KAAK,aAAa,EAClB,KAAK,gBAAgB,GACtB,MAAM,QAAQ,CAAA;AACf,OAAO,EACL,WAAW,EACX,YAAY,EACZ,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,GACvB,MAAM,SAAS,CAAA;AAChB,OAAO,EACL,QAAQ,EACR,eAAe,EACf,YAAY,EACZ,gBAAgB,EAChB,YAAY,EACZ,KAAK,WAAW,EAChB,KAAK,eAAe,EACpB,KAAK,aAAa,GACnB,MAAM,YAAY,CAAA;AACnB,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,KAAK,eAAe,EAAE,MAAM,eAAe,CAAA"}
@@ -62,4 +62,7 @@ export { Form, FormField, FormItem, FormLabel, FormControl, FormDescription, For
62
62
  export { ApplyTypography, } from './prose.js';
63
63
  export { Link, useLink, MDXLink, LinkElement, } from './link.js';
64
64
  export { VideoPlayer, YouTubeEmbed, } from './video.js';
65
+ export { Carousel, CarouselContent, CarouselItem, CarouselPrevious, CarouselNext, } from './carousel.js';
66
+ export { Skeleton } from './skeleton.js';
67
+ export { MediaStack, fit } from './media-stack.js';
65
68
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/backends/gui/index.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,EAAE;AACF,kFAAkF;AAClF,4EAA4E;AAC5E,uEAAuE;AACvE,EAAE;AACF,4EAA4E;AAC5E,iFAAiF;AACjF,+EAA+E;AAC/E,0BAA0B;AAC1B,EAAE;AACF,6DAA6D;AAC7D,6EAA6E;AAC7E,4EAA4E;AAC5E,mEAAmE;AACnE,oCAAoC;AAEpC,OAAO,EACL,SAAS,EACT,aAAa,EACb,gBAAgB,EAChB,gBAAgB,GAKjB,MAAM,aAAa,CAAA;AACpB,OAAO,EAC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