@xola/ui-kit 3.6.0 → 3.7.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/README.md +98 -19
- package/build/components/Alert.js +29 -0
- package/build/components/Animation/FadeIn.js +40 -0
- package/build/components/Animation/SlideDown.js +25 -0
- package/build/components/Avatar.js +28 -0
- package/build/components/Badge.js +51 -0
- package/build/components/BottomSheet.js +114 -0
- package/build/components/Breadcrumb.js +33 -0
- package/build/components/Breakdown.js +81 -0
- package/build/components/Buttons/Button.js +89 -0
- package/build/components/Buttons/ButtonGroup.js +58 -0
- package/build/components/Buttons/SecondaryButton.js +31 -0
- package/build/components/Buttons/SubmitButton.js +89 -0
- package/build/components/Buttons/ToggleButton.js +33 -0
- package/build/components/Charts/BaseChartOptions.js +95 -0
- package/build/components/Charts/HistogramOptions.js +69 -0
- package/build/components/Charts/PieOptions.js +55 -0
- package/build/components/Counter.js +20 -0
- package/build/components/DatePicker/DatePicker.helpers.js +33 -0
- package/build/components/DatePicker/DatePicker.js +214 -0
- package/build/components/DatePicker/DatePickerPopover.js +90 -0
- package/build/components/DatePicker/Day.js +43 -0
- package/build/components/DatePicker/LocalizedDayPicker.js +17 -0
- package/build/components/DatePicker/MonthGrid.js +39 -0
- package/build/components/DatePicker/MonthPicker.js +33 -0
- package/build/components/DatePicker/MonthSelector.js +46 -0
- package/build/components/DatePicker/MonthYearSelector.js +23 -0
- package/build/components/DatePicker/NavbarElement.js +34 -0
- package/build/components/DatePicker/RangeDatePicker.js +111 -0
- package/build/components/DatePicker/RelativeDateRange.js +290 -0
- package/build/components/DatePicker/UpcomingDatePicker.js +31 -0
- package/build/components/Dot/Dot.js +29 -0
- package/build/components/Dot/DotProgress.js +15 -0
- package/build/components/Drawer.js +134 -0
- package/build/components/Forms/BaseInput.js +57 -0
- package/build/components/Forms/Checkbox.js +37 -0
- package/build/components/Forms/Checkbox.module.css.js +7 -0
- package/build/components/Forms/ComboBox.js +41 -0
- package/build/components/Forms/FormGroup.js +10 -0
- package/build/components/Forms/InlineValuePopover.js +41 -0
- package/build/components/Forms/Input.js +17 -0
- package/build/components/Forms/Label.js +23 -0
- package/build/components/Forms/RangeSlider.js +58 -0
- package/build/components/Forms/Select.js +7 -0
- package/build/components/Forms/Switch.js +70 -0
- package/build/components/Forms/Textarea.js +42 -0
- package/build/components/Forms/ValuePopoverText.js +7 -0
- package/build/components/GooglePlacesAutocomplete.js +112 -0
- package/build/components/HeaderToolbar.js +41 -0
- package/build/components/ImageUpload.js +83 -0
- package/build/components/Key.js +33 -0
- package/build/components/Logo.js +17 -0
- package/build/components/Modal.js +141 -0
- package/build/components/Popover/Popover.js +53 -0
- package/build/components/Popover/Popover.module.css.js +7 -0
- package/build/components/Popover/PopoverList.js +57 -0
- package/build/components/Popover/PopoverScroll.module.css.js +4 -0
- package/build/components/Provider.js +16 -0
- package/build/components/Screens/Login.js +115 -0
- package/build/components/Search.js +144 -0
- package/build/components/Sidebar/Sidebar.Account.js +49 -0
- package/build/components/Sidebar/Sidebar.Button.js +47 -0
- package/build/components/Sidebar/Sidebar.Footer.js +10 -0
- package/build/components/Sidebar/Sidebar.Heading.js +13 -0
- package/build/components/Sidebar/Sidebar.Link.js +92 -0
- package/build/components/Sidebar/Sidebar.Menu.js +54 -0
- package/build/components/Sidebar/Sidebar.Menu.module.css.js +7 -0
- package/build/components/Sidebar/Sidebar.Notifications.js +107 -0
- package/build/components/Sidebar/Sidebar.js +212 -0
- package/build/components/Sidebar/SidebarContext.js +15 -0
- package/build/components/Sidebar/SidebarScroll.module.css.js +4 -0
- package/build/components/Sidebar/sidebarWidth.js +41 -0
- package/build/components/Sidebar/useSidebarWidthState.js +115 -0
- package/build/components/Skeleton.js +28 -0
- package/build/components/Skeleton.module.css.js +7 -0
- package/build/components/Spinner.js +35 -0
- package/build/components/Table.js +107 -0
- package/build/components/Tabs/Tabs.Panel.js +11 -0
- package/build/components/Tabs/Tabs.Tab.js +42 -0
- package/build/components/Tabs/Tabs.js +28 -0
- package/build/components/Tag.js +41 -0
- package/build/components/Tooltip.js +22 -0
- package/build/components/Utilities/Currency.js +56 -0
- package/build/components/Utilities/Number.js +17 -0
- package/build/components/Utilities/Phone.js +25 -0
- package/build/helpers/browser.js +9 -0
- package/build/helpers/children.js +6 -0
- package/build/helpers/classnames.js +8 -0
- package/build/helpers/environment.js +10 -0
- package/build/helpers/flash.js +86 -0
- package/build/hooks/useIsClient.js +10 -0
- package/build/hooks/useIsMobile.js +8 -0
- package/build/hooks/useViewportHeight.js +9 -0
- package/build/icons/src/AnnounceIcon.js +12 -0
- package/build/icons/src/BellIcon.js +26 -0
- package/build/icons/src/CalendarIcon.js +15 -0
- package/build/icons/src/CheckIcon.js +7 -0
- package/build/icons/src/ChevronDownIcon.js +7 -0
- package/build/icons/src/ChevronLeftIcon.js +7 -0
- package/build/icons/src/ChevronRightIcon.js +7 -0
- package/build/icons/src/CircleNotch.js +5 -0
- package/build/icons/src/CloseIcon.js +13 -0
- package/build/icons/src/DownArrowIcon.js +15 -0
- package/build/icons/src/ImageIcon.js +26 -0
- package/build/icons/src/SearchIcon.js +15 -0
- package/build/icons/src/TrashIcon.js +19 -0
- package/build/icons/src/WarningDiamondIcon.js +26 -0
- package/build/icons/src/helpers/icon.js +7 -0
- package/build/icons/src/helpers/iconSizes.js +13 -0
- package/build/icons/src/images/XolaLogoSimple.js +13 -0
- package/build/index.js +155 -0
- package/build/style.css +1 -1
- package/build/theme.js +374 -0
- package/build/utils/avatar.js +8 -0
- package/build/utils/currency.js +11 -0
- package/build/utils/date.js +46 -0
- package/build/utils/numbers.js +19 -0
- package/build/utils/phone.js +15 -0
- package/build/utils/userLocale.js +6 -0
- package/index.d.ts +132 -79
- package/package.json +76 -45
- package/postcss.config.js +1 -1
- package/skills/README.md +27 -0
- package/skills/migrate-2.6-to-3.7/SKILL.md +110 -0
- package/tailwind.config.js +9 -5
- package/build/ui-kit.es.js +0 -16771
package/build/theme.js
ADDED
|
@@ -0,0 +1,374 @@
|
|
|
1
|
+
const p = {
|
|
2
|
+
colors: {
|
|
3
|
+
transparent: "transparent",
|
|
4
|
+
current: "currentColor",
|
|
5
|
+
black: "#222324",
|
|
6
|
+
white: "#ffffff",
|
|
7
|
+
gray: {
|
|
8
|
+
hover: "#F7F9FB",
|
|
9
|
+
lighter: "#F0F2F4",
|
|
10
|
+
light: "#E0E3E7",
|
|
11
|
+
DEFAULT: "#BDC0C6",
|
|
12
|
+
dark: "#8A8C91",
|
|
13
|
+
darker: "#505254"
|
|
14
|
+
},
|
|
15
|
+
blue: {
|
|
16
|
+
medium: "#B0C7F1",
|
|
17
|
+
lighter: "#D1E1FF",
|
|
18
|
+
light: "#2979D0",
|
|
19
|
+
DEFAULT: "#1352C6",
|
|
20
|
+
dark: "#3467C4",
|
|
21
|
+
darker: "#0E44A8"
|
|
22
|
+
},
|
|
23
|
+
turquoise: {
|
|
24
|
+
DEFAULT: "#3FE2EE"
|
|
25
|
+
},
|
|
26
|
+
green: {
|
|
27
|
+
lighter: "#E2FFEF",
|
|
28
|
+
lightish: "#C1F9D9",
|
|
29
|
+
light: "#33E781",
|
|
30
|
+
DEFAULT: "#27CE70",
|
|
31
|
+
dark: "#23B965",
|
|
32
|
+
darker: "#168848"
|
|
33
|
+
},
|
|
34
|
+
red: {
|
|
35
|
+
lighter: "#FFF0F0",
|
|
36
|
+
lightish: "#FFE1E1",
|
|
37
|
+
light: "#FFA1A1",
|
|
38
|
+
DEFAULT: "#FF5A5A",
|
|
39
|
+
dark: "#E93737",
|
|
40
|
+
darker: "#CD1F1F"
|
|
41
|
+
},
|
|
42
|
+
yellow: {
|
|
43
|
+
lighter: "#FFFAF0",
|
|
44
|
+
lightish: "#FFECC6",
|
|
45
|
+
light: "#FFDB8E",
|
|
46
|
+
DEFAULT: "#FFC03D",
|
|
47
|
+
dark: "#EBAA24",
|
|
48
|
+
darker: "#987122"
|
|
49
|
+
},
|
|
50
|
+
orange: {
|
|
51
|
+
lighter: "#FFF1E7",
|
|
52
|
+
lightish: "#FFF1E7",
|
|
53
|
+
light: "#FFB493",
|
|
54
|
+
DEFAULT: "#FF9668",
|
|
55
|
+
dark: "#EC743F",
|
|
56
|
+
darker: "#ff7336"
|
|
57
|
+
},
|
|
58
|
+
primary: {
|
|
59
|
+
medium: "#B0C7F1",
|
|
60
|
+
lighter: "#D1E1FF",
|
|
61
|
+
light: "#2979D0",
|
|
62
|
+
DEFAULT: "#1352C6",
|
|
63
|
+
dark: "#3467C4",
|
|
64
|
+
darker: "#0E44A8"
|
|
65
|
+
},
|
|
66
|
+
secondary: {
|
|
67
|
+
hover: "#F7F9FB",
|
|
68
|
+
lighter: "#F0F2F4",
|
|
69
|
+
light: "#E0E3E7",
|
|
70
|
+
DEFAULT: "#BDC0C6",
|
|
71
|
+
dark: "#8A8C91",
|
|
72
|
+
darker: "#505254"
|
|
73
|
+
},
|
|
74
|
+
warning: {
|
|
75
|
+
lighter: "#FFFAF0",
|
|
76
|
+
lightish: "#FFECC6",
|
|
77
|
+
light: "#FFDB8E",
|
|
78
|
+
DEFAULT: "#FFC03D",
|
|
79
|
+
dark: "#EBAA24",
|
|
80
|
+
darker: "#987122"
|
|
81
|
+
},
|
|
82
|
+
success: {
|
|
83
|
+
lighter: "#E2FFEF",
|
|
84
|
+
lightish: "#C1F9D9",
|
|
85
|
+
light: "#33E781",
|
|
86
|
+
DEFAULT: "#27CE70",
|
|
87
|
+
dark: "#23B965",
|
|
88
|
+
darker: "#168848"
|
|
89
|
+
},
|
|
90
|
+
danger: {
|
|
91
|
+
lighter: "#FFF0F0",
|
|
92
|
+
lightish: "#FFE1E1",
|
|
93
|
+
light: "#FFA1A1",
|
|
94
|
+
DEFAULT: "#FF5A5A",
|
|
95
|
+
dark: "#E93737",
|
|
96
|
+
darker: "#CD1F1F"
|
|
97
|
+
},
|
|
98
|
+
caution: {
|
|
99
|
+
lighter: "#FFF1E7",
|
|
100
|
+
lightish: "#FFF1E7",
|
|
101
|
+
light: "#FFB493",
|
|
102
|
+
DEFAULT: "#FF9668",
|
|
103
|
+
dark: "#EC743F",
|
|
104
|
+
darker: "#ff7336"
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
spacing: {
|
|
108
|
+
0: "0px",
|
|
109
|
+
1: "4px",
|
|
110
|
+
2: "8px",
|
|
111
|
+
3: "12px",
|
|
112
|
+
4: "16px",
|
|
113
|
+
5: "20px",
|
|
114
|
+
6: "24px",
|
|
115
|
+
7: "28px",
|
|
116
|
+
8: "32px",
|
|
117
|
+
9: "36px",
|
|
118
|
+
10: "40px",
|
|
119
|
+
11: "44px",
|
|
120
|
+
12: "48px",
|
|
121
|
+
14: "56px",
|
|
122
|
+
15: "60px",
|
|
123
|
+
16: "64px",
|
|
124
|
+
18: "72px",
|
|
125
|
+
20: "80px",
|
|
126
|
+
22: "88px",
|
|
127
|
+
24: "96px",
|
|
128
|
+
25: "100px",
|
|
129
|
+
28: "112px",
|
|
130
|
+
30: "120px",
|
|
131
|
+
32: "128px",
|
|
132
|
+
36: "144px",
|
|
133
|
+
40: "160px",
|
|
134
|
+
44: "176px",
|
|
135
|
+
48: "192px",
|
|
136
|
+
50: "200px",
|
|
137
|
+
52: "208px",
|
|
138
|
+
54: "216px",
|
|
139
|
+
56: "224px",
|
|
140
|
+
60: "240px",
|
|
141
|
+
64: "256px",
|
|
142
|
+
65: "260px",
|
|
143
|
+
72: "288px",
|
|
144
|
+
75: "300px",
|
|
145
|
+
80: "320px",
|
|
146
|
+
85: "340px",
|
|
147
|
+
96: "384px",
|
|
148
|
+
100: "400px",
|
|
149
|
+
105: "420px",
|
|
150
|
+
110: "440px",
|
|
151
|
+
125: "500px",
|
|
152
|
+
140: "560px",
|
|
153
|
+
150: "600px",
|
|
154
|
+
200: "800px",
|
|
155
|
+
"0.25": "1px",
|
|
156
|
+
"0.5": "2px",
|
|
157
|
+
"0.75": "3px",
|
|
158
|
+
"1.5": "6px",
|
|
159
|
+
"2.5": "10px",
|
|
160
|
+
"3.5": "14px",
|
|
161
|
+
"4.5": "18px",
|
|
162
|
+
"7.5": "30px"
|
|
163
|
+
},
|
|
164
|
+
fontSize: {
|
|
165
|
+
xs: "10px",
|
|
166
|
+
sm: "12px",
|
|
167
|
+
base: "14px",
|
|
168
|
+
md: "16px",
|
|
169
|
+
lg: "18px",
|
|
170
|
+
xl: "21px",
|
|
171
|
+
"2xl": "24px",
|
|
172
|
+
"3xl": "38px"
|
|
173
|
+
},
|
|
174
|
+
borderRadius: {
|
|
175
|
+
none: "0px",
|
|
176
|
+
DEFAULT: "4px",
|
|
177
|
+
sm: "2px",
|
|
178
|
+
md: "6px",
|
|
179
|
+
lg: "8px",
|
|
180
|
+
xl: "12px",
|
|
181
|
+
"2xl": "16px",
|
|
182
|
+
full: "9999px"
|
|
183
|
+
},
|
|
184
|
+
extend: {
|
|
185
|
+
animation: {
|
|
186
|
+
"reverse-spin": "reverse-spin 1s linear infinite"
|
|
187
|
+
},
|
|
188
|
+
keyframes: {
|
|
189
|
+
"reverse-spin": {
|
|
190
|
+
from: {
|
|
191
|
+
transform: "rotate(360deg)"
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
},
|
|
195
|
+
fontFamily: {
|
|
196
|
+
sans: [
|
|
197
|
+
"InterVariable",
|
|
198
|
+
"Inter",
|
|
199
|
+
"ui-sans-serif",
|
|
200
|
+
"system-ui",
|
|
201
|
+
"sans-serif",
|
|
202
|
+
'"Apple Color Emoji"',
|
|
203
|
+
'"Segoe UI Emoji"',
|
|
204
|
+
'"Segoe UI Symbol"',
|
|
205
|
+
'"Noto Color Emoji"'
|
|
206
|
+
],
|
|
207
|
+
mono: [
|
|
208
|
+
"Roboto Mono",
|
|
209
|
+
"ui-monospace",
|
|
210
|
+
"SFMono-Regular",
|
|
211
|
+
"Menlo",
|
|
212
|
+
"Monaco",
|
|
213
|
+
"Consolas",
|
|
214
|
+
'"Liberation Mono"',
|
|
215
|
+
'"Courier New"',
|
|
216
|
+
"monospace"
|
|
217
|
+
]
|
|
218
|
+
},
|
|
219
|
+
screens: {
|
|
220
|
+
"3xl": "1836px"
|
|
221
|
+
},
|
|
222
|
+
lineHeight: {
|
|
223
|
+
0: "0px",
|
|
224
|
+
1: "4px",
|
|
225
|
+
2: "8px",
|
|
226
|
+
3: "12px",
|
|
227
|
+
4: "16px",
|
|
228
|
+
5: "20px",
|
|
229
|
+
6: "24px",
|
|
230
|
+
7: "28px",
|
|
231
|
+
8: "32px",
|
|
232
|
+
9: "36px",
|
|
233
|
+
10: "40px",
|
|
234
|
+
11: "44px",
|
|
235
|
+
12: "48px",
|
|
236
|
+
"0.25": "1px",
|
|
237
|
+
"0.5": "2px",
|
|
238
|
+
"0.75": "3px",
|
|
239
|
+
"1.5": "6px",
|
|
240
|
+
"2.5": "10px",
|
|
241
|
+
xs: "10px",
|
|
242
|
+
sm: "12px",
|
|
243
|
+
"3.5": "14px",
|
|
244
|
+
base: "14px",
|
|
245
|
+
md: "16px",
|
|
246
|
+
"4.5": "18px",
|
|
247
|
+
lg: "18px",
|
|
248
|
+
p1: "130%",
|
|
249
|
+
p2: "130%",
|
|
250
|
+
p3: "110%",
|
|
251
|
+
p4: "100%"
|
|
252
|
+
},
|
|
253
|
+
letterSpacing: {
|
|
254
|
+
tightest: "-.4px"
|
|
255
|
+
},
|
|
256
|
+
minWidth: {
|
|
257
|
+
0: "0px",
|
|
258
|
+
1: "4px",
|
|
259
|
+
2: "8px",
|
|
260
|
+
3: "12px",
|
|
261
|
+
4: "16px",
|
|
262
|
+
5: "20px",
|
|
263
|
+
6: "24px",
|
|
264
|
+
7: "28px",
|
|
265
|
+
8: "32px",
|
|
266
|
+
9: "36px",
|
|
267
|
+
10: "40px",
|
|
268
|
+
11: "44px",
|
|
269
|
+
12: "48px",
|
|
270
|
+
14: "56px",
|
|
271
|
+
15: "60px",
|
|
272
|
+
16: "64px",
|
|
273
|
+
18: "72px",
|
|
274
|
+
20: "80px",
|
|
275
|
+
22: "88px",
|
|
276
|
+
24: "96px",
|
|
277
|
+
25: "100px",
|
|
278
|
+
28: "112px",
|
|
279
|
+
30: "120px",
|
|
280
|
+
32: "128px",
|
|
281
|
+
36: "144px",
|
|
282
|
+
40: "160px",
|
|
283
|
+
44: "176px",
|
|
284
|
+
48: "192px",
|
|
285
|
+
50: "200px",
|
|
286
|
+
52: "208px",
|
|
287
|
+
54: "216px",
|
|
288
|
+
56: "224px",
|
|
289
|
+
60: "240px",
|
|
290
|
+
64: "256px",
|
|
291
|
+
65: "260px",
|
|
292
|
+
72: "288px",
|
|
293
|
+
75: "300px",
|
|
294
|
+
80: "320px",
|
|
295
|
+
85: "340px",
|
|
296
|
+
96: "384px",
|
|
297
|
+
100: "400px",
|
|
298
|
+
105: "420px",
|
|
299
|
+
110: "440px",
|
|
300
|
+
125: "500px",
|
|
301
|
+
140: "560px",
|
|
302
|
+
150: "600px",
|
|
303
|
+
200: "800px",
|
|
304
|
+
"0.25": "1px",
|
|
305
|
+
"0.5": "2px",
|
|
306
|
+
"0.75": "3px",
|
|
307
|
+
"1.5": "6px",
|
|
308
|
+
"2.5": "10px",
|
|
309
|
+
"3.5": "14px",
|
|
310
|
+
"4.5": "18px",
|
|
311
|
+
"7.5": "30px"
|
|
312
|
+
},
|
|
313
|
+
maxWidth: {
|
|
314
|
+
0: "0px",
|
|
315
|
+
1: "4px",
|
|
316
|
+
2: "8px",
|
|
317
|
+
3: "12px",
|
|
318
|
+
4: "16px",
|
|
319
|
+
5: "20px",
|
|
320
|
+
6: "24px",
|
|
321
|
+
7: "28px",
|
|
322
|
+
8: "32px",
|
|
323
|
+
9: "36px",
|
|
324
|
+
10: "40px",
|
|
325
|
+
11: "44px",
|
|
326
|
+
12: "48px",
|
|
327
|
+
14: "56px",
|
|
328
|
+
15: "60px",
|
|
329
|
+
16: "64px",
|
|
330
|
+
18: "72px",
|
|
331
|
+
20: "80px",
|
|
332
|
+
22: "88px",
|
|
333
|
+
24: "96px",
|
|
334
|
+
25: "100px",
|
|
335
|
+
28: "112px",
|
|
336
|
+
30: "120px",
|
|
337
|
+
32: "128px",
|
|
338
|
+
36: "144px",
|
|
339
|
+
40: "160px",
|
|
340
|
+
44: "176px",
|
|
341
|
+
48: "192px",
|
|
342
|
+
50: "200px",
|
|
343
|
+
52: "208px",
|
|
344
|
+
54: "216px",
|
|
345
|
+
56: "224px",
|
|
346
|
+
60: "240px",
|
|
347
|
+
64: "256px",
|
|
348
|
+
65: "260px",
|
|
349
|
+
72: "288px",
|
|
350
|
+
75: "300px",
|
|
351
|
+
80: "320px",
|
|
352
|
+
85: "340px",
|
|
353
|
+
96: "384px",
|
|
354
|
+
100: "400px",
|
|
355
|
+
105: "420px",
|
|
356
|
+
110: "440px",
|
|
357
|
+
125: "500px",
|
|
358
|
+
140: "560px",
|
|
359
|
+
150: "600px",
|
|
360
|
+
200: "800px",
|
|
361
|
+
"0.25": "1px",
|
|
362
|
+
"0.5": "2px",
|
|
363
|
+
"0.75": "3px",
|
|
364
|
+
"1.5": "6px",
|
|
365
|
+
"2.5": "10px",
|
|
366
|
+
"3.5": "14px",
|
|
367
|
+
"4.5": "18px",
|
|
368
|
+
"7.5": "30px"
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
};
|
|
372
|
+
export {
|
|
373
|
+
p as theme
|
|
374
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { getDefaultLocale as n } from "./userLocale.js";
|
|
2
|
+
const c = /* @__PURE__ */ new Set(["JPY", "CLP", "KRW", "LAK", "PYG", "VND", "VUV"]), s = (r) => c.has(r), a = (r, e = n(), t = 0, o = !1) => new Intl.NumberFormat(e, {
|
|
3
|
+
style: "currency",
|
|
4
|
+
currency: r,
|
|
5
|
+
maximumFractionDigits: 0,
|
|
6
|
+
currencyDisplay: o ? "narrowSymbol" : "symbol"
|
|
7
|
+
}).format(t).replaceAll(/\d/g, "").trim();
|
|
8
|
+
export {
|
|
9
|
+
a as getSymbol,
|
|
10
|
+
s as isZeroDecimal
|
|
11
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import n from "dayjs";
|
|
2
|
+
import i from "dayjs/plugin/customParseFormat.js";
|
|
3
|
+
import a from "dayjs/plugin/localizedFormat.js";
|
|
4
|
+
import c from "dayjs/plugin/quarterOfYear.js";
|
|
5
|
+
import u from "dayjs/plugin/timezone.js";
|
|
6
|
+
import f from "dayjs/plugin/utc.js";
|
|
7
|
+
const { isDayjs: s } = n;
|
|
8
|
+
n.extend(i);
|
|
9
|
+
n.extend(a);
|
|
10
|
+
n.extend(c);
|
|
11
|
+
n.extend(f);
|
|
12
|
+
n.extend(u);
|
|
13
|
+
const N = (t) => {
|
|
14
|
+
try {
|
|
15
|
+
n.tz(/* @__PURE__ */ new Date(), t);
|
|
16
|
+
} catch {
|
|
17
|
+
return !1;
|
|
18
|
+
}
|
|
19
|
+
return !0;
|
|
20
|
+
}, g = (t, r = "YYYY-MM-DD") => n(t).format(r), Y = (t, r = "h:mm a") => {
|
|
21
|
+
const e = String(t).padStart(4, 0);
|
|
22
|
+
return n(e, "hhmm").format(r);
|
|
23
|
+
}, b = (t) => n(new Date(Number.parseInt(t.slice(0, 8), 16) * 1e3)), h = (t, r) => {
|
|
24
|
+
if (!t)
|
|
25
|
+
return r ? n().tz(r).startOf("day") : n();
|
|
26
|
+
if (typeof t == "number") {
|
|
27
|
+
const e = t <= 2147483647 ? t * 1e3 : t;
|
|
28
|
+
return r ? n(e).tz(r) : n(e);
|
|
29
|
+
}
|
|
30
|
+
return typeof t == "string" ? r ? n(t).tz(r) : n() : s(t) ? t : t instanceof Date && !Number.isNaN(t.getTime()) ? r ? n.tz(m(t), r) : n(m(t)) : r ? n().tz(r) : n();
|
|
31
|
+
}, o = (t) => t.toString().padStart(2, "0"), m = (t) => {
|
|
32
|
+
const r = `${t.getFullYear()}-${o(t.getMonth() + 1)}-${o(t.getDate())}`, e = `${o(t.getHours())}:${o(t.getMinutes())}:${o(t.getSeconds())}`;
|
|
33
|
+
return `${r} ${e}`;
|
|
34
|
+
}, p = "T00:00:00", D = "T23:59:59", w = (t, r = !0) => {
|
|
35
|
+
const e = r ? p : D;
|
|
36
|
+
return new Date(g(t) + e);
|
|
37
|
+
}, F = (t, r, e = "day") => s(t) && s(r) ? t.isSame(r, e) : !1;
|
|
38
|
+
export {
|
|
39
|
+
b as dateFromObjectId,
|
|
40
|
+
g as formatDate,
|
|
41
|
+
Y as formatTime,
|
|
42
|
+
F as isSame,
|
|
43
|
+
N as isValidTimeZoneName,
|
|
44
|
+
h as now,
|
|
45
|
+
w as toDate
|
|
46
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { round as m } from "lodash-es";
|
|
2
|
+
import { isZeroDecimal as c } from "./currency.js";
|
|
3
|
+
import { getDefaultLocale as a } from "./userLocale.js";
|
|
4
|
+
const y = (o) => {
|
|
5
|
+
const r = Math.abs(o);
|
|
6
|
+
return r >= 0 && r <= 1e-3;
|
|
7
|
+
}, N = (o, r = null, t = a(), n = 2, s = !1, u = !1) => {
|
|
8
|
+
const e = { style: r ? "currency" : "decimal", minimumFractionDigits: n, maximumFractionDigits: n };
|
|
9
|
+
return r && (e.currency = r, e.currencyDisplay = u ? "narrowSymbol" : "symbol"), s ? i(o, t) : new Intl.NumberFormat(t, e).format(o);
|
|
10
|
+
}, D = (o, r) => {
|
|
11
|
+
let t = Number(r);
|
|
12
|
+
return c(o) ? m(t) : (m(t, 3) === m(t, 4) && (t = m(t, 3)), m(t, 2));
|
|
13
|
+
}, i = (o, r = a()) => new Intl.NumberFormat(r, { notation: "compact", maximumFractionDigits: 2 }).format(o);
|
|
14
|
+
export {
|
|
15
|
+
y as almostZero,
|
|
16
|
+
i as compactNumber,
|
|
17
|
+
N as numberFormat,
|
|
18
|
+
D as roundNumber
|
|
19
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { parsePhoneNumberFromString as n } from "libphonenumber-js";
|
|
2
|
+
const m = (t, o = "US") => {
|
|
3
|
+
const r = n(t, o);
|
|
4
|
+
return r == null ? void 0 : r.country;
|
|
5
|
+
}, N = (t, o = "US") => {
|
|
6
|
+
const r = n(t, o);
|
|
7
|
+
if (!(r != null && r.country))
|
|
8
|
+
return t;
|
|
9
|
+
const e = r.country === o ? "NATIONAL" : "INTERNATIONAL";
|
|
10
|
+
return r.format(e);
|
|
11
|
+
};
|
|
12
|
+
export {
|
|
13
|
+
N as formatPhoneNumber,
|
|
14
|
+
m as getRegionCode
|
|
15
|
+
};
|