@exsto/ds 0.0.1-rc.17 → 0.0.1-rc.19
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 +55 -0
- package/dist/ds/src/file-input.d.ts +9 -0
- package/dist/ds/src/time-field.d.ts +9 -0
- package/dist/file-input.js +2 -0
- package/dist/index.js +5 -3
- package/dist/source-hash.txt +1 -1
- package/dist/styles.css +186 -82
- package/dist/theme.css +6 -1
- package/dist/time-field.js +2 -0
- package/dist/ui/src/components/edyn/file-input/file-input.d.ts +90 -0
- package/dist/ui/src/components/edyn/file-input/file-input.js +261 -0
- package/dist/ui/src/components/edyn/file-input/file-input.js.map +1 -0
- package/dist/ui/src/components/edyn/file-input/file-input.test.d.ts +8 -0
- package/dist/ui/src/components/edyn/file-input/index.d.ts +1 -0
- package/dist/ui/src/components/edyn/multi-select/multi-select.d.ts +12 -1
- package/dist/ui/src/components/edyn/multi-select/multi-select.js +16 -12
- package/dist/ui/src/components/edyn/multi-select/multi-select.js.map +1 -1
- package/dist/ui/src/components/edyn/rich-text-editor/mention-list.js +1 -1
- package/dist/ui/src/components/edyn/rich-text-editor/rich-text-editor.js +1 -1
- package/dist/ui/src/components/edyn/rich-text-editor/rich-text-editor.js.map +1 -1
- package/dist/ui/src/components/edyn/rich-text-editor/toolbar.js +1 -1
- package/dist/ui/src/components/edyn/rich-text-editor/toolbar.js.map +1 -1
- package/dist/ui/src/components/edyn/time-field/index.d.ts +1 -0
- package/dist/ui/src/components/edyn/time-field/time-field.d.ts +85 -0
- package/dist/ui/src/components/edyn/time-field/time-field.js +337 -0
- package/dist/ui/src/components/edyn/time-field/time-field.js.map +1 -0
- package/dist/ui/src/components/edyn/time-field/time-field.test.d.ts +8 -0
- package/dist/ui/src/components/ui/breadcrumb/breadcrumb.js +1 -1
- package/dist/ui/src/components/ui/breadcrumb/breadcrumb.js.map +1 -1
- package/dist/ui/src/components/ui/button/button.js +2 -2
- package/dist/ui/src/components/ui/button/button.js.map +1 -1
- package/dist/ui/src/components/ui/card/card.js +1 -1
- package/dist/ui/src/components/ui/card/card.js.map +1 -1
- package/dist/ui/src/components/ui/checkbox/checkbox.js +1 -1
- package/dist/ui/src/components/ui/checkbox/checkbox.js.map +1 -1
- package/dist/ui/src/components/ui/combobox/combobox.d.ts +15 -1
- package/dist/ui/src/components/ui/combobox/combobox.js +46 -20
- package/dist/ui/src/components/ui/combobox/combobox.js.map +1 -1
- package/dist/ui/src/components/ui/command/command.js +2 -2
- package/dist/ui/src/components/ui/command/command.js.map +1 -1
- package/dist/ui/src/components/ui/context-menu/context-menu.d.ts +1 -1
- package/dist/ui/src/components/ui/context-menu/context-menu.js +20 -11
- package/dist/ui/src/components/ui/context-menu/context-menu.js.map +1 -1
- package/dist/ui/src/components/ui/dropdown-menu/dropdown-menu.js +7 -10
- package/dist/ui/src/components/ui/dropdown-menu/dropdown-menu.js.map +1 -1
- package/dist/ui/src/components/ui/empty/empty.js +1 -1
- package/dist/ui/src/components/ui/empty/empty.js.map +1 -1
- package/dist/ui/src/components/ui/field/field.js +2 -2
- package/dist/ui/src/components/ui/field/field.js.map +1 -1
- package/dist/ui/src/components/ui/hover-card/hover-card.js +2 -1
- package/dist/ui/src/components/ui/hover-card/hover-card.js.map +1 -1
- package/dist/ui/src/components/ui/input/input.js +1 -1
- package/dist/ui/src/components/ui/input/input.js.map +1 -1
- package/dist/ui/src/components/ui/input-group/input-group.js +1 -1
- package/dist/ui/src/components/ui/input-group/input-group.js.map +1 -1
- package/dist/ui/src/components/ui/input-otp/input-otp.js +1 -1
- package/dist/ui/src/components/ui/input-otp/input-otp.js.map +1 -1
- package/dist/ui/src/components/ui/label/label.js +1 -1
- package/dist/ui/src/components/ui/label/label.js.map +1 -1
- package/dist/ui/src/components/ui/menubar/menubar.js +8 -5
- package/dist/ui/src/components/ui/menubar/menubar.js.map +1 -1
- package/dist/ui/src/components/ui/native-select/native-select.js +1 -1
- package/dist/ui/src/components/ui/native-select/native-select.js.map +1 -1
- package/dist/ui/src/components/ui/navigation-menu/navigation-menu.js +2 -1
- package/dist/ui/src/components/ui/navigation-menu/navigation-menu.js.map +1 -1
- package/dist/ui/src/components/ui/popover/popover.js +2 -1
- package/dist/ui/src/components/ui/popover/popover.js.map +1 -1
- package/dist/ui/src/components/ui/questionnaire/questionnaire.js +4 -4
- package/dist/ui/src/components/ui/questionnaire/questionnaire.js.map +1 -1
- package/dist/ui/src/components/ui/radio-group/radio-group.js +1 -1
- package/dist/ui/src/components/ui/radio-group/radio-group.js.map +1 -1
- package/dist/ui/src/components/ui/scroll-area/index.d.ts +1 -0
- package/dist/ui/src/components/ui/scroll-area/popup-list-scroll.d.ts +13 -0
- package/dist/ui/src/components/ui/scroll-area/popup-list-scroll.js +69 -0
- package/dist/ui/src/components/ui/scroll-area/popup-list-scroll.js.map +1 -0
- package/dist/ui/src/components/ui/scroll-area/scroll-area.d.ts +2 -4
- package/dist/ui/src/components/ui/scroll-area/scroll-area.js +26 -3
- package/dist/ui/src/components/ui/scroll-area/scroll-area.js.map +1 -1
- package/dist/ui/src/components/ui/select/select.js +12 -16
- package/dist/ui/src/components/ui/select/select.js.map +1 -1
- package/dist/ui/src/components/ui/sheet/sheet.d.ts +8 -0
- package/dist/ui/src/components/ui/sheet/sheet.js +11 -3
- package/dist/ui/src/components/ui/sheet/sheet.js.map +1 -1
- package/dist/ui/src/components/ui/table/table.d.ts +9 -2
- package/dist/ui/src/components/ui/table/table.js +19 -6
- package/dist/ui/src/components/ui/table/table.js.map +1 -1
- package/dist/ui/src/components/ui/tabs/tabs.js +1 -1
- package/dist/ui/src/components/ui/tabs/tabs.js.map +1 -1
- package/dist/ui/src/components/ui/textarea/textarea.js +1 -1
- package/dist/ui/src/components/ui/textarea/textarea.js.map +1 -1
- package/dist/ui/src/components/ui/toggle/toggle.js +2 -2
- package/dist/ui/src/components/ui/toggle/toggle.js.map +1 -1
- package/dist/ui/src/components/ui/tooltip/tooltip.js +2 -1
- package/dist/ui/src/components/ui/tooltip/tooltip.js.map +1 -1
- package/dist/ui/src/index.d.ts +1 -0
- package/dist/ui/src/lib/popup-list.d.ts +27 -5
- package/dist/ui/src/lib/popup-list.js +28 -6
- package/dist/ui/src/lib/popup-list.js.map +1 -1
- package/package.json +9 -1
|
@@ -0,0 +1,337 @@
|
|
|
1
|
+
import { cn } from "../../../lib/utils.js";
|
|
2
|
+
import { InputGroup, InputGroupAddon } from "../../ui/input-group/input-group.js";
|
|
3
|
+
import { useMemo, useRef, useState } from "react";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { IconClock } from "@tabler/icons-react";
|
|
6
|
+
//#region ../ui/src/components/edyn/time-field/time-field.tsx
|
|
7
|
+
var EMPTY_TIME = {
|
|
8
|
+
hour: null,
|
|
9
|
+
minute: null,
|
|
10
|
+
second: null,
|
|
11
|
+
period: null
|
|
12
|
+
};
|
|
13
|
+
var DEFAULT_TIME_FIELD_LABELS = {
|
|
14
|
+
hour: "Hours",
|
|
15
|
+
minute: "Minutes",
|
|
16
|
+
second: "Seconds",
|
|
17
|
+
period: "AM or PM",
|
|
18
|
+
empty: "Empty"
|
|
19
|
+
};
|
|
20
|
+
/** What an empty segment shows. Letters, as a DatePicker's pattern is, never a dash. */
|
|
21
|
+
var SEGMENT_PLACEHOLDER = {
|
|
22
|
+
hour: "HH",
|
|
23
|
+
minute: "MM",
|
|
24
|
+
second: "SS",
|
|
25
|
+
period: "AM"
|
|
26
|
+
};
|
|
27
|
+
var TIME = /^(\d{2}):(\d{2})(?::(\d{2}))?$/;
|
|
28
|
+
var two = (value) => String(value).padStart(2, "0");
|
|
29
|
+
/** 12 where the reader's locale writes AM and PM, 24 where it does not. */
|
|
30
|
+
var localeHourCycle = () => new Intl.DateTimeFormat(void 0, { hour: "numeric" }).resolvedOptions().hour12 ? 12 : 24;
|
|
31
|
+
/** `HH:mm` or `HH:mm:ss` (24-hour, as `<input type="time">` writes it) to the segments; anything else is no time. */
|
|
32
|
+
var parseTime = (value, hourCycle) => {
|
|
33
|
+
const match = TIME.exec(value);
|
|
34
|
+
if (match === null) return EMPTY_TIME;
|
|
35
|
+
const hour24 = Number(match[1]);
|
|
36
|
+
const minute = Number(match[2]);
|
|
37
|
+
const second = match[3] === void 0 ? 0 : Number(match[3]);
|
|
38
|
+
if (hour24 > 23 || minute > 59 || second > 59) return EMPTY_TIME;
|
|
39
|
+
if (hourCycle === 24) return {
|
|
40
|
+
hour: hour24,
|
|
41
|
+
minute,
|
|
42
|
+
second,
|
|
43
|
+
period: null
|
|
44
|
+
};
|
|
45
|
+
return {
|
|
46
|
+
hour: hour24 % 12 === 0 ? 12 : hour24 % 12,
|
|
47
|
+
minute,
|
|
48
|
+
second,
|
|
49
|
+
period: hour24 >= 12 ? "PM" : "AM"
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
/** The segments to `HH:mm` or `HH:mm:ss`, or '' until every segment the field shows is in. */
|
|
53
|
+
var formatTime = (parts, hourCycle, granularity) => {
|
|
54
|
+
const { hour, minute, second, period } = parts;
|
|
55
|
+
if (hour === null || minute === null || granularity === "second" && second === null) return "";
|
|
56
|
+
let hour24 = hour;
|
|
57
|
+
if (hourCycle === 12) {
|
|
58
|
+
if (period === null || hour === 0) return "";
|
|
59
|
+
hour24 = hour % 12 + (period === "PM" ? 12 : 0);
|
|
60
|
+
}
|
|
61
|
+
return granularity === "second" ? `${two(hour24)}:${two(minute)}:${two(second ?? 0)}` : `${two(hour24)}:${two(minute)}`;
|
|
62
|
+
};
|
|
63
|
+
var rangeOf = (segment, hourCycle) => {
|
|
64
|
+
if (segment === "hour") return hourCycle === 12 ? {
|
|
65
|
+
min: 1,
|
|
66
|
+
max: 12
|
|
67
|
+
} : {
|
|
68
|
+
min: 0,
|
|
69
|
+
max: 23
|
|
70
|
+
};
|
|
71
|
+
return {
|
|
72
|
+
min: 0,
|
|
73
|
+
max: 59
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
/** One step up or down inside a range, wrapping at the ends. A segment with nothing in it starts at the end the step is heading away from. */
|
|
77
|
+
var stepValue = (current, delta, { min, max }) => {
|
|
78
|
+
if (current === null) return delta > 0 ? min : max;
|
|
79
|
+
const size = max - min + 1;
|
|
80
|
+
return ((current - min + delta) % size + size) % size + min;
|
|
81
|
+
};
|
|
82
|
+
/**
|
|
83
|
+
* Types a digit into a segment. The second digit joins the first when it makes a number the segment can hold; otherwise it starts
|
|
84
|
+
* over. The segment is done, and focus moves on, at two digits or as soon as no second digit could fit (a 3 in the hours, a 6 in the
|
|
85
|
+
* minutes).
|
|
86
|
+
*/
|
|
87
|
+
var typeDigit = (buffer, digit, { min, max }) => {
|
|
88
|
+
let text = buffer + digit;
|
|
89
|
+
if (text.length > 2 || Number(text) > max) text = digit;
|
|
90
|
+
const value = Number(text);
|
|
91
|
+
const done = text.length === 2 || value * 10 > max;
|
|
92
|
+
return {
|
|
93
|
+
value: done && value < min ? min : value,
|
|
94
|
+
buffer: done ? "" : text,
|
|
95
|
+
done
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
var PAGE_STEP = {
|
|
99
|
+
hour: 3,
|
|
100
|
+
minute: 10,
|
|
101
|
+
second: 10
|
|
102
|
+
};
|
|
103
|
+
var withSegment = (parts, segment, value) => ({
|
|
104
|
+
...parts,
|
|
105
|
+
[segment]: value
|
|
106
|
+
});
|
|
107
|
+
/** What a key does to a segment, or null when the key is not one the segment handles (Tab, a letter in the hours...). */
|
|
108
|
+
var editSegment = (parts, segment, key, hourCycle, buffer) => {
|
|
109
|
+
if (segment === "period") {
|
|
110
|
+
const current = parts.period;
|
|
111
|
+
const set = (period) => ({
|
|
112
|
+
parts: {
|
|
113
|
+
...parts,
|
|
114
|
+
period
|
|
115
|
+
},
|
|
116
|
+
buffer: "",
|
|
117
|
+
advance: false
|
|
118
|
+
});
|
|
119
|
+
switch (key) {
|
|
120
|
+
case "a":
|
|
121
|
+
case "A": return {
|
|
122
|
+
...set("AM"),
|
|
123
|
+
advance: true
|
|
124
|
+
};
|
|
125
|
+
case "p":
|
|
126
|
+
case "P": return {
|
|
127
|
+
...set("PM"),
|
|
128
|
+
advance: true
|
|
129
|
+
};
|
|
130
|
+
case "ArrowUp":
|
|
131
|
+
case "ArrowDown": return set(current === null ? key === "ArrowUp" ? "AM" : "PM" : current === "AM" ? "PM" : "AM");
|
|
132
|
+
case "Home": return set("AM");
|
|
133
|
+
case "End": return set("PM");
|
|
134
|
+
case "Backspace":
|
|
135
|
+
case "Delete": return set(null);
|
|
136
|
+
default: return null;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
const range = rangeOf(segment, hourCycle);
|
|
140
|
+
const current = parts[segment];
|
|
141
|
+
const set = (value, advance = false) => ({
|
|
142
|
+
parts: withSegment(parts, segment, value),
|
|
143
|
+
buffer: "",
|
|
144
|
+
advance
|
|
145
|
+
});
|
|
146
|
+
if (/^[0-9]$/.test(key)) {
|
|
147
|
+
const typed = typeDigit(buffer, key, range);
|
|
148
|
+
return {
|
|
149
|
+
parts: withSegment(parts, segment, typed.value),
|
|
150
|
+
buffer: typed.buffer,
|
|
151
|
+
advance: typed.done
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
switch (key) {
|
|
155
|
+
case "ArrowUp": return set(stepValue(current, 1, range));
|
|
156
|
+
case "ArrowDown": return set(stepValue(current, -1, range));
|
|
157
|
+
case "PageUp": return set(stepValue(current, PAGE_STEP[segment], range));
|
|
158
|
+
case "PageDown": return set(stepValue(current, -PAGE_STEP[segment], range));
|
|
159
|
+
case "Home": return set(range.min);
|
|
160
|
+
case "End": return set(range.max);
|
|
161
|
+
case "Backspace":
|
|
162
|
+
case "Delete": return set(null);
|
|
163
|
+
default: return null;
|
|
164
|
+
}
|
|
165
|
+
};
|
|
166
|
+
var SEGMENT_CLASS = "h-6 rounded-sm bg-transparent text-center text-sm tabular-nums caret-transparent outline-none selection:bg-transparent placeholder:text-muted-foreground focus:bg-foreground/10 disabled:cursor-not-allowed";
|
|
167
|
+
/**
|
|
168
|
+
* A time of day typed in segments, in the kit's field: hours, minutes, optional seconds, and AM/PM where the reader's locale uses it.
|
|
169
|
+
* It exists so an app does not fall back to `<input type="time">`, whose look differs between browsers and from the rest of the kit.
|
|
170
|
+
*
|
|
171
|
+
* Each segment is a spinbutton: type digits (the focus moves on by itself), ArrowUp and ArrowDown step with wrap-around, PageUp and
|
|
172
|
+
* PageDown step by more, Home and End jump to the ends, Backspace empties, ArrowLeft and ArrowRight move between segments, and A or P
|
|
173
|
+
* set the period. The group is named by `aria-label` or `aria-labelledby`; a screen reader reads each segment by its own name and value.
|
|
174
|
+
*/
|
|
175
|
+
var TimeField = ({ value, defaultValue = "", onValueChange, granularity = "minute", hourCycle: hourCycleProp, min, max, disabled = false, readOnly = false, invalid = false, name, labels: labelOverrides, className, ...rest }) => {
|
|
176
|
+
const labels = useMemo(() => ({
|
|
177
|
+
...DEFAULT_TIME_FIELD_LABELS,
|
|
178
|
+
...labelOverrides
|
|
179
|
+
}), [labelOverrides]);
|
|
180
|
+
const hourCycle = useMemo(() => hourCycleProp ?? localeHourCycle(), [hourCycleProp]);
|
|
181
|
+
const [parts, setParts] = useState(() => parseTime(value ?? defaultValue, hourCycle));
|
|
182
|
+
const [seen, setSeen] = useState(value);
|
|
183
|
+
const refSegments = useRef([]);
|
|
184
|
+
const refBuffer = useRef({
|
|
185
|
+
segment: "hour",
|
|
186
|
+
text: ""
|
|
187
|
+
});
|
|
188
|
+
const formatted = formatTime(parts, hourCycle, granularity);
|
|
189
|
+
const refReported = useRef(formatted);
|
|
190
|
+
const refParts = useRef(parts);
|
|
191
|
+
refParts.current = parts;
|
|
192
|
+
if (value !== seen) {
|
|
193
|
+
setSeen(value);
|
|
194
|
+
if (value !== void 0 && value !== formatted) {
|
|
195
|
+
setParts(parseTime(value, hourCycle));
|
|
196
|
+
refReported.current = value;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
const segments = [
|
|
200
|
+
"hour",
|
|
201
|
+
"minute",
|
|
202
|
+
...granularity === "second" ? ["second"] : [],
|
|
203
|
+
...hourCycle === 12 ? ["period"] : []
|
|
204
|
+
];
|
|
205
|
+
const focusSegment = (index) => {
|
|
206
|
+
const target = refSegments.current[index];
|
|
207
|
+
if (target !== null && target !== void 0) {
|
|
208
|
+
target.focus();
|
|
209
|
+
target.select();
|
|
210
|
+
}
|
|
211
|
+
};
|
|
212
|
+
const report = (next) => {
|
|
213
|
+
const text = formatTime(next, hourCycle, granularity);
|
|
214
|
+
if (text !== refReported.current) {
|
|
215
|
+
refReported.current = text;
|
|
216
|
+
onValueChange?.(text);
|
|
217
|
+
}
|
|
218
|
+
};
|
|
219
|
+
const edit = (segment, key) => {
|
|
220
|
+
const buffer = refBuffer.current.segment === segment ? refBuffer.current.text : "";
|
|
221
|
+
const result = editSegment(refParts.current, segment, key, hourCycle, buffer);
|
|
222
|
+
if (result === null) return false;
|
|
223
|
+
refBuffer.current = {
|
|
224
|
+
segment,
|
|
225
|
+
text: result.buffer
|
|
226
|
+
};
|
|
227
|
+
refParts.current = result.parts;
|
|
228
|
+
setParts(result.parts);
|
|
229
|
+
if (result.buffer === "") report(result.parts);
|
|
230
|
+
if (result.advance) focusSegment(segments.indexOf(segment) + 1);
|
|
231
|
+
return true;
|
|
232
|
+
};
|
|
233
|
+
const onKeyDown = (segment, event) => {
|
|
234
|
+
if (event.altKey || event.ctrlKey || event.metaKey) return;
|
|
235
|
+
const index = segments.indexOf(segment);
|
|
236
|
+
if (event.key === "ArrowLeft" || event.key === "ArrowRight") {
|
|
237
|
+
event.preventDefault();
|
|
238
|
+
focusSegment(index + (event.key === "ArrowRight" ? 1 : -1));
|
|
239
|
+
return;
|
|
240
|
+
}
|
|
241
|
+
if (disabled || readOnly) return;
|
|
242
|
+
if (edit(segment, event.key)) event.preventDefault();
|
|
243
|
+
};
|
|
244
|
+
const onBlur = (segment) => {
|
|
245
|
+
const unfinished = refBuffer.current.segment === segment && refBuffer.current.text !== "";
|
|
246
|
+
refBuffer.current = {
|
|
247
|
+
segment,
|
|
248
|
+
text: ""
|
|
249
|
+
};
|
|
250
|
+
let settled = refParts.current;
|
|
251
|
+
if (segment === "hour" && hourCycle === 12 && settled.hour === 0) {
|
|
252
|
+
settled = {
|
|
253
|
+
...settled,
|
|
254
|
+
hour: null
|
|
255
|
+
};
|
|
256
|
+
refParts.current = settled;
|
|
257
|
+
setParts(settled);
|
|
258
|
+
}
|
|
259
|
+
if (unfinished) report(settled);
|
|
260
|
+
};
|
|
261
|
+
const onChange = (segment, event) => {
|
|
262
|
+
if (disabled || readOnly) return;
|
|
263
|
+
const typed = event.target.value.slice(-1);
|
|
264
|
+
edit(segment, typed);
|
|
265
|
+
};
|
|
266
|
+
const outOfRange = formatted !== "" && (min !== void 0 && formatted.slice(0, min.length) < min || max !== void 0 && formatted.slice(0, max.length) > max);
|
|
267
|
+
const flagged = invalid || outOfRange;
|
|
268
|
+
const display = (segment) => {
|
|
269
|
+
if (segment === "period") return parts.period ?? "";
|
|
270
|
+
const current = parts[segment];
|
|
271
|
+
return current === null ? "" : two(current);
|
|
272
|
+
};
|
|
273
|
+
return /* @__PURE__ */ jsxs(InputGroup, {
|
|
274
|
+
role: "group",
|
|
275
|
+
className: cn("w-fit", className),
|
|
276
|
+
...rest,
|
|
277
|
+
children: [
|
|
278
|
+
/* @__PURE__ */ jsx(InputGroupAddon, { children: /* @__PURE__ */ jsx(IconClock, { "aria-hidden": "true" }) }),
|
|
279
|
+
/* @__PURE__ */ jsx("div", {
|
|
280
|
+
className: "flex items-center gap-0.5 pr-2",
|
|
281
|
+
children: segments.map((segment, index) => {
|
|
282
|
+
const numeric = segment !== "period";
|
|
283
|
+
const range = numeric ? rangeOf(segment, hourCycle) : {
|
|
284
|
+
min: 0,
|
|
285
|
+
max: 1
|
|
286
|
+
};
|
|
287
|
+
const current = numeric ? parts[segment] : parts.period === null ? null : parts.period === "AM" ? 0 : 1;
|
|
288
|
+
return /* @__PURE__ */ jsxs("span", {
|
|
289
|
+
className: "flex items-center gap-0.5",
|
|
290
|
+
children: [index > 0 && segment !== "period" && /* @__PURE__ */ jsx("span", {
|
|
291
|
+
"aria-hidden": "true",
|
|
292
|
+
className: "text-muted-foreground",
|
|
293
|
+
children: ":"
|
|
294
|
+
}), /* @__PURE__ */ jsx("input", {
|
|
295
|
+
ref: (node) => {
|
|
296
|
+
refSegments.current[index] = node;
|
|
297
|
+
},
|
|
298
|
+
"data-slot": "input-group-control",
|
|
299
|
+
"data-segment": segment,
|
|
300
|
+
role: "spinbutton",
|
|
301
|
+
inputMode: numeric ? "numeric" : "text",
|
|
302
|
+
autoComplete: "off",
|
|
303
|
+
autoCorrect: "off",
|
|
304
|
+
spellCheck: false,
|
|
305
|
+
value: display(segment),
|
|
306
|
+
placeholder: SEGMENT_PLACEHOLDER[segment],
|
|
307
|
+
disabled,
|
|
308
|
+
readOnly,
|
|
309
|
+
"aria-label": labels[segment],
|
|
310
|
+
"aria-readonly": readOnly || void 0,
|
|
311
|
+
"aria-invalid": flagged || void 0,
|
|
312
|
+
"aria-valuemin": range.min,
|
|
313
|
+
"aria-valuemax": range.max,
|
|
314
|
+
"aria-valuenow": current ?? void 0,
|
|
315
|
+
"aria-valuetext": current === null ? labels.empty : segment === "period" ? parts.period ?? labels.empty : two(current),
|
|
316
|
+
className: cn(SEGMENT_CLASS, segment === "period" ? "w-7" : "w-5"),
|
|
317
|
+
onKeyDown: (event) => onKeyDown(segment, event),
|
|
318
|
+
onChange: (event) => onChange(segment, event),
|
|
319
|
+
onFocus: (event) => event.currentTarget.select(),
|
|
320
|
+
onBlur: () => onBlur(segment)
|
|
321
|
+
})]
|
|
322
|
+
}, segment);
|
|
323
|
+
})
|
|
324
|
+
}),
|
|
325
|
+
name !== void 0 && /* @__PURE__ */ jsx("input", {
|
|
326
|
+
type: "hidden",
|
|
327
|
+
name,
|
|
328
|
+
value: formatted,
|
|
329
|
+
disabled
|
|
330
|
+
})
|
|
331
|
+
]
|
|
332
|
+
});
|
|
333
|
+
};
|
|
334
|
+
//#endregion
|
|
335
|
+
export { DEFAULT_TIME_FIELD_LABELS, EMPTY_TIME, TimeField, editSegment, formatTime, localeHourCycle, parseTime, rangeOf, stepValue, typeDigit };
|
|
336
|
+
|
|
337
|
+
//# sourceMappingURL=time-field.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"time-field.js","names":[],"sources":["../../../../../../../ui/src/components/edyn/time-field/time-field.tsx"],"sourcesContent":["import { InputGroup, InputGroupAddon } from '@edyn/ui/components/ui/input-group';\nimport { cn } from '@edyn/ui/lib/utils';\nimport { IconClock } from '@tabler/icons-react';\nimport { type ChangeEvent, type ComponentPropsWithoutRef, type KeyboardEvent, useMemo, useRef, useState } from 'react';\n\nexport type TTimeFieldGranularity = 'minute' | 'second';\n\nexport type TTimeFieldHourCycle = 12 | 24;\n\nexport type TTimeFieldSegment = 'hour' | 'minute' | 'second' | 'period';\n\nexport type TTimeFieldPeriod = 'AM' | 'PM';\n\n/** The segments as they are shown: the hour in the field's own cycle (0 to 23, or 1 to 12 beside a period), each empty until entered. */\nexport interface ITimeParts {\n hour: number | null;\n minute: number | null;\n second: number | null;\n period: TTimeFieldPeriod | null;\n}\n\nexport const EMPTY_TIME: ITimeParts = { hour: null, minute: null, second: null, period: null };\n\nexport interface ITimeFieldLabels {\n hour: string;\n minute: string;\n second: string;\n /** The AM/PM segment. */\n period: string;\n /** Read for a segment with nothing in it. */\n empty: string;\n}\n\nexport const DEFAULT_TIME_FIELD_LABELS: ITimeFieldLabels = {\n hour: 'Hours',\n minute: 'Minutes',\n second: 'Seconds',\n period: 'AM or PM',\n empty: 'Empty',\n};\n\n/** What an empty segment shows. Letters, as a DatePicker's pattern is, never a dash. */\nconst SEGMENT_PLACEHOLDER: Record<TTimeFieldSegment, string> = { hour: 'HH', minute: 'MM', second: 'SS', period: 'AM' };\n\nconst TIME = /^(\\d{2}):(\\d{2})(?::(\\d{2}))?$/;\n\nconst two = (value: number): string => String(value).padStart(2, '0');\n\n/** 12 where the reader's locale writes AM and PM, 24 where it does not. */\nexport const localeHourCycle = (): TTimeFieldHourCycle =>\n new Intl.DateTimeFormat(undefined, { hour: 'numeric' }).resolvedOptions().hour12 ? 12 : 24;\n\n/** `HH:mm` or `HH:mm:ss` (24-hour, as `<input type=\"time\">` writes it) to the segments; anything else is no time. */\nexport const parseTime = (value: string, hourCycle: TTimeFieldHourCycle): ITimeParts => {\n const match = TIME.exec(value);\n if (match === null) {\n return EMPTY_TIME;\n }\n const hour24 = Number(match[1]);\n const minute = Number(match[2]);\n const second = match[3] === undefined ? 0 : Number(match[3]);\n if (hour24 > 23 || minute > 59 || second > 59) {\n return EMPTY_TIME;\n }\n if (hourCycle === 24) {\n return { hour: hour24, minute, second, period: null };\n }\n return { hour: hour24 % 12 === 0 ? 12 : hour24 % 12, minute, second, period: hour24 >= 12 ? 'PM' : 'AM' };\n};\n\n/** The segments to `HH:mm` or `HH:mm:ss`, or '' until every segment the field shows is in. */\nexport const formatTime = (parts: ITimeParts, hourCycle: TTimeFieldHourCycle, granularity: TTimeFieldGranularity): string => {\n const { hour, minute, second, period } = parts;\n if (hour === null || minute === null || (granularity === 'second' && second === null)) {\n return '';\n }\n let hour24 = hour;\n if (hourCycle === 12) {\n // 0 is only ever a first digit still waiting for its second.\n if (period === null || hour === 0) {\n return '';\n }\n hour24 = (hour % 12) + (period === 'PM' ? 12 : 0);\n }\n return granularity === 'second' ? `${two(hour24)}:${two(minute)}:${two(second ?? 0)}` : `${two(hour24)}:${two(minute)}`;\n};\n\nexport interface IRange {\n min: number;\n max: number;\n}\n\nexport const rangeOf = (segment: Exclude<TTimeFieldSegment, 'period'>, hourCycle: TTimeFieldHourCycle): IRange => {\n if (segment === 'hour') {\n return hourCycle === 12 ? { min: 1, max: 12 } : { min: 0, max: 23 };\n }\n return { min: 0, max: 59 };\n};\n\n/** One step up or down inside a range, wrapping at the ends. A segment with nothing in it starts at the end the step is heading away from. */\nexport const stepValue = (current: number | null, delta: number, { min, max }: IRange): number => {\n if (current === null) {\n return delta > 0 ? min : max;\n }\n const size = max - min + 1;\n return ((((current - min + delta) % size) + size) % size) + min;\n};\n\n/**\n * Types a digit into a segment. The second digit joins the first when it makes a number the segment can hold; otherwise it starts\n * over. The segment is done, and focus moves on, at two digits or as soon as no second digit could fit (a 3 in the hours, a 6 in the\n * minutes).\n */\nexport const typeDigit = (buffer: string, digit: string, { min, max }: IRange): { value: number; buffer: string; done: boolean } => {\n let text = buffer + digit;\n if (text.length > 2 || Number(text) > max) {\n text = digit;\n }\n const value = Number(text);\n const done = text.length === 2 || value * 10 > max;\n return { value: done && value < min ? min : value, buffer: done ? '' : text, done };\n};\n\nconst PAGE_STEP: Record<Exclude<TTimeFieldSegment, 'period'>, number> = { hour: 3, minute: 10, second: 10 };\n\nexport interface IEdit {\n parts: ITimeParts;\n /** The digits typed so far into this segment and not yet complete. */\n buffer: string;\n /** Move to the next segment: this one is finished. */\n advance: boolean;\n}\n\nconst withSegment = (parts: ITimeParts, segment: Exclude<TTimeFieldSegment, 'period'>, value: number | null): ITimeParts => ({\n ...parts,\n [segment]: value,\n});\n\n/** What a key does to a segment, or null when the key is not one the segment handles (Tab, a letter in the hours...). */\nexport const editSegment = (\n parts: ITimeParts,\n segment: TTimeFieldSegment,\n key: string,\n hourCycle: TTimeFieldHourCycle,\n buffer: string,\n): IEdit | null => {\n if (segment === 'period') {\n const current = parts.period;\n const set = (period: TTimeFieldPeriod | null): IEdit => ({ parts: { ...parts, period }, buffer: '', advance: false });\n switch (key) {\n case 'a':\n case 'A':\n return { ...set('AM'), advance: true };\n case 'p':\n case 'P':\n return { ...set('PM'), advance: true };\n case 'ArrowUp':\n case 'ArrowDown':\n return set(current === null ? (key === 'ArrowUp' ? 'AM' : 'PM') : current === 'AM' ? 'PM' : 'AM');\n case 'Home':\n return set('AM');\n case 'End':\n return set('PM');\n case 'Backspace':\n case 'Delete':\n return set(null);\n default:\n return null;\n }\n }\n\n const range = rangeOf(segment, hourCycle);\n const current = parts[segment];\n const set = (value: number | null, advance = false): IEdit => ({ parts: withSegment(parts, segment, value), buffer: '', advance });\n\n if (/^[0-9]$/.test(key)) {\n const typed = typeDigit(buffer, key, range);\n return { parts: withSegment(parts, segment, typed.value), buffer: typed.buffer, advance: typed.done };\n }\n switch (key) {\n case 'ArrowUp':\n return set(stepValue(current, 1, range));\n case 'ArrowDown':\n return set(stepValue(current, -1, range));\n case 'PageUp':\n return set(stepValue(current, PAGE_STEP[segment], range));\n case 'PageDown':\n return set(stepValue(current, -PAGE_STEP[segment], range));\n case 'Home':\n return set(range.min);\n case 'End':\n return set(range.max);\n case 'Backspace':\n case 'Delete':\n return set(null);\n default:\n return null;\n }\n};\n\nexport interface ITimeFieldProps extends Omit<ComponentPropsWithoutRef<'div'>, 'defaultValue' | 'onChange' | 'children' | 'role'> {\n /** The time as `HH:mm` or `HH:mm:ss`, 24-hour whatever the field shows, as `<input type=\"time\">` writes it. '' is no time. */\n value?: string;\n defaultValue?: string;\n /** Called with the time as soon as every segment is in, and with '' when one of a full time is cleared. */\n onValueChange?: (value: string) => void;\n /** `second` adds a seconds segment and a `HH:mm:ss` value. */\n granularity?: TTimeFieldGranularity;\n /** 12 shows an AM/PM segment, 24 does not. The default is what the reader's locale writes. */\n hourCycle?: TTimeFieldHourCycle;\n /** The earliest and the latest time, `HH:mm`. A time outside them is marked invalid; it is not refused. */\n min?: string;\n max?: string;\n disabled?: boolean;\n /** Shown, focusable and readable, not changeable. */\n readOnly?: boolean;\n invalid?: boolean;\n /** Submits the time with a form, under this name, as `HH:mm` or `HH:mm:ss`. */\n name?: string;\n labels?: Partial<ITimeFieldLabels>;\n}\n\nconst SEGMENT_CLASS =\n 'h-6 rounded-sm bg-transparent text-center text-sm tabular-nums caret-transparent outline-none selection:bg-transparent placeholder:text-muted-foreground focus:bg-foreground/10 disabled:cursor-not-allowed';\n\n/**\n * A time of day typed in segments, in the kit's field: hours, minutes, optional seconds, and AM/PM where the reader's locale uses it.\n * It exists so an app does not fall back to `<input type=\"time\">`, whose look differs between browsers and from the rest of the kit.\n *\n * Each segment is a spinbutton: type digits (the focus moves on by itself), ArrowUp and ArrowDown step with wrap-around, PageUp and\n * PageDown step by more, Home and End jump to the ends, Backspace empties, ArrowLeft and ArrowRight move between segments, and A or P\n * set the period. The group is named by `aria-label` or `aria-labelledby`; a screen reader reads each segment by its own name and value.\n */\nexport const TimeField = ({\n value,\n defaultValue = '',\n onValueChange,\n granularity = 'minute',\n hourCycle: hourCycleProp,\n min,\n max,\n disabled = false,\n readOnly = false,\n invalid = false,\n name,\n labels: labelOverrides,\n className,\n ...rest\n}: ITimeFieldProps) => {\n const labels = useMemo(() => ({ ...DEFAULT_TIME_FIELD_LABELS, ...labelOverrides }), [labelOverrides]);\n const hourCycle = useMemo(() => hourCycleProp ?? localeHourCycle(), [hourCycleProp]);\n const [parts, setParts] = useState<ITimeParts>(() => parseTime(value ?? defaultValue, hourCycle));\n const [seen, setSeen] = useState(value);\n const refSegments = useRef<Array<HTMLInputElement | null>>([]);\n const refBuffer = useRef<{ segment: TTimeFieldSegment; text: string }>({ segment: 'hour', text: '' });\n const formatted = formatTime(parts, hourCycle, granularity);\n // What the parent was last told, and the segments as the last key left them (state is a render behind inside one event).\n const refReported = useRef(formatted);\n const refParts = useRef(parts);\n refParts.current = parts;\n // A time handed in from outside replaces what is shown, unless it is the very time that is shown: clearing one segment of a full\n // time reports '', and taking that back as a new value would wipe the segments still being edited.\n if (value !== seen) {\n setSeen(value);\n if (value !== undefined && value !== formatted) {\n setParts(parseTime(value, hourCycle));\n refReported.current = value;\n }\n }\n\n const segments: TTimeFieldSegment[] = [\n 'hour',\n 'minute',\n ...(granularity === 'second' ? (['second'] as const) : []),\n ...(hourCycle === 12 ? (['period'] as const) : []),\n ];\n\n const focusSegment = (index: number): void => {\n const target = refSegments.current[index];\n if (target !== null && target !== undefined) {\n target.focus();\n target.select();\n }\n };\n\n const report = (next: ITimeParts): void => {\n const text = formatTime(next, hourCycle, granularity);\n if (text !== refReported.current) {\n refReported.current = text;\n onValueChange?.(text);\n }\n };\n\n const edit = (segment: TTimeFieldSegment, key: string): boolean => {\n const buffer = refBuffer.current.segment === segment ? refBuffer.current.text : '';\n const result = editSegment(refParts.current, segment, key, hourCycle, buffer);\n if (result === null) {\n return false;\n }\n refBuffer.current = { segment, text: result.buffer };\n refParts.current = result.parts;\n setParts(result.parts);\n // A segment still waiting for its second digit is not a time yet worth reporting (a 3 may become 30); it is reported when it is\n // done, or when the focus leaves it.\n if (result.buffer === '') {\n report(result.parts);\n }\n if (result.advance) {\n focusSegment(segments.indexOf(segment) + 1);\n }\n return true;\n };\n\n const onKeyDown = (segment: TTimeFieldSegment, event: KeyboardEvent<HTMLInputElement>): void => {\n if (event.altKey || event.ctrlKey || event.metaKey) {\n return;\n }\n const index = segments.indexOf(segment);\n if (event.key === 'ArrowLeft' || event.key === 'ArrowRight') {\n event.preventDefault();\n focusSegment(index + (event.key === 'ArrowRight' ? 1 : -1));\n return;\n }\n if (disabled || readOnly) {\n return;\n }\n if (edit(segment, event.key)) {\n event.preventDefault();\n }\n };\n\n // Leaving a segment ends what was being typed into it: coming back and typing a 2 must not make 12 of an old 1. A 0 left alone in a\n // 12-hour hour is the start of a number that never came, so it is emptied.\n const onBlur = (segment: TTimeFieldSegment): void => {\n const unfinished = refBuffer.current.segment === segment && refBuffer.current.text !== '';\n refBuffer.current = { segment, text: '' };\n let settled = refParts.current;\n if (segment === 'hour' && hourCycle === 12 && settled.hour === 0) {\n settled = { ...settled, hour: null };\n refParts.current = settled;\n setParts(settled);\n }\n if (unfinished) {\n report(settled);\n }\n };\n\n // A phone's keyboard does not send key events a page can use; what it types arrives as a change to the input.\n const onChange = (segment: TTimeFieldSegment, event: ChangeEvent<HTMLInputElement>): void => {\n if (disabled || readOnly) {\n return;\n }\n const typed = event.target.value.slice(-1);\n edit(segment, typed);\n };\n\n const outOfRange =\n formatted !== '' && ((min !== undefined && formatted.slice(0, min.length) < min) || (max !== undefined && formatted.slice(0, max.length) > max));\n const flagged = invalid || outOfRange;\n\n const display = (segment: TTimeFieldSegment): string => {\n if (segment === 'period') {\n return parts.period ?? '';\n }\n const current = parts[segment];\n return current === null ? '' : two(current);\n };\n\n return (\n <InputGroup role=\"group\" className={cn('w-fit', className)} {...rest}>\n <InputGroupAddon>\n <IconClock aria-hidden=\"true\" />\n </InputGroupAddon>\n <div className=\"flex items-center gap-0.5 pr-2\">\n {segments.map((segment, index) => {\n const numeric = segment !== 'period';\n const range = numeric ? rangeOf(segment, hourCycle) : { min: 0, max: 1 };\n const current = numeric ? parts[segment] : parts.period === null ? null : parts.period === 'AM' ? 0 : 1;\n return (\n <span key={segment} className=\"flex items-center gap-0.5\">\n {index > 0 && segment !== 'period' && (\n <span aria-hidden=\"true\" className=\"text-muted-foreground\">\n :\n </span>\n )}\n <input\n ref={(node) => {\n refSegments.current[index] = node;\n }}\n data-slot=\"input-group-control\"\n data-segment={segment}\n role=\"spinbutton\"\n inputMode={numeric ? 'numeric' : 'text'}\n autoComplete=\"off\"\n autoCorrect=\"off\"\n spellCheck={false}\n value={display(segment)}\n placeholder={SEGMENT_PLACEHOLDER[segment]}\n disabled={disabled}\n readOnly={readOnly}\n aria-label={labels[segment]}\n aria-readonly={readOnly || undefined}\n aria-invalid={flagged || undefined}\n aria-valuemin={range.min}\n aria-valuemax={range.max}\n aria-valuenow={current ?? undefined}\n aria-valuetext={current === null ? labels.empty : segment === 'period' ? (parts.period ?? labels.empty) : two(current)}\n className={cn(SEGMENT_CLASS, segment === 'period' ? 'w-7' : 'w-5')}\n onKeyDown={(event) => onKeyDown(segment, event)}\n onChange={(event) => onChange(segment, event)}\n onFocus={(event) => event.currentTarget.select()}\n onBlur={() => onBlur(segment)}\n />\n </span>\n );\n })}\n </div>\n {name !== undefined && <input type=\"hidden\" name={name} value={formatted} disabled={disabled} />}\n </InputGroup>\n );\n};\n"],"mappings":";;;;;;AAqBA,IAAa,aAAyB;CAAE,MAAM;CAAM,QAAQ;CAAM,Q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C,WAAW,UAAU,SAAS,SAAS,KAAK;OAC5C,UAAU,UAAU,MAAM,cAAc,OAAO;OAC/C,cAAc,OAAO,OAAO;MAC7B,CAAA,CACG;KAlCK,GAAA,OAkCL;IAEV,CAAC;GACE,CAAA;GACJ,SAAS,KAAA,KAAa,oBAAC,SAAD;IAAO,MAAK;IAAe;IAAM,OAAO;IAAqB;GAAW,CAAA;EACrF;;AAEhB"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TimeField: the arithmetic of a time typed in segments, and the keyboard on a mounted field.
|
|
3
|
+
*
|
|
4
|
+
* PATH TAKEN: parsing, formatting, stepping and the typing rules are plain functions and run in happy-dom, and so does a mounted field
|
|
5
|
+
* driven by key events, which is where the focus moving on, the value reported and the roles are checked. How it looks in the kit's
|
|
6
|
+
* field, and the browser's own handling of focus, is for e2e/a11y.spec.ts and the visual cells.
|
|
7
|
+
*/
|
|
8
|
+
export {};
|
|
@@ -29,7 +29,7 @@ var BreadcrumbItem = ({ className, ...props }) => {
|
|
|
29
29
|
var BreadcrumbLink = ({ className, render, ...props }) => {
|
|
30
30
|
return useRender({
|
|
31
31
|
defaultTagName: "a",
|
|
32
|
-
props: mergeProps({ className: cn("transition-colors hover:text-foreground", className) }, props),
|
|
32
|
+
props: mergeProps({ className: cn("inline-flex h-6 items-center transition-colors hover:text-foreground", className) }, props),
|
|
33
33
|
render,
|
|
34
34
|
state: { slot: "breadcrumb-link" }
|
|
35
35
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"breadcrumb.js","names":[],"sources":["../../../../../../../ui/src/components/ui/breadcrumb/breadcrumb.tsx"],"sourcesContent":["import { mergeProps } from '@base-ui/react/merge-props';\nimport { useRender } from '@base-ui/react/use-render';\nimport { cn } from '@edyn/ui/lib/utils';\nimport { IconChevronRight, IconDots } from '@tabler/icons-react';\nimport type * as React from 'react';\n\nexport const Breadcrumb = ({ className, ...props }: React.ComponentProps<'nav'>) => {\n return <nav aria-label=\"breadcrumb\" data-slot=\"breadcrumb\" className={cn(className)} {...props} />;\n};\n\nexport const BreadcrumbList = ({ className, ...props }: React.ComponentProps<'ol'>) => {\n return (\n <ol\n data-slot=\"breadcrumb-list\"\n className={cn('flex flex-wrap items-center gap-1.5 text-sm wrap-break-word text-muted-foreground', className)}\n {...props}\n />\n );\n};\n\nexport const BreadcrumbItem = ({ className, ...props }: React.ComponentProps<'li'>) => {\n return <li data-slot=\"breadcrumb-item\" className={cn('inline-flex items-center gap-1', className)} {...props} />;\n};\n\nexport const BreadcrumbLink = ({ className, render, ...props }: useRender.ComponentProps<'a'>) => {\n return useRender({\n defaultTagName: 'a',\n props: mergeProps<'a'>(\n {\n className: cn('transition-colors hover:text-foreground', className),\n },\n props,\n ),\n render,\n state: {\n slot: 'breadcrumb-link',\n },\n });\n};\n\nexport const BreadcrumbPage = ({ className, ...props }: React.ComponentProps<'span'>) => {\n return (\n // biome-ignore lint/a11y/useFocusableInteractive: matches shadcn pattern; the current page is not an interactive target\n // biome-ignore lint/a11y/useSemanticElements: <span> is intentional; role=\"link\" here only conveys visual/semantic context, not an actual navigable link\n <span\n data-slot=\"breadcrumb-page\"\n role=\"link\"\n aria-disabled=\"true\"\n aria-current=\"page\"\n className={cn('font-normal text-foreground', className)}\n {...props}\n />\n );\n};\n\nexport const BreadcrumbSeparator = ({ children, className, ...props }: React.ComponentProps<'li'>) => {\n return (\n <li data-slot=\"breadcrumb-separator\" role=\"presentation\" aria-hidden=\"true\" className={cn('[&>svg]:size-3.5', className)} {...props}>\n {children ?? <IconChevronRight />}\n </li>\n );\n};\n\nexport const BreadcrumbEllipsis = ({ className, ...props }: React.ComponentProps<'span'>) => {\n return (\n <span\n data-slot=\"breadcrumb-ellipsis\"\n role=\"presentation\"\n aria-hidden=\"true\"\n className={cn('flex size-5 items-center justify-center [&>svg]:size-4', className)}\n {...props}\n >\n <IconDots />\n <span className=\"sr-only\">More</span>\n </span>\n );\n};\n"],"mappings":";;;;;;AAMA,IAAa,cAAc,EAAE,WAAW,GAAG,YAAyC;CAClF,OAAO,oBAAC,OAAD;EAAK,cAAW;EAAa,aAAU;EAAa,WAAW,GAAG,SAAS;EAAG,GAAI;CAAQ,CAAA;AACnG;AAEA,IAAa,kBAAkB,EAAE,WAAW,GAAG,YAAwC;CACrF,OACE,oBAAC,MAAD;EACE,aAAU;EACV,WAAW,GAAG,qFAAqF,SAAS;EAC5G,GAAI;CACL,CAAA;AAEL;AAEA,IAAa,kBAAkB,EAAE,WAAW,GAAG,YAAwC;CACrF,OAAO,oBAAC,MAAD;EAAI,aAAU;EAAkB,WAAW,GAAG,kCAAkC,SAAS;EAAG,GAAI;CAAQ,CAAA;AACjH;AAEA,IAAa,kBAAkB,EAAE,WAAW,QAAQ,GAAG,YAA2C;CAChG,OAAO,UAAU;EACf,gBAAgB;EAChB,OAAO,WACL,EACE,WAAW,GAAG,
|
|
1
|
+
{"version":3,"file":"breadcrumb.js","names":[],"sources":["../../../../../../../ui/src/components/ui/breadcrumb/breadcrumb.tsx"],"sourcesContent":["import { mergeProps } from '@base-ui/react/merge-props';\nimport { useRender } from '@base-ui/react/use-render';\nimport { cn } from '@edyn/ui/lib/utils';\nimport { IconChevronRight, IconDots } from '@tabler/icons-react';\nimport type * as React from 'react';\n\nexport const Breadcrumb = ({ className, ...props }: React.ComponentProps<'nav'>) => {\n return <nav aria-label=\"breadcrumb\" data-slot=\"breadcrumb\" className={cn(className)} {...props} />;\n};\n\nexport const BreadcrumbList = ({ className, ...props }: React.ComponentProps<'ol'>) => {\n return (\n <ol\n data-slot=\"breadcrumb-list\"\n className={cn('flex flex-wrap items-center gap-1.5 text-sm wrap-break-word text-muted-foreground', className)}\n {...props}\n />\n );\n};\n\nexport const BreadcrumbItem = ({ className, ...props }: React.ComponentProps<'li'>) => {\n return <li data-slot=\"breadcrumb-item\" className={cn('inline-flex items-center gap-1', className)} {...props} />;\n};\n\nexport const BreadcrumbLink = ({ className, render, ...props }: useRender.ComponentProps<'a'>) => {\n return useRender({\n defaultTagName: 'a',\n props: mergeProps<'a'>(\n {\n className: cn('inline-flex h-6 items-center transition-colors hover:text-foreground', className),\n },\n props,\n ),\n render,\n state: {\n slot: 'breadcrumb-link',\n },\n });\n};\n\nexport const BreadcrumbPage = ({ className, ...props }: React.ComponentProps<'span'>) => {\n return (\n // biome-ignore lint/a11y/useFocusableInteractive: matches shadcn pattern; the current page is not an interactive target\n // biome-ignore lint/a11y/useSemanticElements: <span> is intentional; role=\"link\" here only conveys visual/semantic context, not an actual navigable link\n <span\n data-slot=\"breadcrumb-page\"\n role=\"link\"\n aria-disabled=\"true\"\n aria-current=\"page\"\n className={cn('font-normal text-foreground', className)}\n {...props}\n />\n );\n};\n\nexport const BreadcrumbSeparator = ({ children, className, ...props }: React.ComponentProps<'li'>) => {\n return (\n <li data-slot=\"breadcrumb-separator\" role=\"presentation\" aria-hidden=\"true\" className={cn('[&>svg]:size-3.5', className)} {...props}>\n {children ?? <IconChevronRight />}\n </li>\n );\n};\n\nexport const BreadcrumbEllipsis = ({ className, ...props }: React.ComponentProps<'span'>) => {\n return (\n <span\n data-slot=\"breadcrumb-ellipsis\"\n role=\"presentation\"\n aria-hidden=\"true\"\n className={cn('flex size-5 items-center justify-center [&>svg]:size-4', className)}\n {...props}\n >\n <IconDots />\n <span className=\"sr-only\">More</span>\n </span>\n );\n};\n"],"mappings":";;;;;;AAMA,IAAa,cAAc,EAAE,WAAW,GAAG,YAAyC;CAClF,OAAO,oBAAC,OAAD;EAAK,cAAW;EAAa,aAAU;EAAa,WAAW,GAAG,SAAS;EAAG,GAAI;CAAQ,CAAA;AACnG;AAEA,IAAa,kBAAkB,EAAE,WAAW,GAAG,YAAwC;CACrF,OACE,oBAAC,MAAD;EACE,aAAU;EACV,WAAW,GAAG,qFAAqF,SAAS;EAC5G,GAAI;CACL,CAAA;AAEL;AAEA,IAAa,kBAAkB,EAAE,WAAW,GAAG,YAAwC;CACrF,OAAO,oBAAC,MAAD;EAAI,aAAU;EAAkB,WAAW,GAAG,kCAAkC,SAAS;EAAG,GAAI;CAAQ,CAAA;AACjH;AAEA,IAAa,kBAAkB,EAAE,WAAW,QAAQ,GAAG,YAA2C;CAChG,OAAO,UAAU;EACf,gBAAgB;EAChB,OAAO,WACL,EACE,WAAW,GAAG,wEAAwE,SAAS,EACjG,GACA,KACF;EACA;EACA,OAAO,EACL,MAAM,kBACR;CACF,CAAC;AACH;AAEA,IAAa,kBAAkB,EAAE,WAAW,GAAG,YAA0C;CACvF,OAGE,oBAAC,QAAD;EACE,aAAU;EACV,MAAK;EACL,iBAAc;EACd,gBAAa;EACb,WAAW,GAAG,+BAA+B,SAAS;EACtD,GAAI;CACL,CAAA;AAEL;AAEA,IAAa,uBAAuB,EAAE,UAAU,WAAW,GAAG,YAAwC;CACpG,OACE,oBAAC,MAAD;EAAI,aAAU;EAAuB,MAAK;EAAe,eAAY;EAAO,WAAW,GAAG,oBAAoB,SAAS;EAAG,GAAI;EAC3H,UAAA,YAAY,oBAAC,kBAAD,CAAmB,CAAA;CAC9B,CAAA;AAER;AAEA,IAAa,sBAAsB,EAAE,WAAW,GAAG,YAA0C;CAC3F,OACE,qBAAC,QAAD;EACE,aAAU;EACV,MAAK;EACL,eAAY;EACZ,WAAW,GAAG,0DAA0D,SAAS;EACjF,GAAI;EALN,UAAA,CAOE,oBAAC,UAAD,CAAW,CAAA,GACX,oBAAC,QAAD;GAAM,WAAU;GAAU,UAAA;EAAU,CAAA,CAChC;;AAEV"}
|
|
@@ -14,7 +14,7 @@ var buttonVariants = cva("group/button inline-flex shrink-0 cursor-pointer items
|
|
|
14
14
|
variants: {
|
|
15
15
|
variant: {
|
|
16
16
|
default: `bg-primary text-primary-foreground hover:bg-primary/80 ${DISABLED_FILL}`,
|
|
17
|
-
outline: `border-
|
|
17
|
+
outline: `border-control bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-control dark:bg-input/30 dark:hover:bg-input/50 ${DISABLED_FILL}`,
|
|
18
18
|
secondary: `bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground ${DISABLED_FILL}`,
|
|
19
19
|
ghost: "hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50 aria-disabled:hover:bg-transparent dark:aria-disabled:hover:bg-transparent",
|
|
20
20
|
destructive: `bg-destructive/10 text-destructive hover:bg-destructive/15 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/15 dark:hover:bg-destructive/20 dark:focus-visible:ring-destructive/40 ${DISABLED_FILL}`,
|
|
@@ -23,7 +23,7 @@ var buttonVariants = cva("group/button inline-flex shrink-0 cursor-pointer items
|
|
|
23
23
|
size: {
|
|
24
24
|
default: "h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
|
|
25
25
|
xs: "h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",
|
|
26
|
-
sm: "h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-
|
|
26
|
+
sm: "h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",
|
|
27
27
|
lg: "h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
|
|
28
28
|
icon: "size-8",
|
|
29
29
|
"icon-xs": "size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.js","names":[],"sources":["../../../../../../../ui/src/components/ui/button/button.tsx"],"sourcesContent":["import { Button as ButtonPrimitive } from '@base-ui/react/button';\nimport { cn } from '@edyn/ui/lib/utils';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { isValidElement } from 'react';\n\n/**\n * The fill of a disabled Button that has one: muted, whichever way it is disabled (a button's own disabled, Base UI's\n * data-disabled, or aria-disabled on a link), in the dark theme too, where the variants set their own fill. Ghost and link\n * have no fill to begin with and are given none: a grey box would turn a link into a button.\n */\nconst DISABLED_FILL =\n 'disabled:bg-muted data-disabled:bg-muted aria-disabled:bg-muted dark:disabled:bg-muted dark:data-disabled:bg-muted dark:aria-disabled:bg-muted';\n\nexport const buttonVariants = cva(\n \"group/button inline-flex shrink-0 cursor-pointer items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all motion-reduce:transition-none motion-reduce:transform-none outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:not-aria-disabled:translate-y-px disabled:pointer-events-none disabled:border-transparent disabled:text-foreground/60 disabled:shadow-none disabled:focus-visible:ring-0 dark:disabled:border-transparent data-link-disabled:pointer-events-none data-link-disabled:focus-visible:ring-0 data-disabled:border-transparent data-disabled:text-foreground/60 data-disabled:shadow-none dark:data-disabled:border-transparent aria-disabled:border-transparent aria-disabled:text-foreground/60 aria-disabled:shadow-none dark:aria-disabled:border-transparent aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n {\n variants: {\n variant: {\n default: `bg-primary text-primary-foreground hover:bg-primary/80 ${DISABLED_FILL}`,\n outline: `border-
|
|
1
|
+
{"version":3,"file":"button.js","names":[],"sources":["../../../../../../../ui/src/components/ui/button/button.tsx"],"sourcesContent":["import { Button as ButtonPrimitive } from '@base-ui/react/button';\nimport { cn } from '@edyn/ui/lib/utils';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { isValidElement } from 'react';\n\n/**\n * The fill of a disabled Button that has one: muted, whichever way it is disabled (a button's own disabled, Base UI's\n * data-disabled, or aria-disabled on a link), in the dark theme too, where the variants set their own fill. Ghost and link\n * have no fill to begin with and are given none: a grey box would turn a link into a button.\n */\nconst DISABLED_FILL =\n 'disabled:bg-muted data-disabled:bg-muted aria-disabled:bg-muted dark:disabled:bg-muted dark:data-disabled:bg-muted dark:aria-disabled:bg-muted';\n\nexport const buttonVariants = cva(\n \"group/button inline-flex shrink-0 cursor-pointer items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all motion-reduce:transition-none motion-reduce:transform-none outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:not-aria-disabled:translate-y-px disabled:pointer-events-none disabled:border-transparent disabled:text-foreground/60 disabled:shadow-none disabled:focus-visible:ring-0 dark:disabled:border-transparent data-link-disabled:pointer-events-none data-link-disabled:focus-visible:ring-0 data-disabled:border-transparent data-disabled:text-foreground/60 data-disabled:shadow-none dark:data-disabled:border-transparent aria-disabled:border-transparent aria-disabled:text-foreground/60 aria-disabled:shadow-none dark:aria-disabled:border-transparent aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n {\n variants: {\n variant: {\n default: `bg-primary text-primary-foreground hover:bg-primary/80 ${DISABLED_FILL}`,\n outline: `border-control bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-control dark:bg-input/30 dark:hover:bg-input/50 ${DISABLED_FILL}`,\n secondary: `bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground ${DISABLED_FILL}`,\n ghost:\n 'hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50 aria-disabled:hover:bg-transparent dark:aria-disabled:hover:bg-transparent',\n destructive: `bg-destructive/10 text-destructive hover:bg-destructive/15 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/15 dark:hover:bg-destructive/20 dark:focus-visible:ring-destructive/40 ${DISABLED_FILL}`,\n link: 'text-primary underline-offset-4 hover:underline aria-disabled:hover:no-underline',\n },\n size: {\n default: 'h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2',\n xs: \"h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3\",\n sm: \"h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5\",\n lg: 'h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2',\n icon: 'size-8',\n 'icon-xs': \"size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3\",\n 'icon-sm': 'size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg',\n 'icon-lg': 'size-9',\n },\n },\n defaultVariants: {\n variant: 'default',\n size: 'default',\n },\n },\n);\n\n/**\n * Whether this Button is rendering a link rather than a button, so it can keep\n * link semantics. Covers `render={<a href=\"...\" />}` and a routing component\n * that takes an `href` (Next's Link). A component with a different prop for its\n * destination (react-router's `to`) cannot be recognised from here: give those\n * `nativeButton={false} role={undefined}` directly.\n */\nconst rendersALink = (render: ButtonPrimitive.Props['render']): boolean =>\n isValidElement(render) && (render.type === 'a' || typeof (render.props as { href?: unknown }).href === 'string');\n\n/**\n * A link that looks like a button is still a link, and has to be announced as\n * one: it opens in a new tab, it has an address, Enter follows it and Space\n * scrolls the page.\n *\n * Base UI needs telling, in two steps. Rendering an anchor while `nativeButton`\n * is true (its default) warns in development and puts `type=\"button\"` on the\n * anchor; following the warning and passing `nativeButton={false}` then adds\n * `role=\"button\"`, which is what takes the link semantics away. So this does\n * both: non-native, with the role and the tabindex Base UI would add cleared\n * again. An explicit prop from the caller still wins over either.\n */\nconst LINK_PROPS = { nativeButton: false, role: undefined, tabIndex: undefined } as const;\n\n/**\n * A disabled link is not :disabled (only a form control can be), so the markup has to say it: Base UI already marks it\n * `aria-disabled` and `data-disabled` and stops the click, and this takes it out of the tab order, which LINK_PROPS\n * would otherwise leave to the browser. The href is kept on purpose, so a routing component that requires one keeps\n * working; the pointer is kept off the link by `data-link-disabled:pointer-events-none`, which also covers a middle\n * click and the context menu, and the click and Enter are stopped by Base UI. It is a data attribute of its own, not\n * `aria-disabled`, because an aria-disabled button (`focusableWhenDisabled`) is meant to stay hoverable and focusable so it\n * can say why it cannot act; only a native :disabled button and this link are inert.\n */\nconst DISABLED_LINK_PROPS = { ...LINK_PROPS, tabIndex: -1, 'data-link-disabled': '' } as const;\n\nexport const Button = ({\n className,\n variant = 'default',\n size = 'default',\n ...props\n}: ButtonPrimitive.Props & VariantProps<typeof buttonVariants>) => {\n return (\n <ButtonPrimitive\n data-slot=\"button\"\n {...(rendersALink(props.render) ? (props.disabled ? DISABLED_LINK_PROPS : LINK_PROPS) : {})}\n className={cn(buttonVariants({ variant, size, className }))}\n {...props}\n />\n );\n};\n"],"mappings":";;;;;;;;;;;AAUA,IAAM,gBACJ;AAEF,IAAa,iBAAiB,IAC5B,qoCACA;CACE,UAAU;EACR,SAAS;GACP,SAAS,0DAA0D;GACnE,SAAS,sLAAsL;GAC/L,WAAW,kLAAkL;GAC7L,OACE;GACF,aAAa,+NAA+N;GAC5O,MAAM;EACR;EACA,MAAM;GACJ,SAAS;GACT,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,MAAM;GACN,WAAW;GACX,WAAW;GACX,WAAW;EACb;CACF;CACA,iBAAiB;EACf,SAAS;EACT,MAAM;CACR;AACF,CACF;;;;;;;;AASA,IAAM,gBAAgB,WACpB,eAAe,MAAM,MAAM,OAAO,SAAS,OAAO,OAAQ,OAAO,MAA6B,SAAS;;;;;;;;;;;;;AAczG,IAAM,aAAa;CAAE,cAAc;CAAO,MAAM,KAAA;CAAW,UAAU,KAAA;AAAU;;;;;;;;;;AAW/E,IAAM,sBAAsB;CAAE,GAAG;CAAY,UAAU;CAAI,sBAAsB;AAAG;AAEpF,IAAa,YAAU,EACrB,WACA,UAAU,WACV,OAAO,WACP,GAAG,YAC8D;CACjE,OACE,oBAAC,QAAD;EACE,aAAU;EACV,GAAK,aAAa,MAAM,MAAM,IAAK,MAAM,WAAW,sBAAsB,aAAc,CAAC;EACzF,WAAW,GAAG,eAAe;GAAE;GAAS;GAAM;EAAU,CAAC,CAAC;EAC1D,GAAI;CACL,CAAA;AAEL"}
|
|
@@ -19,7 +19,7 @@ var CardHeader = ({ className, ...props }) => {
|
|
|
19
19
|
var CardTitle = ({ className, ...props }) => {
|
|
20
20
|
return /* @__PURE__ */ jsx("div", {
|
|
21
21
|
"data-slot": "card-title",
|
|
22
|
-
className: cn("text-base leading-
|
|
22
|
+
className: cn("text-base leading-6 font-medium group-data-[size=sm]/card:text-sm group-data-[size=sm]/card:leading-5", className),
|
|
23
23
|
...props
|
|
24
24
|
});
|
|
25
25
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"card.js","names":[],"sources":["../../../../../../../ui/src/components/ui/card/card.tsx"],"sourcesContent":["import { cn } from '@edyn/ui/lib/utils';\nimport type * as React from 'react';\n\nexport const Card = ({ className, size = 'default', ...props }: React.ComponentProps<'div'> & { size?: 'default' | 'sm' }) => {\n return (\n <div\n data-slot=\"card\"\n data-size={size}\n className={cn(\n 'group/card flex flex-col gap-4 overflow-hidden rounded-xl bg-card py-4 text-sm text-card-foreground ring-1 ring-foreground/10 has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:gap-3 data-[size=sm]:py-3 data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl',\n className,\n )}\n {...props}\n />\n );\n};\n\nexport const CardHeader = ({ className, ...props }: React.ComponentProps<'div'>) => {\n return (\n <div\n data-slot=\"card-header\"\n className={cn(\n 'group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-4 group-data-[size=sm]/card:px-3 has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-4 group-data-[size=sm]/card:[.border-b]:pb-3',\n className,\n )}\n {...props}\n />\n );\n};\n\nexport const CardTitle = ({ className, ...props }: React.ComponentProps<'div'>) => {\n return <div
|
|
1
|
+
{"version":3,"file":"card.js","names":[],"sources":["../../../../../../../ui/src/components/ui/card/card.tsx"],"sourcesContent":["import { cn } from '@edyn/ui/lib/utils';\nimport type * as React from 'react';\n\nexport const Card = ({ className, size = 'default', ...props }: React.ComponentProps<'div'> & { size?: 'default' | 'sm' }) => {\n return (\n <div\n data-slot=\"card\"\n data-size={size}\n className={cn(\n 'group/card flex flex-col gap-4 overflow-hidden rounded-xl bg-card py-4 text-sm text-card-foreground ring-1 ring-foreground/10 has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:gap-3 data-[size=sm]:py-3 data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl',\n className,\n )}\n {...props}\n />\n );\n};\n\nexport const CardHeader = ({ className, ...props }: React.ComponentProps<'div'>) => {\n return (\n <div\n data-slot=\"card-header\"\n className={cn(\n 'group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-4 group-data-[size=sm]/card:px-3 has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-4 group-data-[size=sm]/card:[.border-b]:pb-3',\n className,\n )}\n {...props}\n />\n );\n};\n\nexport const CardTitle = ({ className, ...props }: React.ComponentProps<'div'>) => {\n return (\n <div\n data-slot=\"card-title\"\n className={cn('text-base leading-6 font-medium group-data-[size=sm]/card:text-sm group-data-[size=sm]/card:leading-5', className)}\n {...props}\n />\n );\n};\n\nexport const CardDescription = ({ className, ...props }: React.ComponentProps<'div'>) => {\n return <div data-slot=\"card-description\" className={cn('text-sm text-muted-foreground', className)} {...props} />;\n};\n\nexport const CardAction = ({ className, ...props }: React.ComponentProps<'div'>) => {\n return <div data-slot=\"card-action\" className={cn('col-start-2 row-span-2 row-start-1 self-start justify-self-end', className)} {...props} />;\n};\n\nexport const CardContent = ({ className, ...props }: React.ComponentProps<'div'>) => {\n return <div data-slot=\"card-content\" className={cn('px-4 group-data-[size=sm]/card:px-3', className)} {...props} />;\n};\n\nexport const CardFooter = ({ className, ...props }: React.ComponentProps<'div'>) => {\n return (\n <div\n data-slot=\"card-footer\"\n className={cn('flex items-center rounded-b-xl border-t bg-muted/50 p-4 group-data-[size=sm]/card:p-3', className)}\n {...props}\n />\n );\n};\n"],"mappings":";;;AAGA,IAAa,QAAQ,EAAE,WAAW,OAAO,WAAW,GAAG,YAAuE;CAC5H,OACE,oBAAC,OAAD;EACE,aAAU;EACV,aAAW;EACX,WAAW,GACT,wVACA,SACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,IAAa,cAAc,EAAE,WAAW,GAAG,YAAyC;CAClF,OACE,oBAAC,OAAD;EACE,aAAU;EACV,WAAW,GACT,sSACA,SACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,IAAa,aAAa,EAAE,WAAW,GAAG,YAAyC;CACjF,OACE,oBAAC,OAAD;EACE,aAAU;EACV,WAAW,GAAG,yGAAyG,SAAS;EAChI,GAAI;CACL,CAAA;AAEL;AAEA,IAAa,mBAAmB,EAAE,WAAW,GAAG,YAAyC;CACvF,OAAO,oBAAC,OAAD;EAAK,aAAU;EAAmB,WAAW,GAAG,iCAAiC,SAAS;EAAG,GAAI;CAAQ,CAAA;AAClH;AAEA,IAAa,cAAc,EAAE,WAAW,GAAG,YAAyC;CAClF,OAAO,oBAAC,OAAD;EAAK,aAAU;EAAc,WAAW,GAAG,kEAAkE,SAAS;EAAG,GAAI;CAAQ,CAAA;AAC9I;AAEA,IAAa,eAAe,EAAE,WAAW,GAAG,YAAyC;CACnF,OAAO,oBAAC,OAAD;EAAK,aAAU;EAAe,WAAW,GAAG,uCAAuC,SAAS;EAAG,GAAI;CAAQ,CAAA;AACpH;AAEA,IAAa,cAAc,EAAE,WAAW,GAAG,YAAyC;CAClF,OACE,oBAAC,OAAD;EACE,aAAU;EACV,WAAW,GAAG,yFAAyF,SAAS;EAChH,GAAI;CACL,CAAA;AAEL"}
|
|
@@ -6,7 +6,7 @@ import { Checkbox } from "@base-ui/react/checkbox";
|
|
|
6
6
|
var Checkbox$1 = ({ className, ...props }) => {
|
|
7
7
|
return /* @__PURE__ */ jsx(Checkbox.Root, {
|
|
8
8
|
"data-slot": "checkbox",
|
|
9
|
-
className: cn("peer relative flex size-4 shrink-0 items-center justify-center rounded-sm border border-
|
|
9
|
+
className: cn("peer relative flex size-4 shrink-0 items-center justify-center rounded-sm border border-control transition-colors outline-none after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 data-disabled:cursor-not-allowed data-disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground dark:data-checked:bg-primary", className),
|
|
10
10
|
...props,
|
|
11
11
|
children: /* @__PURE__ */ jsxs(Checkbox.Indicator, {
|
|
12
12
|
"data-slot": "checkbox-indicator",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkbox.js","names":[],"sources":["../../../../../../../ui/src/components/ui/checkbox/checkbox.tsx"],"sourcesContent":["import { Checkbox as CheckboxPrimitive } from '@base-ui/react/checkbox';\n\nimport { cn } from '@edyn/ui/lib/utils';\nimport { IconCheck, IconMinus } from '@tabler/icons-react';\n\nexport const Checkbox = ({ className, ...props }: CheckboxPrimitive.Root.Props) => {\n return (\n <CheckboxPrimitive.Root\n data-slot=\"checkbox\"\n className={cn(\n 'peer relative flex size-4 shrink-0 items-center justify-center rounded-sm border border-
|
|
1
|
+
{"version":3,"file":"checkbox.js","names":[],"sources":["../../../../../../../ui/src/components/ui/checkbox/checkbox.tsx"],"sourcesContent":["import { Checkbox as CheckboxPrimitive } from '@base-ui/react/checkbox';\n\nimport { cn } from '@edyn/ui/lib/utils';\nimport { IconCheck, IconMinus } from '@tabler/icons-react';\n\nexport const Checkbox = ({ className, ...props }: CheckboxPrimitive.Root.Props) => {\n return (\n <CheckboxPrimitive.Root\n data-slot=\"checkbox\"\n className={cn(\n 'peer relative flex size-4 shrink-0 items-center justify-center rounded-sm border border-control transition-colors outline-none after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 data-disabled:cursor-not-allowed data-disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground dark:data-checked:bg-primary',\n className,\n )}\n {...props}\n >\n <CheckboxPrimitive.Indicator\n data-slot=\"checkbox-indicator\"\n className=\"group/checkbox-indicator grid place-content-center text-current transition-none [&>svg]:size-3.5\"\n >\n <IconCheck className=\"group-data-indeterminate/checkbox-indicator:hidden\" />\n <IconMinus className=\"hidden group-data-indeterminate/checkbox-indicator:block\" />\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n );\n};\n"],"mappings":";;;;;AAKA,IAAa,cAAY,EAAE,WAAW,GAAG,YAA0C;CACjF,OACE,oBAAC,SAAkB,MAAnB;EACE,aAAU;EACV,WAAW,GACT,0oBACA,SACF;EACA,GAAI;EAEJ,UAAA,qBAAC,SAAkB,WAAnB;GACE,aAAU;GACV,WAAU;GAFZ,UAAA,CAIE,oBAAC,WAAD,EAAW,WAAU,qDAAsD,CAAA,GAC3E,oBAAC,WAAD,EAAW,WAAU,2DAA4D,CAAA,CACtD;;CACP,CAAA;AAE5B"}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { Combobox as ComboboxPrimitive } from '@base-ui/react/combobox';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
3
|
export declare const Combobox: <TValue>({ ...props }: ComboboxPrimitive.Root.Props<TValue>) => import('react').JSX.Element;
|
|
4
|
-
export
|
|
4
|
+
export interface IComboboxInputProps extends ComboboxPrimitive.Input.Props {
|
|
5
|
+
/** The name of the chevron button that opens the list, for a screen reader and a voice command. Translate it with the rest of the page. */
|
|
6
|
+
triggerLabel?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare const ComboboxInput: ({ className, triggerLabel, ...props }: IComboboxInputProps) => import('react').JSX.Element;
|
|
5
9
|
export interface IComboboxContentProps extends Omit<ComboboxPrimitive.Popup.Props, 'children'> {
|
|
6
10
|
/** Item nodes, or the Base UI function form `(item, index) => node` (requires `items` on the root). */
|
|
7
11
|
children?: ComboboxPrimitive.List.Props['children'];
|
|
@@ -13,3 +17,13 @@ export interface IComboboxContentProps extends Omit<ComboboxPrimitive.Popup.Prop
|
|
|
13
17
|
export declare const ComboboxContent: ({ className, children, empty, portalContainer, ...props }: IComboboxContentProps) => import('react').JSX.Element;
|
|
14
18
|
export declare const ComboboxItem: ({ className, children, ...props }: ComboboxPrimitive.Item.Props) => import('react').JSX.Element;
|
|
15
19
|
export declare const ComboboxEmpty: ({ className, children, ...props }: ComboboxPrimitive.Empty.Props) => import('react').JSX.Element;
|
|
20
|
+
/**
|
|
21
|
+
* A titled run of items. Put a `ComboboxLabel` first in it; with grouped `items` on the root, render the group's own items
|
|
22
|
+
* through `ComboboxCollection` (Base UI's grouped-items pattern), so a filter hides a group whose items all drop out.
|
|
23
|
+
*/
|
|
24
|
+
export declare const ComboboxGroup: ({ ...props }: ComboboxPrimitive.Group.Props) => import('react').JSX.Element;
|
|
25
|
+
/** A group's heading, the same one Select and the menus draw. */
|
|
26
|
+
export declare const ComboboxLabel: ({ className, ...props }: ComboboxPrimitive.GroupLabel.Props) => import('react').JSX.Element;
|
|
27
|
+
/** The items of one group, for grouped `items` on the root. */
|
|
28
|
+
export declare const ComboboxCollection: ({ ...props }: ComboboxPrimitive.Collection.Props) => import('react').JSX.Element;
|
|
29
|
+
export declare const ComboboxSeparator: ({ className, ...props }: ComboboxPrimitive.Separator.Props) => import('react').JSX.Element;
|