@sentropic/design-system-svelte 0.13.0 → 0.15.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.
@@ -0,0 +1,24 @@
1
+ export type RatingSize = "sm" | "md" | "lg";
2
+ import type { HTMLAttributes } from "svelte/elements";
3
+ type RatingProps = Omit<HTMLAttributes<HTMLDivElement>, "class" | "onchange"> & {
4
+ /** Note courante (0..max). Pas de 1, ou 0.5 si `allowHalf`. */
5
+ value?: number;
6
+ /** Nombre d'étoiles. */
7
+ max?: number;
8
+ /** Appelé avec la nouvelle note au clic ou au clavier. */
9
+ onChange?: (value: number) => void;
10
+ /** Affichage seul : ni clic ni clavier n'émettent. */
11
+ readonly?: boolean;
12
+ /** Autorise les demi-étoiles (sélection au demi-point). */
13
+ allowHalf?: boolean;
14
+ size?: RatingSize;
15
+ /** Attribut name (utile dans un formulaire / pour la sémantique radio). */
16
+ name?: string;
17
+ /** Étiquette accessible du groupe. */
18
+ label?: string;
19
+ class?: string;
20
+ };
21
+ declare const Rating: import("svelte").Component<RatingProps, {}, "">;
22
+ type Rating = ReturnType<typeof Rating>;
23
+ export default Rating;
24
+ //# sourceMappingURL=Rating.svelte.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Rating.svelte.d.ts","sourceRoot":"","sources":["../src/lib/Rating.svelte.ts"],"names":[],"mappings":"AAGE,MAAM,MAAM,UAAU,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAI9C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAGpD,KAAK,WAAW,GAAG,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,OAAO,GAAG,UAAU,CAAC,GAAG;IAC9E,+DAA+D;IAC/D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,wBAAwB;IACxB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,0DAA0D;IAC1D,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,sDAAsD;IACtD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,2DAA2D;IAC3D,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,2EAA2E;IAC3E,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,sCAAsC;IACtC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AA2GJ,QAAA,MAAM,MAAM,iDAAwC,CAAC;AACrD,KAAK,MAAM,GAAG,UAAU,CAAC,OAAO,MAAM,CAAC,CAAC;AACxC,eAAe,MAAM,CAAC"}
@@ -0,0 +1,173 @@
1
+ <script lang="ts" module>
2
+ export type SlideIndicatorVariant = "dots" | "bars";
3
+ </script>
4
+
5
+ <script lang="ts">
6
+ import type { HTMLAttributes } from "svelte/elements";
7
+
8
+ type SlideIndicatorProps = Omit<HTMLAttributes<HTMLDivElement>, "class" | "onchange"> & {
9
+ /** Nombre total de diapositives. */
10
+ count: number;
11
+ /** Index de la diapositive courante (0-based). */
12
+ current?: number;
13
+ /** Appelé avec l'index ciblé au clic ou au clavier. */
14
+ onChange?: (index: number) => void;
15
+ size?: "sm" | "md" | "lg";
16
+ variant?: SlideIndicatorVariant;
17
+ /** Préfixe d'étiquette accessible de chaque point ("Diapositive 1"...). */
18
+ label?: string;
19
+ class?: string;
20
+ };
21
+
22
+ let {
23
+ count,
24
+ current = 0,
25
+ onChange,
26
+ size = "md",
27
+ variant = "dots",
28
+ label = "Diapositive",
29
+ class: className,
30
+ ...rest
31
+ }: SlideIndicatorProps = $props();
32
+
33
+ const classes = $derived(
34
+ [
35
+ "st-slideIndicator",
36
+ `st-slideIndicator--${size}`,
37
+ `st-slideIndicator--${variant}`,
38
+ className
39
+ ]
40
+ .filter(Boolean)
41
+ .join(" ")
42
+ );
43
+
44
+ const items = $derived(Array.from({ length: Math.max(0, count) }, (_, i) => i));
45
+
46
+ function select(index: number) {
47
+ if (index < 0 || index >= count || index === current) return;
48
+ onChange?.(index);
49
+ }
50
+
51
+ function onKeyDown(event: KeyboardEvent, index: number) {
52
+ let target = index;
53
+ switch (event.key) {
54
+ case "ArrowRight":
55
+ case "ArrowDown":
56
+ target = Math.min(count - 1, index + 1);
57
+ break;
58
+ case "ArrowLeft":
59
+ case "ArrowUp":
60
+ target = Math.max(0, index - 1);
61
+ break;
62
+ case "Home":
63
+ target = 0;
64
+ break;
65
+ case "End":
66
+ target = count - 1;
67
+ break;
68
+ default:
69
+ return;
70
+ }
71
+ event.preventDefault();
72
+ select(target);
73
+ }
74
+ </script>
75
+
76
+ <div {...rest} class={classes} role="tablist" aria-label={label}>
77
+ {#each items as index (index)}
78
+ <button
79
+ type="button"
80
+ class="st-slideIndicator__dot"
81
+ class:st-slideIndicator__dot--current={index === current}
82
+ role="tab"
83
+ aria-selected={index === current ? "true" : "false"}
84
+ aria-current={index === current ? "true" : undefined}
85
+ aria-label={`${label} ${index + 1}`}
86
+ tabindex={index === current ? 0 : -1}
87
+ onclick={() => select(index)}
88
+ onkeydown={(event) => onKeyDown(event, index)}
89
+ ></button>
90
+ {/each}
91
+ </div>
92
+
93
+ <style>
94
+ .st-slideIndicator {
95
+ align-items: center;
96
+ display: inline-flex;
97
+ gap: var(--st-spacing-2, 0.5rem);
98
+ }
99
+
100
+ .st-slideIndicator__dot {
101
+ background: var(--st-semantic-border-strong, var(--st-semantic-text-muted));
102
+ border: 0;
103
+ cursor: pointer;
104
+ opacity: 0.5;
105
+ padding: 0;
106
+ transition:
107
+ opacity var(--st-motion-fast, 120ms) var(--st-motion-easing, ease),
108
+ background-color var(--st-motion-fast, 120ms) var(--st-motion-easing, ease),
109
+ width var(--st-motion-fast, 120ms) var(--st-motion-easing, ease);
110
+ }
111
+
112
+ .st-slideIndicator__dot:hover {
113
+ opacity: 0.8;
114
+ }
115
+
116
+ .st-slideIndicator__dot:focus-visible {
117
+ outline: 2px solid var(--st-component-control-focusRing, var(--st-semantic-border-interactive));
118
+ outline-offset: 2px;
119
+ }
120
+
121
+ .st-slideIndicator__dot--current {
122
+ background: var(--st-semantic-action-primary);
123
+ opacity: 1;
124
+ }
125
+
126
+ /* Variant dots: cercles */
127
+ .st-slideIndicator--dots .st-slideIndicator__dot {
128
+ border-radius: 50%;
129
+ }
130
+
131
+ .st-slideIndicator--dots.st-slideIndicator--sm .st-slideIndicator__dot {
132
+ height: 0.375rem;
133
+ width: 0.375rem;
134
+ }
135
+
136
+ .st-slideIndicator--dots.st-slideIndicator--md .st-slideIndicator__dot {
137
+ height: 0.5rem;
138
+ width: 0.5rem;
139
+ }
140
+
141
+ .st-slideIndicator--dots.st-slideIndicator--lg .st-slideIndicator__dot {
142
+ height: 0.75rem;
143
+ width: 0.75rem;
144
+ }
145
+
146
+ /* Variant bars: barres, la courante s'allonge */
147
+ .st-slideIndicator--bars .st-slideIndicator__dot {
148
+ border-radius: 999px;
149
+ }
150
+
151
+ .st-slideIndicator--bars.st-slideIndicator--sm .st-slideIndicator__dot {
152
+ height: 0.25rem;
153
+ width: 0.75rem;
154
+ }
155
+
156
+ .st-slideIndicator--bars.st-slideIndicator--md .st-slideIndicator__dot {
157
+ height: 0.3125rem;
158
+ width: 1rem;
159
+ }
160
+
161
+ .st-slideIndicator--bars.st-slideIndicator--lg .st-slideIndicator__dot {
162
+ height: 0.375rem;
163
+ width: 1.25rem;
164
+ }
165
+
166
+ .st-slideIndicator--bars .st-slideIndicator__dot--current {
167
+ width: 1.75rem;
168
+ }
169
+
170
+ .st-slideIndicator--bars.st-slideIndicator--lg .st-slideIndicator__dot--current {
171
+ width: 2.25rem;
172
+ }
173
+ </style>
@@ -0,0 +1,19 @@
1
+ export type SlideIndicatorVariant = "dots" | "bars";
2
+ import type { HTMLAttributes } from "svelte/elements";
3
+ type SlideIndicatorProps = Omit<HTMLAttributes<HTMLDivElement>, "class" | "onchange"> & {
4
+ /** Nombre total de diapositives. */
5
+ count: number;
6
+ /** Index de la diapositive courante (0-based). */
7
+ current?: number;
8
+ /** Appelé avec l'index ciblé au clic ou au clavier. */
9
+ onChange?: (index: number) => void;
10
+ size?: "sm" | "md" | "lg";
11
+ variant?: SlideIndicatorVariant;
12
+ /** Préfixe d'étiquette accessible de chaque point ("Diapositive 1"...). */
13
+ label?: string;
14
+ class?: string;
15
+ };
16
+ declare const SlideIndicator: import("svelte").Component<SlideIndicatorProps, {}, "">;
17
+ type SlideIndicator = ReturnType<typeof SlideIndicator>;
18
+ export default SlideIndicator;
19
+ //# sourceMappingURL=SlideIndicator.svelte.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SlideIndicator.svelte.d.ts","sourceRoot":"","sources":["../src/lib/SlideIndicator.svelte.ts"],"names":[],"mappings":"AAGE,MAAM,MAAM,qBAAqB,GAAG,MAAM,GAAG,MAAM,CAAC;AAGtD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAGpD,KAAK,mBAAmB,GAAG,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,OAAO,GAAG,UAAU,CAAC,GAAG;IACtF,oCAAoC;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,kDAAkD;IAClD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,uDAAuD;IACvD,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAC1B,OAAO,CAAC,EAAE,qBAAqB,CAAC;IAChC,2EAA2E;IAC3E,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAuEJ,QAAA,MAAM,cAAc,yDAAwC,CAAC;AAC7D,KAAK,cAAc,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AACxD,eAAe,cAAc,CAAC"}
@@ -0,0 +1,335 @@
1
+ <script lang="ts" module>
2
+ export type TimePickerFormat = "24" | "12";
3
+ </script>
4
+
5
+ <script lang="ts">
6
+ import { Clock } from "@lucide/svelte";
7
+ import type { HTMLAttributes } from "svelte/elements";
8
+
9
+ type TimePickerProps = Omit<HTMLAttributes<HTMLDivElement>, "class" | "onchange"> & {
10
+ /** Heure courante au format "HH:mm" (24h, toujours). Vide = non renseigné. */
11
+ value?: string;
12
+ /** Appelé avec "HH:mm" lors d'une sélection. */
13
+ onChange?: (value: string) => void;
14
+ /** Pas (en minutes) entre deux créneaux générés. */
15
+ step?: number;
16
+ /** Borne minimale "HH:mm" (inclusive). */
17
+ min?: string;
18
+ /** Borne maximale "HH:mm" (inclusive). */
19
+ max?: string;
20
+ /** Affichage 24h (par défaut) ou 12h (AM/PM). La valeur émise reste "HH:mm". */
21
+ format?: TimePickerFormat;
22
+ size?: "sm" | "md" | "lg";
23
+ disabled?: boolean;
24
+ label?: string;
25
+ class?: string;
26
+ id?: string;
27
+ };
28
+
29
+ let {
30
+ value = "",
31
+ onChange,
32
+ step = 15,
33
+ min,
34
+ max,
35
+ format = "24",
36
+ size = "md",
37
+ disabled = false,
38
+ label,
39
+ class: className,
40
+ id,
41
+ ...rest
42
+ }: TimePickerProps = $props();
43
+
44
+ const fieldId = $derived(id ?? `st-timepicker-${Math.random().toString(36).slice(2, 9)}`);
45
+ const listId = $derived(`${fieldId}-list`);
46
+
47
+ const groupClasses = $derived(["st-timepicker", `st-timepicker--${size}`].join(" "));
48
+
49
+ function toMinutes(hhmm: string | undefined): number | null {
50
+ if (!hhmm) return null;
51
+ const match = /^(\d{1,2}):(\d{2})$/.exec(hhmm);
52
+ if (!match) return null;
53
+ const h = Number(match[1]);
54
+ const m = Number(match[2]);
55
+ if (h < 0 || h > 23 || m < 0 || m > 59) return null;
56
+ return h * 60 + m;
57
+ }
58
+
59
+ function fromMinutes(total: number): string {
60
+ const h = Math.floor(total / 60);
61
+ const m = total % 60;
62
+ return `${String(h).padStart(2, "0")}:${String(m).padStart(2, "0")}`;
63
+ }
64
+
65
+ function display(hhmm: string): string {
66
+ if (format === "24") return hhmm;
67
+ const total = toMinutes(hhmm);
68
+ if (total === null) return hhmm;
69
+ const h24 = Math.floor(total / 60);
70
+ const m = total % 60;
71
+ const period = h24 < 12 ? "AM" : "PM";
72
+ let h12 = h24 % 12;
73
+ if (h12 === 0) h12 = 12;
74
+ return `${String(h12).padStart(2, "0")}:${String(m).padStart(2, "0")} ${period}`;
75
+ }
76
+
77
+ const slots = $derived.by<string[]>(() => {
78
+ const safeStep = step > 0 ? step : 15;
79
+ const lower = toMinutes(min) ?? 0;
80
+ const upper = toMinutes(max) ?? 23 * 60 + 59;
81
+ const result: string[] = [];
82
+ for (let t = lower; t <= upper; t += safeStep) {
83
+ result.push(fromMinutes(t));
84
+ }
85
+ return result;
86
+ });
87
+
88
+ let open = $state(false);
89
+ let hostEl = $state<HTMLDivElement | null>(null);
90
+
91
+ const displayValue = $derived(value ? display(value) : "");
92
+
93
+ function toggleOpen() {
94
+ if (disabled) return;
95
+ open = !open;
96
+ }
97
+
98
+ function pick(slot: string) {
99
+ value = slot;
100
+ onChange?.(slot);
101
+ open = false;
102
+ }
103
+
104
+ function onPanelKeyDown(event: KeyboardEvent) {
105
+ if (event.key === "Escape" && open) {
106
+ event.preventDefault();
107
+ open = false;
108
+ }
109
+ }
110
+
111
+ function onDocumentMouseDown(event: MouseEvent) {
112
+ if (!open) return;
113
+ const target = event.target as Node | null;
114
+ if (hostEl && target && !hostEl.contains(target)) {
115
+ open = false;
116
+ }
117
+ }
118
+
119
+ $effect(() => {
120
+ if (typeof document === "undefined") return;
121
+ document.addEventListener("mousedown", onDocumentMouseDown);
122
+ return () => document.removeEventListener("mousedown", onDocumentMouseDown);
123
+ });
124
+ </script>
125
+
126
+ <div class="st-field" bind:this={hostEl} {...rest}>
127
+ <div class="st-field__control">
128
+ {#if label}<label class="st-field__label" for={fieldId}>{label}</label>{/if}
129
+ <span class={groupClasses}>
130
+ <input
131
+ id={fieldId}
132
+ type="text"
133
+ readonly
134
+ class="st-timepicker__control"
135
+ value={displayValue}
136
+ placeholder={format === "24" ? "HH:mm" : "hh:mm AM"}
137
+ {disabled}
138
+ role="combobox"
139
+ aria-haspopup="listbox"
140
+ aria-controls={listId}
141
+ aria-expanded={open ? "true" : "false"}
142
+ onclick={toggleOpen}
143
+ />
144
+ <button
145
+ type="button"
146
+ class="st-timepicker__trigger"
147
+ aria-label="Ouvrir la liste des horaires"
148
+ aria-haspopup="listbox"
149
+ aria-expanded={open ? "true" : "false"}
150
+ {disabled}
151
+ onclick={toggleOpen}
152
+ >
153
+ <Clock size={16} aria-hidden="true" />
154
+ </button>
155
+ </span>
156
+ </div>
157
+ {#if open}
158
+ <ul
159
+ id={listId}
160
+ class="st-timepicker__list"
161
+ role="listbox"
162
+ aria-label={label ?? "Horaires"}
163
+ tabindex="-1"
164
+ onkeydown={onPanelKeyDown}
165
+ >
166
+ {#each slots as slot (slot)}
167
+ <li role="presentation">
168
+ <button
169
+ type="button"
170
+ class="st-timepicker__option"
171
+ class:st-timepicker__option--selected={slot === value}
172
+ role="option"
173
+ aria-selected={slot === value ? "true" : "false"}
174
+ onclick={() => pick(slot)}
175
+ >
176
+ {display(slot)}
177
+ </button>
178
+ </li>
179
+ {/each}
180
+ </ul>
181
+ {/if}
182
+ </div>
183
+
184
+ <style>
185
+ .st-field {
186
+ color: var(--st-component-field-labelText, var(--st-semantic-text-primary));
187
+ display: grid;
188
+ gap: var(--st-component-field-gap, 0.5rem);
189
+ max-width: var(--st-component-field-maxWidth, 28rem);
190
+ position: relative;
191
+ }
192
+
193
+ .st-field__control {
194
+ display: grid;
195
+ gap: var(--st-component-field-gap, 0.5rem);
196
+ }
197
+
198
+ .st-field__label {
199
+ font-size: 0.875rem;
200
+ font-weight: 600;
201
+ }
202
+
203
+ .st-timepicker {
204
+ align-items: stretch;
205
+ background: var(--st-component-control-background, var(--st-semantic-surface-default));
206
+ border: var(--st-component-control-anatomy-shape-borderWidth, 1px)
207
+ var(--st-component-control-anatomy-shape-borderStyle, solid)
208
+ var(--st-component-control-border, var(--st-semantic-border-subtle));
209
+ border-radius: var(--st-component-control-anatomy-shape-radius, 0.375rem);
210
+ color: var(--st-component-control-text, var(--st-semantic-text-primary));
211
+ display: inline-flex;
212
+ overflow: hidden;
213
+ transition:
214
+ border-color var(--st-motion-fast, 120ms) var(--st-motion-easing, ease),
215
+ box-shadow var(--st-motion-fast, 120ms) var(--st-motion-easing, ease);
216
+ width: 100%;
217
+ }
218
+
219
+ .st-timepicker--sm {
220
+ min-height: var(--st-component-control-smHeight, 2rem);
221
+ }
222
+
223
+ .st-timepicker--md {
224
+ min-height: var(--st-component-control-mdHeight, 2.5rem);
225
+ }
226
+
227
+ .st-timepicker--lg {
228
+ min-height: var(--st-component-control-lgHeight, 3rem);
229
+ }
230
+
231
+ .st-timepicker:hover:not(:has(input:disabled)) {
232
+ border-color: var(--st-component-control-hoverBorder, var(--st-semantic-border-strong));
233
+ }
234
+
235
+ .st-timepicker:focus-within {
236
+ border-color: var(--st-component-control-focusRing, var(--st-semantic-border-interactive));
237
+ box-shadow: var(--st-component-control-anatomy-focus-boxShadow,
238
+ 0 0 0 2px var(--st-component-control-focusRing, var(--st-semantic-border-interactive)));
239
+ }
240
+
241
+ .st-timepicker__control {
242
+ background: transparent;
243
+ border: 0;
244
+ color: inherit;
245
+ cursor: pointer;
246
+ flex: 1 1 auto;
247
+ font: inherit;
248
+ min-width: 0;
249
+ padding: 0 0.75rem;
250
+ width: 100%;
251
+ }
252
+
253
+ .st-timepicker__control:focus {
254
+ outline: none;
255
+ }
256
+
257
+ .st-timepicker__control::placeholder {
258
+ color: var(--st-component-control-placeholderText, var(--st-semantic-text-muted));
259
+ }
260
+
261
+ .st-timepicker__control:disabled {
262
+ color: var(--st-component-control-disabledText, var(--st-semantic-text-muted));
263
+ cursor: not-allowed;
264
+ }
265
+
266
+ .st-timepicker__trigger {
267
+ align-items: center;
268
+ background: transparent;
269
+ border: 0;
270
+ border-left: 1px solid var(--st-component-control-border, var(--st-semantic-border-subtle));
271
+ color: var(--st-semantic-text-secondary);
272
+ cursor: pointer;
273
+ display: inline-flex;
274
+ flex: 0 0 auto;
275
+ justify-content: center;
276
+ min-width: 2.25rem;
277
+ padding: 0 0.5rem;
278
+ }
279
+
280
+ .st-timepicker__trigger:hover:not(:disabled) {
281
+ background: var(--st-component-control-hoverBackground, var(--st-semantic-surface-subtle));
282
+ }
283
+
284
+ .st-timepicker__trigger:focus-visible {
285
+ outline: 2px solid var(--st-component-control-focusRing, var(--st-semantic-border-interactive));
286
+ outline-offset: -2px;
287
+ }
288
+
289
+ .st-timepicker__trigger:disabled {
290
+ cursor: not-allowed;
291
+ }
292
+
293
+ .st-timepicker__list {
294
+ background: var(--st-component-popover-background, var(--st-semantic-surface-raised));
295
+ border: 1px solid var(--st-component-popover-border, var(--st-semantic-border-subtle));
296
+ border-radius: var(--st-component-popover-radius, 0.5rem);
297
+ box-shadow: var(--st-component-popover-shadow, 0 18px 45px rgb(15 23 42 / 0.18));
298
+ list-style: none;
299
+ margin: var(--st-spacing-1, 0.25rem) 0 0;
300
+ max-height: 14rem;
301
+ overflow-y: auto;
302
+ padding: var(--st-spacing-1, 0.25rem);
303
+ position: absolute;
304
+ top: 100%;
305
+ width: 100%;
306
+ z-index: var(--st-component-popover-zIndex, 80);
307
+ }
308
+
309
+ .st-timepicker__option {
310
+ background: transparent;
311
+ border: 0;
312
+ border-radius: var(--st-component-control-radius, 0.375rem);
313
+ color: inherit;
314
+ cursor: pointer;
315
+ display: block;
316
+ font: inherit;
317
+ padding: var(--st-spacing-2, 0.5rem) var(--st-spacing-3, 0.75rem);
318
+ text-align: left;
319
+ width: 100%;
320
+ }
321
+
322
+ .st-timepicker__option:hover {
323
+ background: var(--st-component-control-hoverBackground, var(--st-semantic-surface-subtle));
324
+ }
325
+
326
+ .st-timepicker__option:focus-visible {
327
+ outline: 2px solid var(--st-component-control-focusRing, var(--st-semantic-border-interactive));
328
+ outline-offset: -2px;
329
+ }
330
+
331
+ .st-timepicker__option--selected {
332
+ background: var(--st-component-dropdown-selectedBackground, var(--st-semantic-action-primary));
333
+ color: var(--st-component-dropdown-selectedText, var(--st-semantic-action-primaryText));
334
+ }
335
+ </style>
@@ -0,0 +1,25 @@
1
+ export type TimePickerFormat = "24" | "12";
2
+ import type { HTMLAttributes } from "svelte/elements";
3
+ type TimePickerProps = Omit<HTMLAttributes<HTMLDivElement>, "class" | "onchange"> & {
4
+ /** Heure courante au format "HH:mm" (24h, toujours). Vide = non renseigné. */
5
+ value?: string;
6
+ /** Appelé avec "HH:mm" lors d'une sélection. */
7
+ onChange?: (value: string) => void;
8
+ /** Pas (en minutes) entre deux créneaux générés. */
9
+ step?: number;
10
+ /** Borne minimale "HH:mm" (inclusive). */
11
+ min?: string;
12
+ /** Borne maximale "HH:mm" (inclusive). */
13
+ max?: string;
14
+ /** Affichage 24h (par défaut) ou 12h (AM/PM). La valeur émise reste "HH:mm". */
15
+ format?: TimePickerFormat;
16
+ size?: "sm" | "md" | "lg";
17
+ disabled?: boolean;
18
+ label?: string;
19
+ class?: string;
20
+ id?: string;
21
+ };
22
+ declare const TimePicker: import("svelte").Component<TimePickerProps, {}, "">;
23
+ type TimePicker = ReturnType<typeof TimePicker>;
24
+ export default TimePicker;
25
+ //# sourceMappingURL=TimePicker.svelte.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TimePicker.svelte.d.ts","sourceRoot":"","sources":["../src/lib/TimePicker.svelte.ts"],"names":[],"mappings":"AAGE,MAAM,MAAM,gBAAgB,GAAG,IAAI,GAAG,IAAI,CAAC;AAI7C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAGpD,KAAK,eAAe,GAAG,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,OAAO,GAAG,UAAU,CAAC,GAAG;IAClF,8EAA8E;IAC9E,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gDAAgD;IAChD,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,oDAAoD;IACpD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,0CAA0C;IAC1C,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,0CAA0C;IAC1C,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,gFAAgF;IAChF,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAC1B,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAC1B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,EAAE,CAAC,EAAE,MAAM,CAAC;CACb,CAAC;AAoIJ,QAAA,MAAM,UAAU,qDAAwC,CAAC;AACzD,KAAK,UAAU,GAAG,UAAU,CAAC,OAAO,UAAU,CAAC,CAAC;AAChD,eAAe,UAAU,CAAC"}
package/dist/index.d.ts CHANGED
@@ -2,6 +2,7 @@ export { default as Accordion } from "./Accordion.svelte";
2
2
  export { default as Alert } from "./Alert.svelte";
3
3
  export { default as AreaChart } from "./AreaChart.svelte";
4
4
  export { default as AspectRatio } from "./AspectRatio.svelte";
5
+ export { default as Autosave } from "./Autosave.svelte";
5
6
  export { default as Avatar } from "./Avatar.svelte";
6
7
  export { default as AvatarGroup } from "./AvatarGroup.svelte";
7
8
  export { default as Badge } from "./Badge.svelte";
@@ -10,6 +11,7 @@ export { default as BackToTop } from "./BackToTop.svelte";
10
11
  export { default as Breadcrumb } from "./Breadcrumb.svelte";
11
12
  export { default as Button } from "./Button.svelte";
12
13
  export { default as ButtonGroup } from "./ButtonGroup.svelte";
14
+ export { default as Calendar } from "./Calendar.svelte";
13
15
  export { default as Card } from "./Card.svelte";
14
16
  export { default as ChatMessage } from "./ChatMessage.svelte";
15
17
  export { default as ChatComposer } from "./ChatComposer.svelte";
@@ -67,11 +69,14 @@ export { default as Pagination } from "./Pagination.svelte";
67
69
  export { default as PaginationNav } from "./PaginationNav.svelte";
68
70
  export { default as PasswordInput } from "./PasswordInput.svelte";
69
71
  export { default as Popover } from "./Popover.svelte";
72
+ export { default as Popper } from "./Popper.svelte";
73
+ export { default as Portal } from "./Portal.svelte";
70
74
  export { default as ProgressBar } from "./ProgressBar.svelte";
71
75
  export { default as ProgressIndicator } from "./ProgressIndicator.svelte";
72
76
  export { default as Quote } from "./Quote.svelte";
73
77
  export { default as Radio } from "./Radio.svelte";
74
78
  export { default as RadioGroup } from "./RadioGroup.svelte";
79
+ export { default as Rating } from "./Rating.svelte";
75
80
  export { default as Row } from "./Row.svelte";
76
81
  export { default as ScatterPlot } from "./ScatterPlot.svelte";
77
82
  export { default as Search } from "./Search.svelte";
@@ -79,6 +84,7 @@ export { default as Select } from "./Select.svelte";
79
84
  export { default as SideNav } from "./SideNav.svelte";
80
85
  export { default as SkeletonText } from "./SkeletonText.svelte";
81
86
  export { default as SkipLink } from "./SkipLink.svelte";
87
+ export { default as SlideIndicator } from "./SlideIndicator.svelte";
82
88
  export { default as Slider } from "./Slider.svelte";
83
89
  export { default as Stack } from "./Stack.svelte";
84
90
  export { default as Stepper } from "./Stepper.svelte";
@@ -91,6 +97,7 @@ export { default as Tabs } from "./Tabs.svelte";
91
97
  export { default as Tag } from "./Tag.svelte";
92
98
  export { default as ThemeProvider } from "./ThemeProvider.svelte";
93
99
  export { default as Textarea } from "./Textarea.svelte";
100
+ export { default as TimePicker } from "./TimePicker.svelte";
94
101
  export { default as Tile } from "./Tile.svelte";
95
102
  export { default as TileGroup } from "./TileGroup.svelte";
96
103
  export { default as Toast } from "./Toast.svelte";
@@ -114,6 +121,11 @@ export type { StreamingMessageEvent, StreamingMessageMode } from "./StreamingMes
114
121
  export type { ComboboxOption } from "./Combobox.svelte";
115
122
  export type { DataTableColumn, DataTableRow, DataTableSelectMode, DataTableSort } from "./DataTable.svelte";
116
123
  export type { DatePickerRange } from "./DatePicker.svelte";
124
+ export type { RatingSize } from "./Rating.svelte";
125
+ export type { TimePickerFormat } from "./TimePicker.svelte";
126
+ export type { CalendarValue } from "./Calendar.svelte";
127
+ export type { SlideIndicatorVariant } from "./SlideIndicator.svelte";
128
+ export type { AutosaveStatus, AutosaveLabels } from "./Autosave.svelte";
117
129
  export type { DonutChartDatum, DonutChartTone } from "./DonutChart.svelte";
118
130
  export type { ForceGraphNode, ForceGraphEdge, ForceGraphTone, ForceGraphNodeShape, ForceGraphEdgeDash, ForceGraphLegendEntry } from "./ForceGraph.svelte";
119
131
  export { nodeShapePath, edgeDashArray } from "./ForceGraph.svelte";
@@ -153,4 +165,6 @@ export type { CheckboxGroupOption } from "./CheckboxGroup.svelte";
153
165
  export type { RadioGroupOption } from "./RadioGroup.svelte";
154
166
  export type { TypographyVariant, TypographyWeight, TypographyTone, TypographyAlign } from "./Typography.svelte";
155
167
  export type { StepperStep, StepperOrientation } from "./Stepper.svelte";
168
+ export type { PortalProps } from "./Portal.svelte";
169
+ export type { PopperProps, PopperPlacement, PopperStrategy } from "./Popper.svelte";
156
170
  //# sourceMappingURL=index.d.ts.map