@giddaa-housing/ui 0.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 +41 -0
- package/dist/accordion.d.ts +11 -0
- package/dist/accordion.js +124 -0
- package/dist/accordion.js.map +1 -0
- package/dist/alert.d.ts +18 -0
- package/dist/alert.js +152 -0
- package/dist/alert.js.map +1 -0
- package/dist/avatar.d.ts +14 -0
- package/dist/avatar.js +152 -0
- package/dist/avatar.js.map +1 -0
- package/dist/badge.d.ts +14 -0
- package/dist/badge.js +119 -0
- package/dist/badge.js.map +1 -0
- package/dist/bar-chart.d.ts +136 -0
- package/dist/bar-chart.js +302 -0
- package/dist/bar-chart.js.map +1 -0
- package/dist/base.css +32 -0
- package/dist/breadcrumb.d.ts +12 -0
- package/dist/breadcrumb.js +161 -0
- package/dist/breadcrumb.js.map +1 -0
- package/dist/bullet-chart.d.ts +98 -0
- package/dist/bullet-chart.js +189 -0
- package/dist/bullet-chart.js.map +1 -0
- package/dist/button-group.d.ts +18 -0
- package/dist/button-group.js +170 -0
- package/dist/button-group.js.map +1 -0
- package/dist/button.d.ts +19 -0
- package/dist/button.js +146 -0
- package/dist/button.js.map +1 -0
- package/dist/calendar.d.ts +9 -0
- package/dist/calendar.js +293 -0
- package/dist/calendar.js.map +1 -0
- package/dist/card.d.ts +18 -0
- package/dist/card.js +186 -0
- package/dist/card.js.map +1 -0
- package/dist/carousel.d.ts +53 -0
- package/dist/carousel.js +396 -0
- package/dist/carousel.js.map +1 -0
- package/dist/chart.d.ts +122 -0
- package/dist/chart.js +494 -0
- package/dist/chart.js.map +1 -0
- package/dist/checkbox.d.ts +73 -0
- package/dist/checkbox.js +87 -0
- package/dist/checkbox.js.map +1 -0
- package/dist/collapsible.d.ts +8 -0
- package/dist/collapsible.js +82 -0
- package/dist/collapsible.js.map +1 -0
- package/dist/combobox.d.ts +30 -0
- package/dist/combobox.js +713 -0
- package/dist/combobox.js.map +1 -0
- package/dist/date-picker.d.ts +22 -0
- package/dist/date-picker.js +528 -0
- package/dist/date-picker.js.map +1 -0
- package/dist/dialog.d.ts +30 -0
- package/dist/dialog.js +339 -0
- package/dist/dialog.js.map +1 -0
- package/dist/dropdown-menu.d.ts +35 -0
- package/dist/dropdown-menu.js +376 -0
- package/dist/dropdown-menu.js.map +1 -0
- package/dist/dropzone.d.ts +128 -0
- package/dist/dropzone.js +490 -0
- package/dist/dropzone.js.map +1 -0
- package/dist/empty-state.d.ts +17 -0
- package/dist/empty-state.js +146 -0
- package/dist/empty-state.js.map +1 -0
- package/dist/field.d.ts +29 -0
- package/dist/field.js +345 -0
- package/dist/field.js.map +1 -0
- 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.d.ts +84 -0
- package/dist/funnel-chart.js +569 -0
- package/dist/funnel-chart.js.map +1 -0
- package/dist/index.d.ts +87 -0
- package/dist/index.js +10448 -0
- package/dist/index.js.map +1 -0
- package/dist/input-group.d.ts +31 -0
- package/dist/input-group.js +380 -0
- package/dist/input-group.js.map +1 -0
- package/dist/input-size-context.d.ts +11 -0
- package/dist/input-size-context.js +24 -0
- package/dist/input-size-context.js.map +1 -0
- package/dist/input.d.ts +13 -0
- package/dist/input.js +83 -0
- package/dist/input.js.map +1 -0
- package/dist/item.d.ts +8 -0
- package/dist/item.js +93 -0
- package/dist/item.js.map +1 -0
- package/dist/kpi-card.d.ts +24 -0
- package/dist/kpi-card.js +243 -0
- package/dist/kpi-card.js.map +1 -0
- package/dist/label.d.ts +8 -0
- package/dist/label.js +68 -0
- package/dist/label.js.map +1 -0
- package/dist/line-chart.d.ts +155 -0
- package/dist/line-chart.js +269 -0
- package/dist/line-chart.js.map +1 -0
- package/dist/logo.d.ts +6 -0
- package/dist/logo.js +146 -0
- package/dist/logo.js.map +1 -0
- package/dist/number-input.d.ts +41 -0
- package/dist/number-input.js +418 -0
- package/dist/number-input.js.map +1 -0
- package/dist/page-header.d.ts +13 -0
- package/dist/page-header.js +113 -0
- package/dist/page-header.js.map +1 -0
- package/dist/pagination.d.ts +35 -0
- package/dist/pagination.js +352 -0
- package/dist/pagination.js.map +1 -0
- package/dist/password-input.d.ts +13 -0
- package/dist/password-input.js +356 -0
- package/dist/password-input.js.map +1 -0
- package/dist/phone-input.d.ts +21 -0
- package/dist/phone-input.js +573 -0
- package/dist/phone-input.js.map +1 -0
- package/dist/photo-gallery.d.ts +42 -0
- package/dist/photo-gallery.js +756 -0
- package/dist/photo-gallery.js.map +1 -0
- package/dist/pie-chart.d.ts +125 -0
- package/dist/pie-chart.js +192 -0
- package/dist/pie-chart.js.map +1 -0
- package/dist/popover.d.ts +20 -0
- package/dist/popover.js +169 -0
- package/dist/popover.js.map +1 -0
- package/dist/progress.d.ts +28 -0
- package/dist/progress.js +315 -0
- package/dist/progress.js.map +1 -0
- package/dist/radio-group.d.ts +32 -0
- package/dist/radio-group.js +100 -0
- package/dist/radio-group.js.map +1 -0
- package/dist/red-hat-display.css +2 -0
- package/dist/rich-text-editor.d.ts +16 -0
- package/dist/rich-text-editor.js +1000 -0
- package/dist/rich-text-editor.js.map +1 -0
- package/dist/search-input.d.ts +19 -0
- package/dist/search-input.js +411 -0
- package/dist/search-input.js.map +1 -0
- package/dist/select.d.ts +21 -0
- package/dist/select.js +305 -0
- package/dist/select.js.map +1 -0
- package/dist/separator.d.ts +10 -0
- package/dist/separator.js +72 -0
- package/dist/separator.js.map +1 -0
- package/dist/sheet.d.ts +24 -0
- package/dist/sheet.js +282 -0
- package/dist/sheet.js.map +1 -0
- package/dist/sidebar.d.ts +70 -0
- package/dist/sidebar.js +1078 -0
- package/dist/sidebar.js.map +1 -0
- package/dist/size-context.d.ts +11 -0
- package/dist/size-context.js +22 -0
- package/dist/size-context.js.map +1 -0
- package/dist/skeleton.d.ts +5 -0
- package/dist/skeleton.js +48 -0
- package/dist/skeleton.js.map +1 -0
- package/dist/sparkline.d.ts +94 -0
- package/dist/sparkline.js +568 -0
- package/dist/sparkline.js.map +1 -0
- package/dist/stepper.d.ts +43 -0
- package/dist/stepper.js +296 -0
- package/dist/stepper.js.map +1 -0
- package/dist/styles.css +2 -0
- package/dist/switch.d.ts +29 -0
- package/dist/switch.js +108 -0
- package/dist/switch.js.map +1 -0
- package/dist/tab-list.d.ts +38 -0
- package/dist/tab-list.js +394 -0
- package/dist/tab-list.js.map +1 -0
- package/dist/table.d.ts +69 -0
- package/dist/table.js +197 -0
- package/dist/table.js.map +1 -0
- package/dist/tabs.d.ts +18 -0
- package/dist/tabs.js +159 -0
- package/dist/tabs.js.map +1 -0
- package/dist/tag.d.ts +25 -0
- package/dist/tag.js +160 -0
- package/dist/tag.js.map +1 -0
- package/dist/textarea.d.ts +12 -0
- package/dist/textarea.js +78 -0
- package/dist/textarea.js.map +1 -0
- package/dist/theme/giddaa.css +2 -0
- package/dist/time-picker.d.ts +13 -0
- package/dist/time-picker.js +472 -0
- package/dist/time-picker.js.map +1 -0
- package/dist/toast.d.ts +23 -0
- package/dist/toast.js +330 -0
- package/dist/toast.js.map +1 -0
- package/dist/tooltip.d.ts +11 -0
- package/dist/tooltip.js +96 -0
- package/dist/tooltip.js.map +1 -0
- package/dist/tree-map.d.ts +127 -0
- package/dist/tree-map.js +652 -0
- package/dist/tree-map.js.map +1 -0
- package/package.json +328 -0
package/dist/textarea.js
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
// src/components/ui/textarea.tsx
|
|
2
|
+
import { cva } from "class-variance-authority";
|
|
3
|
+
|
|
4
|
+
// src/lib/cn.ts
|
|
5
|
+
import { clsx } from "clsx";
|
|
6
|
+
import { extendTailwindMerge } from "tailwind-merge";
|
|
7
|
+
var twMerge = extendTailwindMerge({
|
|
8
|
+
extend: {
|
|
9
|
+
classGroups: {
|
|
10
|
+
"font-size": [
|
|
11
|
+
{
|
|
12
|
+
text: [
|
|
13
|
+
"gdt-display",
|
|
14
|
+
"gdt-h1",
|
|
15
|
+
"gdt-h2",
|
|
16
|
+
"gdt-h3",
|
|
17
|
+
"gdt-h4",
|
|
18
|
+
"gdt-h5",
|
|
19
|
+
"gdt-xl",
|
|
20
|
+
"gdt-lg",
|
|
21
|
+
"gdt-md",
|
|
22
|
+
"gdt-sm",
|
|
23
|
+
"gdt-xs",
|
|
24
|
+
"gdt-subtext",
|
|
25
|
+
"gdt-capitalized"
|
|
26
|
+
]
|
|
27
|
+
}
|
|
28
|
+
]
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
function cn(...inputs) {
|
|
33
|
+
return twMerge(clsx(inputs));
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// src/components/ui/size-context.tsx
|
|
37
|
+
import { createContext, useContext } from "react";
|
|
38
|
+
import { Fragment, jsx } from "react/jsx-runtime";
|
|
39
|
+
var SizeContext = createContext(void 0);
|
|
40
|
+
function useComponentSize(size, fallback = "md") {
|
|
41
|
+
const inheritedSize = useContext(SizeContext);
|
|
42
|
+
return size ?? inheritedSize ?? fallback;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// src/components/ui/textarea.tsx
|
|
46
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
47
|
+
var textareaVariants = cva(
|
|
48
|
+
"flex field-sizing-content w-full min-w-0 resize-y rounded-xl border border-line bg-canvas text-fg-primary transition-[background-color,border-color,box-shadow,color] outline-none placeholder:text-fg-caption-placeholder hover:border-line-strong focus-visible:border-line-focus focus-visible:inset-ring-1 inset-ring-line-focus disabled:pointer-events-none disabled:cursor-not-allowed disabled:border-line-subtle disabled:bg-surface disabled:text-fg-caption-placeholder disabled:placeholder:text-fg-caption-placeholder aria-invalid:border-line-danger aria-invalid:text-fg-danger aria-invalid:placeholder:text-fg-danger aria-invalid:shadow-none",
|
|
49
|
+
{
|
|
50
|
+
variants: {
|
|
51
|
+
size: {
|
|
52
|
+
sm: "min-h-22 px-3 py-2 text-gdt-xs",
|
|
53
|
+
md: "min-h-26 px-3.5 py-2.5 text-gdt-sm",
|
|
54
|
+
lg: "min-h-31 px-4 py-3 text-gdt-md"
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
defaultVariants: {
|
|
58
|
+
size: "md"
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
);
|
|
62
|
+
function Textarea({ className, size, ...props }) {
|
|
63
|
+
const resolvedSize = useComponentSize(size);
|
|
64
|
+
return /* @__PURE__ */ jsx2(
|
|
65
|
+
"textarea",
|
|
66
|
+
{
|
|
67
|
+
"data-slot": "textarea",
|
|
68
|
+
"data-size": resolvedSize,
|
|
69
|
+
className: cn(textareaVariants({ size: resolvedSize }), className),
|
|
70
|
+
...props
|
|
71
|
+
}
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
export {
|
|
75
|
+
Textarea,
|
|
76
|
+
textareaVariants
|
|
77
|
+
};
|
|
78
|
+
//# sourceMappingURL=textarea.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/ui/textarea.tsx","../src/lib/cn.ts","../src/components/ui/size-context.tsx"],"sourcesContent":["import { cva, type VariantProps } from \"class-variance-authority\";\nimport type * as React from \"react\";\n\nimport { cn } from \"../../lib/cn\";\nimport { useComponentSize } from \"./size-context\";\n\nconst textareaVariants = cva(\n\t\"flex field-sizing-content w-full min-w-0 resize-y rounded-xl border border-line bg-canvas text-fg-primary transition-[background-color,border-color,box-shadow,color] outline-none placeholder:text-fg-caption-placeholder hover:border-line-strong focus-visible:border-line-focus focus-visible:inset-ring-1 inset-ring-line-focus disabled:pointer-events-none disabled:cursor-not-allowed disabled:border-line-subtle disabled:bg-surface disabled:text-fg-caption-placeholder disabled:placeholder:text-fg-caption-placeholder aria-invalid:border-line-danger aria-invalid:text-fg-danger aria-invalid:placeholder:text-fg-danger aria-invalid:shadow-none\",\n\t{\n\t\tvariants: {\n\t\t\tsize: {\n\t\t\t\tsm: \"min-h-22 px-3 py-2 text-gdt-xs\",\n\t\t\t\tmd: \"min-h-26 px-3.5 py-2.5 text-gdt-sm\",\n\t\t\t\tlg: \"min-h-31 px-4 py-3 text-gdt-md\",\n\t\t\t},\n\t\t},\n\t\tdefaultVariants: {\n\t\t\tsize: \"md\",\n\t\t},\n\t},\n);\n\ntype TextareaProps = Omit<React.ComponentProps<\"textarea\">, \"size\"> &\n\tVariantProps<typeof textareaVariants>;\n\ntype TextareaSize = NonNullable<VariantProps<typeof textareaVariants>[\"size\"]>;\n\nfunction Textarea({ className, size, ...props }: TextareaProps) {\n\tconst resolvedSize = useComponentSize(size);\n\n\treturn (\n\t\t<textarea\n\t\t\tdata-slot=\"textarea\"\n\t\t\tdata-size={resolvedSize}\n\t\t\tclassName={cn(textareaVariants({ size: resolvedSize }), className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport { Textarea, textareaVariants, type TextareaSize };\n","import { type ClassValue, clsx } from \"clsx\";\nimport { extendTailwindMerge } from \"tailwind-merge\";\n\nconst twMerge = extendTailwindMerge({\n\textend: {\n\t\tclassGroups: {\n\t\t\t\"font-size\": [\n\t\t\t\t{\n\t\t\t\t\ttext: [\n\t\t\t\t\t\t\"gdt-display\",\n\t\t\t\t\t\t\"gdt-h1\",\n\t\t\t\t\t\t\"gdt-h2\",\n\t\t\t\t\t\t\"gdt-h3\",\n\t\t\t\t\t\t\"gdt-h4\",\n\t\t\t\t\t\t\"gdt-h5\",\n\t\t\t\t\t\t\"gdt-xl\",\n\t\t\t\t\t\t\"gdt-lg\",\n\t\t\t\t\t\t\"gdt-md\",\n\t\t\t\t\t\t\"gdt-sm\",\n\t\t\t\t\t\t\"gdt-xs\",\n\t\t\t\t\t\t\"gdt-subtext\",\n\t\t\t\t\t\t\"gdt-capitalized\",\n\t\t\t\t\t],\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t},\n});\n\nexport function cn(...inputs: ClassValue[]) {\n\treturn twMerge(clsx(inputs));\n}\n","\"use client\";\n\nimport { createContext, type ReactNode, useContext } from \"react\";\n\ntype ComponentSize = \"sm\" | \"md\" | \"lg\";\n\nconst SizeContext = createContext<ComponentSize | undefined>(undefined);\n\nfunction SizeProvider({\n\tchildren,\n\tsize,\n}: {\n\tchildren: ReactNode;\n\tsize?: ComponentSize | null;\n}) {\n\tif (!size) {\n\t\treturn <>{children}</>;\n\t}\n\n\treturn <SizeContext.Provider value={size}>{children}</SizeContext.Provider>;\n}\n\nfunction useComponentSize(\n\tsize?: ComponentSize | null,\n\tfallback: ComponentSize = \"md\",\n) {\n\tconst inheritedSize = useContext(SizeContext);\n\treturn size ?? inheritedSize ?? fallback;\n}\n\nexport { SizeProvider, useComponentSize, type ComponentSize };\n"],"mappings":";AAAA,SAAS,WAA8B;;;ACAvC,SAA0B,YAAY;AACtC,SAAS,2BAA2B;AAEpC,IAAM,UAAU,oBAAoB;AAAA,EACnC,QAAQ;AAAA,IACP,aAAa;AAAA,MACZ,aAAa;AAAA,QACZ;AAAA,UACC,MAAM;AAAA,YACL;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,UACD;AAAA,QACD;AAAA,MACD;AAAA,IACD;AAAA,EACD;AACD,CAAC;AAEM,SAAS,MAAM,QAAsB;AAC3C,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC5B;;;AC7BA,SAAS,eAA+B,kBAAkB;AAcjD;AAVT,IAAM,cAAc,cAAyC,MAAS;AAgBtE,SAAS,iBACR,MACA,WAA0B,MACzB;AACD,QAAM,gBAAgB,WAAW,WAAW;AAC5C,SAAO,QAAQ,iBAAiB;AACjC;;;AFGE,gBAAAA,YAAA;AAzBF,IAAM,mBAAmB;AAAA,EACxB;AAAA,EACA;AAAA,IACC,UAAU;AAAA,MACT,MAAM;AAAA,QACL,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MACL;AAAA,IACD;AAAA,IACA,iBAAiB;AAAA,MAChB,MAAM;AAAA,IACP;AAAA,EACD;AACD;AAOA,SAAS,SAAS,EAAE,WAAW,MAAM,GAAG,MAAM,GAAkB;AAC/D,QAAM,eAAe,iBAAiB,IAAI;AAE1C,SACC,gBAAAA;AAAA,IAAC;AAAA;AAAA,MACA,aAAU;AAAA,MACV,aAAW;AAAA,MACX,WAAW,GAAG,iBAAiB,EAAE,MAAM,aAAa,CAAC,GAAG,SAAS;AAAA,MAChE,GAAG;AAAA;AAAA,EACL;AAEF;","names":["jsx"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! tailwindcss v4.3.1 | MIT License | https://tailwindcss.com */
|
|
2
|
+
:root,:host{--color-forest-50:#ecf2ea;--color-forest-100:#cfdfcb;--color-forest-200:#a8c2a1;--color-forest-300:#7aa071;--color-forest-400:#4f7b47;--color-forest-500:#2f5a2c;--color-forest-600:#224320;--color-forest-700:#173016;--color-forest-900:#0b1b0a;--color-forest-dark-100:#cdeed5;--color-forest-dark-200:#95d4a6;--color-forest-dark-300:#5bbb74;--color-forest-dark-400:#2e9a4f;--color-forest-dark-500:#0a7e32;--color-forest-dark-600:#0a6328;--color-forest-dark-700:#0f4d28;--color-forest-dark-900:#0a2e18;--color-forest-dark-950:#051a0d;--color-moss-50:#f1f0e4;--color-moss-100:#dcdbbe;--color-moss-200:#bdbc8c;--color-moss-300:#969560;--color-moss-400:#6f6e40;--color-moss-500:#4e4d29;--color-moss-600:#38371d;--color-moss-700:#252513;--color-moss-900:#141408;--color-brass-50:#fcf4e1;--color-brass-100:#f8e9c2;--color-brass-200:#ebc76a;--color-brass-300:#dca838;--color-brass-400:#b8861a;--color-brass-500:#946810;--color-brass-600:#6e4d0b;--color-brass-700:#4d3508;--color-brass-900:#2b1e04;--color-clay-50:#fbf1ec;--color-clay-100:#f4d6c7;--color-clay-200:#f2bd9a;--color-clay-300:#e89968;--color-clay-400:#d17646;--color-clay-500:#b2542b;--color-clay-600:#8f4220;--color-clay-700:#6b3118;--color-clay-900:#3d1b0d;--color-stone-0:#fff;--color-stone-50:#faf9f5;--color-stone-200:#f3f2ed;--color-stone-300:#e0dcd0;--color-stone-400:#b8b0a0;--color-stone-500:#8a8270;--color-stone-600:#5c5648;--color-stone-700:#3d3830;--color-stone-900:#1f1c18;--color-stone-950:#000;--color-stone-dark-0:#11160f;--color-stone-dark-10:#fff;--color-stone-dark-100:#ecf2ea;--color-stone-dark-300:#c4c8bc;--color-stone-dark-400:#8c9182;--color-stone-dark-500:#6e7466;--color-stone-dark-600:#4d5247;--color-stone-dark-700:#383f33;--color-stone-dark-750:#2c3329;--color-stone-dark-800:#232921;--color-stone-dark-875:#1a1f18;--color-button-glass-overlay:#00000080;--color-glass-overlay-button:#11160f59;--color-container-glass-overlay-1:#ffffffd9;--color-container-glass-overlay-2:#fffffff2;--color-botton-glass-overlay-dark:#11160f80;--color-container-glass-overlay-dark-1:#11160fd9;--color-container-glass-overlay-dark-2:#11160ff2;--color-canvas:var(--color-stone-0);--color-surface:var(--color-stone-50);--color-surface-raised:var(--color-stone-200);--color-surface-overlay:var(--color-stone-0);--color-surface-brand:var(--color-forest-500);--color-surface-brand-subtle:var(--color-forest-50);--color-surface-accent:var(--color-brass-400);--color-surface-accent-subtle:var(--color-brass-50);--color-surface-danger-subtle:var(--color-clay-50);--color-surface-info-subtle:var(--color-moss-50);--color-surface-glass-button:var(--color-stone-950);--color-surface-glass-overlay-button:var(--color-button-glass-overlay);--color-surface-glass-overlay-container-1:var(--color-container-glass-overlay-1);--color-surface-glass-overlay-container-2:var(--color-container-glass-overlay-2);--color-fg-primary:var(--color-stone-900);--color-fg-secondary:var(--color-stone-600);--color-fg-caption-placeholder:var(--color-stone-500);--color-fg-brand:var(--color-forest-600);--color-fg-danger:var(--color-clay-600);--color-fg-accent:var(--color-brass-600);--color-fg-on-brand:var(--color-forest-50);--color-fg-on-accent:var(--color-brass-900);--color-line-subtle:var(--color-stone-200);--color-line:var(--color-stone-300);--color-line-strong:var(--color-stone-400);--color-line-focus:var(--color-forest-500);--color-line-danger:var(--color-clay-500);--border:var(--color-stone-300);--color-action-primary:var(--color-forest-500);--color-action-primary-hover:var(--color-forest-600);--color-action-primary-pressed:var(--color-forest-700);--color-action-secondary:var(--color-forest-500);--color-action-secondary-hover:var(--color-forest-600);--color-action-secondary-pressed:var(--color-forest-700);--color-action-tertiary:var(--color-stone-200);--color-action-tertiary-hover:var(--color-stone-300);--color-action-tertiary-pressed:var(--color-stone-400);--color-action-accent:var(--color-brass-400);--color-action-danger:var(--color-clay-500);--color-action-danger-hover:var(--color-clay-600);--color-action-danger-pressed:var(--color-clay-700);--color-status-success:var(--color-forest-500);--color-status-warning:var(--color-brass-400);--color-status-danger:var(--color-clay-500);--color-status-info:var(--color-moss-500);--gradient-hero-forest:linear-gradient(45deg, var(--color-forest-700) 50%, var(--color-forest-500) 80%, var(--color-forest-400) 100%);--gradient-hero-forest-moss:linear-gradient(45deg, var(--color-forest-600) 50%, var(--color-moss-500) 100%);--gradient-surface-canvas-lift:linear-gradient(180deg, var(--color-stone-0) 0%, var(--color-stone-50) 100%);--gradient-surface-card-lift:linear-gradient(180deg, var(--color-stone-0) 0%, var(--color-stone-200) 100%);--gradient-surface-brand-tint:linear-gradient(45deg, var(--color-forest-50) 50%, var(--color-stone-50) 100%);--gradient-accent-brass-rise:linear-gradient(45deg, var(--color-brass-400) 50%, var(--color-brass-300) 80%, var(--color-brass-200) 100%);--gradient-accent-forest-to-brass:linear-gradient(45deg, var(--color-forest-700) 50%, var(--color-forest-500) 75%, var(--color-brass-400) 100%);--gradient-accent-emerald-to-brass:var(--gradient-accent-forest-to-brass);--gradient-overlay-photo-bottom:linear-gradient(180deg, rgb(from var(--color-forest-900) r g b / 0) 0%, rgb(from var(--color-forest-900) r g b / 0) 40%, rgb(from var(--color-forest-900) r g b / .88) 100%);--gradient-overlay-photo-dual:linear-gradient(180deg, rgb(from var(--color-forest-900) r g b / .6) 0%, rgb(from var(--color-forest-900) r g b / 0) 40%, rgb(from var(--color-forest-900) r g b / 0) 60%, rgb(from var(--color-forest-900) r g b / .78) 100%);--shadow-1:0 1px 2px rgb(from var(--color-forest-700) r g b / .06);--shadow-2:0 4px 8px rgb(from var(--color-forest-700) r g b / .1), 0 8px 16px rgb(from var(--color-forest-700) r g b / .06);--shadow-3:0 8px 16px rgb(from var(--color-forest-700) r g b / .14), 0 16px 32px rgb(from var(--color-forest-700) r g b / .1), 0 24px 48px rgb(from var(--color-forest-700) r g b / .06);--shadow-4:0 8px 16px rgb(from var(--color-forest-700) r g b / .14), 0 16px 32px rgb(from var(--color-forest-700) r g b / .1), 0 24px 48px rgb(from var(--color-forest-700) r g b / .06);--elevation-e0-bg:var(--color-stone-50);--elevation-e0-border:var(--color-line-subtle);--elevation-e0-shadow:none;--elevation-e1-bg:var(--color-stone-0);--elevation-e1-border:var(--color-line-subtle);--elevation-e1-shadow:0 1px 2px rgb(from var(--color-stone-900) r g b / .06), 0 1px 1px rgb(from var(--color-stone-900) r g b / .04);--elevation-e2-bg:var(--color-stone-0);--elevation-e2-border:var(--color-line-subtle);--elevation-e2-shadow:0 2px 6px rgb(from var(--color-stone-900) r g b / .08), 0 8px 24px rgb(from var(--color-stone-900) r g b / .06);--elevation-e3-bg:var(--color-stone-0);--elevation-e3-border:var(--color-line);--elevation-e3-shadow:0 4px 12px rgb(from var(--color-stone-900) r g b / .1), 0 16px 40px rgb(from var(--color-stone-900) r g b / .1);--elevation-e4-bg:var(--color-stone-0);--elevation-e4-border:var(--color-line);--elevation-e4-shadow:0 8px 20px rgb(from var(--color-stone-900) r g b / .14), 0 24px 64px rgb(from var(--color-stone-900) r g b / .16)}.dark{--color-canvas:var(--color-stone-dark-0);--color-surface:var(--color-stone-dark-875);--color-surface-raised:var(--color-stone-dark-800);--color-surface-overlay:var(--color-stone-dark-800);--color-surface-brand:var(--color-forest-dark-500);--color-surface-brand-subtle:var(--color-forest-dark-900);--color-surface-accent:var(--color-brass-300);--color-surface-accent-subtle:var(--color-brass-700);--color-surface-danger-subtle:var(--color-clay-900);--color-surface-info-subtle:var(--color-moss-700);--color-surface-glass-button:var(--color-stone-dark-875);--color-surface-glass-overlay-button:var(--color-botton-glass-overlay-dark);--color-surface-glass-overlay-container-1:var(--color-container-glass-overlay-dark-1);--color-surface-glass-overlay-container-2:var(--color-container-glass-overlay-dark-2);--color-fg-primary:var(--color-stone-dark-10);--color-fg-secondary:var(--color-stone-dark-300);--color-fg-caption-placeholder:var(--color-stone-dark-500);--color-fg-brand:var(--color-forest-dark-200);--color-fg-danger:var(--color-clay-300);--color-fg-accent:var(--color-brass-200);--color-fg-on-brand:var(--color-stone-dark-10);--color-fg-on-accent:var(--color-brass-700);--color-line-subtle:var(--color-stone-dark-800);--color-line:var(--color-stone-dark-700);--color-line-strong:var(--color-stone-dark-600);--color-line-focus:var(--color-forest-dark-500);--color-line-danger:var(--color-clay-400);--color-action-primary:var(--color-forest-dark-500);--color-action-primary-hover:var(--color-forest-dark-400);--color-action-primary-pressed:var(--color-forest-dark-600);--color-action-secondary:var(--color-forest-dark-500);--color-action-secondary-hover:var(--color-forest-dark-400);--color-action-secondary-pressed:var(--color-forest-dark-600);--color-action-tertiary:var(--color-stone-dark-600);--color-action-tertiary-hover:var(--color-stone-dark-700);--color-action-tertiary-pressed:var(--color-stone-dark-800);--color-action-accent:var(--color-brass-300);--color-action-danger:var(--color-clay-400);--color-action-danger-hover:var(--color-clay-500);--color-action-danger-pressed:var(--color-clay-600);--color-status-success:var(--color-forest-dark-300);--color-status-warning:var(--color-brass-200);--color-status-danger:var(--color-clay-300);--color-status-info:var(--color-moss-200);--gradient-hero-forest:linear-gradient(45deg, var(--color-forest-dark-950) 50%, var(--color-forest-dark-900) 75%, var(--color-forest-dark-500) 100%);--gradient-hero-forest-moss:linear-gradient(45deg, var(--color-forest-dark-900) 50%, var(--color-moss-700) 100%);--gradient-surface-canvas-lift:linear-gradient(180deg, var(--color-stone-dark-0) 0%, var(--color-stone-dark-875) 100%);--gradient-surface-card-lift:linear-gradient(180deg, var(--color-stone-dark-875) 0%, var(--color-stone-dark-750) 100%);--gradient-surface-brand-tint:linear-gradient(45deg, var(--color-forest-dark-900) 50%, var(--color-stone-dark-875) 100%);--gradient-accent-brass-rise:linear-gradient(45deg, var(--color-brass-500) 50%, var(--color-brass-400) 80%, var(--color-brass-300) 100%);--gradient-accent-forest-to-brass:linear-gradient(45deg, var(--color-forest-dark-950) 50%, var(--color-forest-dark-500) 75%, var(--color-brass-500) 100%);--gradient-accent-emerald-to-brass:var(--gradient-accent-forest-to-brass);--gradient-overlay-photo-bottom:linear-gradient(180deg, rgb(from var(--color-forest-900) r g b / 0) 0%, rgb(from var(--color-forest-900) r g b / 0) 40%, rgb(from var(--color-forest-900) r g b / .88) 100%);--gradient-overlay-photo-dual:linear-gradient(180deg, rgb(from var(--color-forest-900) r g b / .6) 0%, rgb(from var(--color-forest-900) r g b / 0) 40%, rgb(from var(--color-forest-900) r g b / 0) 60%, rgb(from var(--color-forest-900) r g b / .78) 100%);--shadow-1:0 1px 2px rgb(from var(--color-forest-700) r g b / .04);--shadow-2:0 4px 12px #00000059;--shadow-3:0 8px 24px #00000080, 0 16px 48px #0000004d;--shadow-4:0 8px 16px #00000024, 0 16px 32px #0000001a, 0 24px 48px #0000000f;--elevation-e0-bg:var(--color-stone-dark-0);--elevation-e0-border:var(--color-stone-dark-800);--elevation-e0-shadow:none;--elevation-e1-bg:var(--color-stone-dark-875);--elevation-e1-border:var(--color-stone-dark-750);--elevation-e1-shadow:none;--elevation-e2-bg:var(--color-stone-dark-800);--elevation-e2-border:var(--color-stone-dark-700);--elevation-e2-shadow:none;--elevation-e3-bg:var(--color-stone-dark-750);--elevation-e3-border:var(--color-stone-dark-600);--elevation-e3-shadow:0 6px 18px rgb(from var(--color-black) r g b / .28);--elevation-e4-bg:var(--color-stone-dark-700);--elevation-e4-border:var(--color-stone-dark-500);--elevation-e4-shadow:0 10px 30px rgb(from var(--color-black) r g b / .38), 0 24px 64px rgb(from var(--color-black) r g b / .18)}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
interface TimePickerProps {
|
|
4
|
+
value?: string;
|
|
5
|
+
onChange?: (time: string | undefined) => void;
|
|
6
|
+
format?: "12h" | "24h";
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
placeholder?: string;
|
|
9
|
+
className?: string;
|
|
10
|
+
}
|
|
11
|
+
declare function TimePicker({ value, onChange, format, disabled, placeholder, className, }: TimePickerProps): React.JSX.Element;
|
|
12
|
+
|
|
13
|
+
export { TimePicker, type TimePickerProps };
|
|
@@ -0,0 +1,472 @@
|
|
|
1
|
+
// src/components/ui/time-picker.tsx
|
|
2
|
+
import { ClockIcon } from "lucide-react";
|
|
3
|
+
import * as React from "react";
|
|
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/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"];
|
|
191
|
+
function parseTimeString(value, format) {
|
|
192
|
+
if (value) {
|
|
193
|
+
if (format === "12h") {
|
|
194
|
+
const m = value.match(/^(\d{1,2}):(\d{2})\s*(AM|PM)$/i);
|
|
195
|
+
if (m) {
|
|
196
|
+
return {
|
|
197
|
+
hour: m[1].padStart(2, "0"),
|
|
198
|
+
minute: m[2],
|
|
199
|
+
period: m[3].toUpperCase()
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
} else {
|
|
203
|
+
const m = value.match(/^(\d{1,2}):(\d{2})$/);
|
|
204
|
+
if (m) {
|
|
205
|
+
return { hour: m[1].padStart(2, "0"), minute: m[2], period: "" };
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
const now = /* @__PURE__ */ new Date();
|
|
210
|
+
if (format === "12h") {
|
|
211
|
+
const h = now.getHours();
|
|
212
|
+
return {
|
|
213
|
+
hour: String(h % 12 || 12).padStart(2, "0"),
|
|
214
|
+
minute: String(now.getMinutes()).padStart(2, "0"),
|
|
215
|
+
period: h >= 12 ? "PM" : "AM"
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
return {
|
|
219
|
+
hour: String(now.getHours()).padStart(2, "0"),
|
|
220
|
+
minute: String(now.getMinutes()).padStart(2, "0"),
|
|
221
|
+
period: ""
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
function formatTimeValue(tv, format) {
|
|
225
|
+
if (format === "12h") return `${tv.hour}:${tv.minute} ${tv.period}`;
|
|
226
|
+
return `${tv.hour}:${tv.minute}`;
|
|
227
|
+
}
|
|
228
|
+
function TimeColumn({ items, value, onChange }) {
|
|
229
|
+
const scrollRef = React.useRef(null);
|
|
230
|
+
const itemRefs = React.useRef([]);
|
|
231
|
+
const [centerIndex, setCenterIndex] = React.useState(
|
|
232
|
+
() => Math.max(0, items.indexOf(value))
|
|
233
|
+
);
|
|
234
|
+
const isProgrammatic = React.useRef(false);
|
|
235
|
+
const settleRef = React.useRef(null);
|
|
236
|
+
const onChangeRef = React.useRef(onChange);
|
|
237
|
+
onChangeRef.current = onChange;
|
|
238
|
+
const paintCurve = React.useCallback(() => {
|
|
239
|
+
const el = scrollRef.current;
|
|
240
|
+
if (!el) return;
|
|
241
|
+
const offset = el.scrollTop / ITEM_HEIGHT;
|
|
242
|
+
itemRefs.current.forEach((node, index) => {
|
|
243
|
+
if (!node) return;
|
|
244
|
+
const distance = index - offset;
|
|
245
|
+
const abs = Math.min(Math.abs(distance), CURVE_CLAMP);
|
|
246
|
+
const tilt = Math.max(Math.min(distance, CURVE_CLAMP), -CURVE_CLAMP);
|
|
247
|
+
node.style.opacity = String(Math.max(1 - abs * 0.28, 0.2));
|
|
248
|
+
node.style.transform = `perspective(280px) rotateX(${tilt * -20}deg) scale(${1 - abs * 0.04})`;
|
|
249
|
+
});
|
|
250
|
+
}, []);
|
|
251
|
+
React.useEffect(() => {
|
|
252
|
+
const el = scrollRef.current;
|
|
253
|
+
if (!el) return;
|
|
254
|
+
isProgrammatic.current = true;
|
|
255
|
+
el.scrollTop = centerIndex * ITEM_HEIGHT;
|
|
256
|
+
paintCurve();
|
|
257
|
+
requestAnimationFrame(() => {
|
|
258
|
+
isProgrammatic.current = false;
|
|
259
|
+
});
|
|
260
|
+
}, []);
|
|
261
|
+
React.useEffect(() => {
|
|
262
|
+
const idx = items.indexOf(value);
|
|
263
|
+
if (idx === -1 || idx === centerIndex) return;
|
|
264
|
+
setCenterIndex(idx);
|
|
265
|
+
const el = scrollRef.current;
|
|
266
|
+
if (!el) return;
|
|
267
|
+
isProgrammatic.current = true;
|
|
268
|
+
el.scrollTo({ top: idx * ITEM_HEIGHT, behavior: "smooth" });
|
|
269
|
+
setTimeout(() => {
|
|
270
|
+
isProgrammatic.current = false;
|
|
271
|
+
paintCurve();
|
|
272
|
+
}, 320);
|
|
273
|
+
}, [value]);
|
|
274
|
+
function handleScroll() {
|
|
275
|
+
paintCurve();
|
|
276
|
+
if (isProgrammatic.current) return;
|
|
277
|
+
const el = scrollRef.current;
|
|
278
|
+
if (!el) return;
|
|
279
|
+
const idx = Math.max(
|
|
280
|
+
0,
|
|
281
|
+
Math.min(Math.round(el.scrollTop / ITEM_HEIGHT), items.length - 1)
|
|
282
|
+
);
|
|
283
|
+
if (idx !== centerIndex) setCenterIndex(idx);
|
|
284
|
+
if (settleRef.current) clearTimeout(settleRef.current);
|
|
285
|
+
settleRef.current = setTimeout(() => onChangeRef.current(items[idx]), 120);
|
|
286
|
+
}
|
|
287
|
+
return /* @__PURE__ */ jsx4(
|
|
288
|
+
"div",
|
|
289
|
+
{
|
|
290
|
+
ref: scrollRef,
|
|
291
|
+
onScroll: handleScroll,
|
|
292
|
+
style: { height: `${VISIBLE_COUNT * ITEM_HEIGHT}px` },
|
|
293
|
+
className: "overflow-y-scroll [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",
|
|
294
|
+
children: /* @__PURE__ */ jsx4(
|
|
295
|
+
"div",
|
|
296
|
+
{
|
|
297
|
+
style: {
|
|
298
|
+
paddingTop: `${SCROLL_PADDING}px`,
|
|
299
|
+
paddingBottom: `${SCROLL_PADDING}px`
|
|
300
|
+
},
|
|
301
|
+
children: items.map((item, index) => {
|
|
302
|
+
const dist = Math.abs(index - centerIndex);
|
|
303
|
+
return /* @__PURE__ */ jsx4(
|
|
304
|
+
"button",
|
|
305
|
+
{
|
|
306
|
+
type: "button",
|
|
307
|
+
ref: (node) => {
|
|
308
|
+
itemRefs.current[index] = node;
|
|
309
|
+
},
|
|
310
|
+
onClick: () => scrollRef.current?.scrollTo({
|
|
311
|
+
top: index * ITEM_HEIGHT,
|
|
312
|
+
behavior: "smooth"
|
|
313
|
+
}),
|
|
314
|
+
style: { height: `${ITEM_HEIGHT}px` },
|
|
315
|
+
className: "flex w-full cursor-pointer items-center justify-center select-none will-change-transform",
|
|
316
|
+
children: /* @__PURE__ */ jsx4(
|
|
317
|
+
"span",
|
|
318
|
+
{
|
|
319
|
+
className: cn(
|
|
320
|
+
"rounded-full px-4 py-1.5 text-gdt-sm font-medium transition-colors",
|
|
321
|
+
dist === 0 ? "bg-action-primary text-fg-on-brand" : dist === 1 ? "text-fg-secondary" : "text-fg-caption-placeholder"
|
|
322
|
+
),
|
|
323
|
+
children: item
|
|
324
|
+
}
|
|
325
|
+
)
|
|
326
|
+
},
|
|
327
|
+
item
|
|
328
|
+
);
|
|
329
|
+
})
|
|
330
|
+
}
|
|
331
|
+
)
|
|
332
|
+
}
|
|
333
|
+
);
|
|
334
|
+
}
|
|
335
|
+
function TimePicker({
|
|
336
|
+
value,
|
|
337
|
+
onChange,
|
|
338
|
+
format = "12h",
|
|
339
|
+
disabled = false,
|
|
340
|
+
placeholder = "Select time",
|
|
341
|
+
className
|
|
342
|
+
}) {
|
|
343
|
+
const [open, setOpen] = React.useState(false);
|
|
344
|
+
const [pending, setPending] = React.useState(
|
|
345
|
+
() => parseTimeString(value, format)
|
|
346
|
+
);
|
|
347
|
+
function handleOpenChange(next) {
|
|
348
|
+
if (next) setPending(parseTimeString(value, format));
|
|
349
|
+
setOpen(next);
|
|
350
|
+
}
|
|
351
|
+
const columns = [
|
|
352
|
+
{ key: "Hour", show: true },
|
|
353
|
+
{ key: "Minute", show: true },
|
|
354
|
+
{ key: "Period", show: format === "12h" }
|
|
355
|
+
].filter((c) => c.show);
|
|
356
|
+
return /* @__PURE__ */ jsxs3(Popover, { open, onOpenChange: handleOpenChange, children: [
|
|
357
|
+
/* @__PURE__ */ jsxs3(
|
|
358
|
+
PopoverTrigger,
|
|
359
|
+
{
|
|
360
|
+
disabled,
|
|
361
|
+
className: cn(
|
|
362
|
+
"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",
|
|
363
|
+
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",
|
|
364
|
+
className
|
|
365
|
+
),
|
|
366
|
+
children: [
|
|
367
|
+
/* @__PURE__ */ jsx4(
|
|
368
|
+
"span",
|
|
369
|
+
{
|
|
370
|
+
className: cn(
|
|
371
|
+
"min-w-0 truncate",
|
|
372
|
+
!value && "text-fg-caption-placeholder"
|
|
373
|
+
),
|
|
374
|
+
children: value || placeholder
|
|
375
|
+
}
|
|
376
|
+
),
|
|
377
|
+
/* @__PURE__ */ jsx4(
|
|
378
|
+
ClockIcon,
|
|
379
|
+
{
|
|
380
|
+
className: cn(
|
|
381
|
+
"ml-2 size-4 shrink-0",
|
|
382
|
+
disabled ? "text-fg-caption-placeholder" : "text-fg-secondary"
|
|
383
|
+
)
|
|
384
|
+
}
|
|
385
|
+
)
|
|
386
|
+
]
|
|
387
|
+
}
|
|
388
|
+
),
|
|
389
|
+
/* @__PURE__ */ jsxs3(
|
|
390
|
+
PopoverContent,
|
|
391
|
+
{
|
|
392
|
+
showArrow: false,
|
|
393
|
+
align: "start",
|
|
394
|
+
className: "min-w-(--anchor-width) gap-0 overflow-hidden rounded-2xl p-0",
|
|
395
|
+
children: [
|
|
396
|
+
/* @__PURE__ */ jsx4("div", { className: "w-full flex gap-2 items-center justify-center border-b border-line-subtle", children: columns.map((column) => /* @__PURE__ */ jsx4(
|
|
397
|
+
"p",
|
|
398
|
+
{
|
|
399
|
+
className: cn(
|
|
400
|
+
"py-3 text-center text-gdt-xs text-fg-caption-placeholder",
|
|
401
|
+
format === "12h" ? "w-20.5" : "w-31"
|
|
402
|
+
),
|
|
403
|
+
children: column.key
|
|
404
|
+
},
|
|
405
|
+
column.key
|
|
406
|
+
)) }),
|
|
407
|
+
/* @__PURE__ */ jsxs3(
|
|
408
|
+
"div",
|
|
409
|
+
{
|
|
410
|
+
className: cn(
|
|
411
|
+
"flex gap-2 justify-center px-3 pt-2",
|
|
412
|
+
format === "12h" ? "*:w-20.5" : "*:w-31"
|
|
413
|
+
),
|
|
414
|
+
children: [
|
|
415
|
+
/* @__PURE__ */ jsx4(
|
|
416
|
+
TimeColumn,
|
|
417
|
+
{
|
|
418
|
+
items: format === "12h" ? HOURS_12 : HOURS_24,
|
|
419
|
+
value: pending.hour,
|
|
420
|
+
onChange: (hour) => setPending((prev) => ({ ...prev, hour }))
|
|
421
|
+
}
|
|
422
|
+
),
|
|
423
|
+
/* @__PURE__ */ jsx4(
|
|
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
|
+
] });
|
|
468
|
+
}
|
|
469
|
+
export {
|
|
470
|
+
TimePicker
|
|
471
|
+
};
|
|
472
|
+
//# sourceMappingURL=time-picker.js.map
|