@drivenets/design-system 0.0.5 → 0.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.
- package/CHANGELOG.md +11 -0
- package/dist/components/ds-alert-banner/ds-alert-banner.d.ts +5 -5
- package/dist/components/ds-alert-banner/ds-alert-banner.d.ts.map +1 -1
- package/dist/components/ds-button/ds-button.d.cts +2 -2
- package/dist/components/ds-button/ds-button.d.ts +2 -2
- package/dist/components/ds-button/versions/ds-button-new/ds-button-new.module.cjs +18 -18
- package/dist/components/ds-button/versions/ds-button-new/ds-button-new.module.js +18 -18
- package/dist/components/ds-button/versions/ds-button-new/ds-button-new.module.js.map +1 -1
- package/dist/components/ds-confirmation/ds-confirmation.d.cts +8 -8
- package/dist/components/ds-confirmation/ds-confirmation.d.cts.map +1 -1
- package/dist/components/ds-confirmation/ds-confirmation.d.ts +8 -8
- package/dist/components/ds-date-input/ds-date-input.cjs +352 -0
- package/dist/components/ds-date-input/ds-date-input.d.cts +31 -0
- package/dist/components/ds-date-input/ds-date-input.d.cts.map +1 -0
- package/dist/components/ds-date-input/ds-date-input.d.ts +31 -0
- package/dist/components/ds-date-input/ds-date-input.d.ts.map +1 -0
- package/dist/components/ds-date-input/ds-date-input.js +351 -0
- package/dist/components/ds-date-input/ds-date-input.js.map +1 -0
- package/dist/components/ds-date-input/ds-date-input.module.cjs +29 -0
- package/dist/components/ds-date-input/ds-date-input.module.js +29 -0
- package/dist/components/ds-date-input/ds-date-input.module.js.map +1 -0
- package/dist/components/ds-date-input/ds-date-input.types.d.cts +92 -0
- package/dist/components/ds-date-input/ds-date-input.types.d.cts.map +1 -0
- package/dist/components/ds-date-input/ds-date-input.types.d.ts +92 -0
- package/dist/components/ds-date-input/ds-date-input.types.d.ts.map +1 -0
- package/dist/components/ds-date-input/ds-date-input.utils.cjs +169 -0
- package/dist/components/ds-date-input/ds-date-input.utils.js +164 -0
- package/dist/components/ds-date-input/ds-date-input.utils.js.map +1 -0
- package/dist/components/ds-date-input/index.cjs +1 -0
- package/dist/components/ds-date-input/index.d.ts +2 -0
- package/dist/components/ds-date-input/index.js +1 -0
- package/dist/components/ds-divider/ds-divider.cjs +47 -0
- package/dist/components/ds-divider/ds-divider.d.cts +8 -0
- package/dist/components/ds-divider/ds-divider.d.cts.map +1 -0
- package/dist/components/ds-divider/ds-divider.d.ts +8 -0
- package/dist/components/ds-divider/ds-divider.d.ts.map +1 -0
- package/dist/components/ds-divider/ds-divider.js +46 -0
- package/dist/components/ds-divider/ds-divider.js.map +1 -0
- package/dist/components/ds-divider/ds-divider.module.cjs +10 -0
- package/dist/components/ds-divider/ds-divider.module.js +10 -0
- package/dist/components/ds-divider/ds-divider.module.js.map +1 -0
- package/dist/components/ds-divider/ds-divider.types.d.cts +25 -0
- package/dist/components/ds-divider/ds-divider.types.d.cts.map +1 -0
- package/dist/components/ds-divider/ds-divider.types.d.ts +25 -0
- package/dist/components/ds-divider/ds-divider.types.d.ts.map +1 -0
- package/dist/components/ds-divider/index.cjs +1 -0
- package/dist/components/ds-divider/index.d.ts +2 -0
- package/dist/components/ds-divider/index.js +1 -0
- package/dist/components/ds-drawer/ds-drawer.d.cts +9 -9
- package/dist/components/ds-drawer/ds-drawer.d.ts +9 -9
- package/dist/components/ds-dropdown-menu/ds-dropdown-menu.cjs +80 -24
- package/dist/components/ds-dropdown-menu/ds-dropdown-menu.d.cts +1 -0
- package/dist/components/ds-dropdown-menu/ds-dropdown-menu.d.cts.map +1 -1
- package/dist/components/ds-dropdown-menu/ds-dropdown-menu.d.ts +1 -0
- package/dist/components/ds-dropdown-menu/ds-dropdown-menu.d.ts.map +1 -1
- package/dist/components/ds-dropdown-menu/ds-dropdown-menu.js +80 -24
- package/dist/components/ds-dropdown-menu/ds-dropdown-menu.js.map +1 -1
- package/dist/components/ds-dropdown-menu/ds-dropdown-menu.module.cjs +20 -18
- package/dist/components/ds-dropdown-menu/ds-dropdown-menu.module.js +20 -18
- package/dist/components/ds-dropdown-menu/ds-dropdown-menu.module.js.map +1 -1
- package/dist/components/ds-dropdown-menu/ds-dropdown-menu.types.d.cts +5 -1
- package/dist/components/ds-dropdown-menu/ds-dropdown-menu.types.d.cts.map +1 -1
- package/dist/components/ds-dropdown-menu/ds-dropdown-menu.types.d.ts +5 -1
- package/dist/components/ds-dropdown-menu/ds-dropdown-menu.types.d.ts.map +1 -1
- package/dist/components/ds-dropdown-menu/index.d.ts +1 -1
- package/dist/components/ds-expandable-text-input/ds-expandable-text-input.d.cts +2 -2
- package/dist/components/ds-expandable-text-input/ds-expandable-text-input.d.ts +2 -2
- package/dist/components/ds-form-control/ds-form-control.cjs +3 -0
- package/dist/components/ds-form-control/ds-form-control.d.cts +9 -7
- package/dist/components/ds-form-control/ds-form-control.d.cts.map +1 -1
- package/dist/components/ds-form-control/ds-form-control.d.ts +10 -7
- package/dist/components/ds-form-control/ds-form-control.d.ts.map +1 -1
- package/dist/components/ds-form-control/ds-form-control.js +3 -0
- package/dist/components/ds-form-control/ds-form-control.js.map +1 -1
- package/dist/components/ds-modal/ds-modal.d.cts +8 -8
- package/dist/components/ds-modal/ds-modal.d.cts.map +1 -1
- package/dist/components/ds-modal/ds-modal.d.ts +8 -8
- package/dist/components/ds-modal/ds-modal.d.ts.map +1 -1
- package/dist/components/ds-panel/ds-panel.d.cts +2 -2
- package/dist/components/ds-panel/ds-panel.d.ts +2 -2
- package/dist/components/ds-radio-group/ds-radio-group.types.d.cts +1 -1
- package/dist/components/ds-radio-group/ds-radio-group.types.d.cts.map +1 -1
- package/dist/components/ds-radio-group/ds-radio-group.types.d.ts +1 -1
- package/dist/components/ds-radio-group/ds-radio-group.types.d.ts.map +1 -1
- package/dist/components/ds-select/ds-select.d.cts +2 -2
- package/dist/components/ds-select/ds-select.d.ts +2 -2
- package/dist/components/ds-smart-tabs/ds-smart-tabs.d.cts +2 -2
- package/dist/components/ds-smart-tabs/ds-smart-tabs.d.ts +2 -2
- package/dist/components/ds-stepper/components/ds-step-content.d.cts +2 -2
- package/dist/components/ds-stepper/components/ds-step-content.d.ts +2 -2
- package/dist/components/ds-stepper/components/ds-step-next-button.d.cts +2 -2
- package/dist/components/ds-stepper/components/ds-step-next-button.d.ts +2 -2
- package/dist/components/ds-stepper/components/ds-step.d.ts +2 -2
- package/dist/components/ds-stepper/ds-stepper.d.cts +2 -2
- package/dist/components/ds-stepper/ds-stepper.d.ts +2 -2
- package/dist/components/ds-table/components/ds-table-cell/ds-table-cell.types.d.cts +1 -0
- package/dist/components/ds-table/components/ds-table-cell/ds-table-cell.types.d.cts.map +1 -1
- package/dist/components/ds-table/components/ds-table-cell/ds-table-cell.types.d.ts +1 -1
- package/dist/components/ds-table/ds-table.d.cts +2 -2
- package/dist/components/ds-table/ds-table.d.ts +2 -2
- package/dist/components/ds-table/filters/adapters/create-checkbox-filter-adapter.cjs +55 -0
- package/dist/components/ds-table/filters/adapters/create-checkbox-filter-adapter.d.cts +49 -0
- package/dist/components/ds-table/filters/adapters/create-checkbox-filter-adapter.d.cts.map +1 -0
- package/dist/components/ds-table/filters/adapters/create-checkbox-filter-adapter.d.ts +50 -0
- package/dist/components/ds-table/filters/adapters/create-checkbox-filter-adapter.d.ts.map +1 -0
- package/dist/components/ds-table/filters/adapters/create-checkbox-filter-adapter.js +55 -0
- package/dist/components/ds-table/filters/adapters/create-checkbox-filter-adapter.js.map +1 -0
- package/dist/components/ds-table/filters/adapters/create-dual-range-filter-adapter.cjs +87 -0
- package/dist/components/ds-table/filters/adapters/create-dual-range-filter-adapter.d.cts +44 -0
- package/dist/components/ds-table/filters/adapters/create-dual-range-filter-adapter.d.cts.map +1 -0
- package/dist/components/ds-table/filters/adapters/create-dual-range-filter-adapter.d.ts +44 -0
- package/dist/components/ds-table/filters/adapters/create-dual-range-filter-adapter.d.ts.map +1 -0
- package/dist/components/ds-table/filters/adapters/create-dual-range-filter-adapter.js +87 -0
- package/dist/components/ds-table/filters/adapters/create-dual-range-filter-adapter.js.map +1 -0
- package/dist/components/ds-table/filters/adapters/create-filter-adapter.cjs +83 -0
- package/dist/components/ds-table/filters/adapters/create-filter-adapter.d.cts +111 -0
- package/dist/components/ds-table/filters/adapters/create-filter-adapter.d.cts.map +1 -0
- package/dist/components/ds-table/filters/adapters/create-filter-adapter.d.ts +111 -0
- package/dist/components/ds-table/filters/adapters/create-filter-adapter.d.ts.map +1 -0
- package/dist/components/ds-table/filters/adapters/create-filter-adapter.js +83 -0
- package/dist/components/ds-table/filters/adapters/create-filter-adapter.js.map +1 -0
- package/dist/components/ds-table/filters/adapters/index.cjs +3 -0
- package/dist/components/ds-table/filters/adapters/index.d.ts +3 -0
- package/dist/components/ds-table/filters/adapters/index.js +3 -0
- package/dist/components/ds-table/filters/components/checkbox-filter/checkbox-filter.cjs +22 -0
- package/dist/components/ds-table/filters/components/checkbox-filter/checkbox-filter.d.cts +17 -0
- package/dist/components/ds-table/filters/components/checkbox-filter/checkbox-filter.d.cts.map +1 -0
- package/dist/components/ds-table/filters/components/checkbox-filter/checkbox-filter.d.ts +18 -0
- package/dist/components/ds-table/filters/components/checkbox-filter/checkbox-filter.d.ts.map +1 -0
- package/dist/components/ds-table/filters/components/checkbox-filter/checkbox-filter.js +22 -0
- package/dist/components/ds-table/filters/components/checkbox-filter/checkbox-filter.js.map +1 -0
- package/dist/components/ds-table/filters/components/checkbox-filter/index.cjs +1 -0
- package/dist/components/ds-table/filters/components/checkbox-filter/index.d.ts +1 -0
- package/dist/components/ds-table/filters/components/checkbox-filter/index.js +1 -0
- package/dist/components/ds-table/filters/components/range-filter/index.cjs +1 -0
- package/dist/components/ds-table/filters/components/range-filter/index.d.ts +1 -0
- package/dist/components/ds-table/filters/components/range-filter/index.js +1 -0
- package/dist/components/ds-table/filters/components/range-filter/range-filter.cjs +177 -0
- package/dist/components/ds-table/filters/components/range-filter/range-filter.d.cts +14 -0
- package/dist/components/ds-table/filters/components/range-filter/range-filter.d.cts.map +1 -0
- package/dist/components/ds-table/filters/components/range-filter/range-filter.d.ts +16 -0
- package/dist/components/ds-table/filters/components/range-filter/range-filter.d.ts.map +1 -0
- package/dist/components/ds-table/filters/components/range-filter/range-filter.js +177 -0
- package/dist/components/ds-table/filters/components/range-filter/range-filter.js.map +1 -0
- package/dist/components/ds-table/filters/components/range-filter/range-filter.module.cjs +11 -0
- package/dist/components/ds-table/filters/components/range-filter/range-filter.module.js +11 -0
- package/dist/components/ds-table/filters/components/range-filter/range-filter.module.js.map +1 -0
- package/dist/components/ds-table/filters/hooks/index.cjs +1 -0
- package/dist/components/ds-table/filters/hooks/index.d.ts +1 -0
- package/dist/components/ds-table/filters/hooks/index.js +1 -0
- package/dist/components/ds-table/filters/hooks/use-table-filters.cjs +211 -0
- package/dist/components/ds-table/filters/hooks/use-table-filters.d.cts +65 -0
- package/dist/components/ds-table/filters/hooks/use-table-filters.d.cts.map +1 -0
- package/dist/components/ds-table/filters/hooks/use-table-filters.d.ts +66 -0
- package/dist/components/ds-table/filters/hooks/use-table-filters.d.ts.map +1 -0
- package/dist/components/ds-table/filters/hooks/use-table-filters.js +211 -0
- package/dist/components/ds-table/filters/hooks/use-table-filters.js.map +1 -0
- package/dist/components/ds-table/filters/index.cjs +6 -0
- package/dist/components/ds-table/filters/index.d.ts +11 -0
- package/dist/components/ds-table/filters/index.js +6 -0
- package/dist/components/ds-table/filters/types/filter-adapter.types.d.cts +101 -0
- package/dist/components/ds-table/filters/types/filter-adapter.types.d.cts.map +1 -0
- package/dist/components/ds-table/filters/types/filter-adapter.types.d.ts +102 -0
- package/dist/components/ds-table/filters/types/filter-adapter.types.d.ts.map +1 -0
- package/dist/components/ds-table/index.cjs +5 -0
- package/dist/components/ds-table/index.d.ts +8 -0
- package/dist/components/ds-table/index.js +5 -0
- package/dist/components/ds-toggle/ds-toggle.cjs +192 -0
- package/dist/components/ds-toggle/ds-toggle.d.cts +24 -0
- package/dist/components/ds-toggle/ds-toggle.d.cts.map +1 -0
- package/dist/components/ds-toggle/ds-toggle.d.ts +24 -0
- package/dist/components/ds-toggle/ds-toggle.d.ts.map +1 -0
- package/dist/components/ds-toggle/ds-toggle.js +191 -0
- package/dist/components/ds-toggle/ds-toggle.js.map +1 -0
- package/dist/components/ds-toggle/ds-toggle.module.cjs +13 -0
- package/dist/components/ds-toggle/ds-toggle.module.js +13 -0
- package/dist/components/ds-toggle/ds-toggle.module.js.map +1 -0
- package/dist/components/ds-toggle/ds-toggle.types.d.cts +67 -0
- package/dist/components/ds-toggle/ds-toggle.types.d.cts.map +1 -0
- package/dist/components/ds-toggle/ds-toggle.types.d.ts +67 -0
- package/dist/components/ds-toggle/ds-toggle.types.d.ts.map +1 -0
- package/dist/components/ds-toggle/index.cjs +1 -0
- package/dist/components/ds-toggle/index.d.ts +2 -0
- package/dist/components/ds-toggle/index.js +1 -0
- package/dist/components/ds-vertical-tabs/ds-vertical-tabs.d.cts +5 -5
- package/dist/components/ds-vertical-tabs/ds-vertical-tabs.d.ts +5 -5
- package/dist/index.cjs +17 -0
- package/dist/index.d.cts +15 -2
- package/dist/index.d.ts +18 -2
- package/dist/index.js +11 -1
- package/dist/index.min.css +1 -1
- package/package.json +2 -1
- package/src/components/ds-button/versions/ds-button-new/ds-button-new.module.scss +0 -1
- package/src/components/ds-date-input/ds-date-input.module.scss +246 -0
- package/src/components/ds-date-input/ds-date-input.tsx +309 -0
- package/src/components/ds-date-input/ds-date-input.types.tsx +104 -0
- package/src/components/ds-date-input/ds-date-input.utils.ts +242 -0
- package/src/components/ds-date-input/index.ts +2 -0
- package/src/components/ds-divider/ds-divider.module.scss +21 -0
- package/src/components/ds-divider/ds-divider.tsx +22 -0
- package/src/components/ds-divider/ds-divider.types.ts +21 -0
- package/src/components/ds-divider/index.ts +2 -0
- package/src/components/ds-dropdown-menu/ds-dropdown-menu.module.scss +11 -3
- package/src/components/ds-dropdown-menu/ds-dropdown-menu.tsx +17 -1
- package/src/components/ds-dropdown-menu/ds-dropdown-menu.types.tsx +5 -0
- package/src/components/ds-form-control/ds-form-control.tsx +2 -0
- package/src/components/ds-radio-group/ds-radio-group.types.tsx +1 -1
- package/src/components/ds-table/filters/hooks/index.ts +1 -0
- package/src/components/ds-table/index.ts +2 -0
- package/src/components/ds-toggle/ds-toggle.module.scss +154 -0
- package/src/components/ds-toggle/ds-toggle.tsx +78 -0
- package/src/components/ds-toggle/ds-toggle.types.tsx +76 -0
- package/src/components/ds-toggle/index.tsx +2 -0
- package/src/index.ts +3 -0
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
import { type DateValue } from '@ark-ui/react/date-picker';
|
|
2
|
+
import { CalendarDate, parseDate } from '@internationalized/date';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Validation result for date input
|
|
6
|
+
*/
|
|
7
|
+
interface DateInputValidation {
|
|
8
|
+
isValid: boolean;
|
|
9
|
+
error?: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Parsed date range result
|
|
14
|
+
*/
|
|
15
|
+
interface ParsedDateRange {
|
|
16
|
+
start: string | null;
|
|
17
|
+
end: string | null;
|
|
18
|
+
isValid: boolean;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Convert ISO date string to DateValue
|
|
23
|
+
*/
|
|
24
|
+
export const isoStringToDateValue = (isoDate: string): DateValue | undefined => {
|
|
25
|
+
try {
|
|
26
|
+
return parseDate(isoDate) as unknown as DateValue;
|
|
27
|
+
} catch {
|
|
28
|
+
return undefined;
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Convert string or tuple to DateValue array (for internal use with Ark UI)
|
|
34
|
+
*/
|
|
35
|
+
export const stringToDateValue = (dates: string | [string, string]): DateValue[] => {
|
|
36
|
+
const dateArray = Array.isArray(dates) ? dates : [dates];
|
|
37
|
+
|
|
38
|
+
return dateArray.map(isoStringToDateValue).filter((d) => !!d);
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Convert DateValue array to string or tuple (for public API)
|
|
43
|
+
*/
|
|
44
|
+
export const dateValuesToStrings = (dates: DateValue[], range: boolean): string | [string, string] => {
|
|
45
|
+
const values = dates.map((date) => date.toString());
|
|
46
|
+
|
|
47
|
+
return range ? [values[0], values[1]] : values[0];
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Format a DateValue to string (MM/DD/YYYY)
|
|
52
|
+
*/
|
|
53
|
+
const formatDateValue = (date: DateValue): string => {
|
|
54
|
+
const paddedMonth = String(date.month).padStart(2, '0');
|
|
55
|
+
const paddedDay = String(date.day).padStart(2, '0');
|
|
56
|
+
|
|
57
|
+
return `${paddedMonth}/${paddedDay}/${String(date.year)}`;
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Format an array of DateValues to a unified string
|
|
62
|
+
* Single: "12/25/2024"
|
|
63
|
+
* Range: "12/01/2024 - 12/31/2024"
|
|
64
|
+
*/
|
|
65
|
+
export const formatDateInputValue = (value: DateValue[], range: boolean): string => {
|
|
66
|
+
if (value.length === 0) {
|
|
67
|
+
return '';
|
|
68
|
+
}
|
|
69
|
+
const newValue = value.map(formatDateValue);
|
|
70
|
+
|
|
71
|
+
return range ? newValue.join(' - ') : newValue[0];
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Parse a date string (MM/DD/YYYY) to DateValue
|
|
76
|
+
*/
|
|
77
|
+
const parseDateString = (dateStr: string): DateValue | null => {
|
|
78
|
+
if (!dateStr || !dateStr.trim()) {
|
|
79
|
+
return null;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// Try MM/DD/YYYY format
|
|
83
|
+
const match = dateStr.trim().match(/^(\d{1,2})\/(\d{1,2})\/(\d{4})$/);
|
|
84
|
+
if (!match) {
|
|
85
|
+
return null;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
const [, month, day, year] = match;
|
|
89
|
+
const monthNum = parseInt(month, 10);
|
|
90
|
+
const dayNum = parseInt(day, 10);
|
|
91
|
+
const yearNum = parseInt(year, 10);
|
|
92
|
+
|
|
93
|
+
// Use native Date for proper validation (handles leap years, month lengths, etc.)
|
|
94
|
+
// Note: Date months are 0-indexed, so subtract 1
|
|
95
|
+
const date = new Date(yearNum, monthNum - 1, dayNum);
|
|
96
|
+
|
|
97
|
+
// Check if the date is valid and matches what we parsed
|
|
98
|
+
// (e.g., 02/31/2024 would roll over to 03/02/2024, so we detect that)
|
|
99
|
+
if (date.getFullYear() !== yearNum || date.getMonth() !== monthNum - 1 || date.getDate() !== dayNum) {
|
|
100
|
+
return null;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
return new CalendarDate(yearNum, monthNum, dayNum) as unknown as DateValue;
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Parse a range input string (MM/DD/YYYY - MM/DD/YYYY)
|
|
108
|
+
*/
|
|
109
|
+
const parseRangeInput = (text: string): ParsedDateRange => {
|
|
110
|
+
if (!text.trim()) {
|
|
111
|
+
return { start: null, end: null, isValid: true }; // Empty is valid
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
// Check if it contains a dash separator
|
|
115
|
+
if (!text.includes('-')) {
|
|
116
|
+
// Single date format, treat as incomplete range
|
|
117
|
+
const date = parseDateString(text.trim());
|
|
118
|
+
return {
|
|
119
|
+
start: date ? formatDateValue(date) : null,
|
|
120
|
+
end: null,
|
|
121
|
+
isValid: false, // Incomplete range
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
// Split by dash
|
|
126
|
+
const parts = text.split('-').map((p) => p.trim());
|
|
127
|
+
if (parts.length !== 2) {
|
|
128
|
+
return { start: null, end: null, isValid: false };
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
const [startStr, endStr] = parts;
|
|
132
|
+
const startDate = parseDateString(startStr);
|
|
133
|
+
const endDate = parseDateString(endStr);
|
|
134
|
+
|
|
135
|
+
// Both must be valid dates
|
|
136
|
+
if (!startDate || !endDate) {
|
|
137
|
+
return {
|
|
138
|
+
start: startDate ? formatDateValue(startDate) : null,
|
|
139
|
+
end: endDate ? formatDateValue(endDate) : null,
|
|
140
|
+
isValid: false,
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
return {
|
|
145
|
+
start: formatDateValue(startDate),
|
|
146
|
+
end: formatDateValue(endDate),
|
|
147
|
+
isValid: true,
|
|
148
|
+
};
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* Parse input text based on range flag
|
|
153
|
+
*/
|
|
154
|
+
export const parseInputText = (text: string, range: boolean): DateValue[] => {
|
|
155
|
+
if (!range) {
|
|
156
|
+
const date = parseDateString(text);
|
|
157
|
+
return date ? [date] : [];
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
// Range mode
|
|
161
|
+
const parsed = parseRangeInput(text);
|
|
162
|
+
if (!parsed.isValid || !parsed.start || !parsed.end) {
|
|
163
|
+
return [];
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
const startDate = parseDateString(parsed.start);
|
|
167
|
+
const endDate = parseDateString(parsed.end);
|
|
168
|
+
|
|
169
|
+
if (!startDate || !endDate) {
|
|
170
|
+
return [];
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
return [startDate, endDate];
|
|
174
|
+
};
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* Validate date input
|
|
178
|
+
*/
|
|
179
|
+
export const validateDateString = ({
|
|
180
|
+
text,
|
|
181
|
+
range,
|
|
182
|
+
min,
|
|
183
|
+
max,
|
|
184
|
+
}: {
|
|
185
|
+
text: string;
|
|
186
|
+
range: boolean;
|
|
187
|
+
min?: DateValue;
|
|
188
|
+
max?: DateValue;
|
|
189
|
+
}): DateInputValidation => {
|
|
190
|
+
if (!text.trim()) {
|
|
191
|
+
return { isValid: true }; // Empty is valid (let required validation handle it)
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
if (!range) {
|
|
195
|
+
const date = parseDateString(text);
|
|
196
|
+
if (!date) {
|
|
197
|
+
return { isValid: false, error: 'Invalid date format. Use MM/DD/YYYY' };
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
// Check min/max
|
|
201
|
+
if (min && date.compare(min) < 0) {
|
|
202
|
+
return { isValid: false, error: 'Date is before minimum allowed date' };
|
|
203
|
+
}
|
|
204
|
+
if (max && date.compare(max) > 0) {
|
|
205
|
+
return { isValid: false, error: 'Date is after maximum allowed date' };
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
return { isValid: true };
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
// Range mode validation
|
|
212
|
+
const parsed = parseRangeInput(text);
|
|
213
|
+
if (!parsed.isValid) {
|
|
214
|
+
return { isValid: false, error: 'Invalid date range format. Use MM/DD/YYYY - MM/DD/YYYY' };
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
if (!parsed.start || !parsed.end) {
|
|
218
|
+
return { isValid: false, error: 'Both start and end dates are required' };
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
const startDate = parseDateString(parsed.start);
|
|
222
|
+
const endDate = parseDateString(parsed.end);
|
|
223
|
+
|
|
224
|
+
if (!startDate || !endDate) {
|
|
225
|
+
return { isValid: false, error: 'Invalid date format. Use MM/DD/YYYY' };
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
// Validate start <= end
|
|
229
|
+
if (startDate.compare(endDate) > 0) {
|
|
230
|
+
return { isValid: false, error: 'Start date must be before or equal to end date' };
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
// Check min/max
|
|
234
|
+
if (min && startDate.compare(min) < 0) {
|
|
235
|
+
return { isValid: false, error: 'Start date is before minimum allowed date' };
|
|
236
|
+
}
|
|
237
|
+
if (max && endDate.compare(max) > 0) {
|
|
238
|
+
return { isValid: false, error: 'End date is after maximum allowed date' };
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
return { isValid: true };
|
|
242
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
.divider {
|
|
2
|
+
display: block;
|
|
3
|
+
|
|
4
|
+
border: 0;
|
|
5
|
+
padding: 0;
|
|
6
|
+
color: transparent;
|
|
7
|
+
|
|
8
|
+
background-color: var(--color-border-secondary);
|
|
9
|
+
flex-shrink: 0;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.horizontal {
|
|
13
|
+
width: 100%;
|
|
14
|
+
height: 1px;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.vertical {
|
|
18
|
+
width: 1px;
|
|
19
|
+
height: auto;
|
|
20
|
+
align-self: stretch;
|
|
21
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import classNames from 'classnames';
|
|
3
|
+
import styles from './ds-divider.module.scss';
|
|
4
|
+
import { type DsDividerProps } from './ds-divider.types';
|
|
5
|
+
|
|
6
|
+
const DsDivider: React.FC<DsDividerProps> = ({ orientation = 'horizontal', component, style, className }) => {
|
|
7
|
+
const isVertical = orientation === 'vertical';
|
|
8
|
+
const Component = component ?? (isVertical ? 'div' : 'hr');
|
|
9
|
+
|
|
10
|
+
const classes = classNames(
|
|
11
|
+
styles.divider,
|
|
12
|
+
{
|
|
13
|
+
[styles.vertical]: isVertical,
|
|
14
|
+
[styles.horizontal]: !isVertical,
|
|
15
|
+
},
|
|
16
|
+
className,
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
return <Component role="separator" aria-orientation={orientation} className={classes} style={style} />;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export default DsDivider;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
|
|
3
|
+
export interface DsDividerProps {
|
|
4
|
+
/**
|
|
5
|
+
* Controls orientation of the divider. Horizontal by default.
|
|
6
|
+
*/
|
|
7
|
+
orientation?: 'horizontal' | 'vertical';
|
|
8
|
+
/**
|
|
9
|
+
* Underlying element/component to render.
|
|
10
|
+
* Examples: "hr", "div", "span", Link, etc.
|
|
11
|
+
*/
|
|
12
|
+
component?: React.ElementType;
|
|
13
|
+
/**
|
|
14
|
+
* Additional CSS styles.
|
|
15
|
+
*/
|
|
16
|
+
style?: React.CSSProperties;
|
|
17
|
+
/**
|
|
18
|
+
* Additional CSS classes.
|
|
19
|
+
*/
|
|
20
|
+
className?: string;
|
|
21
|
+
}
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
max-height: var(--available-height, 400px);
|
|
9
9
|
overflow-y: auto;
|
|
10
10
|
width: auto;
|
|
11
|
+
z-index: var(--layer-index);
|
|
11
12
|
|
|
12
13
|
&:focus-visible {
|
|
13
14
|
outline-offset: 2px;
|
|
@@ -29,9 +30,12 @@
|
|
|
29
30
|
|
|
30
31
|
.item {
|
|
31
32
|
@include dropdown.dropdown-item;
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
|
|
34
|
+
.triggerItem {
|
|
35
|
+
display: flex;
|
|
36
|
+
align-items: center;
|
|
37
|
+
gap: var(--spacing-xs);
|
|
38
|
+
}
|
|
35
39
|
|
|
36
40
|
&.selected {
|
|
37
41
|
.indicator {
|
|
@@ -105,6 +109,10 @@
|
|
|
105
109
|
}
|
|
106
110
|
}
|
|
107
111
|
|
|
112
|
+
.triggerItemIcon {
|
|
113
|
+
margin-left: auto;
|
|
114
|
+
}
|
|
115
|
+
|
|
108
116
|
/** Legacy classes */
|
|
109
117
|
.contentLegacy {
|
|
110
118
|
@include dropdown.dropdown-content;
|
|
@@ -21,6 +21,7 @@ import type {
|
|
|
21
21
|
DsDropdownMenuPositioning,
|
|
22
22
|
DsDropdownMenuRootProps,
|
|
23
23
|
DsDropdownMenuSeparatorProps,
|
|
24
|
+
DsDropdownMenuTriggerItemProps,
|
|
24
25
|
DsDropdownMenuTriggerProps,
|
|
25
26
|
} from './ds-dropdown-menu.types';
|
|
26
27
|
|
|
@@ -195,7 +196,7 @@ const ItemGroup: React.FC<DsDropdownMenuItemGroupProps> = ({
|
|
|
195
196
|
|
|
196
197
|
return (
|
|
197
198
|
<GroupContext.Provider value={{ collapsed, toggle }}>
|
|
198
|
-
<Menu.ItemGroup className={
|
|
199
|
+
<Menu.ItemGroup className={className} style={style}>
|
|
199
200
|
{children}
|
|
200
201
|
</Menu.ItemGroup>
|
|
201
202
|
</GroupContext.Provider>
|
|
@@ -264,6 +265,20 @@ const Separator: React.FC<DsDropdownMenuSeparatorProps> = ({ className, style })
|
|
|
264
265
|
return <Menu.Separator className={classNames(styles.separator, className)} style={style} />;
|
|
265
266
|
};
|
|
266
267
|
|
|
268
|
+
/**
|
|
269
|
+
* TriggerItem component - triggers a nested submenu
|
|
270
|
+
*/
|
|
271
|
+
const TriggerItem: React.FC<DsDropdownMenuTriggerItemProps> = ({ className, style, children, ...props }) => {
|
|
272
|
+
return (
|
|
273
|
+
<Menu.TriggerItem className={styles.item} {...props}>
|
|
274
|
+
<div className={classNames(styles.triggerItem, className)} style={style}>
|
|
275
|
+
{children}
|
|
276
|
+
</div>
|
|
277
|
+
<DsIcon className={styles.triggerItemIcon} icon="keyboard_arrow_right" />
|
|
278
|
+
</Menu.TriggerItem>
|
|
279
|
+
);
|
|
280
|
+
};
|
|
281
|
+
|
|
267
282
|
/**
|
|
268
283
|
* DEPRECATED: Legacy DsDropdownMenu component with options array
|
|
269
284
|
* Use compound component pattern instead
|
|
@@ -387,6 +402,7 @@ export const DsDropdownMenu = {
|
|
|
387
402
|
Content,
|
|
388
403
|
Item,
|
|
389
404
|
ItemIndicator,
|
|
405
|
+
TriggerItem,
|
|
390
406
|
Header,
|
|
391
407
|
Actions,
|
|
392
408
|
ItemGroup,
|
|
@@ -260,3 +260,8 @@ export interface DsDropdownMenuItemGroupContentProps {
|
|
|
260
260
|
* Props for the DsDropdownMenu Separator component
|
|
261
261
|
*/
|
|
262
262
|
export type DsDropdownMenuSeparatorProps = Menu.SeparatorProps;
|
|
263
|
+
|
|
264
|
+
/**
|
|
265
|
+
* Props for the DsDropdownMenu TriggerItem component (for nested submenus)
|
|
266
|
+
*/
|
|
267
|
+
export type DsDropdownMenuTriggerItemProps = Menu.TriggerItemProps;
|
|
@@ -9,6 +9,7 @@ import { DsNumberInput } from '../ds-number-input';
|
|
|
9
9
|
import { DsPasswordInput } from '../ds-password-input';
|
|
10
10
|
import type { DsFormControlDescriptionProps, DsFormControlProps } from './ds-form-control.types';
|
|
11
11
|
import styles from './ds-form-control.module.scss';
|
|
12
|
+
import { DsDateInput } from '../ds-date-input';
|
|
12
13
|
|
|
13
14
|
const FormControlContext = createContext<{ controlId: string } | null>(null);
|
|
14
15
|
|
|
@@ -87,6 +88,7 @@ const DsFormControl = ({
|
|
|
87
88
|
DsFormControl.TextInput = controlify(DsTextInput);
|
|
88
89
|
DsFormControl.NumberInput = controlify(DsNumberInput);
|
|
89
90
|
DsFormControl.PasswordInput = controlify(DsPasswordInput);
|
|
91
|
+
DsFormControl.DateInput = controlify(DsDateInput);
|
|
90
92
|
DsFormControl.Textarea = controlify(DsTextarea);
|
|
91
93
|
DsFormControl.Select = controlify(DsSelect);
|
|
92
94
|
DsFormControl.Description = DsFormControlDescription;
|
|
@@ -7,7 +7,7 @@ import { type RadioGroupItemProps, type RadioGroupRootProps } from '@ark-ui/reac
|
|
|
7
7
|
*/
|
|
8
8
|
export interface DsRadioGroupRootProps extends Pick<
|
|
9
9
|
RadioGroupRootProps,
|
|
10
|
-
'value' | 'defaultValue' | 'disabled' | 'name' | 'className' | 'style' | 'orientation' | 'children'
|
|
10
|
+
'id' | 'value' | 'defaultValue' | 'disabled' | 'name' | 'className' | 'style' | 'orientation' | 'children'
|
|
11
11
|
> {
|
|
12
12
|
/**
|
|
13
13
|
* Event handler called when the selected value changes
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
.root {
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: flex-start;
|
|
4
|
+
position: relative;
|
|
5
|
+
width: fit-content;
|
|
6
|
+
|
|
7
|
+
--switch-track-width: 36px;
|
|
8
|
+
--thumb-size: 16px;
|
|
9
|
+
--thumb-gap: 2px;
|
|
10
|
+
--transition-duration: 200ms;
|
|
11
|
+
--switch-track-diff: calc(var(--switch-track-width) - var(--thumb-size));
|
|
12
|
+
--switch-thumb-x: var(--switch-track-diff);
|
|
13
|
+
--icon-spacing: 2px;
|
|
14
|
+
|
|
15
|
+
&.small {
|
|
16
|
+
--switch-track-width: 26px;
|
|
17
|
+
--thumb-size: 12px;
|
|
18
|
+
--icon-spacing: 1px;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
[data-part='control'] {
|
|
22
|
+
position: relative;
|
|
23
|
+
outline: 2px solid transparent;
|
|
24
|
+
display: inline-flex;
|
|
25
|
+
flex-shrink: 0;
|
|
26
|
+
justify-content: flex-start;
|
|
27
|
+
box-sizing: content-box;
|
|
28
|
+
cursor: pointer;
|
|
29
|
+
border-radius: 9999px;
|
|
30
|
+
transition-property: background-color, color, fill, stroke, opacity, transform, outline-color, opacity;
|
|
31
|
+
transition-duration: var(--transition-duration);
|
|
32
|
+
padding: var(--thumb-gap);
|
|
33
|
+
width: var(--switch-track-width);
|
|
34
|
+
height: var(--thumb-size);
|
|
35
|
+
|
|
36
|
+
&[data-state='unchecked'] {
|
|
37
|
+
background: var(--color-background-deselected);
|
|
38
|
+
|
|
39
|
+
&[data-hover] {
|
|
40
|
+
background: var(--color-background-deselected-hover);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
&[data-focus-visible] {
|
|
44
|
+
outline-color: var(--color-background-action-hover);
|
|
45
|
+
background: var(--color-background-deselected-hover);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.iconCheck {
|
|
49
|
+
opacity: 0;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.iconClose {
|
|
53
|
+
opacity: 1;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
&[data-state='checked'] {
|
|
58
|
+
background: var(--color-background-selected);
|
|
59
|
+
|
|
60
|
+
&[data-hover] {
|
|
61
|
+
background: var(--color-background-selected-hover);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
&[data-focus-visible] {
|
|
65
|
+
outline-color: var(--color-background-selected);
|
|
66
|
+
background: var(--color-background-selected-hover);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.iconCheck {
|
|
70
|
+
opacity: 1;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.iconClose {
|
|
74
|
+
opacity: 0;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
&[data-disabled] {
|
|
79
|
+
cursor: not-allowed;
|
|
80
|
+
background: var(--color-background-disable);
|
|
81
|
+
|
|
82
|
+
&[data-hover] {
|
|
83
|
+
background: var(--color-background-deselected-hover);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
&[data-focus-visible] {
|
|
87
|
+
outline-color: var(--color-background-action-hover);
|
|
88
|
+
background: var(--color-background-deselected-hover);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
[data-part='thumb'] {
|
|
94
|
+
border-radius: 9999px;
|
|
95
|
+
position: relative;
|
|
96
|
+
transition-property: transform;
|
|
97
|
+
background: var(--color-background);
|
|
98
|
+
transition-duration: var(--transition-duration);
|
|
99
|
+
height: 100%;
|
|
100
|
+
aspect-ratio: 1/1;
|
|
101
|
+
|
|
102
|
+
&:before {
|
|
103
|
+
content: '';
|
|
104
|
+
transition: background-color var(--transition-duration) ease-in-out;
|
|
105
|
+
position: absolute;
|
|
106
|
+
background-color: transparent;
|
|
107
|
+
z-index: 10;
|
|
108
|
+
top: 50%;
|
|
109
|
+
left: 50%;
|
|
110
|
+
transform: translate(-50%, -50%);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
&[data-state='checked'] {
|
|
114
|
+
transform: translateX(var(--switch-thumb-x));
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
[data-part='label'] {
|
|
119
|
+
cursor: pointer;
|
|
120
|
+
display: flex;
|
|
121
|
+
flex-direction: column;
|
|
122
|
+
margin-left: var(--spacing-xs);
|
|
123
|
+
|
|
124
|
+
.labelInfo {
|
|
125
|
+
width: 100%;
|
|
126
|
+
color: var(--color-font-secondary);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
&[data-disabled] {
|
|
130
|
+
color: var(--color-font-disabled);
|
|
131
|
+
cursor: default;
|
|
132
|
+
|
|
133
|
+
.labelInfo {
|
|
134
|
+
color: var(--color-background-disable);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.icon {
|
|
140
|
+
color: var(--color-icon-inverse);
|
|
141
|
+
position: absolute;
|
|
142
|
+
top: 50%;
|
|
143
|
+
transform: translateY(-50%);
|
|
144
|
+
pointer-events: none;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.iconCheck {
|
|
148
|
+
left: var(--icon-spacing);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.iconClose {
|
|
152
|
+
right: var(--icon-spacing);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { Switch, type SwitchCheckedChangeDetails } from '@ark-ui/react/switch';
|
|
2
|
+
import classNames from 'classnames';
|
|
3
|
+
import type { DsToggleProps } from './ds-toggle.types';
|
|
4
|
+
import styles from './ds-toggle.module.scss';
|
|
5
|
+
import { DsIcon } from '../ds-icon';
|
|
6
|
+
import { DsTypography } from '../ds-typography';
|
|
7
|
+
import type { Ref } from 'react';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Design system Toggle component
|
|
11
|
+
*/
|
|
12
|
+
const DsToggle = ({
|
|
13
|
+
ref,
|
|
14
|
+
label,
|
|
15
|
+
name,
|
|
16
|
+
labelInfo,
|
|
17
|
+
className,
|
|
18
|
+
style = {},
|
|
19
|
+
onChange,
|
|
20
|
+
onValueChange,
|
|
21
|
+
size = 'default',
|
|
22
|
+
children,
|
|
23
|
+
checked,
|
|
24
|
+
...rest
|
|
25
|
+
}: DsToggleProps) => {
|
|
26
|
+
const isSmall = size === 'small';
|
|
27
|
+
const iconSize = isSmall ? 'tiny' : 'small';
|
|
28
|
+
const checkIconClass = classNames(styles.icon, styles.iconCheck);
|
|
29
|
+
const closeIconClass = classNames(styles.icon, styles.iconClose);
|
|
30
|
+
|
|
31
|
+
const rootClass = classNames(
|
|
32
|
+
styles.root,
|
|
33
|
+
{
|
|
34
|
+
[styles.small]: isSmall,
|
|
35
|
+
},
|
|
36
|
+
className,
|
|
37
|
+
);
|
|
38
|
+
|
|
39
|
+
const handleCheckedChange = (e: SwitchCheckedChangeDetails) => {
|
|
40
|
+
onValueChange?.(e.checked);
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
return (
|
|
44
|
+
<Switch.Root
|
|
45
|
+
ref={ref as Ref<HTMLLabelElement>}
|
|
46
|
+
style={style}
|
|
47
|
+
className={rootClass}
|
|
48
|
+
label={label}
|
|
49
|
+
checked={checked}
|
|
50
|
+
name={name}
|
|
51
|
+
onCheckedChange={handleCheckedChange}
|
|
52
|
+
onClick={onChange}
|
|
53
|
+
{...rest}
|
|
54
|
+
>
|
|
55
|
+
<Switch.Control>
|
|
56
|
+
<DsIcon icon="check" size={iconSize} className={checkIconClass} />
|
|
57
|
+
<Switch.Thumb />
|
|
58
|
+
<DsIcon icon="close" size={iconSize} className={closeIconClass} />
|
|
59
|
+
</Switch.Control>
|
|
60
|
+
|
|
61
|
+
{label ? (
|
|
62
|
+
<Switch.Label>
|
|
63
|
+
<DsTypography variant={isSmall ? 'body-xs-md' : 'body-sm-md'}>{label}</DsTypography>
|
|
64
|
+
{!!labelInfo && (
|
|
65
|
+
<DsTypography variant="body-xs-reg" className={styles.labelInfo}>
|
|
66
|
+
{labelInfo}
|
|
67
|
+
</DsTypography>
|
|
68
|
+
)}
|
|
69
|
+
</Switch.Label>
|
|
70
|
+
) : (
|
|
71
|
+
children
|
|
72
|
+
)}
|
|
73
|
+
<Switch.HiddenInput />
|
|
74
|
+
</Switch.Root>
|
|
75
|
+
);
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
export default DsToggle;
|