@kanso-labs/kanso-ui 0.37.0 → 0.38.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.
Files changed (38) hide show
  1. package/dist/calendar/styles.js +2 -1
  2. package/dist/calendar/styles.js.map +1 -1
  3. package/dist/carousel/arrangement.d.ts +5 -0
  4. package/dist/carousel/arrangement.js +123 -0
  5. package/dist/carousel/arrangement.js.map +1 -0
  6. package/dist/components/calendar/index.d.ts +3 -2
  7. package/dist/components/calendar/index.js +3 -2
  8. package/dist/components/calendar/index.js.map +1 -1
  9. package/dist/components/carousel/index.d.ts +68 -0
  10. package/dist/components/carousel/index.js +395 -0
  11. package/dist/components/carousel/index.js.map +1 -0
  12. package/dist/components/color-slider/index.js +82 -57
  13. package/dist/components/color-slider/index.js.map +1 -1
  14. package/dist/components/date-picker/index.d.ts +9 -1
  15. package/dist/components/date-picker/index.js +26 -24
  16. package/dist/components/date-picker/index.js.map +1 -1
  17. package/dist/components/date-range-picker/index.d.ts +10 -1
  18. package/dist/components/date-range-picker/index.js +26 -24
  19. package/dist/components/date-range-picker/index.js.map +1 -1
  20. package/dist/components/index.d.ts +4 -2
  21. package/dist/components/number-field/index.js +1 -1
  22. package/dist/components/search-field/index.js +1 -1
  23. package/dist/components/search-view/index.js +1 -1
  24. package/dist/components/slider/index.d.ts +24 -3
  25. package/dist/components/slider/index.js +316 -87
  26. package/dist/components/slider/index.js.map +1 -1
  27. package/dist/i18n/index.js +9 -1
  28. package/dist/i18n/index.js.map +1 -1
  29. package/dist/i18n/messages.js +204 -34
  30. package/dist/i18n/messages.js.map +1 -1
  31. package/dist/index.d.ts +4 -2
  32. package/dist/index.js +3 -2
  33. package/dist/styles/color.js +18 -4
  34. package/dist/styles/color.js.map +1 -1
  35. package/dist/styles/picker.js +8 -0
  36. package/dist/styles/picker.js.map +1 -1
  37. package/dist/styles.css +227 -10
  38. package/package.json +1 -1
