@cognite/aura 0.3.2 → 0.3.4
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/DESIGN.md +134 -5
- package/README.md +24 -3
- package/dist/components/index.d.ts +5 -1
- package/dist/components/index.js +59 -327
- package/dist/components/ui/core/accordion/accordion.js +79 -114
- package/dist/components/ui/core/action-toolbar/action-toolbar.js +108 -176
- package/dist/components/ui/core/alert/alert.js +158 -206
- package/dist/components/ui/core/avatar/avatar.js +64 -90
- package/dist/components/ui/core/badge/badge.js +73 -108
- package/dist/components/ui/core/banner/banner.js +146 -215
- package/dist/components/ui/core/breadcrumb/breadcrumb.js +105 -200
- package/dist/components/ui/core/button/button.js +47 -52
- package/dist/components/ui/core/button-group/button-group.js +40 -79
- package/dist/components/ui/core/calendar/calendar-header.js +63 -0
- package/dist/components/ui/core/calendar/calendar-utils.js +39 -0
- package/dist/components/ui/core/calendar/calendar.js +68 -0
- package/dist/components/ui/core/calendar/constants.d.ts +1 -0
- package/dist/components/ui/core/card/card.js +102 -185
- package/dist/components/ui/core/chart/chart.js +116 -206
- package/dist/components/ui/core/chart/index.js +2 -8
- package/dist/components/ui/core/checkbox/checkbox.js +67 -132
- package/dist/components/ui/core/checkbox/checkbox.metadata.js +7 -7
- package/dist/components/ui/core/code-block/code-block.d.ts +1 -1
- package/dist/components/ui/core/code-block/code-block.js +179 -267
- package/dist/components/ui/core/collapsible/collapsible.js +29 -49
- package/dist/components/ui/core/combobox/combobox.js +41 -0
- package/dist/components/ui/core/command/command.js +85 -150
- package/dist/components/ui/core/count/count.js +21 -32
- package/dist/components/ui/core/data-grid/data-grid-cell.d.ts +10 -0
- package/dist/components/ui/core/data-grid/data-grid-header-row.d.ts +13 -0
- package/dist/components/ui/core/data-grid/data-grid-row.d.ts +18 -0
- package/dist/components/ui/core/data-grid/data-grid.d.ts +43 -0
- package/dist/components/ui/core/data-grid/data-grid.fixtures.d.ts +12 -0
- package/dist/components/ui/core/data-grid/data-grid.utils.d.ts +9 -0
- package/dist/components/ui/core/date-time-pickers/date-picker/date-picker.js +60 -72
- package/dist/components/ui/core/date-time-pickers/date-picker/types.d.ts +2 -1
- package/dist/components/ui/core/date-time-pickers/date-picker/use-date-picker.js +36 -51
- package/dist/components/ui/core/date-time-pickers/date-range-picker/date-range-picker.js +63 -87
- package/dist/components/ui/core/date-time-pickers/date-range-picker/types.d.ts +2 -1
- package/dist/components/ui/core/date-time-pickers/date-range-picker/use-date-range-picker.js +60 -68
- package/dist/components/ui/core/date-time-pickers/date-time-picker/index.d.ts +1 -0
- package/dist/components/ui/core/date-time-pickers/date-time-picker/types.d.ts +36 -0
- package/dist/components/ui/core/date-time-pickers/date-time-picker/use-date-time-picker.d.ts +3 -0
- package/dist/components/ui/core/date-time-pickers/date-time-range-picker/date-time-range-picker.js +118 -174
- package/dist/components/ui/core/date-time-pickers/date-time-range-picker/types.d.ts +7 -6
- package/dist/components/ui/core/date-time-pickers/date-time-range-picker/use-date-time-range-picker.js +104 -145
- package/dist/components/ui/core/date-time-pickers/index.d.ts +3 -1
- package/dist/components/ui/core/date-time-pickers/index.js +6 -10
- package/dist/components/ui/core/date-time-pickers/shared/am-pm-scroll/am-pm-scroll.d.ts +3 -2
- package/dist/components/ui/core/date-time-pickers/shared/am-pm-scroll/am-pm-scroll.js +42 -56
- package/dist/components/ui/core/date-time-pickers/shared/constants.d.ts +3 -8
- package/dist/components/ui/core/date-time-pickers/shared/date-time-input/date-time-input.js +64 -98
- package/dist/components/ui/core/date-time-pickers/shared/date-time-input/range-input-display.js +38 -67
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-popover-state.js +23 -23
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-range-date-state.js +52 -62
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-range-step-manager.js +18 -18
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-single-date-state.js +24 -31
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-time-state.d.ts +3 -3
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-time-state.js +24 -33
- package/dist/components/ui/core/date-time-pickers/shared/scroll-cell-classes.js +4 -7
- package/dist/components/ui/core/date-time-pickers/shared/shortcuts-panel/shortcuts-panel.d.ts +3 -2
- package/dist/components/ui/core/date-time-pickers/shared/shortcuts-panel/shortcuts-panel.js +17 -31
- package/dist/components/ui/core/date-time-pickers/shared/time-picker-panel/time-picker-panel.d.ts +3 -2
- package/dist/components/ui/core/date-time-pickers/shared/time-picker-panel/time-picker-panel.js +40 -40
- package/dist/components/ui/core/date-time-pickers/shared/time-picker-scroll/time-picker-scroll.js +33 -50
- package/dist/components/ui/core/date-time-pickers/time-picker/time-picker.js +78 -99
- package/dist/components/ui/core/date-time-pickers/time-picker/types.d.ts +5 -4
- package/dist/components/ui/core/date-time-pickers/time-picker/use-time-picker.js +41 -63
- package/dist/components/ui/core/date-time-pickers/time-range-picker/index.d.ts +1 -0
- package/dist/components/ui/core/date-time-pickers/time-range-picker/types.d.ts +40 -0
- package/dist/components/ui/core/date-time-pickers/time-range-picker/use-time-range-picker.d.ts +3 -0
- package/dist/components/ui/core/date-time-pickers/utils/format-utils.d.ts +1 -0
- package/dist/components/ui/core/date-time-pickers/utils/time-utils.d.ts +3 -3
- package/dist/components/ui/core/date-time-pickers/utils/time-utils.js +7 -15
- package/dist/components/ui/core/dialog/dialog.js +82 -155
- package/dist/components/ui/core/dropdown-menu/dropdown-menu.d.ts +2 -2
- package/dist/components/ui/core/dropdown-menu/dropdown-menu.js +150 -248
- package/dist/components/ui/core/empty-state/empty-state.context.js +5 -8
- package/dist/components/ui/core/empty-state/empty-state.js +86 -138
- package/dist/components/ui/core/helper-text/helper-text.js +37 -65
- package/dist/components/ui/core/hover-card/hover-card.js +54 -80
- package/dist/components/ui/core/inline-citation/inline-citation.js +98 -181
- package/dist/components/ui/core/input/input.js +12 -27
- package/dist/components/ui/core/input-group/input-group.js +76 -173
- package/dist/components/ui/core/kbd/kbd.js +20 -36
- package/dist/components/ui/core/label/label.js +26 -43
- package/dist/components/ui/core/loader/loader.js +80 -117
- package/dist/components/ui/core/message/message-response-default-streamdown-controls.js +12 -12
- package/dist/components/ui/core/message/message.d.ts +2 -2
- package/dist/components/ui/core/message/message.js +316 -542
- package/dist/components/ui/core/overflow-list/overflow-list.utils.d.ts +52 -0
- package/dist/components/ui/core/pagination/pagination-size-context.js +5 -6
- package/dist/components/ui/core/pagination/pagination-teleport.js +86 -106
- package/dist/components/ui/core/pagination/pagination-teleport.utils.js +6 -6
- package/dist/components/ui/core/pagination/pagination.js +231 -334
- package/dist/components/ui/core/popover/popover.js +90 -157
- package/dist/components/ui/core/progress/progress.js +36 -61
- package/dist/components/ui/core/prompt-input/prompt-input.js +274 -413
- package/dist/components/ui/core/radio-group/radio-group.js +58 -113
- package/dist/components/ui/core/reasoning/reasoning.js +55 -86
- package/dist/components/ui/core/scroll-area/scroll-area.js +41 -71
- package/dist/components/ui/core/search/search.js +77 -99
- package/dist/components/ui/core/segmented-control/segmented-control.js +110 -167
- package/dist/components/ui/core/select/select.js +168 -293
- package/dist/components/ui/core/separator/separator.js +13 -23
- package/dist/components/ui/core/shimmer/shimmer.d.ts +2 -4
- package/dist/components/ui/core/shimmer/shimmer.js +40 -107
- package/dist/components/ui/core/skeleton/skeleton.js +13 -18
- package/dist/components/ui/core/slider/slider.d.ts +9 -0
- package/dist/components/ui/core/slider/slider.js +40 -0
- package/dist/components/ui/core/sonner-toast/sonner-toast.js +54 -47
- package/dist/components/ui/core/sources/sources.d.ts +5 -1
- package/dist/components/ui/core/sources/sources.js +58 -79
- package/dist/components/ui/core/switch/switch.js +62 -0
- package/dist/components/ui/core/tabs/tabs.js +149 -223
- package/dist/components/ui/core/tabs/tabs.utils.js +6 -8
- package/dist/components/ui/core/textarea/textarea.js +13 -27
- package/dist/components/ui/core/toggle/toggle.js +55 -74
- package/dist/components/ui/core/tool/tool.js +127 -163
- package/dist/components/ui/core/tooltip/tooltip.js +47 -86
- package/dist/components/ui/core/topbar/topbar.js +106 -190
- package/dist/eslint/index.js +5 -10
- package/dist/eslint/no-overriding-styles.js +178 -237
- package/dist/icons/index.d.ts +1 -0
- package/dist/icons/index.js +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/lib/highlight-code.d.ts +9 -0
- package/dist/lib/highlight-code.js +42 -0
- package/dist/lib/portal-container-context.js +8 -9
- package/dist/lib/style-scope.js +6 -6
- package/dist/lib/use-controllable-state.js +21 -30
- package/dist/lib/utils.d.ts +0 -2
- package/dist/lib/utils.js +32 -112
- package/dist/styles.css +1 -1
- package/dist/styles.source.css +26 -0
- package/package.json +42 -8
- package/dist/components/ui/core/date-time-pickers/shared/calendar/calendar.js +0 -119
- package/dist/components/ui/core/date-time-pickers/shared/calendar-header/calendar-header.js +0 -93
- package/dist/components/ui/core/date-time-pickers/shared/constants.js +0 -14
- package/dist/components/ui/core/date-time-pickers/utils/calendar-utils.js +0 -52
- /package/dist/components/ui/core/{date-time-pickers/shared/calendar-header → calendar}/calendar-header.d.ts +0 -0
- /package/dist/components/ui/core/{date-time-pickers/utils → calendar}/calendar-utils.d.ts +0 -0
- /package/dist/components/ui/core/{date-time-pickers/shared/calendar → calendar}/calendar.d.ts +0 -0
|
@@ -1,64 +1,42 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}) => {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
hour: y,
|
|
41
|
-
minute: c,
|
|
42
|
-
amPm: O,
|
|
43
|
-
displayValue: U,
|
|
44
|
-
handleOpenChange: (e) => {
|
|
45
|
-
a(), o(e);
|
|
46
|
-
},
|
|
47
|
-
handleApply: () => {
|
|
48
|
-
const e = l(i);
|
|
49
|
-
t(e), o(!1);
|
|
50
|
-
},
|
|
51
|
-
handleHourChange: S,
|
|
52
|
-
handleMinuteChange: k,
|
|
53
|
-
handleAmPmChange: C,
|
|
54
|
-
handleApplyShortcut: (e) => {
|
|
55
|
-
const m = Array.isArray(e) ? e[0] : e;
|
|
56
|
-
t(m ? P(m) : null), o(!1);
|
|
57
|
-
},
|
|
58
|
-
inputRef: A,
|
|
59
|
-
popoverRef: f
|
|
60
|
-
};
|
|
61
|
-
};
|
|
62
|
-
export {
|
|
63
|
-
z as useTimePicker
|
|
1
|
+
import { usePopoverState as e } from "../shared/hooks/use-popover-state.js";
|
|
2
|
+
import { useTimeState as t } from "../shared/hooks/use-time-state.js";
|
|
3
|
+
import { useCallback as n, useEffect as r, useRef as i } from "react";
|
|
4
|
+
import a from "dayjs";
|
|
5
|
+
//#region libs/aura/src/components/ui/core/date-time-pickers/time-picker/use-time-picker.ts
|
|
6
|
+
var o = ({ value: o, onChange: s, timeFormat: c = "24h", defaultDate: l = a() }) => {
|
|
7
|
+
let u = i(() => {}), { isOpen: d, setIsOpen: f, popoverRef: p, inputRef: m } = e({ onBackspace: n(() => u.current(), []) }), { hour: h, minute: g, amPm: _, hour24: v, handleHourChange: y, handleMinuteChange: b, handleAmPmChange: x, resetTime: S } = t({
|
|
8
|
+
initialHour: o?.hour() ?? 9,
|
|
9
|
+
initialMinute: o?.minute() ?? 0,
|
|
10
|
+
timeFormat: c
|
|
11
|
+
}), C = o ?? l, w = (e) => e.hour(v).minute(g).second(0).millisecond(0), T = (e) => C.hour(e.hour()).minute(e.minute()).second(0).millisecond(0), E = d ? w(C) : o, D = () => {
|
|
12
|
+
S(o?.hour() ?? 9, o?.minute() ?? 0);
|
|
13
|
+
}, O = () => {
|
|
14
|
+
o !== null && (s(null), D());
|
|
15
|
+
};
|
|
16
|
+
return r(() => {
|
|
17
|
+
u.current = O;
|
|
18
|
+
}), {
|
|
19
|
+
isOpen: d,
|
|
20
|
+
hour: h,
|
|
21
|
+
minute: g,
|
|
22
|
+
amPm: _,
|
|
23
|
+
displayValue: E,
|
|
24
|
+
handleOpenChange: (e) => {
|
|
25
|
+
D(), f(e);
|
|
26
|
+
},
|
|
27
|
+
handleApply: () => {
|
|
28
|
+
s(w(C)), f(!1);
|
|
29
|
+
},
|
|
30
|
+
handleHourChange: y,
|
|
31
|
+
handleMinuteChange: b,
|
|
32
|
+
handleAmPmChange: x,
|
|
33
|
+
handleApplyShortcut: (e) => {
|
|
34
|
+
let t = Array.isArray(e) ? e[0] : e;
|
|
35
|
+
s(t ? T(t) : null), f(!1);
|
|
36
|
+
},
|
|
37
|
+
inputRef: m,
|
|
38
|
+
popoverRef: p
|
|
39
|
+
};
|
|
64
40
|
};
|
|
41
|
+
//#endregion
|
|
42
|
+
export { o as useTimePicker };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { TimeRangePickerProps, UseTimeRangePickerProps, UseTimeRangePickerReturn, } from './types';
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Dayjs } from 'dayjs';
|
|
2
|
+
import { RangeSelectionStep } from '../shared/hooks/use-range-step-manager';
|
|
3
|
+
import { ShortcutItem, ShortcutValueDayjs } from '../shared/shortcuts-panel/shortcuts-panel';
|
|
4
|
+
import { AmPm, TimeFormat } from '../utils/format-utils';
|
|
5
|
+
export interface UseTimeRangePickerProps {
|
|
6
|
+
value: [Dayjs | null, Dayjs | null];
|
|
7
|
+
onChange: (range: [Dayjs | null, Dayjs | null]) => void;
|
|
8
|
+
timeFormat?: TimeFormat;
|
|
9
|
+
defaultDate?: Dayjs;
|
|
10
|
+
}
|
|
11
|
+
export interface UseTimeRangePickerReturn {
|
|
12
|
+
isOpen: boolean;
|
|
13
|
+
step: RangeSelectionStep;
|
|
14
|
+
tempStartHour: number;
|
|
15
|
+
tempStartMinute: number;
|
|
16
|
+
tempEndHour: number;
|
|
17
|
+
tempEndMinute: number;
|
|
18
|
+
startAmPm: AmPm;
|
|
19
|
+
endAmPm: AmPm;
|
|
20
|
+
displayValue: [Dayjs | null, Dayjs | null];
|
|
21
|
+
handleOpenChange: (open: boolean) => void;
|
|
22
|
+
handleSetStep: (step: RangeSelectionStep) => void;
|
|
23
|
+
handleStartHourChange: (hour: number) => void;
|
|
24
|
+
handleStartMinuteChange: (minute: number) => void;
|
|
25
|
+
handleEndHourChange: (hour: number) => void;
|
|
26
|
+
handleEndMinuteChange: (minute: number) => void;
|
|
27
|
+
handleStartAmPmChange: (amPm: AmPm) => void;
|
|
28
|
+
handleEndAmPmChange: (amPm: AmPm) => void;
|
|
29
|
+
handleNext: () => void;
|
|
30
|
+
handleApply: () => void;
|
|
31
|
+
handleApplyShortcut: (shortcutValue: ShortcutValueDayjs) => void;
|
|
32
|
+
inputRef: React.RefObject<HTMLDivElement>;
|
|
33
|
+
popoverRef: React.RefObject<HTMLDivElement>;
|
|
34
|
+
}
|
|
35
|
+
export interface TimeRangePickerProps extends UseTimeRangePickerProps {
|
|
36
|
+
format?: string;
|
|
37
|
+
placeholder?: string;
|
|
38
|
+
shortcuts?: ShortcutItem[];
|
|
39
|
+
className?: string;
|
|
40
|
+
}
|
package/dist/components/ui/core/date-time-pickers/time-range-picker/use-time-range-picker.d.ts
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { UseTimeRangePickerProps, UseTimeRangePickerReturn } from './types';
|
|
2
|
+
export type { UseTimeRangePickerProps, UseTimeRangePickerReturn };
|
|
3
|
+
export declare const useTimeRangePicker: ({ value, onChange, timeFormat, defaultDate, }: UseTimeRangePickerProps) => UseTimeRangePickerReturn;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TimeFormat } from './format-utils';
|
|
1
|
+
import { AmPm, TimeFormat } from './format-utils';
|
|
2
2
|
/**
|
|
3
3
|
* Generates an array of hours.
|
|
4
4
|
* If timeFormat is '12h', generates hours from 1 to 12.
|
|
@@ -30,11 +30,11 @@ export declare const parseTime: (timeString: string) => {
|
|
|
30
30
|
/**
|
|
31
31
|
* Gets AM/PM period from a 24-hour format hour.
|
|
32
32
|
*/
|
|
33
|
-
export declare const getAmPmFromHour: (hour: number) =>
|
|
33
|
+
export declare const getAmPmFromHour: (hour: number) => AmPm;
|
|
34
34
|
/**
|
|
35
35
|
* Converts a 12-hour format hour and AM/PM period to a 24-hour format hour.
|
|
36
36
|
*/
|
|
37
|
-
export declare const convert12HourTo24Hour: (hour: number, ampm:
|
|
37
|
+
export declare const convert12HourTo24Hour: (hour: number, ampm: AmPm) => number;
|
|
38
38
|
/**
|
|
39
39
|
* Converts a 24-hour format hour to a 12-hour display value (1-12).
|
|
40
40
|
* Used when displaying time in 12-hour format.
|
|
@@ -1,15 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
), a = (r) => r >= t ? "PM" : "AM", A = (r, e) => e === "PM" && r < t ? r + t : e === "AM" && r === t ? 0 : r, N = (r) => r === 0 ? t : r > t ? r - t : r;
|
|
9
|
-
export {
|
|
10
|
-
A as convert12HourTo24Hour,
|
|
11
|
-
N as convert24HourTo12Hour,
|
|
12
|
-
c as generateHours,
|
|
13
|
-
M as generateMinutes,
|
|
14
|
-
a as getAmPmFromHour
|
|
15
|
-
};
|
|
1
|
+
import e from "dayjs";
|
|
2
|
+
import t from "dayjs/plugin/customParseFormat.js";
|
|
3
|
+
//#region libs/aura/src/components/ui/core/date-time-pickers/utils/time-utils.ts
|
|
4
|
+
e.extend(t);
|
|
5
|
+
var n = (e = "24h") => e === "12h" ? Array.from({ length: 12 }, (e, t) => t + 1) : Array.from({ length: 24 }, (e, t) => t), r = () => Array.from({ length: 60 / 1 }, (e, t) => t * 1), i = (e) => e >= 12 ? "PM" : "AM", a = (e, t) => t === "PM" && e < 12 ? e + 12 : t === "AM" && e === 12 ? 0 : e, o = (e) => e === 0 ? 12 : e > 12 ? e - 12 : e;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { a as convert12HourTo24Hour, o as convert24HourTo12Hour, n as generateHours, r as generateMinutes, i as getAmPmFromHour };
|
|
@@ -1,165 +1,92 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { cn as e } from "../../../../lib/utils.js";
|
|
2
|
+
import { Button as t } from "../button/button.js";
|
|
3
|
+
import { usePortalContainer as n } from "../../../../lib/portal-container-context.js";
|
|
4
|
+
import { IconX as r } from "@tabler/icons-react";
|
|
5
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
6
|
+
import { Dialog as o } from "@base-ui/react/dialog";
|
|
7
|
+
//#region libs/aura/src/components/ui/core/dialog/dialog.tsx
|
|
8
|
+
function s({ ...e }) {
|
|
9
|
+
return /* @__PURE__ */ i(o.Root, {
|
|
10
|
+
"data-slot": "dialog",
|
|
11
|
+
...e
|
|
12
|
+
});
|
|
9
13
|
}
|
|
10
|
-
function
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
14
|
+
function c({ children: e, ...t }) {
|
|
15
|
+
return /* @__PURE__ */ i(o.Trigger, {
|
|
16
|
+
"data-slot": "dialog-trigger",
|
|
17
|
+
...t,
|
|
18
|
+
children: e
|
|
19
|
+
});
|
|
15
20
|
}
|
|
16
|
-
function
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
...t
|
|
24
|
-
}
|
|
25
|
-
);
|
|
21
|
+
function l({ ...e }) {
|
|
22
|
+
let t = n();
|
|
23
|
+
return /* @__PURE__ */ i(o.Portal, {
|
|
24
|
+
"data-slot": "dialog-portal",
|
|
25
|
+
container: t,
|
|
26
|
+
...e
|
|
27
|
+
});
|
|
26
28
|
}
|
|
27
|
-
function
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
function u({ children: e, ...t }) {
|
|
30
|
+
return /* @__PURE__ */ i(o.Close, {
|
|
31
|
+
"data-slot": "dialog-close",
|
|
32
|
+
...t,
|
|
33
|
+
children: e
|
|
34
|
+
});
|
|
32
35
|
}
|
|
33
|
-
function
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
{
|
|
40
|
-
"data-slot": "dialog-overlay",
|
|
41
|
-
className: i(
|
|
42
|
-
"fixed inset-0 z-50 bg-black/50 transition-opacity duration-200 data-open:opacity-100 data-closed:opacity-0",
|
|
43
|
-
t
|
|
44
|
-
),
|
|
45
|
-
...o
|
|
46
|
-
}
|
|
47
|
-
);
|
|
36
|
+
function d({ className: t, ...n }) {
|
|
37
|
+
return /* @__PURE__ */ i(o.Backdrop, {
|
|
38
|
+
"data-slot": "dialog-overlay",
|
|
39
|
+
className: e("fixed inset-0 z-50 bg-black/50 transition-opacity duration-200 data-open:opacity-100 data-closed:opacity-0", t),
|
|
40
|
+
...n
|
|
41
|
+
});
|
|
48
42
|
}
|
|
49
|
-
function
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
o,
|
|
69
|
-
r && /* @__PURE__ */ a(
|
|
70
|
-
e.Close,
|
|
71
|
-
{
|
|
72
|
-
"data-slot": "dialog-close",
|
|
73
|
-
render: /* @__PURE__ */ a(
|
|
74
|
-
g,
|
|
75
|
-
{
|
|
76
|
-
variant: "ghost",
|
|
77
|
-
size: "icon-sm",
|
|
78
|
-
className: "absolute top-5 right-4 opacity-70 hover:opacity-100",
|
|
79
|
-
"aria-label": n,
|
|
80
|
-
children: /* @__PURE__ */ a(d, { className: "h-4 w-4" })
|
|
81
|
-
}
|
|
82
|
-
)
|
|
83
|
-
}
|
|
84
|
-
)
|
|
85
|
-
]
|
|
86
|
-
}
|
|
87
|
-
)
|
|
88
|
-
] });
|
|
43
|
+
function f({ className: n, children: s, showCloseButton: c = !0, closeButtonLabel: u = "Close", ...f }) {
|
|
44
|
+
return /* @__PURE__ */ a(l, {
|
|
45
|
+
"data-slot": "dialog-portal",
|
|
46
|
+
children: [/* @__PURE__ */ i(d, {}), /* @__PURE__ */ a(o.Popup, {
|
|
47
|
+
"data-slot": "dialog-content",
|
|
48
|
+
className: e("bg-popover-background fixed inset-x-4 top-1/2 z-50 grid -translate-y-1/2 rounded-xl border px-5 py-5 mb-2.5 shadow-xl outline-none transition-opacity duration-200 data-open:opacity-100 data-closed:opacity-0 sm:inset-x-0 sm:left-1/2 sm:w-full sm:max-w-lg sm:-translate-x-1/2", n),
|
|
49
|
+
...f,
|
|
50
|
+
children: [s, c && /* @__PURE__ */ i(o.Close, {
|
|
51
|
+
"data-slot": "dialog-close",
|
|
52
|
+
render: /* @__PURE__ */ i(t, {
|
|
53
|
+
variant: "ghost",
|
|
54
|
+
size: "icon-sm",
|
|
55
|
+
className: "absolute top-5 right-4 opacity-70 hover:opacity-100",
|
|
56
|
+
"aria-label": u,
|
|
57
|
+
children: /* @__PURE__ */ i(r, { className: "h-4 w-4" })
|
|
58
|
+
})
|
|
59
|
+
})]
|
|
60
|
+
})]
|
|
61
|
+
});
|
|
89
62
|
}
|
|
90
|
-
function
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
{
|
|
97
|
-
"data-slot": "dialog-header",
|
|
98
|
-
className: i(
|
|
99
|
-
"flex flex-col gap-2 text-center sm:text-left pb-2",
|
|
100
|
-
t
|
|
101
|
-
),
|
|
102
|
-
...o
|
|
103
|
-
}
|
|
104
|
-
);
|
|
63
|
+
function p({ className: t, ...n }) {
|
|
64
|
+
return /* @__PURE__ */ i("div", {
|
|
65
|
+
"data-slot": "dialog-header",
|
|
66
|
+
className: e("flex flex-col gap-2 text-center sm:text-left pb-2", t),
|
|
67
|
+
...n
|
|
68
|
+
});
|
|
105
69
|
}
|
|
106
|
-
function
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
{
|
|
113
|
-
"data-slot": "dialog-footer",
|
|
114
|
-
className: i(
|
|
115
|
-
"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end pt-3",
|
|
116
|
-
t
|
|
117
|
-
),
|
|
118
|
-
...o
|
|
119
|
-
}
|
|
120
|
-
);
|
|
70
|
+
function m({ className: t, ...n }) {
|
|
71
|
+
return /* @__PURE__ */ i("div", {
|
|
72
|
+
"data-slot": "dialog-footer",
|
|
73
|
+
className: e("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end pt-3", t),
|
|
74
|
+
...n
|
|
75
|
+
});
|
|
121
76
|
}
|
|
122
|
-
function
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
{
|
|
129
|
-
"data-slot": "dialog-title",
|
|
130
|
-
className: i(
|
|
131
|
-
"text-lg font-medium text-foreground leading-6 tracking-tightest",
|
|
132
|
-
t
|
|
133
|
-
),
|
|
134
|
-
...o
|
|
135
|
-
}
|
|
136
|
-
);
|
|
77
|
+
function h({ className: t, ...n }) {
|
|
78
|
+
return /* @__PURE__ */ i(o.Title, {
|
|
79
|
+
"data-slot": "dialog-title",
|
|
80
|
+
className: e("text-lg font-medium text-foreground leading-6 tracking-tightest", t),
|
|
81
|
+
...n
|
|
82
|
+
});
|
|
137
83
|
}
|
|
138
|
-
function
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
{
|
|
145
|
-
"data-slot": "dialog-description",
|
|
146
|
-
className: i(
|
|
147
|
-
"text-muted-foreground text-base font-normal leading-5 tracking-tightest pt-2",
|
|
148
|
-
t
|
|
149
|
-
),
|
|
150
|
-
...o
|
|
151
|
-
}
|
|
152
|
-
);
|
|
84
|
+
function g({ className: t, ...n }) {
|
|
85
|
+
return /* @__PURE__ */ i(o.Description, {
|
|
86
|
+
"data-slot": "dialog-description",
|
|
87
|
+
className: e("text-muted-foreground text-base font-normal leading-5 tracking-tightest pt-2", t),
|
|
88
|
+
...n
|
|
89
|
+
});
|
|
153
90
|
}
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
N as DialogClose,
|
|
157
|
-
C as DialogContent,
|
|
158
|
-
T as DialogDescription,
|
|
159
|
-
w as DialogFooter,
|
|
160
|
-
k as DialogHeader,
|
|
161
|
-
u as DialogOverlay,
|
|
162
|
-
p as DialogPortal,
|
|
163
|
-
P as DialogTitle,
|
|
164
|
-
v as DialogTrigger
|
|
165
|
-
};
|
|
91
|
+
//#endregion
|
|
92
|
+
export { s as Dialog, u as DialogClose, f as DialogContent, g as DialogDescription, m as DialogFooter, p as DialogHeader, d as DialogOverlay, l as DialogPortal, h as DialogTitle, c as DialogTrigger };
|
|
@@ -2,7 +2,7 @@ import { ComponentProps, ComponentRef, ForwardRefExoticComponent, HTMLAttributes
|
|
|
2
2
|
import { Menu as MenuPrimitive } from '@base-ui/react/menu';
|
|
3
3
|
declare function DropdownMenu({ ...props }: MenuPrimitive.Root.Props): ReactNode;
|
|
4
4
|
declare function DropdownMenuPortal({ container, ...props }: MenuPrimitive.Portal.Props): ReactNode;
|
|
5
|
-
declare
|
|
5
|
+
declare const DropdownMenuTrigger: ForwardRefExoticComponent<Omit<MenuPrimitive.Trigger.Props, 'ref'> & RefAttributes<HTMLButtonElement>>;
|
|
6
6
|
declare function DropdownMenuContent({ align, alignOffset, side, sideOffset, className, container, ...props }: MenuPrimitive.Popup.Props & Pick<MenuPrimitive.Positioner.Props, 'align' | 'alignOffset' | 'side' | 'sideOffset'> & {
|
|
7
7
|
container?: MenuPrimitive.Portal.Props['container'];
|
|
8
8
|
}): ReactNode;
|
|
@@ -29,4 +29,4 @@ type DropdownMenuSubTriggerProps = MenuPrimitive.SubmenuTrigger.Props & {
|
|
|
29
29
|
declare const DropdownMenuSubTrigger: ForwardRefExoticComponent<Omit<DropdownMenuSubTriggerProps, 'ref'> & RefAttributes<ComponentRef<typeof MenuPrimitive.SubmenuTrigger>>>;
|
|
30
30
|
declare function DropdownMenuSubContent({ align, alignOffset, side, sideOffset, className, ...props }: ComponentProps<typeof DropdownMenuContent>): ReactNode;
|
|
31
31
|
declare const DropdownMenuSectionLabel: ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLDivElement>, 'ref'> & RefAttributes<HTMLDivElement>>;
|
|
32
|
-
export { DropdownMenu,
|
|
32
|
+
export { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuHeader, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSectionLabel, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, };
|