@directo-ui/astro 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/README.md +14 -0
  2. package/components.css +326 -0
  3. package/index.d.ts +31 -31
  4. package/index.js +31 -31
  5. package/package.json +19 -1
  6. package/src/components/Accordion.astro +8 -8
  7. package/src/components/AccordionItem.astro +14 -14
  8. package/src/components/Alert.astro +42 -42
  9. package/src/components/Avatar.astro +21 -21
  10. package/src/components/Badge.astro +13 -13
  11. package/src/components/BottomSheet.astro +23 -23
  12. package/src/components/Breadcrumb.astro +18 -18
  13. package/src/components/Button.astro +31 -31
  14. package/src/components/Card.astro +25 -25
  15. package/src/components/Checkbox.astro +14 -14
  16. package/src/components/DatePicker.astro +25 -25
  17. package/src/components/Divider.astro +11 -11
  18. package/src/components/Dropdown.astro +71 -71
  19. package/src/components/EmptyState.astro +15 -15
  20. package/src/components/IconButton.astro +18 -18
  21. package/src/components/Modal.astro +34 -34
  22. package/src/components/MultiSelect.astro +108 -0
  23. package/src/components/Pagination.astro +30 -30
  24. package/src/components/Progress.astro +20 -20
  25. package/src/components/RadioGroup.astro +24 -24
  26. package/src/components/Select.astro +29 -29
  27. package/src/components/Skeleton.astro +13 -13
  28. package/src/components/Spinner.astro +17 -17
  29. package/src/components/StatusTag.astro +18 -0
  30. package/src/components/Switch.astro +13 -13
  31. package/src/components/Tabs.astro +60 -60
  32. package/src/components/TextField.astro +24 -24
  33. package/src/components/Textarea.astro +41 -41
  34. package/src/components/Toaster.astro +8 -8
  35. package/src/components/Tooltip.astro +31 -31
  36. package/src/components/WariDateField.astro +56 -0
  37. package/src/components/WariSchedule.astro +48 -0
  38. package/src/components/WariSelect.astro +76 -0
  39. package/src/components/WariServiceMeta.astro +19 -0
  40. package/src/components/WariStatusSelect.astro +20 -0
  41. package/src/components/WariStepper.astro +40 -0
  42. package/src/components/WariSwitchList.astro +33 -0
  43. package/src/components/WariTimeField.astro +50 -0
  44. package/src/components/WariTripAttributes.astro +60 -0
  45. package/src/modal.d.ts +3 -3
  46. package/src/modal.js +39 -39
  47. package/src/pagination.d.ts +2 -2
  48. package/src/pagination.js +16 -16
  49. package/src/toast.d.ts +9 -9
  50. package/src/toast.js +66 -66
  51. package/src/wari/datetime.d.ts +57 -0
  52. package/src/wari/datetime.js +151 -0
  53. package/src/wari/logic.d.ts +8 -0
  54. package/src/wari/logic.js +41 -0
  55. package/src/wari/multiselect.d.ts +2 -0
  56. package/src/wari/multiselect.js +169 -0
  57. package/src/wari/pickers.d.ts +2 -0
  58. package/src/wari/pickers.js +369 -0
  59. package/src/wari/statuses.d.ts +14 -0
  60. package/src/wari/statuses.js +15 -0
  61. package/src/wari/trip-client.d.ts +4 -0
  62. package/src/wari/trip-client.js +222 -0
  63. package/src/wari/trip.d.ts +56 -0
  64. package/src/wari/trip.js +69 -0
  65. package/styles.css +3 -3
  66. package/wari.d.ts +20 -0
  67. package/wari.js +16 -0
