@directo-ui/web 0.0.0-stage → 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 (61) hide show
  1. package/README.md +44 -2
  2. package/dist/bundle.d.ts +2 -0
  3. package/dist/components/Accordion.d.ts +16 -0
  4. package/dist/components/Alert.d.ts +14 -0
  5. package/dist/components/Avatar.d.ts +16 -0
  6. package/dist/components/Badge.d.ts +11 -0
  7. package/dist/components/BottomSheet.d.ts +9 -0
  8. package/dist/components/Breadcrumb.d.ts +15 -0
  9. package/dist/components/Button.d.ts +3 -0
  10. package/dist/components/Card.d.ts +15 -0
  11. package/dist/components/Checkbox.d.ts +4 -0
  12. package/dist/components/DatePicker.d.ts +15 -0
  13. package/dist/components/Dialog.d.ts +28 -0
  14. package/dist/components/Divider.d.ts +6 -0
  15. package/dist/components/Dropdown.d.ts +20 -0
  16. package/dist/components/EmptyState.d.ts +9 -0
  17. package/dist/components/IconButton.d.ts +10 -0
  18. package/dist/components/Loading.d.ts +31 -0
  19. package/dist/components/Pagination.d.ts +9 -0
  20. package/dist/components/RadioGroup.d.ts +6 -0
  21. package/dist/components/Select.d.ts +5 -0
  22. package/dist/components/SlidingButton.d.ts +7 -0
  23. package/dist/components/Switch.d.ts +4 -0
  24. package/dist/components/Tabs.d.ts +6 -0
  25. package/dist/components/TextField.d.ts +11 -0
  26. package/dist/components/Textarea.d.ts +10 -0
  27. package/dist/components/Toast.d.ts +7 -0
  28. package/dist/components/Tooltip.d.ts +10 -0
  29. package/dist/components/index.d.ts +28 -0
  30. package/dist/core/dates.d.ts +6 -0
  31. package/dist/core/generated.d.ts +34 -0
  32. package/dist/core/index.d.ts +2 -0
  33. package/dist/core/pagination.d.ts +3 -0
  34. package/dist/core/toast.d.ts +19 -0
  35. package/dist/core/tokens.d.ts +178 -0
  36. package/dist/core/types.d.ts +227 -0
  37. package/dist/figma-components-directo.js +1288 -0
  38. package/dist/figma-components-directo.js.map +1 -0
  39. package/dist/index.d.ts +23 -0
  40. package/dist/styles.css +2 -0
  41. package/dist/tokens.css +321 -0
  42. package/dist/wari/MultiSelect.d.ts +44 -0
  43. package/dist/wari/StatusTag.d.ts +14 -0
  44. package/dist/wari/WariDateField.d.ts +28 -0
  45. package/dist/wari/WariSchedule.d.ts +32 -0
  46. package/dist/wari/WariSelect.d.ts +29 -0
  47. package/dist/wari/WariServiceMeta.d.ts +8 -0
  48. package/dist/wari/WariStatusSelect.d.ts +14 -0
  49. package/dist/wari/WariStepper.d.ts +16 -0
  50. package/dist/wari/WariSwitchList.d.ts +17 -0
  51. package/dist/wari/WariTimeField.d.ts +23 -0
  52. package/dist/wari/WariTripAttributes.d.ts +24 -0
  53. package/dist/wari/datetime.d.ts +57 -0
  54. package/dist/wari/icons.d.ts +16 -0
  55. package/dist/wari/index.d.ts +30 -0
  56. package/dist/wari/logic.d.ts +14 -0
  57. package/dist/wari/statuses.d.ts +34 -0
  58. package/dist/wari/trip.d.ts +56 -0
  59. package/dist/wari.js +1735 -0
  60. package/dist/wari.js.map +1 -0
  61. package/package.json +55 -4
