@raystack/apsara 0.39.0 → 0.41.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/dist/style.css +1 -1
- package/dist/v1/components/calendar/calendar.module.css.cjs +1 -1
- package/dist/v1/components/calendar/calendar.module.css.js +1 -1
- package/dist/v1/components/calendar/range-picker.cjs +25 -7
- package/dist/v1/components/calendar/range-picker.cjs.map +1 -1
- package/dist/v1/components/calendar/range-picker.d.ts +2 -1
- package/dist/v1/components/calendar/range-picker.d.ts.map +1 -1
- package/dist/v1/components/calendar/range-picker.js +25 -7
- package/dist/v1/components/calendar/range-picker.js.map +1 -1
- package/dist/v1/components/chip/chip.cjs +2 -2
- package/dist/v1/components/chip/chip.cjs.map +1 -1
- package/dist/v1/components/chip/chip.d.ts +2 -1
- package/dist/v1/components/chip/chip.d.ts.map +1 -1
- package/dist/v1/components/chip/chip.js +2 -2
- package/dist/v1/components/chip/chip.js.map +1 -1
- package/dist/v1/components/data-table/components/search.cjs +4 -3
- package/dist/v1/components/data-table/components/search.cjs.map +1 -1
- package/dist/v1/components/data-table/components/search.d.ts +1 -1
- package/dist/v1/components/data-table/components/search.d.ts.map +1 -1
- package/dist/v1/components/data-table/components/search.js +4 -3
- package/dist/v1/components/data-table/components/search.js.map +1 -1
- package/dist/v1/components/data-table/data-table.d.ts +1 -2
- package/dist/v1/components/data-table/data-table.d.ts.map +1 -1
- package/dist/v1/components/dialog/dialog.cjs +4 -3
- package/dist/v1/components/dialog/dialog.cjs.map +1 -1
- package/dist/v1/components/dialog/dialog.d.ts +3 -2
- package/dist/v1/components/dialog/dialog.d.ts.map +1 -1
- package/dist/v1/components/dialog/dialog.js +4 -3
- package/dist/v1/components/dialog/dialog.js.map +1 -1
- package/dist/v1/components/empty-state/empty-state.cjs +4 -1
- package/dist/v1/components/empty-state/empty-state.cjs.map +1 -1
- package/dist/v1/components/empty-state/empty-state.d.ts +3 -2
- package/dist/v1/components/empty-state/empty-state.d.ts.map +1 -1
- package/dist/v1/components/empty-state/empty-state.js +4 -1
- package/dist/v1/components/empty-state/empty-state.js.map +1 -1
- package/dist/v1/components/empty-state/empty-state.module.css.cjs +1 -1
- package/dist/v1/components/empty-state/empty-state.module.css.js +1 -1
- package/dist/v1/components/input-field/input-field.cjs +6 -5
- package/dist/v1/components/input-field/input-field.cjs.map +1 -1
- package/dist/v1/components/input-field/input-field.d.ts +1 -4
- package/dist/v1/components/input-field/input-field.d.ts.map +1 -1
- package/dist/v1/components/input-field/input-field.js +6 -5
- package/dist/v1/components/input-field/input-field.js.map +1 -1
- package/dist/v1/components/search/search.cjs +5 -4
- package/dist/v1/components/search/search.cjs.map +1 -1
- package/dist/v1/components/search/search.d.ts +3 -6
- package/dist/v1/components/search/search.d.ts.map +1 -1
- package/dist/v1/components/search/search.js +5 -4
- package/dist/v1/components/search/search.js.map +1 -1
- package/dist/v1/components/sidebar/sidebar.cjs +12 -7
- package/dist/v1/components/sidebar/sidebar.cjs.map +1 -1
- package/dist/v1/components/sidebar/sidebar.d.ts +1 -0
- package/dist/v1/components/sidebar/sidebar.d.ts.map +1 -1
- package/dist/v1/components/sidebar/sidebar.js +13 -8
- package/dist/v1/components/sidebar/sidebar.js.map +1 -1
- package/dist/v1/components/text-area/text-area.cjs +2 -2
- package/dist/v1/components/text-area/text-area.cjs.map +1 -1
- package/dist/v1/components/text-area/text-area.d.ts.map +1 -1
- package/dist/v1/components/text-area/text-area.js +2 -2
- package/dist/v1/components/text-area/text-area.js.map +1 -1
- package/dist/v1/icons/assets/buildings-filled.svg.cjs +42 -0
- package/dist/v1/icons/assets/buildings-filled.svg.cjs.map +1 -0
- package/dist/v1/icons/assets/buildings-filled.svg.js +21 -0
- package/dist/v1/icons/assets/buildings-filled.svg.js.map +1 -0
- package/dist/v1/icons/index.cjs +2 -0
- package/dist/v1/icons/index.cjs.map +1 -1
- package/dist/v1/icons/index.d.ts +1 -0
- package/dist/v1/icons/index.d.ts.map +1 -1
- package/dist/v1/icons/index.js +1 -0
- package/dist/v1/icons/index.js.map +1 -1
- package/dist/v1/style.css +1 -1
- package/package.json +1 -1
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var styles = {"calendarRoot":"calendar-module_calendarRoot__OZGQR","caption_label":"calendar-module_caption_label__8K7ZD","dropdowns":"calendar-module_dropdowns__0Uj8G","dropdown_trigger":"calendar-module_dropdown_trigger__HJ6Tm","dropdown_item_text":"calendar-module_dropdown_item_text__vUAKC","nav_button":"calendar-module_nav_button__tZDLw","nav_button_previous":"calendar-module_nav_button_previous__NVCfJ","nav_button_next":"calendar-module_nav_button_next__l1U08","months":"calendar-module_months__bBetg","nav":"calendar-module_nav__QMOu0","month_caption":"calendar-module_month_caption__pYPFz","day":"calendar-module_day__8eOAz","disabled":"calendar-module_disabled__ipw4l","outside":"calendar-module_outside__dbHbx","selected":"calendar-module_selected__TlwjL","range_middle":"calendar-module_range_middle__vn4Fr","range_start":"calendar-module_range_start__ErGPG","range_end":"calendar-module_range_end__K6oe-","week":"calendar-module_week__te1nD","day_button":"calendar-module_day_button__F4ayk","weekday":"calendar-module_weekday__H63mo","hidden":"calendar-module_hidden__5XuPD","calendarPopover":"calendar-module_calendarPopover__ykbVn","dropdown_icon":"calendar-module_dropdown_icon__J5WPO","dropdown_content":"calendar-module_dropdown_content__6KXfz","today":"calendar-module_today__HlNqe","datePickerInput":"calendar-module_datePickerInput__eVoid"};
|
|
5
|
+
var styles = {"calendarRoot":"calendar-module_calendarRoot__OZGQR","caption_label":"calendar-module_caption_label__8K7ZD","dropdowns":"calendar-module_dropdowns__0Uj8G","dropdown_trigger":"calendar-module_dropdown_trigger__HJ6Tm","dropdown_item_text":"calendar-module_dropdown_item_text__vUAKC","nav_button":"calendar-module_nav_button__tZDLw","nav_button_previous":"calendar-module_nav_button_previous__NVCfJ","nav_button_next":"calendar-module_nav_button_next__l1U08","months":"calendar-module_months__bBetg","nav":"calendar-module_nav__QMOu0","month_caption":"calendar-module_month_caption__pYPFz","day":"calendar-module_day__8eOAz","disabled":"calendar-module_disabled__ipw4l","outside":"calendar-module_outside__dbHbx","selected":"calendar-module_selected__TlwjL","range_middle":"calendar-module_range_middle__vn4Fr","range_start":"calendar-module_range_start__ErGPG","range_end":"calendar-module_range_end__K6oe-","week":"calendar-module_week__te1nD","day_button":"calendar-module_day_button__F4ayk","weekday":"calendar-module_weekday__H63mo","hidden":"calendar-module_hidden__5XuPD","calendarPopover":"calendar-module_calendarPopover__ykbVn","dropdown_icon":"calendar-module_dropdown_icon__J5WPO","dropdown_content":"calendar-module_dropdown_content__6KXfz","today":"calendar-module_today__HlNqe","datePickerInput":"calendar-module_datePickerInput__eVoid","calendarFooter":"calendar-module_calendarFooter__kJw5W"};
|
|
6
6
|
|
|
7
7
|
exports.default = styles;
|
|
8
8
|
//# sourceMappingURL=calendar.module.css.cjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var styles = {"calendarRoot":"calendar-module_calendarRoot__OZGQR","caption_label":"calendar-module_caption_label__8K7ZD","dropdowns":"calendar-module_dropdowns__0Uj8G","dropdown_trigger":"calendar-module_dropdown_trigger__HJ6Tm","dropdown_item_text":"calendar-module_dropdown_item_text__vUAKC","nav_button":"calendar-module_nav_button__tZDLw","nav_button_previous":"calendar-module_nav_button_previous__NVCfJ","nav_button_next":"calendar-module_nav_button_next__l1U08","months":"calendar-module_months__bBetg","nav":"calendar-module_nav__QMOu0","month_caption":"calendar-module_month_caption__pYPFz","day":"calendar-module_day__8eOAz","disabled":"calendar-module_disabled__ipw4l","outside":"calendar-module_outside__dbHbx","selected":"calendar-module_selected__TlwjL","range_middle":"calendar-module_range_middle__vn4Fr","range_start":"calendar-module_range_start__ErGPG","range_end":"calendar-module_range_end__K6oe-","week":"calendar-module_week__te1nD","day_button":"calendar-module_day_button__F4ayk","weekday":"calendar-module_weekday__H63mo","hidden":"calendar-module_hidden__5XuPD","calendarPopover":"calendar-module_calendarPopover__ykbVn","dropdown_icon":"calendar-module_dropdown_icon__J5WPO","dropdown_content":"calendar-module_dropdown_content__6KXfz","today":"calendar-module_today__HlNqe","datePickerInput":"calendar-module_datePickerInput__eVoid"};
|
|
1
|
+
var styles = {"calendarRoot":"calendar-module_calendarRoot__OZGQR","caption_label":"calendar-module_caption_label__8K7ZD","dropdowns":"calendar-module_dropdowns__0Uj8G","dropdown_trigger":"calendar-module_dropdown_trigger__HJ6Tm","dropdown_item_text":"calendar-module_dropdown_item_text__vUAKC","nav_button":"calendar-module_nav_button__tZDLw","nav_button_previous":"calendar-module_nav_button_previous__NVCfJ","nav_button_next":"calendar-module_nav_button_next__l1U08","months":"calendar-module_months__bBetg","nav":"calendar-module_nav__QMOu0","month_caption":"calendar-module_month_caption__pYPFz","day":"calendar-module_day__8eOAz","disabled":"calendar-module_disabled__ipw4l","outside":"calendar-module_outside__dbHbx","selected":"calendar-module_selected__TlwjL","range_middle":"calendar-module_range_middle__vn4Fr","range_start":"calendar-module_range_start__ErGPG","range_end":"calendar-module_range_end__K6oe-","week":"calendar-module_week__te1nD","day_button":"calendar-module_day_button__F4ayk","weekday":"calendar-module_weekday__H63mo","hidden":"calendar-module_hidden__5XuPD","calendarPopover":"calendar-module_calendarPopover__ykbVn","dropdown_icon":"calendar-module_dropdown_icon__J5WPO","dropdown_content":"calendar-module_dropdown_content__6KXfz","today":"calendar-module_today__HlNqe","datePickerInput":"calendar-module_datePickerInput__eVoid","calendarFooter":"calendar-module_calendarFooter__kJw5W"};
|
|
2
2
|
|
|
3
3
|
export { styles as default };
|
|
4
4
|
//# sourceMappingURL=calendar.module.css.js.map
|
|
@@ -13,7 +13,7 @@ var calendar_module = require('./calendar.module.css.cjs');
|
|
|
13
13
|
function RangePicker({ side = "top", dateFormat = "DD/MM/YYYY", textFieldProps, placeholders, calendarProps, onSelect = () => { }, value = {
|
|
14
14
|
to: new Date(),
|
|
15
15
|
from: new Date(),
|
|
16
|
-
}, pickerGroupClassName, children, showCalendarIcon = true, }) {
|
|
16
|
+
}, pickerGroupClassName, children, showCalendarIcon = true, footer, }) {
|
|
17
17
|
const [showCalendar, setShowCalendar] = React.useState(false);
|
|
18
18
|
const [currentRangeField, setCurrentRangeField] = React.useState("from");
|
|
19
19
|
const [selectedRange, setSelectedRange] = React.useState(value);
|
|
@@ -25,18 +25,36 @@ function RangePicker({ side = "top", dateFormat = "DD/MM/YYYY", textFieldProps,
|
|
|
25
25
|
const handleSelect = (range, selectedDay) => {
|
|
26
26
|
const from = selectedRange?.from || range?.from;
|
|
27
27
|
let newRange;
|
|
28
|
-
if (currentRangeField === "to"
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
if (currentRangeField === "to") {
|
|
29
|
+
if (dayjs_min.default(selectedDay).isSame(dayjs_min.default(from), 'day')) {
|
|
30
|
+
// If same date is clicked twice, set end date to the same date for UI
|
|
31
|
+
newRange = {
|
|
32
|
+
from,
|
|
33
|
+
to: selectedDay
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
else if (dayjs_min.default(selectedDay).isAfter(dayjs_min.default(from))) {
|
|
37
|
+
// If different date is selected and it's after start date
|
|
38
|
+
newRange = { from, to: selectedDay };
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
// If selected date is before start date, reset and select start day
|
|
42
|
+
newRange = { from: selectedDay };
|
|
43
|
+
}
|
|
31
44
|
setCurrentRangeField("from");
|
|
32
45
|
}
|
|
33
46
|
else {
|
|
34
|
-
//
|
|
47
|
+
// Reset the range and select start day
|
|
35
48
|
newRange = { from: selectedDay };
|
|
36
49
|
setCurrentRangeField("to");
|
|
37
50
|
}
|
|
38
51
|
setSelectedRange(newRange);
|
|
39
|
-
|
|
52
|
+
// Return the range with +1 day for the end date in the callback
|
|
53
|
+
const callbackRange = {
|
|
54
|
+
from: newRange.from,
|
|
55
|
+
to: newRange.to ? dayjs_min.default(newRange.to).add(1, 'day').toDate() : undefined
|
|
56
|
+
};
|
|
57
|
+
onSelect(callbackRange);
|
|
40
58
|
};
|
|
41
59
|
function onOpenChange(open) {
|
|
42
60
|
setShowCalendar(Boolean(open));
|
|
@@ -45,7 +63,7 @@ function RangePicker({ side = "top", dateFormat = "DD/MM/YYYY", textFieldProps,
|
|
|
45
63
|
const trigger = typeof children === 'function'
|
|
46
64
|
? children({ startDate, endDate })
|
|
47
65
|
: children || defaultTrigger;
|
|
48
|
-
return (jsxRuntime.jsxRuntimeExports.jsxs(popover.Popover, { open: showCalendar, onOpenChange: onOpenChange, children: [jsxRuntime.jsxRuntimeExports.jsx(popover.Popover.Trigger, { asChild: true, children: trigger }), jsxRuntime.jsxRuntimeExports.
|
|
66
|
+
return (jsxRuntime.jsxRuntimeExports.jsxs(popover.Popover, { open: showCalendar, onOpenChange: onOpenChange, children: [jsxRuntime.jsxRuntimeExports.jsx(popover.Popover.Trigger, { asChild: true, children: trigger }), jsxRuntime.jsxRuntimeExports.jsxs(popover.Popover.Content, { side: side, className: calendar_module.default.calendarPopover, children: [jsxRuntime.jsxRuntimeExports.jsx(calendar.Calendar, { showOutsideDays: false, numberOfMonths: 2, defaultMonth: selectedRange.from, required: true, ...calendarProps, mode: "range", selected: selectedRange, onSelect: handleSelect }), footer && (jsxRuntime.jsxRuntimeExports.jsx(flex.Flex, { align: "center", justify: "center", className: calendar_module.default.calendarFooter, children: footer }))] })] }));
|
|
49
67
|
}
|
|
50
68
|
|
|
51
69
|
exports.RangePicker = RangePicker;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"range-picker.cjs","sources":["../../../../v1/components/calendar/range-picker.tsx"],"sourcesContent":["import { CalendarIcon } from \"@radix-ui/react-icons\";\nimport dayjs from \"dayjs\";\nimport { useState } from \"react\";\nimport { DateRange, PropsBase, PropsRangeRequired } from \"react-day-picker\";\n\nimport { Flex } from \"../flex\";\nimport { Popover } from \"../popover\";\nimport { TextField } from \"../textfield\";\nimport { TextfieldProps } from \"../textfield/textfield\";\nimport { Calendar } from \"./calendar\";\nimport styles from \"./calendar.module.css\";\n\ninterface RangePickerProps {\n side?: \"top\" | \"right\" | \"bottom\" | \"left\";\n dateFormat?: string;\n textFieldProps?: TextfieldProps;\n placeholders?: { startDate?: string; endDate?: string };\n calendarProps?: PropsRangeRequired & PropsBase;\n onSelect?: (date: DateRange) => void;\n pickerGroupClassName?: string;\n value?: DateRange;\n children?: React.ReactNode | ((props: { startDate: string; endDate: string }) => React.ReactNode);\n showCalendarIcon?: boolean;\n}\n\ntype RangeFields = keyof DateRange;\n\nexport function RangePicker({\n side = \"top\",\n dateFormat = \"DD/MM/YYYY\",\n textFieldProps,\n placeholders,\n calendarProps,\n onSelect = () => {},\n value = {\n to: new Date(),\n from: new Date(),\n },\n pickerGroupClassName,\n children,\n showCalendarIcon = true,\n}: RangePickerProps) {\n const [showCalendar, setShowCalendar] = useState(false);\n const [currentRangeField, setCurrentRangeField] = useState<RangeFields>(\"from\");\n const [selectedRange, setSelectedRange] = useState(value);\n\n const startDate = selectedRange.from ? dayjs(selectedRange.from).format(dateFormat) : '';\n const endDate = selectedRange.to ? dayjs(selectedRange.to).format(dateFormat) : '';\n\n // 1st click will select the start date.\n // 2nd click will select the end date.\n // 3rd click will select the start date again.\n const handleSelect = (range: DateRange, selectedDay: Date) => {\n const from = selectedRange?.from || range?.from;\n let newRange: DateRange;\n \n if (currentRangeField === \"to\"
|
|
1
|
+
{"version":3,"file":"range-picker.cjs","sources":["../../../../v1/components/calendar/range-picker.tsx"],"sourcesContent":["import { CalendarIcon } from \"@radix-ui/react-icons\";\nimport dayjs from \"dayjs\";\nimport { useState } from \"react\";\nimport { DateRange, PropsBase, PropsRangeRequired } from \"react-day-picker\";\n\nimport { Flex } from \"../flex\";\nimport { Popover } from \"../popover\";\nimport { TextField } from \"../textfield\";\nimport { TextfieldProps } from \"../textfield/textfield\";\nimport { Calendar } from \"./calendar\";\nimport styles from \"./calendar.module.css\";\n\ninterface RangePickerProps {\n side?: \"top\" | \"right\" | \"bottom\" | \"left\";\n dateFormat?: string;\n textFieldProps?: TextfieldProps;\n placeholders?: { startDate?: string; endDate?: string };\n calendarProps?: PropsRangeRequired & PropsBase;\n onSelect?: (date: DateRange) => void;\n pickerGroupClassName?: string;\n value?: DateRange;\n children?: React.ReactNode | ((props: { startDate: string; endDate: string }) => React.ReactNode);\n showCalendarIcon?: boolean;\n footer?: React.ReactNode;\n}\n\ntype RangeFields = keyof DateRange;\n\nexport function RangePicker({\n side = \"top\",\n dateFormat = \"DD/MM/YYYY\",\n textFieldProps,\n placeholders,\n calendarProps,\n onSelect = () => {},\n value = {\n to: new Date(),\n from: new Date(),\n },\n pickerGroupClassName,\n children,\n showCalendarIcon = true,\n footer,\n}: RangePickerProps) {\n const [showCalendar, setShowCalendar] = useState(false);\n const [currentRangeField, setCurrentRangeField] = useState<RangeFields>(\"from\");\n const [selectedRange, setSelectedRange] = useState(value);\n\n const startDate = selectedRange.from ? dayjs(selectedRange.from).format(dateFormat) : '';\n const endDate = selectedRange.to ? dayjs(selectedRange.to).format(dateFormat) : '';\n\n // 1st click will select the start date.\n // 2nd click will select the end date.\n // 3rd click will select the start date again.\n const handleSelect = (range: DateRange, selectedDay: Date) => {\n const from = selectedRange?.from || range?.from;\n let newRange: DateRange;\n \n if (currentRangeField === \"to\") {\n if (dayjs(selectedDay).isSame(dayjs(from), 'day')) {\n // If same date is clicked twice, set end date to the same date for UI\n newRange = {\n from,\n to: selectedDay\n };\n } else if (dayjs(selectedDay).isAfter(dayjs(from))) {\n // If different date is selected and it's after start date\n newRange = { from, to: selectedDay };\n } else {\n // If selected date is before start date, reset and select start day\n newRange = { from: selectedDay };\n }\n setCurrentRangeField(\"from\");\n } else {\n // Reset the range and select start day\n newRange = { from: selectedDay };\n setCurrentRangeField(\"to\");\n }\n \n setSelectedRange(newRange);\n \n // Return the range with +1 day for the end date in the callback\n const callbackRange = {\n from: newRange.from,\n to: newRange.to ? dayjs(newRange.to).add(1, 'day').toDate() : undefined\n };\n onSelect(callbackRange);\n };\n\n function onOpenChange(open?: boolean) {\n setShowCalendar(Boolean(open));\n }\n\n const defaultTrigger = (\n <Flex gap={\"medium\"} className={pickerGroupClassName}>\n <TextField\n value={startDate}\n trailing={showCalendarIcon ? <CalendarIcon /> : undefined}\n className={styles.datePickerInput}\n readOnly\n {...textFieldProps}\n placeholder={placeholders?.startDate || \"Select start date\"}\n />\n <TextField\n value={endDate}\n trailing={showCalendarIcon ? <CalendarIcon /> : undefined}\n className={styles.datePickerInput}\n readOnly\n {...textFieldProps}\n placeholder={placeholders?.endDate || \"Select end date\"}\n />\n </Flex>\n );\n\n const trigger = typeof children === 'function' \n ? children({ startDate, endDate }) \n : children || defaultTrigger;\n\n return (\n <Popover open={showCalendar} onOpenChange={onOpenChange}>\n <Popover.Trigger asChild>\n {trigger}\n </Popover.Trigger>\n <Popover.Content side={side} className={styles.calendarPopover}>\n <Calendar\n showOutsideDays={false}\n numberOfMonths={2}\n defaultMonth={selectedRange.from}\n required={true}\n {...calendarProps}\n mode=\"range\"\n selected={selectedRange}\n onSelect={handleSelect}\n />\n {footer && (\n <Flex align=\"center\" justify=\"center\" className={styles.calendarFooter}>\n {footer}\n </Flex>\n )}\n </Popover.Content>\n </Popover>\n );\n}\n"],"names":["useState","dayjs","_jsxs","Flex","_jsx","TextField","CalendarIcon","styles","Popover","Calendar"],"mappings":";;;;;;;;;;;;AA4BM,SAAU,WAAW,CAAC,EAC1B,IAAI,GAAG,KAAK,EACZ,UAAU,GAAG,YAAY,EACzB,cAAc,EACd,YAAY,EACZ,aAAa,EACb,QAAQ,GAAG,MAAO,GAAC,EACnB,KAAK,GAAG;IACN,EAAE,EAAE,IAAI,IAAI,EAAE;IACd,IAAI,EAAE,IAAI,IAAI,EAAE;CACjB,EACD,oBAAoB,EACpB,QAAQ,EACR,gBAAgB,GAAG,IAAI,EACvB,MAAM,GACW,EAAA;IACjB,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAGA,cAAQ,CAAC,KAAK,CAAC,C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AAQ,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC;AAClC,UAAE,QAAQ,IAAI,cAAc,CAAC;IAE/B,QACEL,kCAACM,eAAO,EAAA,EAAC,IAAI,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EACrD,QAAA,EAAA,CAAAJ,gCAAA,CAACI,eAAO,CAAC,OAAO,IAAC,OAAO,EAAA,IAAA,EAAA,QAAA,EACrB,OAAO,EAAA,CACQ,EAClBN,iCAAA,CAACM,eAAO,CAAC,OAAO,IAAC,IAAI,EAAE,IAAI,EAAE,SAAS,EAAED,uBAAM,CAAC,eAAe,aAC5DH,gCAAC,CAAAK,iBAAQ,IACP,eAAe,EAAE,KAAK,EACtB,cAAc,EAAE,CAAC,EACjB,YAAY,EAAE,aAAa,CAAC,IAAI,EAChC,QAAQ,EAAE,IAAI,EAAA,GACV,aAAa,EACjB,IAAI,EAAC,OAAO,EACZ,QAAQ,EAAE,aAAa,EACvB,QAAQ,EAAE,YAAY,EACtB,CAAA,EACD,MAAM,KACLL,gCAAC,CAAAD,SAAI,IAAC,KAAK,EAAC,QAAQ,EAAC,OAAO,EAAC,QAAQ,EAAC,SAAS,EAAEI,uBAAM,CAAC,cAAc,EACnE,QAAA,EAAA,MAAM,GACF,CACR,CAAA,EAAA,CACe,CACV,EAAA,CAAA,EACV;AACJ;;;;"}
|
|
@@ -17,7 +17,8 @@ interface RangePickerProps {
|
|
|
17
17
|
endDate: string;
|
|
18
18
|
}) => React.ReactNode);
|
|
19
19
|
showCalendarIcon?: boolean;
|
|
20
|
+
footer?: React.ReactNode;
|
|
20
21
|
}
|
|
21
|
-
export declare function RangePicker({ side, dateFormat, textFieldProps, placeholders, calendarProps, onSelect, value, pickerGroupClassName, children, showCalendarIcon, }: RangePickerProps): import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
export declare function RangePicker({ side, dateFormat, textFieldProps, placeholders, calendarProps, onSelect, value, pickerGroupClassName, children, showCalendarIcon, footer, }: RangePickerProps): import("react/jsx-runtime").JSX.Element;
|
|
22
23
|
export {};
|
|
23
24
|
//# sourceMappingURL=range-picker.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"range-picker.d.ts","sourceRoot":"","sources":["../../../../v1/components/calendar/range-picker.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAK5E,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAIxD,UAAU,gBAAgB;IACxB,IAAI,CAAC,EAAE,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAC;IAC3C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,YAAY,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACxD,aAAa,CAAC,EAAE,kBAAkB,GAAG,SAAS,CAAC;IAC/C,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,IAAI,CAAC;IACrC,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,CAAC,CAAC,KAAK,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,KAAK,KAAK,CAAC,SAAS,CAAC,CAAC;IAClG,gBAAgB,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"range-picker.d.ts","sourceRoot":"","sources":["../../../../v1/components/calendar/range-picker.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAK5E,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAIxD,UAAU,gBAAgB;IACxB,IAAI,CAAC,EAAE,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAC;IAC3C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,YAAY,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACxD,aAAa,CAAC,EAAE,kBAAkB,GAAG,SAAS,CAAC;IAC/C,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,IAAI,CAAC;IACrC,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,CAAC,CAAC,KAAK,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,KAAK,KAAK,CAAC,SAAS,CAAC,CAAC;IAClG,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC1B;AAID,wBAAgB,WAAW,CAAC,EAC1B,IAAY,EACZ,UAAyB,EACzB,cAAc,EACd,YAAY,EACZ,aAAa,EACb,QAAmB,EACnB,KAGC,EACD,oBAAoB,EACpB,QAAQ,EACR,gBAAuB,EACvB,MAAM,GACP,EAAE,gBAAgB,2CAmGlB"}
|
|
@@ -11,7 +11,7 @@ import styles from './calendar.module.css.js';
|
|
|
11
11
|
function RangePicker({ side = "top", dateFormat = "DD/MM/YYYY", textFieldProps, placeholders, calendarProps, onSelect = () => { }, value = {
|
|
12
12
|
to: new Date(),
|
|
13
13
|
from: new Date(),
|
|
14
|
-
}, pickerGroupClassName, children, showCalendarIcon = true, }) {
|
|
14
|
+
}, pickerGroupClassName, children, showCalendarIcon = true, footer, }) {
|
|
15
15
|
const [showCalendar, setShowCalendar] = useState(false);
|
|
16
16
|
const [currentRangeField, setCurrentRangeField] = useState("from");
|
|
17
17
|
const [selectedRange, setSelectedRange] = useState(value);
|
|
@@ -23,18 +23,36 @@ function RangePicker({ side = "top", dateFormat = "DD/MM/YYYY", textFieldProps,
|
|
|
23
23
|
const handleSelect = (range, selectedDay) => {
|
|
24
24
|
const from = selectedRange?.from || range?.from;
|
|
25
25
|
let newRange;
|
|
26
|
-
if (currentRangeField === "to"
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
if (currentRangeField === "to") {
|
|
27
|
+
if (dayjs(selectedDay).isSame(dayjs(from), 'day')) {
|
|
28
|
+
// If same date is clicked twice, set end date to the same date for UI
|
|
29
|
+
newRange = {
|
|
30
|
+
from,
|
|
31
|
+
to: selectedDay
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
else if (dayjs(selectedDay).isAfter(dayjs(from))) {
|
|
35
|
+
// If different date is selected and it's after start date
|
|
36
|
+
newRange = { from, to: selectedDay };
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
// If selected date is before start date, reset and select start day
|
|
40
|
+
newRange = { from: selectedDay };
|
|
41
|
+
}
|
|
29
42
|
setCurrentRangeField("from");
|
|
30
43
|
}
|
|
31
44
|
else {
|
|
32
|
-
//
|
|
45
|
+
// Reset the range and select start day
|
|
33
46
|
newRange = { from: selectedDay };
|
|
34
47
|
setCurrentRangeField("to");
|
|
35
48
|
}
|
|
36
49
|
setSelectedRange(newRange);
|
|
37
|
-
|
|
50
|
+
// Return the range with +1 day for the end date in the callback
|
|
51
|
+
const callbackRange = {
|
|
52
|
+
from: newRange.from,
|
|
53
|
+
to: newRange.to ? dayjs(newRange.to).add(1, 'day').toDate() : undefined
|
|
54
|
+
};
|
|
55
|
+
onSelect(callbackRange);
|
|
38
56
|
};
|
|
39
57
|
function onOpenChange(open) {
|
|
40
58
|
setShowCalendar(Boolean(open));
|
|
@@ -43,7 +61,7 @@ function RangePicker({ side = "top", dateFormat = "DD/MM/YYYY", textFieldProps,
|
|
|
43
61
|
const trigger = typeof children === 'function'
|
|
44
62
|
? children({ startDate, endDate })
|
|
45
63
|
: children || defaultTrigger;
|
|
46
|
-
return (jsxRuntimeExports.jsxs(Popover, { open: showCalendar, onOpenChange: onOpenChange, children: [jsxRuntimeExports.jsx(Popover.Trigger, { asChild: true, children: trigger }), jsxRuntimeExports.
|
|
64
|
+
return (jsxRuntimeExports.jsxs(Popover, { open: showCalendar, onOpenChange: onOpenChange, children: [jsxRuntimeExports.jsx(Popover.Trigger, { asChild: true, children: trigger }), jsxRuntimeExports.jsxs(Popover.Content, { side: side, className: styles.calendarPopover, children: [jsxRuntimeExports.jsx(Calendar, { showOutsideDays: false, numberOfMonths: 2, defaultMonth: selectedRange.from, required: true, ...calendarProps, mode: "range", selected: selectedRange, onSelect: handleSelect }), footer && (jsxRuntimeExports.jsx(Flex, { align: "center", justify: "center", className: styles.calendarFooter, children: footer }))] })] }));
|
|
47
65
|
}
|
|
48
66
|
|
|
49
67
|
export { RangePicker };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"range-picker.js","sources":["../../../../v1/components/calendar/range-picker.tsx"],"sourcesContent":["import { CalendarIcon } from \"@radix-ui/react-icons\";\nimport dayjs from \"dayjs\";\nimport { useState } from \"react\";\nimport { DateRange, PropsBase, PropsRangeRequired } from \"react-day-picker\";\n\nimport { Flex } from \"../flex\";\nimport { Popover } from \"../popover\";\nimport { TextField } from \"../textfield\";\nimport { TextfieldProps } from \"../textfield/textfield\";\nimport { Calendar } from \"./calendar\";\nimport styles from \"./calendar.module.css\";\n\ninterface RangePickerProps {\n side?: \"top\" | \"right\" | \"bottom\" | \"left\";\n dateFormat?: string;\n textFieldProps?: TextfieldProps;\n placeholders?: { startDate?: string; endDate?: string };\n calendarProps?: PropsRangeRequired & PropsBase;\n onSelect?: (date: DateRange) => void;\n pickerGroupClassName?: string;\n value?: DateRange;\n children?: React.ReactNode | ((props: { startDate: string; endDate: string }) => React.ReactNode);\n showCalendarIcon?: boolean;\n}\n\ntype RangeFields = keyof DateRange;\n\nexport function RangePicker({\n side = \"top\",\n dateFormat = \"DD/MM/YYYY\",\n textFieldProps,\n placeholders,\n calendarProps,\n onSelect = () => {},\n value = {\n to: new Date(),\n from: new Date(),\n },\n pickerGroupClassName,\n children,\n showCalendarIcon = true,\n}: RangePickerProps) {\n const [showCalendar, setShowCalendar] = useState(false);\n const [currentRangeField, setCurrentRangeField] = useState<RangeFields>(\"from\");\n const [selectedRange, setSelectedRange] = useState(value);\n\n const startDate = selectedRange.from ? dayjs(selectedRange.from).format(dateFormat) : '';\n const endDate = selectedRange.to ? dayjs(selectedRange.to).format(dateFormat) : '';\n\n // 1st click will select the start date.\n // 2nd click will select the end date.\n // 3rd click will select the start date again.\n const handleSelect = (range: DateRange, selectedDay: Date) => {\n const from = selectedRange?.from || range?.from;\n let newRange: DateRange;\n \n if (currentRangeField === \"to\"
|
|
1
|
+
{"version":3,"file":"range-picker.js","sources":["../../../../v1/components/calendar/range-picker.tsx"],"sourcesContent":["import { CalendarIcon } from \"@radix-ui/react-icons\";\nimport dayjs from \"dayjs\";\nimport { useState } from \"react\";\nimport { DateRange, PropsBase, PropsRangeRequired } from \"react-day-picker\";\n\nimport { Flex } from \"../flex\";\nimport { Popover } from \"../popover\";\nimport { TextField } from \"../textfield\";\nimport { TextfieldProps } from \"../textfield/textfield\";\nimport { Calendar } from \"./calendar\";\nimport styles from \"./calendar.module.css\";\n\ninterface RangePickerProps {\n side?: \"top\" | \"right\" | \"bottom\" | \"left\";\n dateFormat?: string;\n textFieldProps?: TextfieldProps;\n placeholders?: { startDate?: string; endDate?: string };\n calendarProps?: PropsRangeRequired & PropsBase;\n onSelect?: (date: DateRange) => void;\n pickerGroupClassName?: string;\n value?: DateRange;\n children?: React.ReactNode | ((props: { startDate: string; endDate: string }) => React.ReactNode);\n showCalendarIcon?: boolean;\n footer?: React.ReactNode;\n}\n\ntype RangeFields = keyof DateRange;\n\nexport function RangePicker({\n side = \"top\",\n dateFormat = \"DD/MM/YYYY\",\n textFieldProps,\n placeholders,\n calendarProps,\n onSelect = () => {},\n value = {\n to: new Date(),\n from: new Date(),\n },\n pickerGroupClassName,\n children,\n showCalendarIcon = true,\n footer,\n}: RangePickerProps) {\n const [showCalendar, setShowCalendar] = useState(false);\n const [currentRangeField, setCurrentRangeField] = useState<RangeFields>(\"from\");\n const [selectedRange, setSelectedRange] = useState(value);\n\n const startDate = selectedRange.from ? dayjs(selectedRange.from).format(dateFormat) : '';\n const endDate = selectedRange.to ? dayjs(selectedRange.to).format(dateFormat) : '';\n\n // 1st click will select the start date.\n // 2nd click will select the end date.\n // 3rd click will select the start date again.\n const handleSelect = (range: DateRange, selectedDay: Date) => {\n const from = selectedRange?.from || range?.from;\n let newRange: DateRange;\n \n if (currentRangeField === \"to\") {\n if (dayjs(selectedDay).isSame(dayjs(from), 'day')) {\n // If same date is clicked twice, set end date to the same date for UI\n newRange = {\n from,\n to: selectedDay\n };\n } else if (dayjs(selectedDay).isAfter(dayjs(from))) {\n // If different date is selected and it's after start date\n newRange = { from, to: selectedDay };\n } else {\n // If selected date is before start date, reset and select start day\n newRange = { from: selectedDay };\n }\n setCurrentRangeField(\"from\");\n } else {\n // Reset the range and select start day\n newRange = { from: selectedDay };\n setCurrentRangeField(\"to\");\n }\n \n setSelectedRange(newRange);\n \n // Return the range with +1 day for the end date in the callback\n const callbackRange = {\n from: newRange.from,\n to: newRange.to ? dayjs(newRange.to).add(1, 'day').toDate() : undefined\n };\n onSelect(callbackRange);\n };\n\n function onOpenChange(open?: boolean) {\n setShowCalendar(Boolean(open));\n }\n\n const defaultTrigger = (\n <Flex gap={\"medium\"} className={pickerGroupClassName}>\n <TextField\n value={startDate}\n trailing={showCalendarIcon ? <CalendarIcon /> : undefined}\n className={styles.datePickerInput}\n readOnly\n {...textFieldProps}\n placeholder={placeholders?.startDate || \"Select start date\"}\n />\n <TextField\n value={endDate}\n trailing={showCalendarIcon ? <CalendarIcon /> : undefined}\n className={styles.datePickerInput}\n readOnly\n {...textFieldProps}\n placeholder={placeholders?.endDate || \"Select end date\"}\n />\n </Flex>\n );\n\n const trigger = typeof children === 'function' \n ? children({ startDate, endDate }) \n : children || defaultTrigger;\n\n return (\n <Popover open={showCalendar} onOpenChange={onOpenChange}>\n <Popover.Trigger asChild>\n {trigger}\n </Popover.Trigger>\n <Popover.Content side={side} className={styles.calendarPopover}>\n <Calendar\n showOutsideDays={false}\n numberOfMonths={2}\n defaultMonth={selectedRange.from}\n required={true}\n {...calendarProps}\n mode=\"range\"\n selected={selectedRange}\n onSelect={handleSelect}\n />\n {footer && (\n <Flex align=\"center\" justify=\"center\" className={styles.calendarFooter}>\n {footer}\n </Flex>\n )}\n </Popover.Content>\n </Popover>\n );\n}\n"],"names":["_jsxs","_jsx"],"mappings":";;;;;;;;;;AA4BM,SAAU,WAAW,CAAC,EAC1B,IAAI,GAAG,KAAK,EACZ,UAAU,GAAG,YAAY,EACzB,cAAc,EACd,YAAY,EACZ,aAAa,EACb,QAAQ,GAAG,MAAO,GAAC,EACnB,KAAK,GAAG;IACN,EAAE,EAAE,IAAI,IAAI,EAAE;IACd,IAAI,EAAE,IAAI,IAAI,EAAE;CACjB,EACD,oBAAoB,EACpB,QAAQ,EACR,gBAAgB,GAAG,IAAI,EACvB,MAAM,GACW,EAAA;IACjB,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IACxD,MAAM,CAAC,iBAAiB,EAAE,oBAAoB,CAAC,GAAG,QAAQ,CAAc,MAAM,CAAC,CAAC;IAChF,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAE1D,MAAM,SAAS,GAAG,aAAa,CAAC,IAAI,GAAG,KAAK,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,CAAC;IACzF,MAAM,OAA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,SAAS,EAAE,MAAM,CAAC,eAAe,aAC5DC,qBAAC,CAAA,QAAQ,IACP,eAAe,EAAE,KAAK,EACtB,cAAc,EAAE,CAAC,EACjB,YAAY,EAAE,aAAa,CAAC,IAAI,EAChC,QAAQ,EAAE,IAAI,EAAA,GACV,aAAa,EACjB,IAAI,EAAC,OAAO,EACZ,QAAQ,EAAE,aAAa,EACvB,QAAQ,EAAE,YAAY,EACtB,CAAA,EACD,MAAM,KACLA,qBAAC,CAAA,IAAI,IAAC,KAAK,EAAC,QAAQ,EAAC,OAAO,EAAC,QAAQ,EAAC,SAAS,EAAE,MAAM,CAAC,cAAc,EACnE,QAAA,EAAA,MAAM,GACF,CACR,CAAA,EAAA,CACe,CACV,EAAA,CAAA,EACV;AACJ;;;;"}
|
|
@@ -25,12 +25,12 @@ const chip = index.cva(chip_module.default.chip, {
|
|
|
25
25
|
color: "neutral",
|
|
26
26
|
},
|
|
27
27
|
});
|
|
28
|
-
const Chip = ({ variant, size, color, trailingIcon, leadingIcon, isDismissible, children, className, onDismiss, onClick, role = "status", ariaLabel, }) => {
|
|
28
|
+
const Chip = ({ variant, size, color, trailingIcon, leadingIcon, isDismissible, children, className, onDismiss, onClick, role = "status", ariaLabel, "data-state": dataState, }) => {
|
|
29
29
|
const handleDismiss = (e) => {
|
|
30
30
|
e.stopPropagation();
|
|
31
31
|
onDismiss?.();
|
|
32
32
|
};
|
|
33
|
-
return (jsxRuntime.jsxRuntimeExports.jsxs("span", { className: chip({ variant, size, color, className }), role: role, "aria-label": ariaLabel || (typeof children === "string" ? children : undefined), onClick: onClick, children: [leadingIcon && (jsxRuntime.jsxRuntimeExports.jsx("span", { className: chip_module.default["leading-icon"], "aria-hidden": "true", role: "presentation", children: leadingIcon })), children, isDismissible ? (jsxRuntime.jsxRuntimeExports.jsx("button", { onClick: handleDismiss, className: chip_module.default["dismiss-button"], "aria-label": `Remove ${typeof children === "string" ? children : "item"}`, type: "button", children: jsxRuntime.jsxRuntimeExports.jsx("svg", { width: "12", height: "12", viewBox: "0 0 12 12", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", role: "presentation", children: jsxRuntime.jsxRuntimeExports.jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M9.5066 3.3066C9.73115 3.08205 9.73115 2.71798 9.5066 2.49343C9.28205 2.26887 8.91798 2.26887 8.69343 2.49343L6.00001 5.18684L3.3066 2.49343C3.08205 2.26887 2.71798 2.26887 2.49343 2.49343C2.26887 2.71798 2.26887 3.08205 2.49343 3.3066L5.18684 6.00001L2.49343 8.69343C2.26887 8.91798 2.26887 9.28205 2.49343 9.5066C2.71798 9.73115 3.08205 9.73115 3.3066 9.5066L6.00001 6.81318L8.69343 9.5066C8.91798 9.73115 9.28205 9.73115 9.5066 9.5066C9.73115 9.28205 9.73115 8.91798 9.5066 8.69343L6.81318 6.00001L9.5066 3.3066Z", fill: "currentColor" }) }) })) : trailingIcon ? (jsxRuntime.jsxRuntimeExports.jsx("span", { className: chip_module.default["trailing-icon"], "aria-hidden": "true", role: "presentation", children: trailingIcon })) : null] }));
|
|
33
|
+
return (jsxRuntime.jsxRuntimeExports.jsxs("span", { className: chip({ variant, size, color, className }), role: role, "aria-label": ariaLabel || (typeof children === "string" ? children : undefined), onClick: onClick, "data-state": dataState, children: [leadingIcon && (jsxRuntime.jsxRuntimeExports.jsx("span", { className: chip_module.default["leading-icon"], "aria-hidden": "true", role: "presentation", children: leadingIcon })), children, isDismissible ? (jsxRuntime.jsxRuntimeExports.jsx("button", { onClick: handleDismiss, className: chip_module.default["dismiss-button"], "aria-label": `Remove ${typeof children === "string" ? children : "item"}`, type: "button", children: jsxRuntime.jsxRuntimeExports.jsx("svg", { width: "12", height: "12", viewBox: "0 0 12 12", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", role: "presentation", children: jsxRuntime.jsxRuntimeExports.jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M9.5066 3.3066C9.73115 3.08205 9.73115 2.71798 9.5066 2.49343C9.28205 2.26887 8.91798 2.26887 8.69343 2.49343L6.00001 5.18684L3.3066 2.49343C3.08205 2.26887 2.71798 2.26887 2.49343 2.49343C2.26887 2.71798 2.26887 3.08205 2.49343 3.3066L5.18684 6.00001L2.49343 8.69343C2.26887 8.91798 2.26887 9.28205 2.49343 9.5066C2.71798 9.73115 3.08205 9.73115 3.3066 9.5066L6.00001 6.81318L8.69343 9.5066C8.91798 9.73115 9.28205 9.73115 9.5066 9.5066C9.73115 9.28205 9.73115 8.91798 9.5066 8.69343L6.81318 6.00001L9.5066 3.3066Z", fill: "currentColor" }) }) })) : trailingIcon ? (jsxRuntime.jsxRuntimeExports.jsx("span", { className: chip_module.default["trailing-icon"], "aria-hidden": "true", role: "presentation", children: trailingIcon })) : null] }));
|
|
34
34
|
};
|
|
35
35
|
Chip.displayName = "Chip";
|
|
36
36
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chip.cjs","sources":["../../../../v1/components/chip/chip.tsx"],"sourcesContent":["import { cva, type VariantProps } from \"class-variance-authority\";\nimport { ReactNode } from \"react\";\n\nimport styles from \"./chip.module.css\";\n\nconst chip = cva(styles.chip, {\n variants: {\n variant: {\n outline: styles[\"chip-variant-outline\"],\n filled: styles[\"chip-variant-filled\"],\n },\n size: {\n large: styles[\"chip-size-large\"],\n small: styles[\"chip-size-small\"],\n },\n color: {\n neutral: styles[\"chip-color-neutral\"],\n accent: styles[\"chip-color-accent\"],\n },\n },\n defaultVariants: {\n variant: \"outline\",\n size: \"small\",\n color: \"neutral\",\n },\n});\n\ntype ChipProps = VariantProps<typeof chip> & {\n trailingIcon?: ReactNode;\n leadingIcon?: ReactNode;\n isDismissible?: boolean;\n children: ReactNode;\n className?: string;\n onDismiss?: () => void;\n onClick?: () => void;\n role?: string;\n ariaLabel?: string;\n};\n\nexport const Chip = ({\n variant,\n size,\n color,\n trailingIcon,\n leadingIcon,\n isDismissible,\n children,\n className,\n onDismiss,\n onClick,\n role = \"status\",\n ariaLabel,\n}: ChipProps) => {\n const handleDismiss = (e: React.MouseEvent) => {\n e.stopPropagation();\n onDismiss?.();\n };\n\n return (\n <span\n className={chip({ variant, size, color, className })}\n role={role}\n aria-label={\n ariaLabel || (typeof children === \"string\" ? children : undefined)\n }\n onClick={onClick}\n >\n {leadingIcon && (\n <span\n className={styles[\"leading-icon\"]}\n aria-hidden=\"true\"\n role=\"presentation\"\n >\n {leadingIcon}\n </span>\n )}\n {children}\n {isDismissible ? (\n <button\n onClick={handleDismiss}\n className={styles[\"dismiss-button\"]}\n aria-label={`Remove ${\n typeof children === \"string\" ? children : \"item\"\n }`}\n type=\"button\"\n >\n <svg\n width=\"12\"\n height=\"12\"\n viewBox=\"0 0 12 12\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n aria-hidden=\"true\"\n role=\"presentation\"\n >\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M9.5066 3.3066C9.73115 3.08205 9.73115 2.71798 9.5066 2.49343C9.28205 2.26887 8.91798 2.26887 8.69343 2.49343L6.00001 5.18684L3.3066 2.49343C3.08205 2.26887 2.71798 2.26887 2.49343 2.49343C2.26887 2.71798 2.26887 3.08205 2.49343 3.3066L5.18684 6.00001L2.49343 8.69343C2.26887 8.91798 2.26887 9.28205 2.49343 9.5066C2.71798 9.73115 3.08205 9.73115 3.3066 9.5066L6.00001 6.81318L8.69343 9.5066C8.91798 9.73115 9.28205 9.73115 9.5066 9.5066C9.73115 9.28205 9.73115 8.91798 9.5066 8.69343L6.81318 6.00001L9.5066 3.3066Z\"\n fill=\"currentColor\"\n />\n </svg>\n </button>\n ) : trailingIcon ? (\n <span\n className={styles[\"trailing-icon\"]}\n aria-hidden=\"true\"\n role=\"presentation\"\n >\n {trailingIcon}\n </span>\n ) : null}\n </span>\n );\n};\n\nChip.displayName = \"Chip\";\n"],"names":["cva","styles","_jsxs","_jsx"],"mappings":";;;;;;AAKA,MAAM,IAAI,GAAGA,SAAG,CAACC,mBAAM,CAAC,IAAI,EAAE;AAC5B,IAAA,QAAQ,EAAE;AACR,QAAA,OAAO,EAAE;AACP,YAAA,OAAO,EAAEA,mBAAM,CAAC,sBAAsB,CAAC;AACvC,YAAA,MAAM,EAAEA,mBAAM,CAAC,qBAAqB,CAAC;AACtC,SAAA;AACD,QAAA,IAAI,EAAE;AACJ,YAAA,KAAK,EAAEA,mBAAM,CAAC,iBAAiB,CAAC;AAChC,YAAA,KAAK,EAAEA,mBAAM,CAAC,iBAAiB,CAAC;AACjC,SAAA;AACD,QAAA,KAAK,EAAE;AACL,YAAA,OAAO,EAAEA,mBAAM,CAAC,oBAAoB,CAAC;AACrC,YAAA,MAAM,EAAEA,mBAAM,CAAC,mBAAmB,CAAC;AACpC,SAAA;AACF,KAAA;AACD,IAAA,eAAe,EAAE;AACf,QAAA,OAAO,EAAE,SAAS;AAClB,QAAA,IAAI,EAAE,OAAO;AACb,QAAA,KAAK,EAAE,SAAS;AACjB,KAAA;AACF,CAAA,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"chip.cjs","sources":["../../../../v1/components/chip/chip.tsx"],"sourcesContent":["import { cva, type VariantProps } from \"class-variance-authority\";\nimport { ReactNode } from \"react\";\n\nimport styles from \"./chip.module.css\";\n\nconst chip = cva(styles.chip, {\n variants: {\n variant: {\n outline: styles[\"chip-variant-outline\"],\n filled: styles[\"chip-variant-filled\"],\n },\n size: {\n large: styles[\"chip-size-large\"],\n small: styles[\"chip-size-small\"],\n },\n color: {\n neutral: styles[\"chip-color-neutral\"],\n accent: styles[\"chip-color-accent\"],\n },\n },\n defaultVariants: {\n variant: \"outline\",\n size: \"small\",\n color: \"neutral\",\n },\n});\n\ntype ChipProps = VariantProps<typeof chip> & {\n trailingIcon?: ReactNode;\n leadingIcon?: ReactNode;\n isDismissible?: boolean;\n children: ReactNode;\n className?: string;\n onDismiss?: () => void;\n onClick?: () => void;\n role?: string;\n ariaLabel?: string;\n \"data-state\"?: string;\n};\n\nexport const Chip = ({\n variant,\n size,\n color,\n trailingIcon,\n leadingIcon,\n isDismissible,\n children,\n className,\n onDismiss,\n onClick,\n role = \"status\",\n ariaLabel,\n \"data-state\": dataState,\n}: ChipProps) => {\n const handleDismiss = (e: React.MouseEvent) => {\n e.stopPropagation();\n onDismiss?.();\n };\n\n return (\n <span\n className={chip({ variant, size, color, className })}\n role={role}\n aria-label={\n ariaLabel || (typeof children === \"string\" ? children : undefined)\n }\n onClick={onClick}\n data-state={dataState}\n >\n {leadingIcon && (\n <span\n className={styles[\"leading-icon\"]}\n aria-hidden=\"true\"\n role=\"presentation\"\n >\n {leadingIcon}\n </span>\n )}\n {children}\n {isDismissible ? (\n <button\n onClick={handleDismiss}\n className={styles[\"dismiss-button\"]}\n aria-label={`Remove ${\n typeof children === \"string\" ? children : \"item\"\n }`}\n type=\"button\"\n >\n <svg\n width=\"12\"\n height=\"12\"\n viewBox=\"0 0 12 12\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n aria-hidden=\"true\"\n role=\"presentation\"\n >\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M9.5066 3.3066C9.73115 3.08205 9.73115 2.71798 9.5066 2.49343C9.28205 2.26887 8.91798 2.26887 8.69343 2.49343L6.00001 5.18684L3.3066 2.49343C3.08205 2.26887 2.71798 2.26887 2.49343 2.49343C2.26887 2.71798 2.26887 3.08205 2.49343 3.3066L5.18684 6.00001L2.49343 8.69343C2.26887 8.91798 2.26887 9.28205 2.49343 9.5066C2.71798 9.73115 3.08205 9.73115 3.3066 9.5066L6.00001 6.81318L8.69343 9.5066C8.91798 9.73115 9.28205 9.73115 9.5066 9.5066C9.73115 9.28205 9.73115 8.91798 9.5066 8.69343L6.81318 6.00001L9.5066 3.3066Z\"\n fill=\"currentColor\"\n />\n </svg>\n </button>\n ) : trailingIcon ? (\n <span\n className={styles[\"trailing-icon\"]}\n aria-hidden=\"true\"\n role=\"presentation\"\n >\n {trailingIcon}\n </span>\n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?: string;
|
|
17
17
|
ariaLabel?: string;
|
|
18
|
+
"data-state"?: string;
|
|
18
19
|
};
|
|
19
20
|
export declare const Chip: {
|
|
20
|
-
({ variant, size, color, trailingIcon, leadingIcon, isDismissible, children, className, onDismiss, onClick, role, ariaLabel, }: ChipProps): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
({ variant, size, color, trailingIcon, leadingIcon, isDismissible, children, className, onDismiss, onClick, role, ariaLabel, "data-state": dataState, }: ChipProps): import("react/jsx-runtime").JSX.Element;
|
|
21
22
|
displayName: string;
|
|
22
23
|
};
|
|
23
24
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chip.d.ts","sourceRoot":"","sources":["../../../../v1/components/chip/chip.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIlC,QAAA,MAAM,IAAI;;;;mFAoBR,CAAC;AAEH,KAAK,SAAS,GAAG,YAAY,CAAC,OAAO,IAAI,CAAC,GAAG;IAC3C,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,QAAQ,EAAE,SAAS,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"chip.d.ts","sourceRoot":"","sources":["../../../../v1/components/chip/chip.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIlC,QAAA,MAAM,IAAI;;;;mFAoBR,CAAC;AAEH,KAAK,SAAS,GAAG,YAAY,CAAC,OAAO,IAAI,CAAC,GAAG;IAC3C,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,QAAQ,EAAE,SAAS,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,eAAO,MAAM,IAAI;6JAcd,SAAS;;CA+DX,CAAC"}
|
|
@@ -23,12 +23,12 @@ const chip = cva(styles.chip, {
|
|
|
23
23
|
color: "neutral",
|
|
24
24
|
},
|
|
25
25
|
});
|
|
26
|
-
const Chip = ({ variant, size, color, trailingIcon, leadingIcon, isDismissible, children, className, onDismiss, onClick, role = "status", ariaLabel, }) => {
|
|
26
|
+
const Chip = ({ variant, size, color, trailingIcon, leadingIcon, isDismissible, children, className, onDismiss, onClick, role = "status", ariaLabel, "data-state": dataState, }) => {
|
|
27
27
|
const handleDismiss = (e) => {
|
|
28
28
|
e.stopPropagation();
|
|
29
29
|
onDismiss?.();
|
|
30
30
|
};
|
|
31
|
-
return (jsxRuntimeExports.jsxs("span", { className: chip({ variant, size, color, className }), role: role, "aria-label": ariaLabel || (typeof children === "string" ? children : undefined), onClick: onClick, children: [leadingIcon && (jsxRuntimeExports.jsx("span", { className: styles["leading-icon"], "aria-hidden": "true", role: "presentation", children: leadingIcon })), children, isDismissible ? (jsxRuntimeExports.jsx("button", { onClick: handleDismiss, className: styles["dismiss-button"], "aria-label": `Remove ${typeof children === "string" ? children : "item"}`, type: "button", children: jsxRuntimeExports.jsx("svg", { width: "12", height: "12", viewBox: "0 0 12 12", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", role: "presentation", children: jsxRuntimeExports.jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M9.5066 3.3066C9.73115 3.08205 9.73115 2.71798 9.5066 2.49343C9.28205 2.26887 8.91798 2.26887 8.69343 2.49343L6.00001 5.18684L3.3066 2.49343C3.08205 2.26887 2.71798 2.26887 2.49343 2.49343C2.26887 2.71798 2.26887 3.08205 2.49343 3.3066L5.18684 6.00001L2.49343 8.69343C2.26887 8.91798 2.26887 9.28205 2.49343 9.5066C2.71798 9.73115 3.08205 9.73115 3.3066 9.5066L6.00001 6.81318L8.69343 9.5066C8.91798 9.73115 9.28205 9.73115 9.5066 9.5066C9.73115 9.28205 9.73115 8.91798 9.5066 8.69343L6.81318 6.00001L9.5066 3.3066Z", fill: "currentColor" }) }) })) : trailingIcon ? (jsxRuntimeExports.jsx("span", { className: styles["trailing-icon"], "aria-hidden": "true", role: "presentation", children: trailingIcon })) : null] }));
|
|
31
|
+
return (jsxRuntimeExports.jsxs("span", { className: chip({ variant, size, color, className }), role: role, "aria-label": ariaLabel || (typeof children === "string" ? children : undefined), onClick: onClick, "data-state": dataState, children: [leadingIcon && (jsxRuntimeExports.jsx("span", { className: styles["leading-icon"], "aria-hidden": "true", role: "presentation", children: leadingIcon })), children, isDismissible ? (jsxRuntimeExports.jsx("button", { onClick: handleDismiss, className: styles["dismiss-button"], "aria-label": `Remove ${typeof children === "string" ? children : "item"}`, type: "button", children: jsxRuntimeExports.jsx("svg", { width: "12", height: "12", viewBox: "0 0 12 12", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", role: "presentation", children: jsxRuntimeExports.jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M9.5066 3.3066C9.73115 3.08205 9.73115 2.71798 9.5066 2.49343C9.28205 2.26887 8.91798 2.26887 8.69343 2.49343L6.00001 5.18684L3.3066 2.49343C3.08205 2.26887 2.71798 2.26887 2.49343 2.49343C2.26887 2.71798 2.26887 3.08205 2.49343 3.3066L5.18684 6.00001L2.49343 8.69343C2.26887 8.91798 2.26887 9.28205 2.49343 9.5066C2.71798 9.73115 3.08205 9.73115 3.3066 9.5066L6.00001 6.81318L8.69343 9.5066C8.91798 9.73115 9.28205 9.73115 9.5066 9.5066C9.73115 9.28205 9.73115 8.91798 9.5066 8.69343L6.81318 6.00001L9.5066 3.3066Z", fill: "currentColor" }) }) })) : trailingIcon ? (jsxRuntimeExports.jsx("span", { className: styles["trailing-icon"], "aria-hidden": "true", role: "presentation", children: trailingIcon })) : null] }));
|
|
32
32
|
};
|
|
33
33
|
Chip.displayName = "Chip";
|
|
34
34
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chip.js","sources":["../../../../v1/components/chip/chip.tsx"],"sourcesContent":["import { cva, type VariantProps } from \"class-variance-authority\";\nimport { ReactNode } from \"react\";\n\nimport styles from \"./chip.module.css\";\n\nconst chip = cva(styles.chip, {\n variants: {\n variant: {\n outline: styles[\"chip-variant-outline\"],\n filled: styles[\"chip-variant-filled\"],\n },\n size: {\n large: styles[\"chip-size-large\"],\n small: styles[\"chip-size-small\"],\n },\n color: {\n neutral: styles[\"chip-color-neutral\"],\n accent: styles[\"chip-color-accent\"],\n },\n },\n defaultVariants: {\n variant: \"outline\",\n size: \"small\",\n color: \"neutral\",\n },\n});\n\ntype ChipProps = VariantProps<typeof chip> & {\n trailingIcon?: ReactNode;\n leadingIcon?: ReactNode;\n isDismissible?: boolean;\n children: ReactNode;\n className?: string;\n onDismiss?: () => void;\n onClick?: () => void;\n role?: string;\n ariaLabel?: string;\n};\n\nexport const Chip = ({\n variant,\n size,\n color,\n trailingIcon,\n leadingIcon,\n isDismissible,\n children,\n className,\n onDismiss,\n onClick,\n role = \"status\",\n ariaLabel,\n}: ChipProps) => {\n const handleDismiss = (e: React.MouseEvent) => {\n e.stopPropagation();\n onDismiss?.();\n };\n\n return (\n <span\n className={chip({ variant, size, color, className })}\n role={role}\n aria-label={\n ariaLabel || (typeof children === \"string\" ? children : undefined)\n }\n onClick={onClick}\n >\n {leadingIcon && (\n <span\n className={styles[\"leading-icon\"]}\n aria-hidden=\"true\"\n role=\"presentation\"\n >\n {leadingIcon}\n </span>\n )}\n {children}\n {isDismissible ? (\n <button\n onClick={handleDismiss}\n className={styles[\"dismiss-button\"]}\n aria-label={`Remove ${\n typeof children === \"string\" ? children : \"item\"\n }`}\n type=\"button\"\n >\n <svg\n width=\"12\"\n height=\"12\"\n viewBox=\"0 0 12 12\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n aria-hidden=\"true\"\n role=\"presentation\"\n >\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M9.5066 3.3066C9.73115 3.08205 9.73115 2.71798 9.5066 2.49343C9.28205 2.26887 8.91798 2.26887 8.69343 2.49343L6.00001 5.18684L3.3066 2.49343C3.08205 2.26887 2.71798 2.26887 2.49343 2.49343C2.26887 2.71798 2.26887 3.08205 2.49343 3.3066L5.18684 6.00001L2.49343 8.69343C2.26887 8.91798 2.26887 9.28205 2.49343 9.5066C2.71798 9.73115 3.08205 9.73115 3.3066 9.5066L6.00001 6.81318L8.69343 9.5066C8.91798 9.73115 9.28205 9.73115 9.5066 9.5066C9.73115 9.28205 9.73115 8.91798 9.5066 8.69343L6.81318 6.00001L9.5066 3.3066Z\"\n fill=\"currentColor\"\n />\n </svg>\n </button>\n ) : trailingIcon ? (\n <span\n className={styles[\"trailing-icon\"]}\n aria-hidden=\"true\"\n role=\"presentation\"\n >\n {trailingIcon}\n </span>\n ) : null}\n </span>\n );\n};\n\nChip.displayName = \"Chip\";\n"],"names":["_jsxs","_jsx"],"mappings":";;;;AAKA,MAAM,IAAI,GAAG,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE;AAC5B,IAAA,QAAQ,EAAE;AACR,QAAA,OAAO,EAAE;AACP,YAAA,OAAO,EAAE,MAAM,CAAC,sBAAsB,CAAC;AACvC,YAAA,MAAM,EAAE,MAAM,CAAC,qBAAqB,CAAC;AACtC,SAAA;AACD,QAAA,IAAI,EAAE;AACJ,YAAA,KAAK,EAAE,MAAM,CAAC,iBAAiB,CAAC;AAChC,YAAA,KAAK,EAAE,MAAM,CAAC,iBAAiB,CAAC;AACjC,SAAA;AACD,QAAA,KAAK,EAAE;AACL,YAAA,OAAO,EAAE,MAAM,CAAC,oBAAoB,CAAC;AACrC,YAAA,MAAM,EAAE,MAAM,CAAC,mBAAmB,CAAC;AACpC,SAAA;AACF,KAAA;AACD,IAAA,eAAe,EAAE;AACf,QAAA,OAAO,EAAE,SAAS;AAClB,QAAA,IAAI,EAAE,OAAO;AACb,QAAA,KAAK,EAAE,SAAS;AACjB,KAAA;AACF,CAAA,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"chip.js","sources":["../../../../v1/components/chip/chip.tsx"],"sourcesContent":["import { cva, type VariantProps } from \"class-variance-authority\";\nimport { ReactNode } from \"react\";\n\nimport styles from \"./chip.module.css\";\n\nconst chip = cva(styles.chip, {\n variants: {\n variant: {\n outline: styles[\"chip-variant-outline\"],\n filled: styles[\"chip-variant-filled\"],\n },\n size: {\n large: styles[\"chip-size-large\"],\n small: styles[\"chip-size-small\"],\n },\n color: {\n neutral: styles[\"chip-color-neutral\"],\n accent: styles[\"chip-color-accent\"],\n },\n },\n defaultVariants: {\n variant: \"outline\",\n size: \"small\",\n color: \"neutral\",\n },\n});\n\ntype ChipProps = VariantProps<typeof chip> & {\n trailingIcon?: ReactNode;\n leadingIcon?: ReactNode;\n isDismissible?: boolean;\n children: ReactNode;\n className?: string;\n onDismiss?: () => void;\n onClick?: () => void;\n role?: string;\n ariaLabel?: string;\n \"data-state\"?: string;\n};\n\nexport const Chip = ({\n variant,\n size,\n color,\n trailingIcon,\n leadingIcon,\n isDismissible,\n children,\n className,\n onDismiss,\n onClick,\n role = \"status\",\n ariaLabel,\n \"data-state\": dataState,\n}: ChipProps) => {\n const handleDismiss = (e: React.MouseEvent) => {\n e.stopPropagation();\n onDismiss?.();\n };\n\n return (\n <span\n className={chip({ variant, size, color, className })}\n role={role}\n aria-label={\n ariaLabel || (typeof children === \"string\" ? children : undefined)\n }\n onClick={onClick}\n data-state={dataState}\n >\n {leadingIcon && (\n <span\n className={styles[\"leading-icon\"]}\n aria-hidden=\"true\"\n role=\"presentation\"\n >\n {leadingIcon}\n </span>\n )}\n {children}\n {isDismissible ? (\n <button\n onClick={handleDismiss}\n className={styles[\"dismiss-button\"]}\n aria-label={`Remove ${\n typeof children === \"string\" ? children : \"item\"\n }`}\n type=\"button\"\n >\n <svg\n width=\"12\"\n height=\"12\"\n viewBox=\"0 0 12 12\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n aria-hidden=\"true\"\n role=\"presentation\"\n >\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M9.5066 3.3066C9.73115 3.08205 9.73115 2.71798 9.5066 2.49343C9.28205 2.26887 8.91798 2.26887 8.69343 2.49343L6.00001 5.18684L3.3066 2.49343C3.08205 2.26887 2.71798 2.26887 2.49343 2.49343C2.26887 2.71798 2.26887 3.08205 2.49343 3.3066L5.18684 6.00001L2.49343 8.69343C2.26887 8.91798 2.26887 9.28205 2.49343 9.5066C2.71798 9.73115 3.08205 9.73115 3.3066 9.5066L6.00001 6.81318L8.69343 9.5066C8.91798 9.73115 9.28205 9.73115 9.5066 9.5066C9.73115 9.28205 9.73115 8.91798 9.5066 8.69343L6.81318 6.00001L9.5066 3.3066Z\"\n fill=\"currentColor\"\n />\n </svg>\n </button>\n ) : trailingIcon ? (\n <span\n className={styles[\"trailing-icon\"]}\n aria-hidden=\"true\"\n role=\"presentation\"\n >\n {trailingIcon}\n </span>\n ) : null}\n </span>\n );\n};\n\nChip.displayName = \"Chip\";\n"],"names":["_jsxs","_jsx"],"mappings":";;;;AAKA,MAAM,IAAI,GAAG,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE;AAC5B,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,KACVC,qBACE,CAAA,MAAA,EAAA,EAAA,SAAS,EAAE,MAAM,CAAC,cAAc,CAAC,EAAA,aAAA,EACrB,MAAM,EAClB,IAAI,EAAC,cAAc,EAAA,QAAA,EAElB,WAAW,EACP,CAAA,CACR,EACA,QAAQ,EACR,aAAa,IACZA,kCACE,OAAO,EAAE,aAAa,EACtB,SAAS,EAAE,MAAM,CAAC,gBAAgB,CAAC,EAAA,YAAA,EACvB,UACV,OAAO,QAAQ,KAAK,QAAQ,GAAG,QAAQ,GAAG,MAC5C,CAAA,CAAE,EACF,IAAI,EAAC,QAAQ,EAEb,QAAA,EAAAA,qBAAA,CAAA,KAAA,EAAA,EACE,KAAK,EAAC,IAAI,EACV,MAAM,EAAC,IAAI,EACX,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,MAAM,EACX,KAAK,EAAC,4BAA4B,EAAA,aAAA,EACtB,MAAM,EAClB,IAAI,EAAC,cAAc,EAAA,QAAA,EAEnBA,gCACE,QAAQ,EAAC,SAAS,EAClB,QAAQ,EAAC,SAAS,EAClB,CAAC,EAAC,qgBAAqgB,EACvgB,IAAI,EAAC,cAAc,EAAA,CACnB,GACE,EACC,CAAA,IACP,YAAY,IACdA,qBAAA,CAAA,MAAA,EAAA,EACE,SAAS,EAAE,MAAM,CAAC,eAAe,CAAC,iBACtB,MAAM,EAClB,IAAI,EAAC,cAAc,YAElB,YAAY,EAAA,CACR,IACL,IAAI,CAAA,EAAA,CACH,EACP;AACJ,EAAE;AAEF,IAAI,CAAC,WAAW,GAAG,MAAM;;;;"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var jsxRuntime = require('../../../node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.cjs');
|
|
4
|
+
var React = require('react');
|
|
4
5
|
var search = require('../../search/search.cjs');
|
|
5
6
|
var useDataTable = require('../hooks/useDataTable.cjs');
|
|
6
7
|
|
|
7
|
-
|
|
8
|
+
const TableSearch = React.forwardRef(({ ...props }, ref) => {
|
|
8
9
|
const { updateTableQuery, tableQuery } = useDataTable.useDataTable();
|
|
9
10
|
const handleSearch = (e) => {
|
|
10
11
|
const value = e.target.value;
|
|
@@ -23,8 +24,8 @@ function TableSearch({ ...props }) {
|
|
|
23
24
|
};
|
|
24
25
|
});
|
|
25
26
|
};
|
|
26
|
-
return (jsxRuntime.jsxRuntimeExports.jsx(search.Search, { ...props, onChange: handleSearch, value: tableQuery?.search, onClear: handleClear }));
|
|
27
|
-
}
|
|
27
|
+
return (jsxRuntime.jsxRuntimeExports.jsx(search.Search, { ...props, ref: ref, onChange: handleSearch, value: tableQuery?.search, onClear: handleClear }));
|
|
28
|
+
});
|
|
28
29
|
|
|
29
30
|
exports.TableSearch = TableSearch;
|
|
30
31
|
//# sourceMappingURL=search.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search.cjs","sources":["../../../../../v1/components/data-table/components/search.tsx"],"sourcesContent":["import { Search } from \"../../search\";\nimport { SearchProps } from \"../../search/search\";\nimport { useDataTable } from \"../hooks/useDataTable\";\n\nexport
|
|
1
|
+
{"version":3,"file":"search.cjs","sources":["../../../../../v1/components/data-table/components/search.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport { Search } from \"../../search\";\nimport { SearchProps } from \"../../search/search\";\nimport { useDataTable } from \"../hooks/useDataTable\";\n\nexport const TableSearch = forwardRef<HTMLInputElement, SearchProps>(\n ({ ...props }, ref) => {\n const { updateTableQuery, tableQuery } = useDataTable();\n\n const handleSearch = (e: React.ChangeEvent<HTMLInputElement>) => {\n const value = e.target.value;\n updateTableQuery((query) => {\n return {\n ...query,\n search: value,\n };\n });\n };\n\n const handleClear = () => {\n updateTableQuery((query) => {\n return {\n ...query,\n search: \"\",\n };\n });\n };\n\n return (\n <Search\n {...props}\n ref={ref}\n onChange={handleSearch}\n value={tableQuery?.search}\n onClear={handleClear}\n />\n );\n }\n);\n"],"names":["forwardRef","useDataTable","_jsx","Search"],"mappings":";;;;;;;AAKO,MAAM,WAAW,GAAGA,gBAAU,CACnC,CAAC,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,KAAI;IACpB,MAAM,EAAE,gBAAgB,EAAE,UAAU,EAAE,GAAGC,yBAAY,EAAE,CAAC;AAExD,IAAA,MAAM,YAAY,GAAG,CAAC,CAAsC,KAAI;AAC9D,QAAA,MAAM,KAAK,GAAG,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;AAC7B,QAAA,gBAAgB,CAAC,CAAC,KAAK,KAAI;YACzB,OAAO;AACL,gBAAA,GAAG,KAAK;AACR,gBAAA,MAAM,EAAE,KAAK;aACd,CAAC;AACJ,SAAC,CAAC,CAAC;AACL,KAAC,CAAC;IAEF,MAAM,WAAW,GAAG,MAAK;AACvB,QAAA,gBAAgB,CAAC,CAAC,KAAK,KAAI;YACzB,OAAO;AACL,gBAAA,GAAG,KAAK;AACR,gBAAA,MAAM,EAAE,EAAE;aACX,CAAC;AACJ,SAAC,CAAC,CAAC;AACL,KAAC,CAAC;IAEF,QACEC,gCAAC,CAAAC,aAAM,EACD,EAAA,GAAA,KAAK,EACT,GAAG,EAAE,GAAG,EACR,QAAQ,EAAE,YAAY,EACtB,KAAK,EAAE,UAAU,EAAE,MAAM,EACzB,OAAO,EAAE,WAAW,EACpB,CAAA,EACF;AACJ,CAAC;;;;"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { SearchProps } from "../../search/search";
|
|
2
|
-
export declare
|
|
2
|
+
export declare const TableSearch: import("react").ForwardRefExoticComponent<Omit<SearchProps, "ref"> & import("react").RefAttributes<HTMLInputElement>>;
|
|
3
3
|
//# sourceMappingURL=search.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../../../../v1/components/data-table/components/search.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../../../../v1/components/data-table/components/search.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAGlD,eAAO,MAAM,WAAW,uHAiCvB,CAAC"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { j as jsxRuntimeExports } from '../../../node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.js';
|
|
2
|
+
import { forwardRef } from 'react';
|
|
2
3
|
import { Search } from '../../search/search.js';
|
|
3
4
|
import { useDataTable } from '../hooks/useDataTable.js';
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
const TableSearch = forwardRef(({ ...props }, ref) => {
|
|
6
7
|
const { updateTableQuery, tableQuery } = useDataTable();
|
|
7
8
|
const handleSearch = (e) => {
|
|
8
9
|
const value = e.target.value;
|
|
@@ -21,8 +22,8 @@ function TableSearch({ ...props }) {
|
|
|
21
22
|
};
|
|
22
23
|
});
|
|
23
24
|
};
|
|
24
|
-
return (jsxRuntimeExports.jsx(Search, { ...props, onChange: handleSearch, value: tableQuery?.search, onClear: handleClear }));
|
|
25
|
-
}
|
|
25
|
+
return (jsxRuntimeExports.jsx(Search, { ...props, ref: ref, onChange: handleSearch, value: tableQuery?.search, onClear: handleClear }));
|
|
26
|
+
});
|
|
26
27
|
|
|
27
28
|
export { TableSearch };
|
|
28
29
|
//# sourceMappingURL=search.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search.js","sources":["../../../../../v1/components/data-table/components/search.tsx"],"sourcesContent":["import { Search } from \"../../search\";\nimport { SearchProps } from \"../../search/search\";\nimport { useDataTable } from \"../hooks/useDataTable\";\n\nexport
|
|
1
|
+
{"version":3,"file":"search.js","sources":["../../../../../v1/components/data-table/components/search.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport { Search } from \"../../search\";\nimport { SearchProps } from \"../../search/search\";\nimport { useDataTable } from \"../hooks/useDataTable\";\n\nexport const TableSearch = forwardRef<HTMLInputElement, SearchProps>(\n ({ ...props }, ref) => {\n const { updateTableQuery, tableQuery } = useDataTable();\n\n const handleSearch = (e: React.ChangeEvent<HTMLInputElement>) => {\n const value = e.target.value;\n updateTableQuery((query) => {\n return {\n ...query,\n search: value,\n };\n });\n };\n\n const handleClear = () => {\n updateTableQuery((query) => {\n return {\n ...query,\n search: \"\",\n };\n });\n };\n\n return (\n <Search\n {...props}\n ref={ref}\n onChange={handleSearch}\n value={tableQuery?.search}\n onClear={handleClear}\n />\n );\n }\n);\n"],"names":["_jsx"],"mappings":";;;;;AAKO,MAAM,WAAW,GAAG,UAAU,CACnC,CAAC,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,KAAI;IACpB,MAAM,EAAE,gBAAgB,EAAE,UAAU,EAAE,GAAG,YAAY,EAAE,CAAC;AAExD,IAAA,MAAM,YAAY,GAAG,CAAC,CAAsC,KAAI;AAC9D,QAAA,MAAM,KAAK,GAAG,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;AAC7B,QAAA,gBAAgB,CAAC,CAAC,KAAK,KAAI;YACzB,OAAO;AACL,gBAAA,GAAG,KAAK;AACR,gBAAA,MAAM,EAAE,KAAK;aACd,CAAC;AACJ,SAAC,CAAC,CAAC;AACL,KAAC,CAAC;IAEF,MAAM,WAAW,GAAG,MAAK;AACvB,QAAA,gBAAgB,CAAC,CAAC,KAAK,KAAI;YACzB,OAAO;AACL,gBAAA,GAAG,KAAK;AACR,gBAAA,MAAM,EAAE,EAAE;aACX,CAAC;AACJ,SAAC,CAAC,CAAC;AACL,KAAC,CAAC;IAEF,QACEA,qBAAC,CAAA,MAAM,EACD,EAAA,GAAA,KAAK,EACT,GAAG,EAAE,GAAG,EACR,QAAQ,EAAE,YAAY,EACtB,KAAK,EAAE,UAAU,EAAE,MAAM,EACzB,OAAO,EAAE,WAAW,EACpB,CAAA,EACF;AACJ,CAAC;;;;"}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { DataTableProps } from "./data-table.types";
|
|
2
2
|
import { Content } from "./components/content";
|
|
3
3
|
import { Toolbar } from "./components/toolbar";
|
|
4
|
-
import { TableSearch } from "./components/search";
|
|
5
4
|
declare function DataTableRoot<TData, TValue>({ data, columns, query, mode, isLoading, loadingRowCount, defaultSort, children, onTableQueryChange, onLoadMore, onRowClick, }: React.PropsWithChildren<DataTableProps<TData, TValue>>): import("react/jsx-runtime").JSX.Element;
|
|
6
5
|
export declare const DataTable: typeof DataTableRoot & {
|
|
7
6
|
Content: typeof Content;
|
|
8
7
|
Toolbar: typeof Toolbar;
|
|
9
|
-
Search:
|
|
8
|
+
Search: import("react").ForwardRefExoticComponent<Omit<import("../search/search").SearchProps, "ref"> & import("react").RefAttributes<HTMLInputElement>>;
|
|
10
9
|
};
|
|
11
10
|
export {};
|
|
12
11
|
//# sourceMappingURL=data-table.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-table.d.ts","sourceRoot":"","sources":["../../../../v1/components/data-table/data-table.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,cAAc,EAMf,MAAM,oBAAoB,CAAC;AAkB5B,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"data-table.d.ts","sourceRoot":"","sources":["../../../../v1/components/data-table/data-table.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,cAAc,EAMf,MAAM,oBAAoB,CAAC;AAkB5B,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAG/C,iBAAS,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,EACpC,IAAS,EACT,OAAO,EACP,KAAK,EACL,IAAe,EACf,SAAiB,EACjB,eAAmB,EACnB,WAAW,EACX,QAAQ,EACR,kBAAkB,EAClB,UAAU,EACV,UAAU,GACX,EAAE,KAAK,CAAC,iBAAiB,CAAC,cAAc,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,2CAmGxD;AAED,eAAO,MAAM,SAAS;;;;CAIpB,CAAC"}
|
|
@@ -15,8 +15,8 @@ DialogContent.displayName = index.Content.displayName;
|
|
|
15
15
|
const DialogHeader = ({ children, className, }) => (jsxRuntime.jsxRuntimeExports.jsx(flex.Flex, { justify: "between", align: "center", className: clsx.clsx(dialog_module.default.header, className), children: children }));
|
|
16
16
|
const DialogFooter = ({ children, className, }) => (jsxRuntime.jsxRuntimeExports.jsx(flex.Flex, { gap: 5, justify: "end", className: clsx.clsx(dialog_module.default.footer, className), children: children }));
|
|
17
17
|
const DialogBody = ({ children, className, }) => (jsxRuntime.jsxRuntimeExports.jsx(flex.Flex, { direction: "column", gap: 3, className: clsx.clsx(dialog_module.default.body, className), children: children }));
|
|
18
|
-
function CloseButton({
|
|
19
|
-
return (jsxRuntime.jsxRuntimeExports.jsx(index.Close, { className: clsx.clsx(dialog_module.default.close, className), "aria-label": "Close dialog", ...props, children:
|
|
18
|
+
function CloseButton({ className, ...props }) {
|
|
19
|
+
return (jsxRuntime.jsxRuntimeExports.jsx(index.Close, { className: clsx.clsx(dialog_module.default.close, className), "aria-label": "Close dialog", ...props, children: jsxRuntime.jsxRuntimeExports.jsx(reactIcons_esm.Cross1Icon, {}) }));
|
|
20
20
|
}
|
|
21
21
|
function DialogTitle({ children, className, ...props }) {
|
|
22
22
|
return (jsxRuntime.jsxRuntimeExports.jsx(index.Title, { ...props, role: "heading", "aria-level": 1, className: clsx.clsx(dialog_module.default.title, className), children: children }));
|
|
@@ -30,7 +30,8 @@ const Dialog = Object.assign(index.Root, {
|
|
|
30
30
|
Header: DialogHeader,
|
|
31
31
|
Footer: DialogFooter,
|
|
32
32
|
Body: DialogBody,
|
|
33
|
-
Close:
|
|
33
|
+
Close: index.Close,
|
|
34
|
+
CloseButton: CloseButton,
|
|
34
35
|
Title: DialogTitle,
|
|
35
36
|
Description: DialogDescription,
|
|
36
37
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog.cjs","sources":["../../../../v1/components/dialog/dialog.tsx"],"sourcesContent":["import * as DialogPrimitive from \"@radix-ui/react-dialog\";\nimport { Cross1Icon } from \"@radix-ui/react-icons\";\nimport { cva, VariantProps } from \"class-variance-authority\";\nimport { clsx } from \"clsx\";\nimport {\n ComponentProps,\n ComponentPropsWithoutRef,\n ElementRef,\n forwardRef,\n} from \"react\";\nimport { Flex } from \"../flex\";\n\nimport styles from \"./dialog.module.css\";\n\nconst dialogContent = cva(styles.dialogContent);\n\nexport interface DialogContentProps\n extends ComponentPropsWithoutRef<typeof DialogPrimitive.Content>,\n VariantProps<typeof dialogContent> {\n ariaLabel?: string;\n ariaDescription?: string;\n overlayBlur?: boolean;\n overlayClassName?: string;\n overlayStyle?: React.CSSProperties;\n width?: string | number;\n}\n\nconst DialogContent = forwardRef<\n ElementRef<typeof DialogPrimitive.Content>,\n DialogContentProps\n>(\n (\n {\n className,\n children,\n ariaLabel,\n ariaDescription,\n overlayBlur = false,\n overlayClassName,\n overlayStyle,\n width,\n ...props\n },\n ref\n ) => (\n <DialogPrimitive.Portal>\n <DialogPrimitive.Overlay\n className={clsx(\n styles.dialogOverlay,\n overlayClassName,\n overlayBlur && styles.overlayBlur\n )}\n style={overlayStyle}\n aria-hidden=\"true\"\n role=\"presentation\"\n />\n <DialogPrimitive.Content\n ref={ref}\n className={dialogContent({ className })}\n style={{ width, ...props.style }}\n aria-label={ariaLabel}\n aria-describedby={ariaDescription ? \"dialog-description\" : undefined}\n {...props}\n >\n {children}\n </DialogPrimitive.Content>\n </DialogPrimitive.Portal>\n )\n);\n\nDialogContent.displayName = DialogPrimitive.Content.displayName;\n\nconst DialogHeader = ({\n children,\n className,\n}: {\n children: React.ReactNode;\n className?: string;\n}) => (\n <Flex\n justify={\"between\"}\n align={\"center\"}\n className={clsx(styles.header, className)}\n >\n {children}\n </Flex>\n);\n\nconst DialogFooter = ({\n children,\n className,\n}: {\n children: React.ReactNode;\n className?: string;\n}) => (\n <Flex gap={5} justify=\"end\" className={clsx(styles.footer, className)}>\n {children}\n </Flex>\n);\n\nconst DialogBody = ({\n children,\n className,\n}: {\n children: React.ReactNode;\n className?: string;\n}) => (\n <Flex direction=\"column\" gap={3} className={clsx(styles.body, className)}>\n {children}\n </Flex>\n);\n\ntype CloseButtonProps = ComponentProps<typeof DialogPrimitive.Close>;\nexport function CloseButton({
|
|
1
|
+
{"version":3,"file":"dialog.cjs","sources":["../../../../v1/components/dialog/dialog.tsx"],"sourcesContent":["import * as DialogPrimitive from \"@radix-ui/react-dialog\";\nimport { Cross1Icon } from \"@radix-ui/react-icons\";\nimport { cva, VariantProps } from \"class-variance-authority\";\nimport { clsx } from \"clsx\";\nimport {\n ComponentProps,\n ComponentPropsWithoutRef,\n ElementRef,\n forwardRef,\n} from \"react\";\nimport { Flex } from \"../flex\";\n\nimport styles from \"./dialog.module.css\";\n\nconst dialogContent = cva(styles.dialogContent);\n\nexport interface DialogContentProps\n extends ComponentPropsWithoutRef<typeof DialogPrimitive.Content>,\n VariantProps<typeof dialogContent> {\n ariaLabel?: string;\n ariaDescription?: string;\n overlayBlur?: boolean;\n overlayClassName?: string;\n overlayStyle?: React.CSSProperties;\n width?: string | number;\n}\n\nconst DialogContent = forwardRef<\n ElementRef<typeof DialogPrimitive.Content>,\n DialogContentProps\n>(\n (\n {\n className,\n children,\n ariaLabel,\n ariaDescription,\n overlayBlur = false,\n overlayClassName,\n overlayStyle,\n width,\n ...props\n },\n ref\n ) => (\n <DialogPrimitive.Portal>\n <DialogPrimitive.Overlay\n className={clsx(\n styles.dialogOverlay,\n overlayClassName,\n overlayBlur && styles.overlayBlur\n )}\n style={overlayStyle}\n aria-hidden=\"true\"\n role=\"presentation\"\n />\n <DialogPrimitive.Content\n ref={ref}\n className={dialogContent({ className })}\n style={{ width, ...props.style }}\n aria-label={ariaLabel}\n aria-describedby={ariaDescription ? \"dialog-description\" : undefined}\n {...props}\n >\n {children}\n </DialogPrimitive.Content>\n </DialogPrimitive.Portal>\n )\n);\n\nDialogContent.displayName = DialogPrimitive.Content.displayName;\n\nconst DialogHeader = ({\n children,\n className,\n}: {\n children: React.ReactNode;\n className?: string;\n}) => (\n <Flex\n justify={\"between\"}\n align={\"center\"}\n className={clsx(styles.header, className)}\n >\n {children}\n </Flex>\n);\n\nconst DialogFooter = ({\n children,\n className,\n}: {\n children: React.ReactNode;\n className?: string;\n}) => (\n <Flex gap={5} justify=\"end\" className={clsx(styles.footer, className)}>\n {children}\n </Flex>\n);\n\nconst DialogBody = ({\n children,\n className,\n}: {\n children: React.ReactNode;\n className?: string;\n}) => (\n <Flex direction=\"column\" gap={3} className={clsx(styles.body, className)}>\n {children}\n </Flex>\n);\n\ntype CloseButtonProps = ComponentProps<typeof DialogPrimitive.Close>;\nexport function CloseButton({ className, ...props }: CloseButtonProps) {\n return (\n <DialogPrimitive.Close\n className={clsx(styles.close, className)}\n aria-label=\"Close dialog\"\n {...props}\n >\n <Cross1Icon />\n </DialogPrimitive.Close>\n );\n}\n\ninterface DialogTitleProps\n extends ComponentProps<typeof DialogPrimitive.Title> {\n children: React.ReactNode;\n}\n\nfunction DialogTitle({ children, className, ...props }: DialogTitleProps) {\n return (\n <DialogPrimitive.Title\n {...props}\n role=\"heading\"\n aria-level={1}\n className={clsx(styles.title, className)}\n >\n {children}\n </DialogPrimitive.Title>\n );\n}\n\ninterface DialogDescriptionProps\n extends ComponentProps<typeof DialogPrimitive.Description> {\n children: React.ReactNode;\n className?: string;\n}\n\nfunction DialogDescription({\n children,\n className,\n ...props\n}: DialogDescriptionProps) {\n return (\n <DialogPrimitive.Description\n {...props}\n className={clsx(styles.description, className)}\n id=\"dialog-description\"\n role=\"document\"\n >\n {children}\n </DialogPrimitive.Description>\n );\n}\n\nexport const Dialog = Object.assign(DialogPrimitive.Root, {\n Trigger: DialogPrimitive.Trigger,\n Content: DialogContent,\n Header: DialogHeader,\n Footer: DialogFooter,\n Body: DialogBody,\n Close: DialogPrimitive.Close,\n CloseButton: CloseButton,\n Title: DialogTitle,\n Description: DialogDescription,\n});\n"],"names":["cva","styles","forwardRef","_jsxs","DialogPrimitive.Portal","_jsx","DialogPrimitive.Overlay","clsx","DialogPrimitive.Content","Flex","DialogPrimitive.Close","Cross1Icon","DialogPrimitive.Title","DialogPrimitive.Description","DialogPrimitive.Root","DialogPrimitive.Trigger"],"mappings":";;;;;;;;;;;AAcA,MAAM,aAAa,GAAGA,WAAG,CAACC,qBAAM,CAAC,aAAa,CAAC,CAAC;AAahD,MAAM,aAAa,GAAGC,gBAAU,CAI9B,CACE,EACE,SAAS,EACT,QAAQ,EACR,SAAS,EACT,eAAe,EACf,WAAW,GAAG,KAAK,EACnB,gBAAgB,EAChB,YAAY,EACZ,KAAK,EACL,GAAG,KAAK,EACT,EACD,GAAG,MAEHC,iCAAC,CAAAC,YAAsB,EACrB,EAAA,QAAA,EAAA,CAAAC,gCAAA,CAACC,aAAuB,EAAA,EACtB,SAAS,EAAEC,SAAI,CACbN,qBAAM,CAAC,aAAa,EACpB,gBAAgB,EAChB,WAAW,IAAIA,qBAAM,CAAC,WAAW,CAClC,EACD,KAAK,EAAE,YAAY,EAAA,aAAA,EACP,MAAM,EAClB,IAAI,EAAC,cAAc,EAAA,CACnB,EACFI,gCAAA,CAACG,aAAuB,EAAA,EACtB,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,aAAa,CAAC,EAAE,SAAS,EAAE,CAAC,EACvC,KAAK,EAAE,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC,KAAK,EAAE,EACpB,YAAA,EAAA,SAAS,EACH,kBAAA,EAAA,eAAe,GAAG,oBAAoB,GAAG,SAAS,EAChE,GAAA,KAAK,EAER,QAAA,EAAA,QAAQ,EACe,CAAA,CAAA,EAAA,CACH,CAC1B,CACF,CAAC;AAEF,aAAa,CAAC,WAAW,GAAGA,aAAuB,CAAC,WAAW,CAAC;AAEhE,MAAM,YAAY,GAAG,CAAC,EACpB,QAAQ,EAC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AAE,SAAS,CAAC,EAEvC,QAAA,EAAA,QAAQ,EACa,CAAA,EACxB;AACJ,CAAC;AAQD,SAAS,iBAAiB,CAAC,EACzB,QAAQ,EACR,SAAS,EACT,GAAG,KAAK,EACe,EAAA;AACvB,IAAA,QACEI,gCAAA,CAACQ,iBAA2B,EAAA,EAAA,GACtB,KAAK,EACT,SAAS,EAAEN,SAAI,CAACN,qBAAM,CAAC,WAAW,EAAE,SAAS,CAAC,EAC9C,EAAE,EAAC,oBAAoB,EACvB,IAAI,EAAC,UAAU,EAAA,QAAA,EAEd,QAAQ,EAAA,CACmB,EAC9B;AACJ,CAAC;AAEY,MAAA,MAAM,GAAG,MAAM,CAAC,MAAM,CAACa,UAAoB,EAAE;IACxD,OAAO,EAAEC,aAAuB;AAChC,IAAA,OAAO,EAAE,aAAa;AACtB,IAAA,MAAM,EAAE,YAAY;AACpB,IAAA,MAAM,EAAE,YAAY;AACpB,IAAA,IAAI,EAAE,UAAU;IAChB,KAAK,EAAEL,WAAqB;AAC5B,IAAA,WAAW,EAAE,WAAW;AACxB,IAAA,KAAK,EAAE,WAAW;AAClB,IAAA,WAAW,EAAE,iBAAiB;AAC/B,CAAA;;;;;"}
|
|
@@ -11,7 +11,7 @@ export interface DialogContentProps extends ComponentPropsWithoutRef<typeof Dial
|
|
|
11
11
|
width?: string | number;
|
|
12
12
|
}
|
|
13
13
|
type CloseButtonProps = ComponentProps<typeof DialogPrimitive.Close>;
|
|
14
|
-
export declare function CloseButton({
|
|
14
|
+
export declare function CloseButton({ className, ...props }: CloseButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
15
15
|
interface DialogTitleProps extends ComponentProps<typeof DialogPrimitive.Title> {
|
|
16
16
|
children: React.ReactNode;
|
|
17
17
|
}
|
|
@@ -36,7 +36,8 @@ export declare const Dialog: import("react").FC<DialogPrimitive.DialogProps> & {
|
|
|
36
36
|
children: React.ReactNode;
|
|
37
37
|
className?: string | undefined;
|
|
38
38
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
39
|
-
Close:
|
|
39
|
+
Close: import("react").ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
40
|
+
CloseButton: typeof CloseButton;
|
|
40
41
|
Title: typeof DialogTitle;
|
|
41
42
|
Description: typeof DialogDescription;
|
|
42
43
|
};
|