@eodparks/ui 0.0.0-stage → 0.2.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.
Files changed (176) hide show
  1. package/LICENSE +21 -0
  2. package/dist/accordion.d.ts +36 -0
  3. package/dist/accordion.js +57 -0
  4. package/dist/alert-dialog.d.ts +50 -0
  5. package/dist/alert-dialog.js +149 -0
  6. package/dist/alert.d.ts +23 -0
  7. package/dist/alert.js +87 -0
  8. package/dist/avatar.d.ts +35 -0
  9. package/dist/avatar.js +118 -0
  10. package/dist/badge.d.ts +27 -0
  11. package/dist/badge.js +148 -0
  12. package/dist/button-C2CCxHu1.d.ts +15 -0
  13. package/dist/button-DEsRlveL.js +86 -0
  14. package/dist/button.d.ts +2 -0
  15. package/dist/button.js +1 -0
  16. package/dist/calendar-DhsRPq2D.d.ts +23 -0
  17. package/dist/calendar-kbn4gZ1a.js +110 -0
  18. package/dist/calendar.d.ts +2 -0
  19. package/dist/calendar.js +1 -0
  20. package/dist/card-tkP52GwZ.js +77 -0
  21. package/dist/card.d.ts +18 -0
  22. package/dist/card.js +1 -0
  23. package/dist/chart.d.ts +52 -0
  24. package/dist/chart.js +163 -0
  25. package/dist/checkbox.d.ts +7 -0
  26. package/dist/checkbox.js +26 -0
  27. package/dist/cn-B-fHM4Ov.js +12 -0
  28. package/dist/collapsible.d.ts +10 -0
  29. package/dist/collapsible.js +23 -0
  30. package/dist/command.d.ts +38 -0
  31. package/dist/command.js +124 -0
  32. package/dist/date-picker.d.ts +46 -0
  33. package/dist/date-picker.js +159 -0
  34. package/dist/dialog-JjpMFEDR.js +117 -0
  35. package/dist/dialog.d.ts +2 -0
  36. package/dist/dialog.js +3 -0
  37. package/dist/dropdown-menu-B_VG1VXX.js +116 -0
  38. package/dist/dropdown-menu-CZ8xcq1d.d.ts +38 -0
  39. package/dist/dropdown-menu.d.ts +2 -0
  40. package/dist/dropdown-menu.js +1 -0
  41. package/dist/empty-state-B11Uq0U_.js +66 -0
  42. package/dist/empty-state.d.ts +15 -0
  43. package/dist/empty-state.js +1 -0
  44. package/dist/error-state.d.ts +48 -0
  45. package/dist/error-state.js +139 -0
  46. package/dist/field-Cwhz73-_.d.ts +15 -0
  47. package/dist/field-D-n7O1n6.js +63 -0
  48. package/dist/field.d.ts +2 -0
  49. package/dist/field.js +1 -0
  50. package/dist/focus-ring-BpxMbGAn.js +3 -0
  51. package/dist/form-actions.d.ts +21 -0
  52. package/dist/form-actions.js +41 -0
  53. package/dist/forms/formik.d.ts +20 -0
  54. package/dist/forms/formik.js +50 -0
  55. package/dist/forms/rhf.d.ts +32 -0
  56. package/dist/forms/rhf.js +114 -0
  57. package/dist/icon-button-XAjcFsZ2.js +14 -0
  58. package/dist/icon-button.d.ts +9 -0
  59. package/dist/icon-button.js +1 -0
  60. package/dist/icon.d.ts +15 -0
  61. package/dist/icon.js +21 -0
  62. package/dist/index-Ct4mPvuB.d.ts +29 -0
  63. package/dist/input-BxjcqQS1.js +49 -0
  64. package/dist/input-group.d.ts +12 -0
  65. package/dist/input-group.js +26 -0
  66. package/dist/input.d.ts +15 -0
  67. package/dist/input.js +1 -0
  68. package/dist/label-BrOAJU1p.js +31 -0
  69. package/dist/label-CUAiaBbm.d.ts +13 -0
  70. package/dist/label.d.ts +2 -0
  71. package/dist/label.js +1 -0
  72. package/dist/native-select.d.ts +8 -0
  73. package/dist/native-select.js +41 -0
  74. package/dist/page-header.d.ts +19 -0
  75. package/dist/page-header.js +51 -0
  76. package/dist/pagination.d.ts +47 -0
  77. package/dist/pagination.js +131 -0
  78. package/dist/password-input.d.ts +14 -0
  79. package/dist/password-input.js +41 -0
  80. package/dist/popover.d.ts +19 -0
  81. package/dist/popover.js +54 -0
  82. package/dist/popup-CLsuJ-AA.js +6 -0
  83. package/dist/progress.d.ts +8 -0
  84. package/dist/progress.js +36 -0
  85. package/dist/radio-group.d.ts +14 -0
  86. package/dist/radio-group.js +25 -0
  87. package/dist/scroll-area.d.ts +16 -0
  88. package/dist/scroll-area.js +52 -0
  89. package/dist/select-Cq_JDuYO.js +266 -0
  90. package/dist/select.d.ts +40 -0
  91. package/dist/select.js +1 -0
  92. package/dist/separator.d.ts +8 -0
  93. package/dist/separator.js +38 -0
  94. package/dist/sheet.d.ts +27 -0
  95. package/dist/sheet.js +95 -0
  96. package/dist/skeleton.d.ts +19 -0
  97. package/dist/skeleton.js +45 -0
  98. package/dist/spinner.d.ts +13 -0
  99. package/dist/spinner.js +44 -0
  100. package/dist/switch.d.ts +7 -0
  101. package/dist/switch.js +19 -0
  102. package/dist/table.d.ts +24 -0
  103. package/dist/table.js +75 -0
  104. package/dist/tabs.d.ts +24 -0
  105. package/dist/tabs.js +74 -0
  106. package/dist/textarea.d.ts +5 -0
  107. package/dist/textarea.js +15 -0
  108. package/dist/theme-toggle.d.ts +11 -0
  109. package/dist/theme-toggle.js +50 -0
  110. package/dist/toast.d.ts +12 -0
  111. package/dist/toast.js +105 -0
  112. package/dist/tooltip-BsVKZDXs.js +47 -0
  113. package/dist/tooltip.d.ts +18 -0
  114. package/dist/tooltip.js +1 -0
  115. package/dist/typography-Dy3PCTrL.js +34 -0
  116. package/dist/typography.d.ts +11 -0
  117. package/dist/typography.js +1 -0
  118. package/dist/visually-hidden-BrCs6ZEy.js +11 -0
  119. package/dist/visually-hidden.d.ts +3 -0
  120. package/dist/visually-hidden.js +1 -0
  121. package/docs/accessibility.md +95 -0
  122. package/docs/accordion.md +89 -0
  123. package/docs/alert-dialog.md +157 -0
  124. package/docs/alert.md +70 -0
  125. package/docs/avatar.md +57 -0
  126. package/docs/badge.md +51 -0
  127. package/docs/button.md +121 -0
  128. package/docs/calendar.md +116 -0
  129. package/docs/card.md +74 -0
  130. package/docs/chart.md +93 -0
  131. package/docs/checkbox.md +119 -0
  132. package/docs/collapsible.md +76 -0
  133. package/docs/command.md +114 -0
  134. package/docs/date-picker.md +177 -0
  135. package/docs/dialog.md +110 -0
  136. package/docs/dropdown-menu.md +126 -0
  137. package/docs/empty-state.md +65 -0
  138. package/docs/error-state.md +59 -0
  139. package/docs/field.md +54 -0
  140. package/docs/form-actions.md +55 -0
  141. package/docs/forms/formik.md +42 -0
  142. package/docs/forms/rhf.md +64 -0
  143. package/docs/icon-button.md +84 -0
  144. package/docs/icon.md +77 -0
  145. package/docs/input-group.md +47 -0
  146. package/docs/input.md +46 -0
  147. package/docs/label.md +33 -0
  148. package/docs/layout.md +102 -0
  149. package/docs/llms.txt +72 -0
  150. package/docs/native-select.md +87 -0
  151. package/docs/page-header.md +61 -0
  152. package/docs/pagination.md +107 -0
  153. package/docs/password-input.md +30 -0
  154. package/docs/popover.md +103 -0
  155. package/docs/progress.md +53 -0
  156. package/docs/radio-group.md +119 -0
  157. package/docs/scroll-area.md +85 -0
  158. package/docs/select.md +106 -0
  159. package/docs/separator.md +38 -0
  160. package/docs/sheet.md +118 -0
  161. package/docs/skeleton.md +50 -0
  162. package/docs/spinner.md +46 -0
  163. package/docs/switch.md +92 -0
  164. package/docs/table.md +87 -0
  165. package/docs/tabs.md +96 -0
  166. package/docs/textarea.md +38 -0
  167. package/docs/theme-toggle.md +76 -0
  168. package/docs/toast.md +95 -0
  169. package/docs/tooltip.md +101 -0
  170. package/docs/typography.md +96 -0
  171. package/docs/visually-hidden.md +44 -0
  172. package/layer.css +22 -0
  173. package/package.json +275 -3
  174. package/skills/eod-ui/SKILL.md +37 -0
  175. package/styles.css +2 -0
  176. package/README.md +0 -3