@@ -0,0 +1,30 @@
1
+ export { StatusTag } from './StatusTag.js';
2
+ export { MultiSelect } from './MultiSelect.js';
3
+ export { WariStatusSelect } from './WariStatusSelect.js';
4
+ export { WariDateField } from './WariDateField.js';
5
+ export { WariTimeField } from './WariTimeField.js';
6
+ export { WariSchedule } from './WariSchedule.js';
7
+ export { WariSelect } from './WariSelect.js';
8
+ export { WariSwitchList } from './WariSwitchList.js';
9
+ export { WariStepper } from './WariStepper.js';
10
+ export { WariServiceMeta } from './WariServiceMeta.js';
11
+ export { WariTripAttributes } from './WariTripAttributes.js';
12
+ export { clampCount, defaultTripAttributes, formatSoles, serviceMeta, toggleExtra, typeaheadIndex, wariExtras, wariPaymentMethods, wariServices, } from './trip.js';
13
+ export { wariStatuses, wariStatusLabel } from './statuses.js';
14
+ export { calendarWeeks, formatDisplayDate, formatDisplayTime, parseDisplayDate, parseDisplayTime, parseISODate, parseTime24, toISODate, todayISO, } from './datetime.js';
15
+ export { filterOptions, normalizeSearch, selectionState, selectionSummary, toggleAll, toggleValue } from './logic.js';
16
+ export type { StatusTagProps } from './StatusTag.js';
17
+ export type { MultiSelectProps, MultiSelectOption } from './MultiSelect.js';
18
+ export type { WariStatusSelectProps } from './WariStatusSelect.js';
19
+ export type { WariStatus } from './statuses.js';
20
+ export type { WariDateFieldProps } from './WariDateField.js';
21
+ export type { WariTimeFieldProps } from './WariTimeField.js';
22
+ export type { WariScheduleProps } from './WariSchedule.js';
23
+ export type { WariSelectProps, WariSelectOption } from './WariSelect.js';
24
+ export type { WariSwitchListProps } from './WariSwitchList.js';
25
+ export type { WariStepperProps } from './WariStepper.js';
26
+ export type { WariServiceMetaProps } from './WariServiceMeta.js';
27
+ export type { WariTripAttributesProps } from './WariTripAttributes.js';
28
+ export type { WariService, WariOption, WariTripAttributesValue, ServiceMeta } from './trip.js';
29
+ export type { CalendarDay, TimeParts, Period } from './datetime.js';
30
+ export type { SelectableOption, SelectionState } from './logic.js';
@@ -0,0 +1,14 @@
1
+ export interface SelectableOption {
2
+ value: string;
3
+ label: string;
4
+ disabled?: boolean;
5
+ }
6
+ export type SelectionState = 'none' | 'some' | 'all';
7
+ /** Lowercase and strip accents so "inicio" finds "Inició". */
8
+ export declare function normalizeSearch(text: string): string;
9
+ export declare function filterOptions<T extends SelectableOption>(options: readonly T[], query: string): T[];
10
+ export declare function toggleValue(values: readonly string[], value: string, options: readonly SelectableOption[]): string[];
11
+ export declare function selectionState(values: readonly string[], options: readonly SelectableOption[]): SelectionState;
12
+ /** "Todos": selects every enabled option, or clears them when all were already selected. Disabled ones keep their state. */
13
+ export declare function toggleAll(values: readonly string[], options: readonly SelectableOption[]): string[];
14
+ export declare function selectionSummary(count: number): string;
@@ -0,0 +1,34 @@
1
+ /** Estados de un servicio en Wari, en el orden en que aparecen en Figma. */
2
+ export declare const wariStatuses: readonly [{
3
+ readonly value: "libre";
4
+ readonly label: "Libre";
5
+ }, {
6
+ readonly value: "aceptado";
7
+ readonly label: "Aceptado";
8
+ }, {
9
+ readonly value: "contacto";
10
+ readonly label: "Contacto";
11
+ }, {
12
+ readonly value: "inicio";
13
+ readonly label: "Inició";
14
+ }, {
15
+ readonly value: "llego";
16
+ readonly label: "Llegó";
17
+ }, {
18
+ readonly value: "terminado";
19
+ readonly label: "Terminado";
20
+ }, {
21
+ readonly value: "preasignado";
22
+ readonly label: "Preasignado";
23
+ }, {
24
+ readonly value: "anulado-operador";
25
+ readonly label: "Anulado Operador";
26
+ }, {
27
+ readonly value: "anulado-usuario";
28
+ readonly label: "Anulado Usuario";
29
+ }, {
30
+ readonly value: "empalmado";
31
+ readonly label: "Empalmado";
32
+ }];
33
+ export type WariStatus = (typeof wariStatuses)[number]['value'];
34
+ export declare const wariStatusLabel: (status: WariStatus) => string;
@@ -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[];