@giddaa-housing/ui 1.0.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/css/generated/shared.css +1 -1
- package/dist/accordion.d.ts +9 -10
- package/dist/accordion.js +41 -87
- package/dist/activity-timeline.d.ts +12 -16
- package/dist/activity-timeline.js +83 -198
- package/dist/alert.d.ts +8 -9
- package/dist/alert.js +53 -111
- package/dist/auth-layout.d.ts +4 -4
- package/dist/auth-layout.js +143 -294
- package/dist/avatar.d.ts +6 -6
- package/dist/avatar.js +49 -19
- package/dist/badge.d.ts +12 -14
- package/dist/badge.js +71 -11
- package/dist/bar-chart.d.ts +65 -67
- package/dist/bar-chart.js +232 -207
- package/dist/breadcrumb.d.ts +5 -5
- package/dist/breadcrumb.js +56 -118
- package/dist/bullet-chart.d.ts +33 -33
- package/dist/bullet-chart.js +121 -148
- package/dist/button-BZIeyUw6.d.ts +17 -0
- package/dist/button-group.d.ts +13 -16
- package/dist/button-group.js +39 -88
- package/dist/button.d.ts +2 -19
- package/dist/button.js +94 -13
- package/dist/calendar.d.ts +6 -6
- package/dist/calendar.js +138 -17
- package/dist/card.d.ts +14 -16
- package/dist/card.js +59 -145
- package/dist/carousel.d.ts +34 -35
- package/dist/carousel.js +335 -20
- package/dist/chart.d.ts +58 -59
- package/dist/chart.js +376 -28
- package/dist/checkbox.d.ts +10 -12
- package/dist/checkbox.js +82 -47
- package/dist/cn-BI_4DMBf.js +23 -0
- package/dist/collapsible.d.ts +7 -8
- package/dist/collapsible.js +22 -47
- package/dist/combobox.d.ts +10 -10
- package/dist/combobox.js +236 -44
- package/dist/cta.d.ts +12 -14
- package/dist/cta.js +175 -341
- package/dist/currency-selector.d.ts +31 -32
- package/dist/currency-selector.js +106 -184
- package/dist/data-table.d.ts +164 -0
- package/dist/data-table.js +673 -0
- package/dist/date-picker.d.ts +22 -23
- package/dist/date-picker.js +119 -192
- package/dist/details-card.d.ts +7 -7
- package/dist/details-card.js +104 -253
- package/dist/dialog.d.ts +13 -14
- package/dist/dialog.js +116 -209
- package/dist/dropdown-menu.d.ts +13 -13
- package/dist/dropdown-menu.js +180 -37
- package/dist/dropzone.d.ts +55 -55
- package/dist/dropzone.js +327 -439
- package/dist/editorial-card.d.ts +23 -25
- package/dist/editorial-card.js +129 -296
- package/dist/empty-state.d.ts +8 -9
- package/dist/empty-state.js +48 -105
- package/dist/field.d.ts +23 -25
- package/dist/field.js +110 -221
- package/dist/filter.d.ts +118 -0
- package/dist/filter.js +775 -0
- package/dist/footer.d.ts +8 -15
- package/dist/footer.js +197 -400
- package/dist/funnel-chart.d.ts +38 -41
- package/dist/funnel-chart.js +167 -189
- package/dist/gallery-indicator.d.ts +11 -12
- package/dist/gallery-indicator.js +75 -12
- package/dist/heatmap-chart.d.ts +47 -50
- package/dist/heatmap-chart.js +186 -237
- package/dist/infotip.d.ts +8 -9
- package/dist/infotip.js +33 -59
- package/dist/input-CfoEJ8A6.d.ts +12 -0
- package/dist/input-group.d.ts +16 -20
- package/dist/input-group.js +99 -23
- 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 +17 -9
- package/dist/input.d.ts +2 -13
- package/dist/input.js +27 -11
- package/dist/item.d.ts +7 -8
- package/dist/item.js +22 -59
- package/dist/kpi-card.d.ts +18 -20
- package/dist/kpi-card.js +84 -192
- package/dist/label.d.ts +6 -6
- package/dist/label.js +40 -8
- package/dist/line-chart.d.ts +88 -89
- package/dist/line-chart.js +142 -104
- package/dist/logo.d.ts +4 -4
- package/dist/logo.js +92 -9
- package/dist/map-indicator.d.ts +7 -7
- package/dist/map-indicator.js +80 -106
- package/dist/match.d.ts +10 -11
- package/dist/match.js +62 -107
- package/dist/media-gallery-hero.d.ts +40 -42
- package/dist/media-gallery-hero.js +182 -343
- package/dist/media-player.d.ts +17 -17
- package/dist/media-player.js +873 -1348
- 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 +61 -117
- package/dist/page-header.d.ts +10 -11
- package/dist/page-header.js +34 -79
- package/dist/pagination.d.ts +17 -21
- package/dist/pagination.js +132 -207
- package/dist/password-input.d.ts +5 -13
- package/dist/password-input.js +31 -55
- package/dist/phone-input.d.ts +19 -20
- package/dist/phone-input.js +226 -344
- package/dist/photo-gallery.d.ts +19 -19
- package/dist/photo-gallery.js +313 -449
- package/dist/picker-lzgmsNfG.js +32 -0
- package/dist/pie-chart.d.ts +60 -60
- package/dist/pie-chart.js +140 -148
- package/dist/popover.d.ts +9 -9
- package/dist/popover.js +72 -23
- package/dist/price-tag.d.ts +26 -27
- package/dist/price-tag.js +113 -173
- package/dist/progress.d.ts +16 -17
- package/dist/progress.js +169 -24
- package/dist/property-listing-card.d.ts +14 -17
- package/dist/property-listing-card.js +102 -220
- package/dist/radar-chart.d.ts +29 -31
- package/dist/radar-chart.js +162 -137
- package/dist/radio-group.d.ts +11 -13
- package/dist/radio-group.js +46 -60
- package/dist/review-block.d.ts +14 -16
- package/dist/review-block.js +154 -10
- package/dist/rich-text-editor.d.ts +30 -14
- package/dist/rich-text-editor.js +592 -716
- package/dist/scatter-chart.d.ts +45 -47
- package/dist/scatter-chart.js +236 -240
- package/dist/search-input.d.ts +8 -16
- package/dist/search-input.js +57 -109
- package/dist/select.d.ts +8 -8
- package/dist/select.js +144 -27
- package/dist/separator.d.ts +8 -9
- package/dist/separator.js +32 -8
- package/dist/sheet.d.ts +11 -11
- package/dist/sheet.js +103 -24
- package/dist/sidebar.d.ts +32 -37
- package/dist/sidebar.js +364 -634
- package/dist/size-context-D4mYvcg8.d.ts +10 -0
- package/dist/size-context.d.ts +2 -11
- package/dist/size-context.js +17 -9
- package/dist/skeleton.d.ts +4 -5
- package/dist/skeleton.js +12 -8
- package/dist/slider.d.ts +8 -9
- package/dist/slider.js +64 -135
- package/dist/sparkline.d.ts +43 -46
- package/dist/sparkline.js +221 -251
- package/dist/stepper.d.ts +23 -24
- package/dist/stepper.js +149 -246
- package/dist/styles.css +510 -108
- package/dist/switch.d.ts +10 -12
- package/dist/switch.js +48 -70
- 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 +113 -154
- package/dist/tabs.d.ts +23 -15
- package/dist/tabs.js +71 -18
- package/dist/tag.d.ts +21 -23
- package/dist/tag.js +103 -159
- package/dist/testimonial-block.d.ts +18 -19
- package/dist/testimonial-block.js +189 -358
- package/dist/textarea-IS_D8pXf.d.ts +11 -0
- package/dist/textarea.d.ts +2 -12
- package/dist/textarea.js +24 -11
- package/dist/time-picker.d.ts +11 -11
- package/dist/time-picker.js +245 -302
- package/dist/toast.d.ts +16 -18
- package/dist/toast.js +154 -205
- package/dist/tooltip.d.ts +8 -9
- package/dist/tooltip.js +37 -12
- package/dist/tree-map.d.ts +54 -57
- package/dist/tree-map.js +227 -269
- package/dist/use-uncontrolled-CLfM1XbB.js +21 -0
- package/dist/waterfall-chart.d.ts +94 -97
- package/dist/waterfall-chart.js +455 -552
- package/package.json +28 -9
- package/dist/accordion.js.map +0 -1
- package/dist/activity-timeline.js.map +0 -1
- package/dist/alert.js.map +0 -1
- package/dist/auth-layout.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/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/chunk-322YCNVL.js +0 -278
- package/dist/chunk-322YCNVL.js.map +0 -1
- package/dist/chunk-3ACQVT7A.js +0 -25
- package/dist/chunk-3ACQVT7A.js.map +0 -1
- package/dist/chunk-3T65TLJX.js +0 -334
- package/dist/chunk-3T65TLJX.js.map +0 -1
- package/dist/chunk-6ZSGQHH2.js +0 -192
- package/dist/chunk-6ZSGQHH2.js.map +0 -1
- package/dist/chunk-7TBMLFGW.js +0 -41
- package/dist/chunk-7TBMLFGW.js.map +0 -1
- package/dist/chunk-B4H6RNDH.js +0 -135
- package/dist/chunk-B4H6RNDH.js.map +0 -1
- package/dist/chunk-BUXCGZ6X.js +0 -219
- package/dist/chunk-BUXCGZ6X.js.map +0 -1
- package/dist/chunk-CHII2QHH.js +0 -58
- package/dist/chunk-CHII2QHH.js.map +0 -1
- package/dist/chunk-DMNOXRRW.js +0 -147
- package/dist/chunk-DMNOXRRW.js.map +0 -1
- package/dist/chunk-EFSOSSIC.js +0 -130
- package/dist/chunk-EFSOSSIC.js.map +0 -1
- package/dist/chunk-FZDSVMKY.js +0 -363
- package/dist/chunk-FZDSVMKY.js.map +0 -1
- package/dist/chunk-GJOFIJS3.js +0 -246
- package/dist/chunk-GJOFIJS3.js.map +0 -1
- package/dist/chunk-HL3ZSYES.js +0 -23
- package/dist/chunk-HL3ZSYES.js.map +0 -1
- package/dist/chunk-JVLUBAPB.js +0 -129
- package/dist/chunk-JVLUBAPB.js.map +0 -1
- package/dist/chunk-KDPYSOYZ.js +0 -64
- package/dist/chunk-KDPYSOYZ.js.map +0 -1
- package/dist/chunk-KSMDANKI.js +0 -43
- package/dist/chunk-KSMDANKI.js.map +0 -1
- package/dist/chunk-MEKCCOP5.js +0 -46
- package/dist/chunk-MEKCCOP5.js.map +0 -1
- package/dist/chunk-NOFXVRWL.js +0 -451
- package/dist/chunk-NOFXVRWL.js.map +0 -1
- package/dist/chunk-PC5MHNVA.js +0 -171
- package/dist/chunk-PC5MHNVA.js.map +0 -1
- package/dist/chunk-QKAQZ2GU.js +0 -122
- package/dist/chunk-QKAQZ2GU.js.map +0 -1
- package/dist/chunk-QZHSHSVV.js +0 -26
- package/dist/chunk-QZHSHSVV.js.map +0 -1
- package/dist/chunk-RBMK26XD.js +0 -19
- package/dist/chunk-RBMK26XD.js.map +0 -1
- package/dist/chunk-SFNJGF6M.js +0 -262
- package/dist/chunk-SFNJGF6M.js.map +0 -1
- package/dist/chunk-UJJNLGTM.js +0 -112
- package/dist/chunk-UJJNLGTM.js.map +0 -1
- package/dist/chunk-VGR4ZWJ3.js +0 -418
- package/dist/chunk-VGR4ZWJ3.js.map +0 -1
- package/dist/chunk-XG47P6D4.js +0 -99
- package/dist/chunk-XG47P6D4.js.map +0 -1
- package/dist/chunk-XZZAHNVM.js +0 -21
- package/dist/chunk-XZZAHNVM.js.map +0 -1
- package/dist/chunk-Y4TTYVNE.js +0 -36
- package/dist/chunk-Y4TTYVNE.js.map +0 -1
- package/dist/chunk-YDWIHW6Q.js +0 -69
- package/dist/chunk-YDWIHW6Q.js.map +0 -1
- package/dist/collapsible.js.map +0 -1
- package/dist/combobox.js.map +0 -1
- package/dist/cta.js.map +0 -1
- package/dist/currency-selector.js.map +0 -1
- package/dist/date-picker.js.map +0 -1
- package/dist/details-card.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/editorial-card.js.map +0 -1
- package/dist/empty-state.js.map +0 -1
- package/dist/field.js.map +0 -1
- package/dist/footer.js.map +0 -1
- package/dist/funnel-chart.js.map +0 -1
- package/dist/gallery-indicator.js.map +0 -1
- package/dist/heatmap-chart.js.map +0 -1
- package/dist/infotip.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/map-indicator.js.map +0 -1
- package/dist/match.js.map +0 -1
- package/dist/media-gallery-hero.js.map +0 -1
- package/dist/media-player.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/price-tag.js.map +0 -1
- package/dist/progress.js.map +0 -1
- package/dist/property-listing-card.js.map +0 -1
- package/dist/radar-chart.js.map +0 -1
- package/dist/radio-group.js.map +0 -1
- package/dist/review-block.js.map +0 -1
- package/dist/rich-text-editor.js.map +0 -1
- package/dist/scatter-chart.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/slider.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 -123
- 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/testimonial-block.js.map +0 -1
- package/dist/textarea.js.map +0 -1
- 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/waterfall-chart.js.map +0 -1
package/dist/chunk-YDWIHW6Q.js
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
PopoverTrigger
|
|
3
|
-
} from "./chunk-JVLUBAPB.js";
|
|
4
|
-
import {
|
|
5
|
-
Button
|
|
6
|
-
} from "./chunk-B4H6RNDH.js";
|
|
7
|
-
import {
|
|
8
|
-
cn
|
|
9
|
-
} from "./chunk-Y4TTYVNE.js";
|
|
10
|
-
|
|
11
|
-
// src/lib/picker.tsx
|
|
12
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
13
|
-
function PickerTrigger({
|
|
14
|
-
icon: Icon,
|
|
15
|
-
displayValue,
|
|
16
|
-
placeholder,
|
|
17
|
-
disabled,
|
|
18
|
-
open,
|
|
19
|
-
className
|
|
20
|
-
}) {
|
|
21
|
-
return /* @__PURE__ */ jsxs(
|
|
22
|
-
PopoverTrigger,
|
|
23
|
-
{
|
|
24
|
-
disabled,
|
|
25
|
-
className: cn(
|
|
26
|
-
"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",
|
|
27
|
-
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",
|
|
28
|
-
className
|
|
29
|
-
),
|
|
30
|
-
children: [
|
|
31
|
-
/* @__PURE__ */ jsx(
|
|
32
|
-
"span",
|
|
33
|
-
{
|
|
34
|
-
className: cn(
|
|
35
|
-
"min-w-0 truncate",
|
|
36
|
-
!displayValue && "text-fg-caption-placeholder"
|
|
37
|
-
),
|
|
38
|
-
children: displayValue || placeholder
|
|
39
|
-
}
|
|
40
|
-
),
|
|
41
|
-
/* @__PURE__ */ jsx(
|
|
42
|
-
Icon,
|
|
43
|
-
{
|
|
44
|
-
className: cn(
|
|
45
|
-
"ml-2 size-4 shrink-0",
|
|
46
|
-
disabled ? "text-fg-caption-placeholder" : "text-fg-secondary"
|
|
47
|
-
)
|
|
48
|
-
}
|
|
49
|
-
)
|
|
50
|
-
]
|
|
51
|
-
}
|
|
52
|
-
);
|
|
53
|
-
}
|
|
54
|
-
function PickerFooter({
|
|
55
|
-
secondaryLabel,
|
|
56
|
-
onSecondary,
|
|
57
|
-
onApply
|
|
58
|
-
}) {
|
|
59
|
-
return /* @__PURE__ */ jsxs("div", { className: "flex w-full items-center justify-between border-t border-line-subtle px-4 py-3", children: [
|
|
60
|
-
/* @__PURE__ */ jsx(Button, { variant: "tertiary-outline", size: "sm", onClick: onSecondary, children: secondaryLabel }),
|
|
61
|
-
/* @__PURE__ */ jsx(Button, { size: "sm", onClick: onApply, children: "Apply" })
|
|
62
|
-
] });
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
export {
|
|
66
|
-
PickerTrigger,
|
|
67
|
-
PickerFooter
|
|
68
|
-
};
|
|
69
|
-
//# sourceMappingURL=chunk-YDWIHW6Q.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/lib/picker.tsx"],"sourcesContent":["\"use client\";\n\nimport type { LucideIcon } from \"lucide-react\";\nimport { Button } from \"../button\";\nimport { PopoverTrigger } from \"../popover\";\nimport { cn } from \"./cn\";\n\n// Shared internals for the popover-based pickers (DatePicker, DateRangePicker,\n// TimePicker). Not part of the public package surface.\n\ninterface PickerTriggerProps {\n\ticon: LucideIcon;\n\tdisplayValue: string;\n\tplaceholder: string;\n\tdisabled: boolean;\n\topen: boolean;\n\tclassName?: string;\n}\n\nfunction PickerTrigger({\n\ticon: Icon,\n\tdisplayValue,\n\tplaceholder,\n\tdisabled,\n\topen,\n\tclassName,\n}: PickerTriggerProps) {\n\treturn (\n\t\t<PopoverTrigger\n\t\t\tdisabled={disabled}\n\t\t\tclassName={cn(\n\t\t\t\t\"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\",\n\t\t\t\tdisabled\n\t\t\t\t\t? \"cursor-not-allowed border-line-subtle bg-surface text-fg-caption-placeholder\"\n\t\t\t\t\t: open\n\t\t\t\t\t\t? \"border-line-focus bg-canvas text-fg-primary inset-ring-1 inset-ring-line-focus\"\n\t\t\t\t\t\t: \"border-line bg-canvas text-fg-primary hover:border-line-strong\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t>\n\t\t\t<span\n\t\t\t\tclassName={cn(\n\t\t\t\t\t\"min-w-0 truncate\",\n\t\t\t\t\t!displayValue && \"text-fg-caption-placeholder\",\n\t\t\t\t)}\n\t\t\t>\n\t\t\t\t{displayValue || placeholder}\n\t\t\t</span>\n\t\t\t<Icon\n\t\t\t\tclassName={cn(\n\t\t\t\t\t\"ml-2 size-4 shrink-0\",\n\t\t\t\t\tdisabled ? \"text-fg-caption-placeholder\" : \"text-fg-secondary\",\n\t\t\t\t)}\n\t\t\t/>\n\t\t</PopoverTrigger>\n\t);\n}\n\ninterface PickerFooterProps {\n\tsecondaryLabel: string;\n\tonSecondary: () => void;\n\tonApply: () => void;\n}\n\nfunction PickerFooter({\n\tsecondaryLabel,\n\tonSecondary,\n\tonApply,\n}: PickerFooterProps) {\n\treturn (\n\t\t<div className=\"flex w-full items-center justify-between border-t border-line-subtle px-4 py-3\">\n\t\t\t<Button variant=\"tertiary-outline\" size=\"sm\" onClick={onSecondary}>\n\t\t\t\t{secondaryLabel}\n\t\t\t</Button>\n\t\t\t<Button size=\"sm\" onClick={onApply}>\n\t\t\t\tApply\n\t\t\t</Button>\n\t\t</div>\n\t);\n}\n\nexport { PickerFooter, PickerTrigger };\nexport type { PickerFooterProps, PickerTriggerProps };\n"],"mappings":";;;;;;;;;;;AA4BE,SAYC,KAZD;AATF,SAAS,cAAc;AAAA,EACtB,MAAM;AAAA,EACN;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,GAAuB;AACtB,SACC;AAAA,IAAC;AAAA;AAAA,MACA;AAAA,MACA,WAAW;AAAA,QACV;AAAA,QACA,WACG,iFACA,OACC,mFACA;AAAA,QACJ;AAAA,MACD;AAAA,MAEA;AAAA;AAAA,UAAC;AAAA;AAAA,YACA,WAAW;AAAA,cACV;AAAA,cACA,CAAC,gBAAgB;AAAA,YAClB;AAAA,YAEC,0BAAgB;AAAA;AAAA,QAClB;AAAA,QACA;AAAA,UAAC;AAAA;AAAA,YACA,WAAW;AAAA,cACV;AAAA,cACA,WAAW,gCAAgC;AAAA,YAC5C;AAAA;AAAA,QACD;AAAA;AAAA;AAAA,EACD;AAEF;AAQA,SAAS,aAAa;AAAA,EACrB;AAAA,EACA;AAAA,EACA;AACD,GAAsB;AACrB,SACC,qBAAC,SAAI,WAAU,kFACd;AAAA,wBAAC,UAAO,SAAQ,oBAAmB,MAAK,MAAK,SAAS,aACpD,0BACF;AAAA,IACA,oBAAC,UAAO,MAAK,MAAK,SAAS,SAAS,mBAEpC;AAAA,KACD;AAEF;","names":[]}
|
package/dist/collapsible.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/collapsible.tsx"],"sourcesContent":["\"use client\";\n\nimport { Collapsible as CollapsiblePrimitive } from \"@base-ui/react/collapsible\";\nimport { cn } from \"./lib/cn\";\n\nfunction Collapsible({ className, ...props }: CollapsiblePrimitive.Root.Props) {\n\treturn (\n\t\t<CollapsiblePrimitive.Root\n\t\t\tdata-slot=\"collapsible\"\n\t\t\tclassName={cn(\"group/collapsible\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction CollapsibleTrigger({\n\tclassName,\n\t...props\n}: CollapsiblePrimitive.Trigger.Props) {\n\treturn (\n\t\t<CollapsiblePrimitive.Trigger\n\t\t\tdata-slot=\"collapsible-trigger\"\n\t\t\tclassName={cn(\"group/collapsible-trigger\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction CollapsibleContent({\n\tclassName,\n\t...props\n}: CollapsiblePrimitive.Panel.Props) {\n\treturn (\n\t\t<CollapsiblePrimitive.Panel\n\t\t\tdata-slot=\"collapsible-content\"\n\t\t\tclassName={cn(\n\t\t\t\t\"h-(--collapsible-panel-height) overflow-hidden transition-[height] duration-150 ease-out data-ending-style:h-0 data-starting-style:h-0 [&[hidden]:not([hidden='until-found'])]:hidden\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport { Collapsible, CollapsibleTrigger, CollapsibleContent };\n"],"mappings":";;;;;;AAEA,SAAS,eAAe,4BAA4B;AAKlD;AAFF,SAAS,YAAY,EAAE,WAAW,GAAG,MAAM,GAAoC;AAC9E,SACC;AAAA,IAAC,qBAAqB;AAAA,IAArB;AAAA,MACA,aAAU;AAAA,MACV,WAAW,GAAG,qBAAqB,SAAS;AAAA,MAC3C,GAAG;AAAA;AAAA,EACL;AAEF;AAEA,SAAS,mBAAmB;AAAA,EAC3B;AAAA,EACA,GAAG;AACJ,GAAuC;AACtC,SACC;AAAA,IAAC,qBAAqB;AAAA,IAArB;AAAA,MACA,aAAU;AAAA,MACV,WAAW,GAAG,6BAA6B,SAAS;AAAA,MACnD,GAAG;AAAA;AAAA,EACL;AAEF;AAEA,SAAS,mBAAmB;AAAA,EAC3B;AAAA,EACA,GAAG;AACJ,GAAqC;AACpC,SACC;AAAA,IAAC,qBAAqB;AAAA,IAArB;AAAA,MACA,aAAU;AAAA,MACV,WAAW;AAAA,QACV;AAAA,QACA;AAAA,MACD;AAAA,MACC,GAAG;AAAA;AAAA,EACL;AAEF;","names":[]}
|
package/dist/combobox.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/dist/cta.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/cta.tsx"],"sourcesContent":["import { mergeProps } from \"@base-ui/react/merge-props\";\nimport { useRender } from \"@base-ui/react/use-render\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport type * as React from \"react\";\nimport type { SVGProps } from \"react\";\n\nimport { Button, ButtonLink } from \"./button\";\nimport { cn } from \"./lib/cn\";\n\n/**\n * CTA is a composable marketing panel: a text column (title, description,\n * checklist) paired with an optional grid of feature cards and an action\n * row. Compose only the pieces you need — every part is a standalone\n * primitive, not a fixed layout.\n *\n * @example\n * <CTA variant=\"subtle\">\n * <CTAContent>\n * <CTATag>Your Next Step</CTATag>\n * <CTATitle>Own your first home sooner</CTATitle>\n * <CTADescription>\n * Shari'ah-compliant financing built around how you actually get paid.\n * </CTADescription>\n * <CTAList>\n * <CTAListItem>No interest, ever</CTAListItem>\n * <CTAListItem>Approval in 48 hours</CTAListItem>\n * </CTAList>\n * </CTAContent>\n * <CTACard variant=\"brand\">\n * <CTACardIcon variant=\"surface\"><ShieldCheck /></CTACardIcon>\n * <CTACardTitle>Backed by NAICOM</CTACardTitle>\n * <CTACardDescription>Every plan is insured end to end.</CTACardDescription>\n * <CTAButton>Get started</CTAButton>\n * </CTACard>\n * </CTA>\n */\n\nconst ctaVariants = cva(\n\t\"group/cta relative flex w-full min-w-0 flex-col overflow-hidden rounded-2xl text-fg-primary transition-[background-color,border-color,box-shadow] py-10 px-5 md:px-10 xl:py-16 xl:px-16 md:gap-10 gap-6\",\n\t{\n\t\tvariants: {\n\t\t\tvariant: { default: \"bg-surface\", subtle: \"bg-surface-brand-subtle\" },\n\t\t},\n\t\tdefaultVariants: {\n\t\t\tvariant: \"default\",\n\t\t},\n\t},\n);\n\ntype CTAProps = useRender.ComponentProps<\"section\"> &\n\tVariantProps<typeof ctaVariants>;\n\nfunction CTA({ className, render, variant = \"default\", ...props }: CTAProps) {\n\treturn useRender({\n\t\tdefaultTagName: \"section\",\n\t\tprops: mergeProps<\"section\">(\n\t\t\t{\n\t\t\t\tclassName: cn(ctaVariants({ variant }), className),\n\t\t\t},\n\t\t\tprops,\n\t\t),\n\t\trender,\n\t\tstate: {\n\t\t\tslot: \"cta\",\n\t\t},\n\t});\n}\n\nfunction CTAContent({\n\tclassName,\n\trender,\n\t...props\n}: useRender.ComponentProps<\"div\">) {\n\treturn useRender({\n\t\tdefaultTagName: \"div\",\n\t\tprops: mergeProps<\"div\">(\n\t\t\t{\n\t\t\t\tclassName: cn(\"flex min-w-0 flex-1 flex-col gap-2.5\", className),\n\t\t\t},\n\t\t\tprops,\n\t\t),\n\t\trender,\n\t\tstate: {\n\t\t\tslot: \"cta-content\",\n\t\t},\n\t});\n}\n\nfunction CTATag({\n\tclassName,\n\trender,\n\t...props\n}: useRender.ComponentProps<\"span\">) {\n\treturn useRender({\n\t\tdefaultTagName: \"span\",\n\t\tprops: mergeProps<\"span\">(\n\t\t\t{\n\t\t\t\tclassName: cn(\n\t\t\t\t\t\"text-fg-brand text-gdt-capitalized uppercase font-semibold\",\n\t\t\t\t\tclassName,\n\t\t\t\t),\n\t\t\t},\n\t\t\tprops,\n\t\t),\n\t\trender,\n\t\tstate: {\n\t\t\tslot: \"cta-title\",\n\t\t},\n\t});\n}\n\nfunction CTATitle({\n\tclassName,\n\trender,\n\t...props\n}: useRender.ComponentProps<\"h2\">) {\n\treturn useRender({\n\t\tdefaultTagName: \"h2\",\n\t\tprops: mergeProps<\"h2\">(\n\t\t\t{\n\t\t\t\tclassName: cn(\n\t\t\t\t\t\"text-fg-primary text-gdt-h3 lg:text-gdt-h2 font-extrabold\",\n\t\t\t\t\tclassName,\n\t\t\t\t),\n\t\t\t},\n\t\t\tprops,\n\t\t),\n\t\trender,\n\t\tstate: {\n\t\t\tslot: \"cta-title\",\n\t\t},\n\t});\n}\n\nfunction CTADescription({\n\tclassName,\n\trender,\n\t...props\n}: useRender.ComponentProps<\"p\">) {\n\treturn useRender({\n\t\tdefaultTagName: \"p\",\n\t\tprops: mergeProps<\"p\">(\n\t\t\t{\n\t\t\t\tclassName: cn(\n\t\t\t\t\t\"text-fg-secondary text-gdt-sm md:text-gdt-md\",\n\t\t\t\t\tclassName,\n\t\t\t\t),\n\t\t\t},\n\t\t\tprops,\n\t\t),\n\t\trender,\n\t\tstate: {\n\t\t\tslot: \"cta-description\",\n\t\t},\n\t});\n}\n\nfunction CTAList({\n\tclassName,\n\trender,\n\t...props\n}: useRender.ComponentProps<\"ul\">) {\n\treturn useRender({\n\t\tdefaultTagName: \"ul\",\n\t\tprops: mergeProps<\"ul\">(\n\t\t\t{\n\t\t\t\tclassName: cn(\"flex min-w-0 pt-8 flex-col gap-2.5\", className),\n\t\t\t},\n\t\t\tprops,\n\t\t),\n\t\trender,\n\t\tstate: {\n\t\t\tslot: \"cta-list\",\n\t\t},\n\t});\n}\n\ntype CTAListItemProps = useRender.ComponentProps<\"li\"> & {\n\ticon?: React.ReactNode;\n};\n\nconst CircleCheck = (props: SVGProps<SVGSVGElement>) => (\n\t<svg\n\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\twidth={22}\n\t\theight={22}\n\t\tfill=\"none\"\n\t\tviewBox=\"0 0 22 22\"\n\t\taria-hidden=\"true\"\n\t\t{...props}\n\t>\n\t\t<rect width={22} height={22} fill=\"var(--color-surface-brand)\" rx={11} />\n\t\t<path\n\t\t\tstroke=\"var(--color-fg-on-brand)\"\n\t\t\tstrokeLinecap=\"round\"\n\t\t\tstrokeLinejoin=\"round\"\n\t\t\tstrokeWidth={2}\n\t\t\td=\"m7.36 11.26 2.6 2.6 4.68-5.72\"\n\t\t/>\n\t</svg>\n);\n\nfunction CTAListItem({\n\tchildren,\n\tclassName,\n\ticon,\n\trender,\n\t...props\n}: CTAListItemProps) {\n\treturn useRender({\n\t\tdefaultTagName: \"li\",\n\t\tprops: mergeProps<\"li\">(\n\t\t\t{\n\t\t\t\tclassName: cn(\n\t\t\t\t\t\"flex min-w-0 items-start gap-2 text-gdt-sm text-fg-primary\",\n\t\t\t\t\t\"group-data-[tone=brand]/cta:text-fg-on-brand\",\n\t\t\t\t\tclassName,\n\t\t\t\t),\n\t\t\t\tchildren: (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<span\n\t\t\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\t\"inline-flex shrink-0 items-center justify-center [&_svg]:size-4 [&_svg]:shrink-0\",\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<CircleCheck />\n\t\t\t\t\t\t</span>\n\t\t\t\t\t\t<span className=\"min-w-0\">{children}</span>\n\t\t\t\t\t</>\n\t\t\t\t),\n\t\t\t},\n\t\t\tprops,\n\t\t),\n\t\trender,\n\t\tstate: {\n\t\t\tslot: \"cta-list-item\",\n\t\t},\n\t});\n}\n\nfunction CTACard({\n\tclassName,\n\trender,\n\tvariant = \"default\",\n\t...props\n}: useRender.ComponentProps<\"div\"> & { variant?: \"default\" | \"brand\" }) {\n\treturn useRender({\n\t\tdefaultTagName: \"div\",\n\t\tprops: mergeProps<\"div\">(\n\t\t\t{\n\t\t\t\tclassName: cn(\n\t\t\t\t\t\"group/cta-card min-w-0 flex flex-col gap-3.5 py-6.5 px-6 rounded-2xl text\",\n\t\t\t\t\t{ \"bg-canvas border shadow-1\": variant === \"default\" },\n\t\t\t\t\t{ \"bg-surface-brand shadow-2\": variant === \"brand\" },\n\t\t\t\t),\n\t\t\t},\n\t\t\tprops,\n\t\t),\n\t\trender,\n\t\tstate: {\n\t\t\tslot: \"cta-card\",\n\t\t\tvariant,\n\t\t},\n\t});\n}\n\nfunction CTACardIcon({\n\tclassName,\n\trender,\n\tvariant = \"subtle-brand\",\n\t...props\n}: useRender.ComponentProps<\"span\"> & {\n\tvariant?: \"subtle-brand\" | \"subtle-accent\" | \"surface\";\n}) {\n\treturn useRender({\n\t\tdefaultTagName: \"span\",\n\t\tprops: mergeProps<\"span\">(\n\t\t\t{\n\t\t\t\t\"aria-hidden\": true,\n\t\t\t\tclassName: cn(\n\t\t\t\t\t\"flex size-13.5 shrink-0 items-center justify-center rounded-full [&_svg:not([class*='size-'])]:size-6\",\n\t\t\t\t\t{\n\t\t\t\t\t\t\"bg-surface-brand-subtle text-action-primary\":\n\t\t\t\t\t\t\tvariant === \"subtle-brand\",\n\t\t\t\t\t\t\"bg-surface-accent-subtle text-fg-info\":\n\t\t\t\t\t\t\tvariant === \"subtle-accent\",\n\t\t\t\t\t\t\"bg-surface-overlay text-fg-brand\": variant === \"surface\",\n\t\t\t\t\t},\n\t\t\t\t\tclassName,\n\t\t\t\t),\n\t\t\t},\n\t\t\tprops,\n\t\t),\n\t\trender,\n\t\tstate: {\n\t\t\tslot: \"cta-card-icon\",\n\t\t},\n\t});\n}\n\nfunction CTACardTitle({\n\tclassName,\n\trender,\n\t...props\n}: useRender.ComponentProps<\"h3\">) {\n\treturn useRender({\n\t\tdefaultTagName: \"h3\",\n\t\tprops: mergeProps<\"h3\">(\n\t\t\t{\n\t\t\t\tclassName: cn(\n\t\t\t\t\t\"text-gdt-md font-bold text-fg-primary group-data-[variant=brand]/cta-card:text-fg-on-brand\",\n\t\t\t\t\tclassName,\n\t\t\t\t),\n\t\t\t},\n\t\t\tprops,\n\t\t),\n\t\trender,\n\t\tstate: {\n\t\t\tslot: \"cta-card-title\",\n\t\t},\n\t});\n}\n\nfunction CTACardDescription({\n\tclassName,\n\trender,\n\t...props\n}: useRender.ComponentProps<\"p\">) {\n\treturn useRender({\n\t\tdefaultTagName: \"p\",\n\t\tprops: mergeProps<\"p\">(\n\t\t\t{\n\t\t\t\tclassName: cn(\n\t\t\t\t\t\"text-gdt-sm text-fg-secondary flex-1 group-data-[variant=brand]/cta-card:text-fg-on-brand\",\n\t\t\t\t\tclassName,\n\t\t\t\t),\n\t\t\t},\n\t\t\tprops,\n\t\t),\n\t\trender,\n\t\tstate: {\n\t\t\tslot: \"cta-card-description\",\n\t\t},\n\t});\n}\n\n/**\n * CTAButton wraps `Button` with defaults tuned for a CTA's action row: it\n * stays legible on every `tone`, so a `tone=\"brand\"` panel automatically\n * gets a canvas-colored button instead of an invisible brand-on-brand one.\n * Every `Button` prop (variant, size, isLoading, render, …) still works.\n */\nfunction CTAButton({\n\tclassName,\n\t...props\n}: React.ComponentProps<typeof Button>) {\n\treturn (\n\t\t<Button\n\t\t\tdata-slot=\"cta-button\"\n\t\t\tclassName={cn(\n\t\t\t\t\"relative\",\n\t\t\t\t\"group-data-[variant=brand]/cta-card:bg-canvas group-data-[variant=brand]/cta-card:text-fg-brand\",\n\t\t\t\t\"group-data-[variant=brand]/cta-card:hover:bg-surface group-data-[variant=brand]/cta-card:active:bg-surface-raised\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction CTAButtonLink({\n\tclassName,\n\t...props\n}: React.ComponentProps<typeof ButtonLink>) {\n\treturn (\n\t\t<ButtonLink\n\t\t\tdata-slot=\"cta-button\"\n\t\t\tclassName={cn(\n\t\t\t\t\"relative\",\n\t\t\t\t\"group-data-[variant=brand]/cta-card:bg-canvas group-data-[variant=brand]/cta-card:text-fg-brand\",\n\t\t\t\t\"group-data-[variant=brand]/cta-card:hover:bg-surface group-data-[variant=brand]/cta-card:active:bg-surface-raised\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport {\n\tCTA,\n\tCTAButton,\n\tCTAButtonLink,\n\tCTACard,\n\tCTACardDescription,\n\tCTACardIcon,\n\tCTATag,\n\tCTACardTitle,\n\tCTAContent,\n\tCTADescription,\n\tCTAList,\n\tCTAListItem,\n\tCTATitle,\n\tctaVariants,\n};\nexport type { CTAListItemProps, CTAProps };\n"],"mappings":";;;;;;;;;;AAAA,SAAS,kBAAkB;AAC3B,SAAS,iBAAiB;AAC1B,SAAS,WAA8B;AAoLtC,SAqCI,UA5BH,KATD;AAjJD,IAAM,cAAc;AAAA,EACnB;AAAA,EACA;AAAA,IACC,UAAU;AAAA,MACT,SAAS,EAAE,SAAS,cAAc,QAAQ,0BAA0B;AAAA,IACrE;AAAA,IACA,iBAAiB;AAAA,MAChB,SAAS;AAAA,IACV;AAAA,EACD;AACD;AAKA,SAAS,IAAI,EAAE,WAAW,QAAQ,UAAU,WAAW,GAAG,MAAM,GAAa;AAC5E,SAAO,UAAU;AAAA,IAChB,gBAAgB;AAAA,IAChB,OAAO;AAAA,MACN;AAAA,QACC,WAAW,GAAG,YAAY,EAAE,QAAQ,CAAC,GAAG,SAAS;AAAA,MAClD;AAAA,MACA;AAAA,IACD;AAAA,IACA;AAAA,IACA,OAAO;AAAA,MACN,MAAM;AAAA,IACP;AAAA,EACD,CAAC;AACF;AAEA,SAAS,WAAW;AAAA,EACnB;AAAA,E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;AAAA,IACA;AAAA,IACA,OAAO;AAAA,MACN,MAAM;AAAA,IACP;AAAA,EACD,CAAC;AACF;AAQA,SAAS,UAAU;AAAA,EAClB;AAAA,EACA,GAAG;AACJ,GAAwC;AACvC,SACC;AAAA,IAAC;AAAA;AAAA,MACA,aAAU;AAAA,MACV,WAAW;AAAA,QACV;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACD;AAAA,MACC,GAAG;AAAA;AAAA,EACL;AAEF;AAEA,SAAS,cAAc;AAAA,EACtB;AAAA,EACA,GAAG;AACJ,GAA4C;AAC3C,SACC;AAAA,IAAC;AAAA;AAAA,MACA,aAAU;AAAA,MACV,WAAW;AAAA,QACV;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACD;AAAA,MACC,GAAG;AAAA;AAAA,EACL;AAEF;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/currency-selector.tsx"],"sourcesContent":["\"use client\";\n\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { CheckIcon } from \"lucide-react\";\nimport type * as React from \"react\";\n\nimport { cn } from \"./lib/cn\";\nimport { useUncontrolled } from \"./lib/use-uncontrolled\";\nimport {\n\tSelect,\n\tSelectContent,\n\tSelectItem,\n\tSelectTrigger,\n\tSelectValue,\n} from \"./select\";\n\ntype CurrencyFlagStripe = {\n\tcolor: string;\n\tsize?: number;\n};\n\ntype CurrencySelectorOption = {\n\tcode: string;\n\tlabel: string;\n\tcountryCode?: string;\n\tflag?: readonly CurrencyFlagStripe[];\n};\n\ntype CurrencySelectorSize = NonNullable<\n\tVariantProps<typeof currencySelectorTriggerVariants>[\"size\"]\n>;\n\ntype CurrencySelectorProps = Omit<\n\tReact.ComponentProps<\"button\">,\n\t\"children\" | \"defaultValue\" | \"onChange\" | \"value\"\n> & {\n\toptions: readonly CurrencySelectorOption[];\n\tvalue?: string;\n\tdefaultValue?: string;\n\tonValueChange?: (value: string, option: CurrencySelectorOption) => void;\n\topen?: boolean;\n\tdefaultOpen?: boolean;\n\tonOpenChange?: (open: boolean) => void;\n\tsize?: CurrencySelectorSize;\n\twithBackground?: boolean;\n\tshowFlag?: boolean;\n\tshowOptionFlags?: boolean;\n\tcontentClassName?: string;\n\tplaceholder?: string;\n};\n\nconst DEFAULT_FLAG: readonly CurrencyFlagStripe[] = [\n\t{ color: \"#1f8f55\" },\n\t{ color: \"#ffffff\" },\n\t{ color: \"#1f8f55\" },\n];\n\nconst currencySelectorTriggerVariants = cva(\n\t\"group/currency-selector inline-flex w-fit shrink-0 items-center rounded-full border-0 font-bold whitespace-nowrap outline-none transition-[background-color,color,box-shadow] focus-visible:shadow-[0_0_0_2px_var(--color-line-focus)] disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-60 data-popup-open:text-fg-primary [&_svg]:size-3.5 [&_svg]:shrink-0 [&_svg]:text-current\",\n\t{\n\t\tvariants: {\n\t\t\tsize: {\n\t\t\t\tsm: \"h-8 gap-1.5 px-3 text-gdt-xs\",\n\t\t\t\tmd: \"h-11 gap-2 px-4 text-gdt-sm\",\n\t\t\t\tlg: \"h-12 gap-2.5 px-5 text-gdt-md\",\n\t\t\t},\n\t\t\twithBackground: {\n\t\t\t\ttrue: \"bg-action-tertiary text-fg-primary hover:bg-action-tertiary-hover active:bg-action-tertiary-pressed data-popup-open:bg-action-tertiary-hover\",\n\t\t\t\tfalse:\n\t\t\t\t\t\"bg-transparent px-0 text-fg-primary hover:text-fg-brand active:text-fg-brand data-popup-open:bg-transparent\",\n\t\t\t},\n\t\t},\n\t\tdefaultVariants: {\n\t\t\tsize: \"md\",\n\t\t\twithBackground: true,\n\t\t},\n\t},\n);\n\nfunction findOption(\n\toptions: readonly CurrencySelectorOption[],\n\tvalue: string | undefined,\n) {\n\treturn options.find((option) => option.code === value);\n}\n\nfunction CurrencyFlag({\n\tflag = DEFAULT_FLAG,\n\tlabel,\n\tclassName,\n}: {\n\tflag?: readonly CurrencyFlagStripe[];\n\tlabel?: string;\n\tclassName?: string;\n}) {\n\tconst total = flag.reduce((sum, stripe) => sum + (stripe.size ?? 1), 0);\n\tlet cursor = 0;\n\tconst stops = flag.flatMap((stripe) => {\n\t\tconst start = cursor;\n\t\tcursor += ((stripe.size ?? 1) / total) * 100;\n\n\t\treturn [\n\t\t\t`${stripe.color} ${start.toFixed(2)}%`,\n\t\t\t`${stripe.color} ${cursor.toFixed(2)}%`,\n\t\t];\n\t});\n\n\treturn (\n\t\t<span\n\t\t\trole=\"img\"\n\t\t\taria-label={label ?? \"Currency flag\"}\n\t\t\tdata-slot=\"currency-flag\"\n\t\t\tclassName={cn(\n\t\t\t\t\"inline-block h-4 w-6 shrink-0 overflow-hidden rounded-[3px] bg-cover shadow-[inset_0_0_0_1px_rgb(0_0_0/0.04)]\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\tstyle={{ backgroundImage: `linear-gradient(90deg, ${stops.join(\", \")})` }}\n\t\t/>\n\t);\n}\n\nfunction CurrencySelector({\n\toptions,\n\tvalue,\n\tdefaultValue,\n\tonValueChange,\n\topen,\n\tdefaultOpen,\n\tonOpenChange,\n\tsize = \"md\",\n\twithBackground = true,\n\tshowFlag = true,\n\tshowOptionFlags = true,\n\tcontentClassName,\n\tclassName,\n\tplaceholder = \"Select currency\",\n\ttype = \"button\",\n\t...props\n}: CurrencySelectorProps) {\n\tconst fallbackValue = options[0]?.code;\n\tconst [selectedValue, setSelectedValue] = useUncontrolled({\n\t\tvalue,\n\t\tdefaultValue,\n\t\tfinalValue: fallbackValue,\n\t\tonChange: (nextValue) => {\n\t\t\tconst nextOption = findOption(options, nextValue);\n\n\t\t\tif (nextOption) {\n\t\t\t\tonValueChange?.(nextValue, nextOption);\n\t\t\t}\n\t\t},\n\t});\n\tconst selectedOption = findOption(options, selectedValue);\n\tconst handleValueChange = (nextValue: string | null) => {\n\t\tif (nextValue) {\n\t\t\tsetSelectedValue(nextValue);\n\t\t}\n\t};\n\n\treturn (\n\t\t<Select\n\t\t\tvalue={selectedValue}\n\t\t\tonValueChange={handleValueChange}\n\t\t\topen={open}\n\t\t\tdefaultOpen={defaultOpen}\n\t\t\tonOpenChange={onOpenChange}\n\t\t\tsize={size}\n\t\t>\n\t\t\t<SelectTrigger\n\t\t\t\ttype={type}\n\t\t\t\tunstyled\n\t\t\t\tclassName={cn(\n\t\t\t\t\tcurrencySelectorTriggerVariants({\n\t\t\t\t\t\tsize,\n\t\t\t\t\t\twithBackground,\n\t\t\t\t\t}),\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t\t{...props}\n\t\t\t>\n\t\t\t\t{showFlag && selectedOption ? (\n\t\t\t\t\t<CurrencyFlag\n\t\t\t\t\t\tflag={selectedOption.flag}\n\t\t\t\t\t\tlabel={`${selectedOption.countryCode ?? selectedOption.code} flag`}\n\t\t\t\t\t/>\n\t\t\t\t) : null}\n\t\t\t\t<SelectValue placeholder={placeholder}>\n\t\t\t\t\t{selectedOption?.code ?? placeholder}\n\t\t\t\t</SelectValue>\n\t\t\t</SelectTrigger>\n\t\t\t<SelectContent\n\t\t\t\talign=\"start\"\n\t\t\t\tsideOffset={8}\n\t\t\t\tclassName={cn(\n\t\t\t\t\t\"w-65 rounded-[18px] border-line-subtle bg-surface-overlay p-2 shadow-3\",\n\t\t\t\t\tcontentClassName,\n\t\t\t\t)}\n\t\t\t>\n\t\t\t\t{options.map((option) => (\n\t\t\t\t\t<SelectItem\n\t\t\t\t\t\tkey={option.code}\n\t\t\t\t\t\tvalue={option.code}\n\t\t\t\t\t\tclassName=\"min-h-12 rounded-lg px-3 text-gdt-sm data-selected:bg-surface-brand-subtle data-selected:font-normal data-selected:text-fg-brand data-highlighted:bg-surface-brand-subtle\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{showOptionFlags ? (\n\t\t\t\t\t\t\t<CurrencyFlag\n\t\t\t\t\t\t\t\tflag={option.flag}\n\t\t\t\t\t\t\t\tlabel={`${option.countryCode ?? option.code} flag`}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) : null}\n\t\t\t\t\t\t<span className=\"min-w-0 flex-1 truncate\">\n\t\t\t\t\t\t\t{option.code} - {option.label}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t\t{option.code === selectedValue ? (\n\t\t\t\t\t\t\t<CheckIcon className=\"ml-auto size-4 text-fg-brand\" />\n\t\t\t\t\t\t) : null}\n\t\t\t\t\t</SelectItem>\n\t\t\t\t))}\n\t\t\t</SelectContent>\n\t\t</Select>\n\t);\n}\n\nexport {\n\tCurrencyFlag,\n\tCurrencySelector,\n\tcurrencySelectorTriggerVariants,\n\ttype CurrencyFlagStripe,\n\ttype CurrencySelectorOption,\n\ttype CurrencySelectorProps,\n\ttype CurrencySelectorSize,\n};\n"],"mappings":";;;;;;;;;;;;;;;;;AAEA,SAAS,WAA8B;AACvC,SAAS,iBAAiB;AAyGxB,cA4DC,YA5DD;AAzDF,IAAM,eAA8C;AAAA,EACnD,EAAE,OAAO,UAAU;AAAA,EACnB,EAAE,OAAO,UAAU;AAAA,EACnB,EAAE,OAAO,UAAU;AACpB;AAEA,IAAM,kCAAkC;AAAA,EACvC;AAAA,EACA;AAAA,IACC,UAAU;AAAA,MACT,MAAM;AAAA,QACL,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MACL;AAAA,MACA,gBAAgB;AAAA,QACf,MAAM;AAAA,QACN,OACC;AAAA,MACF;AAAA,IACD;AAAA,IACA,iBAAiB;AAAA,MAChB,MAAM;AAAA,MACN,gBAAgB;AAAA,IACjB;AAAA,EACD;AACD;AAEA,SAAS,WACR,SACA,OACC;AACD,SAAO,QAAQ,KAAK,CAAC,WAAW,OAAO,SAAS,KAAK;AACtD;AAEA,SAAS,aAAa;AAAA,EACrB,OAAO;AAAA,EACP;AAAA,EACA;AACD,GAIG;AACF,QAAM,QAAQ,KAAK,OAAO,CAAC,KAAK,WAAW,OAAO,OAAO,QAAQ,IAAI,CAAC;AACtE,MAAI,SAAS;AACb,QAAM,QAAQ,KAAK,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A,MACA;AAAA,MAEA;AAAA;AAAA,UAAC;AAAA;AAAA,YACA;AAAA,YACA,UAAQ;AAAA,YACR,WAAW;AAAA,cACV,gCAAgC;AAAA,gBAC/B;AAAA,gBACA;AAAA,cACD,CAAC;AAAA,cACD;AAAA,YACD;AAAA,YACC,GAAG;AAAA,YAEH;AAAA,0BAAY,iBACZ;AAAA,gBAAC;AAAA;AAAA,kBACA,MAAM,eAAe;AAAA,kBACrB,OAAO,GAAG,eAAe,eAAe,eAAe,IAAI;AAAA;AAAA,cAC5D,IACG;AAAA,cACJ,oBAAC,eAAY,aACX,0BAAgB,QAAQ,aAC1B;AAAA;AAAA;AAAA,QACD;AAAA,QACA;AAAA,UAAC;AAAA;AAAA,YACA,OAAM;AAAA,YACN,YAAY;AAAA,YACZ,WAAW;AAAA,cACV;AAAA,cACA;AAAA,YACD;AAAA,YAEC,kBAAQ,IAAI,CAAC,WACb;AAAA,cAAC;AAAA;AAAA,gBAEA,OAAO,OAAO;AAAA,gBACd,WAAU;AAAA,gBAET;AAAA,oCACA;AAAA,oBAAC;AAAA;AAAA,sBACA,MAAM,OAAO;AAAA,sBACb,OAAO,GAAG,OAAO,eAAe,OAAO,IAAI;AAAA;AAAA,kBAC5C,IACG;AAAA,kBACJ,qBAAC,UAAK,WAAU,2BACd;AAAA,2BAAO;AAAA,oBAAK;AAAA,oBAAI,OAAO;AAAA,qBACzB;AAAA,kBACC,OAAO,SAAS,gBAChB,oBAAC,aAAU,WAAU,gCAA+B,IACjD;AAAA;AAAA;AAAA,cAfC,OAAO;AAAA,YAgBb,CACA;AAAA;AAAA,QACF;AAAA;AAAA;AAAA,EACD;AAEF;","names":[]}
|
package/dist/date-picker.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/date-picker.tsx"],"sourcesContent":["\"use client\";\n\nimport { CalendarIcon } from \"lucide-react\";\nimport * as React from \"react\";\nimport type { DateRange, Matcher } from \"react-day-picker\";\nimport { Calendar } from \"./calendar\";\nimport { cn } from \"./lib/cn\";\nimport { PickerFooter, PickerTrigger } from \"./lib/picker\";\nimport { Popover, PopoverContent } from \"./popover\";\n\nfunction formatDate(date: Date): string {\n\treturn date.toLocaleDateString(\"en-GB\", {\n\t\tday: \"2-digit\",\n\t\tmonth: \"long\",\n\t\tyear: \"numeric\",\n\t});\n}\n\nconst PANEL_CLASSES =\n\t\"flex min-w-(--anchor-width) flex-col items-center gap-0 overflow-hidden rounded-2xl p-0\";\n\ntype CaptionLayout =\n\t| \"label\"\n\t| \"dropdown\"\n\t| \"dropdown-months\"\n\t| \"dropdown-years\";\n\ninterface DatePickerBaseProps {\n\tdisabled?: boolean;\n\tplaceholder?: string;\n\tclassName?: string;\n\t/** Caption style. Defaults to month + year dropdowns for quick navigation. */\n\tcaptionLayout?: CaptionLayout;\n\t/** Earliest navigable month. Defaults to 100 years before today. */\n\tstartMonth?: Date;\n\t/** Latest navigable month. Defaults to 10 years after today. */\n\tendMonth?: Date;\n\t/** Dates that cannot be selected (react-day-picker matcher). */\n\tdisabledDates?: Matcher | Matcher[];\n}\n\nfunction defaultStartMonth() {\n\treturn new Date(new Date().getFullYear() - 100, 0);\n}\n\nfunction defaultEndMonth() {\n\treturn new Date(new Date().getFullYear() + 10, 11);\n}\n\n// ─── DatePicker ───────────────────────────────────────────────────────────────\n\ninterface DatePickerProps extends DatePickerBaseProps {\n\tvalue?: Date;\n\tonChange?: (date: Date | undefined) => void;\n}\n\nfunction DatePicker({\n\tvalue,\n\tonChange,\n\tdisabled = false,\n\tplaceholder = \"Select date\",\n\tclassName,\n\tcaptionLayout = \"dropdown\",\n\tstartMonth,\n\tendMonth,\n\tdisabledDates,\n}: DatePickerProps) {\n\tconst [open, setOpen] = React.useState(false);\n\tconst [pending, setPending] = React.useState<Date | undefined>(value);\n\tconst [month, setMonth] = React.useState<Date>(() => value ?? new Date());\n\n\tfunction handleOpenChange(next: boolean) {\n\t\tif (next) {\n\t\t\tsetPending(value);\n\t\t\tsetMonth(value ?? new Date());\n\t\t}\n\t\tsetOpen(next);\n\t}\n\n\treturn (\n\t\t<Popover open={open} onOpenChange={handleOpenChange}>\n\t\t\t<PickerTrigger\n\t\t\t\ticon={CalendarIcon}\n\t\t\t\tdisplayValue={value ? formatDate(value) : \"\"}\n\t\t\t\tplaceholder={placeholder}\n\t\t\t\tdisabled={disabled}\n\t\t\t\topen={open}\n\t\t\t\tclassName={className}\n\t\t\t/>\n\t\t\t<PopoverContent\n\t\t\t\tshowArrow={false}\n\t\t\t\talign=\"start\"\n\t\t\t\tside=\"bottom\"\n\t\t\t\tclassName={PANEL_CLASSES}\n\t\t\t>\n\t\t\t\t<Calendar\n\t\t\t\t\tmode=\"single\"\n\t\t\t\t\tselected={pending}\n\t\t\t\t\tonSelect={setPending}\n\t\t\t\t\tmonth={month}\n\t\t\t\t\tonMonthChange={setMonth}\n\t\t\t\t\tcaptionLayout={captionLayout}\n\t\t\t\t\tstartMonth={startMonth ?? defaultStartMonth()}\n\t\t\t\t\tendMonth={endMonth ?? defaultEndMonth()}\n\t\t\t\t\tdisabled={disabledDates}\n\t\t\t\t/>\n\t\t\t\t<PickerFooter\n\t\t\t\t\tsecondaryLabel=\"Clear\"\n\t\t\t\t\tonSecondary={() => {\n\t\t\t\t\t\tsetPending(undefined);\n\t\t\t\t\t\tonChange?.(undefined);\n\t\t\t\t\t\tsetOpen(false);\n\t\t\t\t\t}}\n\t\t\t\t\tonApply={() => {\n\t\t\t\t\t\tonChange?.(pending);\n\t\t\t\t\t\tsetOpen(false);\n\t\t\t\t\t}}\n\t\t\t\t/>\n\t\t\t</PopoverContent>\n\t\t</Popover>\n\t);\n}\n\n// ─── DateRangePicker ──────────────────────────────────────────────────────────\n\ninterface DateRangePickerProps extends DatePickerBaseProps {\n\tvalue?: DateRange;\n\tonChange?: (range: DateRange | undefined) => void;\n}\n\nfunction DateRangePicker({\n\tvalue,\n\tonChange,\n\tdisabled = false,\n\tplaceholder = \"Select date range\",\n\tclassName,\n\tcaptionLayout = \"dropdown\",\n\tstartMonth,\n\tendMonth,\n\tdisabledDates,\n}: DateRangePickerProps) {\n\tconst [open, setOpen] = React.useState(false);\n\tconst [pending, setPending] = React.useState<DateRange | undefined>(value);\n\tconst [month, setMonth] = React.useState<Date>(\n\t\t() => value?.from ?? new Date(),\n\t);\n\n\tfunction handleOpenChange(next: boolean) {\n\t\tif (next) {\n\t\t\tsetPending(value);\n\t\t\tsetMonth(value?.from ?? new Date());\n\t\t}\n\t\tsetOpen(next);\n\t}\n\n\tconst displayValue = (() => {\n\t\tif (value?.from && value?.to)\n\t\t\treturn `${formatDate(value.from)} — ${formatDate(value.to)}`;\n\t\tif (value?.from) return formatDate(value.from);\n\t\treturn \"\";\n\t})();\n\n\treturn (\n\t\t<Popover open={open} onOpenChange={handleOpenChange}>\n\t\t\t<PickerTrigger\n\t\t\t\ticon={CalendarIcon}\n\t\t\t\tdisplayValue={displayValue}\n\t\t\t\tplaceholder={placeholder}\n\t\t\t\tdisabled={disabled}\n\t\t\t\topen={open}\n\t\t\t\tclassName={className}\n\t\t\t/>\n\t\t\t<PopoverContent\n\t\t\t\tshowArrow={false}\n\t\t\t\talign=\"start\"\n\t\t\t\tclassName={cn(PANEL_CLASSES, \"w-auto\")}\n\t\t\t>\n\t\t\t\t<Calendar\n\t\t\t\t\tmode=\"range\"\n\t\t\t\t\tselected={pending}\n\t\t\t\t\tonSelect={setPending}\n\t\t\t\t\tmonth={month}\n\t\t\t\t\tonMonthChange={setMonth}\n\t\t\t\t\tcaptionLayout={captionLayout}\n\t\t\t\t\tstartMonth={startMonth ?? defaultStartMonth()}\n\t\t\t\t\tendMonth={endMonth ?? defaultEndMonth()}\n\t\t\t\t\tdisabled={disabledDates}\n\t\t\t\t/>\n\t\t\t\t<PickerFooter\n\t\t\t\t\tsecondaryLabel=\"Clear\"\n\t\t\t\t\tonSecondary={() => {\n\t\t\t\t\t\tsetPending(undefined);\n\t\t\t\t\t\tonChange?.(undefined);\n\t\t\t\t\t\tsetOpen(false);\n\t\t\t\t\t}}\n\t\t\t\t\tonApply={() => {\n\t\t\t\t\t\tonChange?.(pending);\n\t\t\t\t\t\tsetOpen(false);\n\t\t\t\t\t}}\n\t\t\t\t/>\n\t\t\t</PopoverContent>\n\t\t</Popover>\n\t);\n}\n\nexport { DatePicker, DateRangePicker };\nexport type { DatePickerProps, DateRangePickerProps, DateRange };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAEA,SAAS,oBAAoB;AAC7B,YAAY,WAAW;AA8EpB,cAQA,YARA;AAvEH,SAAS,WAAW,MAAoB;AACvC,SAAO,KAAK,mBAAmB,SAAS;AAAA,IACvC,KAAK;AAAA,IACL,OAAO;AAAA,IACP,MAAM;AAAA,EACP,CAAC;AACF;AAEA,IAAM,gBACL;AAsBD,SAAS,oBAAoB;AAC5B,SAAO,IAAI,MAAK,oBAAI,KAAK,GAAE,YAAY,IAAI,KAAK,CAAC;AAClD;AAEA,SAAS,kBAAkB;AAC1B,SAAO,IAAI,MAAK,oBAAI,KAAK,GAAE,YAAY,IAAI,IAAI,EAAE;AAClD;AASA,SAAS,WAAW;AAAA,EACnB;AAAA,EACA;AAAA,EACA,WAAW;AAAA,EACX,cAAc;AAAA,EACd;AAAA,EACA,gBAAgB;AAAA,EAChB;AAAA,EACA;AAAA,EACA;AACD,GAAoB;AACnB,QAAM,CAAC,MAAM,OAAO,IAAU,eAAS,KAAK;AAC5C,QAAM,CAAC,SAAS,UAAU,IAAU,eAA2B,KAAK;AACpE,QAAM,CAAC,OAAO,QAAQ,IAAU,eAAe,MAAM,SAAS,oBAAI,KAAK,CAAC;AAExE,WAAS,iBAAiB,MAAe;AACxC,QAAI,MAAM;AACT,iBAAW,KAAK;AAChB,eAAS,SAAS,oBAAI,KAAK,CAAC;AAAA,IAC7B;AACA,YAAQ,IAAI;AAAA,EACb;AAEA,SACC,qBAAC,WAAQ,MAAY,cAAc,kBAClC;AAAA;AAAA,MAAC;AAAA;AAAA,QACA,MAAM;AAAA,Q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,OAAO;AACzB,aAAO,GAAG,WAAW,MAAM,IAAI,CAAC,WAAM,WAAW,MAAM,EAAE,CAAC;AAC3D,QAAI,OAAO,KAAM,QAAO,WAAW,MAAM,IAAI;AAC7C,WAAO;AAAA,EACR,GAAG;AAEH,SACC,qBAAC,WAAQ,MAAY,cAAc,kBAClC;AAAA;AAAA,MAAC;AAAA;AAAA,QACA,MAAM;AAAA,QACN;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA;AAAA,IACD;AAAA,IACA;AAAA,MAAC;AAAA;AAAA,QACA,WAAW;AAAA,QACX,OAAM;AAAA,QACN,WAAW,GAAG,eAAe,QAAQ;AAAA,QAErC;AAAA;AAAA,YAAC;AAAA;AAAA,cACA,MAAK;AAAA,cACL,UAAU;AAAA,cACV,UAAU;AAAA,cACV;AAAA,cACA,eAAe;AAAA,cACf;AAAA,cACA,YAAY,cAAc,kBAAkB;AAAA,cAC5C,UAAU,YAAY,gBAAgB;AAAA,cACtC,UAAU;AAAA;AAAA,UACX;AAAA,UACA;AAAA,YAAC;AAAA;AAAA,cACA,gBAAe;AAAA,cACf,aAAa,MAAM;AAClB,2BAAW,MAAS;AACpB,2BAAW,MAAS;AACpB,wBAAQ,KAAK;AAAA,cACd;AAAA,cACA,SAAS,MAAM;AACd,2BAAW,OAAO;AAClB,wBAAQ,KAAK;AAAA,cACd;AAAA;AAAA,UACD;AAAA;AAAA;AAAA,IACD;AAAA,KACD;AAEF;","names":[]}
|
package/dist/details-card.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/details-card.tsx"],"sourcesContent":["import { mergeProps } from \"@base-ui/react/merge-props\";\nimport { useRender } from \"@base-ui/react/use-render\";\nimport type * as React from \"react\";\n\nimport { cn } from \"./lib/cn\";\n\ntype DetailsCardBodyProps = useRender.ComponentProps<\"div\"> & {\n\torientation?: \"horizontal\" | \"vertical\";\n\tshowIcons?: boolean;\n};\n\nfunction DetailsCard({\n\tclassName,\n\trender,\n\t...props\n}: useRender.ComponentProps<\"article\">) {\n\treturn useRender({\n\t\tdefaultTagName: \"article\",\n\t\tprops: mergeProps<\"article\">(\n\t\t\t{\n\t\t\t\tclassName: cn(\n\t\t\t\t\t\"flex w-full min-w-0 flex-col rounded-2xl border border-line-subtle bg-canvas p-gdt-xl text-fg-primary\",\n\t\t\t\t\tclassName,\n\t\t\t\t),\n\t\t\t},\n\t\t\tprops,\n\t\t),\n\t\trender,\n\t\tstate: {\n\t\t\tslot: \"details-card\",\n\t\t},\n\t});\n}\n\nfunction DetailsCardHeader({\n\tclassName,\n\trender,\n\t...props\n}: useRender.ComponentProps<\"div\">) {\n\treturn useRender({\n\t\tdefaultTagName: \"div\",\n\t\tprops: mergeProps<\"div\">(\n\t\t\t{\n\t\t\t\tclassName: cn(\"flex min-w-0 flex-col gap-1\", className),\n\t\t\t},\n\t\t\tprops,\n\t\t),\n\t\trender,\n\t});\n}\n\nfunction DetailsCardTitle({\n\tclassName,\n\trender,\n\t...props\n}: useRender.ComponentProps<\"h3\">) {\n\treturn useRender({\n\t\tdefaultTagName: \"h3\",\n\t\tprops: mergeProps<\"h3\">(\n\t\t\t{\n\t\t\t\tclassName: cn(\"text-gdt-md font-bold text-fg-primary\", className),\n\t\t\t},\n\t\t\tprops,\n\t\t),\n\t\trender,\n\t});\n}\n\nfunction DetailsCardDescription({\n\tclassName,\n\trender,\n\t...props\n}: useRender.ComponentProps<\"p\">) {\n\treturn useRender({\n\t\tdefaultTagName: \"p\",\n\t\tprops: mergeProps<\"p\">(\n\t\t\t{\n\t\t\t\tclassName: cn(\"text-gdt-sm font-normal text-fg-secondary\", className),\n\t\t\t},\n\t\t\tprops,\n\t\t),\n\t\trender,\n\t});\n}\n\nfunction DetailsCardBody({\n\tclassName,\n\torientation = \"horizontal\",\n\trender,\n\tshowIcons = true,\n\t...props\n}: DetailsCardBodyProps) {\n\treturn useRender({\n\t\tdefaultTagName: \"div\",\n\t\tprops: mergeProps<\"div\">(\n\t\t\t{\n\t\t\t\t// @ts-expect-error — data-* attrs are valid but not in mergeProps generic\n\t\t\t\t\"data-icons\": showIcons,\n\t\t\t\t\"data-orientation\": orientation,\n\t\t\t\tclassName: cn(\n\t\t\t\t\t\"group/details-card-body mt-gdt-md flex min-w-0 flex-col border-line-subtle border-t\",\n\t\t\t\t\tclassName,\n\t\t\t\t),\n\t\t\t},\n\t\t\tprops,\n\t\t),\n\t\trender,\n\t\tstate: {\n\t\t\torientation,\n\t\t\tshowIcons,\n\t\t\tslot: \"details-card-body\",\n\t\t},\n\t});\n}\n\nfunction DetailsCardRow({\n\tclassName,\n\trender,\n\t...props\n}: useRender.ComponentProps<\"div\">) {\n\treturn useRender({\n\t\tdefaultTagName: \"div\",\n\t\tprops: mergeProps<\"div\">(\n\t\t\t{\n\t\t\t\tclassName: cn(\n\t\t\t\t\t\"grid min-w-0 grid-cols-[1rem_minmax(0,1fr)_auto] items-center gap-x-2 border-line-subtle border-b py-3 last:border-b-0\",\n\t\t\t\t\t\"group-data-[orientation=vertical]/details-card-body:grid-cols-[1rem_minmax(0,1fr)] group-data-[orientation=vertical]/details-card-body:items-start group-data-[orientation=vertical]/details-card-body:gap-y-1\",\n\t\t\t\t\t\"group-data-[icons=false]/details-card-body:grid-cols-[minmax(0,1fr)_auto]\",\n\t\t\t\t\t\"group-[[data-icons=false][data-orientation=vertical]]/details-card-body:grid-cols-1\",\n\t\t\t\t\t\"group-data-[slot=details-card-row-group]/details-card-row-group:border-b-0\",\n\t\t\t\t\tclassName,\n\t\t\t\t),\n\t\t\t},\n\t\t\tprops,\n\t\t),\n\t\trender,\n\t\tstate: {\n\t\t\tslot: \"details-card-row\",\n\t\t},\n\t});\n}\n\nfunction DetailsCardRowGroup({\n\tclassName,\n\trender,\n\t...props\n}: useRender.ComponentProps<\"div\">) {\n\treturn useRender({\n\t\tdefaultTagName: \"div\",\n\t\tprops: mergeProps<\"div\">(\n\t\t\t{\n\t\t\t\t// @ts-expect-error — data-* attrs are valid but not in mergeProps generic\n\t\t\t\t\"data-slot\": \"details-card-row-group\",\n\t\t\t\tclassName: cn(\n\t\t\t\t\t\"group/details-card-row-group grid min-w-0 border-line-subtle border-b last:border-b-0\",\n\t\t\t\t\tclassName,\n\t\t\t\t),\n\t\t\t},\n\t\t\tprops,\n\t\t),\n\t\trender,\n\t\tstate: {\n\t\t\tslot: \"details-card-row-group\",\n\t\t},\n\t});\n}\n\nfunction DetailsCardIcon({\n\tchildren,\n\tclassName,\n\trender,\n\t...props\n}: useRender.ComponentProps<\"span\">) {\n\treturn useRender({\n\t\tdefaultTagName: \"span\",\n\t\tprops: mergeProps<\"span\">(\n\t\t\t{\n\t\t\t\t\"aria-hidden\": true,\n\t\t\t\tchildren: children ?? <DetailsCardChevronIcon />,\n\t\t\t\tclassName: cn(\n\t\t\t\t\t\"flex size-4 shrink-0 items-center justify-center text-fg-primary\",\n\t\t\t\t\t\"group-data-[icons=false]/details-card-body:hidden\",\n\t\t\t\t\tclassName,\n\t\t\t\t),\n\t\t\t},\n\t\t\tprops,\n\t\t),\n\t\trender,\n\t\tstate: {\n\t\t\tslot: \"details-card-icon\",\n\t\t},\n\t});\n}\n\nfunction DetailsCardLabel({\n\tclassName,\n\trender,\n\t...props\n}: useRender.ComponentProps<\"div\">) {\n\treturn useRender({\n\t\tdefaultTagName: \"div\",\n\t\tprops: mergeProps<\"div\">(\n\t\t\t{\n\t\t\t\tclassName: cn(\n\t\t\t\t\t\"min-w-0 text-gdt-sm font-normal text-fg-secondary\",\n\t\t\t\t\tclassName,\n\t\t\t\t),\n\t\t\t},\n\t\t\tprops,\n\t\t),\n\t\trender,\n\t\tstate: {\n\t\t\tslot: \"details-card-label\",\n\t\t},\n\t});\n}\n\nfunction DetailsCardValue({\n\tclassName,\n\trender,\n\t...props\n}: useRender.ComponentProps<\"div\">) {\n\treturn useRender({\n\t\tdefaultTagName: \"div\",\n\t\tprops: mergeProps<\"div\">(\n\t\t\t{\n\t\t\t\tclassName: cn(\n\t\t\t\t\t\"min-w-0 justify-self-end text-right text-gdt-sm font-semibold text-fg-primary\",\n\t\t\t\t\t\"group-data-[orientation=vertical]/details-card-body:col-start-2 group-data-[orientation=vertical]/details-card-body:justify-self-start group-data-[orientation=vertical]/details-card-body:text-left\",\n\t\t\t\t\t\"group-[[data-icons=false][data-orientation=vertical]]/details-card-body:col-start-1\",\n\t\t\t\t\tclassName,\n\t\t\t\t),\n\t\t\t},\n\t\t\tprops,\n\t\t),\n\t\trender,\n\t\tstate: {\n\t\t\tslot: \"details-card-value\",\n\t\t},\n\t});\n}\n\nfunction DetailsCardChevronIcon(props: React.ComponentProps<\"svg\">) {\n\treturn (\n\t\t<svg\n\t\t\taria-hidden=\"true\"\n\t\t\tfill=\"none\"\n\t\t\tfocusable=\"false\"\n\t\t\theight=\"12\"\n\t\t\tviewBox=\"0 0 12 12\"\n\t\t\twidth=\"12\"\n\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t\t{...props}\n\t\t>\n\t\t\t<path\n\t\t\t\td=\"M4.5 2.5 8 6 4.5 9.5\"\n\t\t\t\tstroke=\"currentColor\"\n\t\t\t\tstrokeLinecap=\"round\"\n\t\t\t\tstrokeLinejoin=\"round\"\n\t\t\t\tstrokeWidth=\"1.5\"\n\t\t\t/>\n\t\t</svg>\n\t);\n}\n\nexport {\n\tDetailsCard,\n\tDetailsCardBody,\n\tDetailsCardDescription,\n\tDetailsCardHeader,\n\tDetailsCardIcon,\n\tDetailsCardLabel,\n\tDetailsCardRow,\n\tDetailsCardRowGroup,\n\tDetailsCardTitle,\n\tDetailsCardValue,\n};\nexport type { DetailsCardBodyProps };\n"],"mappings":";;;;;AAAA,SAAS,kBAAkB;AAC3B,SAAS,iBAAiB;AAiLA;AAvK1B,SAAS,YAAY;AAAA,EACpB;AAAA,EACA;AAAA,EACA,GAAG;AACJ,GAAwC;AACvC,SAAO,UAAU;AAAA,IAChB,gBAAgB;AAAA,IAChB,OAAO;AAAA,MACN;AAAA,QACC,WAAW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AAAA,QACC,WAAW;AAAA,UACV;AAAA,UACA;AAAA,QACD;AAAA,MACD;AAAA,MACA;AAAA,IACD;AAAA,IACA;AAAA,IACA,OAAO;AAAA,MACN,MAAM;AAAA,IACP;AAAA,EACD,CAAC;AACF;AAEA,SAAS,iBAAiB;AAAA,EACzB;AAAA,EACA;AAAA,EACA,GAAG;AACJ,GAAoC;AACnC,SAAO,UAAU;AAAA,IAChB,gBAAgB;AAAA,IAChB,OAAO;AAAA,MACN;AAAA,QACC,WAAW;AAAA,UACV;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,QACD;AAAA,MACD;AAAA,MACA;AAAA,IACD;AAAA,IACA;AAAA,IACA,OAAO;AAAA,MACN,MAAM;AAAA,IACP;AAAA,EACD,CAAC;AACF;AAEA,SAAS,uBAAuB,OAAoC;AACnE,SACC;AAAA,IAAC;AAAA;AAAA,MACA,eAAY;AAAA,MACZ,MAAK;AAAA,MACL,WAAU;AAAA,MACV,QAAO;AAAA,MACP,SAAQ;AAAA,MACR,OAAM;AAAA,MACN,OAAM;AAAA,MACL,GAAG;AAAA,MAEJ;AAAA,QAAC;AAAA;AAAA,UACA,GAAE;AAAA,UACF,QAAO;AAAA,UACP,eAAc;AAAA,UACd,gBAAe;AAAA,UACf,aAAY;AAAA;AAAA,MACb;AAAA;AAAA,EACD;AAEF;","names":[]}
|
package/dist/dialog.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/dialog.tsx"],"sourcesContent":["\"use client\";\n\nimport { Dialog as DialogPrimitive } from \"@base-ui/react/dialog\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { XIcon } from \"lucide-react\";\nimport type * as React from \"react\";\nimport { Button } from \"./button\";\nimport { cn } from \"./lib/cn\";\nimport { SizeProvider, useComponentSize } from \"./size-context\";\n\nfunction Dialog({ ...props }: DialogPrimitive.Root.Props) {\n\treturn <DialogPrimitive.Root data-slot=\"dialog\" {...props} />;\n}\n\nfunction DialogTrigger({ ...props }: DialogPrimitive.Trigger.Props) {\n\treturn <DialogPrimitive.Trigger data-slot=\"dialog-trigger\" {...props} />;\n}\n\nfunction DialogPortal({ ...props }: DialogPrimitive.Portal.Props) {\n\treturn <DialogPrimitive.Portal data-slot=\"dialog-portal\" {...props} />;\n}\n\nfunction DialogClose({ ...props }: DialogPrimitive.Close.Props) {\n\treturn <DialogPrimitive.Close data-slot=\"dialog-close\" {...props} />;\n}\n\nfunction DialogOverlay({\n\tclassName,\n\t...props\n}: DialogPrimitive.Backdrop.Props) {\n\treturn (\n\t\t<DialogPrimitive.Backdrop\n\t\t\tdata-slot=\"dialog-overlay\"\n\t\t\tclassName={cn(\n\t\t\t\t\"fixed inset-0 z-50 bg-black/55 transition-opacity duration-150 data-closed:opacity-0 data-open:opacity-100 supports-backdrop-filter:backdrop-blur-xl\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nconst dialogContentVariants = cva(\n\t\"group/dialog-content fixed top-1/2 left-1/2 z-50 flex max-h-[calc(100dvh-5rem)] w-full max-w-[calc(100vw-2rem)] -translate-x-1/2 -translate-y-1/2 flex-col gap-4 overflow-visible rounded-2xl border border-line-subtle bg-surface-overlay bg-clip-padding p-(--dialog-padding) text-fg-primary shadow-(--elevation-e2-shadow) outline-none [--dialog-padding:1.25rem] transition-[opacity,transform] duration-200 ease-in-out 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\",\n\t{\n\t\tvariants: {\n\t\t\tsize: {\n\t\t\t\tsm: \"sm:w-90 sm:[--dialog-padding:1.5rem]\",\n\t\t\t\tmd: \"sm:w-105 sm:[--dialog-padding:1.5rem]\",\n\t\t\t\tlg: \"sm:w-120 sm:[--dialog-padding:2rem]\",\n\t\t\t},\n\t\t},\n\t\tdefaultVariants: {\n\t\t\tsize: \"md\",\n\t\t},\n\t},\n);\n\nconst dialogIconVariants = cva(\n\t\"flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0\",\n\t{\n\t\tvariants: {\n\t\t\tsize: {\n\t\t\t\tauto: \"group-data-[size=sm]/dialog-content:size-10 group-data-[size=sm]/dialog-content:rounded-md group-data-[size=sm]/dialog-content:[&_svg:not([class*='size-'])]:size-6 group-data-[size=md]/dialog-content:size-12 group-data-[size=md]/dialog-content:rounded-[10px] group-data-[size=md]/dialog-content:[&_svg:not([class*='size-'])]:size-8 group-data-[size=lg]/dialog-content:size-14 group-data-[size=lg]/dialog-content:rounded-lg group-data-[size=lg]/dialog-content:[&_svg:not([class*='size-'])]:size-10\",\n\t\t\t\tsm: \"size-10 rounded-md [&_svg:not([class*='size-'])]:size-6\",\n\t\t\t\tmd: \"size-12 rounded-[10px] [&_svg:not([class*='size-'])]:size-8\",\n\t\t\t\tlg: \"size-14 rounded-lg [&_svg:not([class*='size-'])]:size-10\",\n\t\t\t},\n\t\t\ttone: {\n\t\t\t\tbrand: \"bg-surface-brand-subtle text-fg-brand\",\n\t\t\t\tdanger: \"bg-surface-danger-subtle text-status-danger\",\n\t\t\t\tneutral: \"bg-surface-raised text-fg-primary\",\n\t\t\t},\n\t\t},\n\t\tdefaultVariants: {\n\t\t\tsize: \"auto\",\n\t\t\ttone: \"brand\",\n\t\t},\n\t},\n);\n\ntype DialogContentProps = DialogPrimitive.Popup.Props &\n\tVariantProps<typeof dialogContentVariants> & {\n\t\tshowCloseButton?: boolean;\n\t};\n\nfunction DialogContent({\n\tclassName,\n\tchildren,\n\tsize,\n\tshowCloseButton = true,\n\t...props\n}: DialogContentProps) {\n\tconst resolvedSize = useComponentSize(size);\n\n\treturn (\n\t\t<DialogPortal>\n\t\t\t<DialogOverlay />\n\t\t\t<SizeProvider size={resolvedSize}>\n\t\t\t\t<DialogPrimitive.Popup\n\t\t\t\t\tdata-slot=\"dialog-content\"\n\t\t\t\t\tdata-size={resolvedSize}\n\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\tdialogContentVariants({ size: resolvedSize }),\n\t\t\t\t\t\tclassName,\n\t\t\t\t\t)}\n\t\t\t\t\t{...props}\n\t\t\t\t>\n\t\t\t\t\t{children}\n\t\t\t\t\t{showCloseButton && (\n\t\t\t\t\t\t<DialogPrimitive.Close\n\t\t\t\t\t\t\tdata-slot=\"dialog-close\"\n\t\t\t\t\t\t\trender={\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t\t\t\tclassName=\"absolute -top-10 right-0 z-10\"\n\t\t\t\t\t\t\t\t\tsize=\"icon-sm\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<XIcon />\n\t\t\t\t\t\t\t\t\t<span className=\"sr-only\">Close</span>\n\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t\t</DialogPrimitive.Popup>\n\t\t\t</SizeProvider>\n\t\t</DialogPortal>\n\t);\n}\n\nfunction DialogIcon({\n\tclassName,\n\tsize,\n\ttone,\n\t...props\n}: React.ComponentProps<\"div\"> & VariantProps<typeof dialogIconVariants>) {\n\tconst inheritedSize = useComponentSize();\n\tconst resolvedSize = !size || size === \"auto\" ? inheritedSize : size;\n\n\treturn (\n\t\t<div\n\t\t\tdata-slot=\"dialog-icon\"\n\t\t\tclassName={cn(\n\t\t\t\tdialogIconVariants({ size: resolvedSize, tone }),\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction DialogHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n\treturn (\n\t\t<div\n\t\t\tdata-slot=\"dialog-header\"\n\t\t\tclassName={cn(\"flex flex-col gap-3\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction DialogFooter({\n\tclassName,\n\tshowCloseButton = false,\n\tchildren,\n\t...props\n}: React.ComponentProps<\"div\"> & {\n\tshowCloseButton?: boolean;\n}) {\n\treturn (\n\t\t<div\n\t\t\tdata-slot=\"dialog-footer\"\n\t\t\tclassName={cn(\n\t\t\t\t\"mt-2 flex flex-col-reverse gap-2 sm:flex-row sm:justify-end `**:data-[slot=button-link]:w-full **:data-[slot=button]:w-full sm:**:data-[slot=button-link]:w-auto sm:**:data-[slot=button]:w-auto\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{children}\n\t\t\t{showCloseButton && (\n\t\t\t\t<DialogPrimitive.Close\n\t\t\t\t\trender={<Button variant=\"tertiary-outline\">Close</Button>}\n\t\t\t\t/>\n\t\t\t)}\n\t\t</div>\n\t);\n}\n\nfunction DialogTitle({ className, ...props }: DialogPrimitive.Title.Props) {\n\treturn (\n\t\t<DialogPrimitive.Title\n\t\t\tdata-slot=\"dialog-title\"\n\t\t\tclassName={cn(\n\t\t\t\t\"text-gdt-h5 font-extrabold tracking-tight text-fg-primary\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction DialogDescription({\n\tclassName,\n\t...props\n}: DialogPrimitive.Description.Props) {\n\treturn (\n\t\t<DialogPrimitive.Description\n\t\t\tdata-slot=\"dialog-description\"\n\t\t\tclassName={cn(\n\t\t\t\t\"text-gdt-sm text-fg-secondary *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-fg-primary\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport {\n\tDialog,\n\tDialogClose,\n\tDialogContent,\n\tDialogDescription,\n\tDialogFooter,\n\tDialogHeader,\n\tDialogIcon,\n\tDialogOverlay,\n\tDialogPortal,\n\tDialogTitle,\n\tDialogTrigger,\n\tdialogContentVariants,\n\tdialogIconVariants,\n};\n"],"mappings":";;;;;;;;;;;;;AAEA,SAAS,UAAU,uBAAuB;AAC1C,SAAS,WAA8B;AACvC,SAAS,aAAa;AAOd,cAsGA,YA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ACL;AAEF;AAEA,SAAS,aAAa;AAAA,EACrB;AAAA,EACA,kBAAkB;AAAA,EAClB;AAAA,EACA,GAAG;AACJ,GAEG;AACF,SACC;AAAA,IAAC;AAAA;AAAA,MACA,aAAU;AAAA,MACV,WAAW;AAAA,QACV;AAAA,QACA;AAAA,MACD;AAAA,MACC,GAAG;AAAA,MAEH;AAAA;AAAA,QACA,mBACA;AAAA,UAAC,gBAAgB;AAAA,UAAhB;AAAA,YACA,QAAQ,oBAAC,UAAO,SAAQ,oBAAmB,mBAAK;AAAA;AAAA,QACjD;AAAA;AAAA;AAAA,EAEF;AAEF;AAEA,SAAS,YAAY,EAAE,WAAW,GAAG,MAAM,GAAgC;AAC1E,SACC;AAAA,IAAC,gBAAgB;AAAA,IAAhB;AAAA,MACA,aAAU;AAAA,MACV,WAAW;AAAA,QACV;AAAA,QACA;AAAA,MACD;AAAA,MACC,GAAG;AAAA;AAAA,EACL;AAEF;AAEA,SAAS,kBAAkB;AAAA,EAC1B;AAAA,EACA,GAAG;AACJ,GAAsC;AACrC,SACC;AAAA,IAAC,gBAAgB;AAAA,IAAhB;AAAA,MACA,aAAU;AAAA,MACV,WAAW;AAAA,QACV;AAAA,QACA;AAAA,MACD;AAAA,MACC,GAAG;AAAA;AAAA,EACL;AAEF;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/dist/dropzone.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/dropzone.tsx","../src/lib/use-file-picker.ts"],"sourcesContent":["\"use client\";\n\nimport { UploadCloud } from \"lucide-react\";\nimport {\n\ttype ComponentProps,\n\tcreateContext,\n\ttype KeyboardEvent,\n\ttype ReactNode,\n\tuse,\n} from \"react\";\nimport { cn } from \"./lib/cn\";\nimport {\n\ttype UseFilePickerOptions,\n\ttype UseFilePickerReturn,\n\tuseFilePicker,\n} from \"./lib/use-file-picker\";\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Context\n// ─────────────────────────────────────────────────────────────────────────────\n\ntype DropzoneContextValue = Pick<\n\tUseFilePickerReturn,\n\t| \"isDragging\"\n\t| \"openFileDialog\"\n\t| \"getInputProps\"\n\t| \"handleDragEnter\"\n\t| \"handleDragLeave\"\n\t| \"handleDragOver\"\n\t| \"handleDrop\"\n> & { isDisabled: boolean };\n\nconst DropzoneContext = createContext<DropzoneContextValue | null>(null);\n\nfunction useDropzoneContext(): DropzoneContextValue {\n\tconst ctx = use(DropzoneContext);\n\tif (!ctx) {\n\t\tthrow new Error(\n\t\t\t\"Dropzone compound components must be rendered inside <Dropzone>.\",\n\t\t);\n\t}\n\treturn ctx;\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Root\n// ─────────────────────────────────────────────────────────────────────────────\n\ninterface DropzoneProps extends UseFilePickerOptions {\n\tchildren?: ReactNode;\n\tclassName?: string;\n}\n\n/**\n * Context provider that owns the `useFilePicker` instance.\n * Wrap `<DropzoneArea>` and `<DropzoneInput>` (plus any content helpers)\n * inside this component.\n *\n * @example\n * ```tsx\n * <Dropzone accept=\"image/*\" multiple maxFiles={5} onFilesAccepted={handleFiles}>\n * <DropzoneArea>\n * <DropzoneIcon />\n * <DropzoneTitle>Choose a file or drag & drop</DropzoneTitle>\n * <DropzoneDescription>JPEG, PNG – up to 2 MB</DropzoneDescription>\n * <DropzoneTrigger />\n * </DropzoneArea>\n * <DropzoneInput />\n * </Dropzone>\n * ```\n */\nfunction Dropzone({\n\tchildren,\n\tclassName,\n\tdisabled,\n\t...options\n}: DropzoneProps) {\n\tconst {\n\t\tisDragging,\n\t\topenFileDialog,\n\t\tgetInputProps,\n\t\thandleDragEnter,\n\t\thandleDragLeave,\n\t\thandleDragOver,\n\t\thandleDrop,\n\t} = useFilePicker({ ...options, disabled });\n\n\treturn (\n\t\t<DropzoneContext.Provider\n\t\t\tvalue={{\n\t\t\t\tisDragging,\n\t\t\t\tisDisabled: disabled ?? false,\n\t\t\t\topenFileDialog,\n\t\t\t\tgetInputProps,\n\t\t\t\thandleDragEnter,\n\t\t\t\thandleDragLeave,\n\t\t\t\thandleDragOver,\n\t\t\t\thandleDrop,\n\t\t\t}}\n\t\t>\n\t\t\t<div data-slot=\"dropzone\" className={cn(\"relative\", className)}>\n\t\t\t\t{children}\n\t\t\t</div>\n\t\t</DropzoneContext.Provider>\n\t);\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Area (the interactive drop target)\n// ─────────────────────────────────────────────────────────────────────────────\n\ninterface DropzoneAreaProps\n\textends Omit<ComponentProps<\"div\">, \"onClick\" | \"onKeyDown\"> {\n\t/**\n\t * Accessible label for the drop zone.\n\t * Defaults to a sensible description.\n\t */\n\tlabel?: string;\n}\n\n/**\n * The visual, interactive drop zone.\n *\n * - Behaves as a `button` (role, tabIndex, Enter/Space keyboard support).\n * - Announces drag-state changes to screen readers via a live region.\n * - Applies design-token-based styles and reacts to `data-dragging` /\n * `data-disabled` for visual feedback.\n */\nfunction DropzoneArea({\n\tchildren,\n\tclassName,\n\tlabel = \"Upload files. Click to browse, or drag and drop files here.\",\n\t...props\n}: DropzoneAreaProps) {\n\tconst {\n\t\tisDragging,\n\t\tisDisabled,\n\t\topenFileDialog,\n\t\thandleDragEnter,\n\t\thandleDragLeave,\n\t\thandleDragOver,\n\t\thandleDrop,\n\t} = useDropzoneContext();\n\n\tfunction handleKeyDown(e: KeyboardEvent<HTMLDivElement>) {\n\t\tif (e.key === \"Enter\" || e.key === \" \") {\n\t\t\te.preventDefault();\n\t\t\topenFileDialog();\n\t\t}\n\t}\n\n\treturn (\n\t\t// biome-ignore lint/a11y/useSemanticElements: The dropzone contains block-level compound content and owns drag events.\n\t\t<div\n\t\t\tdata-slot=\"dropzone-area\"\n\t\t\t// Data attributes drive all variant styles – no runtime class toggling.\n\t\t\tdata-dragging={isDragging ? \"true\" : undefined}\n\t\t\tdata-disabled={isDisabled ? \"true\" : undefined}\n\t\t\t// Accessibility ──────────────────────────────────────────────────────\n\t\t\trole=\"button\"\n\t\t\ttabIndex={isDisabled ? -1 : 0}\n\t\t\taria-label={label}\n\t\t\taria-disabled={isDisabled}\n\t\t\t// Interaction ────────────────────────────────────────────────────────\n\t\t\tonClick={isDisabled ? undefined : openFileDialog}\n\t\t\tonKeyDown={isDisabled ? undefined : handleKeyDown}\n\t\t\tonDragEnter={isDisabled ? undefined : handleDragEnter}\n\t\t\tonDragLeave={isDisabled ? undefined : handleDragLeave}\n\t\t\tonDragOver={isDisabled ? undefined : handleDragOver}\n\t\t\tonDrop={isDisabled ? undefined : handleDrop}\n\t\t\t// Styles ─────────────────────────────────────────────────────────────\n\t\t\tclassName={cn(\n\t\t\t\t// Layout & base\n\t\t\t\t\"flex min-h-48 w-full cursor-pointer flex-col items-center justify-center rounded-xl border p-8 text-center transition-colors duration-150 select-none\",\n\t\t\t\t// Default colours (design tokens)\n\t\t\t\t\"border-line bg-surface-brand-subtle\",\n\t\t\t\t// Focus ring – matches other interactive controls in the system\n\t\t\t\t\"focus-visible:border-line-focus focus-visible:ring-2 focus-visible:ring-line-focus/35 focus-visible:outline-none\",\n\t\t\t\t// Dragging variant\n\t\t\t\t\"data-[dragging=true]:border-dashed data-[dragging=true]:border-line-focus data-[dragging=true]:bg-surface-brand/10\",\n\t\t\t\t// Disabled variant\n\t\t\t\t\"data-[disabled=true]:cursor-not-allowed data-[disabled=true]:opacity-50\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{children}\n\n\t\t\t{/* Live region: announces drag-state changes to screen-reader users */}\n\t\t\t<span className=\"sr-only\" aria-live=\"polite\" aria-atomic=\"true\">\n\t\t\t\t{isDragging ? \"Drop files to upload.\" : \"\"}\n\t\t\t</span>\n\t\t</div>\n\t);\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Input (visually hidden but present in the a11y tree)\n// ─────────────────────────────────────────────────────────────────────────────\n\ntype DropzoneInputProps = Omit<ComponentProps<\"input\">, \"type\">;\n\n/**\n * The hidden `<input type=\"file\">` that backs the drop zone.\n * Rendered off-screen (not `display:none`) so it remains accessible.\n * Place it as a sibling to `<DropzoneArea>` inside `<Dropzone>`.\n */\nfunction DropzoneInput({ className, ...props }: DropzoneInputProps) {\n\tconst { getInputProps } = useDropzoneContext();\n\treturn (\n\t\t<input\n\t\t\t{...getInputProps({\n\t\t\t\t// sr-only keeps it in the a11y tree without being visible\n\t\t\t\tclassName: cn(\"sr-only\", className),\n\t\t\t\t// Prevent it from receiving keyboard focus independently\n\t\t\t\ttabIndex: -1,\n\t\t\t\t...props,\n\t\t\t})}\n\t\t/>\n\t);\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Content helpers\n// ─────────────────────────────────────────────────────────────────────────────\n\ntype DropzoneStateLabelProps = {\n\tchildren?: ReactNode;\n\tdisabledLabel?: ReactNode;\n\tdraggingLabel?: ReactNode;\n\tidleLabel?: ReactNode;\n};\n\ntype DropzoneTextProps = Omit<ComponentProps<\"p\">, \"children\"> &\n\tDropzoneStateLabelProps;\n\nfunction useDropzoneStateLabel({\n\tchildren,\n\tdisabledLabel,\n\tdraggingLabel,\n\tidleLabel,\n}: DropzoneStateLabelProps) {\n\tconst { isDragging, isDisabled } = useDropzoneContext();\n\n\tif (isDisabled && disabledLabel !== undefined) {\n\t\treturn disabledLabel;\n\t}\n\n\tif (isDragging && draggingLabel !== undefined) {\n\t\treturn draggingLabel;\n\t}\n\n\treturn idleLabel ?? children;\n}\n\n/**\n * A centred, brand-coloured icon container pre-populated with an upload cloud\n * icon. Pass `children` to swap the icon.\n */\nfunction DropzoneIcon({\n\tclassName,\n\tchildren,\n\t...props\n}: ComponentProps<\"div\">) {\n\treturn (\n\t\t<div\n\t\t\tdata-slot=\"dropzone-icon\"\n\t\t\taria-hidden=\"true\"\n\t\t\tclassName={cn(\n\t\t\t\t\"mb-4 flex size-11 shrink-0 items-center justify-center rounded-full\",\n\t\t\t\t// Solid brand fill with an inset ring for depth\n\t\t\t\t\"bg-surface-brand text-fg-on-brand ring-1 ring-fg-on-brand/10 ring-inset\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{children ?? <UploadCloud className=\"size-5\" />}\n\t\t</div>\n\t);\n}\n\n/**\n * Primary heading text inside the drop zone.\n */\nfunction DropzoneTitle({\n\tclassName,\n\tchildren,\n\tdisabledLabel,\n\tdraggingLabel,\n\tidleLabel,\n\t...props\n}: DropzoneTextProps) {\n\tconst label = useDropzoneStateLabel({\n\t\tchildren,\n\t\tdisabledLabel,\n\t\tdraggingLabel,\n\t\tidleLabel,\n\t});\n\n\treturn (\n\t\t<p\n\t\t\tdata-slot=\"dropzone-title\"\n\t\t\tclassName={cn(\n\t\t\t\t\"text-gdt-md font-semibold leading-snug text-fg-primary\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{label}\n\t\t</p>\n\t);\n}\n\n/**\n * Secondary descriptive text inside the drop zone (file-type hints, size\n * limits, etc.).\n */\nfunction DropzoneDescription({\n\tclassName,\n\tchildren,\n\tdisabledLabel,\n\tdraggingLabel,\n\tidleLabel,\n\t...props\n}: DropzoneTextProps) {\n\tconst label = useDropzoneStateLabel({\n\t\tchildren,\n\t\tdisabledLabel,\n\t\tdraggingLabel,\n\t\tidleLabel,\n\t});\n\n\treturn (\n\t\t<p\n\t\t\tdata-slot=\"dropzone-description\"\n\t\t\tclassName={cn(\"mt-1 text-gdt-sm text-fg-secondary\", className)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{label}\n\t\t</p>\n\t);\n}\n\n/**\n * A decorative \"Browse File\" pill that visually suggests the click action.\n *\n * This element is `aria-hidden` because the surrounding `<DropzoneArea>`\n * already exposes a labelled `button` role to assistive technologies.\n * The pill is purely a visual affordance.\n */\nfunction DropzoneTrigger({\n\tclassName,\n\tchildren = \"Browse File\",\n\t...props\n}: ComponentProps<\"span\">) {\n\treturn (\n\t\t<span\n\t\t\tdata-slot=\"dropzone-trigger\"\n\t\t\taria-hidden=\"true\"\n\t\t\tclassName={cn(\n\t\t\t\t\"mt-5 inline-flex h-8 shrink-0 items-center justify-center rounded-full px-4\",\n\t\t\t\t\"bg-action-primary text-gdt-sm font-medium text-fg-on-brand\",\n\t\t\t\t\"transition-colors duration-150\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{children}\n\t\t</span>\n\t);\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Exports\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport {\n\tDropzone,\n\tDropzoneArea,\n\tDropzoneDescription,\n\tDropzoneIcon,\n\tDropzoneInput,\n\tDropzoneTitle,\n\tDropzoneTrigger,\n\tuseDropzoneContext,\n};\n","import {\n\ttype ChangeEvent,\n\ttype ComponentPropsWithoutRef,\n\ttype DragEvent,\n\ttype Ref,\n\ttype RefObject,\n\tuseCallback,\n\tuseRef,\n\tuseState,\n} from \"react\";\n\ntype FilePickerErrorCode =\n\t| \"file-invalid-type\"\n\t| \"file-too-large\"\n\t| \"too-many-files\";\n\ntype FilePickerError = {\n\tcode: FilePickerErrorCode;\n\tmessage: string;\n};\n\ntype FileRejection = {\n\tfile: File;\n\terrors: FilePickerError[];\n};\n\ntype FilePickerResult = {\n\tacceptedFiles: File[];\n\trejectedFiles: FileRejection[];\n};\n\ntype UseFilePickerOptions = {\n\taccept?: string;\n\tdisabled?: boolean;\n\tmaxFiles?: number;\n\tmaxSize?: number;\n\tmultiple?: boolean;\n\tonFilesAccepted?: (files: File[]) => void;\n\tonFilesChange?: (result: FilePickerResult) => void;\n\tonFilesRejected?: (rejectedFiles: FileRejection[]) => void;\n};\n\ntype FilePickerInputProps = Omit<\n\tComponentPropsWithoutRef<\"input\">,\n\t\"type\" | \"accept\" | \"multiple\"\n> & {\n\taccept?: string;\n\tmultiple?: boolean;\n\tref?: Ref<HTMLInputElement>;\n};\n\ntype UseFilePickerReturn = {\n\tgetInputProps: (props?: FilePickerInputProps) => FilePickerInputProps & {\n\t\ttype: \"file\";\n\t\tref: Ref<HTMLInputElement>;\n\t};\n\thandleDragEnter: (event: DragEvent<HTMLElement>) => void;\n\thandleDragLeave: (event: DragEvent<HTMLElement>) => void;\n\thandleDragOver: (event: DragEvent<HTMLElement>) => void;\n\thandleDrop: (event: DragEvent<HTMLElement>) => void;\n\thandleFileChange: (event: ChangeEvent<HTMLInputElement>) => void;\n\tinputRef: RefObject<HTMLInputElement | null>;\n\tisDragging: boolean;\n\topenFileDialog: () => void;\n\tpickFiles: (files: FileList | File[]) => FilePickerResult;\n};\n\nfunction useFilePicker({\n\taccept = \"*\",\n\tdisabled = false,\n\tmaxFiles = Number.POSITIVE_INFINITY,\n\tmaxSize = Number.POSITIVE_INFINITY,\n\tmultiple = false,\n\tonFilesAccepted,\n\tonFilesChange,\n\tonFilesRejected,\n}: UseFilePickerOptions = {}): UseFilePickerReturn {\n\tconst inputRef = useRef<HTMLInputElement>(null);\n\tconst dragDepthRef = useRef(0);\n\tconst [isDragging, setIsDragging] = useState(false);\n\n\tconst pickFiles = useCallback(\n\t\t(files: FileList | File[]): FilePickerResult => {\n\t\t\tconst incomingFiles = Array.from(files);\n\t\t\tconst limit = multiple ? maxFiles : 1;\n\t\t\tconst acceptedFiles: File[] = [];\n\t\t\tconst rejectedFiles: FileRejection[] = [];\n\n\t\t\tif (incomingFiles.length === 0 || disabled) {\n\t\t\t\treturn { acceptedFiles, rejectedFiles };\n\t\t\t}\n\n\t\t\tfor (const [index, file] of incomingFiles.entries()) {\n\t\t\t\tconst errors: FilePickerError[] = [];\n\n\t\t\t\tif (index >= limit) {\n\t\t\t\t\terrors.push({\n\t\t\t\t\t\tcode: \"too-many-files\",\n\t\t\t\t\t\tmessage: multiple\n\t\t\t\t\t\t\t? `You can only select up to ${limit} files.`\n\t\t\t\t\t\t\t: \"You can only select one file.\",\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\terrors.push(...validateFile(file, { accept, maxSize }));\n\t\t\t\t}\n\n\t\t\t\tif (errors.length > 0) {\n\t\t\t\t\trejectedFiles.push({ file, errors });\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tacceptedFiles.push(file);\n\t\t\t}\n\n\t\t\tconst result = { acceptedFiles, rejectedFiles };\n\n\t\t\tif (acceptedFiles.length > 0) {\n\t\t\t\tonFilesAccepted?.(acceptedFiles);\n\t\t\t}\n\n\t\t\tif (rejectedFiles.length > 0) {\n\t\t\t\tonFilesRejected?.(rejectedFiles);\n\t\t\t}\n\n\t\t\tonFilesChange?.(result);\n\n\t\t\tif (inputRef.current) {\n\t\t\t\tinputRef.current.value = \"\";\n\t\t\t}\n\n\t\t\treturn result;\n\t\t},\n\t\t[\n\t\t\taccept,\n\t\t\tdisabled,\n\t\t\tmaxFiles,\n\t\t\tmaxSize,\n\t\t\tmultiple,\n\t\t\tonFilesAccepted,\n\t\t\tonFilesChange,\n\t\t\tonFilesRejected,\n\t\t],\n\t);\n\n\tconst handleFileChange = useCallback(\n\t\t(event: ChangeEvent<HTMLInputElement>) => {\n\t\t\tif (event.target.files) {\n\t\t\t\tpickFiles(event.target.files);\n\t\t\t}\n\t\t},\n\t\t[pickFiles],\n\t);\n\n\tconst openFileDialog = useCallback(() => {\n\t\tif (disabled) return;\n\t\tinputRef.current?.click();\n\t}, [disabled]);\n\n\tconst handleDragEnter = useCallback(\n\t\t(event: DragEvent<HTMLElement>) => {\n\t\t\tevent.preventDefault();\n\t\t\tevent.stopPropagation();\n\n\t\t\tif (disabled) return;\n\n\t\t\tdragDepthRef.current += 1;\n\t\t\tsetIsDragging(true);\n\t\t},\n\t\t[disabled],\n\t);\n\n\tconst handleDragLeave = useCallback(\n\t\t(event: DragEvent<HTMLElement>) => {\n\t\t\tevent.preventDefault();\n\t\t\tevent.stopPropagation();\n\n\t\t\tif (disabled) return;\n\n\t\t\tdragDepthRef.current = Math.max(0, dragDepthRef.current - 1);\n\t\t\tif (dragDepthRef.current === 0) {\n\t\t\t\tsetIsDragging(false);\n\t\t\t}\n\t\t},\n\t\t[disabled],\n\t);\n\n\tconst handleDragOver = useCallback((event: DragEvent<HTMLElement>) => {\n\t\tevent.preventDefault();\n\t\tevent.stopPropagation();\n\t}, []);\n\n\tconst handleDrop = useCallback(\n\t\t(event: DragEvent<HTMLElement>) => {\n\t\t\tevent.preventDefault();\n\t\t\tevent.stopPropagation();\n\n\t\t\tdragDepthRef.current = 0;\n\t\t\tsetIsDragging(false);\n\n\t\t\tif (event.dataTransfer.files.length > 0) {\n\t\t\t\tpickFiles(event.dataTransfer.files);\n\t\t\t}\n\t\t},\n\t\t[pickFiles],\n\t);\n\n\tconst getInputProps = useCallback(\n\t\t(props: FilePickerInputProps = {}) => {\n\t\t\tconst { onChange, ref, ...inputProps } = props;\n\n\t\t\treturn {\n\t\t\t\t...inputProps,\n\t\t\t\ttype: \"file\" as const,\n\t\t\t\taccept: inputProps.accept ?? accept,\n\t\t\t\tdisabled: inputProps.disabled ?? disabled,\n\t\t\t\tmultiple: inputProps.multiple ?? multiple,\n\t\t\t\tref: (node: HTMLInputElement | null) => {\n\t\t\t\t\tinputRef.current = node;\n\t\t\t\t\tassignRef(ref, node);\n\t\t\t\t},\n\t\t\t\tonChange: (event: ChangeEvent<HTMLInputElement>) => {\n\t\t\t\t\tonChange?.(event);\n\t\t\t\t\tif (!event.defaultPrevented) {\n\t\t\t\t\t\thandleFileChange(event);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t};\n\t\t},\n\t\t[accept, disabled, handleFileChange, multiple],\n\t);\n\n\treturn {\n\t\tgetInputProps,\n\t\thandleDragEnter,\n\t\thandleDragLeave,\n\t\thandleDragOver,\n\t\thandleDrop,\n\t\thandleFileChange,\n\t\tinputRef,\n\t\tisDragging,\n\t\topenFileDialog,\n\t\tpickFiles,\n\t};\n}\n\nfunction validateFile(\n\tfile: File,\n\toptions: Pick<UseFilePickerOptions, \"accept\" | \"maxSize\"> = {},\n): FilePickerError[] {\n\tconst { accept = \"*\", maxSize = Number.POSITIVE_INFINITY } = options;\n\tconst errors: FilePickerError[] = [];\n\n\tif (file.size > maxSize) {\n\t\terrors.push({\n\t\t\tcode: \"file-too-large\",\n\t\t\tmessage: `File \"${file.name}\" exceeds the maximum size of ${formatBytes(maxSize)}.`,\n\t\t});\n\t}\n\n\tif (!isAcceptedFile(file, accept)) {\n\t\terrors.push({\n\t\t\tcode: \"file-invalid-type\",\n\t\t\tmessage: `File \"${file.name}\" is not an accepted file type.`,\n\t\t});\n\t}\n\n\treturn errors;\n}\n\nfunction isAcceptedFile(file: File, accept = \"*\") {\n\tif (accept === \"*\" || accept.trim() === \"\") return true;\n\n\tconst acceptedTypes = accept\n\t\t.split(\",\")\n\t\t.map((type) => type.trim().toLowerCase())\n\t\t.filter(Boolean);\n\n\tif (acceptedTypes.length === 0) return true;\n\n\tconst fileType = file.type.toLowerCase();\n\tconst fileExtension = getFileExtension(file.name);\n\n\treturn acceptedTypes.some((acceptedType) => {\n\t\tif (acceptedType.startsWith(\".\")) {\n\t\t\treturn fileExtension === acceptedType;\n\t\t}\n\n\t\tif (acceptedType.endsWith(\"/*\")) {\n\t\t\treturn fileType.startsWith(acceptedType.slice(0, -1));\n\t\t}\n\n\t\treturn fileType === acceptedType;\n\t});\n}\n\nfunction formatBytes(bytes: number, decimals = 2): string {\n\tif (bytes === 0) return \"0 Bytes\";\n\tif (!Number.isFinite(bytes)) return \"unlimited\";\n\n\tconst unit = 1024;\n\tconst precision = Math.max(0, decimals);\n\tconst sizes = [\"Bytes\", \"KB\", \"MB\", \"GB\", \"TB\", \"PB\"];\n\tconst sizeIndex = Math.min(\n\t\tMath.floor(Math.log(bytes) / Math.log(unit)),\n\t\tsizes.length - 1,\n\t);\n\n\treturn `${Number.parseFloat((bytes / unit ** sizeIndex).toFixed(precision))} ${sizes[sizeIndex]}`;\n}\n\nfunction getFileExtension(fileName: string) {\n\tconst extension = fileName.toLowerCase().split(\".\").pop();\n\treturn extension && extension !== fileName.toLowerCase()\n\t\t? `.${extension}`\n\t\t: \"\";\n}\n\nfunction assignRef<T>(ref: Ref<T> | undefined, value: T | null) {\n\tif (!ref) return;\n\n\tif (typeof ref === \"function\") {\n\t\tref(value);\n\t\treturn;\n\t}\n\n\tref.current = value;\n}\n\nexport { formatBytes, isAcceptedFile, useFilePicker, validateFile };\nexport type {\n\tFilePickerError,\n\tFilePickerErrorCode,\n\tFilePickerInputProps,\n\tFilePickerResult,\n\tFileRejection,\n\tUseFilePickerOptions,\n\tUseFilePickerReturn,\n};\n"],"mappings":";;;;;;AAEA,SAAS,mBAAmB;AAC5B;AAAA,EAEC;AAAA,EAGA;AAAA,OACM;;;ACTP;AAAA,EAMC;AAAA,EACA;AAAA,EACA;AAAA,OACM;AA0DP,SAAS,cAAc;AAAA,EACtB,SAAS;AAAA,EACT,WAAW;AAAA,EACX,WAAW,OAAO;AAAA,EAClB,UAAU,OAAO;AAAA,EACjB,WAAW;AAAA,EACX;AAAA,EACA;AAAA,EACA;AACD,IAA0B,CAAC,GAAwB;AAClD,QAAM,WAAW,OAAyB,IAAI;AAC9C,QAAM,eAAe,OAAO,CAAC;AAC7B,QAAM,CAAC,YAAY,aAAa,IAAI,SAAS,KAAK;AAElD,QAAM,YAAY;AAAA,IACjB,CAAC,UAA+C;AAC/C,YAAM,gBAAgB,MAAM,KAAK,KAAK;AACtC,YAAM,QAAQ,WAAW,WAAW;AACpC,YAAM,gBAAwB,CAAC;AAC/B,YAAM,gBAAiC,CAAC;AAExC,UAAI,cAAc,WAAW,KAAK,UAAU;AAC3C,eAAO,EAAE,eAAe,cAAc;AAAA,MACvC;AAEA,iBAAW,CAAC,OAAO,IAAI,KAAK,cAAc,QAAQ,GAAG;AACpD,cAAM,SAA4B,CAAC;AAEnC,YAAI,SAAS,OAAO;AACnB,iBAAO,KAAK;AAAA,YACX,MAAM;AAAA,YACN,SAAS,WACN,6BAA6B,KAAK,YAClC;AAAA,UACJ,CAAC;AAAA,QACF,OAAO;AACN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A,EACX,GAAG;AACJ,GAA2B;AAC1B,SACC;AAAA,IAAC;AAAA;AAAA,MACA,aAAU;AAAA,MACV,eAAY;AAAA,MACZ,WAAW;AAAA,QACV;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACD;AAAA,MACC,GAAG;AAAA,MAEH;AAAA;AAAA,EACF;AAEF;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/editorial-card.tsx"],"sourcesContent":["import { mergeProps } from \"@base-ui/react/merge-props\";\nimport { useRender } from \"@base-ui/react/use-render\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { ArrowRight, Play } from \"lucide-react\";\n\nimport { Avatar, AvatarFallback, AvatarImage } from \"./avatar\";\nimport { buttonVariants } from \"./button\";\nimport { cn } from \"./lib/cn\";\n\nconst editorialCardVariants = cva(\n\t\"group/editorial-card relative flex w-full min-w-0 flex-col overflow-hidden rounded-2xl border border-line-subtle bg-surface text-fg-primary transition-[background-color,border-color,box-shadow]\",\n\t{\n\t\tvariants: {\n\t\t\tsize: {\n\t\t\t\tsm: \"gap-2.5 p-4\",\n\t\t\t\tmd: \"gap-3 p-4.5\",\n\t\t\t\tlg: \"gap-3.5 p-5\",\n\t\t\t},\n\t\t},\n\t\tdefaultVariants: {\n\t\t\tsize: \"md\",\n\t\t},\n\t},\n);\n\ntype EditorialCardProps = useRender.ComponentProps<\"article\"> &\n\tVariantProps<typeof editorialCardVariants>;\n\nfunction EditorialCard({\n\tclassName,\n\trender,\n\tsize = \"md\",\n\t...props\n}: EditorialCardProps) {\n\treturn useRender({\n\t\tdefaultTagName: \"article\",\n\t\tprops: mergeProps<\"article\">(\n\t\t\t{\n\t\t\t\tclassName: cn(editorialCardVariants({ size }), className),\n\t\t\t},\n\t\t\tprops,\n\t\t),\n\t\trender,\n\t\tstate: {\n\t\t\tslot: \"editorial-card\",\n\t\t\tsize,\n\t\t},\n\t});\n}\n\nfunction EditorialCardHeader({\n\tclassName,\n\trender,\n\t...props\n}: useRender.ComponentProps<\"div\">) {\n\treturn useRender({\n\t\tdefaultTagName: \"div\",\n\t\tprops: mergeProps<\"div\">(\n\t\t\t{\n\t\t\t\tclassName: cn(\n\t\t\t\t\t\"flex min-w-0 flex-col gap-2 group-data-[size=lg]/editorial-card:gap-3\",\n\t\t\t\t\tclassName,\n\t\t\t\t),\n\t\t\t},\n\t\t\tprops,\n\t\t),\n\t\trender,\n\t\tstate: {\n\t\t\tslot: \"editorial-card-header\",\n\t\t},\n\t});\n}\n\nfunction getInitials(name: string) {\n\treturn name\n\t\t.trim()\n\t\t.split(/\\s+/)\n\t\t.slice(0, 2)\n\t\t.map((part) => part[0]?.toUpperCase())\n\t\t.join(\"\");\n}\n\nfunction EditorialCardMeta({\n\tclassName,\n\trender,\n\t...props\n}: useRender.ComponentProps<\"p\">) {\n\treturn useRender({\n\t\tdefaultTagName: \"p\",\n\t\tprops: mergeProps<\"p\">(\n\t\t\t{\n\t\t\t\tclassName: cn(\n\t\t\t\t\t\"text-fg-secondary text-gdt-xs group-data-[size=lg]/editorial-card:text-gdt-sm\",\n\t\t\t\t\tclassName,\n\t\t\t\t),\n\t\t\t},\n\t\t\tprops,\n\t\t),\n\t\trender,\n\t\tstate: {\n\t\t\tslot: \"editorial-card-meta\",\n\t\t},\n\t});\n}\n\nfunction EditorialCardTitle({\n\tclassName,\n\trender,\n\t...props\n}: useRender.ComponentProps<\"h3\">) {\n\treturn useRender({\n\t\tdefaultTagName: \"h3\",\n\t\tprops: mergeProps<\"h3\">(\n\t\t\t{\n\t\t\t\tclassName: cn(\n\t\t\t\t\t\"text-fg-primary text-gdt-md font-extrabold group-data-[size=md]/editorial-card:text-gdt-lg\",\n\t\t\t\t\t\"group-data-[size=lg]/editorial-card:text-gdt-h5\",\n\t\t\t\t\tclassName,\n\t\t\t\t),\n\t\t\t},\n\t\t\tprops,\n\t\t),\n\t\trender,\n\t\tstate: {\n\t\t\tslot: \"editorial-card-title\",\n\t\t},\n\t});\n}\n\nfunction EditorialCardMedia({\n\tclassName,\n\trender,\n\t...props\n}: useRender.ComponentProps<\"div\">) {\n\treturn useRender({\n\t\tdefaultTagName: \"div\",\n\t\tprops: mergeProps<\"div\">(\n\t\t\t{\n\t\t\t\tclassName: cn(\n\t\t\t\t\t\"relative isolate flex min-w-0 items-center justify-center overflow-hidden rounded-xl bg-surface-raised\",\n\t\t\t\t\t\"min-h-28 group-data-[size=md]/editorial-card:min-h-40 group-data-[size=lg]/editorial-card:min-h-56\",\n\t\t\t\t\t\"[&>img]:absolute [&>img]:inset-0 [&>img]:size-full [&>img]:object-cover\",\n\t\t\t\t\tclassName,\n\t\t\t\t),\n\t\t\t},\n\t\t\tprops,\n\t\t),\n\t\trender,\n\t\tstate: {\n\t\t\tslot: \"editorial-card-media\",\n\t\t},\n\t});\n}\n\nfunction EditorialCardCategory({\n\tclassName,\n\trender,\n\t...props\n}: useRender.ComponentProps<\"span\">) {\n\treturn useRender({\n\t\tdefaultTagName: \"span\",\n\t\tprops: mergeProps<\"span\">(\n\t\t\t{\n\t\t\t\tclassName: cn(\n\t\t\t\t\t\"absolute top-2 left-2 z-10 inline-flex w-fit items-center rounded-full bg-surface-brand px-2 py-1\",\n\t\t\t\t\t\"text-gdt-capitalized font-bold text-fg-on-brand uppercase\",\n\t\t\t\t\t\"group-data-[size=lg]/editorial-card:top-3 group-data-[size=sm]/editorial-card:left-3 group-data-[size=sm]/editorial-card:py-0.5 group-data-[size=lg]/editorial-card:px-3\",\n\t\t\t\t\tclassName,\n\t\t\t\t),\n\t\t\t},\n\t\t\tprops,\n\t\t),\n\t\trender,\n\t\tstate: {\n\t\t\tslot: \"editorial-card-category\",\n\t\t},\n\t});\n}\n\nfunction EditorialCardPlayButton({\n\tclassName,\n\trender,\n\tchildren,\n\t\"aria-label\": ariaLabel = \"Play media\",\n\t...props\n}: useRender.ComponentProps<\"button\">) {\n\treturn useRender({\n\t\tdefaultTagName: \"button\",\n\t\tprops: mergeProps<\"button\">(\n\t\t\t{\n\t\t\t\t\"aria-label\": ariaLabel,\n\t\t\t\tclassName: cn(\n\t\t\t\t\t\"absolute top-1/2 left-1/2 z-10 -translate-x-1/2 -translate-y-1/2 active:-translate-y-1/2\",\n\t\t\t\t\tbuttonVariants({ variant: \"glass-overlay\", size: \"icon-lg\" }),\n\t\t\t\t\t\"size-12 group-data-[size=md]/editorial-card:size-16 group-data-[size=lg]/editorial-card:size-20\",\n\t\t\t\t\t\"[&>svg]:ml-1 [&>svg]:size-5 group-data-[size=md]/editorial-card:[&>svg]:size-7 group-data-[size=lg]/editorial-card:[&>svg]:size-8\",\n\t\t\t\t\tclassName,\n\t\t\t\t),\n\t\t\t\tchildren: children ?? <Play aria-hidden=\"true\" fill=\"currentColor\" />,\n\t\t\t},\n\t\t\tprops,\n\t\t),\n\t\trender,\n\t\tstate: {\n\t\t\tslot: \"editorial-card-play-button\",\n\t\t},\n\t});\n}\n\ntype EditorialCardAttributionProps = Omit<\n\tuseRender.ComponentProps<\"div\">,\n\t\"children\"\n> & {\n\tauthorName: string;\n\tbrand?: {\n\t\tname?: string;\n\t\tphoto?: string;\n\t};\n\tprefix?: string;\n};\n\nfunction EditorialCardAttribution({\n\tauthorName,\n\tbrand,\n\tclassName,\n\tprefix = \"By\",\n\trender,\n\t...props\n}: EditorialCardAttributionProps) {\n\tconst brandName = brand?.name?.trim();\n\tconst brandPhoto = brand?.photo;\n\tconst showBrandAvatar = Boolean(brandName || brandPhoto);\n\n\treturn useRender({\n\t\tdefaultTagName: \"div\",\n\t\tprops: mergeProps<\"div\">(\n\t\t\t{\n\t\t\t\tclassName: cn(\n\t\t\t\t\t\"flex min-w-0 items-center gap-2 text-gdt-xs text-fg-secondary\",\n\t\t\t\t\t\"group-data-[size=lg]/editorial-card:text-gdt-sm\",\n\t\t\t\t\tclassName,\n\t\t\t\t),\n\t\t\t\tchildren: (\n\t\t\t\t\t<>\n\t\t\t\t\t\t{prefix ? <span>{prefix}</span> : null}\n\t\t\t\t\t\t{showBrandAvatar ? (\n\t\t\t\t\t\t\t<Avatar\n\t\t\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\t\t\tclassName=\"size-6 group-data-[size=lg]/editorial-card:size-7\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{brandPhoto ? (\n\t\t\t\t\t\t\t\t\t<AvatarImage alt={brandName ?? \"\"} src={brandPhoto} />\n\t\t\t\t\t\t\t\t) : null}\n\t\t\t\t\t\t\t\t{brandName ? (\n\t\t\t\t\t\t\t\t\t<AvatarFallback className=\"text-gdt-capitalized bg-surface-brand text-fg-on-brand\">\n\t\t\t\t\t\t\t\t\t\t{getInitials(brandName)}\n\t\t\t\t\t\t\t\t\t</AvatarFallback>\n\t\t\t\t\t\t\t\t) : null}\n\t\t\t\t\t\t\t</Avatar>\n\t\t\t\t\t\t) : null}\n\t\t\t\t\t\t<span className=\"truncate font-bold text-fg-primary\">\n\t\t\t\t\t\t\t{authorName}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</>\n\t\t\t\t),\n\t\t\t},\n\t\t\tprops,\n\t\t),\n\t\trender,\n\t\tstate: {\n\t\t\tslot: \"editorial-card-attribution\",\n\t\t},\n\t});\n}\n\nfunction EditorialCardExcerpt({\n\tclassName,\n\trender,\n\t...props\n}: useRender.ComponentProps<\"p\">) {\n\treturn useRender({\n\t\tdefaultTagName: \"p\",\n\t\tprops: mergeProps<\"p\">(\n\t\t\t{\n\t\t\t\tclassName: cn(\n\t\t\t\t\t\"line-clamp-3 text-gdt-xs text-fg-secondary group-data-[size=md]/editorial-card:text-gdt-md group-data-[size=lg]/editorial-card:text-gdt-lg\",\n\t\t\t\t\tclassName,\n\t\t\t\t),\n\t\t\t},\n\t\t\tprops,\n\t\t),\n\t\trender,\n\t\tstate: {\n\t\t\tslot: \"editorial-card-excerpt\",\n\t\t},\n\t});\n}\n\nfunction EditorialCardLink({\n\tclassName,\n\trender,\n\tchildren,\n\t...props\n}: useRender.ComponentProps<\"a\">) {\n\treturn useRender({\n\t\tdefaultTagName: \"a\",\n\t\tprops: mergeProps<\"a\">(\n\t\t\t{\n\t\t\t\tclassName: cn(\n\t\t\t\t\t\"inline-flex w-fit items-center gap-gdt-sm text-gdt-xs font-bold text-fg-brand underline underline-offset-2\",\n\t\t\t\t\t\"group-data-[size=lg]/editorial-card:text-gdt-sm hover:opacity-80 focus-visible:outline-none\",\n\t\t\t\t\t\"focus-visible:shadow-[0px_0px_0px_2px_var(--color-line-focus)]\",\n\t\t\t\t\tclassName,\n\t\t\t\t),\n\t\t\t\tchildren: (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<ArrowRight aria-hidden=\"true\" className=\"size-5 shrink-0\" />\n\t\t\t\t\t\t<span>{children}</span>\n\t\t\t\t\t</>\n\t\t\t\t),\n\t\t\t},\n\t\t\tprops,\n\t\t),\n\t\trender,\n\t\tstate: {\n\t\t\tslot: \"editorial-card-link\",\n\t\t},\n\t});\n}\n\nexport {\n\tEditorialCard,\n\tEditorialCardAttribution,\n\tEditorialCardCategory,\n\tEditorialCardExcerpt,\n\tEditorialCardHeader,\n\tEditorialCardLink,\n\tEditorialCardMedia,\n\tEditorialCardMeta,\n\tEditorialCardPlayButton,\n\tEditorialCardTitle,\n\teditorialCardVariants,\n};\nexport type { EditorialCardAttributionProps, EditorialCardProps };\n"],"mappings":";;;;;;;;;;;;;;AAAA,SAAS,kBAAkB;AAC3B,SAAS,iBAAiB;AAC1B,SAAS,WAA8B;AACvC,SAAS,YAAY,YAAY;AAmMP,SA6CrB,UA7CqB,KAgDnB,YAhDmB;AA7L1B,IAAM,wBAAwB;AAAA,EAC7B;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;AAKA,SAAS,cAAc;AAAA,EACtB;AAAA,EACA;AAAA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kC;AACjC,SAAO,UAAU;AAAA,IAChB,gBAAgB;AAAA,IAChB,OAAO;AAAA,MACN;AAAA,QACC,WAAW;AAAA,UACV;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,QACD;AAAA,QACA,UACC,iCACC;AAAA,8BAAC,cAAW,eAAY,QAAO,WAAU,mBAAkB;AAAA,UAC3D,oBAAC,UAAM,UAAS;AAAA,WACjB;AAAA,MAEF;AAAA,MACA;AAAA,IACD;AAAA,IACA;AAAA,IACA,OAAO;AAAA,MACN,MAAM;AAAA,IACP;AAAA,EACD,CAAC;AACF;","names":[]}
|
package/dist/empty-state.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/empty-state.tsx"],"sourcesContent":["import { cva, type VariantProps } from \"class-variance-authority\";\nimport type * as React from \"react\";\n\nimport { cn } from \"./lib/cn\";\n\nfunction Empty({\n\tclassName,\n\tvariant = \"default\",\n\t...props\n}: React.ComponentProps<\"div\"> & {\n\tvariant?: \"filled\" | \"outline\" | \"default\";\n}) {\n\treturn (\n\t\t<div\n\t\t\tdata-slot=\"empty\"\n\t\t\tclassName={cn(\n\t\t\t\t\"flex w-full min-w-0 flex-1 flex-col items-center justify-center gap-gdt-xl rounded-2xl p-gdt-2xl text-center text-balance\",\n\t\t\t\tvariant === \"filled\" && \"bg-surface-raised border border-line-subtle\",\n\t\t\t\tvariant === \"outline\" && \"border border-line\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction EmptyHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n\treturn (\n\t\t<div\n\t\t\tdata-slot=\"empty-header\"\n\t\t\tclassName={cn(\n\t\t\t\t\"flex w-full max-w-95 flex-col items-center gap-gdt-sm\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nconst emptyMediaVariants = cva(\n\t\"mb-gdt-sm flex shrink-0 items-center justify-center text-fg-brand [&_svg]:pointer-events-none [&_svg]:shrink-0\",\n\t{\n\t\tvariants: {\n\t\t\tvariant: {\n\t\t\t\tdefault: \"bg-transparent\",\n\t\t\t\ticon: \"size-24 rounded-full bg-surface-brand-subtle [&_svg:not([class*='size-'])]:size-10\",\n\t\t\t},\n\t\t},\n\t\tdefaultVariants: {\n\t\t\tvariant: \"default\",\n\t\t},\n\t},\n);\n\nfunction EmptyMedia({\n\tclassName,\n\tvariant = \"default\",\n\t...props\n}: React.ComponentProps<\"div\"> & VariantProps<typeof emptyMediaVariants>) {\n\treturn (\n\t\t<div\n\t\t\tdata-slot=\"empty-media\"\n\t\t\tdata-variant={variant}\n\t\t\tclassName={cn(emptyMediaVariants({ variant, className }))}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction EmptyTitle({ className, ...props }: React.ComponentProps<\"div\">) {\n\treturn (\n\t\t<div\n\t\t\tdata-slot=\"empty-title\"\n\t\t\tclassName={cn(\n\t\t\t\t\"text-gdt-h4 font-extrabold tracking-tight text-fg-primary\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction EmptyDescription({ className, ...props }: React.ComponentProps<\"p\">) {\n\treturn (\n\t\t<p\n\t\t\tdata-slot=\"empty-description\"\n\t\t\tclassName={cn(\n\t\t\t\t\"max-w-95 text-gdt-md font-normal text-fg-secondary [&>a]:font-semibold [&>a]:text-fg-brand [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-fg-primary\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction EmptyContent({ className, ...props }: React.ComponentProps<\"div\">) {\n\treturn (\n\t\t<div\n\t\t\tdata-slot=\"empty-content\"\n\t\t\tclassName={cn(\n\t\t\t\t\"flex w-full max-w-95 min-w-0 flex-col items-center justify-center gap-gdt-sm text-gdt-sm text-balance sm:flex-row [&_[data-slot=button]]:w-full sm:[&_[data-slot=button]]:w-auto\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport {\n\tEmpty,\n\tEmptyHeader,\n\tEmptyTitle,\n\tEmptyDescription,\n\tEmptyContent,\n\tEmptyMedia,\n};\n"],"mappings":";;;;;AAAA,SAAS,WAA8B;AAarC;AARF,SAAS,MAAM;AAAA,EACd;AAAA,EACA,UAAU;AAAA,EACV,GAAG;AACJ,GAEG;AACF,SACC;AAAA,IAAC;AAAA;AAAA,MACA,aAAU;AAAA,MACV,WAAW;AAAA,QACV;AAAA,QACA,YAAY,YAAY;AAAA,QACxB,YAAY,aAAa;AAAA,QACzB;AAAA,MACD;AAAA,MACC,GAAG;AAAA;AAAA,EACL;AAEF;AAEA,SAAS,YAAY,EAAE,WAAW,GAAG,MAAM,GAAgC;AAC1E,SACC;AAAA,IAAC;AAAA;AAAA,MACA,aAAU;AAAA,MACV,WAAW;AAAA,QACV;AAAA,QACA;AAAA,MACD;AAAA,MACC,GAAG;AAAA;AAAA,EACL;AAEF;AAEA,IAAM,qBAAqB;AAAA,EAC1B;AAAA,EACA;AAAA,IACC,UAAU;AAAA,MACT,SAAS;AAAA,QACR,SAAS;AAAA,QACT,MAAM;AAAA,MACP;AAAA,IACD;AAAA,IACA,iBAAiB;AAAA,MAChB,SAAS;AAAA,IACV;AAAA,EACD;AACD;AAEA,SAAS,WAAW;AAAA,EACnB;AAAA,EACA,UAAU;AAAA,EACV,GAAG;AACJ,GAA0E;AACzE,SACC;AAAA,IAAC;AAAA;AAAA,MACA,aAAU;AAAA,MACV,gBAAc;AAAA,MACd,WAAW,GAAG,mBAAmB,EAAE,SAAS,UAAU,CAAC,CAAC;AAAA,MACvD,GAAG;AAAA;AAAA,EACL;AAEF;AAEA,SAAS,WAAW,EAAE,WAAW,GAAG,MAAM,GAAgC;AACzE,SACC;AAAA,IAAC;AAAA;AAAA,MACA,aAAU;AAAA,MACV,WAAW;AAAA,QACV;AAAA,QACA;AAAA,MACD;AAAA,MACC,GAAG;AAAA;AAAA,EACL;AAEF;AAEA,SAAS,iBAAiB,EAAE,WAAW,GAAG,MAAM,GAA8B;AAC7E,SACC;AAAA,IAAC;AAAA;AAAA,MACA,aAAU;AAAA,MACV,WAAW;AAAA,QACV;AAAA,QACA;AAAA,MACD;AAAA,MACC,GAAG;AAAA;AAAA,EACL;AAEF;AAEA,SAAS,aAAa,EAAE,WAAW,GAAG,MAAM,GAAgC;AAC3E,SACC;AAAA,IAAC;AAAA;AAAA,MACA,aAAU;AAAA,MACV,WAAW;AAAA,QACV;AAAA,QACA;AAAA,MACD;AAAA,MACC,GAAG;AAAA;AAAA,EACL;AAEF;","names":[]}
|
package/dist/field.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/field.tsx"],"sourcesContent":["\"use client\";\n\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { useMemo } from \"react\";\nimport { Label } from \"./label\";\nimport { cn } from \"./lib/cn\";\nimport { Separator } from \"./separator\";\nimport { SizeProvider, useComponentSize } from \"./size-context\";\n\nfunction FieldSet({ className, ...props }: React.ComponentProps<\"fieldset\">) {\n\treturn (\n\t\t<fieldset\n\t\t\tdata-slot=\"field-set\"\n\t\t\tclassName={cn(\n\t\t\t\t\"flex flex-col gap-4 has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction FieldLegend({\n\tclassName,\n\tvariant = \"legend\",\n\t...props\n}: React.ComponentProps<\"legend\"> & { variant?: \"legend\" | \"label\" }) {\n\treturn (\n\t\t<legend\n\t\t\tdata-slot=\"field-legend\"\n\t\t\tdata-variant={variant}\n\t\t\tclassName={cn(\n\t\t\t\t\"text-fg-primary data-[variant=label]:text-gdt-sm data-[variant=label]:font-semibold data-[variant=legend]:text-gdt-md data-[variant=legend]:font-medium\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction FieldGroup({ className, ...props }: React.ComponentProps<\"div\">) {\n\treturn (\n\t\t<div\n\t\t\tdata-slot=\"field-group\"\n\t\t\tclassName={cn(\n\t\t\t\t\"group/field-group @container/field-group flex w-full flex-col gap-6 data-[slot=checkbox-group]:gap-3 *:data-[slot=field-group]:gap-4\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nconst fieldVariants = cva(\"group/field flex w-full\", {\n\tvariants: {\n\t\torientation: {\n\t\t\tvertical: \"flex-col *:w-full [&>.sr-only]:w-auto\",\n\t\t\thorizontal:\n\t\t\t\t\"flex-row items-center has-[>[data-slot=field-content]]:items-start *:data-[slot=field-label]:flex-auto has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio],[role=switch]]:mt-px data-[size=sm]:gap-1.5 data-[size=md]:gap-2.5 data-[size=lg]:gap-3\",\n\t\t\tresponsive:\n\t\t\t\t\"flex-col *:w-full @md/field-group:flex-row @md/field-group:items-center @md/field-group:*:w-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:*:data-[slot=field-label]:flex-auto [&>.sr-only]:w-auto @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio],[role=switch]]:mt-px\",\n\t\t},\n\t\tsize: {\n\t\t\tsm: \"gap-1\",\n\t\t\tmd: \"gap-1.5\",\n\t\t\tlg: \"gap-2\",\n\t\t},\n\t},\n\tdefaultVariants: {\n\t\torientation: \"vertical\",\n\t\tsize: \"md\",\n\t},\n});\n\nfunction Field({\n\tclassName,\n\torientation = \"vertical\",\n\tsize,\n\t...props\n}: React.ComponentProps<\"div\"> & VariantProps<typeof fieldVariants>) {\n\tconst resolvedSize = useComponentSize(size);\n\n\treturn (\n\t\t<SizeProvider size={resolvedSize}>\n\t\t\t{/* biome-ignore lint/a11y/useSemanticElements: this wrapper is reused for non-fieldset control layouts and needs div semantics. */}\n\t\t\t<div\n\t\t\t\trole=\"group\"\n\t\t\t\tdata-slot=\"field\"\n\t\t\t\tdata-orientation={orientation}\n\t\t\t\tdata-size={resolvedSize}\n\t\t\t\tclassName={cn(\n\t\t\t\t\tfieldVariants({ orientation, size: resolvedSize }),\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t\t{...props}\n\t\t\t/>\n\t\t</SizeProvider>\n\t);\n}\n\nfunction FieldContent({ className, ...props }: React.ComponentProps<\"div\">) {\n\treturn (\n\t\t<div\n\t\t\tdata-slot=\"field-content\"\n\t\t\tclassName={cn(\n\t\t\t\t\"group/field-content flex flex-1 flex-col leading-snug group-data-[size=sm]/field:gap-0.5 group-data-[size=md]/field:gap-0.5 group-data-[size=lg]/field:gap-1\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction FieldLabel({\n\tclassName,\n\t...props\n}: React.ComponentProps<typeof Label>) {\n\treturn (\n\t\t<Label\n\t\t\tdata-slot=\"field-label\"\n\t\t\tclassName={cn(\n\t\t\t\t\"group/field-label peer/field-label flex w-fit gap-1 leading-snug font-semibold text-fg-primary group-data-[size=sm]/field:text-gdt-xs group-data-[size=md]/field:text-gdt-sm group-data-[size=lg]/field:text-gdt-md group-data-[disabled=true]/field:opacity-50 has-data-checked:border-primary/30 has-data-checked:bg-primary/5 has-[>[data-slot=field]]:rounded-lg has-[>[data-slot=field]]:border *:data-[slot=field]:p-2.5 dark:has-data-checked:border-primary/20 dark:has-data-checked:bg-primary/10\",\n\t\t\t\t\"has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col has-[>[data-slot=field]]:gap-2\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction FieldTitle({ className, ...props }: React.ComponentProps<\"div\">) {\n\treturn (\n\t\t<div\n\t\t\tdata-slot=\"field-label\"\n\t\t\tclassName={cn(\n\t\t\t\t\"flex w-fit items-center gap-2 font-semibold text-fg-primary group-data-[size=sm]/field:text-gdt-xs group-data-[size=md]/field:text-gdt-sm group-data-[size=lg]/field:text-gdt-md group-data-[disabled=true]/field:opacity-50\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction FieldDescription({ className, ...props }: React.ComponentProps<\"p\">) {\n\treturn (\n\t\t<p\n\t\t\tdata-slot=\"field-description\"\n\t\t\tclassName={cn(\n\t\t\t\t\"text-left font-normal text-fg-secondary group-data-[size=sm]/field:text-gdt-subtext group-data-[size=md]/field:text-gdt-xs group-data-[size=lg]/field:text-gdt-sm group-has-data-horizontal/field:text-balance [[data-variant=legend]+&]:-mt-1.5\",\n\t\t\t\t\"last:mt-0 nth-last-2:-mt-1\",\n\t\t\t\t\"[&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction FieldSeparator({\n\tchildren,\n\tclassName,\n\t...props\n}: React.ComponentProps<\"div\"> & {\n\tchildren?: React.ReactNode;\n}) {\n\treturn (\n\t\t<div\n\t\t\tdata-slot=\"field-separator\"\n\t\t\tdata-content={!!children}\n\t\t\tclassName={cn(\n\t\t\t\t\"relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n\t\t\t<Separator className=\"absolute inset-0 top-1/2\" />\n\t\t\t{children && (\n\t\t\t\t<span\n\t\t\t\t\tclassName=\"relative mx-auto block w-fit bg-background px-2 text-muted-foreground\"\n\t\t\t\t\tdata-slot=\"field-separator-content\"\n\t\t\t\t>\n\t\t\t\t\t{children}\n\t\t\t\t</span>\n\t\t\t)}\n\t\t</div>\n\t);\n}\n\nfunction FieldError({\n\tclassName,\n\tchildren,\n\terrors,\n\t...props\n}: React.ComponentProps<\"div\"> & {\n\terrors?: Array<{ message?: string } | undefined>;\n}) {\n\tconst content = useMemo(() => {\n\t\tif (children) {\n\t\t\treturn children;\n\t\t}\n\n\t\tif (!errors?.length) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst uniqueErrors = [\n\t\t\t...new Map(errors.map((error) => [error?.message, error])).values(),\n\t\t];\n\n\t\tif (uniqueErrors?.length === 1) {\n\t\t\treturn uniqueErrors[0]?.message;\n\t\t}\n\n\t\treturn (\n\t\t\t<ul className=\"ml-4 flex list-disc flex-col gap-1\">\n\t\t\t\t{uniqueErrors.map(\n\t\t\t\t\t(error) =>\n\t\t\t\t\t\terror?.message && <li key={error.message}>{error.message}</li>,\n\t\t\t\t)}\n\t\t\t</ul>\n\t\t);\n\t}, [children, errors]);\n\n\tif (!content) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<div\n\t\t\trole=\"alert\"\n\t\t\tdata-slot=\"field-error\"\n\t\t\tclassName={cn(\"text-gdt-xs font-normal text-fg-danger\", className)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{content}\n\t\t</div>\n\t);\n}\n\nexport {\n\tField,\n\tFieldLabel,\n\tFieldDescription,\n\tFieldError,\n\tFieldGroup,\n\tFieldLegend,\n\tFieldSeparator,\n\tFieldSet,\n\tFieldContent,\n\tFieldTitle,\n};\n"],"mappings":";;;;;;;;;;;;;;;;AAEA,SAAS,WAA8B;AACvC,SAAS,eAAe;AAQtB,cA2JA,YA3JA;AAFF,SAAS,SAAS,EAAE,WAAW,GAAG,MAAM,GAAqC;AAC5E,SACC;AAAA,IAAC;AAAA;AAAA,MACA,aAAU;AAAA,MACV,WAAW;AAAA,QACV;AAAA,QACA;AAAA,MACD;AAAA,MACC,GAAG;AAAA;AAAA,EACL;AAEF;AAEA,SAAS,YAAY;AAAA,EACpB;AAAA,EACA,UAAU;AAAA,EACV,GAAG;AACJ,GAAsE;AACrE,SACC;AAAA,IAAC;AAAA;AAAA,MACA,aAAU;AAAA,MACV,gBAAc;AAAA,MACd,WAAW;AAAA,QACV;A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B,aAAO,aAAa,CAAC,GAAG;AAAA,IACzB;AAEA,WACC,oBAAC,QAAG,WAAU,sCACZ,uBAAa;AAAA,MACb,CAAC,UACA,OAAO,WAAW,oBAAC,QAAwB,gBAAM,WAAtB,MAAM,OAAwB;AAAA,IAC3D,GACD;AAAA,EAEF,GAAG,CAAC,UAAU,MAAM,CAAC;AAErB,MAAI,CAAC,SAAS;AACb,WAAO;AAAA,EACR;AAEA,SACC;AAAA,IAAC;AAAA;AAAA,MACA,MAAK;AAAA,MACL,aAAU;AAAA,MACV,WAAW,GAAG,0CAA0C,SAAS;AAAA,MAChE,GAAG;AAAA,MAEH;AAAA;AAAA,EACF;AAEF;","names":[]}
|
package/dist/footer.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/footer.tsx"],"sourcesContent":["import { mergeProps } from \"@base-ui/react/merge-props\";\nimport { useRender } from \"@base-ui/react/use-render\";\nimport type * as React from \"react\";\nimport { InputGroup, InputGroupButton, InputGroupInput } from \"./input-group\";\nimport { cn } from \"./lib/cn\";\n\ntype FooterRootProps = React.ComponentProps<\"footer\"> & {\n\tcontainerClassName?: string;\n};\n\nfunction FooterRoot({\n\tclassName,\n\tcontainerClassName,\n\tchildren,\n\t...props\n}: FooterRootProps) {\n\treturn (\n\t\t<footer\n\t\t\tdata-slot=\"footer-root\"\n\t\t\tclassName={cn(\"bg-surface text-fg-primary\", className)}\n\t\t\t{...props}\n\t\t>\n\t\t\t<div\n\t\t\t\tdata-slot=\"footer-container\"\n\t\t\t\tclassName={cn(\n\t\t\t\t\t\"mx-auto flex w-full max-w-7xl flex-col\",\n\t\t\t\t\tcontainerClassName,\n\t\t\t\t)}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</div>\n\t\t</footer>\n\t);\n}\n\nfunction FooterCta({ className, ...props }: React.ComponentProps<\"section\">) {\n\treturn (\n\t\t<section\n\t\t\tdata-slot=\"footer-cta\"\n\t\t\tclassName={cn(\n\t\t\t\t\"grid gap-gdt-xl bg-surface-brand px-gdt-xl py-gdt-4xl text-fg-on-brand md:grid-cols-[minmax(0,1fr)_auto] md:items-center md:px-gdt-5xl\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction FooterCtaContent({\n\tclassName,\n\t...props\n}: React.ComponentProps<\"div\">) {\n\treturn (\n\t\t<div\n\t\t\tdata-slot=\"footer-cta-content\"\n\t\t\tclassName={cn(\"flex max-w-145 flex-col gap-2 md:gap-3\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction FooterCtaTitle({ className, ...props }: React.ComponentProps<\"h2\">) {\n\treturn (\n\t\t<h2\n\t\t\tdata-slot=\"footer-cta-title\"\n\t\t\tclassName={cn(\"text-gdt-h5 text-current md:text-gdt-h4\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction FooterCtaDescription({\n\tclassName,\n\t...props\n}: React.ComponentProps<\"p\">) {\n\treturn (\n\t\t<p\n\t\t\tdata-slot=\"footer-cta-description\"\n\t\t\tclassName={cn(\"text-gdt-sm text-current\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction FooterCtaActions({\n\tclassName,\n\t...props\n}: React.ComponentProps<\"div\">) {\n\treturn (\n\t\t<div\n\t\t\tdata-slot=\"footer-cta-actions\"\n\t\t\tclassName={cn(\"flex flex-wrap items-center gap-3 md:gap-4\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction FooterBody({ className, ...props }: React.ComponentProps<\"div\">) {\n\treturn (\n\t\t<div\n\t\t\tdata-slot=\"footer-body\"\n\t\t\tclassName={cn(\n\t\t\t\t\"flex flex-col gap-gdt-6xl px-gdt-xl py-gdt-5xl md:px-gdt-5xl\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction FooterHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n\treturn (\n\t\t<div\n\t\t\tdata-slot=\"footer-header\"\n\t\t\tclassName={cn(\"flex max-w-xl flex-col gap-gdt-sm\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction FooterTitle({ className, ...props }: React.ComponentProps<\"h2\">) {\n\treturn (\n\t\t<h2\n\t\t\tdata-slot=\"footer-title\"\n\t\t\tclassName={cn(\"text-gdt-h5 text-fg-primary\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction FooterDescription({ className, ...props }: React.ComponentProps<\"p\">) {\n\treturn (\n\t\t<p\n\t\t\tdata-slot=\"footer-description\"\n\t\t\tclassName={cn(\"text-gdt-xs text-fg-secondary\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction FooterNav({ className, ...props }: React.ComponentProps<\"nav\">) {\n\treturn (\n\t\t<nav\n\t\t\tdata-slot=\"footer-nav\"\n\t\t\tclassName={cn(\n\t\t\t\t\"grid gap-x-gdt-4xl gap-y-gdt-xl sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-6\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction FooterSection({ className, ...props }: React.ComponentProps<\"div\">) {\n\treturn (\n\t\t<div\n\t\t\tdata-slot=\"footer-section\"\n\t\t\tclassName={cn(\"flex min-w-0 flex-col gap-gdt-md\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction FooterSectionTitle({\n\tclassName,\n\t...props\n}: React.ComponentProps<\"h3\">) {\n\treturn (\n\t\t<h3\n\t\t\tdata-slot=\"footer-section-title\"\n\t\t\tclassName={cn(\"text-gdt-xs font-bold text-fg-primary\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction FooterLinkList({ className, ...props }: React.ComponentProps<\"ul\">) {\n\treturn (\n\t\t<ul\n\t\t\tdata-slot=\"footer-link-list\"\n\t\t\tclassName={cn(\"flex flex-col gap-gdt-sm\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction FooterLinkItem({ className, ...props }: React.ComponentProps<\"li\">) {\n\treturn (\n\t\t<li\n\t\t\tdata-slot=\"footer-link-item\"\n\t\t\tclassName={cn(\"text-gdt-xs\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\ntype FooterLinkProps = useRender.ComponentProps<\"a\"> & {\n\tshowArrow?: boolean;\n};\n\nfunction FooterLink({\n\tclassName,\n\tchildren,\n\trender,\n\tshowArrow = false,\n\t...props\n}: FooterLinkProps) {\n\treturn useRender({\n\t\tdefaultTagName: \"a\",\n\t\tprops: mergeProps<\"a\">(\n\t\t\t{\n\t\t\t\tclassName: cn(\n\t\t\t\t\t\"inline-flex items-center gap-gdt-sm text-fg-secondary transition-colors hover:text-fg-brand focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-line-focus focus-visible:ring-offset-2\",\n\t\t\t\t\tclassName,\n\t\t\t\t),\n\t\t\t\tchildren: (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<span>{children}</span>\n\t\t\t\t\t\t{showArrow && <span aria-hidden=\"true\">›</span>}\n\t\t\t\t\t</>\n\t\t\t\t),\n\t\t\t},\n\t\t\tprops,\n\t\t),\n\t\trender,\n\t\tstate: {\n\t\t\tslot: \"footer-link\",\n\t\t},\n\t});\n}\n\nfunction FooterContactGrid({\n\tclassName,\n\t...props\n}: React.ComponentProps<\"div\">) {\n\treturn (\n\t\t<div\n\t\t\tdata-slot=\"footer-contact-grid\"\n\t\t\tclassName={cn(\n\t\t\t\t\"grid gap-gdt-3xl border-t border-line-subtle pt-gdt-xl md:grid-cols-[minmax(0,1fr)_minmax(18rem,25rem)]\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction FooterContact({\n\tclassName,\n\t...props\n}: React.ComponentProps<\"address\">) {\n\treturn (\n\t\t<address\n\t\t\tdata-slot=\"footer-contact\"\n\t\t\tclassName={cn(\"not-italic text-gdt-xs text-fg-secondary\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction FooterContactTitle({\n\tclassName,\n\t...props\n}: React.ComponentProps<\"h3\">) {\n\treturn (\n\t\t<h3\n\t\t\tdata-slot=\"footer-contact-title\"\n\t\t\tclassName={cn(\n\t\t\t\t\"mb-gdt-sm text-gdt-xs font-bold text-fg-primary\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction FooterSocialList({ className, ...props }: React.ComponentProps<\"ul\">) {\n\treturn (\n\t\t<ul\n\t\t\tdata-slot=\"footer-social-list\"\n\t\t\tclassName={cn(\n\t\t\t\t\"mt-gdt-lg flex flex-wrap items-center gap-gdt-md\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction FooterSocialItem({ className, ...props }: React.ComponentProps<\"li\">) {\n\treturn <li data-slot=\"footer-social-item\" className={className} {...props} />;\n}\n\nfunction FooterSocialLink({ className, ...props }: React.ComponentProps<\"a\">) {\n\treturn (\n\t\t<a\n\t\t\tdata-slot=\"footer-social-link\"\n\t\t\tclassName={cn(\n\t\t\t\t\"inline-flex size-7 items-center justify-center rounded-full bg-canvas text-fg-secondary transition-colors hover:bg-surface-brand hover:text-fg-on-brand focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-line-focus focus-visible:ring-offset-2 [&>svg:not([class*='size-'])]:size-3.5\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction FooterNewsletter({\n\tclassName,\n\t...props\n}: React.ComponentProps<\"form\">) {\n\treturn (\n\t\t<form\n\t\t\tdata-slot=\"footer-newsletter\"\n\t\t\tclassName={cn(\"flex flex-col gap-gdt-md\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction FooterNewsletterTitle({\n\tclassName,\n\t...props\n}: React.ComponentProps<\"h3\">) {\n\treturn (\n\t\t<h3\n\t\t\tdata-slot=\"footer-newsletter-title\"\n\t\t\tclassName={cn(\"text-gdt-xs font-bold text-fg-primary\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction FooterNewsletterDescription({\n\tclassName,\n\t...props\n}: React.ComponentProps<\"p\">) {\n\treturn (\n\t\t<p\n\t\t\tdata-slot=\"footer-newsletter-description\"\n\t\t\tclassName={cn(\"text-gdt-xs text-fg-secondary\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction FooterNewsletterControl({\n\tclassName,\n\tchildren,\n\t...props\n}: React.ComponentProps<typeof InputGroup>) {\n\treturn (\n\t\t<InputGroup\n\t\t\tdata-slot=\"footer-newsletter-control\"\n\t\t\tsize=\"md\"\n\t\t\tclassName={cn(\"max-w-md bg-canvas\", className)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{children ?? (\n\t\t\t\t<>\n\t\t\t\t\t<InputGroupInput\n\t\t\t\t\t\ttype=\"email\"\n\t\t\t\t\t\tname=\"email\"\n\t\t\t\t\t\tplaceholder=\"Email address\"\n\t\t\t\t\t\taria-label=\"Email address\"\n\t\t\t\t\t/>\n\t\t\t\t\t<InputGroupButton type=\"submit\" variant=\"primary\">\n\t\t\t\t\t\tSubscribe\n\t\t\t\t\t</InputGroupButton>\n\t\t\t\t</>\n\t\t\t)}\n\t\t</InputGroup>\n\t);\n}\n\nfunction FooterBottom({ className, ...props }: React.ComponentProps<\"div\">) {\n\treturn (\n\t\t<div\n\t\t\tdata-slot=\"footer-bottom\"\n\t\t\tclassName={cn(\n\t\t\t\t\"flex flex-col gap-gdt-md border-t border-line-subtle px-gdt-xl py-gdt-lg text-gdt-subtext text-fg-secondary md:flex-row md:items-center md:justify-between md:px-gdt-5xl\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction FooterLegalLinks({\n\tclassName,\n\t...props\n}: React.ComponentProps<\"nav\">) {\n\treturn (\n\t\t<nav\n\t\t\tdata-slot=\"footer-legal-links\"\n\t\t\tclassName={cn(\"flex flex-wrap items-center gap-gdt-xl\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport {\n\tFooterBody,\n\tFooterBottom,\n\tFooterContact,\n\tFooterContactGrid,\n\tFooterContactTitle,\n\tFooterCta,\n\tFooterCtaActions,\n\tFooterCtaContent,\n\tFooterCtaDescription,\n\tFooterCtaTitle,\n\tFooterDescription,\n\tFooterHeader,\n\tFooterLegalLinks,\n\tFooterLink,\n\tFooterLinkItem,\n\tFooterLinkList,\n\tFooterNav,\n\tFooterNewsletter,\n\tFooterNewsletterControl,\n\tFooterNewsletterDescription,\n\tFooterNewsletterTitle,\n\tFooterRoot,\n\tFooterSection,\n\tFooterSectionTitle,\n\tFooterSocialItem,\n\tFooterSocialLink,\n\tFooterSocialList,\n\tFooterTitle,\n};\nexport type { FooterLinkProps, FooterRootProps };\n"],"mappings":";;;;;;;;;;;;;;;AAAA,SAAS,kBAAkB;AAC3B,SAAS,iBAAiB;AAqBvB,SAkME,UAlMF,KAkME,YAlMF;AAZH,SAAS,WAAW;AAAA,EACnB;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACJ,GAAoB;AACnB,SACC;AAAA,IAAC;AAAA;AAAA,MACA,aAAU;AAAA,MACV,WAAW,GAAG,8BAA8B,SAAS;AAAA,MACpD,GAAG;AAAA,MAEJ;AAAA,QAAC;AAAA;AAAA,UACA,aAAU;AAAA,UACV,WAAW;AAAA,YACV;AAAA,YACA;AAAA,UACD;AAAA,UAEC;AAAA;AAAA,MACF;AAAA;AAAA,EACD;AAEF;AAEA,SAAS,UAAU,EAAE,WAAW,GAAG,MAAM,GAAoC;AAC5E,SACC;AAAA,IAAC;AAAA;AAAA,MACA,aAAU;AAAA,MACV,WAAW;AAAA,QACV;AAAA,QACA;AAAA,MACD;AAAA,MACC,GAAG;AAAA;AAAA,EACL;AAEF;AAEA,SAAS,iBAAiB;AAAA,EACzB;AAAA,EAC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AAAA,QACA;AAAA,MACD;AAAA,MACC,GAAG;AAAA;AAAA,EACL;AAEF;AAEA,SAAS,iBAAiB;AAAA,EACzB;AAAA,EACA,GAAG;AACJ,GAAgC;AAC/B,SACC;AAAA,IAAC;AAAA;AAAA,MACA,aAAU;AAAA,MACV,WAAW,GAAG,0CAA0C,SAAS;AAAA,MAChE,GAAG;AAAA;AAAA,EACL;AAEF;","names":[]}
|
package/dist/funnel-chart.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/funnel-chart.tsx"],"sourcesContent":["\"use client\";\n\nimport { cva } from \"class-variance-authority\";\nimport type * as React from \"react\";\nimport {\n\tBar,\n\tBarChart,\n\tFunnel,\n\tFunnelChart as RechartsFunnelChart,\n\tXAxis,\n\tYAxis,\n} from \"recharts\";\nimport {\n\tChartCard,\n\ttype ChartConfig,\n\tChartContainer,\n\tChartDescription,\n\tChartHeader,\n\tChartTitle,\n\tChartTooltip,\n\tChartTooltipContent,\n\ttype ChartValueType,\n} from \"./chart\";\nimport { cn } from \"./lib/cn\";\nimport { type ComponentSize, useComponentSize } from \"./size-context\";\n\n/**\n * A staged conversion chart for drop-off analytics. Two renderings share one\n * component — `funnel` draws connected, edge-sharing trapezoids (recharts\n * `FunnelChart`) that narrow top-down; `bars` draws flush, left-aligned tracks\n * (recharts `BarChart`, vertical layout) over a faint 100 % reference, using\n * recharts' built-in `Bar` `background`. Both read top-down as the audience\n * drops off, and both reuse the same stage data, palette, value-label column,\n * legend, frame, and tooltip — only the inner plot differs (the same split as\n * `Sparkline`). Per the chart architecture the recharts primitives are rendered\n * directly here, never wrapped.\n *\n * @example\n * <FunnelChart\n * data={[\n * { label: \"Applied\", value: 1000 },\n * { label: \"Pre-qualified\", value: 720 },\n * { label: \"Closed\", value: 110 },\n * ]}\n * title=\"Application drop-off\"\n * description=\"V3 analytics · last 30 days\"\n * tooltip\n * />\n */\n\n/** Funnel sizes line up with the three shared `ComponentSize` values. */\ntype FunnelChartSize = ComponentSize;\n\n/** Plot rendering — connected trapezoids or flush-stacked bars. */\ntype FunnelChartType = \"funnel\" | \"bars\";\n\n/** Where the colour-key legend sits relative to the plot. */\ntype FunnelLegendPlacement = \"right\" | \"bottom\";\n\ntype FunnelStage = {\n\t/** Stage name, e.g. \"Applied\". */\n\tlabel: string;\n\t/** Absolute count reaching this stage. */\n\tvalue: number;\n\t/** Segment colour; defaults to the palette in stage order. */\n\tfill?: string;\n};\n\n/**\n * Stage palette, ordered top-of-funnel → bottom: forest → brass → moss → clay →\n * stone. Giddaa has no `chart-1`…`chart-N` tokens yet, so these map to the brand\n * scales; assign by order, or override per stage with `fill`.\n */\nconst FUNNEL_CHART_PALETTE = [\n\t\"var(--color-forest-700)\",\n\t\"var(--color-brass-500)\",\n\t\"var(--color-moss-600)\",\n\t\"var(--color-clay-500)\",\n\t\"var(--color-stone-500)\",\n] as const;\n\ntype FunnelChartLayout = {\n\t/** Plot box height in px. */\n\theight: number;\n\t/** Plot box width in px — the funnel/bars column; labels + legend flow after. */\n\twidth: number;\n\t/** Corner radius for the `bars` rendering. */\n\tbarRadius: number;\n\t/** Bar thickness cap for the `bars` rendering. */\n\tbarMaxSize: number;\n};\n\nconst FUNNEL_CHART_LAYOUT: Record<FunnelChartSize, FunnelChartLayout> = {\n\tsm: { height: 150, width: 150, barRadius: 3, barMaxSize: 14 },\n\tmd: { height: 200, width: 220, barRadius: 4, barMaxSize: 18 },\n\tlg: { height: 264, width: 288, barRadius: 5, barMaxSize: 22 },\n};\n\n/** Vertical stage list — value-label column and the right-hand legend share it. */\nconst funnelStageListVariants = cva(\"flex min-w-0 flex-col\", {\n\tvariants: {\n\t\tsize: {\n\t\t\tsm: \"gap-2 text-gdt-xs\",\n\t\t\tmd: \"gap-3 text-gdt-sm\",\n\t\t\tlg: \"gap-3.5 text-gdt-sm\",\n\t\t},\n\t},\n\tdefaultVariants: { size: \"md\" },\n});\n\nconst funnelLegendDotVariants = cva(\"shrink-0 rounded-full\", {\n\tvariants: {\n\t\tsize: { sm: \"size-2\", md: \"size-2.5\", lg: \"size-3\" },\n\t},\n\tdefaultVariants: { size: \"md\" },\n});\n\ntype FunnelChartProps = Omit<\n\tReact.ComponentProps<typeof ChartCard>,\n\t\"size\" | \"children\"\n> & {\n\t/** Stages in funnel order — the widest (top) stage first. */\n\tdata: FunnelStage[];\n\t/** Plot rendering. Defaults to `funnel`. */\n\ttype?: FunnelChartType;\n\t/** Explicit size; otherwise inherited from the nearest `SizeProvider`. */\n\tsize?: FunnelChartSize;\n\t/** Chart heading. Omit to hide the title. */\n\ttitle?: React.ReactNode;\n\t/** Supporting metadata (period, source). Omit to hide the description. */\n\tdescription?: React.ReactNode;\n\t/** Enable the hover value tooltip. Default false. */\n\ttooltip?: boolean;\n\t/** Legend placement — a right column or a wrapped bottom row. Default right. */\n\tlegend?: FunnelLegendPlacement;\n\t/** Format the absolute count in the value label and tooltip. */\n\tvalueFormatter?: (value: number) => string;\n\t/** Value formatting for the tooltip. Defaults to `number`. */\n\tvalueType?: ChartValueType;\n};\n\nfunction FunnelChart({\n\tdata,\n\ttype = \"funnel\",\n\tsize,\n\ttitle,\n\tdescription,\n\ttooltip = false,\n\tlegend = \"right\",\n\tvalueFormatter = (value) => value.toLocaleString(\"en-NG\"),\n\tvalueType = \"number\",\n\tclassName,\n\t...props\n}: FunnelChartProps) {\n\tconst resolvedSize = useComponentSize(size);\n\tconst layout = FUNNEL_CHART_LAYOUT[resolvedSize];\n\n\tconst stages = data.map((stage, i) => ({\n\t\t...stage,\n\t\tfill: stage.fill ?? FUNNEL_CHART_PALETTE[i % FUNNEL_CHART_PALETTE.length],\n\t}));\n\t// Top stage is the funnel's 100 % reference — every share is relative to it.\n\tconst top = stages[0]?.value || 1;\n\n\tconst config = Object.fromEntries(\n\t\tstages.map((stage) => [\n\t\t\tstage.label,\n\t\t\t{ label: stage.label, color: stage.fill },\n\t\t]),\n\t) satisfies ChartConfig;\n\n\tconst tooltipNode = tooltip ? (\n\t\t<ChartTooltip\n\t\t\tcursor={false}\n\t\t\tcontent={<ChartTooltipContent nameKey=\"label\" valueType={valueType} />}\n\t\t/>\n\t) : null;\n\n\t// Per-segment colour comes from each datum's `fill` — recharts reads it\n\t// directly, so no (deprecated) `<Cell>` children are needed.\n\tconst chartNode =\n\t\ttype === \"bars\" ? (\n\t\t\t<BarChart\n\t\t\t\taccessibilityLayer\n\t\t\t\tlayout=\"vertical\"\n\t\t\t\tdata={stages}\n\t\t\t\tmargin={{ top: 0, right: 0, bottom: 0, left: 0 }}\n\t\t\t\tbarCategoryGap=\"0%\"\n\t\t\t>\n\t\t\t\t{tooltipNode}\n\t\t\t\t<XAxis type=\"number\" domain={[0, top]} hide />\n\t\t\t\t<YAxis type=\"category\" dataKey=\"label\" hide />\n\t\t\t\t<Bar\n\t\t\t\t\tdataKey=\"value\"\n\t\t\t\t\tradius={layout.barRadius}\n\t\t\t\t\tcolor=\"var(--color-line-subtle)\"\n\t\t\t\t\tisAnimationActive={false}\n\t\t\t\t/>\n\t\t\t</BarChart>\n\t\t) : (\n\t\t\t<RechartsFunnelChart margin={{ top: 0, right: 0, bottom: 0, left: 0 }}>\n\t\t\t\t{tooltipNode}\n\t\t\t\t<Funnel\n\t\t\t\t\tdata={stages}\n\t\t\t\t\tdataKey=\"value\"\n\t\t\t\t\tnameKey=\"label\"\n\t\t\t\t\tisAnimationActive={false}\n\t\t\t\t/>\n\t\t\t</RechartsFunnelChart>\n\t\t);\n\n\tconst valueLabels = (\n\t\t<ul className={cn(funnelStageListVariants({ size: resolvedSize }))}>\n\t\t\t{stages.map((stage) => (\n\t\t\t\t<li\n\t\t\t\t\tkey={stage.label}\n\t\t\t\t\tclassName=\"whitespace-nowrap tabular-nums text-fg-primary\"\n\t\t\t\t>\n\t\t\t\t\t{valueFormatter(stage.value)} ·{\" \"}\n\t\t\t\t\t{Math.round((stage.value / top) * 100)}%\n\t\t\t\t</li>\n\t\t\t))}\n\t\t</ul>\n\t);\n\n\tconst legendNode = (\n\t\t<ul\n\t\t\tclassName={cn(\n\t\t\t\tlegend === \"right\"\n\t\t\t\t\t? funnelStageListVariants({ size: resolvedSize })\n\t\t\t\t\t: cn(\n\t\t\t\t\t\t\t\"flex flex-row flex-wrap items-center gap-x-4 gap-y-2\",\n\t\t\t\t\t\t\tresolvedSize === \"sm\" ? \"text-gdt-xs\" : \"text-gdt-sm\",\n\t\t\t\t\t\t),\n\t\t\t)}\n\t\t>\n\t\t\t{stages.map((stage) => (\n\t\t\t\t<li\n\t\t\t\t\tkey={stage.label}\n\t\t\t\t\tclassName=\"flex items-center gap-2 text-fg-primary\"\n\t\t\t\t>\n\t\t\t\t\t<span\n\t\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\t\tclassName={cn(funnelLegendDotVariants({ size: resolvedSize }))}\n\t\t\t\t\t\tstyle={{ backgroundColor: stage.fill }}\n\t\t\t\t\t/>\n\t\t\t\t\t<span className=\"min-w-0 truncate\">{stage.label}</span>\n\t\t\t\t</li>\n\t\t\t))}\n\t\t</ul>\n\t);\n\n\treturn (\n\t\t<ChartCard size={resolvedSize} className={className} {...props}>\n\t\t\t{(title != null || description != null) && (\n\t\t\t\t<ChartHeader>\n\t\t\t\t\t{title != null && <ChartTitle>{title}</ChartTitle>}\n\t\t\t\t\t{description != null && (\n\t\t\t\t\t\t<ChartDescription>{description}</ChartDescription>\n\t\t\t\t\t)}\n\t\t\t\t</ChartHeader>\n\t\t\t)}\n\t\t\t<div className=\"flex flex-col gap-4\">\n\t\t\t\t<div className=\"flex flex-wrap items-center gap-x-6 gap-y-4\">\n\t\t\t\t\t<ChartContainer\n\t\t\t\t\t\tconfig={config}\n\t\t\t\t\t\tclassName=\"aspect-auto shrink-0\"\n\t\t\t\t\t\tstyle={{ width: layout.width, height: layout.height }}\n\t\t\t\t\t>\n\t\t\t\t\t\t{chartNode}\n\t\t\t\t\t</ChartContainer>\n\t\t\t\t\t{valueLabels}\n\t\t\t\t\t{legend === \"right\" && legendNode}\n\t\t\t\t</div>\n\t\t\t\t{legend === \"bottom\" && legendNode}\n\t\t\t</div>\n\t\t</ChartCard>\n\t);\n}\n\nexport { FUNNEL_CHART_LAYOUT, FUNNEL_CHART_PALETTE, FunnelChart };\nexport type {\n\tFunnelChartLayout,\n\tFunnelChartProps,\n\tFunnelChartSize,\n\tFunnelChartType,\n\tFunnelLegendPlacement,\n\tFunnelStage,\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAEA,SAAS,WAAW;AAEpB;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA,eAAe;AAAA,EACf;AAAA,EACA;AAAA,OACM;AAmKK,cAQT,YARS;AArGZ,IAAM,uBAAuB;AAAA,EAC5B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD;AAaA,IAAM,sBAAkE;AAAA,EACvE,IAAI,EAAE,QAAQ,KAAK,OAAO,KAAK,WAAW,GAAG,YAAY,GAAG;AAAA,EAC5D,IAAI,EAAE,QAAQ,KAAK,OAAO,KAAK,WAAW,GAAG,YAAY,GAAG;AAAA,EAC5D,IAAI,EAAE,QAAQ,KAAK,OAAO,KAAK,WAAW,GAAG,YAAY,GAAG;AAC7D;AAGA,IAAM,0BAA0B,IAAI,yBAAyB;AAAA,EAC5D,UAAU;AAAA,IACT,MAAM;AAAA,MACL,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,IACL;AAAA,EACD;AAAA,EACA,iBAAiB,EAAE,MAAM,KAAK;AAC/B,CAAC;AAED,IAAM,0BAA0B,IAAI,yBAAyB;AAAA,EAC5D,UAAU;AAAA,IACT,MAAM,EAAE,IAAI,UAAU,IAAI,YAAY,IAAI,SAAS;AAAA,EACpD;AAAA,EACA,iBAAiB,EAAE,MAAM,KAAK;AAC/B,CAAC;AA0BD,SAAS,YAAY;AAAA,EACpB;AAAA,EACA,OAAO;AAAA,EACP;AAAA,EACA;AAAA,EACA;AAAA,EACA,UAAU;AAAA,EACV,SAAS;AAAA,EACT,iBA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AED,qBAAC,SAAI,WAAU,uBACd;AAAA,2BAAC,SAAI,WAAU,+CACd;AAAA;AAAA,UAAC;AAAA;AAAA,YACA;AAAA,YACA,WAAU;AAAA,YACV,OAAO,EAAE,OAAO,OAAO,OAAO,QAAQ,OAAO,OAAO;AAAA,YAEnD;AAAA;AAAA,QACF;AAAA,QACC;AAAA,QACA,WAAW,WAAW;AAAA,SACxB;AAAA,MACC,WAAW,YAAY;AAAA,OACzB;AAAA,KACD;AAEF;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/heatmap-chart.tsx"],"sourcesContent":["\"use client\";\n\nimport type * as React from \"react\";\nimport { Fragment } from \"react\";\nimport { ChartCard, ChartDescription, ChartHeader, ChartTitle } from \"./chart\";\nimport { type ComponentSize, useComponentSize } from \"./size-context\";\n\n/**\n * A heatmap — a row × column grid encoding magnitude as fill intensity.\n * Reach for one to compare a measure across two categorical dimensions at a\n * glance (listing inquiries by neighbourhood and month, traffic by day and\n * hour, repayment rate by branch and quarter).\n *\n * Unlike the other charts in this folder it is not built on recharts\n * (recharts has no heatmap/matrix primitive); it is a CSS grid of cells, a\n * hover/focus tooltip per cell, and an optional sequential-scale legend. It\n * stays size-aware via the shared `SizeProvider` and reuses `ChartCard`.\n *\n * Color encodes magnitude, so cells are `--color-surface-brand` at a\n * magnitude-scaled opacity (8/22/44/70/100%) rather than a distinct hue per\n * bucket — the brand token already flips per theme, so the ramp stays\n * correct in both without a separate token set. Never the categorical\n * `chart-1`…`3` tokens, which encode identity, not amount.\n *\n * @example\n * <HeatmapChart\n * data={[\n * { row: \"Lekki\", column: \"Jan\", value: 42 },\n * { row: \"Lekki\", column: \"Feb\", value: 58 },\n * { row: \"Yaba\", column: \"Jan\", value: 21 },\n * { row: \"Yaba\", column: \"Feb\", value: 30 },\n * ]}\n * title=\"Listing inquiries\"\n * description=\"By neighbourhood · Jan–Feb 2026\"\n * />\n */\n\n/** Heatmap sizes line up with the three shared `ComponentSize` values. */\ntype HeatmapChartSize = ComponentSize;\n\ntype HeatmapChartCellDatum = {\n\t/** Row category label. */\n\trow: string;\n\t/** Column category label. */\n\tcolumn: string;\n\t/** Magnitude driving the cell's fill. Omit the datum entirely for \"no data\". */\n\tvalue: number;\n};\n\n/**\n * Sequential fill ramp — `--color-surface-brand` (already theme-aware) at five\n * magnitude-scaled opacity stops: 8%, 22%, 44%, 70%, 100%. Index 0 is the\n * lowest magnitude bucket, index 4 the highest — assign by bucket order,\n * never by an arbitrary opacity pick. Relative color syntax (`rgb(from … / a)`)\n * keeps each stop a true alpha over whatever surface it sits on, matching the\n * shadow/gradient tokens in `styles/giddaa.css`.\n */\nconst HEATMAP_CHART_PALETTE = [\n\t\"rgb(from var(--color-surface-brand) r g b / 0.08)\",\n\t\"rgb(from var(--color-surface-brand) r g b / 0.22)\",\n\t\"rgb(from var(--color-surface-brand) r g b / 0.44)\",\n\t\"rgb(from var(--color-surface-brand) r g b / 0.7)\",\n\t\"rgb(from var(--color-surface-brand) r g b / 1)\",\n] as const;\n\ntype HeatmapChartLayout = {\n\t/** Width/height of a single (square) cell in px. */\n\tcellSize: number;\n\t/** Gap between cells in px. */\n\tgap: number;\n\t/** Reserved width for row labels in px. */\n\trowLabelWidth: number;\n\t/** Reserved height for the column header row in px. */\n\tcolumnLabelHeight: number;\n\t/** Row/column label font size in px. */\n\tlabelFontSize: number;\n\t/** In-cell value label font size in px. */\n\tvalueFontSize: number;\n\t/** Width of a single legend ramp swatch in px. */\n\tlegendSwatchSize: number;\n};\n\nconst HEATMAP_CHART_LAYOUT: Record<HeatmapChartSize, HeatmapChartLayout> = {\n\tsm: {\n\t\tcellSize: 20,\n\t\tgap: 3,\n\t\trowLabelWidth: 64,\n\t\tcolumnLabelHeight: 20,\n\t\tlabelFontSize: 10,\n\t\tvalueFontSize: 9,\n\t\tlegendSwatchSize: 14,\n\t},\n\tmd: {\n\t\tcellSize: 26,\n\t\tgap: 3,\n\t\trowLabelWidth: 80,\n\t\tcolumnLabelHeight: 22,\n\t\tlabelFontSize: 11,\n\t\tvalueFontSize: 10,\n\t\tlegendSwatchSize: 16,\n\t},\n\tlg: {\n\t\tcellSize: 32,\n\t\tgap: 4,\n\t\trowLabelWidth: 96,\n\t\tcolumnLabelHeight: 24,\n\t\tlabelFontSize: 12,\n\t\tvalueFontSize: 11,\n\t\tlegendSwatchSize: 18,\n\t},\n};\n\n/** Joins a row/column pair into a stable lookup key. */\nfunction cellKey(row: string, column: string) {\n\treturn `${row}␟${column}`;\n}\n\n/** Buckets a value into one of the five palette steps (1 = lowest, 5 = highest). */\nfunction heatmapStep(value: number, domain: readonly [number, number]) {\n\tconst [min, max] = domain;\n\tif (max <= min) return HEATMAP_CHART_PALETTE.length;\n\tconst ratio = (value - min) / (max - min);\n\tconst step = Math.ceil(ratio * HEATMAP_CHART_PALETTE.length);\n\treturn Math.min(HEATMAP_CHART_PALETTE.length, Math.max(1, step));\n}\n\ntype HeatmapChartProps = Omit<\n\tReact.ComponentProps<typeof ChartCard>,\n\t\"size\" | \"children\"\n> & {\n\t/** Cells — one entry per row/column pair that has a value. */\n\tdata: HeatmapChartCellDatum[];\n\t/** Row order, top to bottom. Defaults to first-seen order in `data`. */\n\trows?: string[];\n\t/** Column order, left to right. Defaults to first-seen order in `data`. */\n\tcolumns?: string[];\n\t/** Fixed `[min, max]` for the color scale. Defaults to the data's range. */\n\tdomain?: [number, number];\n\t/** Explicit size; otherwise inherited from the nearest `SizeProvider`. */\n\tsize?: HeatmapChartSize;\n\t/** Chart heading. Omit to hide the title. */\n\ttitle?: React.ReactNode;\n\t/** Supporting metadata (period, source). Omit to hide the description. */\n\tdescription?: React.ReactNode;\n\t/** Show the sequential-scale legend under the grid. Default true. */\n\tlegend?: boolean;\n\t/** Print the formatted value inside every cell. Default false — the\n\t * hover/focus tooltip carries exact figures without crowding the grid. */\n\tshowValues?: boolean;\n\t/** Format a cell value for the tooltip, legend, and in-cell label. */\n\tvalueFormatter?: (value: number) => string;\n};\n\nfunction HeatmapChart({\n\tdata,\n\trows: rowsProp,\n\tcolumns: columnsProp,\n\tdomain: domainProp,\n\tsize,\n\ttitle,\n\tdescription,\n\tlegend = true,\n\tshowValues = false,\n\tvalueFormatter = (value) => value.toLocaleString(\"en-NG\"),\n\tclassName,\n\t...props\n}: HeatmapChartProps) {\n\tconst resolvedSize = useComponentSize(size);\n\tconst layout = HEATMAP_CHART_LAYOUT[resolvedSize];\n\n\tconst rows = rowsProp ?? Array.from(new Set(data.map((d) => d.row)));\n\tconst columns = columnsProp ?? Array.from(new Set(data.map((d) => d.column)));\n\n\tconst valuesByKey = new Map(\n\t\tdata.map((datum) => [cellKey(datum.row, datum.column), datum.value]),\n\t);\n\n\tconst values = data.map((datum) => datum.value);\n\tconst domain: [number, number] = domainProp ?? [\n\t\tvalues.length ? Math.min(...values) : 0,\n\t\tvalues.length ? Math.max(...values) : 1,\n\t];\n\n\treturn (\n\t\t<ChartCard size={resolvedSize} className={className} {...props}>\n\t\t\t{(title != null || description != null) && (\n\t\t\t\t<ChartHeader>\n\t\t\t\t\t{title != null && <ChartTitle>{title}</ChartTitle>}\n\t\t\t\t\t{description != null && (\n\t\t\t\t\t\t<ChartDescription>{description}</ChartDescription>\n\t\t\t\t\t)}\n\t\t\t\t</ChartHeader>\n\t\t\t)}\n\t\t\t<div className=\"flex flex-col gap-3\">\n\t\t\t\t<div className=\"overflow-x-auto\">\n\t\t\t\t\t<div\n\t\t\t\t\t\tclassName=\"inline-grid\"\n\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\tgridTemplateColumns: `${layout.rowLabelWidth}px repeat(${columns.length}, ${layout.cellSize}px)`,\n\t\t\t\t\t\t\tgap: layout.gap,\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\t<span aria-hidden=\"true\" />\n\t\t\t\t\t\t{columns.map((column) => (\n\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\tkey={column}\n\t\t\t\t\t\t\t\tclassName=\"flex items-end justify-center truncate px-0.5 pb-1 text-fg-secondary\"\n\t\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t\tfontSize: layout.labelFontSize,\n\t\t\t\t\t\t\t\t\theight: layout.columnLabelHeight,\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\ttitle={column}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{column}\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t))}\n\t\t\t\t\t\t{rows.map((row) => (\n\t\t\t\t\t\t\t<Fragment key={row}>\n\t\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t\tclassName=\"flex items-center truncate pr-2 text-fg-secondary\"\n\t\t\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t\t\tfontSize: layout.labelFontSize,\n\t\t\t\t\t\t\t\t\t\theight: layout.cellSize,\n\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\ttitle={row}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{row}\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t{columns.map((column) => (\n\t\t\t\t\t\t\t\t\t<HeatmapChartCell\n\t\t\t\t\t\t\t\t\t\tkey={column}\n\t\t\t\t\t\t\t\t\t\trow={row}\n\t\t\t\t\t\t\t\t\t\tcolumn={column}\n\t\t\t\t\t\t\t\t\t\tvalue={valuesByKey.get(cellKey(row, column))}\n\t\t\t\t\t\t\t\t\t\tdomain={domain}\n\t\t\t\t\t\t\t\t\t\tlayout={layout}\n\t\t\t\t\t\t\t\t\t\tshowValue={showValues}\n\t\t\t\t\t\t\t\t\t\tvalueFormatter={valueFormatter}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t</Fragment>\n\t\t\t\t\t\t))}\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t{legend && (\n\t\t\t\t\t<HeatmapChartLegend\n\t\t\t\t\t\tdomain={domain}\n\t\t\t\t\t\tlayout={layout}\n\t\t\t\t\t\tvalueFormatter={valueFormatter}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t</ChartCard>\n\t);\n}\n\ntype HeatmapChartCellProps = {\n\trow: string;\n\tcolumn: string;\n\tvalue: number | undefined;\n\tdomain: readonly [number, number];\n\tlayout: HeatmapChartLayout;\n\tshowValue: boolean;\n\tvalueFormatter: (value: number) => string;\n};\n\n/**\n * One grid cell. Missing data (no matching datum for this row/column) renders\n * a dashed placeholder and is skipped from tab order — there is nothing to\n * announce or hover. A valued cell is a focusable, hoverable swatch: the\n * `aria-label` carries the row/column/value so screen readers get the exact\n * figure without relying on the visual tooltip, which mirrors it for sighted\n * hover/keyboard-focus use.\n */\nfunction HeatmapChartCell({\n\trow,\n\tcolumn,\n\tvalue,\n\tdomain,\n\tlayout,\n\tshowValue,\n\tvalueFormatter,\n}: HeatmapChartCellProps) {\n\tif (value == null) {\n\t\treturn (\n\t\t\t<span\n\t\t\t\tclassName=\"rounded-[4px] border border-line-subtle border-dashed\"\n\t\t\t\tstyle={{ width: layout.cellSize, height: layout.cellSize }}\n\t\t\t\ttitle={`${row} · ${column}: no data`}\n\t\t\t/>\n\t\t);\n\t}\n\n\tconst step = heatmapStep(value, domain);\n\tconst color = HEATMAP_CHART_PALETTE[step - 1];\n\tconst formatted = valueFormatter(value);\n\tconst label = `${row} · ${column}: ${formatted}`;\n\tconst textColor =\n\t\tstep >= 4 ? \"var(--color-fg-on-brand)\" : \"var(--color-fg-primary)\";\n\n\treturn (\n\t\t<button\n\t\t\ttype=\"button\"\n\t\t\tclassName=\"group/cell relative flex items-center justify-center rounded-[4px] outline-none focus-visible:shadow-[0px_0px_0px_2px_var(--color-line-focus)]\"\n\t\t\tstyle={{\n\t\t\t\twidth: layout.cellSize,\n\t\t\t\theight: layout.cellSize,\n\t\t\t\tbackgroundColor: color,\n\t\t\t}}\n\t\t\taria-label={label}\n\t\t>\n\t\t\t{showValue && (\n\t\t\t\t<span\n\t\t\t\t\tclassName=\"pointer-events-none tabular-nums\"\n\t\t\t\t\tstyle={{ fontSize: layout.valueFontSize, color: textColor }}\n\t\t\t\t>\n\t\t\t\t\t{formatted}\n\t\t\t\t</span>\n\t\t\t)}\n\t\t\t<span\n\t\t\t\trole=\"tooltip\"\n\t\t\t\tclassName=\"pointer-events-none absolute bottom-full left-1/2 z-10 mb-1.5 -translate-x-1/2 whitespace-nowrap rounded-md border border-line-subtle bg-surface-overlay px-2 py-1 text-fg-primary text-gdt-xs opacity-0 shadow-2 transition-opacity group-hover/cell:opacity-100 group-focus-visible/cell:opacity-100\"\n\t\t\t>\n\t\t\t\t{label}\n\t\t\t</span>\n\t\t</button>\n\t);\n}\n\ntype HeatmapChartLegendProps = {\n\tdomain: readonly [number, number];\n\tlayout: HeatmapChartLayout;\n\tvalueFormatter: (value: number) => string;\n};\n\n/** Sequential-scale legend — the opacity ramp bounded by the domain's min/max. */\nfunction HeatmapChartLegend({\n\tdomain,\n\tlayout,\n\tvalueFormatter,\n}: HeatmapChartLegendProps) {\n\treturn (\n\t\t<div\n\t\t\tclassName=\"flex items-center gap-2 text-fg-caption-placeholder\"\n\t\t\tstyle={{ fontSize: layout.labelFontSize }}\n\t\t>\n\t\t\t<span className=\"tabular-nums\">{valueFormatter(domain[0])}</span>\n\t\t\t<div className=\"flex overflow-hidden rounded-[3px]\">\n\t\t\t\t{HEATMAP_CHART_PALETTE.map((color) => (\n\t\t\t\t\t<span\n\t\t\t\t\t\tkey={color}\n\t\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\tbackgroundColor: color,\n\t\t\t\t\t\t\twidth: layout.legendSwatchSize,\n\t\t\t\t\t\t\theight: layout.legendSwatchSize / 2,\n\t\t\t\t\t\t}}\n\t\t\t\t\t/>\n\t\t\t\t))}\n\t\t\t</div>\n\t\t\t<span className=\"tabular-nums\">{valueFormatter(domain[1])}</span>\n\t\t</div>\n\t);\n}\n\nexport { HEATMAP_CHART_LAYOUT, HEATMAP_CHART_PALETTE, HeatmapChart };\nexport type {\n\tHeatmapChartCellDatum,\n\tHeatmapChartLayout,\n\tHeatmapChartProps,\n\tHeatmapChartSize,\n};\n"],"mappings":";;;;;;;;;;;;;AAGA,SAAS,gBAAgB;AAuLrB,SACmB,KADnB;AAjIJ,IAAM,wBAAwB;AAAA,EAC7B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD;AAmBA,IAAM,uBAAqE;AAAA,EAC1E,IAAI;AAAA,IACH,UAAU;AAAA,IACV,KAAK;AAAA,IACL,eAAe;AAAA,IACf,mBAAmB;AAAA,IACnB,eAAe;AAAA,IACf,eAAe;AAAA,IACf,kBAAkB;AAAA,EACnB;AAAA,EACA,IAAI;AAAA,IACH,UAAU;AAAA,IACV,KAAK;AAAA,IACL,eAAe;AAAA,IACf,mBAAmB;AAAA,IACnB,eAAe;AAAA,IACf,eAAe;AAAA,IACf,kBAAkB;AAAA,EACnB;AAAA,EACA,IAAI;AAAA,IACH,UAAU;AAAA,IACV,KAAK;AAAA,IACL,eAAe;AAAA,IACf,mBAAmB;AAAA,IACnB,eAAe;AAAA,IACf,eAAe;AAAA,IACf,kBAAkB;AAAA,EACnB;AACD;AAGA,SAAS,QAAQ,KAAa,QAAgB;AAC7C,SAAO,GAAG,GAAG,SAAI,MAAM;AACxB;AAGA,SAAS,YAAY,OAAe,QAAmC;AACtE,QAAM,CAAC,KAAK,GAAG,IAAI;AACnB,MAAI,OAAO,IAAK,QAAO,sBAAsB;AAC7C,QAAM,SAAS,QAAQ,QAAQ,MAAM;AACrC,QAAM,OAAO,KAAK,KAAK,QAAQ,sBAAsB,MAAM;AAC3D,SAAO,KAAK,IAAI,sBAAsB,QAAQ,KAAK,IAAI,GAAG,IAAI,CAAC;AAChE;AA6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ETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/infotip.tsx"],"sourcesContent":["\"use client\";\n\nimport { Popover as PopoverPrimitive } from \"@base-ui/react/popover\";\nimport { cn } from \"./lib/cn\";\n\nfunction Infotip({ ...props }: PopoverPrimitive.Root.Props) {\n\treturn <PopoverPrimitive.Root data-slot=\"infotip\" {...props} />;\n}\n\nfunction InfotipTrigger({ ...props }: PopoverPrimitive.Trigger.Props) {\n\treturn (\n\t\t<PopoverPrimitive.Trigger\n\t\t\tnativeButton={false}\n\t\t\tdata-slot=\"infotip-trigger\"\n\t\t\topenOnHover={true}\n\t\t\tdelay={100}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\ntype InfotipContentProps = PopoverPrimitive.Popup.Props &\n\tPick<\n\t\tPopoverPrimitive.Positioner.Props,\n\t\t\"align\" | \"alignOffset\" | \"side\" | \"sideOffset\"\n\t> &\n\tPick<PopoverPrimitive.Portal.Props, \"container\"> & {\n\t\tshowArrow?: boolean;\n\t};\n\nfunction InfotipContent({\n\tclassName,\n\tcontainer,\n\tside = \"top\",\n\tsideOffset = 6,\n\talign = \"center\",\n\talignOffset = 0,\n\tshowArrow = true,\n\tchildren,\n\t...props\n}: InfotipContentProps) {\n\treturn (\n\t\t<PopoverPrimitive.Portal container={container}>\n\t\t\t<PopoverPrimitive.Positioner\n\t\t\t\talign={align}\n\t\t\t\talignOffset={alignOffset}\n\t\t\t\tside={side}\n\t\t\t\tsideOffset={sideOffset}\n\t\t\t\tclassName=\"isolate z-50\"\n\t\t\t>\n\t\t\t\t<PopoverPrimitive.Popup\n\t\t\t\t\tdata-slot=\"infotip-content\"\n\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\"z-50 relative inline-flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-[6px] border border-line bg-surface-overlay px-3 py-2 text-gdt-sm font-medium text-fg-primary shadow-2 duration-100 has-data-[slot=kbd]:pr-1.5 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-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm 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\",\n\t\t\t\t\t\tclassName,\n\t\t\t\t\t)}\n\t\t\t\t\t{...props}\n\t\t\t\t>\n\t\t\t\t\t{children}\n\t\t\t\t\t{showArrow ? (\n\t\t\t\t\t\t<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)]\" />\n\t\t\t\t\t) : null}\n\t\t\t\t</PopoverPrimitive.Popup>\n\t\t\t</PopoverPrimitive.Positioner>\n\t\t</PopoverPrimitive.Portal>\n\t);\n}\n\nexport { Infotip, InfotipTrigger, InfotipContent };\n"],"mappings":";;;;;;AAEA,SAAS,WAAW,wBAAwB;AAIpC,cA4CJ,YA5CI;AADR,SAAS,QAAQ,EAAE,GAAG,MAAM,GAAgC;AAC3D,SAAO,oBAAC,iBAAiB,MAAjB,EAAsB,aAAU,WAAW,GAAG,OAAO;AAC9D;AAEA,SAAS,eAAe,EAAE,GAAG,MAAM,GAAmC;AACrE,SACC;AAAA,IAAC,iBAAiB;AAAA,IAAjB;AAAA,MACA,cAAc;AAAA,MACd,aAAU;AAAA,MACV,aAAa;AAAA,MACb,OAAO;AAAA,MACN,GAAG;AAAA;AAAA,EACL;AAEF;AAWA,SAAS,eAAe;AAAA,EACvB;AAAA,EACA;AAAA,EACA,OAAO;AAAA,EACP,aAAa;AAAA,EACb,QAAQ;AAAA,EACR,cAAc;AAAA,EACd,YAAY;AAAA,EACZ;AAAA,EACA,GAAG;AACJ,GAAwB;AACvB,SACC,oBAAC,iBAAiB,QAAjB,EAAwB,WACxB;AAAA,IAAC,iBAAiB;AAAA,IAAjB;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,WAAU;AAAA,MAEV;AAAA,QAAC,iBAAiB;AAAA,QAAjB;AAAA,UACA,aAAU;AAAA,UACV,WAAW;AAAA,YACV;AAAA,YACA;AAAA,UACD;AAAA,UACC,GAAG;AAAA,UAEH;AAAA;AAAA,YACA,YACA,oBAAC,iBAAiB,OAAjB,EAAuB,WAAU,meAAke,IACjgB;AAAA;AAAA;AAAA,MACL;AAAA;AAAA,EACD,GACD;AAEF;","names":[]}
|
package/dist/input-group.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/dist/input.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/dist/item.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/item.tsx"],"sourcesContent":["import { mergeProps, useRender } from \"@base-ui/react\";\nimport { cn } from \"./lib/cn\";\n\nfunction Item({\n\tclassName,\n\trender,\n\t...props\n}: useRender.ComponentProps<\"div\">) {\n\treturn useRender({\n\t\tdefaultTagName: \"div\",\n\t\tprops: mergeProps<\"div\">(\n\t\t\t{\n\t\t\t\tclassName: cn(\"flex flex-col gap-1\", className),\n\t\t\t},\n\t\t\tprops,\n\t\t),\n\t\trender,\n\t});\n}\n\nfunction ItemLabel({\n\tclassName,\n\trender,\n\t...props\n}: useRender.ComponentProps<\"div\">) {\n\treturn useRender({\n\t\tdefaultTagName: \"div\",\n\t\tprops: mergeProps<\"div\">(\n\t\t\t{\n\t\t\t\tclassName: cn(\"text-gdt-sm text-fg-secondary\", className),\n\t\t\t},\n\t\t\tprops,\n\t\t),\n\t\trender,\n\t});\n}\n\nfunction ItemValue({\n\tclassName,\n\trender,\n\t...props\n}: useRender.ComponentProps<\"div\">) {\n\treturn useRender({\n\t\tdefaultTagName: \"div\",\n\t\tprops: mergeProps<\"div\">(\n\t\t\t{\n\t\t\t\tclassName: cn(\n\t\t\t\t\t\"text-gdt-sm font-semibold text-fg-primary [a]:text-fg-brand [&_a]:text-fg-brand\",\n\t\t\t\t\tclassName,\n\t\t\t\t),\n\t\t\t},\n\t\t\tprops,\n\t\t),\n\t\trender,\n\t});\n}\n\nexport { Item, ItemLabel, ItemValue };\n"],"mappings":";;;;;AAAA,SAAS,YAAY,iBAAiB;AAGtC,SAAS,KAAK;AAAA,EACb;AAAA,EACA;AAAA,EACA,GAAG;AACJ,GAAoC;AACnC,SAAO,UAAU;AAAA,IAChB,gBAAgB;AAAA,IAChB,OAAO;AAAA,MACN;AAAA,QACC,WAAW,GAAG,uBAAuB,SAAS;AAAA,MAC/C;AAAA,MACA;AAAA,IACD;AAAA,IACA;AAAA,EACD,CAAC;AACF;AAEA,SAAS,UAAU;AAAA,EAClB;AAAA,EACA;AAAA,EACA,GAAG;AACJ,GAAoC;AACnC,SAAO,UAAU;AAAA,IAChB,gBAAgB;AAAA,IAChB,OAAO;AAAA,MACN;AAAA,QACC,WAAW,GAAG,kCAAkC,SAAS;AAAA,MAC1D;AAAA,MACA;AAAA,IACD;AAAA,IACA;AAAA,EACD,CAAC;AACF;AAEA,SAAS,UAAU;AAAA,EAClB;AAAA,EACA;AAAA,EACA,GAAG;AACJ,GAAoC;AACnC,SAAO,UAAU;AAAA,IAChB,gBAAgB;AAAA,IAChB,OAAO;AAAA,MACN;AAAA,QACC,WAAW;AAAA,UACV;AAAA,UACA;AAAA,QACD;AAAA,MACD;AAAA,MACA;AAAA,IACD;AAAA,IACA;AAAA,EACD,CAAC;AACF;","names":[]}
|
package/dist/kpi-card.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/kpi-card.tsx"],"sourcesContent":["import { mergeProps } from \"@base-ui/react/merge-props\";\nimport { useRender } from \"@base-ui/react/use-render\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { ArrowDown, ArrowUp, ArrowUpRight } from \"lucide-react\";\nimport { cn } from \"./lib/cn\";\nimport { Skeleton } from \"./skeleton\";\n\nfunction KpiCard({\n\tclassName,\n\tloading = false,\n\trender,\n\t...props\n}: useRender.ComponentProps<\"article\"> & { loading?: boolean }) {\n\treturn useRender({\n\t\tdefaultTagName: \"article\",\n\t\tprops: mergeProps<\"article\">(\n\t\t\t{\n\t\t\t\t\"aria-busy\": loading || undefined,\n\t\t\t\tclassName: cn(\n\t\t\t\t\t\"group/kpi-card relative flex w-full min-w-0 flex-col gap-4 rounded-xl p-5 text-fg-primary transition-[background-color,border-color,box-shadow,transform] outline-none border border-line-subtle shadow-1\",\n\t\t\t\t\tclassName,\n\t\t\t\t),\n\t\t\t},\n\t\t\tprops,\n\t\t),\n\t\trender,\n\t\tstate: {\n\t\t\tslot: \"kpi-card\",\n\t\t\tloading,\n\t\t},\n\t});\n}\n\nfunction KpiCardTitle({\n\tclassName,\n\trender,\n\t...props\n}: useRender.ComponentProps<\"h3\">) {\n\treturn useRender({\n\t\tdefaultTagName: \"h3\",\n\t\tprops: mergeProps<\"h3\">(\n\t\t\t{\n\t\t\t\tclassName: cn(\n\t\t\t\t\t\"min-w-0 pr-gdt-xl text-gdt-sm font-semibold capitalized text-fg-secondary\",\n\t\t\t\t\tclassName,\n\t\t\t\t),\n\t\t\t},\n\t\t\tprops,\n\t\t),\n\t\trender,\n\t});\n}\n\nfunction KpiCardLinkOutIcon({\n\tchildren,\n\tclassName,\n\trender,\n\t...props\n}: useRender.ComponentProps<\"span\">) {\n\treturn useRender({\n\t\tdefaultTagName: \"span\",\n\t\tprops: mergeProps<\"span\">(\n\t\t\t{\n\t\t\t\t\"aria-hidden\": true,\n\t\t\t\tclassName: cn(\n\t\t\t\t\t\"pointer-events-none absolute right-gdt-md top-gdt-md inline-flex size-4 shrink-0 items-center justify-center text-fg-secondary [&>svg]:size-4 [&>svg]:shrink-0\",\n\t\t\t\t\tclassName,\n\t\t\t\t),\n\t\t\t\tchildren: children ?? <ArrowUpRight aria-hidden=\"true\" />,\n\t\t\t},\n\t\t\tprops,\n\t\t),\n\t\trender,\n\t});\n}\n\nfunction KpiCardValue({\n\tclassName,\n\trender,\n\t...props\n}: useRender.ComponentProps<\"p\">) {\n\treturn useRender({\n\t\tdefaultTagName: \"p\",\n\t\tprops: mergeProps<\"p\">(\n\t\t\t{\n\t\t\t\tclassName: cn(\n\t\t\t\t\t\"text-gdt-h3 font-extrabold text-fg-primary group-aria-busy/kpi-card:hidden\",\n\t\t\t\t\tclassName,\n\t\t\t\t),\n\t\t\t},\n\t\t\tprops,\n\t\t),\n\t\trender,\n\t});\n}\n\nfunction KpiCardValueSkeleton({\n\tclassName,\n\t...props\n}: React.ComponentProps<typeof Skeleton>) {\n\treturn (\n\t\t<Skeleton\n\t\t\tclassName={cn(\n\t\t\t\t\"hidden h-8 mt-2 md:mt-3 w-24 rounded-md group-aria-busy/kpi-card:block\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nconst kpiCardTrendVariants = cva(\n\t\"flex min-w-0 items-center gap-1.5 text-gdt-capitalized\",\n\t{\n\t\tvariants: {\n\t\t\tdirection: {\n\t\t\t\tup: \"text-status-success\",\n\t\t\t\tdown: \"text-status-danger\",\n\t\t\t},\n\t\t},\n\t\tdefaultVariants: {\n\t\t\tdirection: \"up\",\n\t\t},\n\t},\n);\n\ntype KpiCardTrendProps = useRender.ComponentProps<\"p\"> &\n\tVariantProps<typeof kpiCardTrendVariants> & {\n\t\tshowIcon?: boolean;\n\t};\n\nfunction KpiCardTrend({\n\tchildren,\n\tclassName,\n\tdirection = \"up\",\n\trender,\n\tshowIcon = true,\n\t...props\n}: KpiCardTrendProps) {\n\tconst Icon = direction === \"down\" ? ArrowDown : ArrowUp;\n\n\treturn useRender({\n\t\tdefaultTagName: \"p\",\n\t\tprops: mergeProps<\"p\">(\n\t\t\t{\n\t\t\t\tclassName: cn(kpiCardTrendVariants({ direction }), className),\n\t\t\t\tchildren: (\n\t\t\t\t\t<>\n\t\t\t\t\t\t{showIcon ? (\n\t\t\t\t\t\t\t<Icon aria-hidden=\"true\" className=\"size-3 shrink-0\" />\n\t\t\t\t\t\t) : null}\n\t\t\t\t\t\t{children}\n\t\t\t\t\t</>\n\t\t\t\t),\n\t\t\t},\n\t\t\tprops,\n\t\t),\n\t\trender,\n\t\tstate: {\n\t\t\tdirection,\n\t\t\tshowIcon,\n\t\t\tslot: \"kpi-card-trend\",\n\t\t},\n\t});\n}\n\nfunction KpiCardTrendValue({\n\tclassName,\n\trender,\n\t...props\n}: useRender.ComponentProps<\"span\">) {\n\treturn useRender({\n\t\tdefaultTagName: \"span\",\n\t\tprops: mergeProps<\"span\">(\n\t\t\t{\n\t\t\t\tclassName: cn(\"text-gdt-sm text-current font-semibold\", className),\n\t\t\t},\n\t\t\tprops,\n\t\t),\n\t\trender,\n\t});\n}\n\nfunction KpiCardTrendCaption({\n\tclassName,\n\trender,\n\t...props\n}: useRender.ComponentProps<\"span\">) {\n\treturn useRender({\n\t\tdefaultTagName: \"span\",\n\t\tprops: mergeProps<\"span\">(\n\t\t\t{\n\t\t\t\tclassName: cn(\n\t\t\t\t\t\"min-w-0 truncate text-gdt-xs text-fg-secondary font-normal\",\n\t\t\t\t\tclassName,\n\t\t\t\t),\n\t\t\t},\n\t\t\tprops,\n\t\t),\n\t\trender,\n\t});\n}\n\n/**\n * Composition examples:\n *\n * <KpiCard>\n * <KpiCardTitle>Total Revenue</KpiCardTitle>\n * <KpiCardValue>$1.25M</KpiCardValue>\n * <KpiCardTrend>\n * <KpiCardTrendValue>+12.5%</KpiCardTrendValue>\n * <KpiCardTrendCaption>vs last month</KpiCardTrendCaption>\n * </KpiCardTrend>\n * </KpiCard>\n *\n * <KpiCard interactive render={<a href=\"/reports\" aria-label=\"View revenue report\" />}>\n * <KpiCardLinkOutIcon />\n * <KpiCardTitle>Total Revenue</KpiCardTitle>\n * <KpiCardValue>$1.25M</KpiCardValue>\n * </KpiCard>\n *\n * <KpiCard loading>\n * <KpiCardTitle>Total Revenue</KpiCardTitle>\n * <KpiCardValue>$1.25M</KpiCardValue>\n * <KpiCardValueSkeleton />\n * </KpiCard>\n */\nexport {\n\tKpiCard,\n\tKpiCardLinkOutIcon,\n\tKpiCardTitle,\n\tKpiCardTrend,\n\tKpiCardTrendCaption,\n\tKpiCardTrendValue,\n\tKpiCardValue,\n\tKpiCardValueSkeleton,\n\tkpiCardTrendVariants,\n};\n"],"mappings":";;;;;;;;AAAA,SAAS,kBAAkB;AAC3B,SAAS,iBAAiB;AAC1B,SAAS,WAA8B;AACvC,SAAS,WAAW,SAAS,oBAAoB;AAiEvB,SA+ErB,UA/EqB,KA+ErB,YA/EqB;AA7D1B,SAAS,QAAQ;AAAA,EAChB;AAAA,EACA,UAAU;AAAA,EACV;AAAA,EACA,GAAG;AACJ,GAAgE;AAC/D,SAAO,UAAU;AAAA,IAChB,gBAAgB;AAAA,IAChB,OAAO;AAAA,MACN;AAAA,QACC,aAAa,WAAW;AAAA,QACxB,WAAW;AAAA,UACV;AAAA,UACA;AAAA,QACD;AAAA,MACD;AAAA,MACA;AAAA,IACD;AAAA,IACA;AAAA,IACA,OAAO;AAAA,MACN,MAAM;AAAA,MACN;AAAA,IACD;AAAA,EACD,CAAC;AACF;AAEA,SAAS,aAAa;AAAA,EACrB;AAAA,EACA;AAAA,EACA,GAA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Z;AAAA,EACA,WAAW;AAAA,EACX,GAAG;AACJ,GAAsB;AACrB,QAAM,OAAO,cAAc,SAAS,YAAY;AAEhD,SAAO,UAAU;AAAA,IAChB,gBAAgB;AAAA,IAChB,OAAO;AAAA,MACN;AAAA,QACC,WAAW,GAAG,qBAAqB,EAAE,UAAU,CAAC,GAAG,SAAS;AAAA,QAC5D,UACC,iCACE;AAAA,qBACA,oBAAC,QAAK,eAAY,QAAO,WAAU,mBAAkB,IAClD;AAAA,UACH;AAAA,WACF;AAAA,MAEF;AAAA,MACA;AAAA,IACD;AAAA,IACA;AAAA,IACA,OAAO;AAAA,MACN;AAAA,MACA;AAAA,MACA,MAAM;AAAA,IACP;AAAA,EACD,CAAC;AACF;AAEA,SAAS,kBAAkB;AAAA,EAC1B;AAAA,EACA;AAAA,EACA,GAAG;AACJ,GAAqC;AACpC,SAAO,UAAU;AAAA,IAChB,gBAAgB;AAAA,IAChB,OAAO;AAAA,MACN;AAAA,QACC,WAAW,GAAG,0CAA0C,SAAS;AAAA,MAClE;AAAA,MACA;AAAA,IACD;AAAA,IACA;AAAA,EACD,CAAC;AACF;AAEA,SAAS,oBAAoB;AAAA,EAC5B;AAAA,EACA;AAAA,EACA,GAAG;AACJ,GAAqC;AACpC,SAAO,UAAU;AAAA,IAChB,gBAAgB;AAAA,IAChB,OAAO;AAAA,MACN;AAAA,QACC,WAAW;AAAA,UACV;AAAA,UACA;AAAA,QACD;AAAA,MACD;AAAA,MACA;AAAA,IACD;AAAA,IACA;AAAA,EACD,CAAC;AACF;","names":[]}
|
package/dist/label.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|