package/dist/chart.js ADDED
@@ -0,0 +1,163 @@
1
+ import { renderElement } from "@ui-sdk/react/primitive";
2
+ import { LoaderCircleIcon } from "lucide-react";
3
+ import { createContext, useContext, useId, useState, useSyncExternalStore } from "react";
4
+ import { Legend, ResponsiveContainer, Tooltip } from "recharts";
5
+ import { n as withBase, t as cn } from "./cn-B-fHM4Ov.js";
6
+ import { n as textVariants } from "./typography-Dy3PCTrL.js";
7
+ import { t as VisuallyHidden } from "./visually-hidden-BrCs6ZEy.js";
8
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
9
+ // src/chart/chart.tsx
10
+ const ChartContext = createContext(null);
11
+ function useChart() {
12
+ const context = useContext(ChartContext);
13
+ if (!context) throw new Error("Chart parts must sit inside ChartContainer");
14
+ return context;
15
+ }
16
+ /** The colours charts draw with: one hue each for categories, one ramp for ordered values. */
17
+ const chartPalette = {
18
+ categorical: Array.from({ length: 8 }, (_, index) => `var(--chart-cat-${index + 1})`),
19
+ sequential: [
20
+ 0,
21
+ 15,
22
+ 30,
23
+ 45,
24
+ 60
25
+ ].map((share) => share === 0 ? "var(--chart-cat-1)" : `color-mix(in oklab, var(--chart-cat-1), var(--foreground) ${share}%)`)
26
+ };
27
+ const query = "(prefers-reduced-motion: reduce)";
28
+ const subscribe = (notify) => {
29
+ const media = window.matchMedia(query);
30
+ media.addEventListener("change", notify);
31
+ return () => media.removeEventListener("change", notify);
32
+ };
33
+ /** Spread onto a series (`<Bar {...useChartMotion()} />`) so it does not animate under reduced motion. */
34
+ function useChartMotion() {
35
+ return { isAnimationActive: !useSyncExternalStore(subscribe, () => window.matchMedia(query).matches, () => true) };
36
+ }
37
+ const chartStyles = cn("flex w-full justify-center rounded-item text-xs", "has-focus-visible:ring-(length:--focus-ring-width) has-focus-visible:ring-ring has-focus-visible:ring-offset-[length:var(--focus-ring-offset)] has-focus-visible:ring-offset-background", "[&_.recharts-cartesian-axis-tick-value]:fill-muted-foreground!", "[&_.recharts-label]:fill-muted-foreground!", "[&_.recharts-cartesian-grid_line]:stroke-border!", "[&_.recharts-curve.recharts-tooltip-cursor]:stroke-border", "[&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted", "[&_.recharts-sector]:outline-hidden [&_.recharts-surface]:outline-hidden");
38
+ function ChartContainer({ config, description, loading, empty, loadingLabel = "Loading", emptyLabel = "No data", children, render, className, style, onKeyDown, onPointerMove, onBlur, ...props }) {
39
+ const describedBy = useId();
40
+ const [dismissed, setDismissed] = useState(false);
41
+ const colours = Object.fromEntries(Object.entries(config).flatMap(([key, { color }]) => color ? [[`--color-${key}`, color]] : []));
42
+ const state = loading ? "loading" : empty ? "empty" : void 0;
43
+ return /* @__PURE__ */ jsx(ChartContext.Provider, {
44
+ value: {
45
+ config,
46
+ dismissed
47
+ },
48
+ children: renderElement("div", {
49
+ role: "group",
50
+ "aria-describedby": description ? describedBy : void 0,
51
+ ...props,
52
+ onKeyDown: (event) => {
53
+ onKeyDown?.(event);
54
+ setDismissed(event.key === "Escape");
55
+ },
56
+ onPointerMove: (event) => {
57
+ onPointerMove?.(event);
58
+ setDismissed(false);
59
+ },
60
+ onBlur: (event) => {
61
+ onBlur?.(event);
62
+ setDismissed(false);
63
+ },
64
+ "data-slot": "chart",
65
+ "data-state": state,
66
+ "aria-busy": loading || void 0,
67
+ style: {
68
+ ...colours,
69
+ ...style
70
+ },
71
+ className: withBase(`aspect-video ${chartStyles}`, className),
72
+ children: /* @__PURE__ */ jsxs(Fragment, { children: [description && /* @__PURE__ */ jsx(VisuallyHidden, {
73
+ id: describedBy,
74
+ children: description
75
+ }), loading ? /* @__PURE__ */ jsxs("output", {
76
+ "data-slot": "chart-loading",
77
+ className: "flex size-full animate-pulse items-center justify-center rounded-item bg-muted motion-reduce:animate-none",
78
+ children: [/* @__PURE__ */ jsx(LoaderCircleIcon, {
79
+ "aria-hidden": "true",
80
+ className: "size-4 animate-spin text-muted-foreground motion-reduce:animate-none"
81
+ }), /* @__PURE__ */ jsx(VisuallyHidden, { children: loadingLabel })]
82
+ }) : empty ? /* @__PURE__ */ jsx("div", {
83
+ "data-slot": "chart-empty",
84
+ className: `flex size-full items-center justify-center rounded-item border border-dashed text-center ${textVariants({ variant: "small" })} text-muted-foreground`,
85
+ children: emptyLabel
86
+ }) : /* @__PURE__ */ jsx(ResponsiveContainer, {
87
+ width: "100%",
88
+ height: "100%",
89
+ children
90
+ })] })
91
+ }, render)
92
+ });
93
+ }
94
+ const ChartTooltip = Tooltip;
95
+ function ChartLegend(props) {
96
+ return /* @__PURE__ */ jsx(Legend, {
97
+ itemSorter: null,
98
+ ...props
99
+ });
100
+ }
101
+ function Swatch({ color, indicator = "dot" }) {
102
+ return /* @__PURE__ */ jsx("span", {
103
+ "aria-hidden": "true",
104
+ "data-slot": "chart-swatch",
105
+ "data-indicator": indicator,
106
+ style: indicator === "dot" ? { backgroundColor: color } : { borderColor: color },
107
+ className: cn("shrink-0", indicator === "dot" && "size-2.5 rounded-[2px]", indicator === "line" && "h-3 w-1 rounded-[2px] border-s-4", indicator === "dashed" && "h-3 w-0 border-s-2 border-dashed")
108
+ });
109
+ }
110
+ function ChartTooltipContent({ active, payload, label, hideLabel, indicator, nameKey, labelFormatter, valueFormatter = (value) => typeof value === "number" ? value.toLocaleString() : String(value), className }) {
111
+ const { config, dismissed } = useChart();
112
+ if (!active || dismissed || !payload?.length) return null;
113
+ const heading = labelFormatter ? labelFormatter(label) : label;
114
+ return /* @__PURE__ */ jsxs("div", {
115
+ "data-slot": "chart-tooltip",
116
+ className: cn(`grid min-w-32 gap-1.5 rounded-popup border bg-popover p-2 text-popover-foreground shadow-md ${textVariants({ variant: "small" })}`, className),
117
+ children: [!hideLabel && heading ? /* @__PURE__ */ jsx("div", {
118
+ className: "font-medium",
119
+ children: heading
120
+ }) : null, /* @__PURE__ */ jsx("ul", {
121
+ className: "grid gap-1",
122
+ children: payload.map((item) => {
123
+ const key = String((nameKey && item.payload?.[nameKey]) ?? item.dataKey ?? item.name ?? "value");
124
+ const entry = config[key];
125
+ return /* @__PURE__ */ jsxs("li", {
126
+ className: "flex items-center gap-2",
127
+ children: [
128
+ /* @__PURE__ */ jsx(Swatch, {
129
+ color: entry?.color ?? item.payload?.fill ?? item.color,
130
+ indicator
131
+ }),
132
+ /* @__PURE__ */ jsx("span", {
133
+ className: "text-muted-foreground",
134
+ children: entry?.label ?? item.name ?? key
135
+ }),
136
+ /* @__PURE__ */ jsx("span", {
137
+ className: "ms-auto font-medium tabular-nums",
138
+ children: item.value === void 0 ? null : valueFormatter(item.value)
139
+ })
140
+ ]
141
+ }, `${item.graphicalItemId}-${key}`);
142
+ })
143
+ })]
144
+ });
145
+ }
146
+ function ChartLegendContent({ payload, verticalAlign, nameKey, className }) {
147
+ const { config } = useChart();
148
+ if (!payload?.length) return null;
149
+ return /* @__PURE__ */ jsx("ul", {
150
+ "data-slot": "chart-legend",
151
+ className: cn(`flex flex-wrap items-center justify-center gap-4 ${textVariants({ variant: "small" })}`, verticalAlign === "top" ? "pb-3" : "pt-3", className),
152
+ children: payload.map((item) => {
153
+ const data = item.payload;
154
+ const key = String((nameKey && data?.[nameKey]) ?? item.dataKey ?? item.value ?? "value");
155
+ const entry = config[key];
156
+ return /* @__PURE__ */ jsxs("li", {
157
+ className: "flex items-center gap-1.5",
158
+ children: [/* @__PURE__ */ jsx(Swatch, { color: entry?.color ?? item.color }), entry?.label ?? item.value]
159
+ }, `${key}-${item.value}`);
160
+ })
161
+ });
162
+ }
163
+ export { ChartContainer, ChartLegend, ChartLegendContent, ChartTooltip, ChartTooltipContent, chartPalette, useChartMotion };
@@ -0,0 +1,7 @@
1
+ import { Checkbox as Checkbox$1, CheckboxGroup as CheckboxGroup$1 } from "@ui-sdk/react/checkbox";
2
+ import { ComponentProps } from "react";
3
+ type CheckboxProps = Omit<ComponentProps<typeof Checkbox$1>, "children">;
4
+ declare function Checkbox({ className, ...props }: CheckboxProps): import("react").JSX.Element;
5
+ type CheckboxGroupProps = ComponentProps<typeof CheckboxGroup$1>;
6
+ declare function CheckboxGroup({ className, ...props }: CheckboxGroupProps): import("react").JSX.Element;
7
+ export { Checkbox, CheckboxGroup, type CheckboxGroupProps, type CheckboxProps };
@@ -0,0 +1,26 @@
1
+ import { Checkbox as Checkbox$1, CheckboxGroup as CheckboxGroup$1, CheckboxIndicator } from "@ui-sdk/react/checkbox";
2
+ import { CheckIcon, MinusIcon } from "lucide-react";
3
+ import { n as withBase, t as cn } from "./cn-B-fHM4Ov.js";
4
+ import { t as focusRing } from "./focus-ring-BpxMbGAn.js";
5
+ import { jsx } from "react/jsx-runtime";
6
+ // src/checkbox/checkbox.tsx
7
+ const checkboxClass = cn("peer relative inline-flex size-4 shrink-0 items-center justify-center rounded-item border border-primary bg-background text-primary-foreground transition-colors", "after:absolute after:top-1/2 after:left-1/2 after:size-6 after:-translate-1/2", "data-checked:bg-primary data-indeterminate:bg-primary", "[&:not([data-disabled],[data-readonly]):hover]:bg-accent", "[&:is([data-checked],[data-indeterminate]):not([data-disabled],[data-readonly]):hover]:bg-primary/90", "[&:not([data-checked],[data-indeterminate],[data-disabled],[data-readonly]):hover:active]:bg-primary/20", "[&:is([data-checked],[data-indeterminate]):not([data-disabled],[data-readonly]):hover:active]:bg-primary/80", "aria-invalid:border-destructive data-invalid:border-destructive", "data-disabled:cursor-not-allowed data-disabled:opacity-50 data-readonly:cursor-default", focusRing);
8
+ const indicatorClass = cn("flex items-center justify-center transition-[opacity,scale] duration-150 [&_svg]:size-3.5", "data-starting-style:scale-50 data-starting-style:opacity-0 data-ending-style:scale-50 data-ending-style:opacity-0");
9
+ function Checkbox({ className, ...props }) {
10
+ return /* @__PURE__ */ jsx(Checkbox$1, {
11
+ className: withBase(checkboxClass, className),
12
+ ...props,
13
+ children: /* @__PURE__ */ jsx(CheckboxIndicator, {
14
+ "data-slot": "checkbox-indicator",
15
+ className: indicatorClass,
16
+ children: (state) => state.indeterminate ? /* @__PURE__ */ jsx(MinusIcon, { "aria-hidden": "true" }) : /* @__PURE__ */ jsx(CheckIcon, { "aria-hidden": "true" })
17
+ })
18
+ });
19
+ }
20
+ function CheckboxGroup({ className, ...props }) {
21
+ return /* @__PURE__ */ jsx(CheckboxGroup$1, {
22
+ className: withBase("flex flex-col gap-3", className),
23
+ ...props
24
+ });
25
+ }
26
+ export { Checkbox, CheckboxGroup };
@@ -0,0 +1,12 @@
1
+ import { clsx } from "clsx";
2
+ import { twMerge } from "tailwind-merge";
3
+ // src/internal/cn.ts
4
+ function cn(...inputs) {
5
+ return twMerge(clsx(inputs));
6
+ }
7
+ /** A part's own classes under the caller's `className`, which UI SDK lets be a function of state. */
8
+ function withBase(base, className) {
9
+ if (typeof className === "function") return (state) => cn(base, className(state));
10
+ return cn(base, className);
11
+ }
12
+ export { withBase as n, cn as t };
@@ -0,0 +1,10 @@
1
+ import { Collapsible as Collapsible$1, CollapsiblePanel, CollapsibleTrigger as CollapsibleTrigger$1 } from "@ui-sdk/react/collapsible";
2
+ import { ComponentProps } from "react";
3
+ type CollapsibleProps = ComponentProps<typeof Collapsible$1>;
4
+ declare function Collapsible(props: CollapsibleProps): import("react").JSX.Element;
5
+ type CollapsibleTriggerProps = ComponentProps<typeof CollapsibleTrigger$1>;
6
+ /** A lucide icon among the children turns upside down while the panel is open. */
7
+ declare function CollapsibleTrigger({ className, ...props }: CollapsibleTriggerProps): import("react").JSX.Element;
8
+ type CollapsibleContentProps = ComponentProps<typeof CollapsiblePanel>;
9
+ declare function CollapsibleContent({ className, ...props }: CollapsibleContentProps): import("react").JSX.Element;
10
+ export { Collapsible, CollapsibleContent, type CollapsibleContentProps, type CollapsibleProps, CollapsibleTrigger, type CollapsibleTriggerProps };
@@ -0,0 +1,23 @@
1
+ import { Collapsible as Collapsible$1, CollapsiblePanel, CollapsibleTrigger as CollapsibleTrigger$1 } from "@ui-sdk/react/collapsible";
2
+ import { n as withBase, t as cn } from "./cn-B-fHM4Ov.js";
3
+ import { t as focusRing } from "./focus-ring-BpxMbGAn.js";
4
+ import { n as textVariants } from "./typography-Dy3PCTrL.js";
5
+ import { jsx } from "react/jsx-runtime";
6
+ // src/collapsible/collapsible.tsx
7
+ function Collapsible(props) {
8
+ return /* @__PURE__ */ jsx(Collapsible$1, { ...props });
9
+ }
10
+ /** A lucide icon among the children turns upside down while the panel is open. */
11
+ function CollapsibleTrigger({ className, ...props }) {
12
+ return /* @__PURE__ */ jsx(CollapsibleTrigger$1, {
13
+ ...props,
14
+ className: withBase(cn(textVariants({ variant: "label" }), "inline-flex min-h-(--control-h-sm) w-fit max-w-full items-center gap-2 rounded-item text-start", focusRing, "hover:underline data-disabled:cursor-not-allowed data-disabled:hover:no-underline data-disabled:opacity-50", "[&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:transition-transform [&>svg]:duration-200 motion-reduce:[&>svg]:transition-none data-open:[&>svg]:rotate-180"), className)
15
+ });
16
+ }
17
+ function CollapsibleContent({ className, ...props }) {
18
+ return /* @__PURE__ */ jsx(CollapsiblePanel, {
19
+ ...props,
20
+ className: withBase("h-(--collapsible-panel-height) overflow-hidden text-sm transition-[height] duration-200 data-ending-style:h-0 data-starting-style:h-0 motion-reduce:transition-none", className)
21
+ });
22
+ }
23
+ export { Collapsible, CollapsibleContent, CollapsibleTrigger };
@@ -0,0 +1,38 @@
1
+ import { Command as Command$1, CommandController, CommandEmpty as CommandEmpty$1, CommandGroup as CommandGroup$1, CommandInput as CommandInput$1, CommandItem as CommandItem$1, CommandList as CommandList$1, CommandPage as CommandPage$1, CommandSeparator as CommandSeparator$1, CommandShortcut as CommandShortcut$1, CommandStatus as CommandStatus$1, createCommandController } from "@ui-sdk/react/command";
2
+ import { DialogController } from "@ui-sdk/react/dialog";
3
+ import { ComponentProps, ReactNode } from "react";
4
+ import { r as Dialog$1 } from "./index-Ct4mPvuB.js";
5
+ type CommandProps = ComponentProps<typeof Command$1>;
6
+ declare function Command({ className, ...props }: CommandProps): import("react").JSX.Element;
7
+ type CommandInputProps = ComponentProps<typeof CommandInput$1>;
8
+ declare function CommandInput({ className, ...props }: CommandInputProps): import("react").JSX.Element;
9
+ type CommandListProps = ComponentProps<typeof CommandList$1>;
10
+ declare function CommandList({ className, ...props }: CommandListProps): import("react").JSX.Element;
11
+ type CommandEmptyProps = ComponentProps<typeof CommandEmpty$1>;
12
+ declare function CommandEmpty({ className, children, ...props }: CommandEmptyProps): import("react").JSX.Element;
13
+ type CommandStatusProps = ComponentProps<typeof CommandStatus$1>;
14
+ declare function CommandStatus({ className, ...props }: CommandStatusProps): import("react").JSX.Element;
15
+ type CommandGroupProps = Omit<ComponentProps<typeof CommandGroup$1>, "children"> & {
16
+ heading?: ReactNode;
17
+ children?: ReactNode;
18
+ };
19
+ declare function CommandGroup({ heading, className, children, ...props }: CommandGroupProps): import("react").JSX.Element;
20
+ type CommandItemProps = ComponentProps<typeof CommandItem$1>;
21
+ declare function CommandItem({ className, ...props }: CommandItemProps): import("react").JSX.Element;
22
+ type CommandShortcutProps = ComponentProps<typeof CommandShortcut$1>;
23
+ declare function CommandShortcut({ className, ...props }: CommandShortcutProps): import("react").JSX.Element;
24
+ type CommandSeparatorProps = ComponentProps<typeof CommandSeparator$1>;
25
+ declare function CommandSeparator({ className, ...props }: CommandSeparatorProps): import("react").JSX.Element;
26
+ type CommandPageProps = ComponentProps<typeof CommandPage$1>;
27
+ declare function CommandPage(props: CommandPageProps): import("react").JSX.Element;
28
+ type CommandDialogProps = Omit<ComponentProps<typeof Dialog$1>, "children" | "controller"> & {
29
+ controller?: DialogController;
30
+ title?: string;
31
+ description?: string;
32
+ closeLabel?: string;
33
+ children?: ReactNode;
34
+ commandProps?: CommandProps;
35
+ };
36
+ /** A Command inside the library Dialog, titled for screen readers, that closes when a command runs. */
37
+ declare function CommandDialog({ controller, title, description, closeLabel, commandProps, children, ...props }: CommandDialogProps): import("react").JSX.Element;
38
+ export { Command, type CommandController, CommandDialog, type CommandDialogProps, CommandEmpty, type CommandEmptyProps, CommandGroup, type CommandGroupProps, CommandInput, type CommandInputProps, CommandItem, type CommandItemProps, CommandList, type CommandListProps, CommandPage, type CommandPageProps, type CommandProps, CommandSeparator, type CommandSeparatorProps, CommandShortcut, type CommandShortcutProps, CommandStatus, type CommandStatusProps, createCommandController };
@@ -0,0 +1,124 @@
1
+ import { Command as Command$1, CommandEmpty as CommandEmpty$1, CommandGroup as CommandGroup$1, CommandGroupLabel, CommandInput as CommandInput$1, CommandItem as CommandItem$1, CommandList as CommandList$1, CommandPage as CommandPage$1, CommandSeparator as CommandSeparator$1, CommandShortcut as CommandShortcut$1, CommandStatus as CommandStatus$1, createCommandController } from "@ui-sdk/react/command";
2
+ import { createDialogController } from "@ui-sdk/react/dialog";
3
+ import { SearchIcon, XIcon } from "lucide-react";
4
+ import { useState } from "react";
5
+ import { a as DialogDescription$1, c as DialogTitle$1, i as DialogContent$1, r as DialogClose$1, t as Dialog$1 } from "./dialog-JjpMFEDR.js";
6
+ import { n as withBase, t as cn } from "./cn-B-fHM4Ov.js";
7
+ import { t as focusRing } from "./focus-ring-BpxMbGAn.js";
8
+ import { n as textVariants } from "./typography-Dy3PCTrL.js";
9
+ import { t as VisuallyHidden } from "./visually-hidden-BrCs6ZEy.js";
10
+ import { jsx, jsxs } from "react/jsx-runtime";
11
+ // src/command/command.tsx
12
+ function Command({ className, ...props }) {
13
+ return /* @__PURE__ */ jsx(Command$1, {
14
+ className: withBase("flex size-full flex-col overflow-hidden rounded-surface bg-popover text-popover-foreground", className),
15
+ ...props
16
+ });
17
+ }
18
+ const fieldClass = "flex items-center gap-2 border-b px-3 has-[input:focus-visible]:outline-solid has-[input:focus-visible]:outline-(length:--focus-ring-width) has-[input:focus-visible]:-outline-offset-(length:--focus-ring-width) has-[input:focus-visible]:outline-ring [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-muted-foreground";
19
+ function CommandInput({ className, ...props }) {
20
+ return /* @__PURE__ */ jsxs("div", {
21
+ "data-slot": "command-input-wrapper",
22
+ className: fieldClass,
23
+ children: [/* @__PURE__ */ jsx(SearchIcon, { "aria-hidden": true }), /* @__PURE__ */ jsx(CommandInput$1, {
24
+ className: withBase(cn(textVariants({ variant: "small" }), "h-(--control-h-lg) w-full min-w-0 bg-transparent outline-hidden placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50"), className),
25
+ ...props
26
+ })]
27
+ });
28
+ }
29
+ function CommandList({ className, ...props }) {
30
+ return /* @__PURE__ */ jsx(CommandList$1, {
31
+ className: withBase("max-h-72 scroll-py-1 overflow-x-hidden overflow-y-auto overscroll-contain p-1", className),
32
+ ...props
33
+ });
34
+ }
35
+ const messageClass = cn(textVariants({ variant: "small" }), "px-2 py-6 text-center empty:p-0");
36
+ function CommandEmpty({ className, children, ...props }) {
37
+ return /* @__PURE__ */ jsx(CommandEmpty$1, {
38
+ className: withBase(messageClass, className),
39
+ ...props,
40
+ children: typeof children === "function" ? children : (state) => state.empty && !state.loading ? children : null
41
+ });
42
+ }
43
+ function CommandStatus({ className, ...props }) {
44
+ return /* @__PURE__ */ jsx(CommandStatus$1, {
45
+ className: withBase(cn(messageClass, "text-muted-foreground"), className),
46
+ ...props
47
+ });
48
+ }
49
+ function CommandGroup({ heading, className, children, ...props }) {
50
+ return /* @__PURE__ */ jsxs(CommandGroup$1, {
51
+ className: withBase("flex flex-col", className),
52
+ ...props,
53
+ children: [heading != null && /* @__PURE__ */ jsx(CommandGroupLabel, {
54
+ className: cn(textVariants({ variant: "caption" }), "px-2 py-1.5 font-medium"),
55
+ children: heading
56
+ }), children]
57
+ });
58
+ }
59
+ function CommandItem({ className, ...props }) {
60
+ return /* @__PURE__ */ jsx(CommandItem$1, {
61
+ className: withBase(cn(textVariants({ variant: "small" }), "relative flex cursor-default items-center gap-2 rounded-item px-2 py-1.5 text-start outline-none select-none", "data-highlighted:bg-accent data-highlighted:text-accent-foreground data-highlighted:outline-solid data-highlighted:outline-(length:--focus-ring-width) data-highlighted:-outline-offset-(length:--focus-ring-width) data-highlighted:outline-ring data-disabled:cursor-not-allowed data-disabled:opacity-50 data-pending:cursor-progress", "[&>svg]:pointer-events-none [&>svg]:size-4 [&>svg]:shrink-0"), className),
62
+ ...props
63
+ });
64
+ }
65
+ function CommandShortcut({ className, ...props }) {
66
+ return /* @__PURE__ */ jsx(CommandShortcut$1, {
67
+ className: withBase(cn(textVariants({ variant: "caption" }), "ms-auto ps-4 tracking-widest"), className),
68
+ ...props
69
+ });
70
+ }
71
+ function CommandSeparator({ className, ...props }) {
72
+ return /* @__PURE__ */ jsx(CommandSeparator$1, {
73
+ className: withBase("-mx-1 my-1 h-px bg-border", className),
74
+ ...props
75
+ });
76
+ }
77
+ function CommandPage(props) {
78
+ return /* @__PURE__ */ jsx(CommandPage$1, { ...props });
79
+ }
80
+ const closeClass = cn("inline-flex size-(--control-h) items-center justify-center rounded-item text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground", focusRing);
81
+ /** A Command inside the library Dialog, titled for screen readers, that closes when a command runs. */
82
+ function CommandDialog({ controller, title = "Command palette", description, closeLabel = "Close", commandProps, children, ...props }) {
83
+ const [own] = useState(() => createDialogController());
84
+ const dialog = controller ?? own;
85
+ const onAction = commandProps?.onAction;
86
+ return /* @__PURE__ */ jsx(Dialog$1, {
87
+ controller: dialog,
88
+ ...props,
89
+ children: /* @__PURE__ */ jsxs(DialogContent$1, {
90
+ showCloseButton: false,
91
+ className: "gap-0 overflow-hidden bg-popover p-0",
92
+ children: [
93
+ /* @__PURE__ */ jsx(VisuallyHidden, {
94
+ render: /* @__PURE__ */ jsx(DialogTitle$1, {}),
95
+ children: title
96
+ }),
97
+ description && /* @__PURE__ */ jsx(VisuallyHidden, {
98
+ render: /* @__PURE__ */ jsx(DialogDescription$1, {}),
99
+ children: description
100
+ }),
101
+ /* @__PURE__ */ jsx(Command, {
102
+ ...commandProps,
103
+ onAction: async (value, details) => {
104
+ await onAction?.(value, details);
105
+ dialog.close();
106
+ },
107
+ children
108
+ }),
109
+ /* @__PURE__ */ jsx("div", {
110
+ className: "order-first flex justify-end border-b p-2 sm:hidden",
111
+ children: /* @__PURE__ */ jsx(DialogClose$1, {
112
+ "aria-label": closeLabel,
113
+ className: closeClass,
114
+ children: /* @__PURE__ */ jsx(XIcon, {
115
+ "aria-hidden": true,
116
+ className: "size-4"
117
+ })
118
+ })
119
+ })
120
+ ]
121
+ })
122
+ });
123
+ }
124
+ export { Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandPage, CommandSeparator, CommandShortcut, CommandStatus, createCommandController };
@@ -0,0 +1,46 @@
1
+ import { DatePicker as DatePicker$1, DatePickerClear as DatePickerClear$1, DatePickerContent as DatePickerContent$1, DatePickerHint as DatePickerHint$1, DatePickerInput as DatePickerInput$1, DatePickerMode, DatePickerPreset as DatePickerPreset$1, DatePickerTrigger as DatePickerTrigger$1, DatePickerValue, createDatePickerController } from "@ui-sdk/react/date-picker";
2
+ import { ComponentProps } from "react";
3
+ import { C as todayDate, S as toISODate, _ as CaptionLayout, x as fromISODate, y as addDays } from "./calendar-DhsRPq2D.js";
4
+ type DatePickerProps = ComponentProps<typeof DatePicker$1> & {
5
+ /** `"dropdown"` adds month and year selects to the default calendar, for dates far away. */
6
+ captionLayout?: CaptionLayout;
7
+ };
8
+ declare function DatePicker({ captionLayout, mode, months, today, timeZone, className, children, ...props }: DatePickerProps): import("react").JSX.Element;
9
+ /** The row that holds the inputs, Clear and the trigger. */
10
+ declare function DatePickerField({ className, ...props }: ComponentProps<"div">): import("react").JSX.Element;
11
+ /** The dash between a range's two inputs, hidden from screen readers: each input has its own name. */
12
+ declare function DatePickerSeparator({ className, children, ...props }: ComponentProps<"span">): import("react").JSX.Element;
13
+ type Size = "default" | "sm";
14
+ type DatePickerInputProps = Omit<ComponentProps<typeof DatePickerInput$1>, "size"> & {
15
+ size?: Size;
16
+ /** Marks the input invalid for app validation, such as a Formik error; typed text that isn't a date is marked already. */
17
+ invalid?: boolean;
18
+ };
19
+ declare function DatePickerInput({ size, invalid, className, ...props }: DatePickerInputProps): import("react").JSX.Element;
20
+ declare function DatePickerTrigger({ size, className, children, ...props }: ComponentProps<typeof DatePickerTrigger$1> & {
21
+ size?: Size;
22
+ }): import("react").JSX.Element;
23
+ declare function DatePickerClear({ size, "aria-label": label, className, children, ...props }: ComponentProps<typeof DatePickerClear$1> & {
24
+ size?: Size;
25
+ }): import("react").JSX.Element;
26
+ /** The format to type; once typed text is not a date, it says so, so the error is not colour alone. */
27
+ declare function DatePickerHint({ invalidMessage, className, children, ...props }: ComponentProps<typeof DatePickerHint$1> & {
28
+ invalidMessage?: string;
29
+ }): import("react").JSX.Element;
30
+ declare function DatePickerContent({ side, align, sideOffset, className, children, ...props }: ComponentProps<typeof DatePickerContent$1>): import("react").JSX.Element;
31
+ /** The calendar header and grids, laid out from the root's `months` and `captionLayout`. */
32
+ declare function DatePickerCalendar(): import("react").JSX.Element;
33
+ /** A row of presets under the calendar, split from it by a rule. */
34
+ declare function DatePickerPresets({ className, ...props }: ComponentProps<"div">): import("react").JSX.Element;
35
+ declare function DatePickerPreset({ className, ...props }: ComponentProps<typeof DatePickerPreset$1>): import("react").JSX.Element;
36
+ /** Selects today, or `[today, today]` in range mode. Today follows the root's `today` and `timeZone`. */
37
+ declare function DatePickerToday({ children, ...props }: Omit<ComponentProps<typeof DatePickerPreset$1>, "value">): import("react").JSX.Element;
38
+ type Range = [string, string];
39
+ /** The ranges analytics screens offer most, counted back from `today`, both ends included. */
40
+ declare function presetRanges(today: string): {
41
+ today: Range;
42
+ last7Days: Range;
43
+ last30Days: Range;
44
+ thisMonth: Range;
45
+ };
46
+ export { DatePicker, DatePickerCalendar, DatePickerClear, DatePickerContent, DatePickerField, DatePickerHint, DatePickerInput, type DatePickerInputProps, type DatePickerMode, DatePickerPreset, DatePickerPresets, type DatePickerProps, DatePickerSeparator, DatePickerToday, DatePickerTrigger, type DatePickerValue, addDays, createDatePickerController, fromISODate, presetRanges, toISODate, todayDate };
@@ -0,0 +1,159 @@
1
+ import { addDays as addDays$1, endOfMonth, startOfMonth, todayDate as todayDate$1 } from "@ui-sdk/core/date";
2
+ import { DatePicker as DatePicker$1, DatePickerClear as DatePickerClear$1, DatePickerContent as DatePickerContent$1, DatePickerHint as DatePickerHint$1, DatePickerInput as DatePickerInput$1, DatePickerPreset as DatePickerPreset$1, DatePickerTrigger as DatePickerTrigger$1, createDatePickerController } from "@ui-sdk/react/date-picker";
3
+ import { CalendarIcon, XIcon } from "lucide-react";
4
+ import { createContext, use } from "react";
5
+ import { _ as toISODate, g as fromISODate, m as addDays, n as CalendarBody, v as todayDate } from "./calendar-kbn4gZ1a.js";
6
+ import { n as withBase, t as cn } from "./cn-B-fHM4Ov.js";
7
+ import { t as focusRing } from "./focus-ring-BpxMbGAn.js";
8
+ import { t as popup } from "./popup-CLsuJ-AA.js";
9
+ import { n as textVariants } from "./typography-Dy3PCTrL.js";
10
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
11
+ // src/date-picker/date-picker.tsx
12
+ const LayoutContext = createContext({
13
+ mode: "single",
14
+ months: 1,
15
+ captionLayout: "label"
16
+ });
17
+ function DatePicker({ captionLayout = "label", mode = "single", months = 1, today, timeZone, className, children, ...props }) {
18
+ return /* @__PURE__ */ jsx(DatePicker$1, {
19
+ mode,
20
+ months,
21
+ today,
22
+ timeZone,
23
+ className: withBase("flex min-w-0 flex-col gap-1.5", className),
24
+ ...props,
25
+ children: (state) => /* @__PURE__ */ jsx(LayoutContext, {
26
+ value: {
27
+ mode,
28
+ months,
29
+ captionLayout,
30
+ today,
31
+ timeZone,
32
+ invalid: state.invalid
33
+ },
34
+ children: typeof children === "function" ? children(state) : children ?? /* @__PURE__ */ jsxs(Fragment, { children: [
35
+ /* @__PURE__ */ jsxs(DatePickerField, { children: [
36
+ /* @__PURE__ */ jsx(DatePickerInput, { "aria-label": mode === "range" ? "Start date" : "Date" }),
37
+ mode === "range" && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(DatePickerSeparator, {}), /* @__PURE__ */ jsx(DatePickerInput, {
38
+ end: true,
39
+ "aria-label": "End date"
40
+ })] }),
41
+ /* @__PURE__ */ jsx(DatePickerTrigger, {})
42
+ ] }),
43
+ /* @__PURE__ */ jsx(DatePickerHint, {}),
44
+ /* @__PURE__ */ jsx(DatePickerContent, {})
45
+ ] })
46
+ })
47
+ });
48
+ }
49
+ /** The row that holds the inputs, Clear and the trigger. */
50
+ function DatePickerField({ className, ...props }) {
51
+ return /* @__PURE__ */ jsx("div", {
52
+ "data-slot": "date-picker-field",
53
+ className: cn("flex min-w-0 items-center gap-2", className),
54
+ ...props
55
+ });
56
+ }
57
+ /** The dash between a range's two inputs, hidden from screen readers: each input has its own name. */
58
+ function DatePickerSeparator({ className, children = "–", ...props }) {
59
+ return /* @__PURE__ */ jsx("span", {
60
+ "aria-hidden": true,
61
+ "data-slot": "date-picker-separator",
62
+ className: cn("shrink-0 text-sm text-muted-foreground", className),
63
+ ...props,
64
+ children
65
+ });
66
+ }
67
+ const inputClass = cn("h-(--control-h) w-full min-w-0 flex-1 rounded-control border border-input bg-background px-3 text-sm text-foreground tabular-nums outline-hidden", "placeholder:text-muted-foreground", "data-[size=sm]:h-(--control-h-sm) data-[size=sm]:px-2.5", "aria-invalid:border-destructive data-invalid:border-destructive", "data-disabled:cursor-not-allowed data-disabled:opacity-50", focusRing);
68
+ function DatePickerInput({ size = "default", invalid, className, ...props }) {
69
+ return /* @__PURE__ */ jsx(DatePickerInput$1, {
70
+ "data-size": size,
71
+ ...invalid ? {
72
+ "aria-invalid": true,
73
+ "data-invalid": ""
74
+ } : null,
75
+ className: withBase(inputClass, className),
76
+ ...props
77
+ });
78
+ }
79
+ const iconButtonClass = cn("inline-flex size-(--control-h) shrink-0 items-center justify-center rounded-control text-foreground outline-hidden transition-colors", "data-[size=sm]:size-(--control-h-sm)", "[&:not([data-disabled]):hover]:bg-accent [&:not([data-disabled]):hover]:text-accent-foreground", "data-disabled:cursor-not-allowed data-disabled:opacity-50", "[&_svg]:size-4 [&_svg]:shrink-0", focusRing);
80
+ function DatePickerTrigger({ size = "default", className, children, ...props }) {
81
+ return /* @__PURE__ */ jsx(DatePickerTrigger$1, {
82
+ "data-size": size,
83
+ className: withBase(cn(iconButtonClass, "border border-input bg-background"), className),
84
+ ...props,
85
+ children: children ?? /* @__PURE__ */ jsx(CalendarIcon, { "aria-hidden": true })
86
+ });
87
+ }
88
+ function DatePickerClear({ size = "default", "aria-label": label = "Clear date", className, children, ...props }) {
89
+ return /* @__PURE__ */ jsx(DatePickerClear$1, {
90
+ "data-size": size,
91
+ "aria-label": label,
92
+ className: withBase(cn(iconButtonClass, "text-muted-foreground data-empty:hidden"), className),
93
+ ...props,
94
+ children: children ?? /* @__PURE__ */ jsx(XIcon, { "aria-hidden": true })
95
+ });
96
+ }
97
+ /** The format to type; once typed text is not a date, it says so, so the error is not colour alone. */
98
+ function DatePickerHint({ invalidMessage = "Enter a valid date.", className, children, ...props }) {
99
+ const { invalid } = use(LayoutContext);
100
+ return /* @__PURE__ */ jsx(DatePickerHint$1, {
101
+ className: withBase(textVariants({ variant: "caption" }), className),
102
+ ...props,
103
+ children: invalid ? invalidMessage : children
104
+ });
105
+ }
106
+ const contentClass = cn(popup, "flex max-w-(--available-width) flex-col gap-3 overflow-auto overscroll-contain p-3 outline-hidden");
107
+ function DatePickerContent({ side = "bottom", align = "start", sideOffset = 4, className, children, ...props }) {
108
+ return /* @__PURE__ */ jsx(DatePickerContent$1, {
109
+ side,
110
+ align,
111
+ sideOffset,
112
+ className: withBase(contentClass, className),
113
+ ...props,
114
+ children: children ?? /* @__PURE__ */ jsx(DatePickerCalendar, {})
115
+ });
116
+ }
117
+ /** The calendar header and grids, laid out from the root's `months` and `captionLayout`. */
118
+ function DatePickerCalendar() {
119
+ const layout = use(LayoutContext);
120
+ return /* @__PURE__ */ jsx(CalendarBody, {
121
+ captionLayout: layout.captionLayout,
122
+ months: layout.months
123
+ });
124
+ }
125
+ /** A row of presets under the calendar, split from it by a rule. */
126
+ function DatePickerPresets({ className, ...props }) {
127
+ return /* @__PURE__ */ jsx("div", {
128
+ "data-slot": "date-picker-presets",
129
+ className: cn("flex flex-wrap gap-1 border-t pt-3", className),
130
+ ...props
131
+ });
132
+ }
133
+ const presetClass = cn("inline-flex h-(--control-h-sm) shrink-0 items-center justify-center rounded-control px-3 text-sm font-medium whitespace-nowrap text-foreground outline-hidden transition-colors", "[&:not([data-disabled],[data-selected]):hover]:bg-accent [&:not([data-disabled],[data-selected]):hover]:text-accent-foreground", "data-selected:bg-primary-subtle data-selected:text-primary-subtle-foreground", "data-disabled:cursor-not-allowed data-disabled:opacity-50", focusRing);
134
+ function DatePickerPreset({ className, ...props }) {
135
+ return /* @__PURE__ */ jsx(DatePickerPreset$1, {
136
+ className: withBase(presetClass, className),
137
+ ...props
138
+ });
139
+ }
140
+ /** Selects today, or `[today, today]` in range mode. Today follows the root's `today` and `timeZone`. */
141
+ function DatePickerToday({ children = "Today", ...props }) {
142
+ const layout = use(LayoutContext);
143
+ const today = layout.today ?? todayDate$1(layout.timeZone);
144
+ return /* @__PURE__ */ jsx(DatePickerPreset, {
145
+ value: layout.mode === "range" ? [today, today] : today,
146
+ ...props,
147
+ children
148
+ });
149
+ }
150
+ /** The ranges analytics screens offer most, counted back from `today`, both ends included. */
151
+ function presetRanges(today) {
152
+ return {
153
+ today: [today, today],
154
+ last7Days: [addDays$1(today, -6), today],
155
+ last30Days: [addDays$1(today, -29), today],
156
+ thisMonth: [startOfMonth(today), endOfMonth(today)]
157
+ };
158
+ }
159
+ export { DatePicker, DatePickerCalendar, DatePickerClear, DatePickerContent, DatePickerField, DatePickerHint, DatePickerInput, DatePickerPreset, DatePickerPresets, DatePickerSeparator, DatePickerToday, DatePickerTrigger, addDays, createDatePickerController, fromISODate, presetRanges, toISODate, todayDate };