@@ -0,0 +1,395 @@
1
+ "use client";
2
+ import { props } from "../../node_modules/@stylexjs/stylex/lib/es/stylex.js";
3
+ import { radii } from "../../tokens/design.tokens.stylex.js";
4
+ import { mergeStyles } from "../../styles/merge.js";
5
+ import { ChevronEndGlyph } from "../../glyphs/index.js";
6
+ import { focus } from "../../styles/focus.js";
7
+ import { useMessages } from "../../i18n/index.js";
8
+ import { arrange, placements } from "../../carousel/arrangement.js";
9
+ import IconButton from "../icon-button/index.js";
10
+ import { c } from "react/compiler-runtime";
11
+ import { Children, createContext, isValidElement, useContext, useLayoutEffect, useRef, useState } from "react";
12
+ import { jsx, jsxs } from "react/jsx-runtime";
13
+ //#region src/components/carousel/index.tsx
14
+ /** The page's 16dp at a carousel's ends. */
15
+ const PADDING = 16;
16
+ const DEFAULT_ITEM_SIZE = 240;
17
+ const styles = {
18
+ item: {
19
+ kaIpWk: "x19pkqky",
20
+ kB7OPa: "x9f619",
21
+ kzQI83: "x1c4vz4f",
22
+ kmuXW: "x2lah0s",
23
+ kAzted: "x2lwn1j",
24
+ kVQacm: "xb3r6kr",
25
+ kVAEAm: "x1n2onr6",
26
+ $$css: true
27
+ },
28
+ itemUncontained: {
29
+ k5xd4v: "x1bhewko",
30
+ $$css: true
31
+ },
32
+ marker: {
33
+ kmuXW: "x2lah0s",
34
+ k5xd4v: "x83psoy",
35
+ $$css: true
36
+ },
37
+ scroller: {
38
+ kOuLrU: "xfk6m8",
39
+ kB7OPa: "x9f619",
40
+ k1xSpc: "x78zum5",
41
+ kXHlph: "xw2csxc",
42
+ kORKVm: "x10wlt62",
43
+ kvh3hx: "x7p5m3t",
44
+ kVAEAm: "x1n2onr6",
45
+ k5wCbM: "x1rohswg",
46
+ khEr5k: "xkcv6ua xg83hb1",
47
+ kc424l: "xhfbhpw",
48
+ $$css: true
49
+ },
50
+ scrollerUncontained: {
51
+ katHQp: "x7jkkja",
52
+ $$css: true
53
+ }
54
+ };
55
+ const _temp = {
56
+ kzqmXN: "x1uyokj7",
57
+ "$$css": true
58
+ };
59
+ const _temp2 = {
60
+ kzqmXN: "x1uyokj7",
61
+ "$$css": true
62
+ };
63
+ const _temp3 = {
64
+ kzqmXN: "x1uyokj7",
65
+ "$$css": true
66
+ };
67
+ const placed = {
68
+ item: (inlineSize, shift, clip) => [
69
+ _temp,
70
+ {
71
+ kz4h6p: clip != null ? "xx58lst" : clip,
72
+ kLqNvP: shift != null ? "x1lxsm33" : shift,
73
+ $$css: true
74
+ },
75
+ {
76
+ "--x-clipPath": clip != null ? clip : void 0,
77
+ "--x-inlineSize": ((val) => typeof val === "number" ? val + "px" : val != null ? val : void 0)(inlineSize),
78
+ "--x-insetInlineStart": ((val) => typeof val === "number" ? val + "px" : val != null ? val : void 0)(shift)
79
+ }
80
+ ],
81
+ marker: (inlineSize) => [_temp2, { "--x-inlineSize": ((val) => typeof val === "number" ? val + "px" : val != null ? val : void 0)(inlineSize) }],
82
+ uncontained: (inlineSize) => [_temp3, { "--x-inlineSize": ((val) => typeof val === "number" ? val + "px" : val != null ? val : void 0)(inlineSize) }]
83
+ };
84
+ const SlotContext = createContext(null);
85
+ function along(direction, { end, masked, scrolled, step }) {
86
+ if (step <= 0) return 0;
87
+ const offset = masked ? (Math.round(scrolled / step) + direction) * step : scrolled + direction * step;
88
+ return Math.min(Math.max(offset, 0), end);
89
+ }
90
+ /**
91
+ * A row of items that scrolls on and off the screen, in the carousel page's
92
+ * multi-browse, hero or uncontained layout. Name it with `label`, and give it
93
+ * a `Carousel.Item` for each item.
94
+ *
95
+ * ```tsx
96
+ * <Carousel label="Label">
97
+ * <Carousel.Item><img alt="First item" src="…" /></Carousel.Item>
98
+ * <Carousel.Item><img alt="Second item" src="…" /></Carousel.Item>
99
+ * </Carousel>
100
+ * ```
101
+ *
102
+ * The call site's `className` and `style` land on the carousel as a whole,
103
+ * which is the element a layout positions.
104
+ */
105
+ function Carousel(t0) {
106
+ const $ = c(40);
107
+ const { children, itemSize: t1, label, layout: t2, nextLabel, previousLabel, ref, ...props$2 } = t0;
108
+ const itemSize = t1 === void 0 ? DEFAULT_ITEM_SIZE : t1;
109
+ const layout = t2 === void 0 ? "multi-browse" : t2;
110
+ const messages = useMessages();
111
+ const scrollerRef = useRef(null);
112
+ const [width, setWidth] = useState(0);
113
+ const [scrolled, setScrolled] = useState(0);
114
+ const items = Children.toArray(children).filter(isValidElement);
115
+ const count = items.length;
116
+ const room = Math.max(width - 32, 0);
117
+ const arrangement = arrange(layout, room, itemSize, count);
118
+ const masked = layout !== "uncontained";
119
+ const step = arrangement.large + 8;
120
+ const end = masked ? arrangement.steps * step : Math.max(count * step - 8 + 32 - width, 0);
121
+ const lastLarge = arrangement.largeCount - 1;
122
+ const position = masked && step > 0 ? scrolled / step : 0;
123
+ const drawn = masked ? placements(layout, arrangement, room, PADDING, count, position) : [];
124
+ let t3;
125
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
126
+ t3 = () => {
127
+ const scroller = scrollerRef.current;
128
+ if (scroller === null) return;
129
+ setWidth(scroller.clientWidth);
130
+ setScrolled(Math.abs(scroller.scrollLeft));
131
+ };
132
+ $[0] = t3;
133
+ } else t3 = $[0];
134
+ const measure = t3;
135
+ let t4;
136
+ let t5;
137
+ if ($[1] !== measure) {
138
+ t4 = () => {
139
+ const scroller_0 = scrollerRef.current;
140
+ if (scroller_0 === null) return;
141
+ measure();
142
+ const observer = new ResizeObserver(measure);
143
+ observer.observe(scroller_0);
144
+ return () => {
145
+ observer.disconnect();
146
+ };
147
+ };
148
+ t5 = [measure];
149
+ $[1] = measure;
150
+ $[2] = t4;
151
+ $[3] = t5;
152
+ } else {
153
+ t4 = $[2];
154
+ t5 = $[3];
155
+ }
156
+ useLayoutEffect(t4, t5);
157
+ let t6;
158
+ if ($[4] !== end || $[5] !== lastLarge || $[6] !== masked || $[7] !== scrolled || $[8] !== step) {
159
+ t6 = () => {
160
+ const geometry = {
161
+ end,
162
+ lastLarge,
163
+ masked,
164
+ scrolled,
165
+ step
166
+ };
167
+ scrollAlong(scrollerRef.current, along(-1, geometry));
168
+ };
169
+ $[4] = end;
170
+ $[5] = lastLarge;
171
+ $[6] = masked;
172
+ $[7] = scrolled;
173
+ $[8] = step;
174
+ $[9] = t6;
175
+ } else t6 = $[9];
176
+ const previous = t6;
177
+ let t7;
178
+ if ($[10] !== end || $[11] !== lastLarge || $[12] !== masked || $[13] !== scrolled || $[14] !== step) {
179
+ t7 = () => {
180
+ const geometry_0 = {
181
+ end,
182
+ lastLarge,
183
+ masked,
184
+ scrolled,
185
+ step
186
+ };
187
+ scrollAlong(scrollerRef.current, along(1, geometry_0));
188
+ };
189
+ $[10] = end;
190
+ $[11] = lastLarge;
191
+ $[12] = masked;
192
+ $[13] = scrolled;
193
+ $[14] = step;
194
+ $[15] = t7;
195
+ } else t7 = $[15];
196
+ const next = t7;
197
+ let t8;
198
+ if ($[16] !== end || $[17] !== lastLarge || $[18] !== masked || $[19] !== scrolled || $[20] !== step) {
199
+ t8 = (event) => {
200
+ const { target } = event;
201
+ if (!masked || step <= 0 || !(target instanceof Node)) return;
202
+ const index = Array.from(event.currentTarget.children).findIndex((child) => child.contains(target));
203
+ if (index < 0) return;
204
+ const offset = Math.min(restRevealing(index, {
205
+ end,
206
+ lastLarge,
207
+ masked,
208
+ scrolled,
209
+ step
210
+ }) * step, end);
211
+ scrollAlong(scrollerRef.current, offset);
212
+ };
213
+ $[16] = end;
214
+ $[17] = lastLarge;
215
+ $[18] = masked;
216
+ $[19] = scrolled;
217
+ $[20] = step;
218
+ $[21] = t8;
219
+ } else t8 = $[21];
220
+ const reveal = t8;
221
+ const slots = items.map((_, index_0) => ({
222
+ count,
223
+ index: index_0,
224
+ large: arrangement.large,
225
+ layout,
226
+ placement: drawn[index_0]
227
+ }));
228
+ const t9 = messages.carousel;
229
+ const t10 = mergeStyles({ className: "x9f619 x78zum5 xdt5ytf x126z3so xeuugli" }, props$2);
230
+ let t11;
231
+ if ($[22] !== masked) {
232
+ t11 = props(styles.scroller, focus.ring, !masked && styles.scrollerUncontained);
233
+ $[22] = masked;
234
+ $[23] = t11;
235
+ } else t11 = $[23];
236
+ let t12;
237
+ if ($[24] !== masked) {
238
+ t12 = masked ? /* @__PURE__ */ jsx("div", {
239
+ "aria-hidden": "true",
240
+ className: "xjm9jq1 x1i1rx1s x13vifvy x1o0tod x47corl x10l6tqk x1bhewko"
241
+ }) : null;
242
+ $[24] = masked;
243
+ $[25] = t12;
244
+ } else t12 = $[25];
245
+ let t13;
246
+ if ($[26] === Symbol.for("react.memo_cache_sentinel")) {
247
+ t13 = {
248
+ 0: { className: "x9f619 x78zum5 x2lah0s x126z3so x1cmllll x790zyz" },
249
+ 1: { className: "x9f619 x78zum5 x2lah0s x126z3so x1cmllll x790zyz xh8yej3 x1o0tod x7giv3 x7wzq59" }
250
+ };
251
+ $[26] = t13;
252
+ } else t13 = $[26];
253
+ const t14 = previousLabel ?? messages.previousSlide;
254
+ const t15 = scrolled <= .5;
255
+ let t16;
256
+ if ($[27] === Symbol.for("react.memo_cache_sentinel")) {
257
+ t16 = /* @__PURE__ */ jsx(ChevronEndGlyph, { className: "xlzyvqe x1lliihq x15vhz18 x1pw7kks xpk2tj9" });
258
+ $[27] = t16;
259
+ } else t16 = $[27];
260
+ let t17;
261
+ if ($[28] !== previous || $[29] !== t14 || $[30] !== t15) {
262
+ t17 = /* @__PURE__ */ jsx(IconButton, {
263
+ "aria-label": t14,
264
+ isDisabled: t15,
265
+ onPress: previous,
266
+ children: t16
267
+ });
268
+ $[28] = previous;
269
+ $[29] = t14;
270
+ $[30] = t15;
271
+ $[31] = t17;
272
+ } else t17 = $[31];
273
+ const t18 = nextLabel ?? messages.nextSlide;
274
+ const t19 = scrolled >= end - .5;
275
+ let t20;
276
+ if ($[32] === Symbol.for("react.memo_cache_sentinel")) {
277
+ t20 = /* @__PURE__ */ jsx(ChevronEndGlyph, { className: "xlzyvqe x1lliihq x15vhz18 x19axjrm x1c071of" });
278
+ $[32] = t20;
279
+ } else t20 = $[32];
280
+ let t21;
281
+ if ($[33] !== next || $[34] !== t18 || $[35] !== t19) {
282
+ t21 = /* @__PURE__ */ jsx(IconButton, {
283
+ "aria-label": t18,
284
+ isDisabled: t19,
285
+ onPress: next,
286
+ children: t20
287
+ });
288
+ $[33] = next;
289
+ $[34] = t18;
290
+ $[35] = t19;
291
+ $[36] = t21;
292
+ } else t21 = $[36];
293
+ let t22;
294
+ if ($[37] !== t17 || $[38] !== t21) {
295
+ t22 = /* @__PURE__ */ jsxs("div", {
296
+ className: "x9f619 x78zum5 x126z3so x13a6bvl x790zyz",
297
+ children: [t17, t21]
298
+ });
299
+ $[37] = t17;
300
+ $[38] = t21;
301
+ $[39] = t22;
302
+ } else t22 = $[39];
303
+ return /* @__PURE__ */ jsxs("section", {
304
+ "aria-label": label,
305
+ "aria-roledescription": t9,
306
+ ref,
307
+ ...props$2,
308
+ ...t10,
309
+ children: [/* @__PURE__ */ jsxs("div", {
310
+ onScroll: measure,
311
+ ref: scrollerRef,
312
+ tabIndex: end > 0 ? 0 : void 0,
313
+ ...t11,
314
+ children: [
315
+ t12,
316
+ /* @__PURE__ */ jsx("div", {
317
+ onFocus: reveal,
318
+ ...t13[!!masked << 0],
319
+ children: items.map((item, index_1) => /* @__PURE__ */ jsx(SlotContext, {
320
+ value: slots[index_1] ?? null,
321
+ children: item
322
+ }, item.key ?? index_1))
323
+ }),
324
+ masked ? Array.from({ length: arrangement.steps }, (__0, rest) => /* @__PURE__ */ jsx("div", {
325
+ "aria-hidden": "true",
326
+ ...props(styles.marker, placed.marker(`${step}px`))
327
+ }, rest)) : null
328
+ ]
329
+ }), t22]
330
+ });
331
+ }
332
+ /**
333
+ * One item. It is named by which of how many it is — "2 of 6" — unless it is
334
+ * given an `aria-label` of its own.
335
+ *
336
+ * The call site's `className` and `style` land on the item.
337
+ */
338
+ function CarouselItem(t0) {
339
+ const $ = c(11);
340
+ const { children, ref, ...props$1 } = t0;
341
+ const messages = useMessages();
342
+ const slot = useContext(SlotContext);
343
+ const count = slot?.count ?? 1;
344
+ const index = slot?.index ?? 0;
345
+ const large = slot?.large ?? 0;
346
+ const placement = slot?.placement;
347
+ const inset = placement === void 0 ? 0 : (large - placement.width) / 2;
348
+ let t1;
349
+ if ($[0] !== count || $[1] !== index || $[2] !== messages) {
350
+ t1 = messages.slideLabel(index + 1, count);
351
+ $[0] = count;
352
+ $[1] = index;
353
+ $[2] = messages;
354
+ $[3] = t1;
355
+ } else t1 = $[3];
356
+ const t2 = messages.slide;
357
+ const t3 = "group";
358
+ const t4 = mergeStyles(props(styles.item, slot?.layout === "uncontained" && styles.itemUncontained, slot?.layout === "uncontained" && placed.uncontained(`${large}px`), placement !== void 0 && placed.item(`${large}px`, `${placement.left - inset - index * (large + 8)}px`, `inset(0 ${inset}px round ${radii.xl})`)), props$1);
359
+ let t5;
360
+ if ($[4] !== children || $[5] !== messages.slide || $[6] !== props$1 || $[7] !== ref || $[8] !== t1 || $[9] !== t4) {
361
+ t5 = /* @__PURE__ */ jsx("div", {
362
+ "aria-label": t1,
363
+ "aria-roledescription": t2,
364
+ ref,
365
+ role: t3,
366
+ ...props$1,
367
+ ...t4,
368
+ children
369
+ });
370
+ $[4] = children;
371
+ $[5] = messages.slide;
372
+ $[6] = props$1;
373
+ $[7] = ref;
374
+ $[8] = t1;
375
+ $[9] = t4;
376
+ $[10] = t5;
377
+ } else t5 = $[10];
378
+ return t5;
379
+ }
380
+ function restRevealing(index, { lastLarge, scrolled, step }) {
381
+ const at = Math.round(scrolled / step);
382
+ if (index < at) return index;
383
+ if (index > at + lastLarge) return index - lastLarge;
384
+ return at;
385
+ }
386
+ function scrollAlong(scroller, offset) {
387
+ if (scroller === null) return;
388
+ const sign = getComputedStyle(scroller).direction === "rtl" ? -1 : 1;
389
+ scroller.scrollTo({ left: sign * offset });
390
+ }
391
+ Carousel.Item = CarouselItem;
392
+ //#endregion
393
+ export { CarouselItem, Carousel as default };
394
+
395
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["c","_c","FocusEvent","HTMLAttributes","ReactNode","RefAttributes","stylex","Children","createContext","isValidElement","useCallback","useContext","useLayoutEffect","useRef","useState","CarouselLayout","Placement","arrange","GAP","placements","ChevronEndGlyph","useMessages","focus","mergeStyles","radii","spacing","IconButton","PADDING","DEFAULT_ITEM_SIZE","CarouselItemProps","Omit","HTMLDivElement","children","CarouselProps","HTMLElement","itemSize","label","layout","nextLabel","previousLabel","styles","item","kaIpWk","kB7OPa","kzQI83","kmuXW","kAzted","kVQacm","kVAEAm","$$css","itemUncontained","k5xd4v","marker","scroller","kOuLrU","k1xSpc","kXHlph","kORKVm","kvh3hx","k5wCbM","khEr5k","kc424l","scrollerUncontained","katHQp","_temp","kzqmXN","_temp2","_temp3","placed","inlineSize","shift","clip","kz4h6p","kLqNvP","undefined","val","uncontained","Slot","count","index","large","placement","SlotContext","Geometry","end","lastLarge","masked","scrolled","step","along","direction","offset","Math","round","min","max","Carousel","t0","$","t1","t2","ref","props","messages","scrollerRef","width","setWidth","setScrolled","items","toArray","filter","length","room","arrangement","steps","largeCount","position","drawn","t3","Symbol","for","current","clientWidth","abs","scrollLeft","measure","t4","t5","scroller_0","observer","ResizeObserver","observe","disconnect","t6","geometry","scrollAlong","previous","t7","geometry_0","next","t8","event","target","Node","Array","from","currentTarget","findIndex","child","contains","geometry_1","restRevealing","reveal","slots","map","_","index_0","t9","carousel","t10","className","t11","ring","t12","t13","0","1","t14","previousSlide","t15","t16","t17","t18","nextSlide","t19","t20","t21","t22","index_1","key","__0","rest","CarouselItem","slot","inset","slideLabel","slide","left","xl","at","sign","getComputedStyle","scrollTo","Item","_c","props","stylex.props"],"sources":["../../../src/components/carousel/index.tsx"],"sourcesContent":["'use client';\n\nimport type { FocusEvent, HTMLAttributes, ReactNode, RefAttributes } from 'react';\nimport * as stylex from '@stylexjs/stylex';\nimport { Children, createContext, isValidElement, useCallback, useContext, useLayoutEffect, useRef, useState } from 'react';\nimport type { CarouselLayout, Placement } from '../../carousel/arrangement';\nimport { arrange, GAP, placements } from '../../carousel/arrangement';\nimport { ChevronEndGlyph } from '../../glyphs';\nimport { useMessages } from '../../i18n';\nimport { focus } from '../../styles/focus';\nimport { mergeStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { radii, spacing } from '../../tokens/design.tokens.stylex';\nimport IconButton from '../icon-button';\n\n// The carousel page's carousel: a row of items that scrolls on and off the\n// screen, drawn in three of the page's layouts. Each has the page's 16dp of\n// padding at its ends and 8dp at its top and bottom, 8dp between items and a\n// 28dp corner on every item.\n//\n// - **Multi-browse**, the default, shows as many large items as fit at\n// `itemSize`, then a medium one and a small one, and fills its width\n// exactly; the large width gives way where the preferred one does not fit.\n// - **Hero** shows one large item and one small.\n// - **Uncontained** shows every item at `itemSize`, scrolling past the edge.\n//\n// **Items change size as they move**, as the page draws them. The first two\n// layouts come to rest one item apart, and between two rests every item's\n// place and width are interpolated, so an item shrinks as it leaves and\n// grows as it arrives; the last rests turn the arrangement round a slot at a\n// time, so every item is drawn large at one of them. The arithmetic is\n// `src/carousel/arrangement.ts`.\n// An item is laid out at the large width and masked down to the width it is\n// drawn at, centred, with the page's corner on the mask: what it holds is\n// cut at both sides rather than squeezed, as the page's masked items are.\n//\n// **The scrolling is the browser's.** A scroller holds the items' track,\n// which stays put while it scrolls, and a run of empty markers one item\n// apart after it, which is what gives the scroller its length and its rests:\n// each marker's end is a scroll-snap point, and a mark at the scroller's\n// start is the first. The position the scroller reports is what the items\n// are drawn from. Uncontained has no rests and no masks, so its items scroll\n// in the track themselves, snapping to their own starts.\n//\n// **It is the ARIA carousel pattern**, since React Aria has no carousel: a\n// region named by `label` and described as a carousel, each item a group\n// described as a slide and named by which of how many it is, and a previous\n// and a next button under it, at the end. Focus moving into an item that is\n// not drawn large scrolls the carousel to the nearest rest that draws it\n// large, and the scroller is a tab stop while it scrolls, so the arrow keys\n// move it too. Under reduced motion the scroller jumps rather than scrolling\n// smoothly.\n//\n// The page's large width is \"dynamic, or user-set\", and neither MDC-Android\n// nor Compose has a default for it; `itemSize`'s 240 is this component's own.\n// Uncontained keeps the 16dp at its end as well as its start, where the page\n// gives it a leading padding alone, so its last item does not end flush\n// against the edge.\n\n/** The page's 16dp at a carousel's ends. */\nconst PADDING = 16;\nconst DEFAULT_ITEM_SIZE = 240;\ntype CarouselItemProps = Omit<HTMLAttributes<HTMLDivElement>, 'children'> & {\n /** What the item shows: usually an image, which the item masks. */\n children?: ReactNode;\n};\ntype CarouselProps = Omit<HTMLAttributes<HTMLElement>, 'children'> & {\n /** The items: `Carousel.Item` for each. */\n children?: ReactNode;\n /**\n * The large item's preferred width, in pixels. Multi-browse lays out as\n * many as fit and narrows them where they do not; uncontained draws every\n * item at it; hero takes its large item's width from the carousel's.\n * @default 240\n */\n itemSize?: number;\n /**\n * What the carousel shows, for a screen reader. Required rather than\n * optional: a carousel is a region, and a region with no name is one a\n * screen reader cannot introduce.\n */\n label: string;\n /**\n * Which of the page's layouts the carousel draws.\n * @default 'multi-browse'\n */\n layout?: CarouselLayout;\n /**\n * What the next button is called. Left out, the library names it in the\n * reader's locale — \"Next slide\" in English.\n */\n nextLabel?: string;\n /**\n * What the previous button is called. Left out, the library names it in\n * the reader's locale — \"Previous slide\" in English.\n */\n previousLabel?: string;\n};\nconst styles = {\n item: {\n kaIpWk: \"x19pkqky\",\n kB7OPa: \"x9f619\",\n kzQI83: \"x1c4vz4f\",\n kmuXW: \"x2lah0s\",\n kAzted: \"x2lwn1j\",\n kVQacm: \"xb3r6kr\",\n kVAEAm: \"x1n2onr6\",\n $$css: true\n },\n itemUncontained: {\n k5xd4v: \"x1bhewko\",\n $$css: true\n },\n marker: {\n kmuXW: \"x2lah0s\",\n k5xd4v: \"x83psoy\",\n $$css: true\n },\n scroller: {\n kOuLrU: \"xfk6m8\",\n kB7OPa: \"x9f619\",\n k1xSpc: \"x78zum5\",\n kXHlph: \"xw2csxc\",\n kORKVm: \"x10wlt62\",\n kvh3hx: \"x7p5m3t\",\n kVAEAm: \"x1n2onr6\",\n k5wCbM: \"x1rohswg\",\n khEr5k: \"xkcv6ua xg83hb1\",\n kc424l: \"xhfbhpw\",\n $$css: true\n },\n scrollerUncontained: {\n katHQp: \"x7jkkja\",\n $$css: true\n }\n};\nconst _temp = {\n kzqmXN: \"x1uyokj7\",\n \"$$css\": true\n};\nconst _temp2 = {\n kzqmXN: \"x1uyokj7\",\n \"$$css\": true\n};\nconst _temp3 = {\n kzqmXN: \"x1uyokj7\",\n \"$$css\": true\n};\nconst placed = {\n item: (inlineSize: string, shift: string, clip: string) => [_temp, {\n kz4h6p: clip != null ? \"xx58lst\" : clip,\n kLqNvP: shift != null ? \"x1lxsm33\" : shift,\n $$css: true\n }, {\n \"--x-clipPath\": clip != null ? clip : undefined,\n \"--x-inlineSize\": (val => typeof val === \"number\" ? val + \"px\" : val != null ? val : undefined)(inlineSize),\n \"--x-insetInlineStart\": (val => typeof val === \"number\" ? val + \"px\" : val != null ? val : undefined)(shift)\n }],\n marker: (inlineSize: string) => [_temp2, {\n \"--x-inlineSize\": (val => typeof val === \"number\" ? val + \"px\" : val != null ? val : undefined)(inlineSize)\n }],\n uncontained: (inlineSize: string) => [_temp3, {\n \"--x-inlineSize\": (val => typeof val === \"number\" ? val + \"px\" : val != null ? val : undefined)(inlineSize)\n }]\n};\ntype Slot = {\n count: number;\n index: number;\n /** The width the item is laid out at. */\n large: number;\n layout: CarouselLayout;\n /** Where it is drawn, for a layout that masks. */\n placement: Placement | undefined;\n};\nconst SlotContext = createContext<null | Slot>(null);\n\n/** What the controls and focus scroll by, as numbers read off one render. */\ntype Geometry = {\n /** The offset of the last rest, or for uncontained how far it scrolls. */\n end: number;\n /** How many items past the first large one the last large one is. */\n lastLarge: number;\n masked: boolean;\n scrolled: number;\n /** The distance between two rests, or for uncontained between two items. */\n step: number;\n};\n\n// Where a press of previous or next scrolls to from `scrolled`: the rest\n// either side of the nearest one, or for uncontained an item's width along,\n// kept between the two ends.\nfunction along(direction: -1 | 1, {\n end,\n masked,\n scrolled,\n step\n}: Geometry): number {\n if (step <= 0) {\n return 0;\n }\n const offset = masked ? (Math.round(scrolled / step) + direction) * step : scrolled + direction * step;\n return Math.min(Math.max(offset, 0), end);\n}\n\n/**\n * A row of items that scrolls on and off the screen, in the carousel page's\n * multi-browse, hero or uncontained layout. Name it with `label`, and give it\n * a `Carousel.Item` for each item.\n *\n * ```tsx\n * <Carousel label=\"Label\">\n * <Carousel.Item><img alt=\"First item\" src=\"…\" /></Carousel.Item>\n * <Carousel.Item><img alt=\"Second item\" src=\"…\" /></Carousel.Item>\n * </Carousel>\n * ```\n *\n * The call site's `className` and `style` land on the carousel as a whole,\n * which is the element a layout positions.\n */\nfunction Carousel({\n children,\n itemSize = DEFAULT_ITEM_SIZE,\n label,\n layout = 'multi-browse',\n nextLabel,\n previousLabel,\n ref,\n ...props\n}: CarouselProps & RefAttributes<HTMLElement>) {\n const messages = useMessages();\n const scrollerRef = useRef<HTMLDivElement>(null);\n // The scroller's width and how far it has scrolled along the text:\n // everything drawn is drawn from these two.\n const [width, setWidth] = useState(0);\n const [scrolled, setScrolled] = useState(0);\n const items = Children.toArray(children).filter(isValidElement);\n const count = items.length;\n const room = Math.max(width - 2 * PADDING, 0);\n const arrangement = arrange(layout, room, itemSize, count);\n const masked = layout !== 'uncontained';\n // Read off the arrangement as arithmetic, so each is a number of its own\n // rather than a field of an object the calls below are handed.\n const step = arrangement.large + GAP;\n // The last rest, or how far the uncontained track runs past the scroller.\n const end = masked ? arrangement.steps * step : Math.max(count * step - GAP + 2 * PADDING - width, 0);\n const lastLarge = arrangement.largeCount - 1;\n const position = masked && step > 0 ? scrolled / step : 0;\n const drawn = masked ? placements(layout, arrangement, room, PADDING, count, position) : [];\n\n // Measured before the first paint, again on every scroll, and whenever\n // the scroller's width changes. A right-to-left scroller counts its offset\n // down from zero.\n const measure = useCallback(() => {\n const scroller = scrollerRef.current;\n if (scroller === null) {\n return;\n }\n setWidth(scroller.clientWidth);\n setScrolled(Math.abs(scroller.scrollLeft));\n }, []);\n useLayoutEffect(() => {\n const scroller = scrollerRef.current;\n if (scroller === null) {\n return undefined;\n }\n measure();\n const observer = new ResizeObserver(measure);\n observer.observe(scroller);\n return () => {\n observer.disconnect();\n };\n }, [measure]);\n const previous = useCallback(() => {\n const geometry = {\n end,\n lastLarge,\n masked,\n scrolled,\n step\n };\n scrollAlong(scrollerRef.current, along(-1, geometry));\n }, [end, lastLarge, masked, scrolled, step]);\n const next = useCallback(() => {\n const geometry = {\n end,\n lastLarge,\n masked,\n scrolled,\n step\n };\n scrollAlong(scrollerRef.current, along(1, geometry));\n }, [end, lastLarge, masked, scrolled, step]);\n\n // Focus arriving in an item a masking layout is not drawing large.\n // Uncontained items are where they are drawn, so the browser's own\n // scrolling of focus into view is already right for them.\n const reveal = useCallback((event: FocusEvent<HTMLDivElement>) => {\n const {\n target\n } = event;\n if (!masked || step <= 0 || !(target instanceof Node)) {\n return;\n }\n const index = Array.from(event.currentTarget.children).findIndex(child => child.contains(target));\n if (index < 0) {\n return;\n }\n const geometry = {\n end,\n lastLarge,\n masked,\n scrolled,\n step\n };\n const offset = Math.min(restRevealing(index, geometry) * step, end);\n scrollAlong(scrollerRef.current, offset);\n }, [end, lastLarge, masked, scrolled, step]);\n const slots = items.map((_, index): Slot => ({\n count,\n index,\n large: arrangement.large,\n layout,\n placement: drawn[index]\n }));\n return <section aria-label={label} aria-roledescription={messages.carousel} ref={ref} {...props} {...mergeStyles({\n className: \"x9f619 x78zum5 xdt5ytf x126z3so xeuugli\"\n }, props)}>\n <div onScroll={measure} ref={scrollerRef}\n // A tab stop while there is anywhere to scroll, so the arrow keys\n // move it from rest to rest whatever its items hold. A scroll\n // container with nothing focusable inside is otherwise out of a\n // keyboard's reach, which axe's scrollable-region-focusable reports.\n // oxlint-disable-next-line jsx-a11y/no-noninteractive-tabindex -- see above\n tabIndex={end > 0 ? 0 : undefined} {...stylex.props(styles.scroller, focus.ring, !masked && styles.scrollerUncontained)}>\n {masked ? <div aria-hidden=\"true\" className=\"xjm9jq1 x1i1rx1s x13vifvy x1o0tod x47corl x10l6tqk x1bhewko\" /> : null}\n <div onFocus={reveal} {...{\n 0: {\n className: \"x9f619 x78zum5 x2lah0s x126z3so x1cmllll x790zyz\"\n },\n 1: {\n className: \"x9f619 x78zum5 x2lah0s x126z3so x1cmllll x790zyz xh8yej3 x1o0tod x7giv3 x7wzq59\"\n }\n }[!!masked << 0]}>\n {items.map((item, index) => <SlotContext key={item.key ?? index} value={slots[index] ?? null}>\n {item}\n </SlotContext>)}\n </div>\n {masked ? Array.from({\n length: arrangement.steps\n }, (_, rest) => <div aria-hidden=\"true\" key={rest} {...stylex.props(styles.marker, placed.marker(`${step}px`))} />) : null}\n </div>\n <div className=\"x9f619 x78zum5 x126z3so x13a6bvl x790zyz\">\n <IconButton aria-label={previousLabel ?? messages.previousSlide} isDisabled={scrolled <= 0.5} onPress={previous}>\n <ChevronEndGlyph className=\"xlzyvqe x1lliihq x15vhz18 x1pw7kks xpk2tj9\" />\n </IconButton>\n <IconButton aria-label={nextLabel ?? messages.nextSlide} isDisabled={scrolled >= end - 0.5} onPress={next}>\n <ChevronEndGlyph className=\"xlzyvqe x1lliihq x15vhz18 x19axjrm x1c071of\" />\n </IconButton>\n </div>\n </section>;\n}\n\n/**\n * One item. It is named by which of how many it is — \"2 of 6\" — unless it is\n * given an `aria-label` of its own.\n *\n * The call site's `className` and `style` land on the item.\n */\nfunction CarouselItem({\n children,\n ref,\n ...props\n}: CarouselItemProps & RefAttributes<HTMLDivElement>) {\n const messages = useMessages();\n const slot = useContext(SlotContext);\n const count = slot?.count ?? 1;\n const index = slot?.index ?? 0;\n const large = slot?.large ?? 0;\n const placement = slot?.placement;\n const inset = placement === undefined ? 0 : (large - placement.width) / 2;\n return <div aria-label={messages.slideLabel(index + 1, count)} aria-roledescription={messages.slide} ref={ref}\n // The pattern's own role for a slide. Its suggested `fieldset` is a\n // form's grouping, with a legend and a border of its own.\n // oxlint-disable-next-line jsx-a11y/prefer-tag-over-role -- see above\n role=\"group\" {...props} {...mergeStyles(stylex.props(styles.item, slot?.layout === 'uncontained' && styles.itemUncontained, slot?.layout === 'uncontained' && placed.uncontained(`${large}px`), placement !== undefined && placed.item(`${large}px`, `${placement.left - inset - index * (large + GAP)}px`, `inset(0 ${inset}px round ${radii.xl})`)), props)}>\n {children}\n </div>;\n}\n\n// The nearest rest that draws the item at `index` large, from the rest\n// nearest `scrolled`: the one it starts, for an item before the large ones,\n// or the one it ends, for an item after them. At rest `s` the large items\n// are `s` to `s + lastLarge`.\nfunction restRevealing(index: number, {\n lastLarge,\n scrolled,\n step\n}: Geometry): number {\n const at = Math.round(scrolled / step);\n if (index < at) {\n return index;\n }\n if (index > at + lastLarge) {\n return index - lastLarge;\n }\n return at;\n}\n\n// Scrolls to an offset along the text, whichever way it runs: a\n// right-to-left scroller counts its offset down from zero.\nfunction scrollAlong(scroller: HTMLElement | null, offset: number) {\n if (scroller === null) {\n return;\n }\n const sign = getComputedStyle(scroller).direction === 'rtl' ? -1 : 1;\n scroller.scrollTo({\n left: sign * offset\n });\n}\nCarousel.Item = CarouselItem;\nexport type { CarouselItemProps, CarouselLayout, CarouselProps };\nexport { CarouselItem };\nexport default Carousel;"],"mappings":";;;;;;;;;;;;;;AA4DA,MAAM2B,UAAU;AAChB,MAAMC,oBAAoB;AAqC1B,MAAMY,SAAS;CACbC,MAAM;EACJC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,OAAO;EACPC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,OAAO;CACT;CACAC,iBAAiB;EACfC,QAAQ;EACRF,OAAO;CACT;CACAG,QAAQ;EACNP,OAAO;EACPM,QAAQ;EACRF,OAAO;CACT;CACAI,UAAU;EACRC,QAAQ;EACRX,QAAQ;EACRY,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRV,QAAQ;EACRW,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRZ,OAAO;CACT;CACAa,qBAAqB;EACnBC,QAAQ;EAC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GAAG,EAAG,CAAC,GAAGtF,OAAK;CAAC,IAAAyB;CAAA,IAAA7B,EAAA,OAAAlE,YAAAkE,EAAA,OAAAK,SAAAmF,SAAAxF,EAAA,OAAAI,WAAAJ,EAAA,OAAAG,OAAAH,EAAA,OAAAC,MAAAD,EAAA,OAAA4B,IAAA;EAJtVC,KAAA,oBAAA,OAAA;GAAiB,cAAA5B;GAA6D,wBAAAC;GAAqBC;GAIrG,MAAAiB;GAAO,GAAKhB;GAAK,GAAMwB;GACvB9F;EACG,CAAA;EAAAkE,EAAA,KAAAlE;EAAAkE,EAAA,KAAAK,SAAAmF;EAAAxF,EAAA,KAAAI;EAAAJ,EAAA,KAAAG;EAAAH,EAAA,KAAAC;EAAAD,EAAA,KAAA4B;EAAA5B,EAAA,MAAA6B;CAAA,OAAAA,KAAA7B,EAAA;CAAA,OAND6B;AAMC;AAOV,SAASwB,cAAcxE,OAAe,EACpCM,WACAE,UACAC,QACmB;CACnB,MAAMqG,KAAKjG,KAAKC,MAAMN,WAAWC,IAAI;CACrC,IAAIT,QAAQ8G,IACV,OAAO9G;CAET,IAAIA,QAAQ8G,KAAKxG,WACf,OAAON,QAAQM;CAEjB,OAAOwG;AACT;AAIA,SAAStD,YAAYlF,UAA8BsC,QAAgB;CACjE,IAAItC,aAAa,MACf;CAEF,MAAMyI,OAAOC,iBAAiB1I,QAAQ,CAAC,CAACqC,cAAc,QAAQ,KAAK;CACnErC,SAAS2I,SAAS,EAChBL,MAAMG,OAAOnG,OACf,CAAC;AACH;AACAK,SAASiG,OAAOX"}
@@ -3,7 +3,7 @@ import { props } from "../../node_modules/@stylexjs/stylex/lib/es/stylex.js";
3
3
  import { mergeStatefulStyles } from "../../styles/merge.js";
