@charcuterie/ui 3.33.0 → 3.34.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/README.md +30 -0
- package/dist/Board/Board.d.ts.map +1 -1
- package/dist/Board/Board.js +2 -2
- package/dist/Board/Board.js.map +1 -1
- package/dist/RangeSlider/RangeSlider.d.ts +117 -0
- package/dist/RangeSlider/RangeSlider.d.ts.map +1 -0
- package/dist/RangeSlider/RangeSlider.js +242 -0
- package/dist/RangeSlider/RangeSlider.js.map +1 -0
- package/dist/RangeSlider/rangeSliderValue.d.ts +102 -0
- package/dist/RangeSlider/rangeSliderValue.d.ts.map +1 -0
- package/dist/RangeSlider/rangeSliderValue.js +116 -0
- package/dist/RangeSlider/rangeSliderValue.js.map +1 -0
- package/dist/SegmentedControl/SegmentedControl.d.ts +12 -1
- package/dist/SegmentedControl/SegmentedControl.d.ts.map +1 -1
- package/dist/SegmentedControl/SegmentedControl.js +3 -3
- package/dist/SegmentedControl/SegmentedControl.js.map +1 -1
- package/dist/SegmentedControl/SegmentedOption.d.ts +2 -1
- package/dist/SegmentedControl/SegmentedOption.d.ts.map +1 -1
- package/dist/SegmentedControl/SegmentedOption.js +7 -2
- package/dist/SegmentedControl/SegmentedOption.js.map +1 -1
- package/dist/Slider/Slider.d.ts +6 -1
- package/dist/Slider/Slider.d.ts.map +1 -1
- package/dist/Slider/Slider.js +8 -22
- package/dist/Slider/Slider.js.map +1 -1
- package/dist/TimecodeInput/TimecodeInput.d.ts +88 -0
- package/dist/TimecodeInput/TimecodeInput.d.ts.map +1 -0
- package/dist/TimecodeInput/TimecodeInput.js +258 -0
- package/dist/TimecodeInput/TimecodeInput.js.map +1 -0
- package/dist/TimecodeInput/timecode.d.ts +132 -0
- package/dist/TimecodeInput/timecode.d.ts.map +1 -0
- package/dist/TimecodeInput/timecode.js +246 -0
- package/dist/TimecodeInput/timecode.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/sliderStyles.d.ts +39 -0
- package/dist/sliderStyles.d.ts.map +1 -0
- package/dist/sliderStyles.js +50 -0
- package/dist/sliderStyles.js.map +1 -0
- package/package.json +1 -1
- package/src/Board/Board.test.tsx +8 -0
- package/src/Board/Board.tsx +7 -1
- package/src/RangeSlider/RangeSlider.mdx +85 -0
- package/src/RangeSlider/RangeSlider.stories.tsx +346 -0
- package/src/RangeSlider/RangeSlider.test.tsx +452 -0
- package/src/RangeSlider/RangeSlider.tsx +595 -0
- package/src/RangeSlider/rangeSliderValue.test.ts +217 -0
- package/src/RangeSlider/rangeSliderValue.ts +185 -0
- package/src/SegmentedControl/SegmentedControl.stories.tsx +50 -0
- package/src/SegmentedControl/SegmentedControl.test.tsx +36 -1
- package/src/SegmentedControl/SegmentedControl.tsx +14 -0
- package/src/SegmentedControl/SegmentedOption.tsx +7 -0
- package/src/Slider/Slider.tsx +23 -29
- package/src/TimecodeInput/TimecodeInput.mdx +155 -0
- package/src/TimecodeInput/TimecodeInput.stories.tsx +304 -0
- package/src/TimecodeInput/TimecodeInput.test.tsx +279 -0
- package/src/TimecodeInput/TimecodeInput.tsx +493 -0
- package/src/TimecodeInput/timecode.test.ts +236 -0
- package/src/TimecodeInput/timecode.ts +391 -0
- package/src/index.ts +18 -0
- package/src/sliderStyles.ts +69 -0
- package/src/sourceRules.test.ts +25 -1
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The arithmetic behind `RangeSlider`: everything the second thumb
|
|
3
|
+
* adds to `Slider`'s, and nothing `Slider` already answers.
|
|
4
|
+
*
|
|
5
|
+
* The single-value functions are **called**, never re-derived —
|
|
6
|
+
* `snapToStep` and `clampToRange` come from `../Slider/sliderValue.ts`
|
|
7
|
+
* — so a range slider snaps on exactly the grid a plain slider snaps
|
|
8
|
+
* on. Anchoring on `min` rather than on zero, the re-clamp after a
|
|
9
|
+
* snap, and the float-step rounding are all already right there, and
|
|
10
|
+
* a second copy of them is a second set of edge cases to keep in
|
|
11
|
+
* agreement.
|
|
12
|
+
*
|
|
13
|
+
* Every function here is total. A caller may hand over a reversed
|
|
14
|
+
* range, a `NaN`, or a start past its end, and the answer is still a
|
|
15
|
+
* pair of numbers inside `[min, max]` with `start <= end`. A range
|
|
16
|
+
* that renders `inline-size: NaN%` paints nothing and the DOM says
|
|
17
|
+
* nothing about it.
|
|
18
|
+
*/
|
|
19
|
+
import { clampToRange, snapToStep, } from "../Slider/sliderValue.js";
|
|
20
|
+
/**
|
|
21
|
+
* Both ends snapped to the step grid, clamped into the range, and put
|
|
22
|
+
* in order.
|
|
23
|
+
*
|
|
24
|
+
* The ordering is not a nicety. `value` **seeds** rather than
|
|
25
|
+
* controls, exactly as `Slider`'s does, so the pair arrives from an
|
|
26
|
+
* app's state and an app can hold `{ end: 20, start: 80 }` for a
|
|
27
|
+
* frame — a text field committing a typed start before the end
|
|
28
|
+
* catches up is the ordinary way to reach it. A backwards pair paints
|
|
29
|
+
* a fill of negative width, which is invisible rather than wrong-
|
|
30
|
+
* looking, so it is corrected here instead.
|
|
31
|
+
*/
|
|
32
|
+
export const snapRange = (range, { max, min, step }) => {
|
|
33
|
+
const first = snapToStep(range.start, min, max, step);
|
|
34
|
+
const second = snapToStep(range.end, min, max, step);
|
|
35
|
+
return {
|
|
36
|
+
end: Math.max(first, second),
|
|
37
|
+
start: Math.min(first, second),
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* The range with one thumb moved to `next`, clamped at the other one.
|
|
42
|
+
*
|
|
43
|
+
* **The thumbs clamp; they do not swap.** A thumb pushed past its
|
|
44
|
+
* partner stops on it, keeps its own identity, and the range collapses
|
|
45
|
+
* to zero width rather than turning inside out. Swapping is the other
|
|
46
|
+
* defensible answer and is the wrong one for the first consumer: the
|
|
47
|
+
* thumbs are a clip's start and its end, a QueuePilot user drags them
|
|
48
|
+
* against a `TimecodeInput` showing which is which, and a drag that
|
|
49
|
+
* silently renamed the handle under the pointer would move a number
|
|
50
|
+
* the user is reading somewhere else. Keyboard makes it plainer still
|
|
51
|
+
* — swapping means one ArrowRight moves the *other* thumb, and the
|
|
52
|
+
* focused element is no longer the value that changed.
|
|
53
|
+
*
|
|
54
|
+
* The snap happens on the **global** grid before the clamp, never on
|
|
55
|
+
* a grid anchored at the other thumb: the partner is already on the
|
|
56
|
+
* grid, so clamping to it lands on the grid too, while snapping
|
|
57
|
+
* against a moving anchor would put the two thumbs on different
|
|
58
|
+
* ladders.
|
|
59
|
+
*/
|
|
60
|
+
export const moveThumb = ({ bounds, next, range, thumb, }) => {
|
|
61
|
+
const ordered = snapRange(range, bounds);
|
|
62
|
+
const snapped = snapToStep(next, bounds.min, bounds.max, bounds.step);
|
|
63
|
+
if (thumb === "start") {
|
|
64
|
+
return {
|
|
65
|
+
end: ordered.end,
|
|
66
|
+
start: clampToRange(snapped, Math.min(bounds.min, bounds.max), ordered.end),
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
return {
|
|
70
|
+
end: clampToRange(snapped, ordered.start, Math.max(bounds.min, bounds.max)),
|
|
71
|
+
start: ordered.start,
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
/**
|
|
75
|
+
* The thumb a press at `at` should pick up.
|
|
76
|
+
*
|
|
77
|
+
* The nearer one, and the tie is the interesting half: two thumbs
|
|
78
|
+
* sitting on the same value are the state the clamping rule makes
|
|
79
|
+
* reachable, and a rule that always picked the same one would leave a
|
|
80
|
+
* collapsed range stuck against whichever end it collapsed on. So a
|
|
81
|
+
* tie is broken by **which side of them the press landed on** —
|
|
82
|
+
* below picks the start, on or above picks the end — which is what
|
|
83
|
+
* lets a collapsed pair be pulled open in either direction.
|
|
84
|
+
*/
|
|
85
|
+
export const getNearerThumb = ({ at, range, }) => {
|
|
86
|
+
const toStart = Math.abs(at - range.start);
|
|
87
|
+
const toEnd = Math.abs(at - range.end);
|
|
88
|
+
if (toStart < toEnd)
|
|
89
|
+
return "start";
|
|
90
|
+
if (toEnd < toStart)
|
|
91
|
+
return "end";
|
|
92
|
+
return at < range.start ? "start" : "end";
|
|
93
|
+
};
|
|
94
|
+
/**
|
|
95
|
+
* What one thumb may report as its own `aria-valuemin` /
|
|
96
|
+
* `aria-valuemax`.
|
|
97
|
+
*
|
|
98
|
+
* The other thumb is the bound, which is how the clamping rule
|
|
99
|
+
* reaches assistive technology at all: a screen reader reading
|
|
100
|
+
* "12 of 0 to 30" on the start thumb is being told, in the only
|
|
101
|
+
* vocabulary a slider has, that 30 is where this handle stops. The
|
|
102
|
+
* APG's multi-thumb pattern asks for exactly this.
|
|
103
|
+
*/
|
|
104
|
+
export const getThumbBounds = ({ bounds, range, thumb, }) => {
|
|
105
|
+
const ordered = snapRange(range, bounds);
|
|
106
|
+
return thumb === "start"
|
|
107
|
+
? {
|
|
108
|
+
max: ordered.end,
|
|
109
|
+
min: Math.min(bounds.min, bounds.max),
|
|
110
|
+
}
|
|
111
|
+
: {
|
|
112
|
+
max: Math.max(bounds.min, bounds.max),
|
|
113
|
+
min: ordered.start,
|
|
114
|
+
};
|
|
115
|
+
};
|
|
116
|
+
//# sourceMappingURL=rangeSliderValue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rangeSliderValue.js","sourceRoot":"","sources":["../../src/RangeSlider/rangeSliderValue.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EACL,YAAY,EACZ,UAAU,GACX,MAAM,0BAA0B,CAAA;AAgBjC;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,CACvB,KAAuB,EACvB,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAqB,EACnB,EAAE;IACpB,MAAM,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,CAAA;IAErD,MAAM,MAAM,GAAG,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K,CAAC,CAAA;IAE1C,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,EAAE,GAAG,KAAK,CAAC,GAAG,CAAC,CAAA;IAEtC,IAAI,OAAO,GAAG,KAAK;QAAE,OAAO,OAAO,CAAA;IAEnC,IAAI,KAAK,GAAG,OAAO;QAAE,OAAO,KAAK,CAAA;IAEjC,OAAO,EAAE,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAA;AAC3C,CAAC,CAAA;AAED;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,EAC7B,MAAM,EACN,KAAK,EACL,KAAK,GAKN,EAAgC,EAAE;IACjC,MAAM,OAAO,GAAG,SAAS,CAAC,KAAK,EAAE,MAAM,CAAC,CAAA;IAExC,OAAO,KAAK,KAAK,OAAO;QACtB,CAAC,CAAC;YACE,GAAG,EAAE,OAAO,CAAC,GAAG;YAChB,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,GAAG,CAAC;SACtC;QACH,CAAC,CAAC;YACE,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,GAAG,CAAC;YACrC,GAAG,EAAE,OAAO,CAAC,KAAK;SACnB,CAAA;AACP,CAAC,CAAA"}
|
|
@@ -13,6 +13,17 @@ export type SegmentedItem = {
|
|
|
13
13
|
};
|
|
14
14
|
export type SegmentedControlProps = {
|
|
15
15
|
className?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Fill the available inline space, with every option claiming an
|
|
18
|
+
* equal share. A board's Narrow View selector needs this: its
|
|
19
|
+
* options name the only lane on screen, so a content-width strip
|
|
20
|
+
* leaves the rest of the board looking disconnected.
|
|
21
|
+
*
|
|
22
|
+
* The default stays content-width. Most segmented controls choose
|
|
23
|
+
* a compact view or density, where stretching three short words
|
|
24
|
+
* across a whole toolbar would weaken their grouping.
|
|
25
|
+
*/
|
|
26
|
+
isFullWidth?: boolean;
|
|
16
27
|
items: readonly SegmentedItem[];
|
|
17
28
|
/** The group's accessible name. Required. */
|
|
18
29
|
label: string;
|
|
@@ -55,5 +66,5 @@ export type SegmentedControlProps = {
|
|
|
55
66
|
* Space's behaviour trivial rather than a special case: it checks
|
|
56
67
|
* whatever focus is on, whether or not focus moved there by arrow.
|
|
57
68
|
*/
|
|
58
|
-
export declare const SegmentedControl: ({ className, items, label, onChange, selectedValue, size, }: SegmentedControlProps) => ReactNode;
|
|
69
|
+
export declare const SegmentedControl: ({ className, isFullWidth, items, label, onChange, selectedValue, size, }: SegmentedControlProps) => ReactNode;
|
|
59
70
|
//# sourceMappingURL=SegmentedControl.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SegmentedControl.d.ts","sourceRoot":"","sources":["../../src/SegmentedControl/SegmentedControl.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACtD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAMtC,MAAM,MAAM,aAAa,GAAG;IAC1B;;;;;OAKG;IACH,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,KAAK,EAAE,SAAS,CAAA;IAChB,KAAK,EAAE,MAAM,CAAA;CACd,CAAA;AAED,MAAM,MAAM,qBAAqB,GAAG;IAClC,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,KAAK,EAAE,SAAS,aAAa,EAAE,CAAA;IAC/B,6CAA6C;IAC7C,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,CAAC,aAAa,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAA;IACjD,0DAA0D;IAC1D,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,IAAI,CAAC,EAAE,WAAW,CAAA;CACnB,CAAA;AAQD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,eAAO,MAAM,gBAAgB,GAAI,
|
|
1
|
+
{"version":3,"file":"SegmentedControl.d.ts","sourceRoot":"","sources":["../../src/SegmentedControl/SegmentedControl.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACtD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAMtC,MAAM,MAAM,aAAa,GAAG;IAC1B;;;;;OAKG;IACH,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,KAAK,EAAE,SAAS,CAAA;IAChB,KAAK,EAAE,MAAM,CAAA;CACd,CAAA;AAED,MAAM,MAAM,qBAAqB,GAAG;IAClC,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;;;;;;;;OASG;IACH,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,KAAK,EAAE,SAAS,aAAa,EAAE,CAAA;IAC/B,6CAA6C;IAC7C,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,CAAC,aAAa,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAA;IACjD,0DAA0D;IAC1D,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,IAAI,CAAC,EAAE,WAAW,CAAA;CACnB,CAAA;AAQD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,eAAO,MAAM,gBAAgB,GAAI,0EAQ9B,qBAAqB,KAAG,SA0I1B,CAAA"}
|
|
@@ -42,7 +42,7 @@ const GAP_CLASS = {
|
|
|
42
42
|
* Space's behaviour trivial rather than a special case: it checks
|
|
43
43
|
* whatever focus is on, whether or not focus moved there by arrow.
|
|
44
44
|
*/
|
|
45
|
-
export const SegmentedControl = ({ className, items, label, onChange, selectedValue, size = "md", }) => {
|
|
45
|
+
export const SegmentedControl = ({ className, isFullWidth = false, items, label, onChange, selectedValue, size = "md", }) => {
|
|
46
46
|
const groupRef = useRef(null);
|
|
47
47
|
const optionElements = useRef(new Map());
|
|
48
48
|
const initialValue = selectedValue ??
|
|
@@ -86,7 +86,7 @@ export const SegmentedControl = ({ className, items, label, onChange, selectedVa
|
|
|
86
86
|
}
|
|
87
87
|
optionElements.current.get(activeValue)?.focus();
|
|
88
88
|
}, [activeValue]);
|
|
89
|
-
return (_jsx("div", { "aria-label": label, className: toClassName("inline-flex items-center rounded-md border border-border-subtle bg-surface-sunken p-0.5", GAP_CLASS[size], className), onKeyDown: (keyEvent) => {
|
|
89
|
+
return (_jsx("div", { "aria-label": label, className: toClassName("inline-flex items-center rounded-md border border-border-subtle bg-surface-sunken p-0.5", isFullWidth && "w-full flex-wrap", GAP_CLASS[size], className), onKeyDown: (keyEvent) => {
|
|
90
90
|
const commands = {
|
|
91
91
|
ArrowDown: focus.next,
|
|
92
92
|
ArrowLeft: focus.previous,
|
|
@@ -112,7 +112,7 @@ export const SegmentedControl = ({ className, items, label, onChange, selectedVa
|
|
|
112
112
|
keyEvent.preventDefault();
|
|
113
113
|
select(activeValue);
|
|
114
114
|
}
|
|
115
|
-
}, ref: groupRef, role: "radiogroup", children: items.map((item) => (_jsx(SegmentedOption, { isChecked: checkedValue === item.value, item: item, onChoose: chooseOption, registerFocus: focus.register, registerSelection: selection.register, size: size,
|
|
115
|
+
}, ref: groupRef, role: "radiogroup", children: items.map((item) => (_jsx(SegmentedOption, { isChecked: checkedValue === item.value, isFullWidth: isFullWidth, item: item, onChoose: chooseOption, registerFocus: focus.register, registerSelection: selection.register, size: size,
|
|
116
116
|
// The roving-tabindex rule read from the core rather than
|
|
117
117
|
// restated here: exactly one option is in the tab order,
|
|
118
118
|
// so Tab enters and leaves the group once while the arrow
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SegmentedControl.js","sourceRoot":"","sources":["../../src/SegmentedControl/SegmentedControl.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,cAAc,EACd,cAAc,EACd,eAAe,GAChB,MAAM,oBAAoB,CAAA;AAG3B,OAAO,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C/B,IAAI,OAAO,EAAE,CAAC;oBACZ,cAAc,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,OAAO,CAAC,CAAA;gBAC5C,CAAC;qBAAM,CAAC;oBACN,cAAc,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;gBACtC,CAAC;YACH,CAAC,IAhBI,IAAI,CAAC,KAAK,CAiBf,CACH,CAAC,GACE,CACP,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -3,6 +3,7 @@ import type { ReactNode } from "react";
|
|
|
3
3
|
import type { SegmentedItem } from "./SegmentedControl.tsx";
|
|
4
4
|
export type SegmentedOptionProps = {
|
|
5
5
|
isChecked: boolean;
|
|
6
|
+
isFullWidth: boolean;
|
|
6
7
|
item: SegmentedItem;
|
|
7
8
|
onChoose: (value: string) => void;
|
|
8
9
|
/** `RovingFocus.register` — membership of the arrow-key group. */
|
|
@@ -24,5 +25,5 @@ export type SegmentedOptionProps = {
|
|
|
24
25
|
* display — and a one-shade difference does not survive that or a
|
|
25
26
|
* `daylight` theme in sunlight.
|
|
26
27
|
*/
|
|
27
|
-
export declare const SegmentedOption: ({ isChecked, item, onChoose, registerFocus, registerSelection, size, tabIndex, trackElement, }: SegmentedOptionProps) => ReactNode;
|
|
28
|
+
export declare const SegmentedOption: ({ isChecked, isFullWidth, item, onChoose, registerFocus, registerSelection, size, tabIndex, trackElement, }: SegmentedOptionProps) => ReactNode;
|
|
28
29
|
//# sourceMappingURL=SegmentedOption.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SegmentedOption.d.ts","sourceRoot":"","sources":["../../src/SegmentedControl/SegmentedOption.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACtD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAMtC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAA;AAE3D,M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,CACZ,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,iBAAiB,GAAG,IAAI,KAC9B,IAAI,CAAA;CACV,CAAA;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,eAAe,GAAI,6GAU7B,oBAAoB,KAAG,SAqDzB,CAAA"}
|
|
@@ -14,7 +14,7 @@ import { toClassName } from "../toClassName.js";
|
|
|
14
14
|
* display — and a one-shade difference does not survive that or a
|
|
15
15
|
* `daylight` theme in sunlight.
|
|
16
16
|
*/
|
|
17
|
-
export const SegmentedOption = ({ isChecked, item, onChoose, registerFocus, registerSelection, size, tabIndex, trackElement, }) => {
|
|
17
|
+
export const SegmentedOption = ({ isChecked, isFullWidth, item, onChoose, registerFocus, registerSelection, size, tabIndex, trackElement, }) => {
|
|
18
18
|
const { isDisabled = false, label, value } = item;
|
|
19
19
|
useEffect(() => registerSelection(value), [registerSelection, value]);
|
|
20
20
|
useEffect(() => {
|
|
@@ -23,7 +23,12 @@ export const SegmentedOption = ({ isChecked, item, onChoose, registerFocus, regi
|
|
|
23
23
|
}
|
|
24
24
|
return registerFocus(value);
|
|
25
25
|
}, [isDisabled, registerFocus, value]);
|
|
26
|
-
return (_jsx("button", { "aria-checked": isChecked, className: toClassName("cursor-pointer rounded-sm border border-transparent font-medium tabular-nums transition-colors duration-(--duration-fast) ease-standard",
|
|
26
|
+
return (_jsx("button", { "aria-checked": isChecked, className: toClassName("cursor-pointer rounded-sm border border-transparent font-medium tabular-nums transition-colors duration-(--duration-fast) ease-standard",
|
|
27
|
+
// In a very narrow board, three full labels cannot share
|
|
28
|
+
// one row. The minimum lets two fit, then the final option
|
|
29
|
+
// takes a full second row instead of wrapping its label or
|
|
30
|
+
// leaving unused space beside it.
|
|
31
|
+
isFullWidth && "min-w-28 flex-1 basis-28", CONTROL_SIZE_CLASS[size],
|
|
27
32
|
// Two entries rather than one interpolated string:
|
|
28
33
|
// `tailwindCandidates.test.ts` rejects a template literal in
|
|
29
34
|
// a className outright, because Tailwind's scanner cannot
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SegmentedOption.js","sourceRoot":"","sources":["../../src/SegmentedControl/SegmentedOption.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEjC,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAA;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"SegmentedOption.js","sourceRoot":"","sources":["../../src/SegmentedControl/SegmentedOption.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEjC,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAA;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAoB/C;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,EAC9B,SAAS,EACT,WAAW,EACX,IAAI,EACJ,QAAQ,EACR,aAAa,EACb,iBAAiB,EACjB,IAAI,EACJ,QAAQ,EACR,YAAY,GACS,EAAa,EAAE;IACpC,MAAM,EAAE,UAAU,GAAG,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,IAAI,CAAA;IAEjD,SAAS,CACP,GAAG,EAAE,CAAC,iBAAiB,CAAC,KAAK,CAAC,EAC9B,CAAC,iBAAiB,EAAE,KAAK,CAAC,CAC3B,CAAA;IAED,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,UAAU,EAAE,CAAC;YACf,OAAM;QACR,CAAC;QAED,OAAO,aAAa,CAAC,KAAK,CAAC,CAAA;IAC7B,CAAC,EAAE,CAAC,UAAU,EAAE,aAAa,EAAE,KAAK,CAAC,CAAC,CAAA;IAEtC,OAAO,CAEL,iCACgB,SAAS,EACvB,SAAS,EAAE,WAAW,CACpB,yIAAyI;QACzI,yDAAyD;QACzD,2DAA2D;QAC3D,2DAA2D;QAC3D,kCAAkC;QAClC,WAAW,IAAI,0BAA0B,EACzC,kBAAkB,CAAC,IAAI,CAAC;QACxB,mDAAmD;QACnD,6DAA6D;QAC7D,0DAA0D;QAC1D,2CAA2C;QAC3C,SAAS;YACP,CAAC,CAAC,oDAAoD;YACtD,CAAC,CAAC,mFAAmF,EACvF,UAAU;YACR,2FAA2F,EAC7F,gBAAgB,CACjB,EACD,QAAQ,EAAE,UAAU,EACpB,OAAO,EAAE,GAAG,EAAE;YACZ,QAAQ,CAAC,KAAK,CAAC,CAAA;QACjB,CAAC,EACD,GAAG,EAAE,CAAC,OAAO,EAAE,EAAE;YACf,YAAY,CAAC,KAAK,EAAE,OAAO,CAAC,CAAA;QAC9B,CAAC,EACD,IAAI,EAAC,OAAO,EACZ,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAC,QAAQ,YAEZ,KAAK,GACC,CACV,CAAA;AACH,CAAC,CAAA"}
|
package/dist/Slider/Slider.d.ts
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import type { IntentName } from "@charcuterie/tokens";
|
|
2
2
|
import type { ComponentPropsWithRef, ReactNode } from "react";
|
|
3
|
-
|
|
3
|
+
import type { SliderSize } from "../sliderStyles.ts";
|
|
4
|
+
/**
|
|
5
|
+
* Re-exported rather than declared here: the three sizes are the bar's,
|
|
6
|
+
* and `RangeSlider` paints the same bar from `../sliderStyles.ts`.
|
|
7
|
+
*/
|
|
8
|
+
export type { SliderSize };
|
|
4
9
|
export type SliderProps = Omit<ComponentPropsWithRef<"div">, "children" | "defaultValue" | "onChange"> & {
|
|
5
10
|
intent?: IntentName;
|
|
6
11
|
isDisabled?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Slider.d.ts","sourceRoot":"","sources":["../../src/Slider/Slider.tsx"],"names":[],"mapp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E,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAA;CACxC,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,eAAO,MAAM,MAAM,GAAI,6KAkBpB,WAAW,KAAG,SAyQhB,CAAA"}
|
package/dist/Slider/Slider.js
CHANGED
|
@@ -2,25 +2,10 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { useUniqueId } from "@charcuterie/logic";
|
|
3
3
|
import { useRef, useState } from "react";
|
|
4
4
|
import { FOCUS_RING_CLASS, INTENT_SOLID_FILL_CLASS, } from "../intentStyles.js";
|
|
5
|
+
import { SLIDER_ROW_CLASS, SLIDER_THUMB_CLASS, SLIDER_THUMB_OFFSET, SLIDER_THUMB_SIZE_CLASS, SLIDER_TRACK_CLASS, SLIDER_TRACK_SIZE_CLASS, } from "../sliderStyles.js";
|
|
5
6
|
import { toClassName } from "../toClassName.js";
|
|
6
7
|
import { VisuallyHidden } from "../VisuallyHidden/VisuallyHidden.js";
|
|
7
8
|
import { clampToRange, fromFraction, snapToStep, toPercent, } from "./sliderValue.js";
|
|
8
|
-
const TRACK_SIZE_CLASS = {
|
|
9
|
-
sm: "h-1",
|
|
10
|
-
md: "h-2",
|
|
11
|
-
lg: "h-3",
|
|
12
|
-
};
|
|
13
|
-
const THUMB_SIZE_CLASS = {
|
|
14
|
-
sm: "size-3",
|
|
15
|
-
md: "size-4",
|
|
16
|
-
lg: "size-5",
|
|
17
|
-
};
|
|
18
|
-
/** Half of each `THUMB_SIZE_CLASS`, as the inline-start pull-back. */
|
|
19
|
-
const THUMB_OFFSET = {
|
|
20
|
-
sm: "-0.375rem",
|
|
21
|
-
md: "-0.5rem",
|
|
22
|
-
lg: "-0.625rem",
|
|
23
|
-
};
|
|
24
9
|
/**
|
|
25
10
|
* A single-value range control: the thing `<input type="range">` is,
|
|
26
11
|
* without the OS painting it.
|
|
@@ -159,10 +144,11 @@ export const Slider = ({ className, intent = "accent", isDisabled = false, isLab
|
|
|
159
144
|
// `role`, ARIA, keyboard and axe are all correct on a control
|
|
160
145
|
// 16px wide. `<input type="range">` has an intrinsic default
|
|
161
146
|
// width for the same reason; this is ours.
|
|
162
|
-
"min-w-40", className), children: [isLabelVisible || isValueShown ? (_jsxs("div", { className: "flex items-baseline justify-between gap-2 text-sm", children: [isLabelVisible ? (_jsx("span", { className: "text-content-secondary", id: labelId, children: label })) : (_jsx(VisuallyHidden, { id: labelId, children: label })), isValueShown ? (_jsx("span", { className: "text-content-muted tabular-nums", children: valueText ?? shown })) : null] })) : (_jsx(VisuallyHidden, { id: labelId, children: label })), _jsxs("div", { "aria-disabled": isDisabled || undefined, "aria-labelledby": labelId, "aria-orientation": "horizontal", "aria-readonly": isReadOnly || undefined, "aria-valuemax": Math.max(min, max), "aria-valuemin": Math.min(min, max), "aria-valuenow": shown, "aria-valuetext": valueText, className: toClassName(
|
|
163
|
-
// The
|
|
164
|
-
//
|
|
165
|
-
|
|
147
|
+
"min-w-40", className), children: [isLabelVisible || isValueShown ? (_jsxs("div", { className: "flex items-baseline justify-between gap-2 text-sm", children: [isLabelVisible ? (_jsx("span", { className: "text-content-secondary", id: labelId, children: label })) : (_jsx(VisuallyHidden, { id: labelId, children: label })), isValueShown ? (_jsx("span", { className: "text-content-muted tabular-nums", children: valueText ?? shown })) : null] })) : (_jsx(VisuallyHidden, { id: labelId, children: label })), _jsxs("div", { "aria-disabled": isDisabled || undefined, "aria-labelledby": labelId, "aria-orientation": "horizontal", "aria-readonly": isReadOnly || undefined, "aria-valuemax": Math.max(min, max), "aria-valuemin": Math.min(min, max), "aria-valuenow": shown, "aria-valuetext": valueText, className: toClassName(
|
|
148
|
+
// The bar, shared with `RangeSlider` through
|
|
149
|
+
// `../sliderStyles.ts` — including the hit area being the
|
|
150
|
+
// row rather than the 2px track.
|
|
151
|
+
SLIDER_ROW_CLASS, FOCUS_RING_CLASS,
|
|
166
152
|
// NOT `ARIA_DISABLED_CLASS`. That constant paints a
|
|
167
153
|
// box-shaped control — `bg-surface-sunken` plus a border —
|
|
168
154
|
// which is right for `ButtonLink` and wrong here: a slider's
|
|
@@ -176,7 +162,7 @@ export const Slider = ({ className, intent = "accent", isDisabled = false, isLab
|
|
|
176
162
|
// `:disabled` the hover rules still match.
|
|
177
163
|
isDisabled
|
|
178
164
|
? "pointer-events-none opacity-55"
|
|
179
|
-
: "", isReadOnly ? "cursor-default" : ""), onKeyDown: onKeyDown, onPointerCancel: onPointerUp, onPointerDown: onPointerDown, onPointerMove: onPointerMove, onPointerUp: onPointerUp, ref: trackRef, role: "slider", tabIndex: isDisabled ? -1 : 0, children: [_jsx("span", { className: toClassName(
|
|
165
|
+
: "", isReadOnly ? "cursor-default" : ""), onKeyDown: onKeyDown, onPointerCancel: onPointerUp, onPointerDown: onPointerDown, onPointerMove: onPointerMove, onPointerUp: onPointerUp, ref: trackRef, role: "slider", tabIndex: isDisabled ? -1 : 0, children: [_jsx("span", { className: toClassName(SLIDER_TRACK_CLASS, SLIDER_TRACK_SIZE_CLASS[size]), children: _jsx("span", { className: toClassName("block h-full rounded-full", INTENT_SOLID_FILL_CLASS[intent]), style: { inlineSize: `${percent}%` } }) }), _jsx("span", { "aria-hidden": "true", className: toClassName(SLIDER_THUMB_CLASS, SLIDER_THUMB_SIZE_CLASS[size], INTENT_SOLID_FILL_CLASS[intent]),
|
|
180
166
|
// Pulled back by half its own width so it sits ON the
|
|
181
167
|
// position rather than starting at it, which is what keeps
|
|
182
168
|
// 100% from hanging off the end of the track.
|
|
@@ -187,7 +173,7 @@ export const Slider = ({ className, intent = "accent", isDisabled = false, isLab
|
|
|
187
173
|
// logical `inset-inline-start` looks like it already solved.
|
|
188
174
|
style: {
|
|
189
175
|
insetInlineStart: `${percent}%`,
|
|
190
|
-
marginInlineStart:
|
|
176
|
+
marginInlineStart: SLIDER_THUMB_OFFSET[size],
|
|
191
177
|
} })] })] }));
|
|
192
178
|
};
|
|
193
179
|
//# sourceMappingURL=Slider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Slider.js","sourceRoot":"","sources":["../../src/Slider/Slider.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAQhD,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAExC,OAAO,EACL,gBAAgB,EAChB,uBAAuB,GACxB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAsC,CAAA;AACrE,OAAO,EACL,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,SAAS,GACV,MAAM,kBAAkB,CAAA;
|
|
1
|
+
{"version":3,"file":"Slider.js","sourceRoot":"","sources":["../../src/Slider/Slider.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAQhD,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAExC,OAAO,EACL,gBAAgB,EAChB,uBAAuB,GACxB,MAAM,oBAAoB,CAAA;AAE3B,OAAO,EACL,gBAAgB,EAChB,kBAAkB,EAClB,mBAAmB,EACnB,uBAAuB,EACvB,kBAAkB,EAClB,uBAAuB,GACxB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAsC,CAAA;AACrE,OAAO,EACL,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,SAAS,GACV,MAAM,kBAAkB,CAAA;AA0DzB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,EACrB,SAAS,EACT,MAAM,GAAG,QAAQ,EACjB,UAAU,GAAG,KAAK,EAClB,cAAc,GAAG,KAAK,EACt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|
+
import type { SlotProps } from "../slotProps.ts";
|
|
4
|
+
import type { TimecodeRange } from "./timecode.ts";
|
|
5
|
+
export type TimecodeInputProps = SlotProps & {
|
|
6
|
+
className?: string;
|
|
7
|
+
/**
|
|
8
|
+
* How long the media is. It is the default `maxValueMs`, so a
|
|
9
|
+
* consumer that knows the file's length gets the clamp without
|
|
10
|
+
* stating a bound twice.
|
|
11
|
+
*/
|
|
12
|
+
durationMs?: number;
|
|
13
|
+
isDisabled?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Section mode — a start and an end. A **mode, not a sibling
|
|
16
|
+
* component**, following `DatePicker`'s `isRange` and `Combobox`'s
|
|
17
|
+
* `isMultiple`.
|
|
18
|
+
*/
|
|
19
|
+
isRange?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Required. In section mode it names **both** inputs, as
|
|
22
|
+
* "<label> start" and "<label> end", so the two stay separately
|
|
23
|
+
* addressable by a screen reader and by an agent.
|
|
24
|
+
*/
|
|
25
|
+
label: string;
|
|
26
|
+
/** The end of the allowed window. Defaults to `durationMs`. */
|
|
27
|
+
maxValueMs?: number;
|
|
28
|
+
/** The start of the allowed window. Defaults to `0`. */
|
|
29
|
+
minValueMs?: number;
|
|
30
|
+
/**
|
|
31
|
+
* Milliseconds in single mode, a `{ end, start }` of them in
|
|
32
|
+
* section mode, and `null` when both ends are cleared.
|
|
33
|
+
*/
|
|
34
|
+
onChange?: (value: null | number | TimecodeRange) => void;
|
|
35
|
+
placeholder?: string;
|
|
36
|
+
size?: ControlSize;
|
|
37
|
+
/** How far ArrowUp and ArrowDown move. Shift multiplies it by ten. */
|
|
38
|
+
stepMs?: number;
|
|
39
|
+
/** **Initial** only, like every other value prop in this library. */
|
|
40
|
+
valueMs?: number | TimecodeRange;
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* A timecode field: a text input a person can actually type a media
|
|
44
|
+
* position into, with an `isRange` mode for a section of a file.
|
|
45
|
+
*
|
|
46
|
+
* ### Why this is a text field and not `<input type="time">`
|
|
47
|
+
*
|
|
48
|
+
* Two reasons and neither is taste.
|
|
49
|
+
*
|
|
50
|
+
* A `time` input's smallest step is a **second** unless `step` is
|
|
51
|
+
* fractional, its value is a wall-clock `HH:MM` string capped at 24
|
|
52
|
+
* hours, and it has no way to express "1.5 hours into a file" as a
|
|
53
|
+
* duration rather than as half past one. A clip boundary in a video
|
|
54
|
+
* editor is milliseconds; the platform control cannot carry them.
|
|
55
|
+
*
|
|
56
|
+
* And it is painted by the operating system, from
|
|
57
|
+
* `::-webkit-datetime-edit-*` pseudo-elements no token reaches
|
|
58
|
+
* inside — the same mechanism that
|
|
59
|
+
* [deprecated the native `Select`](../../../../docs/decisions/2026-08-20-native-select-is-deprecated-and-the-platform-hatch-is-closed.md)
|
|
60
|
+
* and that kept `Slider` off
|
|
61
|
+
* [`<input type="range">`](../../../../docs/decisions/2026-08-22-the-slider-is-a-div-with-role-slider-not-an-input-range.md).
|
|
62
|
+
* A `<input type="text">` this component owns every pixel of is the
|
|
63
|
+
* settled answer to that shape of question.
|
|
64
|
+
*
|
|
65
|
+
* ### Typing is the whole interface, so nothing guesses in silence
|
|
66
|
+
*
|
|
67
|
+
* `90`, `1:30`, `1:02:03` and `1:02:03.500` all resolve, and the
|
|
68
|
+
* resolution is echoed underneath the field, in a live region, before
|
|
69
|
+
* anything commits. Commit is Enter or blur; a keystroke never
|
|
70
|
+
* commits, a refused value leaves the text exactly as typed, and
|
|
71
|
+
* Escape puts back the last committed value. `timecode.ts` is the
|
|
72
|
+
* grammar and the reasoning.
|
|
73
|
+
*
|
|
74
|
+
* ### Both ends of a section are independently optional
|
|
75
|
+
*
|
|
76
|
+
* `{ end, start }` has four real states, not three plus an error: no
|
|
77
|
+
* window, from here to the end of the media, from the beginning up to
|
|
78
|
+
* here, and the window between two points. So there is no
|
|
79
|
+
* `isEndOpen` prop — `null` says it — and clearing one end never
|
|
80
|
+
* touches the other.
|
|
81
|
+
*
|
|
82
|
+
* An **inverted** section swaps, because throwing the pair away would
|
|
83
|
+
* discard the boundary just typed. A **zero-length** section is
|
|
84
|
+
* refused by name: it plays nothing, so swapping would hide a typo
|
|
85
|
+
* behind a window that silently does not exist.
|
|
86
|
+
*/
|
|
87
|
+
export declare const TimecodeInput: ({ className, durationMs, isDisabled, isRange, label, maxValueMs, minValueMs, onChange, placeholder, size, stepMs, valueMs, ...receivedSlotProps }: TimecodeInputProps) => ReactNode;
|
|
88
|
+
//# sourceMappingURL=TimecodeInput.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TimecodeInput.d.ts","sourceRoot":"","sources":["../../src/TimecodeInput/TimecodeInput.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACtD,OAAO,KAAK,EAEV,SAAS,EACV,MAAM,OAAO,CAAA;AAQd,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAGhD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAOlD,MAAM,MAAM,kBAAkB,GAAG,SAAS,GAAG;IAC3C,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB;;;;OAIG;IACH,KAAK,EAAE,MAAM,CAAA;IACb,+DAA+D;IAC/D,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,wDAAwD;IACxD,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,IAAI,GAAG,MAAM,GAAG,aAAa,KAAK,IAAI,CAAA;IACzD,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,IAAI,CAAC,EAAE,WAAW,CAAA;IAClB,sEAAsE;IACtE,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,qEAAqE;IACrE,OAAO,CAAC,EAAE,MAAM,GAAG,aAAa,CAAA;CACjC,CAAA;AAgBD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,eAAO,MAAM,aAAa,GAAI,mJAc3B,kBAAkB,KAAG,SAsWvB,CAAA"}
|