@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/calendar.js
CHANGED
|
@@ -1,293 +1,139 @@
|
|
|
1
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
import { t as cn } from "./cn-BI_4DMBf.js";
|
|
3
|
+
import { Button } from "./button.js";
|
|
4
|
+
import { Combobox, ComboboxContent, ComboboxEmpty, ComboboxInput, ComboboxItem, ComboboxList, ComboboxTrigger, ComboboxValue } from "./combobox.js";
|
|
2
5
|
import { ChevronLeftIcon, ChevronRightIcon } from "lucide-react";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
7
|
import * as React from "react";
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
8
|
+
import { DayPicker, getDefaultClassNames } from "react-day-picker";
|
|
9
|
+
//#region src/calendar.tsx
|
|
10
|
+
function Calendar({ className, classNames, showOutsideDays = false, weekStartsOn = 1, locale, formatters, components, ...props }) {
|
|
11
|
+
const defaultClassNames = getDefaultClassNames();
|
|
12
|
+
return /* @__PURE__ */ jsx(DayPicker, {
|
|
13
|
+
showOutsideDays,
|
|
14
|
+
weekStartsOn,
|
|
15
|
+
className: cn("group/calendar bg-transparent p-4 [--cell-radius:var(--radius-md)] [--cell-height:36px] [--cell-width:40px]", String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`, String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`, className),
|
|
16
|
+
locale,
|
|
17
|
+
formatters: {
|
|
18
|
+
formatWeekdayName: (date) => date.toLocaleString(locale?.code, { weekday: "narrow" }),
|
|
19
|
+
...formatters
|
|
20
|
+
},
|
|
21
|
+
classNames: {
|
|
22
|
+
root: cn("w-fit", defaultClassNames.root),
|
|
23
|
+
months: cn("relative flex flex-col gap-4 md:flex-row", defaultClassNames.months),
|
|
24
|
+
month: cn("flex w-full flex-col gap-4", defaultClassNames.month),
|
|
25
|
+
nav: cn("pointer-events-none absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1 *:pointer-events-auto", defaultClassNames.nav),
|
|
26
|
+
button_previous: cn("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", defaultClassNames.button_previous),
|
|
27
|
+
button_next: cn("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", defaultClassNames.button_next),
|
|
28
|
+
month_caption: cn("flex h-(--cell-height) w-full items-center justify-center px-(--cell-width)", defaultClassNames.month_caption),
|
|
29
|
+
caption_label: cn("text-gdt-sm font-medium text-fg-primary select-none", defaultClassNames.caption_label),
|
|
30
|
+
dropdowns: cn("flex h-(--cell-height) w-full items-center justify-center gap-1.5", defaultClassNames.dropdowns),
|
|
31
|
+
table: "w-full border-collapse",
|
|
32
|
+
weekdays: cn("flex", defaultClassNames.weekdays),
|
|
33
|
+
weekday: cn("flex-1 text-gdt-xs font-normal text-fg-secondary select-none", defaultClassNames.weekday),
|
|
34
|
+
week: cn("mt-1 flex w-full", defaultClassNames.week),
|
|
35
|
+
day: cn("group/day relative aspect-square h-full w-full p-0 text-center select-none", defaultClassNames.day),
|
|
36
|
+
range_start: cn("rounded-l-full bg-surface-brand-subtle", defaultClassNames.range_start),
|
|
37
|
+
range_middle: cn("rounded-none bg-surface-brand-subtle", defaultClassNames.range_middle),
|
|
38
|
+
range_end: cn("rounded-r-full bg-surface-brand-subtle", defaultClassNames.range_end),
|
|
39
|
+
today: cn("rounded-full h-(--cell-height) w-(--cell-width) flex items-center justify-center bg-surface-brand-subtle p-0", defaultClassNames.today),
|
|
40
|
+
outside: cn("text-fg-caption-placeholder aria-selected:text-fg-caption-placeholder", defaultClassNames.outside),
|
|
41
|
+
disabled: cn("text-fg-caption-placeholder opacity-50", defaultClassNames.disabled),
|
|
42
|
+
hidden: cn("invisible", defaultClassNames.hidden),
|
|
43
|
+
...classNames
|
|
44
|
+
},
|
|
45
|
+
components: {
|
|
46
|
+
Root: ({ className, rootRef, ...props }) => {
|
|
47
|
+
return /* @__PURE__ */ jsx("div", {
|
|
48
|
+
"data-slot": "calendar",
|
|
49
|
+
ref: rootRef,
|
|
50
|
+
className: cn(className),
|
|
51
|
+
...props
|
|
52
|
+
});
|
|
53
|
+
},
|
|
54
|
+
Chevron: ({ className, orientation, ...props }) => {
|
|
55
|
+
if (orientation === "right") return /* @__PURE__ */ jsx(ChevronRightIcon, {
|
|
56
|
+
className: cn("size-4", className),
|
|
57
|
+
...props
|
|
58
|
+
});
|
|
59
|
+
return /* @__PURE__ */ jsx(ChevronLeftIcon, {
|
|
60
|
+
className: cn("size-4", className),
|
|
61
|
+
...props
|
|
62
|
+
});
|
|
63
|
+
},
|
|
64
|
+
DayButton: ({ ...props }) => /* @__PURE__ */ jsx(CalendarDayButton, {
|
|
65
|
+
locale,
|
|
66
|
+
...props
|
|
67
|
+
}),
|
|
68
|
+
Dropdown: CalendarDropdown,
|
|
69
|
+
WeekNumber: ({ children, ...props }) => {
|
|
70
|
+
return /* @__PURE__ */ jsx("td", {
|
|
71
|
+
...props,
|
|
72
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
73
|
+
className: "flex h-(--cell-height) w-(--cell-width) items-center justify-center text-center",
|
|
74
|
+
children
|
|
75
|
+
})
|
|
76
|
+
});
|
|
77
|
+
},
|
|
78
|
+
...components
|
|
79
|
+
},
|
|
80
|
+
...props
|
|
81
|
+
});
|
|
39
82
|
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
83
|
+
function CalendarDropdown({ options = [], value, onChange, disabled, "aria-label": ariaLabel }) {
|
|
84
|
+
const selected = options.find((option) => option.value === Number(value));
|
|
85
|
+
return /* @__PURE__ */ jsxs(Combobox, {
|
|
86
|
+
size: "sm",
|
|
87
|
+
items: options.map((option) => option.label),
|
|
88
|
+
value: selected?.label ?? null,
|
|
89
|
+
onValueChange: (label) => {
|
|
90
|
+
const next = options.find((option) => option.label === label);
|
|
91
|
+
if (!next) return;
|
|
92
|
+
onChange?.({ target: { value: String(next.value) } });
|
|
93
|
+
},
|
|
94
|
+
disabled,
|
|
95
|
+
children: [/* @__PURE__ */ jsx(ComboboxTrigger, {
|
|
96
|
+
"aria-label": ariaLabel,
|
|
97
|
+
children: /* @__PURE__ */ jsx(ComboboxValue, {})
|
|
98
|
+
}), /* @__PURE__ */ jsxs(ComboboxContent, {
|
|
99
|
+
className: "w-auto min-w-32",
|
|
100
|
+
children: [
|
|
101
|
+
/* @__PURE__ */ jsx(ComboboxInput, {
|
|
102
|
+
placeholder: "Search",
|
|
103
|
+
showTrigger: false
|
|
104
|
+
}),
|
|
105
|
+
/* @__PURE__ */ jsx(ComboboxEmpty, { children: "No results" }),
|
|
106
|
+
/* @__PURE__ */ jsx(ComboboxList, {
|
|
107
|
+
className: "max-h-56",
|
|
108
|
+
children: (label) => /* @__PURE__ */ jsx(ComboboxItem, {
|
|
109
|
+
value: label,
|
|
110
|
+
disabled: options.find((option) => option.label === label)?.disabled,
|
|
111
|
+
children: label
|
|
112
|
+
}, label)
|
|
113
|
+
})
|
|
114
|
+
]
|
|
115
|
+
})]
|
|
116
|
+
});
|
|
53
117
|
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
},
|
|
74
|
-
size: {
|
|
75
|
-
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",
|
|
76
|
-
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",
|
|
77
|
-
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",
|
|
78
|
-
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",
|
|
79
|
-
icon: "size-10",
|
|
80
|
-
"icon-xs": "size-6 text-gdt-xs [&_svg:not([class*='size-'])]:size-3",
|
|
81
|
-
"icon-sm": "size-8 text-gdt-sm [&_svg:not([class*='size-'])]:size-3.5",
|
|
82
|
-
"icon-lg": "size-12.5 text-gdt-md [&_svg:not([class*='size-'])]:size-4.5",
|
|
83
|
-
"icon-xl": "size-14 text-gdt-lg [&_svg:not([class*='size-'])]:size-5"
|
|
84
|
-
}
|
|
85
|
-
},
|
|
86
|
-
defaultVariants: {
|
|
87
|
-
variant: "primary",
|
|
88
|
-
size: "md"
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
);
|
|
92
|
-
function Button({
|
|
93
|
-
className,
|
|
94
|
-
variant = "primary",
|
|
95
|
-
size,
|
|
96
|
-
isLoading = false,
|
|
97
|
-
children,
|
|
98
|
-
disabled = false,
|
|
99
|
-
...props
|
|
100
|
-
}) {
|
|
101
|
-
const inheritedSize = useComponentSize();
|
|
102
|
-
const resolvedSize = size ?? inheritedSize;
|
|
103
|
-
const _disabled = disabled || isLoading;
|
|
104
|
-
return /* @__PURE__ */ jsxs(
|
|
105
|
-
ButtonPrimitive,
|
|
106
|
-
{
|
|
107
|
-
"data-slot": "button",
|
|
108
|
-
className: cn(buttonVariants({ variant, size: resolvedSize, className })),
|
|
109
|
-
disabled: _disabled,
|
|
110
|
-
...props,
|
|
111
|
-
children: [
|
|
112
|
-
isLoading && /* @__PURE__ */ jsx2(Loader, { className: "size-4 animate-spin" }),
|
|
113
|
-
" ",
|
|
114
|
-
children
|
|
115
|
-
]
|
|
116
|
-
}
|
|
117
|
-
);
|
|
118
|
+
function CalendarDayButton({ className, day, modifiers, locale, ...props }) {
|
|
119
|
+
const defaultClassNames = getDefaultClassNames();
|
|
120
|
+
const ref = React.useRef(null);
|
|
121
|
+
React.useEffect(() => {
|
|
122
|
+
if (modifiers.focused) ref.current?.focus();
|
|
123
|
+
}, [modifiers.focused]);
|
|
124
|
+
const isEndpoint = modifiers.selected && !modifiers.range_start && !modifiers.range_end && !modifiers.range_middle || modifiers.range_start || modifiers.range_end;
|
|
125
|
+
return /* @__PURE__ */ jsx(Button, {
|
|
126
|
+
ref,
|
|
127
|
+
variant: "ghost",
|
|
128
|
+
size: "icon",
|
|
129
|
+
"data-day": day.date.toLocaleDateString(locale?.code),
|
|
130
|
+
"data-selected-single": modifiers.selected && !modifiers.range_start && !modifiers.range_end && !modifiers.range_middle,
|
|
131
|
+
"data-range-start": modifiers.range_start,
|
|
132
|
+
"data-range-end": modifiers.range_end,
|
|
133
|
+
"data-range-middle": modifiers.range_middle,
|
|
134
|
+
className: cn("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", "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", "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", "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", "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", isEndpoint && "font-medium", "group-data-[focused=true]/day:border-line-focus group-data-[focused=true]/day:shadow-[0px_0px_0px_2px_var(--color-line-focus)]", defaultClassNames.day, className),
|
|
135
|
+
...props
|
|
136
|
+
});
|
|
118
137
|
}
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
122
|
-
function Calendar({
|
|
123
|
-
className,
|
|
124
|
-
classNames,
|
|
125
|
-
showOutsideDays = false,
|
|
126
|
-
weekStartsOn = 1,
|
|
127
|
-
locale,
|
|
128
|
-
formatters,
|
|
129
|
-
components,
|
|
130
|
-
...props
|
|
131
|
-
}) {
|
|
132
|
-
const defaultClassNames = getDefaultClassNames();
|
|
133
|
-
return /* @__PURE__ */ jsx3(
|
|
134
|
-
DayPicker,
|
|
135
|
-
{
|
|
136
|
-
showOutsideDays,
|
|
137
|
-
weekStartsOn,
|
|
138
|
-
className: cn(
|
|
139
|
-
"group/calendar bg-transparent p-4 [--cell-radius:var(--radius-md)] [--cell-height:36px] [--cell-width:40px]",
|
|
140
|
-
String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,
|
|
141
|
-
String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,
|
|
142
|
-
className
|
|
143
|
-
),
|
|
144
|
-
locale,
|
|
145
|
-
formatters: {
|
|
146
|
-
formatWeekdayName: (date) => date.toLocaleString(locale?.code, { weekday: "narrow" }),
|
|
147
|
-
...formatters
|
|
148
|
-
},
|
|
149
|
-
classNames: {
|
|
150
|
-
root: cn("w-fit", defaultClassNames.root),
|
|
151
|
-
months: cn(
|
|
152
|
-
"relative flex flex-col gap-4 md:flex-row",
|
|
153
|
-
defaultClassNames.months
|
|
154
|
-
),
|
|
155
|
-
month: cn("flex w-full flex-col gap-4", defaultClassNames.month),
|
|
156
|
-
nav: cn(
|
|
157
|
-
"absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1",
|
|
158
|
-
defaultClassNames.nav
|
|
159
|
-
),
|
|
160
|
-
button_previous: cn(
|
|
161
|
-
"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",
|
|
162
|
-
defaultClassNames.button_previous
|
|
163
|
-
),
|
|
164
|
-
button_next: cn(
|
|
165
|
-
"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",
|
|
166
|
-
defaultClassNames.button_next
|
|
167
|
-
),
|
|
168
|
-
month_caption: cn(
|
|
169
|
-
"flex h-(--cell-height) w-full items-center justify-center px-(--cell-width)",
|
|
170
|
-
defaultClassNames.month_caption
|
|
171
|
-
),
|
|
172
|
-
caption_label: cn(
|
|
173
|
-
"text-gdt-sm font-medium text-fg-primary select-none",
|
|
174
|
-
defaultClassNames.caption_label
|
|
175
|
-
),
|
|
176
|
-
table: "w-full border-collapse",
|
|
177
|
-
weekdays: cn("flex", defaultClassNames.weekdays),
|
|
178
|
-
weekday: cn(
|
|
179
|
-
"flex-1 text-gdt-xs font-normal text-fg-secondary select-none",
|
|
180
|
-
defaultClassNames.weekday
|
|
181
|
-
),
|
|
182
|
-
week: cn("mt-1 flex w-full", defaultClassNames.week),
|
|
183
|
-
day: cn(
|
|
184
|
-
"group/day relative aspect-square h-full w-full p-0 text-center select-none",
|
|
185
|
-
defaultClassNames.day
|
|
186
|
-
),
|
|
187
|
-
range_start: cn(
|
|
188
|
-
"rounded-l-full bg-surface-brand-subtle",
|
|
189
|
-
defaultClassNames.range_start
|
|
190
|
-
),
|
|
191
|
-
range_middle: cn(
|
|
192
|
-
"rounded-none bg-surface-brand-subtle",
|
|
193
|
-
defaultClassNames.range_middle
|
|
194
|
-
),
|
|
195
|
-
range_end: cn(
|
|
196
|
-
"rounded-r-full bg-surface-brand-subtle",
|
|
197
|
-
defaultClassNames.range_end
|
|
198
|
-
),
|
|
199
|
-
today: cn(
|
|
200
|
-
"rounded-full h-(--cell-height) w-(--cell-width) flex items-center justify-center bg-surface-brand-subtle p-0",
|
|
201
|
-
defaultClassNames.today
|
|
202
|
-
),
|
|
203
|
-
outside: cn(
|
|
204
|
-
"text-fg-caption-placeholder aria-selected:text-fg-caption-placeholder",
|
|
205
|
-
defaultClassNames.outside
|
|
206
|
-
),
|
|
207
|
-
disabled: cn(
|
|
208
|
-
"text-fg-caption-placeholder opacity-50",
|
|
209
|
-
defaultClassNames.disabled
|
|
210
|
-
),
|
|
211
|
-
hidden: cn("invisible", defaultClassNames.hidden),
|
|
212
|
-
...classNames
|
|
213
|
-
},
|
|
214
|
-
components: {
|
|
215
|
-
Root: ({ className: className2, rootRef, ...props2 }) => {
|
|
216
|
-
return /* @__PURE__ */ jsx3(
|
|
217
|
-
"div",
|
|
218
|
-
{
|
|
219
|
-
"data-slot": "calendar",
|
|
220
|
-
ref: rootRef,
|
|
221
|
-
className: cn(className2),
|
|
222
|
-
...props2
|
|
223
|
-
}
|
|
224
|
-
);
|
|
225
|
-
},
|
|
226
|
-
Chevron: ({ className: className2, orientation, ...props2 }) => {
|
|
227
|
-
if (orientation === "right") {
|
|
228
|
-
return /* @__PURE__ */ jsx3(
|
|
229
|
-
ChevronRightIcon,
|
|
230
|
-
{
|
|
231
|
-
className: cn("size-4", className2),
|
|
232
|
-
...props2
|
|
233
|
-
}
|
|
234
|
-
);
|
|
235
|
-
}
|
|
236
|
-
return /* @__PURE__ */ jsx3(ChevronLeftIcon, { className: cn("size-4", className2), ...props2 });
|
|
237
|
-
},
|
|
238
|
-
DayButton: ({ ...props2 }) => /* @__PURE__ */ jsx3(CalendarDayButton, { locale, ...props2 }),
|
|
239
|
-
WeekNumber: ({ children, ...props2 }) => {
|
|
240
|
-
return /* @__PURE__ */ jsx3("td", { ...props2, children: /* @__PURE__ */ jsx3("div", { className: "flex h-(--cell-height) w-(--cell-width) items-center justify-center text-center", children }) });
|
|
241
|
-
},
|
|
242
|
-
...components
|
|
243
|
-
},
|
|
244
|
-
...props
|
|
245
|
-
}
|
|
246
|
-
);
|
|
247
|
-
}
|
|
248
|
-
function CalendarDayButton({
|
|
249
|
-
className,
|
|
250
|
-
day,
|
|
251
|
-
modifiers,
|
|
252
|
-
locale,
|
|
253
|
-
...props
|
|
254
|
-
}) {
|
|
255
|
-
const defaultClassNames = getDefaultClassNames();
|
|
256
|
-
const ref = React.useRef(null);
|
|
257
|
-
React.useEffect(() => {
|
|
258
|
-
if (modifiers.focused) ref.current?.focus();
|
|
259
|
-
}, [modifiers.focused]);
|
|
260
|
-
const isEndpoint = modifiers.selected && !modifiers.range_start && !modifiers.range_end && !modifiers.range_middle || modifiers.range_start || modifiers.range_end;
|
|
261
|
-
return /* @__PURE__ */ jsx3(
|
|
262
|
-
Button,
|
|
263
|
-
{
|
|
264
|
-
ref,
|
|
265
|
-
variant: "ghost",
|
|
266
|
-
size: "icon",
|
|
267
|
-
"data-day": day.date.toLocaleDateString(locale?.code),
|
|
268
|
-
"data-selected-single": modifiers.selected && !modifiers.range_start && !modifiers.range_end && !modifiers.range_middle,
|
|
269
|
-
"data-range-start": modifiers.range_start,
|
|
270
|
-
"data-range-end": modifiers.range_end,
|
|
271
|
-
"data-range-middle": modifiers.range_middle,
|
|
272
|
-
className: cn(
|
|
273
|
-
"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",
|
|
274
|
-
// Selected single + range endpoints: filled brand circle.
|
|
275
|
-
"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",
|
|
276
|
-
"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",
|
|
277
|
-
"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",
|
|
278
|
-
// In-range days: brand wash carried by the cell, brand text on the button.
|
|
279
|
-
"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",
|
|
280
|
-
isEndpoint && "font-medium",
|
|
281
|
-
"group-data-[focused=true]/day:border-line-focus group-data-[focused=true]/day:shadow-[0px_0px_0px_2px_var(--color-line-focus)]",
|
|
282
|
-
defaultClassNames.day,
|
|
283
|
-
className
|
|
284
|
-
),
|
|
285
|
-
...props
|
|
286
|
-
}
|
|
287
|
-
);
|
|
288
|
-
}
|
|
289
|
-
export {
|
|
290
|
-
Calendar,
|
|
291
|
-
CalendarDayButton
|
|
292
|
-
};
|
|
293
|
-
//# sourceMappingURL=calendar.js.map
|
|
138
|
+
//#endregion
|
|
139
|
+
export { Calendar, CalendarDayButton };
|
package/dist/card.d.ts
CHANGED
|
@@ -1,18 +1,16 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
import { VariantProps } from 'class-variance-authority';
|
|
5
|
-
|
|
1
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
2
|
+
import { VariantProps } from "class-variance-authority";
|
|
3
|
+
//#region src/card.d.ts
|
|
6
4
|
declare const cardVariants: (props?: ({
|
|
7
|
-
|
|
8
|
-
} &
|
|
5
|
+
selected?: boolean | null | undefined;
|
|
6
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
9
7
|
type CardProps = useRender.ComponentProps<"article"> & VariantProps<typeof cardVariants>;
|
|
10
|
-
declare function Card({ className, render, selected, ...props }: CardProps):
|
|
11
|
-
declare function CardTitle({ className, render, ...props }: useRender.ComponentProps<"h3">):
|
|
12
|
-
declare function CardHeader({ className, render, ...props }: useRender.ComponentProps<"div">):
|
|
13
|
-
declare function CardDescription({ className, render, ...props }: useRender.ComponentProps<"p">):
|
|
14
|
-
declare function CardContent({ className, render, ...props }: useRender.ComponentProps<"div">):
|
|
15
|
-
declare function CardFooter({ className, render, ...props }: useRender.ComponentProps<"div">):
|
|
16
|
-
declare function CardAction({ className, render, ...props }: useRender.ComponentProps<"button">):
|
|
17
|
-
|
|
18
|
-
export { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, type CardProps, CardTitle, cardVariants };
|
|
8
|
+
declare function Card({ className, render, selected, ...props }: CardProps): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
|
|
9
|
+
declare function CardTitle({ className, render, ...props }: useRender.ComponentProps<"h3">): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
|
|
10
|
+
declare function CardHeader({ className, render, ...props }: useRender.ComponentProps<"div">): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
|
|
11
|
+
declare function CardDescription({ className, render, ...props }: useRender.ComponentProps<"p">): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
|
|
12
|
+
declare function CardContent({ className, render, ...props }: useRender.ComponentProps<"div">): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
|
|
13
|
+
declare function CardFooter({ className, render, ...props }: useRender.ComponentProps<"div">): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
|
|
14
|
+
declare function CardAction({ className, render, ...props }: useRender.ComponentProps<"button">): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
|
|
15
|
+
//#endregion
|
|
16
|
+
export { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, type CardProps, CardTitle, cardVariants };
|