@brightlocal/ui-components 0.1.1 → 0.1.3
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/accordion.cjs +1 -1
- package/dist/accordion.d.ts +74 -4
- package/dist/accordion.d.ts.map +1 -1
- package/dist/accordion.js +100 -105
- package/dist/alert-dialog.cjs +1 -1
- package/dist/alert-dialog.d.ts +30 -10
- package/dist/alert-dialog.d.ts.map +1 -1
- package/dist/alert-dialog.js +129 -132
- package/dist/alert.d.ts +22 -1
- package/dist/alert.d.ts.map +1 -1
- package/dist/aspect-ratio.cjs +1 -1
- package/dist/aspect-ratio.d.ts +11 -1
- package/dist/aspect-ratio.d.ts.map +1 -1
- package/dist/aspect-ratio.js +16 -20
- package/dist/avatar.cjs +1 -1
- package/dist/avatar.d.ts +43 -3
- package/dist/avatar.d.ts.map +1 -1
- package/dist/avatar.js +18 -16
- package/dist/badge.cjs +1 -1
- package/dist/badge.d.ts +24 -9
- package/dist/badge.d.ts.map +1 -1
- package/dist/badge.js +34 -32
- package/dist/blocks/data-table.cjs +1 -1
- package/dist/blocks/data-table.d.ts.map +1 -1
- package/dist/blocks/data-table.js +209 -202
- package/dist/blocks/sidebar.cjs +1 -1
- package/dist/blocks/sidebar.d.ts +1 -1
- package/dist/blocks/sidebar.d.ts.map +1 -1
- package/dist/blocks/sidebar.js +154 -154
- package/dist/breadcrumb.cjs +1 -1
- package/dist/breadcrumb.d.ts +63 -8
- package/dist/breadcrumb.d.ts.map +1 -1
- package/dist/breadcrumb.js +97 -93
- package/dist/button.cjs +1 -1
- package/dist/button.d.ts +17 -45
- package/dist/button.d.ts.map +1 -1
- package/dist/button.js +49 -50
- package/dist/calendar.cjs +1 -1
- package/dist/calendar.d.ts +12 -0
- package/dist/calendar.d.ts.map +1 -1
- package/dist/calendar.js +10 -8
- package/dist/card.cjs +1 -1
- package/dist/card.d.ts +58 -18
- package/dist/card.d.ts.map +1 -1
- package/dist/card.js +60 -51
- package/dist/carousel.cjs +1 -1
- package/dist/carousel.d.ts +99 -9
- package/dist/carousel.d.ts.map +1 -1
- package/dist/carousel.js +142 -128
- package/dist/centred-layout.cjs +1 -1
- package/dist/centred-layout.d.ts +18 -2
- package/dist/centred-layout.d.ts.map +1 -1
- package/dist/centred-layout.js +46 -33
- package/dist/chart.cjs +4 -4
- package/dist/chart.d.ts +70 -7
- package/dist/chart.d.ts.map +1 -1
- package/dist/chart.js +71 -66
- package/dist/checkbox.cjs +1 -1
- package/dist/checkbox.d.ts +9 -5
- package/dist/checkbox.d.ts.map +1 -1
- package/dist/checkbox.js +61 -82
- package/dist/collapsible.cjs +1 -1
- package/dist/collapsible.d.ts +65 -8
- package/dist/collapsible.d.ts.map +1 -1
- package/dist/collapsible.js +41 -55
- package/dist/combobox.cjs +1 -1
- package/dist/combobox.d.ts +29 -11
- package/dist/combobox.d.ts.map +1 -1
- package/dist/combobox.js +193 -159
- package/dist/command.cjs +1 -1
- package/dist/command.d.ts +115 -9
- package/dist/command.d.ts.map +1 -1
- package/dist/command.js +176 -152
- package/dist/context-menu.cjs +1 -1
- package/dist/context-menu.d.ts +188 -20
- package/dist/context-menu.d.ts.map +1 -1
- package/dist/context-menu.js +119 -121
- package/dist/date-picker.cjs +1 -1
- package/dist/date-picker.d.ts +75 -9
- package/dist/date-picker.d.ts.map +1 -1
- package/dist/date-picker.js +220 -81
- package/dist/description.cjs +1 -0
- package/dist/description.d.ts +37 -0
- package/dist/description.d.ts.map +1 -0
- package/dist/description.js +25 -0
- package/dist/dialog.cjs +1 -1
- package/dist/dialog.d.ts +73 -9
- package/dist/dialog.d.ts.map +1 -1
- package/dist/dialog.js +103 -112
- package/dist/drawer.cjs +1 -1
- package/dist/drawer.d.ts +92 -0
- package/dist/drawer.d.ts.map +1 -1
- package/dist/drawer.js +67 -52
- package/dist/dropdown-menu.cjs +1 -1
- package/dist/dropdown-menu.d.ts +95 -11
- package/dist/dropdown-menu.d.ts.map +1 -1
- package/dist/dropdown-menu.js +146 -106
- package/dist/field.cjs +1 -1
- package/dist/field.d.ts +23 -6
- package/dist/field.d.ts.map +1 -1
- package/dist/field.js +54 -53
- package/dist/global-layout.cjs +1 -1
- package/dist/global-layout.d.ts +27 -17
- package/dist/global-layout.d.ts.map +1 -1
- package/dist/global-layout.js +86 -79
- package/dist/hover-card.cjs +1 -1
- package/dist/hover-card.d.ts +36 -6
- package/dist/hover-card.d.ts.map +1 -1
- package/dist/hover-card.js +44 -42
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +383 -387
- package/dist/input-group.cjs +1 -1
- package/dist/input-group.d.ts +21 -2
- package/dist/input-group.d.ts.map +1 -1
- package/dist/input-group.js +51 -41
- package/dist/input-password.cjs +1 -1
- package/dist/input-password.d.ts.map +1 -1
- package/dist/input-password.js +24 -25
- package/dist/input.cjs +1 -1
- package/dist/input.d.ts +38 -24
- package/dist/input.d.ts.map +1 -1
- package/dist/input.js +68 -136
- package/dist/label.cjs +1 -1
- package/dist/label.d.ts +20 -1
- package/dist/label.d.ts.map +1 -1
- package/dist/label.js +31 -18
- package/dist/logo.cjs +1 -1
- package/dist/logo.d.ts +3 -0
- package/dist/logo.d.ts.map +1 -1
- package/dist/logo.js +12 -10
- package/dist/menubar.cjs +1 -1
- package/dist/menubar.d.ts +40 -6
- package/dist/menubar.d.ts.map +1 -1
- package/dist/menubar.js +97 -76
- package/dist/popover.cjs +1 -1
- package/dist/popover.d.ts +59 -4
- package/dist/popover.d.ts.map +1 -1
- package/dist/popover.js +42 -34
- package/dist/progress.cjs +1 -1
- package/dist/progress.d.ts +9 -2
- package/dist/progress.d.ts.map +1 -1
- package/dist/progress.js +71 -59
- package/dist/radio-group.d.ts +40 -0
- package/dist/radio-group.d.ts.map +1 -1
- package/dist/rating.d.ts +4 -0
- package/dist/rating.d.ts.map +1 -1
- package/dist/resizable.cjs +1 -1
- package/dist/resizable.d.ts +65 -4
- package/dist/resizable.d.ts.map +1 -1
- package/dist/resizable.js +53 -36
- package/dist/scroll-area.cjs +1 -1
- package/dist/scroll-area.d.ts +46 -5
- package/dist/scroll-area.d.ts.map +1 -1
- package/dist/scroll-area.js +42 -38
- package/dist/select.cjs +1 -1
- package/dist/select.d.ts +30 -0
- package/dist/select.d.ts.map +1 -1
- package/dist/select.js +64 -54
- package/dist/separator.cjs +1 -1
- package/dist/separator.d.ts +49 -2
- package/dist/separator.d.ts.map +1 -1
- package/dist/separator.js +48 -36
- package/dist/sheet.cjs +1 -1
- package/dist/sheet.d.ts +80 -9
- package/dist/sheet.d.ts.map +1 -1
- package/dist/sheet.js +117 -113
- package/dist/skeleton.cjs +1 -1
- package/dist/skeleton.d.ts +24 -2
- package/dist/skeleton.d.ts.map +1 -1
- package/dist/skeleton.js +15 -9
- package/dist/slider.cjs +1 -1
- package/dist/slider.d.ts +18 -4
- package/dist/slider.d.ts.map +1 -1
- package/dist/slider.js +72 -66
- package/dist/sonner.cjs +1 -1
- package/dist/sonner.d.ts +4 -2
- package/dist/sonner.d.ts.map +1 -1
- package/dist/sonner.js +29 -28
- package/dist/split-layout.d.ts +4 -1
- package/dist/split-layout.d.ts.map +1 -1
- package/dist/table.cjs +1 -1
- package/dist/table.js +1 -1
- package/dist/toggle-group.cjs +1 -1
- package/dist/toggle-group.d.ts +3 -1
- package/dist/toggle-group.d.ts.map +1 -1
- package/dist/toggle-group.js +38 -36
- package/package.json +8 -2
- package/src/blocks/data-table.tsx +42 -32
- package/src/blocks/sidebar.tsx +4 -12
- package/src/components/accordion.tsx +163 -77
- package/src/components/alert-dialog.tsx +156 -111
- package/src/components/alert.tsx +26 -13
- package/src/components/aspect-ratio.tsx +25 -16
- package/src/components/avatar.tsx +56 -8
- package/src/components/badge.tsx +65 -42
- package/src/components/breadcrumb.tsx +158 -82
- package/src/components/button.tsx +41 -62
- package/src/components/calendar.tsx +16 -2
- package/src/components/card.tsx +92 -40
- package/src/components/carousel.tsx +240 -115
- package/src/components/centred-layout.tsx +67 -35
- package/src/components/chart.tsx +118 -47
- package/src/components/checkbox.tsx +42 -78
- package/src/components/collapsible.tsx +95 -26
- package/src/components/combobox.tsx +242 -144
- package/src/components/command.tsx +295 -121
- package/src/components/context-menu.tsx +278 -81
- package/src/components/date-picker.tsx +281 -30
- package/src/components/description.tsx +60 -0
- package/src/components/dialog.tsx +162 -86
- package/src/components/drawer.tsx +76 -2
- package/src/components/dropdown-menu.tsx +143 -37
- package/src/components/field.tsx +36 -11
- package/src/components/global-layout.tsx +116 -77
- package/src/components/hover-card.tsx +54 -14
- package/src/components/input-group.tsx +56 -18
- package/src/components/input-password.tsx +3 -4
- package/src/components/input.tsx +93 -186
- package/src/components/label.tsx +56 -15
- package/src/components/logo.tsx +3 -0
- package/src/components/menubar.tsx +58 -4
- package/src/components/popover.tsx +103 -20
- package/src/components/progress.tsx +82 -60
- package/src/components/radio-group.tsx +40 -0
- package/src/components/rating.tsx +4 -1
- package/src/components/resizable.tsx +119 -31
- package/src/components/scroll-area.tsx +123 -56
- package/src/components/select.tsx +21 -1
- package/src/components/separator.tsx +97 -20
- package/src/components/sheet.tsx +180 -79
- package/src/components/skeleton.tsx +40 -10
- package/src/components/slider.tsx +83 -57
- package/src/components/sonner.tsx +10 -7
- package/src/components/split-layout.tsx +4 -1
- package/src/components/table.tsx +1 -1
- package/src/components/toggle-group.tsx +4 -0
- package/src/index.ts +1 -1
- package/dist/input-base.cjs +0 -1
- package/dist/input-base.d.ts +0 -28
- package/dist/input-base.d.ts.map +0 -1
- package/dist/input-base.js +0 -56
- package/src/components/input-base.tsx +0 -86
package/dist/context-menu.d.ts
CHANGED
|
@@ -1,42 +1,210 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import * as ContextMenuPrimitive from "@radix-ui/react-context-menu";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
3
|
+
/**
|
|
4
|
+
* Props for the ContextMenu component
|
|
5
|
+
*/
|
|
6
|
+
export type ContextMenuProps = React.ComponentProps<typeof ContextMenuPrimitive.Root>;
|
|
7
|
+
/**
|
|
8
|
+
* A context menu component that displays a menu on right-click.
|
|
9
|
+
* Built with Radix UI Context Menu primitive.
|
|
10
|
+
*/
|
|
11
|
+
declare function ContextMenu({ ...props }: ContextMenuProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
declare namespace ContextMenu {
|
|
13
|
+
var displayName: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Props for the ContextMenuTrigger component
|
|
17
|
+
*/
|
|
18
|
+
export interface ContextMenuTriggerProps extends React.ComponentProps<typeof ContextMenuPrimitive.Trigger> {
|
|
19
|
+
/**
|
|
20
|
+
* Data hook for automated testing
|
|
21
|
+
*/
|
|
22
|
+
dataHook?: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* The element that triggers the context menu on right-click.
|
|
26
|
+
*/
|
|
27
|
+
declare const ContextMenuTrigger: React.ForwardRefExoticComponent<Omit<ContextMenuTriggerProps, "ref"> & React.RefAttributes<HTMLSpanElement>>;
|
|
28
|
+
/**
|
|
29
|
+
* Props for the ContextMenuGroup component
|
|
30
|
+
*/
|
|
31
|
+
export type ContextMenuGroupProps = React.ComponentProps<typeof ContextMenuPrimitive.Group>;
|
|
32
|
+
/**
|
|
33
|
+
* Groups related context menu items together.
|
|
34
|
+
*/
|
|
35
|
+
declare function ContextMenuGroup({ ...props }: ContextMenuGroupProps): import("react/jsx-runtime").JSX.Element;
|
|
36
|
+
declare namespace ContextMenuGroup {
|
|
37
|
+
var displayName: string;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Props for the ContextMenuPortal component
|
|
41
|
+
*/
|
|
42
|
+
export type ContextMenuPortalProps = React.ComponentProps<typeof ContextMenuPrimitive.Portal>;
|
|
43
|
+
/**
|
|
44
|
+
* Portal for rendering context menu content outside the DOM hierarchy.
|
|
45
|
+
*/
|
|
46
|
+
declare function ContextMenuPortal({ ...props }: ContextMenuPortalProps): import("react/jsx-runtime").JSX.Element;
|
|
47
|
+
declare namespace ContextMenuPortal {
|
|
48
|
+
var displayName: string;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Props for the ContextMenuSub component
|
|
52
|
+
*/
|
|
53
|
+
export type ContextMenuSubProps = React.ComponentProps<typeof ContextMenuPrimitive.Sub>;
|
|
54
|
+
/**
|
|
55
|
+
* A sub-menu container for nested context menu items.
|
|
56
|
+
*/
|
|
57
|
+
declare function ContextMenuSub({ ...props }: ContextMenuSubProps): import("react/jsx-runtime").JSX.Element;
|
|
58
|
+
declare namespace ContextMenuSub {
|
|
59
|
+
var displayName: string;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Props for the ContextMenuRadioGroup component
|
|
63
|
+
*/
|
|
64
|
+
export type ContextMenuRadioGroupProps = React.ComponentProps<typeof ContextMenuPrimitive.RadioGroup>;
|
|
65
|
+
/**
|
|
66
|
+
* A group of radio items where only one can be selected at a time.
|
|
67
|
+
*/
|
|
68
|
+
declare function ContextMenuRadioGroup({ ...props }: ContextMenuRadioGroupProps): import("react/jsx-runtime").JSX.Element;
|
|
69
|
+
declare namespace ContextMenuRadioGroup {
|
|
70
|
+
var displayName: string;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Props for the ContextMenuSubTrigger component
|
|
74
|
+
*/
|
|
75
|
+
export interface ContextMenuSubTriggerProps extends React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.SubTrigger> {
|
|
76
|
+
/**
|
|
77
|
+
* Whether to add left padding for alignment with other items
|
|
78
|
+
*/
|
|
10
79
|
inset?: boolean;
|
|
80
|
+
/**
|
|
81
|
+
* Data hook for automated testing
|
|
82
|
+
*/
|
|
11
83
|
dataHook?: string;
|
|
84
|
+
/**
|
|
85
|
+
* Tracking element identifier for analytics
|
|
86
|
+
*/
|
|
12
87
|
trackingEl?: string;
|
|
88
|
+
/**
|
|
89
|
+
* Tracking label for analytics context
|
|
90
|
+
*/
|
|
13
91
|
trackingLabel?: string;
|
|
14
|
-
}
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Trigger for opening a sub-menu within the context menu.
|
|
95
|
+
*/
|
|
96
|
+
declare const ContextMenuSubTrigger: React.ForwardRefExoticComponent<ContextMenuSubTriggerProps & React.RefAttributes<HTMLDivElement>>;
|
|
97
|
+
/**
|
|
98
|
+
* Props for the ContextMenuSubContent component
|
|
99
|
+
*/
|
|
100
|
+
export type ContextMenuSubContentProps = React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.SubContent>;
|
|
101
|
+
/**
|
|
102
|
+
* Content container for a sub-menu.
|
|
103
|
+
*/
|
|
15
104
|
declare const ContextMenuSubContent: React.ForwardRefExoticComponent<Omit<ContextMenuPrimitive.ContextMenuSubContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
105
|
+
/**
|
|
106
|
+
* Props for the ContextMenuContent component
|
|
107
|
+
*/
|
|
108
|
+
export type ContextMenuContentProps = React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Content>;
|
|
109
|
+
/**
|
|
110
|
+
* Main content container for the context menu.
|
|
111
|
+
*/
|
|
16
112
|
declare const ContextMenuContent: React.ForwardRefExoticComponent<Omit<ContextMenuPrimitive.ContextMenuContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
17
|
-
|
|
113
|
+
/**
|
|
114
|
+
* Props for the ContextMenuItem component
|
|
115
|
+
*/
|
|
116
|
+
export interface ContextMenuItemProps extends React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Item> {
|
|
117
|
+
/**
|
|
118
|
+
* Whether to add left padding for alignment with other items
|
|
119
|
+
*/
|
|
18
120
|
inset?: boolean;
|
|
121
|
+
/**
|
|
122
|
+
* Data hook for automated testing
|
|
123
|
+
*/
|
|
19
124
|
dataHook?: string;
|
|
125
|
+
/**
|
|
126
|
+
* Tracking element identifier for analytics
|
|
127
|
+
*/
|
|
20
128
|
trackingEl?: string;
|
|
129
|
+
/**
|
|
130
|
+
* Tracking label for analytics context
|
|
131
|
+
*/
|
|
21
132
|
trackingLabel?: string;
|
|
22
|
-
}
|
|
23
|
-
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* An interactive item in the context menu.
|
|
136
|
+
*/
|
|
137
|
+
declare const ContextMenuItem: React.ForwardRefExoticComponent<ContextMenuItemProps & React.RefAttributes<HTMLDivElement>>;
|
|
138
|
+
/**
|
|
139
|
+
* Props for the ContextMenuCheckboxItem component
|
|
140
|
+
*/
|
|
141
|
+
export interface ContextMenuCheckboxItemProps extends React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.CheckboxItem> {
|
|
142
|
+
/**
|
|
143
|
+
* Data hook for automated testing
|
|
144
|
+
*/
|
|
24
145
|
dataHook?: string;
|
|
146
|
+
/**
|
|
147
|
+
* Tracking element identifier for analytics
|
|
148
|
+
*/
|
|
25
149
|
trackingEl?: string;
|
|
150
|
+
/**
|
|
151
|
+
* Tracking label for analytics context
|
|
152
|
+
*/
|
|
26
153
|
trackingLabel?: string;
|
|
27
|
-
}
|
|
28
|
-
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* A checkbox item that can be toggled on/off in the context menu.
|
|
157
|
+
*/
|
|
158
|
+
declare const ContextMenuCheckboxItem: React.ForwardRefExoticComponent<ContextMenuCheckboxItemProps & React.RefAttributes<HTMLDivElement>>;
|
|
159
|
+
/**
|
|
160
|
+
* Props for the ContextMenuRadioItem component
|
|
161
|
+
*/
|
|
162
|
+
export interface ContextMenuRadioItemProps extends React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.RadioItem> {
|
|
163
|
+
/**
|
|
164
|
+
* Data hook for automated testing
|
|
165
|
+
*/
|
|
29
166
|
dataHook?: string;
|
|
167
|
+
/**
|
|
168
|
+
* Tracking element identifier for analytics
|
|
169
|
+
*/
|
|
30
170
|
trackingEl?: string;
|
|
171
|
+
/**
|
|
172
|
+
* Tracking label for analytics context
|
|
173
|
+
*/
|
|
31
174
|
trackingLabel?: string;
|
|
32
|
-
}
|
|
33
|
-
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* A radio item within a radio group, where only one can be selected.
|
|
178
|
+
*/
|
|
179
|
+
declare const ContextMenuRadioItem: React.ForwardRefExoticComponent<ContextMenuRadioItemProps & React.RefAttributes<HTMLDivElement>>;
|
|
180
|
+
/**
|
|
181
|
+
* Props for the ContextMenuLabel component
|
|
182
|
+
*/
|
|
183
|
+
export interface ContextMenuLabelProps extends React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Label> {
|
|
184
|
+
/**
|
|
185
|
+
* Whether to add left padding for alignment with other items
|
|
186
|
+
*/
|
|
34
187
|
inset?: boolean;
|
|
35
|
-
}
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* A non-interactive label for grouping menu items.
|
|
191
|
+
*/
|
|
192
|
+
declare const ContextMenuLabel: React.ForwardRefExoticComponent<ContextMenuLabelProps & React.RefAttributes<HTMLDivElement>>;
|
|
193
|
+
/**
|
|
194
|
+
* Props for the ContextMenuSeparator component
|
|
195
|
+
*/
|
|
196
|
+
export type ContextMenuSeparatorProps = React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Separator>;
|
|
197
|
+
/**
|
|
198
|
+
* Visual separator between groups of menu items.
|
|
199
|
+
*/
|
|
36
200
|
declare const ContextMenuSeparator: React.ForwardRefExoticComponent<Omit<ContextMenuPrimitive.ContextMenuSeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
201
|
+
/**
|
|
202
|
+
* Props for the ContextMenuShortcut component
|
|
203
|
+
*/
|
|
204
|
+
export type ContextMenuShortcutProps = React.HTMLAttributes<HTMLSpanElement>;
|
|
205
|
+
/**
|
|
206
|
+
* Displays a keyboard shortcut hint for a menu item.
|
|
207
|
+
*/
|
|
208
|
+
declare const ContextMenuShortcut: React.ForwardRefExoticComponent<ContextMenuShortcutProps & React.RefAttributes<HTMLSpanElement>>;
|
|
41
209
|
export { ContextMenu, ContextMenuTrigger, ContextMenuContent, ContextMenuItem, ContextMenuCheckboxItem, ContextMenuRadioItem, ContextMenuLabel, ContextMenuSeparator, ContextMenuShortcut, ContextMenuGroup, ContextMenuPortal, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuRadioGroup, };
|
|
42
210
|
//# sourceMappingURL=context-menu.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context-menu.d.ts","sourceRoot":"","sources":["../../src/components/context-menu.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,oBAAoB,MAAM,8BAA8B,CAAC;AAKrE,iBAAS,WAAW,CAAC,
|
|
1
|
+
{"version":3,"file":"context-menu.d.ts","sourceRoot":"","sources":["../../src/components/context-menu.tsx"],"names":[],"mappings":"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"}
|
package/dist/context-menu.js
CHANGED
|
@@ -1,226 +1,224 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import * as
|
|
3
|
-
import * as
|
|
1
|
+
import { jsx as t, jsxs as m } from "react/jsx-runtime";
|
|
2
|
+
import * as r from "react";
|
|
3
|
+
import * as n from "@radix-ui/react-context-menu";
|
|
4
4
|
import { Check as p, Circle as f, ChevronRight as x } from "lucide-react";
|
|
5
|
-
import { cn as
|
|
6
|
-
function
|
|
7
|
-
...e
|
|
8
|
-
}) {
|
|
9
|
-
return /* @__PURE__ */ a(t.Root, { "data-slot": "context-menu", ...e });
|
|
5
|
+
import { cn as s } from "@brightlocal/ui-components/lib/utils";
|
|
6
|
+
function b({ ...e }) {
|
|
7
|
+
return /* @__PURE__ */ t(n.Root, { "data-slot": "context-menu", ...e });
|
|
10
8
|
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
9
|
+
b.displayName = "ContextMenu";
|
|
10
|
+
const g = r.forwardRef(({ dataHook: e, ...a }, o) => /* @__PURE__ */ t(
|
|
11
|
+
n.Trigger,
|
|
12
|
+
{
|
|
13
|
+
ref: o,
|
|
14
|
+
"data-hook": e,
|
|
15
|
+
"data-slot": "context-menu-trigger",
|
|
16
|
+
...a
|
|
17
|
+
}
|
|
18
|
+
));
|
|
19
|
+
g.displayName = "ContextMenuTrigger";
|
|
20
|
+
function C({ ...e }) {
|
|
21
|
+
return /* @__PURE__ */ t(n.Group, { "data-slot": "context-menu-group", ...e });
|
|
20
22
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
})
|
|
24
|
-
return /* @__PURE__ */ a(t.Portal, { "data-slot": "context-menu-portal", ...e });
|
|
23
|
+
C.displayName = "ContextMenuGroup";
|
|
24
|
+
function h({ ...e }) {
|
|
25
|
+
return /* @__PURE__ */ t(n.Portal, { "data-slot": "context-menu-portal", ...e });
|
|
25
26
|
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
})
|
|
29
|
-
return /* @__PURE__ */ a(t.Sub, { "data-slot": "context-menu-sub", ...e });
|
|
27
|
+
h.displayName = "ContextMenuPortal";
|
|
28
|
+
function M({ ...e }) {
|
|
29
|
+
return /* @__PURE__ */ t(n.Sub, { "data-slot": "context-menu-sub", ...e });
|
|
30
30
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
t.RadioGroup,
|
|
31
|
+
M.displayName = "ContextMenuSub";
|
|
32
|
+
function N({ ...e }) {
|
|
33
|
+
return /* @__PURE__ */ t(
|
|
34
|
+
n.RadioGroup,
|
|
36
35
|
{
|
|
37
36
|
"data-slot": "context-menu-radio-group",
|
|
38
37
|
...e
|
|
39
38
|
}
|
|
40
39
|
);
|
|
41
40
|
}
|
|
42
|
-
|
|
41
|
+
N.displayName = "ContextMenuRadioGroup";
|
|
42
|
+
const y = r.forwardRef(
|
|
43
43
|
({
|
|
44
44
|
className: e,
|
|
45
|
-
inset:
|
|
46
|
-
children:
|
|
47
|
-
dataHook:
|
|
45
|
+
inset: a,
|
|
46
|
+
children: o,
|
|
47
|
+
dataHook: d,
|
|
48
48
|
trackingEl: i,
|
|
49
49
|
trackingLabel: l,
|
|
50
50
|
...c
|
|
51
|
-
},
|
|
52
|
-
|
|
51
|
+
}, u) => /* @__PURE__ */ m(
|
|
52
|
+
n.SubTrigger,
|
|
53
53
|
{
|
|
54
|
-
ref:
|
|
55
|
-
className:
|
|
54
|
+
ref: u,
|
|
55
|
+
className: s(
|
|
56
56
|
"focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none select-none",
|
|
57
|
-
|
|
57
|
+
a && "pl-8",
|
|
58
58
|
e
|
|
59
59
|
),
|
|
60
|
-
"data-hook":
|
|
60
|
+
"data-hook": d,
|
|
61
61
|
"data-slot": "context-menu-sub-trigger",
|
|
62
62
|
"data-tracking-el": i,
|
|
63
63
|
"data-tracking-label": l,
|
|
64
64
|
...c,
|
|
65
65
|
children: [
|
|
66
|
-
|
|
67
|
-
/* @__PURE__ */
|
|
66
|
+
o,
|
|
67
|
+
/* @__PURE__ */ t(x, { className: "ml-auto size-4" })
|
|
68
68
|
]
|
|
69
69
|
}
|
|
70
70
|
)
|
|
71
71
|
);
|
|
72
|
-
|
|
73
|
-
const
|
|
74
|
-
|
|
72
|
+
y.displayName = "ContextMenuSubTrigger";
|
|
73
|
+
const k = r.forwardRef(({ className: e, ...a }, o) => /* @__PURE__ */ t(
|
|
74
|
+
n.SubContent,
|
|
75
75
|
{
|
|
76
|
-
ref:
|
|
77
|
-
className:
|
|
76
|
+
ref: o,
|
|
77
|
+
className: s(
|
|
78
78
|
"border-border bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] overflow-hidden rounded-md border p-1 shadow-md",
|
|
79
79
|
e
|
|
80
80
|
),
|
|
81
81
|
"data-slot": "context-menu-sub-content",
|
|
82
|
-
...
|
|
82
|
+
...a
|
|
83
83
|
}
|
|
84
84
|
));
|
|
85
|
-
|
|
86
|
-
const
|
|
87
|
-
|
|
85
|
+
k.displayName = "ContextMenuSubContent";
|
|
86
|
+
const R = r.forwardRef(({ className: e, ...a }, o) => /* @__PURE__ */ t(n.Portal, { children: /* @__PURE__ */ t(
|
|
87
|
+
n.Content,
|
|
88
88
|
{
|
|
89
|
-
ref:
|
|
90
|
-
className:
|
|
89
|
+
ref: o,
|
|
90
|
+
className: s(
|
|
91
91
|
"border-border bg-popover text-popover-foreground animate-in fade-in-80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] overflow-hidden rounded-md border p-1 shadow-md",
|
|
92
92
|
e
|
|
93
93
|
),
|
|
94
94
|
"data-slot": "context-menu-content",
|
|
95
|
-
...
|
|
95
|
+
...a
|
|
96
96
|
}
|
|
97
97
|
) }));
|
|
98
|
-
|
|
99
|
-
const
|
|
100
|
-
({ className: e, inset:
|
|
101
|
-
|
|
98
|
+
R.displayName = "ContextMenuContent";
|
|
99
|
+
const w = r.forwardRef(
|
|
100
|
+
({ className: e, inset: a, dataHook: o, trackingEl: d, trackingLabel: i, ...l }, c) => /* @__PURE__ */ t(
|
|
101
|
+
n.Item,
|
|
102
102
|
{
|
|
103
103
|
ref: c,
|
|
104
|
-
className:
|
|
104
|
+
className: s(
|
|
105
105
|
"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
106
|
-
|
|
106
|
+
a && "pl-8",
|
|
107
107
|
e
|
|
108
108
|
),
|
|
109
|
-
"data-hook":
|
|
109
|
+
"data-hook": o,
|
|
110
110
|
"data-slot": "context-menu-item",
|
|
111
|
-
"data-tracking-el":
|
|
111
|
+
"data-tracking-el": d,
|
|
112
112
|
"data-tracking-label": i,
|
|
113
113
|
...l
|
|
114
114
|
}
|
|
115
115
|
)
|
|
116
116
|
);
|
|
117
|
-
|
|
118
|
-
const
|
|
117
|
+
w.displayName = "ContextMenuItem";
|
|
118
|
+
const v = r.forwardRef(
|
|
119
119
|
({
|
|
120
120
|
className: e,
|
|
121
|
-
children:
|
|
122
|
-
checked:
|
|
123
|
-
dataHook:
|
|
121
|
+
children: a,
|
|
122
|
+
checked: o,
|
|
123
|
+
dataHook: d,
|
|
124
124
|
trackingEl: i,
|
|
125
125
|
trackingLabel: l,
|
|
126
126
|
...c
|
|
127
|
-
},
|
|
128
|
-
|
|
127
|
+
}, u) => /* @__PURE__ */ m(
|
|
128
|
+
n.CheckboxItem,
|
|
129
129
|
{
|
|
130
|
-
ref:
|
|
131
|
-
checked:
|
|
132
|
-
className:
|
|
130
|
+
ref: u,
|
|
131
|
+
checked: o,
|
|
132
|
+
className: s(
|
|
133
133
|
"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center rounded-sm py-1.5 pr-2 pl-8 text-sm outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
134
134
|
e
|
|
135
135
|
),
|
|
136
|
-
"data-hook":
|
|
136
|
+
"data-hook": d,
|
|
137
137
|
"data-slot": "context-menu-checkbox-item",
|
|
138
138
|
"data-tracking-el": i,
|
|
139
139
|
"data-tracking-label": l,
|
|
140
140
|
...c,
|
|
141
141
|
children: [
|
|
142
|
-
/* @__PURE__ */
|
|
143
|
-
|
|
142
|
+
/* @__PURE__ */ t("span", { className: "absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ t(n.ItemIndicator, { children: /* @__PURE__ */ t(p, { className: "size-4" }) }) }),
|
|
143
|
+
a
|
|
144
144
|
]
|
|
145
145
|
}
|
|
146
146
|
)
|
|
147
147
|
);
|
|
148
|
-
|
|
149
|
-
const
|
|
150
|
-
({ className: e, children:
|
|
151
|
-
|
|
148
|
+
v.displayName = "ContextMenuCheckboxItem";
|
|
149
|
+
const S = r.forwardRef(
|
|
150
|
+
({ className: e, children: a, dataHook: o, trackingEl: d, trackingLabel: i, ...l }, c) => /* @__PURE__ */ m(
|
|
151
|
+
n.RadioItem,
|
|
152
152
|
{
|
|
153
153
|
ref: c,
|
|
154
|
-
className:
|
|
154
|
+
className: s(
|
|
155
155
|
"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center rounded-sm py-1.5 pr-2 pl-8 text-sm outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
156
156
|
e
|
|
157
157
|
),
|
|
158
|
-
"data-hook":
|
|
158
|
+
"data-hook": o,
|
|
159
159
|
"data-slot": "context-menu-radio-item",
|
|
160
|
-
"data-tracking-el":
|
|
160
|
+
"data-tracking-el": d,
|
|
161
161
|
"data-tracking-label": i,
|
|
162
162
|
...l,
|
|
163
163
|
children: [
|
|
164
|
-
/* @__PURE__ */
|
|
165
|
-
|
|
164
|
+
/* @__PURE__ */ t("span", { className: "absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ t(n.ItemIndicator, { children: /* @__PURE__ */ t(f, { className: "size-2 fill-current" }) }) }),
|
|
165
|
+
a
|
|
166
166
|
]
|
|
167
167
|
}
|
|
168
168
|
)
|
|
169
169
|
);
|
|
170
|
-
|
|
171
|
-
const
|
|
172
|
-
|
|
170
|
+
S.displayName = "ContextMenuRadioItem";
|
|
171
|
+
const I = r.forwardRef(({ className: e, inset: a, ...o }, d) => /* @__PURE__ */ t(
|
|
172
|
+
n.Label,
|
|
173
173
|
{
|
|
174
|
-
ref:
|
|
175
|
-
className:
|
|
174
|
+
ref: d,
|
|
175
|
+
className: s(
|
|
176
176
|
"text-foreground px-2 py-1.5 text-sm font-semibold",
|
|
177
|
-
|
|
177
|
+
a && "pl-8",
|
|
178
178
|
e
|
|
179
179
|
),
|
|
180
180
|
"data-slot": "context-menu-label",
|
|
181
|
-
...
|
|
181
|
+
...o
|
|
182
182
|
}
|
|
183
183
|
));
|
|
184
|
-
|
|
185
|
-
const
|
|
186
|
-
|
|
184
|
+
I.displayName = "ContextMenuLabel";
|
|
185
|
+
const z = r.forwardRef(({ className: e, ...a }, o) => /* @__PURE__ */ t(
|
|
186
|
+
n.Separator,
|
|
187
187
|
{
|
|
188
|
-
ref:
|
|
189
|
-
className:
|
|
188
|
+
ref: o,
|
|
189
|
+
className: s("bg-border -mx-1 my-1 h-px", e),
|
|
190
190
|
"data-slot": "context-menu-separator",
|
|
191
|
-
...
|
|
191
|
+
...a
|
|
192
192
|
}
|
|
193
193
|
));
|
|
194
|
-
|
|
195
|
-
const
|
|
196
|
-
className: e,
|
|
197
|
-
...o
|
|
198
|
-
}) => /* @__PURE__ */ a(
|
|
194
|
+
z.displayName = "ContextMenuSeparator";
|
|
195
|
+
const G = r.forwardRef(({ className: e, ...a }, o) => /* @__PURE__ */ t(
|
|
199
196
|
"span",
|
|
200
197
|
{
|
|
201
|
-
|
|
198
|
+
ref: o,
|
|
199
|
+
className: s(
|
|
202
200
|
"text-muted-foreground ml-auto text-xs tracking-widest",
|
|
203
201
|
e
|
|
204
202
|
),
|
|
205
203
|
"data-slot": "context-menu-shortcut",
|
|
206
|
-
...
|
|
204
|
+
...a
|
|
207
205
|
}
|
|
208
|
-
);
|
|
209
|
-
|
|
206
|
+
));
|
|
207
|
+
G.displayName = "ContextMenuShortcut";
|
|
210
208
|
export {
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
209
|
+
b as ContextMenu,
|
|
210
|
+
v as ContextMenuCheckboxItem,
|
|
211
|
+
R as ContextMenuContent,
|
|
212
|
+
C as ContextMenuGroup,
|
|
213
|
+
w as ContextMenuItem,
|
|
214
|
+
I as ContextMenuLabel,
|
|
215
|
+
h as ContextMenuPortal,
|
|
216
|
+
N as ContextMenuRadioGroup,
|
|
217
|
+
S as ContextMenuRadioItem,
|
|
218
|
+
z as ContextMenuSeparator,
|
|
219
|
+
G as ContextMenuShortcut,
|
|
220
|
+
M as ContextMenuSub,
|
|
221
|
+
k as ContextMenuSubContent,
|
|
222
|
+
y as ContextMenuSubTrigger,
|
|
223
|
+
g as ContextMenuTrigger
|
|
226
224
|
};
|
package/dist/date-picker.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),T=require("react"),b=require("date-fns"),S=require("lucide-react"),s=require("@brightlocal/ui-components/lib/utils"),y=require("./input.cjs"),N=require("@brightlocal/ui-components/calendar"),d=require("@brightlocal/ui-components/popover"),g=require("@brightlocal/ui-components/select");function $(t){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(a,n,i.get?i:{enumerable:!0,get:()=>t[n]})}}return a.default=t,Object.freeze(a)}const p=$(T),k=p.forwardRef(({className:t,dataHook:a,trackingEl:n,trackingLabel:i,date:r,onDateChange:m,placeholder:x="Pick a date",disabled:o,dateFormat:u="PPP",presets:c,id:P,...f},D)=>{const[w,h]=p.useState(!1),j=e.jsx(N.Calendar,{captionLayout:"dropdown",className:s.cn("border-0 shadow-none",c&&"border-border rounded-lg border"),dataHook:`${a}-calendar`,disabled:o,endMonth:new Date(2100,11,31),mode:"single",selected:r,startMonth:new Date(1900,0,1),onSelect:l=>{m?.(l),h(!1)}});return e.jsx("div",{ref:D,className:s.cn("flex w-full flex-col gap-2",t),"data-hook":a,"data-slot":"date-picker","data-tracking-el":n||"date-picker","data-tracking-label":i,...f,children:e.jsxs(d.Popover,{open:w,onOpenChange:h,children:[e.jsx(d.PopoverTrigger,{asChild:!0,children:e.jsxs("div",{className:"relative flex w-full items-center",children:[e.jsx(S.Calendar,{className:s.cn("text-muted-foreground pointer-events-none absolute left-3 flex size-4 items-center",o&&"opacity-50"),"data-slot":"calendar-icon"}),e.jsx("button",{"aria-label":f["aria-label"]??"Select date",className:s.cn(y.inputVariants({hasIcon:!0}),"cursor-pointer justify-start text-left",!r&&"text-muted-foreground"),"data-hook":`${a}-trigger`,"data-slot":"date-picker-trigger",disabled:o,id:P,type:"button",children:r?b.format(r,u):e.jsx("span",{children:x})})]})}),e.jsx(d.PopoverContent,{align:"start",className:"w-auto rounded-lg p-0",children:c?e.jsxs("div",{className:"flex flex-col gap-2 p-2",children:[e.jsxs(g.Select,{disabled:o,value:r?c.find(l=>l.date().toDateString()===r.toDateString())?.label:void 0,onValueChange:l=>{const v=c.find(q=>q.label===l);v&&m?.(v.date())},children:[e.jsx(g.SelectTrigger,{className:"w-full",dataHook:`${a}-preset-select`,children:e.jsx(g.SelectValue,{placeholder:x})}),e.jsx(g.SelectContent,{children:c.map(l=>e.jsx(g.SelectItem,{"data-hook":`${a}-preset-${l.label.toLowerCase().replace(/\s+/g,"-")}`,value:l.label,children:l.label},l.label))})]}),j]}):j})]})})});k.displayName="DatePicker";const M=[{label:"Today",date:()=>new Date},{label:"Tomorrow",date:()=>{const t=new Date;return t.setDate(t.getDate()+1),t}},{label:"In 3 days",date:()=>{const t=new Date;return t.setDate(t.getDate()+3),t}},{label:"In a week",date:()=>{const t=new Date;return t.setDate(t.getDate()+7),t}}],C=p.forwardRef(({presets:t=M,...a},n)=>e.jsx(k,{ref:n,presets:t,...a}));C.displayName="DatePickerPreset";const O=p.forwardRef(({className:t,dataHook:a,trackingEl:n,trackingLabel:i,dateRange:r,onDateRangeChange:m,placeholder:x="Pick a date range",disabled:o,dateFormat:u="PP",numberOfMonths:c=2,id:P,...f},D)=>{const[w,h]=p.useState(!1),j=()=>r?.from?r.to?`${b.format(r.from,u)} - ${b.format(r.to,u)}`:b.format(r.from,u):null;return e.jsx("div",{ref:D,className:s.cn("flex w-full flex-col gap-2",t),"data-hook":a,"data-slot":"date-picker-range","data-tracking-el":n||"date-picker-range","data-tracking-label":i,...f,children:e.jsxs(d.Popover,{open:w,onOpenChange:h,children:[e.jsx(d.PopoverTrigger,{asChild:!0,children:e.jsxs("div",{className:"relative flex w-full items-center",children:[e.jsx(S.Calendar,{className:s.cn("text-muted-foreground pointer-events-none absolute left-3 flex size-4 items-center",o&&"opacity-50"),"data-slot":"calendar-icon"}),e.jsx("button",{"aria-label":f["aria-label"]??"Select date range",className:s.cn(y.inputVariants({hasIcon:!0}),"cursor-pointer justify-start text-left",!r?.from&&"text-muted-foreground"),"data-hook":`${a}-trigger`,"data-slot":"date-picker-trigger",disabled:o,id:P,type:"button",children:j()||e.jsx("span",{children:x})})]})}),e.jsx(d.PopoverContent,{align:"start",className:"w-auto rounded-lg p-0",children:e.jsx(N.Calendar,{captionLayout:"dropdown",className:"border-0 shadow-none",dataHook:`${a}-calendar`,disabled:o,endMonth:new Date(2100,11,31),mode:"range",numberOfMonths:c,selected:r,startMonth:new Date(1900,0,1),onSelect:m})})]})})});O.displayName="DatePickerRange";exports.DatePicker=k;exports.DatePickerPreset=C;exports.DatePickerRange=O;
|