@@ -0,0 +1,222 @@
1
+ // Client behaviour for <WariSelect>, <WariSwitchList>, <WariStepper> and <WariTripAttributes>. Safe to call many times.
2
+ // Each piece emits a bubbling "ds-change" CustomEvent with its value; <WariTripAttributes> stops those and emits its own
3
+ // "ds-change" with the whole object { service, hourly, delivery, extras, vehicles, payment }.
4
+ import { clampCount, serviceMeta, typeaheadIndex } from './trip.js';
5
+
6
+ const emit = (element, detail) => element.dispatchEvent(new CustomEvent('ds-change', { detail, bubbles: true }));
7
+ const userSvg = '<svg viewBox="0 0 24 24" aria-hidden="true"><circle cx="12" cy="8" r="4" fill="currentColor"/><path d="M4.5 20.5c1-4 4-6 7.5-6s6.5 2 7.5 6" fill="currentColor"/></svg>';
8
+ const bagSvg = '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"><rect x="2.5" y="8.5" width="19" height="11" rx="2" fill="currentColor" stroke="none"/><path d="M9 8.5V6.5h6v2"/></svg>';
9
+ const luggageSvg = '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"><rect x="6" y="7" width="12" height="13" rx="2" fill="currentColor" stroke="none"/><path d="M9.5 7V4.5h5V7M9 22v-2M15 22v-2"/></svg>';
10
+
11
+ /** Same markup as WariServiceMeta.astro, for re-rendering when "Por horas" / "Envíos" change. */
12
+ export function serviceMetaHtml(service, mode) {
13
+ const meta = serviceMeta(service, mode);
14
+ let html = '';
15
+ if (meta.delivery) html += '<span class="ds-wmeta-badge">Envío</span>';
16
+ if (meta.price) html += `<span class="ds-wmeta-item">${meta.price}</span>`;
17
+ if (meta.capacity) {
18
+ html += `<span class="ds-wmeta-item">${userSvg}${meta.capacity.passengers}</span><span class="ds-wmeta-item">${luggageSvg}${meta.capacity.luggage}</span>`;
19
+ if (meta.capacity.luggageAlt != null) html += `<span class="ds-wmeta-item">o ${bagSvg}${meta.capacity.luggageAlt}</span>`;
20
+ }
21
+ return { html, label: meta.label };
22
+ }
23
+
24
+ export function initWariTripFields(scope = document) {
25
+ scope.querySelectorAll('[data-ds-wselect]:not([data-ds-ready])').forEach(setupSelect);
26
+ scope.querySelectorAll('[data-ds-wswitches]:not([data-ds-ready])').forEach(setupSwitches);
27
+ scope.querySelectorAll('[data-ds-wstepper]:not([data-ds-ready])').forEach(setupStepper);
28
+ scope.querySelectorAll('[data-ds-wtrip]:not([data-ds-ready])').forEach(setupTrip);
29
+ }
30
+
31
+ function setupSelect(root) {
32
+ root.dataset.dsReady = '';
33
+ const combo = root.querySelector('[role="combobox"]');
34
+ const list = root.querySelector('[role="listbox"]');
35
+ const valueText = root.querySelector('.ds-wselect-value');
36
+ const valueMeta = root.querySelector('[data-ds-value-meta]');
37
+ const hidden = root.querySelector('[data-ds-value]');
38
+ const label = root.querySelector('label');
39
+ const rows = () => [...list.querySelectorAll('[role="option"]')];
40
+ const options = () => rows().map(li => ({ value: li.dataset.value, label: li.dataset.label, disabled: li.getAttribute('aria-disabled') === 'true' }));
41
+ let active = 0;
42
+ let typed = { text: '', at: 0 };
43
+ const isOpen = () => !list.hidden;
44
+ const disabled = () => combo.getAttribute('aria-disabled') === 'true';
45
+ const selectedIndex = () => rows().findIndex(li => li.getAttribute('aria-selected') === 'true');
46
+ const enabled = index => { const li = rows()[index]; return !!li && li.getAttribute('aria-disabled') !== 'true'; };
47
+ const move = (from, delta) => {
48
+ const count = rows().length;
49
+ let index = from;
50
+ for (let i = 0; i < count; i++) {
51
+ index = Math.min(count - 1, Math.max(0, index + delta));
52
+ if (enabled(index)) return index;
53
+ if (index === 0 || index === count - 1) break;
54
+ }
55
+ return from;
56
+ };
57
+ const setActive = index => {
58
+ active = Math.max(0, index);
59
+ rows().forEach((li, i) => { li.dataset.active = String(i === active); });
60
+ const current = rows()[active];
61
+ if (current) { combo.setAttribute('aria-activedescendant', current.id); current.scrollIntoView?.({ block: 'nearest' }); }
62
+ };
63
+ const setOpen = (open, index = 0) => {
64
+ if (open && disabled()) return;
65
+ list.hidden = !open;
66
+ root.dataset.open = String(open);
67
+ combo.setAttribute('aria-expanded', String(open));
68
+ if (open) setActive(index); else combo.removeAttribute('aria-activedescendant');
69
+ };
70
+ /** Copies the chosen option into the closed field (text + detail). Also used when the trip card re-renders details. */
71
+ root.dsSyncValue = () => {
72
+ const li = rows()[selectedIndex()];
73
+ valueText.firstChild.textContent = li ? li.dataset.label : root.dataset.placeholder || '';
74
+ valueText.dataset.placeholder = String(!li);
75
+ const hiddenLabel = valueText.querySelector('.ds-wvisually-hidden');
76
+ const metaLabel = li?.dataset.metaLabel;
77
+ if (hiddenLabel) hiddenLabel.textContent = metaLabel ? `, ${metaLabel}` : '';
78
+ if (valueMeta) valueMeta.innerHTML = li?.querySelector('.ds-wmeta')?.outerHTML ?? '';
79
+ };
80
+ const commit = index => {
81
+ const li = rows()[index];
82
+ if (!li || !enabled(index) || li.dataset.value === hidden.value) return;
83
+ rows().forEach((row, i) => row.setAttribute('aria-selected', String(i === index)));
84
+ hidden.value = li.dataset.value;
85
+ root.dsSyncValue();
86
+ emit(root, li.dataset.value);
87
+ };
88
+
89
+ label?.addEventListener('click', () => combo.focus());
90
+ combo.addEventListener('click', () => (isOpen() ? setOpen(false) : setOpen(true, Math.max(0, selectedIndex()))));
91
+ combo.addEventListener('keydown', event => {
92
+ if (disabled()) return;
93
+ const start = Math.max(0, selectedIndex());
94
+ const open = isOpen();
95
+ switch (event.key) {
96
+ case 'ArrowDown':
97
+ case 'ArrowUp':
98
+ event.preventDefault();
99
+ if (!open) setOpen(true, start); else setActive(move(active, event.key === 'ArrowDown' ? 1 : -1));
100
+ return;
101
+ case 'Home':
102
+ event.preventDefault();
103
+ setOpen(true, move(-1, 1));
104
+ return;
105
+ case 'End':
106
+ event.preventDefault();
107
+ setOpen(true, move(rows().length, -1));
108
+ return;
109
+ case 'PageDown':
110
+ case 'PageUp':
111
+ if (open) { event.preventDefault(); setActive(move(active, event.key === 'PageDown' ? 10 : -10)); }
112
+ return;
113
+ case 'Enter':
114
+ case ' ':
115
+ event.preventDefault();
116
+ if (!open) setOpen(true, start); else { commit(active); setOpen(false); }
117
+ return;
118
+ case 'Escape':
119
+ if (open) { event.preventDefault(); setOpen(false); }
120
+ return;
121
+ case 'Tab':
122
+ if (open) { commit(active); setOpen(false); }
123
+ return;
124
+ }
125
+ if (event.key.length === 1 && !event.ctrlKey && !event.metaKey && !event.altKey) {
126
+ const now = Date.now();
127
+ typed = { text: now - typed.at < 600 ? typed.text + event.key : event.key, at: now };
128
+ const from = open ? active : start;
129
+ const index = typeaheadIndex(options(), typed.text, typed.text.length > 1 ? from - 1 : from);
130
+ if (index >= 0) { if (open) setActive(index); else setOpen(true, index); }
131
+ }
132
+ });
133
+ list.addEventListener('mousedown', event => event.preventDefault());
134
+ list.addEventListener('mousemove', event => {
135
+ const index = rows().indexOf(event.target.closest('[role="option"]'));
136
+ if (index >= 0 && index !== active && enabled(index)) setActive(index);
137
+ });
138
+ list.addEventListener('click', event => {
139
+ const index = rows().indexOf(event.target.closest('[role="option"]'));
140
+ if (index < 0 || !enabled(index)) return;
141
+ commit(index);
142
+ setOpen(false);
143
+ combo.focus();
144
+ });
145
+ root.addEventListener('focusout', event => { if (isOpen() && event.relatedTarget && !root.contains(event.relatedTarget)) setOpen(false); });
146
+ document.addEventListener('pointerdown', event => { if (isOpen() && !root.contains(event.target)) setOpen(false); });
147
+ }
148
+
149
+ function setupSwitches(root) {
150
+ root.dataset.dsReady = '';
151
+ root.addEventListener('change', event => {
152
+ if (!event.target.matches('input[role="switch"]')) return;
153
+ emit(root, [...root.querySelectorAll('input[role="switch"]:checked')].map(input => input.value));
154
+ });
155
+ }
156
+
157
+ function setupStepper(root) {
158
+ root.dataset.dsReady = '';
159
+ const input = root.querySelector('input');
160
+ const [minus, plus] = root.querySelectorAll('.ds-wstepper-button');
161
+ const min = Number(root.dataset.min ?? 1);
162
+ const max = Number(root.dataset.max ?? 99);
163
+ let value = clampCount(Number(input.value), min, max);
164
+ const set = next => {
165
+ const clamped = clampCount(next, min, max);
166
+ input.value = String(clamped);
167
+ input.setAttribute('aria-valuenow', String(clamped));
168
+ minus.disabled = input.disabled || clamped <= min;
169
+ plus.disabled = input.disabled || clamped >= max;
170
+ if (clamped === value) return;
171
+ value = clamped;
172
+ emit(root, clamped);
173
+ };
174
+ minus.addEventListener('click', () => set(value - 1));
175
+ plus.addEventListener('click', () => set(value + 1));
176
+ input.addEventListener('input', () => { input.value = input.value.replace(/\D/g, ''); });
177
+ input.addEventListener('blur', () => set(input.value.trim() ? Number(input.value) : value));
178
+ input.addEventListener('keydown', event => {
179
+ const moves = { ArrowUp: value + 1, ArrowDown: value - 1, PageUp: value + 10, PageDown: value - 10, Home: min, End: max };
180
+ if (event.key in moves) { event.preventDefault(); set(moves[event.key]); }
181
+ if (event.key === 'Enter') { event.preventDefault(); set(input.value.trim() ? Number(input.value) : value); }
182
+ });
183
+ }
184
+
185
+ function setupTrip(root) {
186
+ root.dataset.dsReady = '';
187
+ initWariTripFields(root);
188
+ const services = JSON.parse(root.dataset.services || '[]');
189
+ const [serviceSelect, paymentSelect] = root.querySelectorAll('[data-ds-wselect]');
190
+ const [modes, extras] = root.querySelectorAll('[data-ds-wswitches]');
191
+ const stepper = root.querySelector('[data-ds-wstepper]');
192
+ const read = () => {
193
+ const activeModes = [...modes.querySelectorAll('input:checked')].map(input => input.value);
194
+ return {
195
+ service: serviceSelect.querySelector('[data-ds-value]').value,
196
+ hourly: activeModes.includes('hourly'),
197
+ delivery: activeModes.includes('delivery'),
198
+ extras: [...extras.querySelectorAll('input:checked')].map(input => input.value),
199
+ vehicles: Number(stepper.querySelector('input').value),
200
+ payment: paymentSelect.querySelector('[data-ds-value]').value,
201
+ };
202
+ };
203
+ const renderMeta = () => {
204
+ const value = read();
205
+ serviceSelect.querySelectorAll('[role="option"]').forEach(li => {
206
+ const service = services.find(item => item.value === li.dataset.value);
207
+ if (!service) return;
208
+ const meta = serviceMetaHtml(service, value);
209
+ li.querySelector('.ds-wmeta').innerHTML = meta.html;
210
+ li.dataset.metaLabel = meta.label;
211
+ li.setAttribute('aria-label', `${service.label}, ${meta.label}`);
212
+ });
213
+ serviceSelect.dsSyncValue?.();
214
+ };
215
+ // Capture phase: the pieces' own events never reach listeners on the card (or above); only the full object does.
216
+ root.addEventListener('ds-change', event => {
217
+ if (event.target === root) return;
218
+ event.stopPropagation();
219
+ if (event.target === modes) renderMeta();
220
+ emit(root, read());
221
+ }, true);
222
+ }
@@ -0,0 +1,56 @@
1
+ export interface WariService {
2
+ value: string;
3
+ label: string;
4
+ /** Pasajeros. */
5
+ passengers: number;
6
+ /** Maletas. */
7
+ luggage: number;
8
+ /** Capacidad alternativa que muestra el diseño tras "o" (XL: 4 o 6, Van: 6 o 10). */
9
+ luggageAlt?: number;
10
+ /** Tarifa por horas desde la que se cobra (se muestra como "Desde S/80"). */
11
+ hourlyPrice?: number;
12
+ disabled?: boolean;
13
+ }
14
+ export interface WariOption {
15
+ value: string;
16
+ label: string;
17
+ disabled?: boolean;
18
+ }
19
+ export interface WariTripAttributesValue {
20
+ service: string;
21
+ hourly: boolean;
22
+ delivery: boolean;
23
+ /** Valores de los extras activos (por defecto: carseat, booster, carga). */
24
+ extras: string[];
25
+ vehicles: number;
26
+ payment: string;
27
+ }
28
+ /** Servicios del diseño de Figma. Reemplázalos con los datos de tu API. */
29
+ export declare const wariServices: WariService[];
30
+ export declare const wariExtras: WariOption[];
31
+ export declare const wariPaymentMethods: WariOption[];
32
+ export declare const defaultTripAttributes: WariTripAttributesValue;
33
+ export interface ServiceMeta {
34
+ /** Mostrar la insignia "Envío". */
35
+ delivery: boolean;
36
+ /** "Desde S/80" cuando el viaje es por horas. */
37
+ price: string | null;
38
+ /** Capacidad cuando no es por horas ni envío. */
39
+ capacity: {
40
+ passengers: number;
41
+ luggage: number;
42
+ luggageAlt?: number;
43
+ } | null;
44
+ /** Texto completo para lectores de pantalla. */
45
+ label: string;
46
+ }
47
+ export declare const formatSoles: (amount: number) => string;
48
+ /** Lo que muestra el diseño a la derecha de cada servicio, según "Por horas" y "Envíos". */
49
+ export declare function serviceMeta(service: WariService, mode: {
50
+ hourly: boolean;
51
+ delivery: boolean;
52
+ }): ServiceMeta;
53
+ export declare function clampCount(value: number, min?: number, max?: number): number;
54
+ /** Type-ahead for select-only comboboxes: next enabled option whose label starts with `query`, after `from`. */
55
+ export declare function typeaheadIndex(options: readonly WariOption[], query: string, from: number): number;
56
+ export declare function toggleExtra(extras: readonly string[], value: string, options?: readonly WariOption[]): string[];
@@ -0,0 +1,69 @@
1
+ // Generated from web/components/src/wari/trip.ts (same behaviour in React, Angular and Astro).
2
+ // Data and pure helpers for "Atributos del viaje" (no framework code, easy to test).
3
+ /** Servicios del diseño de Figma. Reemplázalos con los datos de tu API. */
4
+ export const wariServices = [
5
+ { value: 'lite', label: 'Lite', passengers: 4, luggage: 1, hourlyPrice: 80 },
6
+ { value: 'comfort', label: 'Comfort', passengers: 4, luggage: 2, hourlyPrice: 90 },
7
+ { value: 'comfort-xl', label: 'Comfort XL', passengers: 4, luggage: 2, hourlyPrice: 90 },
8
+ { value: 'xl', label: 'XL', passengers: 4, luggage: 4, luggageAlt: 6, hourlyPrice: 90 },
9
+ { value: 'van', label: 'Van', passengers: 7, luggage: 6, luggageAlt: 10, hourlyPrice: 140 },
10
+ ];
11
+ export const wariExtras = [
12
+ { value: 'carseat', label: 'Carseat' },
13
+ { value: 'booster', label: 'Booster' },
14
+ { value: 'carga', label: 'Carga' },
15
+ ];
16
+ export const wariPaymentMethods = [
17
+ { value: 'efectivo', label: 'Efectivo' },
18
+ { value: 'tarjeta', label: 'Tarjeta' },
19
+ { value: 'vale', label: 'Vale corporativo' },
20
+ ];
21
+ export const defaultTripAttributes = {
22
+ service: 'lite', hourly: false, delivery: false, extras: [], vehicles: 1, payment: 'efectivo',
23
+ };
24
+ export const formatSoles = (amount) => `S/${Number.isInteger(amount) ? amount : amount.toFixed(2)}`;
25
+ /** Lo que muestra el diseño a la derecha de cada servicio, según "Por horas" y "Envíos". */
26
+ export function serviceMeta(service, mode) {
27
+ const price = mode.hourly && service.hourlyPrice != null ? `Desde ${formatSoles(service.hourlyPrice)}` : null;
28
+ const capacity = !mode.hourly && !mode.delivery
29
+ ? { passengers: service.passengers, luggage: service.luggage, luggageAlt: service.luggageAlt }
30
+ : null;
31
+ const parts = [];
32
+ if (mode.delivery)
33
+ parts.push('envío');
34
+ if (price)
35
+ parts.push(price.toLowerCase());
36
+ if (capacity) {
37
+ parts.push(`${capacity.passengers} pasajeros`);
38
+ parts.push(capacity.luggageAlt != null ? `${capacity.luggage} o ${capacity.luggageAlt} maletas` : `${capacity.luggage} ${capacity.luggage === 1 ? 'maleta' : 'maletas'}`);
39
+ }
40
+ return { delivery: mode.delivery, price, capacity, label: parts.join(', ') };
41
+ }
42
+ export function clampCount(value, min = 1, max = 99) {
43
+ if (!Number.isFinite(value))
44
+ return min;
45
+ return Math.min(max, Math.max(min, Math.round(value)));
46
+ }
47
+ /** Type-ahead for select-only comboboxes: next enabled option whose label starts with `query`, after `from`. */
48
+ export function typeaheadIndex(options, query, from) {
49
+ const needle = query.normalize('NFD').replace(/\p{Diacritic}/gu, '').toLowerCase();
50
+ if (!needle)
51
+ return -1;
52
+ const count = options.length;
53
+ for (let step = 1; step <= count; step++) {
54
+ const index = (from + step + count) % count;
55
+ const option = options[index];
56
+ const label = option.label.normalize('NFD').replace(/\p{Diacritic}/gu, '').toLowerCase();
57
+ if (!option.disabled && label.startsWith(needle))
58
+ return index;
59
+ }
60
+ return -1;
61
+ }
62
+ export function toggleExtra(extras, value, options = wariExtras) {
63
+ const set = new Set(extras);
64
+ if (set.has(value))
65
+ set.delete(value);
66
+ else
67
+ set.add(value);
68
+ return options.filter(option => set.has(option.value)).map(option => option.value);
69
+ }
package/styles.css CHANGED
@@ -1,3 +1,3 @@
1
- /* @directo-ui/astro: design tokens + component styles (generated copies, run `pnpm build`). */
2
- @import "./tokens.css";
3
- @import "./components.css";
1
+ /* @directo-ui/astro: design tokens + component styles (generated copies, run `pnpm build`). */
2
+ @import "./tokens.css";
3
+ @import "./components.css";
package/wari.d.ts ADDED
@@ -0,0 +1,20 @@
1
+ export { default as StatusTag } from './src/components/StatusTag.astro';
2
+ export { default as MultiSelect } from './src/components/MultiSelect.astro';
3
+ export { default as WariStatusSelect } from './src/components/WariStatusSelect.astro';
4
+ export { default as WariDateField } from './src/components/WariDateField.astro';
5
+ export { default as WariTimeField } from './src/components/WariTimeField.astro';
6
+ export { default as WariSchedule } from './src/components/WariSchedule.astro';
7
+ export { default as WariSelect } from './src/components/WariSelect.astro';
8
+ export { default as WariSwitchList } from './src/components/WariSwitchList.astro';
9
+ export { default as WariStepper } from './src/components/WariStepper.astro';
10
+ export { default as WariServiceMeta } from './src/components/WariServiceMeta.astro';
11
+ export { default as WariTripAttributes } from './src/components/WariTripAttributes.astro';
12
+ export type { WariSelectOption } from './src/components/WariSelect.astro';
13
+ export { clampCount, defaultTripAttributes, formatSoles, serviceMeta, toggleExtra, typeaheadIndex, wariExtras, wariPaymentMethods, wariServices } from './src/wari/trip';
14
+ export type { WariService, WariOption, WariTripAttributesValue, ServiceMeta } from './src/wari/trip';
15
+ export { calendarWeeks, formatDisplayDate, formatDisplayTime, parseDisplayDate, parseDisplayTime, parseISODate, parseTime24, toISODate, todayISO } from './src/wari/datetime';
16
+ export type { CalendarDay, TimeParts, Period } from './src/wari/datetime';
17
+ export type { MultiSelectOption } from './src/components/MultiSelect.astro';
18
+ export { wariStatuses, wariStatusLabel } from './src/wari/statuses';
19
+ export type { WariStatus } from './src/wari/statuses';
20
+ export * from './src/wari/logic';
package/wari.js ADDED
@@ -0,0 +1,16 @@
1
+ // @directo-ui/astro/wari — componentes del módulo Wari. Estilos: '@directo-ui/astro/styles.css' (los mismos de siempre).
2
+ export { default as StatusTag } from './src/components/StatusTag.astro';
3
+ export { default as MultiSelect } from './src/components/MultiSelect.astro';
4
+ export { default as WariStatusSelect } from './src/components/WariStatusSelect.astro';
5
+ export { default as WariDateField } from './src/components/WariDateField.astro';
6
+ export { default as WariTimeField } from './src/components/WariTimeField.astro';
7
+ export { default as WariSchedule } from './src/components/WariSchedule.astro';
8
+ export { default as WariSelect } from './src/components/WariSelect.astro';
9
+ export { default as WariSwitchList } from './src/components/WariSwitchList.astro';
10
+ export { default as WariStepper } from './src/components/WariStepper.astro';
11
+ export { default as WariServiceMeta } from './src/components/WariServiceMeta.astro';
12
+ export { default as WariTripAttributes } from './src/components/WariTripAttributes.astro';
13
+ export { clampCount, defaultTripAttributes, formatSoles, serviceMeta, toggleExtra, typeaheadIndex, wariExtras, wariPaymentMethods, wariServices } from './src/wari/trip.js';
14
+ export { calendarWeeks, formatDisplayDate, formatDisplayTime, parseDisplayDate, parseDisplayTime, parseISODate, parseTime24, toISODate, todayISO } from './src/wari/datetime.js';
15
+ export { wariStatuses, wariStatusLabel } from './src/wari/statuses.js';
16
+ export { filterOptions, normalizeSearch, selectionState, selectionSummary, toggleAll, toggleValue } from './src/wari/logic.js';