4
4
  import { groupStyles } from "../../field/styles.js";
5
5
  import { FieldLabel } from "../../field/index.js";
6
- import { thumbClassName } from "../../styles/color.js";
6
+ import { thumbClassName, verticalThumbClassName } from "../../styles/color.js";
7
7
  import { chequer } from "../../styles/chequer.js";
8
8
  import { c } from "react/compiler-runtime";
9
9
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -14,6 +14,12 @@ const styles = {
14
14
  kzqmXN: "xh8yej3",
15
15
  $$css: true
16
16
  },
17
+ rootVertical: {
18
+ kGNEyG: "x1cy8zhl",
19
+ kZKoxP: "x1u5z0ei",
20
+ kzqmXN: "x14atkfc",
21
+ $$css: true
22
+ },
17
23
  trackGround: {
18
24
  kZKoxP: "xlup9mm",
19
25
  kaIpWk: "x1xdvaa9",
@@ -25,6 +31,15 @@ const styles = {
25
31
  trackGroundDisabled: {
26
32
  kSiTet: "x1ppv7y9",
27
33
  $$css: true
34
+ },
35
+ trackGroundVertical: {
36
+ kZKoxP: "xt7dq6l",
37
+ kzQI83: "x1iyjqo2",
38
+ kzqmXN: "x1kky2od",
39
+ kqGvvJ: "x10im51j",
40
+ kUOVxO: "xcwsfa8",
41
+ kAzted: "x2lwn1j",
42
+ $$css: true
28
43
  }
29
44
  };
30
45
  /**
@@ -49,7 +64,7 @@ const styles = {
49
64
  * which is the element a layout positions.
50
65
  */
51
66
  function ColorSlider$1(t0) {
52
- const $ = c(31);
67
+ const $ = c(35);
53
68
  let T0;
54
69
  let isDisabled;
55
70
  let label;
@@ -57,15 +72,17 @@ function ColorSlider$1(t0) {
57
72
  let t1;
58
73
  let t2;
59
74
  let t3;
75
+ let vertical;
60
76
  if ($[0] !== t0) {
61
77
  const { isDisabled: t4, label: t5, showValue: t6, ...props$1 } = t0;
62
78
  label = t5;
63
79
  isDisabled = t4 === void 0 ? false : t4;
64
80
  showValue = t6 === void 0 ? true : t6;
81
+ vertical = props$1.orientation === "vertical";
65
82
  T0 = ColorSlider;
66
83
  t1 = isDisabled;
67
84
  t2 = props$1;
68
- t3 = mergeStatefulStyles(props(groupStyles.root, styles.root), props$1);
85
+ t3 = mergeStatefulStyles(props(groupStyles.root, styles.root, vertical && styles.rootVertical), props$1);
69
86
  $[0] = t0;
70
87
  $[1] = T0;
71
88
  $[2] = isDisabled;
@@ -74,6 +91,7 @@ function ColorSlider$1(t0) {
74
91
  $[5] = t1;
75
92
  $[6] = t2;
76
93
  $[7] = t3;
94
+ $[8] = vertical;
77
95
  } else {
78
96
  T0 = $[1];
79
97
  isDisabled = $[2];
@@ -82,88 +100,95 @@ function ColorSlider$1(t0) {
82
100
  t1 = $[5];
83
101
  t2 = $[6];
84
102
  t3 = $[7];
103
+ vertical = $[8];
85
104
  }
86
105
  let t4;
87
- if ($[8] !== label) {
106
+ if ($[9] !== label) {
88
107
  t4 = label === void 0 ? null : /* @__PURE__ */ jsx(FieldLabel, {
89
108
  variant: "group",
90
109
  children: label
91
110
  });
92
- $[8] = label;
93
- $[9] = t4;
94
- } else t4 = $[9];
111
+ $[9] = label;
112
+ $[10] = t4;
113
+ } else t4 = $[10];
95
114
  let t5;
96
- if ($[10] !== showValue) {
115
+ if ($[11] !== showValue) {
97
116
  t5 = showValue ? /* @__PURE__ */ jsx(SliderOutput, { className: "x1w5n3ug x1yicsit x1b35g6e xwth0xh xybisxh xvc5jky" }) : null;
98
- $[10] = showValue;
99
- $[11] = t5;
100
- } else t5 = $[11];
117
+ $[11] = showValue;
118
+ $[12] = t5;
119
+ } else t5 = $[12];
101
120
  let t6;
102
- if ($[12] !== t4 || $[13] !== t5) {
121
+ if ($[13] !== t4 || $[14] !== t5) {
103
122
  t6 = /* @__PURE__ */ jsxs("div", {
104
123
  className: "x1pha0wt x78zum5 x126z3so",
105
124
  children: [t4, t5]
106
125
  });
107
- $[12] = t4;
108
- $[13] = t5;
109
- $[14] = t6;
110
- } else t6 = $[14];
126
+ $[13] = t4;
127
+ $[14] = t5;
128
+ $[15] = t6;
129
+ } else t6 = $[15];
111
130
  let t7;
112
- if ($[15] !== isDisabled) {
113
- t7 = props(chequer.ground, styles.trackGround, isDisabled && styles.trackGroundDisabled);
114
- $[15] = isDisabled;
115
- $[16] = t7;
116
- } else t7 = $[16];
131
+ if ($[16] !== isDisabled || $[17] !== vertical) {
132
+ t7 = props(chequer.ground, styles.trackGround, vertical && styles.trackGroundVertical, isDisabled && styles.trackGroundDisabled);
133
+ $[16] = isDisabled;
134
+ $[17] = vertical;
135
+ $[18] = t7;
136
+ } else t7 = $[18];
117
137
  let t8;
118
- if ($[17] === Symbol.for("react.memo_cache_sentinel")) {
138
+ if ($[19] === Symbol.for("react.memo_cache_sentinel")) {
119
139
  t8 = {
120
140
  0: { className: "x1cpjm7i x1mtdikz xm4btww x1hmns74 x5yr21d x9f619 x1ypdohk xh8yej3 x1n2onr6" },
121
- 1: { className: "x1cpjm7i x1mtdikz xm4btww x1hmns74 x5yr21d x9f619 xh8yej3 x1n2onr6 x1h6gzvc" }
141
+ 2: { className: "x1cpjm7i x1hmns74 x5yr21d x9f619 x1ypdohk xh8yej3 x1n2onr6 x1nc033x x8s3y0y" },
142
+ 1: { className: "x1cpjm7i x1mtdikz xm4btww x1hmns74 x5yr21d x9f619 xh8yej3 x1n2onr6 x1h6gzvc" },
143
+ 3: { className: "x1cpjm7i x1hmns74 x5yr21d x9f619 xh8yej3 x1n2onr6 x1nc033x x8s3y0y x1h6gzvc" }
122
144
  };
123
- $[17] = t8;
124
- } else t8 = $[17];
125
- const t9 = t8[!!isDisabled << 0];
126
- let t10;
127
- if ($[18] === Symbol.for("react.memo_cache_sentinel")) {
128
- t10 = /* @__PURE__ */ jsx(ColorThumb, { className: thumbClassName });
129
- $[18] = t10;
130
- } else t10 = $[18];
145
+ $[19] = t8;
146
+ } else t8 = $[19];
147
+ const t9 = t8[!!vertical << 1 | !!isDisabled << 0];
148
+ const t10 = vertical ? verticalThumbClassName : thumbClassName;
131
149
  let t11;
132
- if ($[19] !== t9) {
133
- t11 = /* @__PURE__ */ jsx(SliderTrack, {
134
- ...t9,
135
- children: t10
136
- });
137
- $[19] = t9;
138
- $[20] = t11;
139
- } else t11 = $[20];
150
+ if ($[20] !== t10) {
151
+ t11 = /* @__PURE__ */ jsx(ColorThumb, { className: t10 });
152
+ $[20] = t10;
153
+ $[21] = t11;
154
+ } else t11 = $[21];
140
155
  let t12;
141
- if ($[21] !== t11 || $[22] !== t7) {
142
- t12 = /* @__PURE__ */ jsx("div", {
143
- ...t7,
156
+ if ($[22] !== t11 || $[23] !== t9) {
157
+ t12 = /* @__PURE__ */ jsx(SliderTrack, {
158
+ ...t9,
144
159
  children: t11
145
160
  });
146
- $[21] = t11;
147
- $[22] = t7;
148
- $[23] = t12;
149
- } else t12 = $[23];
161
+ $[22] = t11;
162
+ $[23] = t9;
163
+ $[24] = t12;
164
+ } else t12 = $[24];
150
165
  let t13;
151
- if ($[24] !== T0 || $[25] !== t1 || $[26] !== t12 || $[27] !== t2 || $[28] !== t3 || $[29] !== t6) {
152
- t13 = /* @__PURE__ */ jsxs(T0, {
166
+ if ($[25] !== t12 || $[26] !== t7) {
167
+ t13 = /* @__PURE__ */ jsx("div", {
168
+ ...t7,
169
+ children: t12
170
+ });
171
+ $[25] = t12;
172
+ $[26] = t7;
173
+ $[27] = t13;
174
+ } else t13 = $[27];
175
+ let t14;
176
+ if ($[28] !== T0 || $[29] !== t1 || $[30] !== t13 || $[31] !== t2 || $[32] !== t3 || $[33] !== t6) {
177
+ t14 = /* @__PURE__ */ jsxs(T0, {
153
178
  isDisabled: t1,
154
179
  ...t2,
155
180
  ...t3,
156
- children: [t6, t12]
181
+ children: [t6, t13]
157
182
  });
158
- $[24] = T0;
159
- $[25] = t1;
160
- $[26] = t12;
161
- $[27] = t2;
162
- $[28] = t3;
163
- $[29] = t6;
183
+ $[28] = T0;
184
+ $[29] = t1;
164
185
  $[30] = t13;
165
- } else t13 = $[30];
166
- return t13;
186
+ $[31] = t2;
187
+ $[32] = t3;
188
+ $[33] = t6;
189
+ $[34] = t14;
190
+ } else t14 = $[34];
191
+ return t14;
167
192
  }
168
193
  //#endregion
169
194
  export { ColorSlider$1 as default };