@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
package/dist/styles.source.css
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
/* Streamdown ships Tailwind classes in pre-built dist JS; */
|
|
9
9
|
@source 'streamdown/dist';
|
|
10
10
|
@source '@streamdown/mermaid/dist';
|
|
11
|
+
@import 'streamdown/styles.css';
|
|
11
12
|
|
|
12
13
|
@custom-variant dark (&:is(.dark *));
|
|
13
14
|
|
|
@@ -81,6 +82,9 @@
|
|
|
81
82
|
/* default focus ring: inner border (1px dark) + outer glow (3px light, 2px visible beyond inner) */
|
|
82
83
|
--shadow-focus-ring-destructive:
|
|
83
84
|
0 0 0 1px var(--ring-destructive), 0 0 0 3px var(--ring-destructive-muted);
|
|
85
|
+
--shadow-pinned-column:
|
|
86
|
+
4px 0 8px 0 var(--effect-shadow-md), 3px 0 2px 0 var(--effect-shadow-md);
|
|
87
|
+
/* horizontal edge shadow for the last pinned column in data grids */
|
|
84
88
|
|
|
85
89
|
--radius-none: 0px;
|
|
86
90
|
--radius-xs: 2px;
|
|
@@ -169,6 +173,18 @@
|
|
|
169
173
|
var(--dusk-550) 50%,
|
|
170
174
|
var(--dusk-300) 100%
|
|
171
175
|
);
|
|
176
|
+
--gradient-active: linear-gradient(
|
|
177
|
+
90deg,
|
|
178
|
+
var(--color-muted-foreground) 0%,
|
|
179
|
+
var(--color-muted-foreground) 32%,
|
|
180
|
+
color-mix(in oklab, var(--fjord-550) 60%, var(--color-muted-foreground)) 42%,
|
|
181
|
+
color-mix(in oklab, var(--nordic-400) 60%, var(--color-muted-foreground))
|
|
182
|
+
48%,
|
|
183
|
+
color-mix(in oklab, var(--aurora-400) 60%, var(--color-muted-foreground))
|
|
184
|
+
54%,
|
|
185
|
+
var(--color-muted-foreground) 64%,
|
|
186
|
+
var(--color-muted-foreground) 100%
|
|
187
|
+
);
|
|
172
188
|
}
|
|
173
189
|
|
|
174
190
|
.dark {
|
|
@@ -231,6 +247,12 @@
|
|
|
231
247
|
body {
|
|
232
248
|
@apply bg-background text-foreground;
|
|
233
249
|
}
|
|
250
|
+
|
|
251
|
+
:where(svg.tabler-icon) {
|
|
252
|
+
width: 1rem;
|
|
253
|
+
height: 1rem;
|
|
254
|
+
stroke-width: 1.5;
|
|
255
|
+
}
|
|
234
256
|
}
|
|
235
257
|
|
|
236
258
|
@layer utilities {
|
|
@@ -280,6 +302,10 @@
|
|
|
280
302
|
[data-slot='loader-rect'] {
|
|
281
303
|
animation: none;
|
|
282
304
|
}
|
|
305
|
+
|
|
306
|
+
[data-sd-animate] {
|
|
307
|
+
animation: none;
|
|
308
|
+
}
|
|
283
309
|
}
|
|
284
310
|
|
|
285
311
|
[data-state='closed'] {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cognite/aura",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"sideEffects": [
|
|
6
6
|
"**/*.scss",
|
|
@@ -47,6 +47,10 @@
|
|
|
47
47
|
"import": "./dist/components/ui/core/button-group/button-group.js",
|
|
48
48
|
"types": "./dist/components/ui/core/button-group/button-group.d.ts"
|
|
49
49
|
},
|
|
50
|
+
"./components/calendar": {
|
|
51
|
+
"import": "./dist/components/ui/core/calendar/calendar.js",
|
|
52
|
+
"types": "./dist/components/ui/core/calendar/calendar.d.ts"
|
|
53
|
+
},
|
|
50
54
|
"./components/card": {
|
|
51
55
|
"import": "./dist/components/ui/core/card/card.js",
|
|
52
56
|
"types": "./dist/components/ui/core/card/card.d.ts"
|
|
@@ -63,6 +67,10 @@
|
|
|
63
67
|
"import": "./dist/components/ui/core/collapsible/collapsible.js",
|
|
64
68
|
"types": "./dist/components/ui/core/collapsible/collapsible.d.ts"
|
|
65
69
|
},
|
|
70
|
+
"./components/combobox": {
|
|
71
|
+
"import": "./dist/components/ui/core/combobox/combobox.js",
|
|
72
|
+
"types": "./dist/components/ui/core/combobox/combobox.d.ts"
|
|
73
|
+
},
|
|
66
74
|
"./components/command": {
|
|
67
75
|
"import": "./dist/components/ui/core/command/command.js",
|
|
68
76
|
"types": "./dist/components/ui/core/command/command.d.ts"
|
|
@@ -175,6 +183,10 @@
|
|
|
175
183
|
"import": "./dist/components/ui/core/skeleton/skeleton.js",
|
|
176
184
|
"types": "./dist/components/ui/core/skeleton/skeleton.d.ts"
|
|
177
185
|
},
|
|
186
|
+
"./components/slider": {
|
|
187
|
+
"import": "./dist/components/ui/core/slider/slider.js",
|
|
188
|
+
"types": "./dist/components/ui/core/slider/slider.d.ts"
|
|
189
|
+
},
|
|
178
190
|
"./components/sonner-toast": {
|
|
179
191
|
"import": "./dist/components/ui/core/sonner-toast/sonner-toast.js",
|
|
180
192
|
"types": "./dist/components/ui/core/sonner-toast/sonner-toast.d.ts"
|
|
@@ -183,6 +195,10 @@
|
|
|
183
195
|
"import": "./dist/components/ui/core/sources/sources.js",
|
|
184
196
|
"types": "./dist/components/ui/core/sources/sources.d.ts"
|
|
185
197
|
},
|
|
198
|
+
"./components/switch": {
|
|
199
|
+
"import": "./dist/components/ui/core/switch/switch.js",
|
|
200
|
+
"types": "./dist/components/ui/core/switch/switch.d.ts"
|
|
201
|
+
},
|
|
186
202
|
"./components/tabs": {
|
|
187
203
|
"import": "./dist/components/ui/core/tabs/tabs.js",
|
|
188
204
|
"types": "./dist/components/ui/core/tabs/tabs.d.ts"
|
|
@@ -211,6 +227,14 @@
|
|
|
211
227
|
"import": "./dist/components/ui/core/chart/index.js",
|
|
212
228
|
"types": "./dist/components/ui/core/chart/index.d.ts"
|
|
213
229
|
},
|
|
230
|
+
"./highlight-code": {
|
|
231
|
+
"import": "./dist/lib/highlight-code.js",
|
|
232
|
+
"types": "./dist/lib/highlight-code.d.ts"
|
|
233
|
+
},
|
|
234
|
+
"./icons": {
|
|
235
|
+
"import": "./dist/icons/index.js",
|
|
236
|
+
"types": "./dist/icons/index.d.ts"
|
|
237
|
+
},
|
|
214
238
|
"./utils": {
|
|
215
239
|
"import": "./dist/lib/utils.js",
|
|
216
240
|
"types": "./dist/lib/utils.d.ts"
|
|
@@ -235,7 +259,7 @@
|
|
|
235
259
|
"DESIGN.md"
|
|
236
260
|
],
|
|
237
261
|
"dependencies": {
|
|
238
|
-
"@base-ui/react": "^1.
|
|
262
|
+
"@base-ui/react": "^1.6.0",
|
|
239
263
|
"@streamdown/mermaid": "^1.0.2",
|
|
240
264
|
"@tabler/icons-react": "^3.35.0",
|
|
241
265
|
"class-variance-authority": "^0.7.1",
|
|
@@ -258,14 +282,16 @@
|
|
|
258
282
|
"@storybook/react-vite": "10.3.5",
|
|
259
283
|
"@swc-node/register": "1.11.1",
|
|
260
284
|
"@tailwindcss/vite": "^4.3.1",
|
|
285
|
+
"@tanstack/react-table": "^8.7.4",
|
|
286
|
+
"@tanstack/react-virtual": "^3.10.8",
|
|
261
287
|
"@testing-library/jest-dom": "^6.4.6",
|
|
262
288
|
"@testing-library/react": "16.0.1",
|
|
263
289
|
"@testing-library/user-event": "^14.6.1",
|
|
264
290
|
"@types/react": "18.3.14",
|
|
265
291
|
"@types/react-dom": "18.3.2",
|
|
266
|
-
"@vitejs/plugin-react": "^5.
|
|
267
|
-
"@vitest/browser": "^4.1.
|
|
268
|
-
"@vitest/browser-playwright": "^4.1.
|
|
292
|
+
"@vitejs/plugin-react": "^5.2.0",
|
|
293
|
+
"@vitest/browser": "^4.1.10",
|
|
294
|
+
"@vitest/browser-playwright": "^4.1.10",
|
|
269
295
|
"eslint": "9.39.4",
|
|
270
296
|
"eslint-plugin-check-file": "^2.7.1",
|
|
271
297
|
"react": "^18.3.1",
|
|
@@ -276,17 +302,25 @@
|
|
|
276
302
|
"tailwindcss": "^4.3.1",
|
|
277
303
|
"typescript": "5.8.3",
|
|
278
304
|
"typescript-eslint": "^8.57.1",
|
|
279
|
-
"vite": "
|
|
305
|
+
"vite": "^8.1.4",
|
|
280
306
|
"vite-plugin-dts": "^4.5.4",
|
|
281
|
-
"vitest": "^4.1.
|
|
307
|
+
"vitest": "^4.1.10"
|
|
282
308
|
},
|
|
283
309
|
"peerDependencies": {
|
|
284
|
-
"
|
|
310
|
+
"@tanstack/react-table": "^8.7.4",
|
|
311
|
+
"@tanstack/react-virtual": "^3.10.8",
|
|
312
|
+
"eslint": "^9.6.0 || ^10.0.0",
|
|
285
313
|
"react": "^18.3.1",
|
|
286
314
|
"recharts": "^3.7.0",
|
|
287
315
|
"tailwindcss": "^4.1.17"
|
|
288
316
|
},
|
|
289
317
|
"peerDependenciesMeta": {
|
|
318
|
+
"@tanstack/react-table": {
|
|
319
|
+
"optional": true
|
|
320
|
+
},
|
|
321
|
+
"@tanstack/react-virtual": {
|
|
322
|
+
"optional": true
|
|
323
|
+
},
|
|
290
324
|
"recharts": {
|
|
291
325
|
"optional": true
|
|
292
326
|
},
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
import { jsxs as x, jsx as l } from "react/jsx-runtime";
|
|
2
|
-
import C from "react";
|
|
3
|
-
import { cn as b } from "../../../../../../lib/utils.js";
|
|
4
|
-
import { getCalendarDays as E, getWeekdayNames as O, getWeekNumbers as T, isDateInRange as v, isSameDay as f, isToday as B, isOutsideMonth as K } from "../../utils/calendar-utils.js";
|
|
5
|
-
import { CalendarHeader as P } from "../calendar-header/calendar-header.js";
|
|
6
|
-
import { DAYS_IN_WEEK as p } from "../constants.js";
|
|
7
|
-
function _({
|
|
8
|
-
isOutsideMonth: r,
|
|
9
|
-
isSelected: t,
|
|
10
|
-
isToday: s,
|
|
11
|
-
isRangeStart: o,
|
|
12
|
-
isRangeEnd: c,
|
|
13
|
-
isInRange: a,
|
|
14
|
-
isInHoverRange: i
|
|
15
|
-
}) {
|
|
16
|
-
return b(
|
|
17
|
-
"w-9 h-9 flex items-center justify-center text-sm font-medium cursor-pointer select-none relative transition-colors",
|
|
18
|
-
"focus-visible:ring-2 focus-visible:ring-border focus-visible:outline-none",
|
|
19
|
-
// border-radius for range endpoints
|
|
20
|
-
o && c && "rounded-lg",
|
|
21
|
-
o && !c && "rounded-l-lg",
|
|
22
|
-
c && !o && "rounded-r-lg",
|
|
23
|
-
// selected day
|
|
24
|
-
t && "bg-primary-background text-foreground-on-primary hover:bg-primary-background",
|
|
25
|
-
// unselected text
|
|
26
|
-
!t && r && "text-muted-foreground/50",
|
|
27
|
-
!t && !r && (a || i) ? "text-foreground" : !t && !r && "text-secondary-foreground",
|
|
28
|
-
// range highlight
|
|
29
|
-
!t && (a || i) && "bg-accent-background",
|
|
30
|
-
!t && "hover:bg-accent-background hover:rounded-lg hover:text-foreground",
|
|
31
|
-
// today outline
|
|
32
|
-
s && !t && "border border-border rounded-lg"
|
|
33
|
-
);
|
|
34
|
-
}
|
|
35
|
-
const W = ({
|
|
36
|
-
displayedMonth: r,
|
|
37
|
-
selectedRange: t,
|
|
38
|
-
hoverDate: s,
|
|
39
|
-
displayWeekNumber: o = !1,
|
|
40
|
-
onDateClick: c,
|
|
41
|
-
onMonthChange: a,
|
|
42
|
-
onDateHover: i,
|
|
43
|
-
className: N
|
|
44
|
-
}) => {
|
|
45
|
-
const [n, m] = t, h = E(r), M = O(), k = o ? T(h) : [], Y = () => {
|
|
46
|
-
a(r.subtract(1, "month"));
|
|
47
|
-
}, D = () => {
|
|
48
|
-
a(r.add(1, "month"));
|
|
49
|
-
}, w = (e) => {
|
|
50
|
-
const d = {
|
|
51
|
-
isOutsideMonth: K(e, r),
|
|
52
|
-
isToday: B(e),
|
|
53
|
-
isSelected: f(e, n) || f(e, m),
|
|
54
|
-
isRangeStart: f(e, n),
|
|
55
|
-
isRangeEnd: f(e, m),
|
|
56
|
-
isInRange: v(e, n, m),
|
|
57
|
-
isInHoverRange: !1
|
|
58
|
-
};
|
|
59
|
-
if (s && n && !m) {
|
|
60
|
-
const u = n.isBefore(s) ? n : s, g = n.isBefore(s) ? s : n;
|
|
61
|
-
d.isInHoverRange = v(e, u, g);
|
|
62
|
-
}
|
|
63
|
-
return d;
|
|
64
|
-
};
|
|
65
|
-
return /* @__PURE__ */ x("div", { "data-slot": "calendar", className: b("flex flex-col gap-4", N), children: [
|
|
66
|
-
/* @__PURE__ */ l(
|
|
67
|
-
P,
|
|
68
|
-
{
|
|
69
|
-
displayedMonth: r,
|
|
70
|
-
onPrevMonth: Y,
|
|
71
|
-
onNextMonth: D,
|
|
72
|
-
onMonthChange: a
|
|
73
|
-
}
|
|
74
|
-
),
|
|
75
|
-
/* @__PURE__ */ x(
|
|
76
|
-
"div",
|
|
77
|
-
{
|
|
78
|
-
className: b(
|
|
79
|
-
"grid gap-0",
|
|
80
|
-
o ? "grid-cols-calendar-weeks" : "grid-cols-calendar"
|
|
81
|
-
),
|
|
82
|
-
children: [
|
|
83
|
-
o && /* @__PURE__ */ l("div", { className: "text-xs font-semibold text-muted-foreground text-center py-2 px-1", children: "#" }),
|
|
84
|
-
M.map((e) => /* @__PURE__ */ l(
|
|
85
|
-
"div",
|
|
86
|
-
{
|
|
87
|
-
className: "text-xs font-medium text-muted-foreground text-center py-2 px-1 tracking-tighter",
|
|
88
|
-
children: e
|
|
89
|
-
},
|
|
90
|
-
e
|
|
91
|
-
)),
|
|
92
|
-
h.map((e, d) => {
|
|
93
|
-
const u = w(e), g = Math.floor(d / p), I = o && d % p === 0, j = `day-${e.format("YYYY-MM-DD")}`;
|
|
94
|
-
return /* @__PURE__ */ x(C.Fragment, { children: [
|
|
95
|
-
I && /* @__PURE__ */ l("div", { className: "text-xs text-muted-foreground text-center flex items-center justify-center h-9", children: k[g] }),
|
|
96
|
-
/* @__PURE__ */ l(
|
|
97
|
-
"div",
|
|
98
|
-
{
|
|
99
|
-
className: _(u),
|
|
100
|
-
onClick: () => c(e),
|
|
101
|
-
onMouseEnter: () => i?.(e),
|
|
102
|
-
onMouseLeave: () => i?.(null),
|
|
103
|
-
role: "gridcell",
|
|
104
|
-
tabIndex: 0,
|
|
105
|
-
"aria-label": e.format("DD MMMM YYYY"),
|
|
106
|
-
"aria-selected": u.isSelected,
|
|
107
|
-
children: e.date()
|
|
108
|
-
}
|
|
109
|
-
)
|
|
110
|
-
] }, j);
|
|
111
|
-
})
|
|
112
|
-
]
|
|
113
|
-
}
|
|
114
|
-
)
|
|
115
|
-
] });
|
|
116
|
-
};
|
|
117
|
-
export {
|
|
118
|
-
W as Calendar
|
|
119
|
-
};
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import { jsxs as t, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { IconChevronLeft as h, IconChevronRight as u, IconChevronDown as p } from "@tabler/icons-react";
|
|
3
|
-
import i from "dayjs";
|
|
4
|
-
import { cn as N } from "../../../../../../lib/utils.js";
|
|
5
|
-
import { Button as l } from "../../../button/button.js";
|
|
6
|
-
import { DropdownMenu as g, DropdownMenuTrigger as v, DropdownMenuContent as x, DropdownMenuItem as w } from "../../../dropdown-menu/dropdown-menu.js";
|
|
7
|
-
const M = Array.from(
|
|
8
|
-
{ length: 12 },
|
|
9
|
-
(r, a) => i().month(a).format("MMMM")
|
|
10
|
-
), c = i().year() - 50, b = i().year() + 10, z = Array.from(
|
|
11
|
-
{ length: b - c + 1 },
|
|
12
|
-
(r, a) => c + a
|
|
13
|
-
), d = ({
|
|
14
|
-
label: r,
|
|
15
|
-
items: a,
|
|
16
|
-
onSelect: s
|
|
17
|
-
}) => /* @__PURE__ */ t(g, { modal: !1, children: [
|
|
18
|
-
/* @__PURE__ */ e(
|
|
19
|
-
v,
|
|
20
|
-
{
|
|
21
|
-
render: /* @__PURE__ */ t(
|
|
22
|
-
l,
|
|
23
|
-
{
|
|
24
|
-
variant: "ghost",
|
|
25
|
-
size: "sm",
|
|
26
|
-
className: "h-7 px-2 gap-1 text-sm font-medium text-secondary-foreground",
|
|
27
|
-
children: [
|
|
28
|
-
r,
|
|
29
|
-
/* @__PURE__ */ e(p, { className: "size-4" })
|
|
30
|
-
]
|
|
31
|
-
}
|
|
32
|
-
)
|
|
33
|
-
}
|
|
34
|
-
),
|
|
35
|
-
/* @__PURE__ */ e(x, { className: "max-h-60 overflow-y-auto", children: a.map(({ value: n, label: m }) => /* @__PURE__ */ e(w, { onClick: () => s(n), children: m }, n)) })
|
|
36
|
-
] }), E = ({
|
|
37
|
-
displayedMonth: r,
|
|
38
|
-
onPrevMonth: a,
|
|
39
|
-
onNextMonth: s,
|
|
40
|
-
onMonthChange: n,
|
|
41
|
-
className: m
|
|
42
|
-
}) => /* @__PURE__ */ t(
|
|
43
|
-
"div",
|
|
44
|
-
{
|
|
45
|
-
"data-slot": "calendar-header",
|
|
46
|
-
className: N("flex items-center justify-between pt-1 w-full", m),
|
|
47
|
-
children: [
|
|
48
|
-
/* @__PURE__ */ e(
|
|
49
|
-
l,
|
|
50
|
-
{
|
|
51
|
-
variant: "ghost",
|
|
52
|
-
size: "icon-sm",
|
|
53
|
-
className: "size-7 rounded-md text-secondary-foreground",
|
|
54
|
-
onClick: a,
|
|
55
|
-
"aria-label": "Previous month",
|
|
56
|
-
children: /* @__PURE__ */ e(h, { className: "size-4" })
|
|
57
|
-
}
|
|
58
|
-
),
|
|
59
|
-
/* @__PURE__ */ t("div", { className: "flex items-center gap-0.5", children: [
|
|
60
|
-
/* @__PURE__ */ e(
|
|
61
|
-
d,
|
|
62
|
-
{
|
|
63
|
-
label: r.format("MMMM"),
|
|
64
|
-
items: M.map((o, f) => ({ value: f, label: o })),
|
|
65
|
-
onSelect: (o) => n(r.date(1).month(o))
|
|
66
|
-
}
|
|
67
|
-
),
|
|
68
|
-
/* @__PURE__ */ e(
|
|
69
|
-
d,
|
|
70
|
-
{
|
|
71
|
-
label: r.format("YYYY"),
|
|
72
|
-
items: z.map((o) => ({ value: o, label: String(o) })),
|
|
73
|
-
onSelect: (o) => n(r.date(1).year(o))
|
|
74
|
-
}
|
|
75
|
-
)
|
|
76
|
-
] }),
|
|
77
|
-
/* @__PURE__ */ e(
|
|
78
|
-
l,
|
|
79
|
-
{
|
|
80
|
-
variant: "ghost",
|
|
81
|
-
size: "icon-sm",
|
|
82
|
-
className: "size-7 rounded-md text-secondary-foreground",
|
|
83
|
-
onClick: s,
|
|
84
|
-
"aria-label": "Next month",
|
|
85
|
-
children: /* @__PURE__ */ e(u, { className: "size-4" })
|
|
86
|
-
}
|
|
87
|
-
)
|
|
88
|
-
]
|
|
89
|
-
}
|
|
90
|
-
);
|
|
91
|
-
export {
|
|
92
|
-
E as CalendarHeader
|
|
93
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
const _ = 24, N = 12, U = 60, o = 1, t = 7, E = 9, T = 0, c = 0, n = 23, s = 59, I = 0;
|
|
2
|
-
export {
|
|
3
|
-
t as DAYS_IN_WEEK,
|
|
4
|
-
T as DEFAULT_MINUTE,
|
|
5
|
-
E as DEFAULT_START_HOUR,
|
|
6
|
-
n as END_OF_DAY_HOUR,
|
|
7
|
-
s as END_OF_DAY_MINUTE,
|
|
8
|
-
N as HOURS_IN_12H,
|
|
9
|
-
_ as HOURS_IN_DAY,
|
|
10
|
-
I as MIDNIGHT_HOUR,
|
|
11
|
-
U as MINUTES_IN_HOUR,
|
|
12
|
-
o as MINUTE_INCREMENT,
|
|
13
|
-
c as START_OF_DAY_HOUR
|
|
14
|
-
};
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import r from "dayjs";
|
|
2
|
-
import c from "dayjs/plugin/isBetween.js";
|
|
3
|
-
import d from "dayjs/plugin/isSameOrBefore.js";
|
|
4
|
-
import m from "dayjs/plugin/weekOfYear.js";
|
|
5
|
-
import { DAYS_IN_WEEK as u } from "../shared/constants.js";
|
|
6
|
-
r.extend(c);
|
|
7
|
-
r.extend(d);
|
|
8
|
-
r.extend(m);
|
|
9
|
-
function p(e, t) {
|
|
10
|
-
const n = e, a = n.startOf("month").startOf("week"), i = n.endOf("month").endOf("week"), f = [];
|
|
11
|
-
let s = a;
|
|
12
|
-
for (; s.isSameOrBefore(i, "day"); )
|
|
13
|
-
f.push(s), s = s.add(1, "day");
|
|
14
|
-
return f;
|
|
15
|
-
}
|
|
16
|
-
function g(e, t, n) {
|
|
17
|
-
return !t || !n || !e.isValid() || !t.isValid() || !n.isValid() || t.isAfter(n, "day") ? !1 : e.isBetween(t, n, "day", "[]");
|
|
18
|
-
}
|
|
19
|
-
function b(e, t) {
|
|
20
|
-
return e.month() !== t.month();
|
|
21
|
-
}
|
|
22
|
-
function M(e, t) {
|
|
23
|
-
return e.isSame(r(), "day");
|
|
24
|
-
}
|
|
25
|
-
function S(e, t) {
|
|
26
|
-
const a = r().startOf("week");
|
|
27
|
-
return Array.from({ length: u }, (l, i) => a.add(i, "day").format("dd"));
|
|
28
|
-
}
|
|
29
|
-
function y(e) {
|
|
30
|
-
return e.week();
|
|
31
|
-
}
|
|
32
|
-
function W(e) {
|
|
33
|
-
const t = [];
|
|
34
|
-
for (let n = 0; n < e.length; n += u) {
|
|
35
|
-
const o = e[n];
|
|
36
|
-
o && t.push(y(o));
|
|
37
|
-
}
|
|
38
|
-
return t;
|
|
39
|
-
}
|
|
40
|
-
function N(e, t) {
|
|
41
|
-
return !e || !t ? !1 : e.isSame(t, "day");
|
|
42
|
-
}
|
|
43
|
-
export {
|
|
44
|
-
p as getCalendarDays,
|
|
45
|
-
y as getWeekNumber,
|
|
46
|
-
W as getWeekNumbers,
|
|
47
|
-
S as getWeekdayNames,
|
|
48
|
-
g as isDateInRange,
|
|
49
|
-
b as isOutsideMonth,
|
|
50
|
-
N as isSameDay,
|
|
51
|
-
M as isToday
|
|
52
|
-
};
|
|
File without changes
|
|
File without changes
|
/package/dist/components/ui/core/{date-time-pickers/shared/calendar → calendar}/calendar.d.ts
RENAMED
|
File without changes
|