@cascivo/react 0.8.0 → 0.10.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 +24 -11
- package/dist/combobox/combobox.js +73 -73
- package/dist/command-menu/command-menu.js +2 -2
- package/dist/date-picker/date-picker.js +95 -95
- package/dist/field/field.js +24 -15
- package/dist/filter/filter.js +12 -12
- package/dist/index.d.ts +74 -8
- package/dist/index.js +2 -0
- package/dist/node/accordion/accordion.js +95 -0
- package/dist/node/accordion/accordion.module.js +13 -0
- package/dist/node/action-sheet/action-sheet.js +91 -0
- package/dist/node/action-sheet/action-sheet.module.js +14 -0
- package/dist/node/alert/alert.js +55 -0
- package/dist/node/alert/alert.module.js +13 -0
- package/dist/node/alert-dialog/alert-dialog.js +68 -0
- package/dist/node/alert-dialog/alert-dialog.module.js +13 -0
- package/dist/node/app-shell/app-shell.js +80 -0
- package/dist/node/app-shell/app-shell.module.js +14 -0
- package/dist/node/aspect-ratio/aspect-ratio.js +22 -0
- package/dist/node/aspect-ratio/aspect-ratio.module.js +8 -0
- package/dist/node/avatar/avatar.js +57 -0
- package/dist/node/avatar/avatar.module.js +10 -0
- package/dist/node/avatar-group/avatar-group.js +26 -0
- package/dist/node/avatar-group/avatar-group.module.js +8 -0
- package/dist/node/badge/badge.js +17 -0
- package/dist/node/badge/badge.module.js +5 -0
- package/dist/node/blockquote/blockquote.js +18 -0
- package/dist/node/blockquote/blockquote.module.js +8 -0
- package/dist/node/bottom-sheet/bottom-sheet.js +111 -0
- package/dist/node/bottom-sheet/bottom-sheet.module.js +16 -0
- package/dist/node/breadcrumb/breadcrumb.js +28 -0
- package/dist/node/breadcrumb/breadcrumb.module.js +5 -0
- package/dist/node/button/button.js +31 -0
- package/dist/node/button/button.module.js +5 -0
- package/dist/node/button-group/button-group.js +39 -0
- package/dist/node/button-group/button-group.module.js +5 -0
- package/dist/node/calendar/calendar.js +195 -0
- package/dist/node/calendar/calendar.module.js +16 -0
- package/dist/node/card/card.js +45 -0
- package/dist/node/card/card.module.js +11 -0
- package/dist/node/carousel/carousel.js +138 -0
- package/dist/node/carousel/carousel.module.js +15 -0
- package/dist/node/chat-bubble/chat-bubble.js +33 -0
- package/dist/node/chat-bubble/chat-bubble.module.js +13 -0
- package/dist/node/checkbox/checkbox.js +38 -0
- package/dist/node/checkbox/checkbox.module.js +10 -0
- package/dist/node/checkbox-card/checkbox-card.js +48 -0
- package/dist/node/checkbox-card/checkbox-card.module.js +13 -0
- package/dist/node/code/code.js +16 -0
- package/dist/node/code/code.module.js +5 -0
- package/dist/node/code-snippet/code-snippet.js +116 -0
- package/dist/node/code-snippet/code-snippet.module.js +19 -0
- package/dist/node/code-snippet/highlight.js +69 -0
- package/dist/node/collapsible/collapsible.js +42 -0
- package/dist/node/collapsible/collapsible.module.js +10 -0
- package/dist/node/color-picker/color-picker.js +268 -0
- package/dist/node/color-picker/color-picker.module.js +20 -0
- package/dist/node/combobox/combobox.js +164 -0
- package/dist/node/combobox/combobox.module.js +21 -0
- package/dist/node/command-menu/command-menu.js +425 -0
- package/dist/node/command-menu/command-menu.module.js +36 -0
- package/dist/node/comparison/comparison.js +69 -0
- package/dist/node/comparison/comparison.module.js +11 -0
- package/dist/node/contained-list/contained-list.js +41 -0
- package/dist/node/contained-list/contained-list.module.js +13 -0
- package/dist/node/context-menu/context-menu.js +89 -0
- package/dist/node/context-menu/context-menu.module.js +9 -0
- package/dist/node/copy-button/copy-button.js +58 -0
- package/dist/node/copy-button/copy-button.module.js +8 -0
- package/dist/node/data-list/data-list.js +27 -0
- package/dist/node/data-list/data-list.module.js +10 -0
- package/dist/node/data-table/data-table.js +370 -0
- package/dist/node/data-table/data-table.module.js +35 -0
- package/dist/node/date-picker/date-picker.js +218 -0
- package/dist/node/date-picker/date-picker.module.js +25 -0
- package/dist/node/date-range-picker/date-range-picker.js +196 -0
- package/dist/node/date-range-picker/date-range-picker.module.js +20 -0
- package/dist/node/dock/dock.js +34 -0
- package/dist/node/dock/dock.module.js +10 -0
- package/dist/node/drawer/drawer.js +95 -0
- package/dist/node/drawer/drawer.module.js +15 -0
- package/dist/node/dropdown/dropdown.js +109 -0
- package/dist/node/dropdown/dropdown.module.js +11 -0
- package/dist/node/editable/editable.js +67 -0
- package/dist/node/editable/editable.module.js +13 -0
- package/dist/node/empty-state/empty-state.js +34 -0
- package/dist/node/empty-state/empty-state.module.js +11 -0
- package/dist/node/fab/fab.js +93 -0
- package/dist/node/fab/fab.module.js +14 -0
- package/dist/node/field/field.js +48 -0
- package/dist/node/field/field.module.js +9 -0
- package/dist/node/file-uploader/file-uploader.js +122 -0
- package/dist/node/file-uploader/file-uploader.module.js +20 -0
- package/dist/node/filter/filter.js +34 -0
- package/dist/node/filter/filter.module.js +8 -0
- package/dist/node/form/form.js +95 -0
- package/dist/node/form/form.module.js +5 -0
- package/dist/node/header/header.js +44 -0
- package/dist/node/header/header.module.js +13 -0
- package/dist/node/header-panel/header-panel.js +74 -0
- package/dist/node/header-panel/header-panel.module.js +11 -0
- package/dist/node/heading/heading.js +24 -0
- package/dist/node/heading/heading.module.js +5 -0
- package/dist/node/hover-card/hover-card.js +84 -0
- package/dist/node/hover-card/hover-card.module.js +8 -0
- package/dist/node/icon-button/icon-button.js +21 -0
- package/dist/node/icon-button/icon-button.module.js +5 -0
- package/dist/node/image/image.js +64 -0
- package/dist/node/image/image.module.js +11 -0
- package/dist/node/index.js +2 -0
- package/dist/node/indicator/indicator.js +18 -0
- package/dist/node/indicator/indicator.module.js +8 -0
- package/dist/node/inline-loading/inline-loading.js +76 -0
- package/dist/node/inline-loading/inline-loading.module.js +11 -0
- package/dist/node/input/input.js +54 -0
- package/dist/node/input/input.module.js +11 -0
- package/dist/node/input-group/input-group.js +41 -0
- package/dist/node/input-group/input-group.module.js +11 -0
- package/dist/node/item/item.js +52 -0
- package/dist/node/item/item.module.js +12 -0
- package/dist/node/join/join.js +14 -0
- package/dist/node/join/join.module.js +5 -0
- package/dist/node/kbd/kbd.js +16 -0
- package/dist/node/kbd/kbd.module.js +5 -0
- package/dist/node/label/label.js +25 -0
- package/dist/node/label/label.module.js +9 -0
- package/dist/node/layouts/src/auto-grid/auto-grid.js +19 -0
- package/dist/node/layouts/src/auto-grid/auto-grid.module.js +6 -0
- package/dist/node/layouts/src/center/center.js +18 -0
- package/dist/node/layouts/src/center/center.module.js +5 -0
- package/dist/node/layouts/src/columns/columns.js +23 -0
- package/dist/node/layouts/src/columns/columns.module.js +8 -0
- package/dist/node/layouts/src/flex/flex.js +22 -0
- package/dist/node/layouts/src/flex/flex.module.js +5 -0
- package/dist/node/layouts/src/grid/grid.js +57 -0
- package/dist/node/layouts/src/grid/grid.module.js +9 -0
- package/dist/node/layouts/src/spacer/spacer.js +19 -0
- package/dist/node/layouts/src/spacer/spacer.module.js +5 -0
- package/dist/node/link/link.js +22 -0
- package/dist/node/link/link.module.js +5 -0
- package/dist/node/list/list.js +23 -0
- package/dist/node/list/list.module.js +8 -0
- package/dist/node/log-viewer/log-viewer.js +184 -0
- package/dist/node/log-viewer/log-viewer.module.js +18 -0
- package/dist/node/menu/menu.js +121 -0
- package/dist/node/menu/menu.module.js +10 -0
- package/dist/node/menu-button/menu-button.js +92 -0
- package/dist/node/menu-button/menu-button.module.js +10 -0
- package/dist/node/menubar/menubar.js +103 -0
- package/dist/node/menubar/menubar.module.js +10 -0
- package/dist/node/modal/modal.js +70 -0
- package/dist/node/modal/modal.module.js +13 -0
- package/dist/node/multi-select/multi-select.js +106 -0
- package/dist/node/multi-select/multi-select.module.js +17 -0
- package/dist/node/native-select/native-select.js +37 -0
- package/dist/node/native-select/native-select.module.js +9 -0
- package/dist/node/navigation-menu/navigation-menu.js +99 -0
- package/dist/node/navigation-menu/navigation-menu.module.js +12 -0
- package/dist/node/notification/notification.js +134 -0
- package/dist/node/notification/notification.module.js +13 -0
- package/dist/node/number-input/number-input.js +145 -0
- package/dist/node/number-input/number-input.module.js +14 -0
- package/dist/node/otp-input/otp-input.js +70 -0
- package/dist/node/otp-input/otp-input.module.js +8 -0
- package/dist/node/overflow-menu/overflow-menu.js +65 -0
- package/dist/node/overflow-menu/overflow-menu.module.js +9 -0
- package/dist/node/pagination/pagination.js +92 -0
- package/dist/node/pagination/pagination.module.js +13 -0
- package/dist/node/password-input/password-input.js +80 -0
- package/dist/node/password-input/password-input.module.js +13 -0
- package/dist/node/popover/popover.js +49 -0
- package/dist/node/popover/popover.module.js +8 -0
- package/dist/node/popover/use-popover.js +57 -0
- package/dist/node/progress/progress.js +17 -0
- package/dist/node/progress/progress.module.js +8 -0
- package/dist/node/progress-bar/progress-bar.js +44 -0
- package/dist/node/progress-bar/progress-bar.module.js +13 -0
- package/dist/node/progress-circle/progress-circle.js +48 -0
- package/dist/node/progress-circle/progress-circle.module.js +11 -0
- package/dist/node/progress-indicator/progress-indicator.js +36 -0
- package/dist/node/progress-indicator/progress-indicator.module.js +12 -0
- package/dist/node/prose/prose.js +15 -0
- package/dist/node/prose/prose.module.js +5 -0
- package/dist/node/pull-to-refresh/pull-to-refresh.js +82 -0
- package/dist/node/pull-to-refresh/pull-to-refresh.module.js +11 -0
- package/dist/node/qr-code/encode.js +585 -0
- package/dist/node/qr-code/qr-code.js +41 -0
- package/dist/node/qr-code/qr-code.module.js +8 -0
- package/dist/node/radial-progress/radial-progress.js +28 -0
- package/dist/node/radial-progress/radial-progress.module.js +8 -0
- package/dist/node/radio/radio.js +49 -0
- package/dist/node/radio/radio.module.js +11 -0
- package/dist/node/radio-card/radio-card.js +63 -0
- package/dist/node/radio-card/radio-card.module.js +13 -0
- package/dist/node/rating-group/rating-group.js +37 -0
- package/dist/node/rating-group/rating-group.module.js +8 -0
- package/dist/node/react/src/index.js +138 -0
- package/dist/node/react/src/theme.js +54 -0
- package/dist/node/relative-time/relative-time.js +66 -0
- package/dist/node/relative-time/relative-time.module.js +5 -0
- package/dist/node/resizable/resizable.js +80 -0
- package/dist/node/resizable/resizable.module.js +10 -0
- package/dist/node/scroll-area/scroll-area.js +38 -0
- package/dist/node/scroll-area/scroll-area.module.js +5 -0
- package/dist/node/search/search.js +94 -0
- package/dist/node/search/search.module.js +11 -0
- package/dist/node/segmented-control/segmented-control.js +43 -0
- package/dist/node/segmented-control/segmented-control.module.js +8 -0
- package/dist/node/select/select.js +71 -0
- package/dist/node/select/select.module.js +13 -0
- package/dist/node/separator/separator.js +21 -0
- package/dist/node/separator/separator.module.js +5 -0
- package/dist/node/sheet/sheet.js +50 -0
- package/dist/node/sheet/sheet.module.js +11 -0
- package/dist/node/shell-header/shell-header.js +166 -0
- package/dist/node/shell-header/shell-header.module.js +25 -0
- package/dist/node/side-nav/side-nav.js +333 -0
- package/dist/node/side-nav/side-nav.module.js +33 -0
- package/dist/node/skeleton/skeleton.js +25 -0
- package/dist/node/skeleton/skeleton.module.js +9 -0
- package/dist/node/skip-nav/skip-nav.js +27 -0
- package/dist/node/skip-nav/skip-nav.module.js +5 -0
- package/dist/node/slider/slider.js +29 -0
- package/dist/node/slider/slider.module.js +9 -0
- package/dist/node/spinner/spinner.js +18 -0
- package/dist/node/spinner/spinner.module.js +8 -0
- package/dist/node/stack/stack.js +19 -0
- package/dist/node/stack/stack.module.js +8 -0
- package/dist/node/stat/stat.js +41 -0
- package/dist/node/stat/stat.module.js +13 -0
- package/dist/node/status/status.js +20 -0
- package/dist/node/status/status.module.js +9 -0
- package/dist/node/steps/steps.js +35 -0
- package/dist/node/steps/steps.module.js +10 -0
- package/dist/node/storage/src/drivers.js +36 -0
- package/dist/node/storage/src/persisted-signal.js +43 -0
- package/dist/node/structured-list/structured-list.js +101 -0
- package/dist/node/structured-list/structured-list.module.js +14 -0
- package/dist/node/swap/swap.js +36 -0
- package/dist/node/swap/swap.module.js +9 -0
- package/dist/node/swipe-item/swipe-item.js +62 -0
- package/dist/node/swipe-item/swipe-item.module.js +14 -0
- package/dist/node/switcher/switcher.js +32 -0
- package/dist/node/switcher/switcher.module.js +10 -0
- package/dist/node/tabs/tabs.js +95 -0
- package/dist/node/tabs/tabs.module.js +10 -0
- package/dist/node/tag/tag.js +26 -0
- package/dist/node/tag/tag.module.js +8 -0
- package/dist/node/tags-input/tags-input.js +64 -0
- package/dist/node/tags-input/tags-input.module.js +10 -0
- package/dist/node/text/text.js +18 -0
- package/dist/node/text/text.module.js +5 -0
- package/dist/node/textarea/textarea.js +56 -0
- package/dist/node/textarea/textarea.module.js +11 -0
- package/dist/node/tile/tile.js +39 -0
- package/dist/node/tile/tile.module.js +9 -0
- package/dist/node/time-picker/time-picker.js +62 -0
- package/dist/node/time-picker/time-picker.module.js +11 -0
- package/dist/node/timeline/timeline.js +41 -0
- package/dist/node/timeline/timeline.module.js +13 -0
- package/dist/node/toast/toast.js +85 -0
- package/dist/node/toast/toast.module.js +13 -0
- package/dist/node/toc/toc.js +42 -0
- package/dist/node/toc/toc.module.js +5 -0
- package/dist/node/toc/use-toc-from-region.js +18 -0
- package/dist/node/toggle/toggle.js +39 -0
- package/dist/node/toggle/toggle.module.js +10 -0
- package/dist/node/toggle-group/toggle-group.js +55 -0
- package/dist/node/toggle-group/toggle-group.module.js +8 -0
- package/dist/node/toggletip/toggletip.js +49 -0
- package/dist/node/toggletip/toggletip.module.js +9 -0
- package/dist/node/tooltip/tooltip.js +58 -0
- package/dist/node/tooltip/tooltip.module.js +8 -0
- package/dist/node/tree-view/tree-view.js +201 -0
- package/dist/node/tree-view/tree-view.module.js +15 -0
- package/dist/node/user/user.js +37 -0
- package/dist/node/user/user.module.js +11 -0
- package/dist/node/visually-hidden/visually-hidden.js +15 -0
- package/dist/node/visually-hidden/visually-hidden.module.js +5 -0
- package/dist/number-input/number-input.js +41 -41
- package/dist/react/src/theme.js +42 -31
- package/dist/search/search.js +35 -35
- package/dist/swap/swap.js +12 -12
- package/dist/time-picker/time-picker.js +24 -24
- package/dist/toggle/toggle.js +12 -12
- package/package.json +7 -6
- package/readme.body.md +24 -11
package/README.md
CHANGED
|
@@ -36,12 +36,17 @@ supplies the tokens and themes the components read.
|
|
|
36
36
|
Charts live in a separate package — add [`@cascivo/charts`](https://github.com/cascivo/cascivo/tree/main/packages/charts)
|
|
37
37
|
for `LineChart`, `AreaChart`, `BarChart`, `Sparkline`, and more.
|
|
38
38
|
|
|
39
|
+
> **Types are the reference.** The shipped `dist/index.d.ts` is a self-contained, flat
|
|
40
|
+
> rollup — every component's `…Props` interface is real, documentation-grade API. Reading
|
|
41
|
+
> it (or the per-component [`/llms/<name>.md`](https://cascivo.com/llms.txt)) is the fastest
|
|
42
|
+
> way to learn a component's props with no web access.
|
|
43
|
+
|
|
39
44
|
### Framework setup (Next.js App Router)
|
|
40
45
|
|
|
41
46
|
In a Server Component file (e.g. `app/layout.tsx`), import the themes once:
|
|
42
47
|
|
|
43
48
|
```tsx
|
|
44
|
-
import '@cascivo/themes/all'
|
|
49
|
+
import '@cascivo/themes/all.css'
|
|
45
50
|
```
|
|
46
51
|
|
|
47
52
|
Component CSS ships **per component** and is pulled in automatically when you
|
|
@@ -58,19 +63,27 @@ RSC without any extra wrapper.
|
|
|
58
63
|
> only if you prefer one explicit stylesheet over per-component tree-shaking, or
|
|
59
64
|
> for Vite SSR (below), where it is required.
|
|
60
65
|
|
|
61
|
-
> **Vite SSR / TanStack Start / Remix / workerd?**
|
|
62
|
-
>
|
|
63
|
-
>
|
|
64
|
-
>
|
|
65
|
-
> `@cascivo/
|
|
66
|
-
>
|
|
66
|
+
> **Vite SSR / TanStack Start / Remix / workerd?** The 4-line SSR checklist (full
|
|
67
|
+
> recipe: [USING-WITH-VITE-SSR.md](https://github.com/cascivo/cascivo/blob/main/docs/USING-WITH-VITE-SSR.md)):
|
|
68
|
+
>
|
|
69
|
+
> 1. **`ssr: { noExternal: [/^@cascivo\//] }`** in `vite.config` (or the
|
|
70
|
+
> `cascivoSsr()` plugin from `@cascivo/vite-plugin`). Without it a bare
|
|
71
|
+
> server-side ESM loader can't resolve the per-component `.css` side-effect
|
|
72
|
+
> imports and throws `Unknown file extension ".css"`.
|
|
73
|
+
> 2. **`@preact/signals-react` 3.x** — on React 19 the 2.x line fails to load. The
|
|
74
|
+
> peer range enforces `>=3`.
|
|
75
|
+
> 3. **Import the CSS once** in your root entry: `@cascivo/react/styles.css` +
|
|
76
|
+
> `@cascivo/themes/all` (+ `@cascivo/charts/styles.css` if you use charts).
|
|
77
|
+
> 4. **Theme without a mismatch:** inline `themePreloadScript()` in `<head>` and add
|
|
78
|
+
> `suppressHydrationWarning` to `<html>`, or hard-code `data-theme` for a fixed theme.
|
|
79
|
+
>
|
|
67
80
|
> Next.js App Router needs none of this.
|
|
68
81
|
|
|
69
82
|
## Use
|
|
70
83
|
|
|
71
84
|
```tsx
|
|
72
85
|
// once, in your entry file — themes are the only global import
|
|
73
|
-
import '@cascivo/themes/all' // tokens (once) + base typography + light & dark
|
|
86
|
+
import '@cascivo/themes/all.css' // tokens (once) + base typography + light & dark
|
|
74
87
|
|
|
75
88
|
// anywhere — each component brings its own CSS along
|
|
76
89
|
import { Button, Card, CardContent, Toggle } from '@cascivo/react'
|
|
@@ -97,9 +110,9 @@ Prefer à-la-carte? Import only the themes you need — each self-imports the to
|
|
|
97
110
|
(deduped by URL, so light + dark load tokens once):
|
|
98
111
|
|
|
99
112
|
```tsx
|
|
100
|
-
import '@cascivo/themes/base' // base typography (font/line-height/color)
|
|
101
|
-
import '@cascivo/themes/light'
|
|
102
|
-
import '@cascivo/themes/dark'
|
|
113
|
+
import '@cascivo/themes/base.css' // base typography (font/line-height/color)
|
|
114
|
+
import '@cascivo/themes/light.css'
|
|
115
|
+
import '@cascivo/themes/dark.css'
|
|
103
116
|
```
|
|
104
117
|
|
|
105
118
|
Scope a theme with `data-theme="light" | "dark" | "warm"` on any container. Brand
|
|
@@ -13,149 +13,149 @@ var p = n({
|
|
|
13
13
|
open: { on: { CLOSE: "closed" } }
|
|
14
14
|
}
|
|
15
15
|
});
|
|
16
|
-
function m({ options: n, value: m, defaultValue: h,
|
|
16
|
+
function m({ options: n, value: m, defaultValue: h, onValueChange: g, onChange: _, clearable: v = !1, searchable: y = !0, label: b, hint: x, error: S, size: C = "md", disabled: w = !1, labels: T, className: E, id: D }) {
|
|
17
17
|
o();
|
|
18
|
-
let [
|
|
19
|
-
m !== void 0 && (
|
|
20
|
-
let
|
|
18
|
+
let [O, k] = r(p), A = d(), j = D ?? `cascade-combobox-${A}`, M = `${A}-listbox`, N = f(null), P = T?.placeholder ?? c(s.combobox.placeholder), F = T?.empty ?? c(s.combobox.empty), I = T?.clear ?? c(s.combobox.clear), L = T?.search ?? c(s.combobox.search), R = i(m ?? h);
|
|
19
|
+
m !== void 0 && (R.value = m);
|
|
20
|
+
let z = i(""), B = i(0), V = O.value === "open", H = n.filter((e) => !y || !z.value ? !0 : e.label.toLowerCase().includes(z.value.toLowerCase())), U = n.find((e) => e.value === R.value);
|
|
21
21
|
a(() => {
|
|
22
|
-
if (!
|
|
22
|
+
if (!V) return;
|
|
23
23
|
let e = (e) => {
|
|
24
|
-
let t = document.getElementById(`${
|
|
25
|
-
t && !t.contains(e.target) &&
|
|
24
|
+
let t = document.getElementById(`${A}-root`);
|
|
25
|
+
t && !t.contains(e.target) && k("CLOSE");
|
|
26
26
|
};
|
|
27
27
|
return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
|
|
28
28
|
});
|
|
29
|
-
let
|
|
30
|
-
|
|
31
|
-
},
|
|
32
|
-
|
|
33
|
-
},
|
|
34
|
-
m === void 0 && (
|
|
35
|
-
},
|
|
36
|
-
m === void 0 && (
|
|
37
|
-
},
|
|
38
|
-
if (
|
|
39
|
-
let t =
|
|
40
|
-
t !== void 0 && (
|
|
41
|
-
},
|
|
42
|
-
(e.key === "Enter" || e.key === " " || e.key === "ArrowDown") && (e.preventDefault(),
|
|
43
|
-
},
|
|
29
|
+
let W = () => {
|
|
30
|
+
w || (z.value = "", B.value = 0, k("OPEN"), setTimeout(() => N.current?.focus(), 0));
|
|
31
|
+
}, G = () => {
|
|
32
|
+
k("CLOSE"), z.value = "";
|
|
33
|
+
}, K = g ?? _, q = (e) => {
|
|
34
|
+
m === void 0 && (R.value = e), K?.(e), G();
|
|
35
|
+
}, J = () => {
|
|
36
|
+
m === void 0 && (R.value = void 0), K?.(void 0);
|
|
37
|
+
}, Y = H.flatMap((e, t) => e.disabled ? [] : [t]), X = (e) => {
|
|
38
|
+
if (Y.length === 0) return;
|
|
39
|
+
let t = Y[(Y.indexOf(B.value) + e + Y.length) % Y.length];
|
|
40
|
+
t !== void 0 && (B.value = t);
|
|
41
|
+
}, Z = (e) => {
|
|
42
|
+
(e.key === "Enter" || e.key === " " || e.key === "ArrowDown") && (e.preventDefault(), W());
|
|
43
|
+
}, Q = (e) => {
|
|
44
44
|
switch (e.key) {
|
|
45
45
|
case "ArrowDown":
|
|
46
|
-
e.preventDefault(),
|
|
46
|
+
e.preventDefault(), X(1);
|
|
47
47
|
break;
|
|
48
48
|
case "ArrowUp":
|
|
49
|
-
e.preventDefault(),
|
|
49
|
+
e.preventDefault(), X(-1);
|
|
50
50
|
break;
|
|
51
51
|
case "Enter": {
|
|
52
52
|
e.preventDefault();
|
|
53
|
-
let t =
|
|
54
|
-
t && !t.disabled &&
|
|
53
|
+
let t = H[B.value];
|
|
54
|
+
t && !t.disabled && q(t.value);
|
|
55
55
|
break;
|
|
56
56
|
}
|
|
57
57
|
case "Escape":
|
|
58
|
-
e.preventDefault(),
|
|
58
|
+
e.preventDefault(), G();
|
|
59
59
|
break;
|
|
60
60
|
case "Tab":
|
|
61
|
-
|
|
61
|
+
G();
|
|
62
62
|
break;
|
|
63
63
|
}
|
|
64
|
-
},
|
|
64
|
+
}, $ = (e) => `${A}-option-${e}`;
|
|
65
65
|
return /* @__PURE__ */ u("div", {
|
|
66
|
-
id: `${
|
|
67
|
-
className: t(e.wrapper,
|
|
68
|
-
"data-state":
|
|
69
|
-
"data-size":
|
|
66
|
+
id: `${A}-root`,
|
|
67
|
+
className: t(e.wrapper, E),
|
|
68
|
+
"data-state": S ? "error" : O.value,
|
|
69
|
+
"data-size": C,
|
|
70
70
|
children: [
|
|
71
|
-
|
|
71
|
+
b && /* @__PURE__ */ l("label", {
|
|
72
72
|
className: e.label,
|
|
73
|
-
htmlFor:
|
|
74
|
-
children:
|
|
73
|
+
htmlFor: j,
|
|
74
|
+
children: b
|
|
75
75
|
}),
|
|
76
76
|
/* @__PURE__ */ u("div", {
|
|
77
77
|
className: e.field,
|
|
78
78
|
children: [/* @__PURE__ */ u("button", {
|
|
79
|
-
id:
|
|
79
|
+
id: j,
|
|
80
80
|
type: "button",
|
|
81
81
|
role: "combobox",
|
|
82
|
-
"aria-expanded":
|
|
83
|
-
"aria-controls":
|
|
82
|
+
"aria-expanded": V,
|
|
83
|
+
"aria-controls": M,
|
|
84
84
|
"aria-haspopup": "listbox",
|
|
85
|
-
"aria-activedescendant":
|
|
86
|
-
"aria-invalid":
|
|
87
|
-
"aria-describedby":
|
|
85
|
+
"aria-activedescendant": V && B.value >= 0 ? $(B.value) : void 0,
|
|
86
|
+
"aria-invalid": S ? !0 : void 0,
|
|
87
|
+
"aria-describedby": S ? `${A}-error` : x ? `${A}-hint` : void 0,
|
|
88
88
|
className: e.trigger,
|
|
89
|
-
disabled:
|
|
90
|
-
onKeyDown:
|
|
91
|
-
onClick:
|
|
89
|
+
disabled: w,
|
|
90
|
+
onKeyDown: Z,
|
|
91
|
+
onClick: V ? G : W,
|
|
92
92
|
children: [/* @__PURE__ */ l("span", {
|
|
93
|
-
className: t(e.value,
|
|
94
|
-
children:
|
|
93
|
+
className: t(e.value, U ? void 0 : e.placeholder),
|
|
94
|
+
children: U?.label ?? P
|
|
95
95
|
}), /* @__PURE__ */ l("span", {
|
|
96
96
|
className: e.chevron,
|
|
97
97
|
"aria-hidden": "true"
|
|
98
98
|
})]
|
|
99
|
-
}),
|
|
99
|
+
}), v && R.value !== void 0 && /* @__PURE__ */ l("button", {
|
|
100
100
|
type: "button",
|
|
101
101
|
className: e.clear,
|
|
102
|
-
"aria-label":
|
|
102
|
+
"aria-label": I,
|
|
103
103
|
onClick: (e) => {
|
|
104
|
-
e.stopPropagation(),
|
|
104
|
+
e.stopPropagation(), J();
|
|
105
105
|
},
|
|
106
106
|
children: "✕"
|
|
107
107
|
})]
|
|
108
108
|
}),
|
|
109
109
|
/* @__PURE__ */ u("div", {
|
|
110
110
|
role: "listbox",
|
|
111
|
-
id:
|
|
111
|
+
id: M,
|
|
112
112
|
className: e.listbox,
|
|
113
|
-
"data-state":
|
|
114
|
-
"aria-label":
|
|
115
|
-
children: [
|
|
113
|
+
"data-state": V ? "open" : "closed",
|
|
114
|
+
"aria-label": b,
|
|
115
|
+
children: [y && V && /* @__PURE__ */ l("div", {
|
|
116
116
|
className: e.searchWrapper,
|
|
117
117
|
children: /* @__PURE__ */ l("input", {
|
|
118
|
-
ref:
|
|
118
|
+
ref: N,
|
|
119
119
|
type: "text",
|
|
120
120
|
className: e.search,
|
|
121
|
-
value:
|
|
121
|
+
value: z.value,
|
|
122
122
|
onChange: (e) => {
|
|
123
|
-
|
|
123
|
+
z.value = e.target.value, B.value = 0;
|
|
124
124
|
},
|
|
125
|
-
onKeyDown:
|
|
126
|
-
"aria-label":
|
|
125
|
+
onKeyDown: Q,
|
|
126
|
+
"aria-label": L,
|
|
127
127
|
autoComplete: "off"
|
|
128
128
|
})
|
|
129
|
-
}),
|
|
129
|
+
}), H.length === 0 ? /* @__PURE__ */ l("div", {
|
|
130
130
|
className: e.empty,
|
|
131
|
-
children:
|
|
132
|
-
}) :
|
|
133
|
-
id:
|
|
131
|
+
children: F
|
|
132
|
+
}) : H.map((t, n) => /* @__PURE__ */ l("div", {
|
|
133
|
+
id: $(n),
|
|
134
134
|
role: "option",
|
|
135
|
-
"aria-selected": t.value ===
|
|
135
|
+
"aria-selected": t.value === R.value,
|
|
136
136
|
"aria-disabled": t.disabled || void 0,
|
|
137
|
-
"data-state": n ===
|
|
137
|
+
"data-state": n === B.value ? "active" : void 0,
|
|
138
138
|
"data-disabled": t.disabled || void 0,
|
|
139
139
|
className: e.option,
|
|
140
140
|
onMouseEnter: () => {
|
|
141
|
-
t.disabled || (
|
|
141
|
+
t.disabled || (B.value = n);
|
|
142
142
|
},
|
|
143
143
|
onClick: () => {
|
|
144
|
-
t.disabled ||
|
|
144
|
+
t.disabled || q(t.value);
|
|
145
145
|
},
|
|
146
146
|
children: t.label
|
|
147
147
|
}, t.value))]
|
|
148
148
|
}),
|
|
149
|
-
|
|
150
|
-
id: `${
|
|
149
|
+
S && /* @__PURE__ */ l("span", {
|
|
150
|
+
id: `${A}-error`,
|
|
151
151
|
className: e.error,
|
|
152
152
|
role: "alert",
|
|
153
|
-
children:
|
|
153
|
+
children: S
|
|
154
154
|
}),
|
|
155
|
-
!
|
|
156
|
-
id: `${
|
|
155
|
+
!S && x && /* @__PURE__ */ l("span", {
|
|
156
|
+
id: `${A}-hint`,
|
|
157
157
|
className: e.hint,
|
|
158
|
-
children:
|
|
158
|
+
children: x
|
|
159
159
|
})
|
|
160
160
|
]
|
|
161
161
|
});
|
|
@@ -282,6 +282,7 @@ function v({ open: m, onOpenChange: v, groups: te, placeholder: y, emptyLabel: b
|
|
|
282
282
|
role: "listbox",
|
|
283
283
|
id: k,
|
|
284
284
|
"aria-label": S,
|
|
285
|
+
tabIndex: 0,
|
|
285
286
|
children: H.map((e, r) => /* @__PURE__ */ d("div", {
|
|
286
287
|
role: "group",
|
|
287
288
|
"aria-label": e.heading,
|
|
@@ -338,8 +339,7 @@ function v({ open: m, onOpenChange: v, groups: te, placeholder: y, emptyLabel: b
|
|
|
338
339
|
}),
|
|
339
340
|
r.actions && r.actions.length > 0 && /* @__PURE__ */ u("span", {
|
|
340
341
|
className: n.actions,
|
|
341
|
-
children: r.actions.map((e) => /* @__PURE__ */ d("
|
|
342
|
-
type: "button",
|
|
342
|
+
children: r.actions.map((e) => /* @__PURE__ */ d("span", {
|
|
343
343
|
className: n.action,
|
|
344
344
|
onClick: (t) => {
|
|
345
345
|
t.stopPropagation(), Y(e);
|
|
@@ -2,25 +2,25 @@
|
|
|
2
2
|
|
|
3
3
|
import e from "./date-picker.module.js";
|
|
4
4
|
import { batch as t, cn as n, createMachine as r, useMachine as i, useSignal as a, useSignalEffect as o, useSignals as s } from "@cascivo/core";
|
|
5
|
-
import { builtin as c, currentLocale as
|
|
6
|
-
import { jsx as
|
|
7
|
-
import { useId as
|
|
5
|
+
import { builtin as c, currentLocale as ee, t as l } from "@cascivo/i18n";
|
|
6
|
+
import { jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
7
|
+
import { useId as f, useRef as te } from "react";
|
|
8
8
|
//#region ../components/src/date-picker/date-picker.tsx
|
|
9
|
-
var
|
|
9
|
+
var p = r({
|
|
10
10
|
initial: "closed",
|
|
11
11
|
states: {
|
|
12
12
|
closed: { on: { OPEN: "open" } },
|
|
13
13
|
open: { on: { CLOSE: "closed" } }
|
|
14
14
|
}
|
|
15
15
|
});
|
|
16
|
-
function
|
|
16
|
+
function ne(e) {
|
|
17
17
|
try {
|
|
18
18
|
let t = new Intl.Locale(e).weekInfo;
|
|
19
19
|
if (t) return t.firstDay % 7;
|
|
20
20
|
} catch {}
|
|
21
21
|
return 1;
|
|
22
22
|
}
|
|
23
|
-
function
|
|
23
|
+
function m(e, t, n) {
|
|
24
24
|
let r = new Date(Date.UTC(e, t, 1)), i = new Date(Date.UTC(e, t + 1, 0)), a = (r.getUTCDay() - n + 7) % 7, o = [];
|
|
25
25
|
for (let e = 0; e < a; e++) o.push(null);
|
|
26
26
|
for (let n = 1; n <= i.getUTCDate(); n++) o.push(new Date(Date.UTC(e, t, n)));
|
|
@@ -29,170 +29,170 @@ function g(e, t, n) {
|
|
|
29
29
|
for (let e = 0; e < o.length; e += 7) s.push(o.slice(e, e + 7));
|
|
30
30
|
return s;
|
|
31
31
|
}
|
|
32
|
-
function
|
|
32
|
+
function h(e, t) {
|
|
33
33
|
return new Intl.DateTimeFormat(t).format(e);
|
|
34
34
|
}
|
|
35
|
-
function
|
|
35
|
+
function g(e) {
|
|
36
36
|
return e.toISOString().slice(0, 10);
|
|
37
37
|
}
|
|
38
|
-
function
|
|
38
|
+
function _(e) {
|
|
39
39
|
let [t, n, r] = e.split("-").map(Number);
|
|
40
40
|
return new Date(Date.UTC(t, n - 1, r));
|
|
41
41
|
}
|
|
42
|
-
function
|
|
42
|
+
function v({ value: r, defaultValue: v, onValueChange: y, onChange: b, min: x, max: S, clearable: C = !1, label: w, hint: T, error: E, size: D = "md", disabled: O = !1, labels: k, className: re, id: A }) {
|
|
43
43
|
s();
|
|
44
|
-
let [
|
|
45
|
-
r !== void 0 && (
|
|
46
|
-
let
|
|
44
|
+
let [j, M] = i(p), N = f(), P = A ?? `cascade-date-picker-${N}`, F = `${N}-grid`, I = ee(), ie = k?.placeholder ?? l(c.datePicker.placeholder), ae = k?.previousMonth ?? l(c.datePicker.previousMonth), L = k?.nextMonth ?? l(c.datePicker.nextMonth), R = k?.clear ?? l(c.datePicker.clear), z = /* @__PURE__ */ new Date(), B = g(z), V = a(r ?? v);
|
|
45
|
+
r !== void 0 && (V.value = r);
|
|
46
|
+
let H = a(V.value ? _(V.value).getUTCFullYear() : z.getUTCFullYear()), U = a(V.value ? _(V.value).getUTCMonth() : z.getUTCMonth()), W = a(V.value), G = te(null);
|
|
47
47
|
o(() => {
|
|
48
|
-
if (
|
|
48
|
+
if (j.value !== "open") return;
|
|
49
49
|
let e = (e) => {
|
|
50
|
-
|
|
50
|
+
G.current && !G.current.contains(e.target) && M("CLOSE");
|
|
51
51
|
};
|
|
52
52
|
return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
|
|
53
53
|
});
|
|
54
|
-
let
|
|
55
|
-
|
|
56
|
-
},
|
|
57
|
-
|
|
58
|
-
},
|
|
59
|
-
e.stopPropagation(), r === void 0 && (
|
|
60
|
-
},
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
}) :
|
|
64
|
-
},
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
}) :
|
|
68
|
-
},
|
|
69
|
-
let n = new Date(Date.UTC(2024, 0, 7 +
|
|
70
|
-
return
|
|
71
|
-
}), Q = new Intl.DateTimeFormat(
|
|
54
|
+
let K = () => {
|
|
55
|
+
O || M("OPEN");
|
|
56
|
+
}, q = () => M("CLOSE"), J = y ?? b, Y = (e) => {
|
|
57
|
+
x && e < x || S && e > S || (r === void 0 && (V.value = e), J?.(e), q());
|
|
58
|
+
}, oe = (e) => {
|
|
59
|
+
e.stopPropagation(), r === void 0 && (V.value = void 0), J?.(void 0);
|
|
60
|
+
}, se = () => {
|
|
61
|
+
U.value === 0 ? t(() => {
|
|
62
|
+
H.value--, U.value = 11;
|
|
63
|
+
}) : U.value--;
|
|
64
|
+
}, ce = () => {
|
|
65
|
+
U.value === 11 ? t(() => {
|
|
66
|
+
H.value++, U.value = 0;
|
|
67
|
+
}) : U.value++;
|
|
68
|
+
}, X = ne(I), Z = m(H.value, U.value, X), le = new Intl.DateTimeFormat(I, { weekday: "short" }), ue = Array.from({ length: 7 }, (e, t) => {
|
|
69
|
+
let n = new Date(Date.UTC(2024, 0, 7 + X + t));
|
|
70
|
+
return le.format(n);
|
|
71
|
+
}), Q = new Intl.DateTimeFormat(I, {
|
|
72
72
|
month: "long",
|
|
73
73
|
year: "numeric"
|
|
74
|
-
}).format(new Date(Date.UTC(
|
|
75
|
-
let n =
|
|
74
|
+
}).format(new Date(Date.UTC(H.value, U.value, 1))), de = (e) => {
|
|
75
|
+
let n = W.value;
|
|
76
76
|
if (!n) return;
|
|
77
|
-
let r =
|
|
77
|
+
let r = _(n), i;
|
|
78
78
|
if (e.key === "ArrowRight") i = new Date(Date.UTC(r.getUTCFullYear(), r.getUTCMonth(), r.getUTCDate() + 1));
|
|
79
79
|
else if (e.key === "ArrowLeft") i = new Date(Date.UTC(r.getUTCFullYear(), r.getUTCMonth(), r.getUTCDate() - 1));
|
|
80
80
|
else if (e.key === "ArrowDown") i = new Date(Date.UTC(r.getUTCFullYear(), r.getUTCMonth(), r.getUTCDate() + 7));
|
|
81
81
|
else if (e.key === "ArrowUp") i = new Date(Date.UTC(r.getUTCFullYear(), r.getUTCMonth(), r.getUTCDate() - 7));
|
|
82
82
|
else if (e.key === "Enter" || e.key === " ") {
|
|
83
|
-
e.preventDefault(),
|
|
83
|
+
e.preventDefault(), Y(n);
|
|
84
84
|
return;
|
|
85
85
|
} else if (e.key === "Escape") {
|
|
86
|
-
|
|
86
|
+
q();
|
|
87
87
|
return;
|
|
88
88
|
} else return;
|
|
89
89
|
if (e.preventDefault(), i) {
|
|
90
|
-
let e =
|
|
91
|
-
if (
|
|
92
|
-
|
|
93
|
-
|
|
90
|
+
let e = g(i);
|
|
91
|
+
if (x && e < x || S && e > S) return;
|
|
92
|
+
W.value = e, t(() => {
|
|
93
|
+
H.value = i.getUTCFullYear(), U.value = i.getUTCMonth();
|
|
94
94
|
});
|
|
95
95
|
}
|
|
96
|
-
}, $ =
|
|
97
|
-
return /* @__PURE__ */
|
|
98
|
-
ref:
|
|
99
|
-
className: n(e.wrapper,
|
|
100
|
-
"data-state":
|
|
101
|
-
"data-size":
|
|
96
|
+
}, $ = V.value ? h(_(V.value), I) : "";
|
|
97
|
+
return /* @__PURE__ */ d("div", {
|
|
98
|
+
ref: G,
|
|
99
|
+
className: n(e.wrapper, re),
|
|
100
|
+
"data-state": E ? "error" : j.value,
|
|
101
|
+
"data-size": D,
|
|
102
102
|
children: [
|
|
103
|
-
|
|
103
|
+
w && /* @__PURE__ */ u("label", {
|
|
104
104
|
className: e.label,
|
|
105
|
-
htmlFor:
|
|
106
|
-
children:
|
|
105
|
+
htmlFor: P,
|
|
106
|
+
children: w
|
|
107
107
|
}),
|
|
108
|
-
/* @__PURE__ */
|
|
108
|
+
/* @__PURE__ */ d("div", {
|
|
109
109
|
className: e.field,
|
|
110
|
-
children: [/* @__PURE__ */
|
|
111
|
-
id:
|
|
110
|
+
children: [/* @__PURE__ */ d("button", {
|
|
111
|
+
id: P,
|
|
112
112
|
type: "button",
|
|
113
113
|
role: "combobox",
|
|
114
|
-
"aria-expanded":
|
|
115
|
-
"aria-controls":
|
|
114
|
+
"aria-expanded": j.value === "open",
|
|
115
|
+
"aria-controls": F,
|
|
116
116
|
"aria-haspopup": "dialog",
|
|
117
|
-
"aria-invalid":
|
|
118
|
-
"aria-describedby":
|
|
117
|
+
"aria-invalid": E ? !0 : void 0,
|
|
118
|
+
"aria-describedby": E ? `${N}-error` : T ? `${N}-hint` : void 0,
|
|
119
119
|
className: e.trigger,
|
|
120
|
-
disabled:
|
|
121
|
-
onClick:
|
|
122
|
-
children: [/* @__PURE__ */
|
|
120
|
+
disabled: O,
|
|
121
|
+
onClick: j.value === "open" ? q : K,
|
|
122
|
+
children: [/* @__PURE__ */ u("span", {
|
|
123
123
|
className: n(e.value, $ ? void 0 : e.placeholder),
|
|
124
|
-
children: $ ||
|
|
125
|
-
}), /* @__PURE__ */
|
|
124
|
+
children: $ || ie
|
|
125
|
+
}), /* @__PURE__ */ u("span", {
|
|
126
126
|
className: e.icon,
|
|
127
127
|
"aria-hidden": "true",
|
|
128
128
|
children: "📅"
|
|
129
129
|
})]
|
|
130
|
-
}),
|
|
130
|
+
}), C && V.value !== void 0 && /* @__PURE__ */ u("button", {
|
|
131
131
|
type: "button",
|
|
132
132
|
className: e.clear,
|
|
133
|
-
"aria-label":
|
|
134
|
-
onClick:
|
|
133
|
+
"aria-label": R,
|
|
134
|
+
onClick: oe,
|
|
135
135
|
children: "✕"
|
|
136
136
|
})]
|
|
137
137
|
}),
|
|
138
|
-
/* @__PURE__ */
|
|
139
|
-
id:
|
|
138
|
+
/* @__PURE__ */ d("div", {
|
|
139
|
+
id: F,
|
|
140
140
|
role: "dialog",
|
|
141
141
|
"aria-label": Q,
|
|
142
142
|
className: e.calendar,
|
|
143
|
-
"data-state":
|
|
144
|
-
onKeyDown:
|
|
145
|
-
children: [/* @__PURE__ */
|
|
143
|
+
"data-state": j.value,
|
|
144
|
+
onKeyDown: de,
|
|
145
|
+
children: [/* @__PURE__ */ d("div", {
|
|
146
146
|
className: e.header,
|
|
147
147
|
children: [
|
|
148
|
-
/* @__PURE__ */
|
|
148
|
+
/* @__PURE__ */ u("button", {
|
|
149
149
|
type: "button",
|
|
150
150
|
className: e.navButton,
|
|
151
|
-
"aria-label":
|
|
152
|
-
onClick:
|
|
151
|
+
"aria-label": ae,
|
|
152
|
+
onClick: se,
|
|
153
153
|
children: "‹"
|
|
154
154
|
}),
|
|
155
|
-
/* @__PURE__ */
|
|
155
|
+
/* @__PURE__ */ u("span", {
|
|
156
156
|
className: e.monthLabel,
|
|
157
157
|
"aria-live": "polite",
|
|
158
158
|
children: Q
|
|
159
159
|
}),
|
|
160
|
-
/* @__PURE__ */
|
|
160
|
+
/* @__PURE__ */ u("button", {
|
|
161
161
|
type: "button",
|
|
162
162
|
className: e.navButton,
|
|
163
|
-
"aria-label":
|
|
164
|
-
onClick:
|
|
163
|
+
"aria-label": L,
|
|
164
|
+
onClick: ce,
|
|
165
165
|
children: "›"
|
|
166
166
|
})
|
|
167
167
|
]
|
|
168
|
-
}), /* @__PURE__ */
|
|
168
|
+
}), /* @__PURE__ */ d("table", {
|
|
169
169
|
role: "grid",
|
|
170
170
|
className: e.grid,
|
|
171
|
-
children: [/* @__PURE__ */
|
|
171
|
+
children: [/* @__PURE__ */ u("thead", { children: /* @__PURE__ */ u("tr", { children: ue.map((t) => /* @__PURE__ */ u("th", {
|
|
172
172
|
className: e.weekday,
|
|
173
173
|
abbr: t,
|
|
174
174
|
scope: "col",
|
|
175
175
|
children: t
|
|
176
|
-
}, t)) }) }), /* @__PURE__ */
|
|
177
|
-
if (!t) return /* @__PURE__ */
|
|
178
|
-
let r =
|
|
179
|
-
return /* @__PURE__ */
|
|
176
|
+
}, t)) }) }), /* @__PURE__ */ u("tbody", { children: Z.map((t, n) => /* @__PURE__ */ u("tr", { children: t.map((t, n) => {
|
|
177
|
+
if (!t) return /* @__PURE__ */ u("td", { className: e.empty }, n);
|
|
178
|
+
let r = g(t), i = r === V.value, a = r === B, o = r === W.value, s = x !== void 0 && r < x || S !== void 0 && r > S;
|
|
179
|
+
return /* @__PURE__ */ u("td", {
|
|
180
180
|
className: e.cell,
|
|
181
|
-
children: /* @__PURE__ */
|
|
181
|
+
children: /* @__PURE__ */ u("button", {
|
|
182
182
|
type: "button",
|
|
183
183
|
className: e.day,
|
|
184
184
|
tabIndex: o ? 0 : -1,
|
|
185
185
|
"aria-pressed": i,
|
|
186
|
-
"aria-label":
|
|
186
|
+
"aria-label": h(t, I),
|
|
187
187
|
"aria-current": a ? "date" : void 0,
|
|
188
188
|
"aria-disabled": s || void 0,
|
|
189
189
|
"data-selected": i || void 0,
|
|
190
190
|
"data-today": a || void 0,
|
|
191
191
|
onClick: () => {
|
|
192
|
-
s ||
|
|
192
|
+
s || Y(r);
|
|
193
193
|
},
|
|
194
194
|
onFocus: () => {
|
|
195
|
-
|
|
195
|
+
W.value = r;
|
|
196
196
|
},
|
|
197
197
|
children: t.getUTCDate()
|
|
198
198
|
})
|
|
@@ -200,19 +200,19 @@ function b({ value: r, defaultValue: b, onChange: x, min: S, max: C, clearable:
|
|
|
200
200
|
}) }, n)) })]
|
|
201
201
|
})]
|
|
202
202
|
}),
|
|
203
|
-
|
|
204
|
-
id: `${
|
|
203
|
+
E && /* @__PURE__ */ u("span", {
|
|
204
|
+
id: `${N}-error`,
|
|
205
205
|
className: e.error,
|
|
206
206
|
role: "alert",
|
|
207
|
-
children:
|
|
207
|
+
children: E
|
|
208
208
|
}),
|
|
209
|
-
!
|
|
210
|
-
id: `${
|
|
209
|
+
!E && T && /* @__PURE__ */ u("span", {
|
|
210
|
+
id: `${N}-hint`,
|
|
211
211
|
className: e.hint,
|
|
212
|
-
children:
|
|
212
|
+
children: T
|
|
213
213
|
})
|
|
214
214
|
]
|
|
215
215
|
});
|
|
216
216
|
}
|
|
217
217
|
//#endregion
|
|
218
|
-
export {
|
|
218
|
+
export { v as DatePicker };
|