@giddaa-housing/ui 0.1.0 → 1.1.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 +18 -6
- package/css/base.css +37 -0
- package/css/components.css +135 -0
- package/css/generated/shared.css +1 -0
- package/css/giddaa.css +402 -0
- package/css/preset.css +77 -0
- package/css/styles.css +2 -0
- package/css/theme.css +255 -0
- package/dist/accordion.d.ts +9 -10
- package/dist/accordion.js +41 -117
- package/dist/activity-timeline.d.ts +29 -0
- package/dist/activity-timeline.js +97 -0
- package/dist/alert.d.ts +8 -9
- package/dist/alert.js +53 -141
- package/dist/auth-layout.d.ts +23 -0
- package/dist/auth-layout.js +153 -0
- package/dist/avatar.d.ts +6 -6
- package/dist/avatar.js +40 -142
- package/dist/badge.d.ts +12 -13
- package/dist/badge.js +66 -114
- package/dist/bar-chart.d.ts +136 -114
- package/dist/bar-chart.js +244 -297
- package/dist/breadcrumb.d.ts +5 -5
- package/dist/breadcrumb.js +56 -148
- package/dist/bullet-chart.d.ts +33 -33
- package/dist/bullet-chart.js +123 -183
- package/dist/button-BZIeyUw6.d.ts +17 -0
- package/dist/button-group.d.ts +13 -16
- package/dist/button-group.js +38 -163
- package/dist/button.d.ts +2 -19
- package/dist/button.js +90 -142
- package/dist/calendar.d.ts +6 -6
- package/dist/calendar.js +134 -288
- package/dist/card.d.ts +14 -16
- package/dist/card.js +58 -174
- package/dist/carousel.d.ts +34 -35
- package/dist/carousel.js +319 -378
- package/dist/chart.d.ts +58 -59
- package/dist/chart.js +350 -466
- package/dist/checkbox.d.ts +10 -12
- package/dist/checkbox.js +84 -84
- package/dist/cn-BI_4DMBf.js +23 -0
- package/dist/collapsible.d.ts +7 -8
- package/dist/collapsible.js +23 -77
- package/dist/combobox.d.ts +10 -10
- package/dist/combobox.js +220 -696
- package/dist/cta.d.ts +64 -0
- package/dist/cta.js +192 -0
- package/dist/currency-selector.d.ts +41 -0
- package/dist/currency-selector.js +114 -0
- package/dist/data-table.d.ts +164 -0
- package/dist/data-table.js +673 -0
- package/dist/date-picker.d.ts +27 -20
- package/dist/date-picker.js +122 -520
- package/dist/details-card.d.ts +19 -0
- package/dist/details-card.js +118 -0
- package/dist/dialog.d.ts +13 -14
- package/dist/dialog.js +117 -320
- package/dist/dropdown-menu.d.ts +14 -14
- package/dist/dropdown-menu.js +170 -365
- package/dist/dropzone.d.ts +55 -55
- package/dist/dropzone.js +328 -467
- package/dist/editorial-card.d.ts +27 -0
- package/dist/editorial-card.js +144 -0
- package/dist/empty-state.d.ts +8 -9
- package/dist/empty-state.js +48 -135
- package/dist/field.d.ts +23 -25
- package/dist/field.js +111 -327
- package/dist/filter.d.ts +118 -0
- package/dist/filter.js +775 -0
- package/dist/footer.d.ts +40 -0
- package/dist/footer.js +227 -0
- package/dist/funnel-chart.d.ts +38 -41
- package/dist/funnel-chart.js +168 -563
- package/dist/gallery-indicator.d.ts +17 -0
- package/dist/gallery-indicator.js +75 -0
- package/dist/heatmap-chart.d.ts +95 -0
- package/dist/heatmap-chart.js +197 -0
- package/dist/infotip.d.ts +10 -0
- package/dist/infotip.js +40 -0
- package/dist/input-CfoEJ8A6.d.ts +12 -0
- package/dist/input-group.d.ts +16 -19
- package/dist/input-group.js +92 -372
- package/dist/input-size-context-C-SFx9sx.d.ts +10 -0
- package/dist/input-size-context.d.ts +2 -11
- package/dist/input-size-context.js +14 -20
- package/dist/input.d.ts +2 -13
- package/dist/input.js +23 -79
- package/dist/item.d.ts +7 -8
- package/dist/item.js +22 -89
- package/dist/kpi-card.d.ts +18 -20
- package/dist/kpi-card.js +84 -232
- package/dist/label.d.ts +6 -6
- package/dist/label.js +39 -66
- package/dist/line-chart.d.ts +88 -89
- package/dist/line-chart.js +143 -262
- package/dist/logo.d.ts +4 -4
- package/dist/logo.js +87 -141
- package/dist/map-indicator.d.ts +13 -0
- package/dist/map-indicator.js +83 -0
- package/dist/match.d.ts +15 -0
- package/dist/match.js +68 -0
- package/dist/media-gallery-hero.d.ts +58 -0
- package/dist/media-gallery-hero.js +201 -0
- package/dist/media-player.d.ts +60 -0
- package/dist/media-player.js +919 -0
- package/dist/multi-step-form.d.ts +56 -0
- package/dist/multi-step-form.js +342 -0
- package/dist/number-input.d.ts +34 -34
- package/dist/number-input.js +62 -413
- package/dist/page-header.d.ts +10 -11
- package/dist/page-header.js +34 -107
- package/dist/pagination.d.ts +17 -20
- package/dist/pagination.js +132 -341
- package/dist/password-input.d.ts +5 -12
- package/dist/password-input.js +32 -354
- package/dist/phone-input.d.ts +19 -19
- package/dist/phone-input.js +232 -561
- package/dist/photo-gallery.d.ts +20 -20
- package/dist/photo-gallery.js +314 -746
- package/dist/picker-lzgmsNfG.js +32 -0
- package/dist/pie-chart.d.ts +60 -60
- package/dist/pie-chart.js +141 -184
- package/dist/popover.d.ts +9 -9
- package/dist/popover.js +60 -156
- package/dist/price-tag.d.ts +34 -0
- package/dist/price-tag.js +118 -0
- package/dist/progress.d.ts +18 -16
- package/dist/progress.js +156 -300
- package/dist/property-listing-card.d.ts +29 -0
- package/dist/property-listing-card.js +117 -0
- package/dist/radar-chart.d.ts +108 -0
- package/dist/radar-chart.js +172 -0
- package/dist/radio-group.d.ts +11 -13
- package/dist/radio-group.js +47 -96
- package/dist/review-block.d.ts +18 -0
- package/dist/review-block.js +154 -0
- package/dist/rich-text-editor.d.ts +30 -14
- package/dist/rich-text-editor.js +594 -979
- package/dist/scatter-chart.d.ts +140 -0
- package/dist/scatter-chart.js +248 -0
- package/dist/search-input.d.ts +8 -15
- package/dist/search-input.js +58 -408
- package/dist/select.d.ts +8 -8
- package/dist/select.js +131 -291
- package/dist/separator.d.ts +8 -9
- package/dist/separator.js +31 -70
- package/dist/sheet.d.ts +11 -11
- package/dist/sheet.js +84 -262
- package/dist/sidebar.d.ts +32 -37
- package/dist/sidebar.js +380 -1055
- package/dist/size-context-D4mYvcg8.d.ts +10 -0
- package/dist/size-context.d.ts +2 -11
- package/dist/size-context.js +14 -18
- package/dist/skeleton.d.ts +4 -5
- package/dist/skeleton.js +9 -45
- package/dist/slider.d.ts +27 -0
- package/dist/slider.js +81 -0
- package/dist/sparkline.d.ts +43 -46
- package/dist/sparkline.js +223 -561
- package/dist/stepper.d.ts +23 -24
- package/dist/stepper.js +149 -276
- package/dist/styles.css +9995 -2
- package/dist/switch.d.ts +10 -12
- package/dist/switch.js +49 -106
- package/dist/table-card.d.ts +35 -0
- package/dist/table-card.js +125 -0
- package/dist/table.d.ts +18 -14
- package/dist/table.js +114 -182
- package/dist/tabs.d.ts +23 -15
- package/dist/tabs.js +62 -149
- package/dist/tag.d.ts +22 -23
- package/dist/tag.js +104 -156
- package/dist/testimonial-block.d.ts +33 -0
- package/dist/testimonial-block.js +208 -0
- package/dist/textarea-IS_D8pXf.d.ts +11 -0
- package/dist/textarea.d.ts +2 -12
- package/dist/textarea.js +20 -74
- package/dist/time-picker.d.ts +11 -11
- package/dist/time-picker.js +247 -464
- package/dist/toast.d.ts +16 -18
- package/dist/toast.js +154 -310
- package/dist/tooltip.d.ts +9 -10
- package/dist/tooltip.js +33 -91
- package/dist/tree-map.d.ts +54 -57
- package/dist/tree-map.js +231 -646
- package/dist/use-uncontrolled-CLfM1XbB.js +21 -0
- package/dist/waterfall-chart.d.ts +126 -0
- package/dist/waterfall-chart.js +480 -0
- package/package.json +123 -34
- package/dist/accordion.js.map +0 -1
- package/dist/alert.js.map +0 -1
- package/dist/avatar.js.map +0 -1
- package/dist/badge.js.map +0 -1
- package/dist/bar-chart.js.map +0 -1
- package/dist/base.css +0 -32
- package/dist/breadcrumb.js.map +0 -1
- package/dist/bullet-chart.js.map +0 -1
- package/dist/button-group.js.map +0 -1
- package/dist/button.js.map +0 -1
- package/dist/calendar.js.map +0 -1
- package/dist/card.js.map +0 -1
- package/dist/carousel.js.map +0 -1
- package/dist/chart.js.map +0 -1
- package/dist/checkbox.js.map +0 -1
- package/dist/collapsible.js.map +0 -1
- package/dist/combobox.js.map +0 -1
- package/dist/date-picker.js.map +0 -1
- package/dist/dialog.js.map +0 -1
- package/dist/dropdown-menu.js.map +0 -1
- package/dist/dropzone.js.map +0 -1
- package/dist/empty-state.js.map +0 -1
- package/dist/field.js.map +0 -1
- package/dist/files/red-hat-display-latin-300-italic.woff +0 -0
- package/dist/files/red-hat-display-latin-300-italic.woff2 +0 -0
- package/dist/files/red-hat-display-latin-300-normal.woff +0 -0
- package/dist/files/red-hat-display-latin-300-normal.woff2 +0 -0
- package/dist/files/red-hat-display-latin-400-italic.woff +0 -0
- package/dist/files/red-hat-display-latin-400-italic.woff2 +0 -0
- package/dist/files/red-hat-display-latin-400-normal.woff +0 -0
- package/dist/files/red-hat-display-latin-400-normal.woff2 +0 -0
- package/dist/files/red-hat-display-latin-500-italic.woff +0 -0
- package/dist/files/red-hat-display-latin-500-italic.woff2 +0 -0
- package/dist/files/red-hat-display-latin-500-normal.woff +0 -0
- package/dist/files/red-hat-display-latin-500-normal.woff2 +0 -0
- package/dist/files/red-hat-display-latin-600-italic.woff +0 -0
- package/dist/files/red-hat-display-latin-600-italic.woff2 +0 -0
- package/dist/files/red-hat-display-latin-600-normal.woff +0 -0
- package/dist/files/red-hat-display-latin-600-normal.woff2 +0 -0
- package/dist/files/red-hat-display-latin-700-italic.woff +0 -0
- package/dist/files/red-hat-display-latin-700-italic.woff2 +0 -0
- package/dist/files/red-hat-display-latin-700-normal.woff +0 -0
- package/dist/files/red-hat-display-latin-700-normal.woff2 +0 -0
- package/dist/files/red-hat-display-latin-800-italic.woff +0 -0
- package/dist/files/red-hat-display-latin-800-italic.woff2 +0 -0
- package/dist/files/red-hat-display-latin-800-normal.woff +0 -0
- package/dist/files/red-hat-display-latin-800-normal.woff2 +0 -0
- package/dist/files/red-hat-display-latin-900-italic.woff +0 -0
- package/dist/files/red-hat-display-latin-900-italic.woff2 +0 -0
- package/dist/files/red-hat-display-latin-900-normal.woff +0 -0
- package/dist/files/red-hat-display-latin-900-normal.woff2 +0 -0
- package/dist/files/red-hat-display-latin-ext-300-italic.woff +0 -0
- package/dist/files/red-hat-display-latin-ext-300-italic.woff2 +0 -0
- package/dist/files/red-hat-display-latin-ext-300-normal.woff +0 -0
- package/dist/files/red-hat-display-latin-ext-300-normal.woff2 +0 -0
- package/dist/files/red-hat-display-latin-ext-400-italic.woff +0 -0
- package/dist/files/red-hat-display-latin-ext-400-italic.woff2 +0 -0
- package/dist/files/red-hat-display-latin-ext-400-normal.woff +0 -0
- package/dist/files/red-hat-display-latin-ext-400-normal.woff2 +0 -0
- package/dist/files/red-hat-display-latin-ext-500-italic.woff +0 -0
- package/dist/files/red-hat-display-latin-ext-500-italic.woff2 +0 -0
- package/dist/files/red-hat-display-latin-ext-500-normal.woff +0 -0
- package/dist/files/red-hat-display-latin-ext-500-normal.woff2 +0 -0
- package/dist/files/red-hat-display-latin-ext-600-italic.woff +0 -0
- package/dist/files/red-hat-display-latin-ext-600-italic.woff2 +0 -0
- package/dist/files/red-hat-display-latin-ext-600-normal.woff +0 -0
- package/dist/files/red-hat-display-latin-ext-600-normal.woff2 +0 -0
- package/dist/files/red-hat-display-latin-ext-700-italic.woff +0 -0
- package/dist/files/red-hat-display-latin-ext-700-italic.woff2 +0 -0
- package/dist/files/red-hat-display-latin-ext-700-normal.woff +0 -0
- package/dist/files/red-hat-display-latin-ext-700-normal.woff2 +0 -0
- package/dist/files/red-hat-display-latin-ext-800-italic.woff +0 -0
- package/dist/files/red-hat-display-latin-ext-800-italic.woff2 +0 -0
- package/dist/files/red-hat-display-latin-ext-800-normal.woff +0 -0
- package/dist/files/red-hat-display-latin-ext-800-normal.woff2 +0 -0
- package/dist/files/red-hat-display-latin-ext-900-italic.woff +0 -0
- package/dist/files/red-hat-display-latin-ext-900-italic.woff2 +0 -0
- package/dist/files/red-hat-display-latin-ext-900-normal.woff +0 -0
- package/dist/files/red-hat-display-latin-ext-900-normal.woff2 +0 -0
- package/dist/funnel-chart.js.map +0 -1
- package/dist/index.d.ts +0 -87
- package/dist/index.js +0 -10448
- package/dist/index.js.map +0 -1
- package/dist/input-group.js.map +0 -1
- package/dist/input-size-context.js.map +0 -1
- package/dist/input.js.map +0 -1
- package/dist/item.js.map +0 -1
- package/dist/kpi-card.js.map +0 -1
- package/dist/label.js.map +0 -1
- package/dist/line-chart.js.map +0 -1
- package/dist/logo.js.map +0 -1
- package/dist/number-input.js.map +0 -1
- package/dist/page-header.js.map +0 -1
- package/dist/pagination.js.map +0 -1
- package/dist/password-input.js.map +0 -1
- package/dist/phone-input.js.map +0 -1
- package/dist/photo-gallery.js.map +0 -1
- package/dist/pie-chart.js.map +0 -1
- package/dist/popover.js.map +0 -1
- package/dist/progress.js.map +0 -1
- package/dist/radio-group.js.map +0 -1
- package/dist/red-hat-display.css +0 -2
- package/dist/rich-text-editor.js.map +0 -1
- package/dist/search-input.js.map +0 -1
- package/dist/select.js.map +0 -1
- package/dist/separator.js.map +0 -1
- package/dist/sheet.js.map +0 -1
- package/dist/sidebar.js.map +0 -1
- package/dist/size-context.js.map +0 -1
- package/dist/skeleton.js.map +0 -1
- package/dist/sparkline.js.map +0 -1
- package/dist/stepper.js.map +0 -1
- package/dist/switch.js.map +0 -1
- package/dist/tab-list.d.ts +0 -38
- package/dist/tab-list.js +0 -394
- package/dist/tab-list.js.map +0 -1
- package/dist/table.js.map +0 -1
- package/dist/tabs.js.map +0 -1
- package/dist/tag.js.map +0 -1
- package/dist/textarea.js.map +0 -1
- package/dist/theme/giddaa.css +0 -2
- package/dist/time-picker.js.map +0 -1
- package/dist/toast.js.map +0 -1
- package/dist/tooltip.js.map +0 -1
- package/dist/tree-map.js.map +0 -1
package/dist/date-picker.js
CHANGED
|
@@ -1,528 +1,130 @@
|
|
|
1
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
import { t as cn } from "./cn-BI_4DMBf.js";
|
|
3
|
+
import { Calendar } from "./calendar.js";
|
|
4
|
+
import { Popover, PopoverContent } from "./popover.js";
|
|
5
|
+
import { n as PickerTrigger, t as PickerFooter } from "./picker-lzgmsNfG.js";
|
|
2
6
|
import { CalendarIcon } from "lucide-react";
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
// src/lib/cn.ts
|
|
6
|
-
import { clsx } from "clsx";
|
|
7
|
-
import { extendTailwindMerge } from "tailwind-merge";
|
|
8
|
-
var twMerge = extendTailwindMerge({
|
|
9
|
-
extend: {
|
|
10
|
-
classGroups: {
|
|
11
|
-
"font-size": [
|
|
12
|
-
{
|
|
13
|
-
text: [
|
|
14
|
-
"gdt-display",
|
|
15
|
-
"gdt-h1",
|
|
16
|
-
"gdt-h2",
|
|
17
|
-
"gdt-h3",
|
|
18
|
-
"gdt-h4",
|
|
19
|
-
"gdt-h5",
|
|
20
|
-
"gdt-xl",
|
|
21
|
-
"gdt-lg",
|
|
22
|
-
"gdt-md",
|
|
23
|
-
"gdt-sm",
|
|
24
|
-
"gdt-xs",
|
|
25
|
-
"gdt-subtext",
|
|
26
|
-
"gdt-capitalized"
|
|
27
|
-
]
|
|
28
|
-
}
|
|
29
|
-
]
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
});
|
|
33
|
-
function cn(...inputs) {
|
|
34
|
-
return twMerge(clsx(inputs));
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
// src/components/ui/button.tsx
|
|
38
|
-
import { Button as ButtonPrimitive } from "@base-ui/react/button";
|
|
39
|
-
import { cva } from "class-variance-authority";
|
|
40
|
-
import { Loader } from "lucide-react";
|
|
41
|
-
|
|
42
|
-
// src/components/ui/size-context.tsx
|
|
43
|
-
import { createContext, useContext } from "react";
|
|
44
|
-
import { Fragment, jsx } from "react/jsx-runtime";
|
|
45
|
-
var SizeContext = createContext(void 0);
|
|
46
|
-
function SizeProvider({
|
|
47
|
-
children,
|
|
48
|
-
size
|
|
49
|
-
}) {
|
|
50
|
-
if (!size) {
|
|
51
|
-
return /* @__PURE__ */ jsx(Fragment, { children });
|
|
52
|
-
}
|
|
53
|
-
return /* @__PURE__ */ jsx(SizeContext.Provider, { value: size, children });
|
|
54
|
-
}
|
|
55
|
-
function useComponentSize(size, fallback = "md") {
|
|
56
|
-
const inheritedSize = useContext(SizeContext);
|
|
57
|
-
return size ?? inheritedSize ?? fallback;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
// src/components/ui/button.tsx
|
|
61
|
-
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
62
|
-
var buttonVariants = cva(
|
|
63
|
-
"group/button inline-flex shrink-0 items-center justify-center rounded-full bg-clip-padding whitespace-nowrap font-bold transition-[background-color,color,border-color,box-shadow,transform] outline-none select-none focus-visible:border-line-focus focus-visible:shadow-[0px_0px_0px_2px_var(--color-line-focus)] active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 aria-invalid:border-line-danger aria-invalid:ring-3 aria-invalid:ring-destructive/20 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
64
|
-
{
|
|
65
|
-
variants: {
|
|
66
|
-
variant: {
|
|
67
|
-
primary: "bg-action-primary text-fg-on-brand hover:bg-action-primary-hover active:bg-action-primary-pressed",
|
|
68
|
-
"primary-outline": "border-2 border-action-primary bg-transparent text-fg-brand hover:bg-surface-brand-subtle active:bg-surface-brand-subtle data-focused:bg-surface-brand-subtle data-pressed:bg-surface-brand-subtle",
|
|
69
|
-
secondary: "bg-surface-brand-subtle text-fg-brand hover:bg-action-primary-hover hover:text-fg-on-brand active:bg-action-primary-pressed active:text-fg-on-brand data-focused:bg-action-primary-hover data-pressed:bg-action-primary-pressed data-focused:text-fg-on-brand data-pressed:text-fg-on-brand",
|
|
70
|
-
"secondary-outline": "border-2 border-action-secondary bg-transparent text-fg-brand hover:bg-surface-brand-subtle active:bg-surface-brand-subtle data-focused:bg-surface-brand-subtle data-pressed:bg-surface-brand-subtle",
|
|
71
|
-
tertiary: "bg-action-tertiary text-fg-primary hover:bg-action-tertiary-hover active:bg-action-tertiary-pressed data-focused:bg-action-tertiary-hover data-pressed:bg-action-tertiary-pressed",
|
|
72
|
-
"tertiary-outline": "border border-line-strong bg-transparent text-fg-primary hover:bg-surface active:bg-surface-raised data-focused:bg-surface data-pressed:bg-surface-raised",
|
|
73
|
-
ghost: "bg-transparent text-fg-primary hover:bg-surface active:bg-surface-raised data-focused:bg-surface data-pressed:bg-surface-raised",
|
|
74
|
-
danger: "bg-action-danger text-fg-on-brand hover:bg-action-danger-hover active:bg-action-danger-pressed data-focused:bg-action-danger-hover data-pressed:bg-action-danger-pressed",
|
|
75
|
-
"glass-overlay": "bg-surface-glass-overlay-button text-fg-on-brand",
|
|
76
|
-
"link-brand": "border-transparent bg-transparent px-0 text-fg-brand hover:underline active:underline active:opacity-70",
|
|
77
|
-
"link-neutral": "border-transparent bg-transparent px-0 text-fg-secondary hover:underline active:underline active:opacity-70"
|
|
78
|
-
},
|
|
79
|
-
size: {
|
|
80
|
-
sm: "h-8 gap-2 px-3.5 text-gdt-xs has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3 [&_svg:not([class*='size-'])]:size-3.5",
|
|
81
|
-
md: "h-10 gap-2 px-4.5 text-gdt-sm has-data-[icon=inline-end]:pr-4 has-data-[icon=inline-start]:pl-4",
|
|
82
|
-
lg: "h-12.5 gap-2.5 px-5.5 text-gdt-md has-data-[icon=inline-end]:pr-5 has-data-[icon=inline-start]:pl-5 [&_svg:not([class*='size-'])]:size-4.5",
|
|
83
|
-
xl: "h-14 gap-3 px-6.5 text-gdt-lg has-data-[icon=inline-end]:pr-6 has-data-[icon=inline-start]:pl-6 [&_svg:not([class*='size-'])]:size-5",
|
|
84
|
-
icon: "size-10",
|
|
85
|
-
"icon-xs": "size-6 text-gdt-xs [&_svg:not([class*='size-'])]:size-3",
|
|
86
|
-
"icon-sm": "size-8 text-gdt-sm [&_svg:not([class*='size-'])]:size-3.5",
|
|
87
|
-
"icon-lg": "size-12.5 text-gdt-md [&_svg:not([class*='size-'])]:size-4.5",
|
|
88
|
-
"icon-xl": "size-14 text-gdt-lg [&_svg:not([class*='size-'])]:size-5"
|
|
89
|
-
}
|
|
90
|
-
},
|
|
91
|
-
defaultVariants: {
|
|
92
|
-
variant: "primary",
|
|
93
|
-
size: "md"
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
);
|
|
97
|
-
function Button({
|
|
98
|
-
className,
|
|
99
|
-
variant = "primary",
|
|
100
|
-
size,
|
|
101
|
-
isLoading = false,
|
|
102
|
-
children,
|
|
103
|
-
disabled = false,
|
|
104
|
-
...props
|
|
105
|
-
}) {
|
|
106
|
-
const inheritedSize = useComponentSize();
|
|
107
|
-
const resolvedSize = size ?? inheritedSize;
|
|
108
|
-
const _disabled = disabled || isLoading;
|
|
109
|
-
return /* @__PURE__ */ jsxs(
|
|
110
|
-
ButtonPrimitive,
|
|
111
|
-
{
|
|
112
|
-
"data-slot": "button",
|
|
113
|
-
className: cn(buttonVariants({ variant, size: resolvedSize, className })),
|
|
114
|
-
disabled: _disabled,
|
|
115
|
-
...props,
|
|
116
|
-
children: [
|
|
117
|
-
isLoading && /* @__PURE__ */ jsx2(Loader, { className: "size-4 animate-spin" }),
|
|
118
|
-
" ",
|
|
119
|
-
children
|
|
120
|
-
]
|
|
121
|
-
}
|
|
122
|
-
);
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
// src/components/ui/calendar.tsx
|
|
126
|
-
import { ChevronLeftIcon, ChevronRightIcon } from "lucide-react";
|
|
7
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
127
8
|
import * as React from "react";
|
|
128
|
-
|
|
129
|
-
DayPicker,
|
|
130
|
-
getDefaultClassNames
|
|
131
|
-
} from "react-day-picker";
|
|
132
|
-
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
133
|
-
function Calendar({
|
|
134
|
-
className,
|
|
135
|
-
classNames,
|
|
136
|
-
showOutsideDays = false,
|
|
137
|
-
weekStartsOn = 1,
|
|
138
|
-
locale,
|
|
139
|
-
formatters,
|
|
140
|
-
components,
|
|
141
|
-
...props
|
|
142
|
-
}) {
|
|
143
|
-
const defaultClassNames = getDefaultClassNames();
|
|
144
|
-
return /* @__PURE__ */ jsx3(
|
|
145
|
-
DayPicker,
|
|
146
|
-
{
|
|
147
|
-
showOutsideDays,
|
|
148
|
-
weekStartsOn,
|
|
149
|
-
className: cn(
|
|
150
|
-
"group/calendar bg-transparent p-4 [--cell-radius:var(--radius-md)] [--cell-height:36px] [--cell-width:40px]",
|
|
151
|
-
String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,
|
|
152
|
-
String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,
|
|
153
|
-
className
|
|
154
|
-
),
|
|
155
|
-
locale,
|
|
156
|
-
formatters: {
|
|
157
|
-
formatWeekdayName: (date) => date.toLocaleString(locale?.code, { weekday: "narrow" }),
|
|
158
|
-
...formatters
|
|
159
|
-
},
|
|
160
|
-
classNames: {
|
|
161
|
-
root: cn("w-fit", defaultClassNames.root),
|
|
162
|
-
months: cn(
|
|
163
|
-
"relative flex flex-col gap-4 md:flex-row",
|
|
164
|
-
defaultClassNames.months
|
|
165
|
-
),
|
|
166
|
-
month: cn("flex w-full flex-col gap-4", defaultClassNames.month),
|
|
167
|
-
nav: cn(
|
|
168
|
-
"absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1",
|
|
169
|
-
defaultClassNames.nav
|
|
170
|
-
),
|
|
171
|
-
button_previous: cn(
|
|
172
|
-
"flex size-7 items-center justify-center rounded-(--cell-radius) text-fg-secondary transition-colors outline-none select-none hover:bg-surface focus-visible:border-line-focus focus-visible:shadow-[0px_0px_0px_2px_var(--color-line-focus)] aria-disabled:opacity-40",
|
|
173
|
-
defaultClassNames.button_previous
|
|
174
|
-
),
|
|
175
|
-
button_next: cn(
|
|
176
|
-
"flex size-7 items-center justify-center rounded-(--cell-radius) text-fg-secondary transition-colors outline-none select-none hover:bg-surface focus-visible:border-line-focus focus-visible:shadow-[0px_0px_0px_2px_var(--color-line-focus)] aria-disabled:opacity-40",
|
|
177
|
-
defaultClassNames.button_next
|
|
178
|
-
),
|
|
179
|
-
month_caption: cn(
|
|
180
|
-
"flex h-(--cell-height) w-full items-center justify-center px-(--cell-width)",
|
|
181
|
-
defaultClassNames.month_caption
|
|
182
|
-
),
|
|
183
|
-
caption_label: cn(
|
|
184
|
-
"text-gdt-sm font-medium text-fg-primary select-none",
|
|
185
|
-
defaultClassNames.caption_label
|
|
186
|
-
),
|
|
187
|
-
table: "w-full border-collapse",
|
|
188
|
-
weekdays: cn("flex", defaultClassNames.weekdays),
|
|
189
|
-
weekday: cn(
|
|
190
|
-
"flex-1 text-gdt-xs font-normal text-fg-secondary select-none",
|
|
191
|
-
defaultClassNames.weekday
|
|
192
|
-
),
|
|
193
|
-
week: cn("mt-1 flex w-full", defaultClassNames.week),
|
|
194
|
-
day: cn(
|
|
195
|
-
"group/day relative aspect-square h-full w-full p-0 text-center select-none",
|
|
196
|
-
defaultClassNames.day
|
|
197
|
-
),
|
|
198
|
-
range_start: cn(
|
|
199
|
-
"rounded-l-full bg-surface-brand-subtle",
|
|
200
|
-
defaultClassNames.range_start
|
|
201
|
-
),
|
|
202
|
-
range_middle: cn(
|
|
203
|
-
"rounded-none bg-surface-brand-subtle",
|
|
204
|
-
defaultClassNames.range_middle
|
|
205
|
-
),
|
|
206
|
-
range_end: cn(
|
|
207
|
-
"rounded-r-full bg-surface-brand-subtle",
|
|
208
|
-
defaultClassNames.range_end
|
|
209
|
-
),
|
|
210
|
-
today: cn(
|
|
211
|
-
"rounded-full h-(--cell-height) w-(--cell-width) flex items-center justify-center bg-surface-brand-subtle p-0",
|
|
212
|
-
defaultClassNames.today
|
|
213
|
-
),
|
|
214
|
-
outside: cn(
|
|
215
|
-
"text-fg-caption-placeholder aria-selected:text-fg-caption-placeholder",
|
|
216
|
-
defaultClassNames.outside
|
|
217
|
-
),
|
|
218
|
-
disabled: cn(
|
|
219
|
-
"text-fg-caption-placeholder opacity-50",
|
|
220
|
-
defaultClassNames.disabled
|
|
221
|
-
),
|
|
222
|
-
hidden: cn("invisible", defaultClassNames.hidden),
|
|
223
|
-
...classNames
|
|
224
|
-
},
|
|
225
|
-
components: {
|
|
226
|
-
Root: ({ className: className2, rootRef, ...props2 }) => {
|
|
227
|
-
return /* @__PURE__ */ jsx3(
|
|
228
|
-
"div",
|
|
229
|
-
{
|
|
230
|
-
"data-slot": "calendar",
|
|
231
|
-
ref: rootRef,
|
|
232
|
-
className: cn(className2),
|
|
233
|
-
...props2
|
|
234
|
-
}
|
|
235
|
-
);
|
|
236
|
-
},
|
|
237
|
-
Chevron: ({ className: className2, orientation, ...props2 }) => {
|
|
238
|
-
if (orientation === "right") {
|
|
239
|
-
return /* @__PURE__ */ jsx3(
|
|
240
|
-
ChevronRightIcon,
|
|
241
|
-
{
|
|
242
|
-
className: cn("size-4", className2),
|
|
243
|
-
...props2
|
|
244
|
-
}
|
|
245
|
-
);
|
|
246
|
-
}
|
|
247
|
-
return /* @__PURE__ */ jsx3(ChevronLeftIcon, { className: cn("size-4", className2), ...props2 });
|
|
248
|
-
},
|
|
249
|
-
DayButton: ({ ...props2 }) => /* @__PURE__ */ jsx3(CalendarDayButton, { locale, ...props2 }),
|
|
250
|
-
WeekNumber: ({ children, ...props2 }) => {
|
|
251
|
-
return /* @__PURE__ */ jsx3("td", { ...props2, children: /* @__PURE__ */ jsx3("div", { className: "flex h-(--cell-height) w-(--cell-width) items-center justify-center text-center", children }) });
|
|
252
|
-
},
|
|
253
|
-
...components
|
|
254
|
-
},
|
|
255
|
-
...props
|
|
256
|
-
}
|
|
257
|
-
);
|
|
258
|
-
}
|
|
259
|
-
function CalendarDayButton({
|
|
260
|
-
className,
|
|
261
|
-
day,
|
|
262
|
-
modifiers,
|
|
263
|
-
locale,
|
|
264
|
-
...props
|
|
265
|
-
}) {
|
|
266
|
-
const defaultClassNames = getDefaultClassNames();
|
|
267
|
-
const ref = React.useRef(null);
|
|
268
|
-
React.useEffect(() => {
|
|
269
|
-
if (modifiers.focused) ref.current?.focus();
|
|
270
|
-
}, [modifiers.focused]);
|
|
271
|
-
const isEndpoint = modifiers.selected && !modifiers.range_start && !modifiers.range_end && !modifiers.range_middle || modifiers.range_start || modifiers.range_end;
|
|
272
|
-
return /* @__PURE__ */ jsx3(
|
|
273
|
-
Button,
|
|
274
|
-
{
|
|
275
|
-
ref,
|
|
276
|
-
variant: "ghost",
|
|
277
|
-
size: "icon",
|
|
278
|
-
"data-day": day.date.toLocaleDateString(locale?.code),
|
|
279
|
-
"data-selected-single": modifiers.selected && !modifiers.range_start && !modifiers.range_end && !modifiers.range_middle,
|
|
280
|
-
"data-range-start": modifiers.range_start,
|
|
281
|
-
"data-range-end": modifiers.range_end,
|
|
282
|
-
"data-range-middle": modifiers.range_middle,
|
|
283
|
-
className: cn(
|
|
284
|
-
"relative isolate z-10 flex aspect-square size-auto w-full min-w-(--cell-width) h-(--cell-height) items-center justify-center rounded-full border-0 text-gdt-sm font-normal leading-none",
|
|
285
|
-
// Selected single + range endpoints: filled brand circle.
|
|
286
|
-
"data-[range-end=true]:bg-action-primary data-[range-end=true]:text-fg-on-brand data-[range-end=true]:hover:bg-action-primary-hover data-[range-end=true]:hover:text-fg-on-brand",
|
|
287
|
-
"data-[range-start=true]:bg-action-primary data-[range-start=true]:text-fg-on-brand data-[range-start=true]:hover:bg-action-primary-hover data-[range-start=true]:hover:text-fg-on-brand",
|
|
288
|
-
"data-[selected-single=true]:bg-action-primary data-[selected-single=true]:text-fg-on-brand data-[selected-single=true]:hover:bg-action-primary-hover data-[selected-single=true]:hover:text-fg-on-brand",
|
|
289
|
-
// In-range days: brand wash carried by the cell, brand text on the button.
|
|
290
|
-
"data-[range-middle=true]:rounded-none data-[range-middle=true]:bg-transparent data-[range-middle=true]:text-fg-brand data-[range-middle=true]:hover:bg-transparent",
|
|
291
|
-
isEndpoint && "font-medium",
|
|
292
|
-
"group-data-[focused=true]/day:border-line-focus group-data-[focused=true]/day:shadow-[0px_0px_0px_2px_var(--color-line-focus)]",
|
|
293
|
-
defaultClassNames.day,
|
|
294
|
-
className
|
|
295
|
-
),
|
|
296
|
-
...props
|
|
297
|
-
}
|
|
298
|
-
);
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
// src/components/ui/popover.tsx
|
|
302
|
-
import { Popover as PopoverPrimitive } from "@base-ui/react/popover";
|
|
303
|
-
import { jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
304
|
-
function Popover({ ...props }) {
|
|
305
|
-
return /* @__PURE__ */ jsx4(PopoverPrimitive.Root, { "data-slot": "popover", ...props });
|
|
306
|
-
}
|
|
307
|
-
function PopoverTrigger({ ...props }) {
|
|
308
|
-
return /* @__PURE__ */ jsx4(PopoverPrimitive.Trigger, { "data-slot": "popover-trigger", ...props });
|
|
309
|
-
}
|
|
310
|
-
function PopoverContent({
|
|
311
|
-
className,
|
|
312
|
-
align = "center",
|
|
313
|
-
alignOffset = 0,
|
|
314
|
-
side = "bottom",
|
|
315
|
-
sideOffset = 6,
|
|
316
|
-
showArrow = true,
|
|
317
|
-
size = "md",
|
|
318
|
-
children,
|
|
319
|
-
...props
|
|
320
|
-
}) {
|
|
321
|
-
return /* @__PURE__ */ jsx4(PopoverPrimitive.Portal, { children: /* @__PURE__ */ jsx4(
|
|
322
|
-
PopoverPrimitive.Positioner,
|
|
323
|
-
{
|
|
324
|
-
align,
|
|
325
|
-
alignOffset,
|
|
326
|
-
side,
|
|
327
|
-
sideOffset,
|
|
328
|
-
className: "isolate z-50",
|
|
329
|
-
children: /* @__PURE__ */ jsxs2(
|
|
330
|
-
PopoverPrimitive.Popup,
|
|
331
|
-
{
|
|
332
|
-
"data-slot": "popover-content",
|
|
333
|
-
className: cn(
|
|
334
|
-
"z-50 relative flex w-72 max-w-[calc(100vw-2rem)] origin-(--transform-origin) flex-col rounded-lg border-0 bg-surface-overlay py-4 text-gdt-sm text-fg-primary shadow-2 outline-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-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 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 has-[&_[data-slot=popover-footer]]:pb-0",
|
|
335
|
-
className
|
|
336
|
-
),
|
|
337
|
-
...props,
|
|
338
|
-
children: [
|
|
339
|
-
/* @__PURE__ */ jsx4(SizeProvider, { size, children }),
|
|
340
|
-
showArrow ? /* @__PURE__ */ jsx4(PopoverPrimitive.Arrow, { className: "relative block w-3 h-1.5 overflow-clip data-[side=bottom]:top-[-6px] data-[side=left]:right-[-9px] data-[side=left]:rotate-90 data-[side=right]:left-[-9px] data-[side=right]:-rotate-90 data-[side=top]:bottom-[-6px] data-[side=top]:rotate-180 before:content-[''] before:absolute before:bottom-0 before:left-1/2 before:w-[calc(6px*sqrt(2))] before:h-[calc(6px*sqrt(2))] before:bg-surface-overlay before:border before:border-line before:[transform:translate(-50%,50%)_rotate(45deg)]" }) : null
|
|
341
|
-
]
|
|
342
|
-
}
|
|
343
|
-
)
|
|
344
|
-
}
|
|
345
|
-
) });
|
|
346
|
-
}
|
|
347
|
-
|
|
348
|
-
// src/components/ui/date-picker.tsx
|
|
349
|
-
import { jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
350
|
-
var MONTHS = [
|
|
351
|
-
"January",
|
|
352
|
-
"February",
|
|
353
|
-
"March",
|
|
354
|
-
"April",
|
|
355
|
-
"May",
|
|
356
|
-
"June",
|
|
357
|
-
"July",
|
|
358
|
-
"August",
|
|
359
|
-
"September",
|
|
360
|
-
"October",
|
|
361
|
-
"November",
|
|
362
|
-
"December"
|
|
363
|
-
];
|
|
9
|
+
//#region src/date-picker.tsx
|
|
364
10
|
function formatDate(date) {
|
|
365
|
-
|
|
366
|
-
|
|
11
|
+
return date.toLocaleDateString("en-GB", {
|
|
12
|
+
day: "2-digit",
|
|
13
|
+
month: "long",
|
|
14
|
+
year: "numeric"
|
|
15
|
+
});
|
|
367
16
|
}
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
disabled,
|
|
372
|
-
open,
|
|
373
|
-
className
|
|
374
|
-
}) {
|
|
375
|
-
return /* @__PURE__ */ jsxs3(
|
|
376
|
-
PopoverTrigger,
|
|
377
|
-
{
|
|
378
|
-
disabled,
|
|
379
|
-
className: cn(
|
|
380
|
-
"flex h-10 w-full items-center justify-between rounded-full border px-3.5 text-gdt-sm transition-[border-color,box-shadow] outline-none",
|
|
381
|
-
disabled ? "cursor-not-allowed border-line-subtle bg-surface text-fg-caption-placeholder" : open ? "border-line-focus bg-canvas text-fg-primary inset-ring-1 inset-ring-line-focus" : "border-line bg-canvas text-fg-primary hover:border-line-strong",
|
|
382
|
-
className
|
|
383
|
-
),
|
|
384
|
-
children: [
|
|
385
|
-
/* @__PURE__ */ jsx5(
|
|
386
|
-
"span",
|
|
387
|
-
{
|
|
388
|
-
className: cn(
|
|
389
|
-
"min-w-0 truncate",
|
|
390
|
-
!displayValue && "text-fg-caption-placeholder"
|
|
391
|
-
),
|
|
392
|
-
children: displayValue || placeholder
|
|
393
|
-
}
|
|
394
|
-
),
|
|
395
|
-
/* @__PURE__ */ jsx5(
|
|
396
|
-
CalendarIcon,
|
|
397
|
-
{
|
|
398
|
-
className: cn(
|
|
399
|
-
"ml-2 size-4 shrink-0",
|
|
400
|
-
disabled ? "text-fg-caption-placeholder" : "text-fg-secondary"
|
|
401
|
-
)
|
|
402
|
-
}
|
|
403
|
-
)
|
|
404
|
-
]
|
|
405
|
-
}
|
|
406
|
-
);
|
|
17
|
+
const PANEL_CLASSES = "flex min-w-(--anchor-width) flex-col items-center gap-0 overflow-hidden rounded-2xl p-0";
|
|
18
|
+
function defaultStartMonth() {
|
|
19
|
+
return new Date((/* @__PURE__ */ new Date()).getFullYear() - 100, 0);
|
|
407
20
|
}
|
|
408
|
-
function
|
|
409
|
-
|
|
410
|
-
/* @__PURE__ */ jsx5(Button, { variant: "tertiary-outline", size: "sm", onClick: onClear, children: "Clear" }),
|
|
411
|
-
/* @__PURE__ */ jsx5(Button, { size: "sm", onClick: onApply, children: "Apply" })
|
|
412
|
-
] });
|
|
21
|
+
function defaultEndMonth() {
|
|
22
|
+
return new Date((/* @__PURE__ */ new Date()).getFullYear() + 10, 11);
|
|
413
23
|
}
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
)
|
|
465
|
-
] });
|
|
24
|
+
function DatePicker({ value, onChange, disabled = false, placeholder = "Select date", className, captionLayout = "dropdown", startMonth, endMonth, disabledDates }) {
|
|
25
|
+
const [open, setOpen] = React.useState(false);
|
|
26
|
+
const [pending, setPending] = React.useState(value);
|
|
27
|
+
const [month, setMonth] = React.useState(() => value ?? /* @__PURE__ */ new Date());
|
|
28
|
+
function handleOpenChange(next) {
|
|
29
|
+
if (next) {
|
|
30
|
+
setPending(value);
|
|
31
|
+
setMonth(value ?? /* @__PURE__ */ new Date());
|
|
32
|
+
}
|
|
33
|
+
setOpen(next);
|
|
34
|
+
}
|
|
35
|
+
return /* @__PURE__ */ jsxs(Popover, {
|
|
36
|
+
open,
|
|
37
|
+
onOpenChange: handleOpenChange,
|
|
38
|
+
children: [/* @__PURE__ */ jsx(PickerTrigger, {
|
|
39
|
+
icon: CalendarIcon,
|
|
40
|
+
displayValue: value ? formatDate(value) : "",
|
|
41
|
+
placeholder,
|
|
42
|
+
disabled,
|
|
43
|
+
open,
|
|
44
|
+
className
|
|
45
|
+
}), /* @__PURE__ */ jsxs(PopoverContent, {
|
|
46
|
+
showArrow: false,
|
|
47
|
+
align: "start",
|
|
48
|
+
side: "bottom",
|
|
49
|
+
className: PANEL_CLASSES,
|
|
50
|
+
children: [/* @__PURE__ */ jsx(Calendar, {
|
|
51
|
+
mode: "single",
|
|
52
|
+
selected: pending,
|
|
53
|
+
onSelect: setPending,
|
|
54
|
+
month,
|
|
55
|
+
onMonthChange: setMonth,
|
|
56
|
+
captionLayout,
|
|
57
|
+
startMonth: startMonth ?? defaultStartMonth(),
|
|
58
|
+
endMonth: endMonth ?? defaultEndMonth(),
|
|
59
|
+
disabled: disabledDates
|
|
60
|
+
}), /* @__PURE__ */ jsx(PickerFooter, {
|
|
61
|
+
secondaryLabel: "Clear",
|
|
62
|
+
onSecondary: () => {
|
|
63
|
+
setPending(void 0);
|
|
64
|
+
onChange?.(void 0);
|
|
65
|
+
setOpen(false);
|
|
66
|
+
},
|
|
67
|
+
onApply: () => {
|
|
68
|
+
onChange?.(pending);
|
|
69
|
+
setOpen(false);
|
|
70
|
+
}
|
|
71
|
+
})]
|
|
72
|
+
})]
|
|
73
|
+
});
|
|
466
74
|
}
|
|
467
|
-
function DateRangePicker({
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
}
|
|
521
|
-
)
|
|
522
|
-
] });
|
|
75
|
+
function DateRangePicker({ value, onChange, disabled = false, placeholder = "Select date range", className, captionLayout = "dropdown", startMonth, endMonth, disabledDates }) {
|
|
76
|
+
const [open, setOpen] = React.useState(false);
|
|
77
|
+
const [pending, setPending] = React.useState(value);
|
|
78
|
+
const [month, setMonth] = React.useState(() => value?.from ?? /* @__PURE__ */ new Date());
|
|
79
|
+
function handleOpenChange(next) {
|
|
80
|
+
if (next) {
|
|
81
|
+
setPending(value);
|
|
82
|
+
setMonth(value?.from ?? /* @__PURE__ */ new Date());
|
|
83
|
+
}
|
|
84
|
+
setOpen(next);
|
|
85
|
+
}
|
|
86
|
+
return /* @__PURE__ */ jsxs(Popover, {
|
|
87
|
+
open,
|
|
88
|
+
onOpenChange: handleOpenChange,
|
|
89
|
+
children: [/* @__PURE__ */ jsx(PickerTrigger, {
|
|
90
|
+
icon: CalendarIcon,
|
|
91
|
+
displayValue: (() => {
|
|
92
|
+
if (value?.from && value?.to) return `${formatDate(value.from)} — ${formatDate(value.to)}`;
|
|
93
|
+
if (value?.from) return formatDate(value.from);
|
|
94
|
+
return "";
|
|
95
|
+
})(),
|
|
96
|
+
placeholder,
|
|
97
|
+
disabled,
|
|
98
|
+
open,
|
|
99
|
+
className
|
|
100
|
+
}), /* @__PURE__ */ jsxs(PopoverContent, {
|
|
101
|
+
showArrow: false,
|
|
102
|
+
align: "start",
|
|
103
|
+
className: cn(PANEL_CLASSES, "w-auto"),
|
|
104
|
+
children: [/* @__PURE__ */ jsx(Calendar, {
|
|
105
|
+
mode: "range",
|
|
106
|
+
selected: pending,
|
|
107
|
+
onSelect: setPending,
|
|
108
|
+
month,
|
|
109
|
+
onMonthChange: setMonth,
|
|
110
|
+
captionLayout,
|
|
111
|
+
startMonth: startMonth ?? defaultStartMonth(),
|
|
112
|
+
endMonth: endMonth ?? defaultEndMonth(),
|
|
113
|
+
disabled: disabledDates
|
|
114
|
+
}), /* @__PURE__ */ jsx(PickerFooter, {
|
|
115
|
+
secondaryLabel: "Clear",
|
|
116
|
+
onSecondary: () => {
|
|
117
|
+
setPending(void 0);
|
|
118
|
+
onChange?.(void 0);
|
|
119
|
+
setOpen(false);
|
|
120
|
+
},
|
|
121
|
+
onApply: () => {
|
|
122
|
+
onChange?.(pending);
|
|
123
|
+
setOpen(false);
|
|
124
|
+
}
|
|
125
|
+
})]
|
|
126
|
+
})]
|
|
127
|
+
});
|
|
523
128
|
}
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
DateRangePicker
|
|
527
|
-
};
|
|
528
|
-
//# sourceMappingURL=date-picker.js.map
|
|
129
|
+
//#endregion
|
|
130
|
+
export { DatePicker, DateRangePicker };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
//#region src/details-card.d.ts
|
|
4
|
+
type DetailsCardBodyProps = useRender.ComponentProps<"div"> & {
|
|
5
|
+
orientation?: "horizontal" | "vertical";
|
|
6
|
+
showIcons?: boolean;
|
|
7
|
+
};
|
|
8
|
+
declare function DetailsCard({ className, render, ...props }: useRender.ComponentProps<"article">): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
|
|
9
|
+
declare function DetailsCardHeader({ className, render, ...props }: useRender.ComponentProps<"div">): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
|
|
10
|
+
declare function DetailsCardTitle({ className, render, ...props }: useRender.ComponentProps<"h3">): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
|
|
11
|
+
declare function DetailsCardDescription({ className, render, ...props }: useRender.ComponentProps<"p">): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
|
|
12
|
+
declare function DetailsCardBody({ className, orientation, render, showIcons, ...props }: DetailsCardBodyProps): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
|
|
13
|
+
declare function DetailsCardRow({ className, render, ...props }: useRender.ComponentProps<"div">): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
|
|
14
|
+
declare function DetailsCardRowGroup({ className, render, ...props }: useRender.ComponentProps<"div">): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
|
|
15
|
+
declare function DetailsCardIcon({ children, className, render, ...props }: useRender.ComponentProps<"span">): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
|
|
16
|
+
declare function DetailsCardLabel({ className, render, ...props }: useRender.ComponentProps<"div">): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
|
|
17
|
+
declare function DetailsCardValue({ className, render, ...props }: useRender.ComponentProps<"div">): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
|
|
18
|
+
//#endregion
|
|
19
|
+
export { DetailsCard, DetailsCardBody, type DetailsCardBodyProps, DetailsCardDescription, DetailsCardHeader, DetailsCardIcon, DetailsCardLabel, DetailsCardRow, DetailsCardRowGroup, DetailsCardTitle, DetailsCardValue };
|