@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/time-picker.js
CHANGED
|
@@ -1,472 +1,255 @@
|
|
|
1
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
import { t as cn } from "./cn-BI_4DMBf.js";
|
|
3
|
+
import { Popover, PopoverContent } from "./popover.js";
|
|
4
|
+
import { n as PickerTrigger, t as PickerFooter } from "./picker-lzgmsNfG.js";
|
|
2
5
|
import { ClockIcon } from "lucide-react";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
7
|
import * as React from "react";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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/popover.tsx
|
|
126
|
-
import { Popover as PopoverPrimitive } from "@base-ui/react/popover";
|
|
127
|
-
import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
128
|
-
function Popover({ ...props }) {
|
|
129
|
-
return /* @__PURE__ */ jsx3(PopoverPrimitive.Root, { "data-slot": "popover", ...props });
|
|
130
|
-
}
|
|
131
|
-
function PopoverTrigger({ ...props }) {
|
|
132
|
-
return /* @__PURE__ */ jsx3(PopoverPrimitive.Trigger, { "data-slot": "popover-trigger", ...props });
|
|
133
|
-
}
|
|
134
|
-
function PopoverContent({
|
|
135
|
-
className,
|
|
136
|
-
align = "center",
|
|
137
|
-
alignOffset = 0,
|
|
138
|
-
side = "bottom",
|
|
139
|
-
sideOffset = 6,
|
|
140
|
-
showArrow = true,
|
|
141
|
-
size = "md",
|
|
142
|
-
children,
|
|
143
|
-
...props
|
|
144
|
-
}) {
|
|
145
|
-
return /* @__PURE__ */ jsx3(PopoverPrimitive.Portal, { children: /* @__PURE__ */ jsx3(
|
|
146
|
-
PopoverPrimitive.Positioner,
|
|
147
|
-
{
|
|
148
|
-
align,
|
|
149
|
-
alignOffset,
|
|
150
|
-
side,
|
|
151
|
-
sideOffset,
|
|
152
|
-
className: "isolate z-50",
|
|
153
|
-
children: /* @__PURE__ */ jsxs2(
|
|
154
|
-
PopoverPrimitive.Popup,
|
|
155
|
-
{
|
|
156
|
-
"data-slot": "popover-content",
|
|
157
|
-
className: cn(
|
|
158
|
-
"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",
|
|
159
|
-
className
|
|
160
|
-
),
|
|
161
|
-
...props,
|
|
162
|
-
children: [
|
|
163
|
-
/* @__PURE__ */ jsx3(SizeProvider, { size, children }),
|
|
164
|
-
showArrow ? /* @__PURE__ */ jsx3(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
|
|
165
|
-
]
|
|
166
|
-
}
|
|
167
|
-
)
|
|
168
|
-
}
|
|
169
|
-
) });
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
// src/components/ui/time-picker.tsx
|
|
173
|
-
import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
174
|
-
var ITEM_HEIGHT = 40;
|
|
175
|
-
var VISIBLE_COUNT = 5;
|
|
176
|
-
var SCROLL_PADDING = Math.floor(VISIBLE_COUNT / 2) * ITEM_HEIGHT;
|
|
177
|
-
var CURVE_CLAMP = 3;
|
|
178
|
-
var HOURS_12 = Array.from(
|
|
179
|
-
{ length: 12 },
|
|
180
|
-
(_, i) => String(i + 1).padStart(2, "0")
|
|
181
|
-
);
|
|
182
|
-
var HOURS_24 = Array.from(
|
|
183
|
-
{ length: 24 },
|
|
184
|
-
(_, i) => String(i).padStart(2, "0")
|
|
185
|
-
);
|
|
186
|
-
var MINUTES = Array.from(
|
|
187
|
-
{ length: 60 },
|
|
188
|
-
(_, i) => String(i).padStart(2, "0")
|
|
189
|
-
);
|
|
190
|
-
var PERIODS = ["AM", "PM"];
|
|
8
|
+
//#region src/time-picker.tsx
|
|
9
|
+
const ITEM_HEIGHT = 40;
|
|
10
|
+
const VISIBLE_COUNT = 5;
|
|
11
|
+
const SCROLL_PADDING = Math.floor(VISIBLE_COUNT / 2) * ITEM_HEIGHT;
|
|
12
|
+
const CURVE_CLAMP = 3;
|
|
13
|
+
const HOURS_12 = Array.from({ length: 12 }, (_, i) => String(i + 1).padStart(2, "0"));
|
|
14
|
+
const HOURS_24 = Array.from({ length: 24 }, (_, i) => String(i).padStart(2, "0"));
|
|
15
|
+
const MINUTES = Array.from({ length: 60 }, (_, i) => String(i).padStart(2, "0"));
|
|
16
|
+
const PERIODS = ["AM", "PM"];
|
|
191
17
|
function parseTimeString(value, format) {
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
period: ""
|
|
222
|
-
};
|
|
18
|
+
if (value) if (format === "12h") {
|
|
19
|
+
const m = value.match(/^(\d{1,2}):(\d{2})\s*(AM|PM)$/i);
|
|
20
|
+
if (m) return {
|
|
21
|
+
hour: m[1].padStart(2, "0"),
|
|
22
|
+
minute: m[2],
|
|
23
|
+
period: m[3].toUpperCase()
|
|
24
|
+
};
|
|
25
|
+
} else {
|
|
26
|
+
const m = value.match(/^(\d{1,2}):(\d{2})$/);
|
|
27
|
+
if (m) return {
|
|
28
|
+
hour: m[1].padStart(2, "0"),
|
|
29
|
+
minute: m[2],
|
|
30
|
+
period: ""
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
const now = /* @__PURE__ */ new Date();
|
|
34
|
+
if (format === "12h") {
|
|
35
|
+
const h = now.getHours();
|
|
36
|
+
return {
|
|
37
|
+
hour: String(h % 12 || 12).padStart(2, "0"),
|
|
38
|
+
minute: String(now.getMinutes()).padStart(2, "0"),
|
|
39
|
+
period: h >= 12 ? "PM" : "AM"
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
return {
|
|
43
|
+
hour: String(now.getHours()).padStart(2, "0"),
|
|
44
|
+
minute: String(now.getMinutes()).padStart(2, "0"),
|
|
45
|
+
period: ""
|
|
46
|
+
};
|
|
223
47
|
}
|
|
224
48
|
function formatTimeValue(tv, format) {
|
|
225
|
-
|
|
226
|
-
|
|
49
|
+
if (format === "12h") return `${tv.hour}:${tv.minute} ${tv.period}`;
|
|
50
|
+
return `${tv.hour}:${tv.minute}`;
|
|
227
51
|
}
|
|
228
|
-
function TimeColumn({ items, value, onChange }) {
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
52
|
+
function TimeColumn({ label, items, value, onChange }) {
|
|
53
|
+
const scrollRef = React.useRef(null);
|
|
54
|
+
const itemRefs = React.useRef([]);
|
|
55
|
+
const [centerIndex, setCenterIndex] = React.useState(() => Math.max(0, items.indexOf(value)));
|
|
56
|
+
const isProgrammatic = React.useRef(false);
|
|
57
|
+
const onChangeRef = React.useRef(onChange);
|
|
58
|
+
onChangeRef.current = onChange;
|
|
59
|
+
const paintCurve = React.useCallback(() => {
|
|
60
|
+
const el = scrollRef.current;
|
|
61
|
+
if (!el) return;
|
|
62
|
+
const offset = el.scrollTop / ITEM_HEIGHT;
|
|
63
|
+
itemRefs.current.forEach((node, index) => {
|
|
64
|
+
if (!node) return;
|
|
65
|
+
const distance = index - offset;
|
|
66
|
+
const abs = Math.min(Math.abs(distance), CURVE_CLAMP);
|
|
67
|
+
const tilt = Math.max(Math.min(distance, CURVE_CLAMP), -3);
|
|
68
|
+
node.style.opacity = String(Math.max(1 - abs * .28, .2));
|
|
69
|
+
node.style.transform = `perspective(280px) rotateX(${tilt * -20}deg) scale(${1 - abs * .04})`;
|
|
70
|
+
});
|
|
71
|
+
}, []);
|
|
72
|
+
React.useEffect(() => {
|
|
73
|
+
const el = scrollRef.current;
|
|
74
|
+
if (!el) return;
|
|
75
|
+
isProgrammatic.current = true;
|
|
76
|
+
el.scrollTop = centerIndex * ITEM_HEIGHT;
|
|
77
|
+
paintCurve();
|
|
78
|
+
requestAnimationFrame(() => {
|
|
79
|
+
isProgrammatic.current = false;
|
|
80
|
+
});
|
|
81
|
+
}, []);
|
|
82
|
+
React.useEffect(() => {
|
|
83
|
+
const idx = items.indexOf(value);
|
|
84
|
+
if (idx === -1 || idx === centerIndex) return;
|
|
85
|
+
setCenterIndex(idx);
|
|
86
|
+
const el = scrollRef.current;
|
|
87
|
+
if (!el) return;
|
|
88
|
+
isProgrammatic.current = true;
|
|
89
|
+
el.scrollTo({
|
|
90
|
+
top: idx * ITEM_HEIGHT,
|
|
91
|
+
behavior: "smooth"
|
|
92
|
+
});
|
|
93
|
+
setTimeout(() => {
|
|
94
|
+
isProgrammatic.current = false;
|
|
95
|
+
paintCurve();
|
|
96
|
+
}, 320);
|
|
97
|
+
}, [value]);
|
|
98
|
+
function selectIndex(index) {
|
|
99
|
+
const el = scrollRef.current;
|
|
100
|
+
if (!el) return;
|
|
101
|
+
isProgrammatic.current = true;
|
|
102
|
+
setCenterIndex(index);
|
|
103
|
+
onChangeRef.current(items[index]);
|
|
104
|
+
el.scrollTo({
|
|
105
|
+
top: index * ITEM_HEIGHT,
|
|
106
|
+
behavior: "smooth"
|
|
107
|
+
});
|
|
108
|
+
setTimeout(() => {
|
|
109
|
+
isProgrammatic.current = false;
|
|
110
|
+
}, 350);
|
|
111
|
+
}
|
|
112
|
+
function handleScroll() {
|
|
113
|
+
paintCurve();
|
|
114
|
+
if (isProgrammatic.current) return;
|
|
115
|
+
const el = scrollRef.current;
|
|
116
|
+
if (!el) return;
|
|
117
|
+
const idx = Math.max(0, Math.min(Math.round(el.scrollTop / ITEM_HEIGHT), items.length - 1));
|
|
118
|
+
if (idx !== centerIndex) {
|
|
119
|
+
setCenterIndex(idx);
|
|
120
|
+
onChangeRef.current(items[idx]);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
124
|
+
className: "relative",
|
|
125
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
126
|
+
"aria-hidden": true,
|
|
127
|
+
style: { height: `${ITEM_HEIGHT - 4}px` },
|
|
128
|
+
className: "pointer-events-none absolute inset-x-0.5 top-1/2 -translate-y-1/2 rounded-full bg-action-primary"
|
|
129
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
130
|
+
ref: scrollRef,
|
|
131
|
+
onScroll: handleScroll,
|
|
132
|
+
role: "listbox",
|
|
133
|
+
"aria-label": label,
|
|
134
|
+
style: { height: `${VISIBLE_COUNT * ITEM_HEIGHT}px` },
|
|
135
|
+
className: "relative snap-y snap-mandatory overflow-y-scroll overscroll-contain [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",
|
|
136
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
137
|
+
style: {
|
|
138
|
+
paddingTop: `${SCROLL_PADDING}px`,
|
|
139
|
+
paddingBottom: `${SCROLL_PADDING}px`
|
|
140
|
+
},
|
|
141
|
+
children: items.map((item, index) => {
|
|
142
|
+
const dist = Math.abs(index - centerIndex);
|
|
143
|
+
return /* @__PURE__ */ jsx("button", {
|
|
144
|
+
type: "button",
|
|
145
|
+
role: "option",
|
|
146
|
+
"aria-selected": index === centerIndex,
|
|
147
|
+
tabIndex: index === centerIndex ? 0 : -1,
|
|
148
|
+
ref: (node) => {
|
|
149
|
+
itemRefs.current[index] = node;
|
|
150
|
+
},
|
|
151
|
+
onClick: () => selectIndex(index),
|
|
152
|
+
style: { height: `${ITEM_HEIGHT}px` },
|
|
153
|
+
className: "flex w-full cursor-pointer snap-center items-center justify-center select-none will-change-transform",
|
|
154
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
155
|
+
className: cn("text-gdt-sm font-medium transition-colors", dist === 0 ? "text-fg-on-brand" : dist === 1 ? "text-fg-secondary" : "text-fg-caption-placeholder"),
|
|
156
|
+
children: item
|
|
157
|
+
})
|
|
158
|
+
}, item);
|
|
159
|
+
})
|
|
160
|
+
})
|
|
161
|
+
})]
|
|
162
|
+
});
|
|
334
163
|
}
|
|
335
|
-
function TimePicker({
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
TimeColumn,
|
|
425
|
-
{
|
|
426
|
-
items: MINUTES,
|
|
427
|
-
value: pending.minute,
|
|
428
|
-
onChange: (minute) => setPending((prev) => ({ ...prev, minute }))
|
|
429
|
-
}
|
|
430
|
-
),
|
|
431
|
-
format === "12h" && /* @__PURE__ */ jsx4(
|
|
432
|
-
TimeColumn,
|
|
433
|
-
{
|
|
434
|
-
items: PERIODS,
|
|
435
|
-
value: pending.period,
|
|
436
|
-
onChange: (period) => setPending((prev) => ({ ...prev, period }))
|
|
437
|
-
}
|
|
438
|
-
)
|
|
439
|
-
]
|
|
440
|
-
}
|
|
441
|
-
),
|
|
442
|
-
/* @__PURE__ */ jsxs3("div", { className: "mt-2 flex items-center justify-between border-t border-line-subtle px-4 py-3", children: [
|
|
443
|
-
/* @__PURE__ */ jsx4(
|
|
444
|
-
Button,
|
|
445
|
-
{
|
|
446
|
-
variant: "tertiary-outline",
|
|
447
|
-
size: "sm",
|
|
448
|
-
onClick: () => setOpen(false),
|
|
449
|
-
children: "Cancel"
|
|
450
|
-
}
|
|
451
|
-
),
|
|
452
|
-
/* @__PURE__ */ jsx4(
|
|
453
|
-
Button,
|
|
454
|
-
{
|
|
455
|
-
size: "sm",
|
|
456
|
-
onClick: () => {
|
|
457
|
-
onChange?.(formatTimeValue(pending, format));
|
|
458
|
-
setOpen(false);
|
|
459
|
-
},
|
|
460
|
-
children: "Apply"
|
|
461
|
-
}
|
|
462
|
-
)
|
|
463
|
-
] })
|
|
464
|
-
]
|
|
465
|
-
}
|
|
466
|
-
)
|
|
467
|
-
] });
|
|
164
|
+
function TimePicker({ value, onChange, format = "12h", disabled = false, placeholder = "Select time", className }) {
|
|
165
|
+
const [open, setOpen] = React.useState(false);
|
|
166
|
+
const [pending, setPending] = React.useState(() => parseTimeString(value, format));
|
|
167
|
+
function handleOpenChange(next) {
|
|
168
|
+
if (next) setPending(parseTimeString(value, format));
|
|
169
|
+
setOpen(next);
|
|
170
|
+
}
|
|
171
|
+
const columns = [
|
|
172
|
+
{
|
|
173
|
+
key: "Hour",
|
|
174
|
+
show: true
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
key: "Minute",
|
|
178
|
+
show: true
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
key: "Period",
|
|
182
|
+
show: format === "12h"
|
|
183
|
+
}
|
|
184
|
+
].filter((c) => c.show);
|
|
185
|
+
return /* @__PURE__ */ jsxs(Popover, {
|
|
186
|
+
open,
|
|
187
|
+
onOpenChange: handleOpenChange,
|
|
188
|
+
children: [/* @__PURE__ */ jsx(PickerTrigger, {
|
|
189
|
+
icon: ClockIcon,
|
|
190
|
+
displayValue: value ?? "",
|
|
191
|
+
placeholder,
|
|
192
|
+
disabled,
|
|
193
|
+
open,
|
|
194
|
+
className
|
|
195
|
+
}), /* @__PURE__ */ jsxs(PopoverContent, {
|
|
196
|
+
showArrow: false,
|
|
197
|
+
align: "start",
|
|
198
|
+
className: "min-w-(--anchor-width) gap-0 overflow-hidden rounded-2xl p-0",
|
|
199
|
+
children: [
|
|
200
|
+
/* @__PURE__ */ jsx("div", {
|
|
201
|
+
className: "flex w-full items-center justify-center gap-2 border-b border-line-subtle",
|
|
202
|
+
children: columns.map((column) => /* @__PURE__ */ jsx("p", {
|
|
203
|
+
className: cn("py-3 text-center text-gdt-xs text-fg-caption-placeholder", format === "12h" ? "w-20.5" : "w-31"),
|
|
204
|
+
children: column.key
|
|
205
|
+
}, column.key))
|
|
206
|
+
}),
|
|
207
|
+
/* @__PURE__ */ jsxs("div", {
|
|
208
|
+
className: cn("flex justify-center gap-2 px-3 pt-2", format === "12h" ? "*:w-20.5" : "*:w-31"),
|
|
209
|
+
children: [
|
|
210
|
+
/* @__PURE__ */ jsx(TimeColumn, {
|
|
211
|
+
label: "Hour",
|
|
212
|
+
items: format === "12h" ? HOURS_12 : HOURS_24,
|
|
213
|
+
value: pending.hour,
|
|
214
|
+
onChange: (hour) => setPending((prev) => ({
|
|
215
|
+
...prev,
|
|
216
|
+
hour
|
|
217
|
+
}))
|
|
218
|
+
}),
|
|
219
|
+
/* @__PURE__ */ jsx(TimeColumn, {
|
|
220
|
+
label: "Minute",
|
|
221
|
+
items: MINUTES,
|
|
222
|
+
value: pending.minute,
|
|
223
|
+
onChange: (minute) => setPending((prev) => ({
|
|
224
|
+
...prev,
|
|
225
|
+
minute
|
|
226
|
+
}))
|
|
227
|
+
}),
|
|
228
|
+
format === "12h" && /* @__PURE__ */ jsx(TimeColumn, {
|
|
229
|
+
label: "Period",
|
|
230
|
+
items: PERIODS,
|
|
231
|
+
value: pending.period,
|
|
232
|
+
onChange: (period) => setPending((prev) => ({
|
|
233
|
+
...prev,
|
|
234
|
+
period
|
|
235
|
+
}))
|
|
236
|
+
})
|
|
237
|
+
]
|
|
238
|
+
}),
|
|
239
|
+
/* @__PURE__ */ jsx("div", {
|
|
240
|
+
className: "mt-2 w-full",
|
|
241
|
+
children: /* @__PURE__ */ jsx(PickerFooter, {
|
|
242
|
+
secondaryLabel: "Cancel",
|
|
243
|
+
onSecondary: () => setOpen(false),
|
|
244
|
+
onApply: () => {
|
|
245
|
+
onChange?.(formatTimeValue(pending, format));
|
|
246
|
+
setOpen(false);
|
|
247
|
+
}
|
|
248
|
+
})
|
|
249
|
+
})
|
|
250
|
+
]
|
|
251
|
+
})]
|
|
252
|
+
});
|
|
468
253
|
}
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
};
|
|
472
|
-
//# sourceMappingURL=time-picker.js.map
|
|
254
|
+
//#endregion
|
|
255
|
+
export { TimePicker };
|