@eodparks/ui 0.0.0-stage → 0.2.1

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-Bu72BGjv.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-C-tNDS8C.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/badge.js ADDED
@@ -0,0 +1,148 @@
1
+ import { renderElement } from "@ui-sdk/react/primitive";
2
+ import { cva } from "class-variance-authority";
3
+ import { Children } from "react";
4
+ import { n as withBase } from "./cn-B-fHM4Ov.js";
5
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
6
+ // src/badge/badge.tsx
7
+ const badgeVariants = cva("inline-flex shrink-0 items-center justify-center rounded-full", {
8
+ variants: {
9
+ variant: {
10
+ default: "",
11
+ secondary: "",
12
+ outline: "",
13
+ destructive: "",
14
+ success: "",
15
+ warning: "",
16
+ info: "",
17
+ highlight: ""
18
+ },
19
+ subtle: {
20
+ true: "",
21
+ false: ""
22
+ },
23
+ shape: {
24
+ label: "h-5 max-w-full gap-1 px-2 text-xs/4 font-medium whitespace-nowrap [&_svg]:size-3",
25
+ count: "h-5 min-w-5 px-1.5 text-xs/4 font-medium tabular-nums",
26
+ dot: "size-2"
27
+ },
28
+ offset: {
29
+ true: "absolute end-0 top-0 -translate-y-1/2 translate-x-1/2 rtl:-translate-x-1/2",
30
+ false: ""
31
+ }
32
+ },
33
+ compoundVariants: [
34
+ {
35
+ variant: "default",
36
+ subtle: false,
37
+ class: "bg-primary text-primary-foreground"
38
+ },
39
+ {
40
+ variant: "secondary",
41
+ class: "bg-secondary text-secondary-foreground"
42
+ },
43
+ {
44
+ variant: "outline",
45
+ class: "border border-input bg-background text-foreground"
46
+ },
47
+ {
48
+ variant: "destructive",
49
+ subtle: false,
50
+ class: "bg-destructive text-destructive-foreground"
51
+ },
52
+ {
53
+ variant: "success",
54
+ subtle: false,
55
+ class: "bg-success text-success-foreground"
56
+ },
57
+ {
58
+ variant: "warning",
59
+ subtle: false,
60
+ class: "bg-warning text-warning-foreground"
61
+ },
62
+ {
63
+ variant: "info",
64
+ subtle: false,
65
+ class: "bg-info text-info-foreground"
66
+ },
67
+ {
68
+ variant: "highlight",
69
+ subtle: false,
70
+ class: "bg-highlight text-highlight-foreground"
71
+ },
72
+ {
73
+ variant: "default",
74
+ subtle: true,
75
+ class: "border border-primary-border bg-primary-subtle text-primary-subtle-foreground"
76
+ },
77
+ {
78
+ variant: "destructive",
79
+ subtle: true,
80
+ class: "border border-destructive-border bg-destructive-subtle text-destructive-subtle-foreground"
81
+ },
82
+ {
83
+ variant: "success",
84
+ subtle: true,
85
+ class: "border border-success-border bg-success-subtle text-success-subtle-foreground"
86
+ },
87
+ {
88
+ variant: "warning",
89
+ subtle: true,
90
+ class: "border border-warning-border bg-warning-subtle text-warning-subtle-foreground"
91
+ },
92
+ {
93
+ variant: "info",
94
+ subtle: true,
95
+ class: "border border-info-border bg-info-subtle text-info-subtle-foreground"
96
+ },
97
+ {
98
+ variant: "highlight",
99
+ subtle: true,
100
+ class: "border border-highlight-border bg-highlight-subtle text-highlight-subtle-foreground"
101
+ }
102
+ ],
103
+ defaultVariants: {
104
+ variant: "default",
105
+ subtle: false,
106
+ shape: "label",
107
+ offset: false
108
+ }
109
+ });
110
+ const truncating = (nodes) => Children.map(nodes, (node) => typeof node === "string" || typeof node === "number" ? /* @__PURE__ */ jsx("span", {
111
+ className: "truncate",
112
+ children: node
113
+ }) : node);
114
+ function Badge({ variant = "default", subtle: isSubtle = false, count, max = 99, dot = false, label, offset = false, render, className, children, ...props }) {
115
+ if (count === 0) return null;
116
+ const shape = dot ? "dot" : count === void 0 ? "label" : "count";
117
+ const text = count === void 0 ? children : count > max ? `${max}+` : String(count);
118
+ return renderElement("span", {
119
+ ...props,
120
+ "data-slot": "badge",
121
+ "data-variant": variant,
122
+ "data-shape": shape,
123
+ ...isSubtle && { "data-subtle": "" },
124
+ ...dot && (label ? {
125
+ role: "img",
126
+ "aria-label": label
127
+ } : { "aria-hidden": true }),
128
+ className: withBase(badgeVariants({
129
+ variant,
130
+ subtle: isSubtle,
131
+ shape,
132
+ offset
133
+ }), className),
134
+ children: dot ? void 0 : /* @__PURE__ */ jsxs(Fragment, { children: [shape === "label" ? truncating(text) : text, label && /* @__PURE__ */ jsxs("span", {
135
+ className: "sr-only",
136
+ children: [" ", label]
137
+ })] })
138
+ }, render);
139
+ }
140
+ /** The element a badge is pinned to. It places the badge and adds no space of its own. */
141
+ function BadgeAnchor({ render, className, ...props }) {
142
+ return renderElement("span", {
143
+ ...props,
144
+ "data-slot": "badge-anchor",
145
+ className: withBase("relative inline-flex w-fit", className)
146
+ }, render);
147
+ }
148
+ export { Badge, BadgeAnchor, badgeVariants };
@@ -0,0 +1,15 @@
1
+ import { Button as Button$1 } from "@ui-sdk/react/button";
2
+ import { VariantProps } from "class-variance-authority";
3
+ import { ComponentProps, ReactNode } from "react";
4
+ declare const buttonVariants: (props?: ({
5
+ variant?: "link" | "default" | "secondary" | "outline" | "destructive" | "ghost" | null | undefined;
6
+ size?: "sm" | "lg" | "default" | "xs" | "icon" | "icon-sm" | "icon-xs" | null | undefined;
7
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
8
+ type UIButtonProps = ComponentProps<typeof Button$1>;
9
+ type ButtonProps = Omit<UIButtonProps, "children"> & VariantProps<typeof buttonVariants> & {
10
+ children?: ReactNode;
11
+ /** Controlled pending, for form submits and mutations whose Promise `onClick` does not return. */
12
+ pending?: boolean;
13
+ };
14
+ declare function Button({ variant, size, pending, pendingAnnouncement, disabled, focusableWhenDisabled, className, children, ...props }: ButtonProps): import("react").JSX.Element;
15
+ export { ButtonProps as n, buttonVariants as r, Button as t };
@@ -0,0 +1,86 @@
1
+ import { announce } from "@ui-sdk/core";
2
+ import { Button as Button$1 } from "@ui-sdk/react/button";
3
+ import { cva } from "class-variance-authority";
4
+ import { LoaderCircleIcon } from "lucide-react";
5
+ import { Children, useEffect } from "react";
6
+ import { t as cn } from "./cn-B-fHM4Ov.js";
7
+ import { t as focusRing } from "./focus-ring-BpxMbGAn.js";
8
+ import { jsx, jsxs } from "react/jsx-runtime";
9
+ // src/button/button.tsx
10
+ const buttonVariants = cva([
11
+ "relative inline-flex max-w-full shrink-0 items-center justify-center gap-2 rounded-control text-sm font-medium whitespace-nowrap transition-colors",
12
+ focusRing,
13
+ "data-disabled:not-data-pending:cursor-not-allowed data-disabled:not-data-pending:opacity-50 data-pending:cursor-progress",
14
+ "[&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
15
+ "data-pending:[&>:not([data-slot=button-spinner])]:opacity-0"
16
+ ], {
17
+ variants: {
18
+ variant: {
19
+ default: "bg-primary text-primary-foreground [&:not([data-disabled],[data-pending]):is(:hover,:active)]:bg-primary/90",
20
+ secondary: "bg-secondary text-secondary-foreground [&:not([data-disabled],[data-pending]):is(:hover,:active)]:bg-secondary/80",
21
+ outline: "border border-input bg-background text-foreground [&:not([data-disabled],[data-pending]):is(:hover,:active)]:bg-accent [&:not([data-disabled],[data-pending]):is(:hover,:active)]:text-accent-foreground",
22
+ ghost: "text-foreground [&:not([data-disabled],[data-pending]):is(:hover,:active)]:bg-accent [&:not([data-disabled],[data-pending]):is(:hover,:active)]:text-accent-foreground",
23
+ link: "text-primary [&:not([data-disabled],[data-pending]):is(:hover,:active)]:underline underline-offset-4",
24
+ destructive: "bg-destructive text-destructive-foreground [&:not([data-disabled],[data-pending]):is(:hover,:active)]:bg-destructive/90"
25
+ },
26
+ size: {
27
+ xs: "h-6 gap-1 px-2 text-xs",
28
+ sm: "h-(--control-h-sm) px-3",
29
+ default: "h-(--control-h) px-4",
30
+ lg: "h-(--control-h-lg) px-8",
31
+ icon: "size-(--control-h)",
32
+ "icon-sm": "size-(--control-h-sm)",
33
+ "icon-xs": "size-6"
34
+ }
35
+ },
36
+ defaultVariants: {
37
+ variant: "default",
38
+ size: "default"
39
+ }
40
+ });
41
+ function label(children) {
42
+ const parts = [];
43
+ let text = "";
44
+ for (const child of [...Children.toArray(children), null]) {
45
+ if (typeof child === "string" || typeof child === "number") {
46
+ text += child;
47
+ continue;
48
+ }
49
+ if (text) parts.push(/* @__PURE__ */ jsx("span", {
50
+ className: "truncate",
51
+ children: text
52
+ }, parts.length));
53
+ text = "";
54
+ if (child) parts.push(child);
55
+ }
56
+ return parts;
57
+ }
58
+ function Button({ variant = "default", size = "default", pending = false, pendingAnnouncement = "Loading", disabled, focusableWhenDisabled = true, className, children, ...props }) {
59
+ useEffect(() => {
60
+ if (!pending || !pendingAnnouncement) return;
61
+ const timer = setTimeout(() => announce(pendingAnnouncement), 1e3);
62
+ return () => clearTimeout(timer);
63
+ }, [pending, pendingAnnouncement]);
64
+ return /* @__PURE__ */ jsxs(Button$1, {
65
+ ...props,
66
+ "data-variant": variant,
67
+ "data-size": size,
68
+ ...pending && {
69
+ "data-pending": "",
70
+ "aria-busy": true
71
+ },
72
+ disabled: disabled || pending,
73
+ focusableWhenDisabled: focusableWhenDisabled || pending,
74
+ pendingAnnouncement,
75
+ className: (state) => cn(buttonVariants({
76
+ variant,
77
+ size
78
+ }), typeof className === "function" ? className(state) : className),
79
+ children: [label(children), /* @__PURE__ */ jsx(LoaderCircleIcon, {
80
+ "data-slot": "button-spinner",
81
+ "aria-hidden": "true",
82
+ className: "absolute inset-0 m-auto hidden animate-spin motion-reduce:animate-none in-data-pending:block"
83
+ })]
84
+ });
85
+ }
86
+ export { buttonVariants as n, Button as t };
@@ -0,0 +1,2 @@
1
+ import { n as ButtonProps, r as buttonVariants, t as Button } from "./button-Bu72BGjv.js";
2
+ export { Button, type ButtonProps, buttonVariants };
package/dist/button.js ADDED
@@ -0,0 +1 @@
1
+ export { t as Button, n as buttonVariants } from "./button-DEsRlveL.js";
@@ -0,0 +1,23 @@
1
+ import { Calendar as Calendar$1, CalendarDay as CalendarDay$1, CalendarDayState, CalendarGrid as CalendarGrid$1, CalendarHeading as CalendarHeading$1, CalendarMode, CalendarMonthSelect as CalendarMonthSelect$1, CalendarNext as CalendarNext$1, CalendarPrevious as CalendarPrevious$1, CalendarValue, CalendarWeekday as CalendarWeekday$1, CalendarWeekdays as CalendarWeekdays$1, CalendarWeeks as CalendarWeeks$1, CalendarYearSelect as CalendarYearSelect$1, DateMatchers, createCalendarController } from "@ui-sdk/react/calendar";
2
+ import { ComponentProps } from "react";
3
+ import { addDays, toISODate, todayDate } from "@ui-sdk/core/date";
4
+ type CaptionLayout = "label" | "dropdown";
5
+ type CalendarProps = ComponentProps<typeof Calendar$1> & {
6
+ /** `"dropdown"` adds native month and year selects beside the heading, for dates far away. */
7
+ captionLayout?: CaptionLayout;
8
+ };
9
+ declare function Calendar({ captionLayout, months, className, children, ...props }: CalendarProps): import("react").JSX.Element;
10
+ declare function CalendarHeader({ className, ...props }: ComponentProps<"div">): import("react").JSX.Element;
11
+ declare function CalendarPrevious({ className, children, ...props }: ComponentProps<typeof CalendarPrevious$1>): import("react").JSX.Element;
12
+ declare function CalendarNext({ className, children, ...props }: ComponentProps<typeof CalendarNext$1>): import("react").JSX.Element;
13
+ declare function CalendarHeading({ className, ...props }: ComponentProps<typeof CalendarHeading$1>): import("react").JSX.Element;
14
+ declare function CalendarMonthSelect({ className, ...props }: ComponentProps<typeof CalendarMonthSelect$1>): import("react").JSX.Element;
15
+ declare function CalendarYearSelect({ className, ...props }: ComponentProps<typeof CalendarYearSelect$1>): import("react").JSX.Element;
16
+ declare function CalendarGrid({ className, children, ...props }: ComponentProps<typeof CalendarGrid$1>): import("react").JSX.Element;
17
+ declare function CalendarWeekdays(props: ComponentProps<typeof CalendarWeekdays$1>): import("react").JSX.Element;
18
+ declare function CalendarWeekday({ className, ...props }: ComponentProps<typeof CalendarWeekday$1>): import("react").JSX.Element;
19
+ declare function CalendarWeeks(props: ComponentProps<typeof CalendarWeeks$1>): import("react").JSX.Element;
20
+ declare function CalendarDay({ className, ...props }: ComponentProps<typeof CalendarDay$1>): import("react").JSX.Element;
21
+ /** A local-midnight `Date` for an ISO date, for app code that still holds `Date` objects. */
22
+ declare function fromISODate(value: string): Date | undefined;
23
+ export { todayDate as C, toISODate as S, CaptionLayout as _, CalendarHeader as a, createCalendarController as b, CalendarMonthSelect as c, CalendarProps as d, CalendarValue as f, CalendarYearSelect as g, CalendarWeeks as h, CalendarGrid as i, CalendarNext as l, CalendarWeekdays as m, CalendarDay as n, CalendarHeading as o, CalendarWeekday as p, CalendarDayState as r, CalendarMode as s, Calendar as t, CalendarPrevious as u, DateMatchers as v, fromISODate as x, addDays as y };
@@ -0,0 +1,110 @@
1
+ import { addDays, dateParts, toISODate, todayDate } from "@ui-sdk/core/date";
2
+ import { Calendar as Calendar$1, CalendarDay as CalendarDay$1, CalendarGrid as CalendarGrid$1, CalendarHeading as CalendarHeading$1, CalendarMonthSelect as CalendarMonthSelect$1, CalendarNext as CalendarNext$1, CalendarPrevious as CalendarPrevious$1, CalendarWeekday as CalendarWeekday$1, CalendarWeekdays as CalendarWeekdays$1, CalendarWeeks as CalendarWeeks$1, CalendarYearSelect as CalendarYearSelect$1, createCalendarController } from "@ui-sdk/react/calendar";
3
+ import { ChevronLeftIcon, ChevronRightIcon } from "lucide-react";
4
+ import { n as withBase, t as cn } from "./cn-B-fHM4Ov.js";
5
+ import { t as focusRing } from "./focus-ring-BpxMbGAn.js";
6
+ import { n as textVariants } from "./typography-Dy3PCTrL.js";
7
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
8
+ // src/calendar/calendar.tsx
9
+ function Calendar({ captionLayout = "label", months = 1, className, children, ...props }) {
10
+ return /* @__PURE__ */ jsx(Calendar$1, {
11
+ months,
12
+ className: withBase("flex w-fit flex-col gap-3 p-3", className),
13
+ ...props,
14
+ children: children ?? /* @__PURE__ */ jsx(CalendarBody, {
15
+ captionLayout,
16
+ months
17
+ })
18
+ });
19
+ }
20
+ /** The header and one grid per month: what `Calendar` and `DatePickerContent` render by default. */
21
+ function CalendarBody({ captionLayout = "label", months = 1 }) {
22
+ const offsets = Array.from({ length: months }, (_, offset) => offset);
23
+ return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs(CalendarHeader, { children: [
24
+ /* @__PURE__ */ jsx(CalendarPrevious, {}),
25
+ captionLayout === "dropdown" ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(CalendarHeading, { className: "sr-only" }), /* @__PURE__ */ jsxs("div", {
26
+ className: "flex min-w-0 items-center gap-2",
27
+ children: [/* @__PURE__ */ jsx(CalendarMonthSelect, {}), /* @__PURE__ */ jsx(CalendarYearSelect, {})]
28
+ })] }) : /* @__PURE__ */ jsx(CalendarHeading, {}),
29
+ /* @__PURE__ */ jsx(CalendarNext, {})
30
+ ] }), /* @__PURE__ */ jsx("div", {
31
+ className: "flex flex-wrap items-start gap-4",
32
+ children: offsets.map((offset) => /* @__PURE__ */ jsx(CalendarGrid, { offset }, offset))
33
+ })] });
34
+ }
35
+ function CalendarHeader({ className, ...props }) {
36
+ return /* @__PURE__ */ jsx("div", {
37
+ "data-slot": "calendar-header",
38
+ className: cn("flex items-center justify-between gap-2", className),
39
+ ...props
40
+ });
41
+ }
42
+ const stepClass = cn("inline-flex size-(--control-h-sm) shrink-0 items-center justify-center rounded-control text-foreground outline-hidden transition-colors", "[&: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 rtl:[&_svg]:-scale-x-100", focusRing);
43
+ function CalendarPrevious({ className, children, ...props }) {
44
+ return /* @__PURE__ */ jsx(CalendarPrevious$1, {
45
+ className: withBase(stepClass, className),
46
+ ...props,
47
+ children: children ?? /* @__PURE__ */ jsx(ChevronLeftIcon, { "aria-hidden": true })
48
+ });
49
+ }
50
+ function CalendarNext({ className, children, ...props }) {
51
+ return /* @__PURE__ */ jsx(CalendarNext$1, {
52
+ className: withBase(stepClass, className),
53
+ ...props,
54
+ children: children ?? /* @__PURE__ */ jsx(ChevronRightIcon, { "aria-hidden": true })
55
+ });
56
+ }
57
+ function CalendarHeading({ className, ...props }) {
58
+ return /* @__PURE__ */ jsx(CalendarHeading$1, {
59
+ className: withBase(cn(textVariants({ variant: "label" }), "truncate text-center"), className),
60
+ ...props
61
+ });
62
+ }
63
+ const selectClass = cn("h-(--control-h-sm) min-w-0 rounded-control border border-input bg-background ps-2 pe-1 text-sm text-foreground outline-hidden", "data-disabled:cursor-not-allowed data-disabled:opacity-50", focusRing);
64
+ function CalendarMonthSelect({ className, ...props }) {
65
+ return /* @__PURE__ */ jsx(CalendarMonthSelect$1, {
66
+ className: withBase(selectClass, className),
67
+ ...props
68
+ });
69
+ }
70
+ function CalendarYearSelect({ className, ...props }) {
71
+ return /* @__PURE__ */ jsx(CalendarYearSelect$1, {
72
+ className: withBase(selectClass, className),
73
+ ...props
74
+ });
75
+ }
76
+ function CalendarGrid({ className, children, ...props }) {
77
+ return /* @__PURE__ */ jsx(CalendarGrid$1, {
78
+ className: withBase("border-collapse", className),
79
+ ...props,
80
+ children: children ?? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(CalendarWeekdays, { children: (index) => /* @__PURE__ */ jsx(CalendarWeekday, { index }) }), /* @__PURE__ */ jsx(CalendarWeeks, { children: (cell) => /* @__PURE__ */ jsx(CalendarDay, { value: cell.date }) })] })
81
+ });
82
+ }
83
+ function CalendarWeekdays(props) {
84
+ return /* @__PURE__ */ jsx(CalendarWeekdays$1, { ...props });
85
+ }
86
+ function CalendarWeekday({ className, ...props }) {
87
+ return /* @__PURE__ */ jsx(CalendarWeekday$1, {
88
+ className: withBase(cn(textVariants({ variant: "caption" }), "size-(--control-h-sm) p-0 text-center font-normal"), className),
89
+ ...props
90
+ });
91
+ }
92
+ function CalendarWeeks(props) {
93
+ return /* @__PURE__ */ jsx(CalendarWeeks$1, { ...props });
94
+ }
95
+ const dayClass = cn("size-(--control-h-sm) cursor-default rounded-item p-0 text-center align-middle text-sm text-foreground tabular-nums outline-hidden select-none", "[&:not([data-disabled],[data-selected]):hover]:bg-accent [&:not([data-disabled],[data-selected]):hover]:text-accent-foreground", "data-today:font-semibold data-today:underline data-today:underline-offset-4 data-today:not-data-selected:text-primary", "data-outside:text-muted-foreground", "data-preview:bg-accent data-preview:text-accent-foreground", "data-selected:not-data-range-middle:bg-primary data-selected:not-data-range-middle:text-primary-foreground", "data-range-middle:rounded-none data-range-middle:bg-primary-subtle data-range-middle:text-primary-subtle-foreground", "data-range-start:not-data-range-end:rounded-e-none data-range-end:not-data-range-start:rounded-s-none", "data-disabled:cursor-not-allowed data-disabled:text-muted-foreground data-disabled:opacity-50", "data-unavailable:line-through", focusRing);
96
+ function CalendarDay({ className, ...props }) {
97
+ return /* @__PURE__ */ jsx(CalendarDay$1, {
98
+ className: withBase(dayClass, className),
99
+ ...props
100
+ });
101
+ }
102
+ /** A local-midnight `Date` for an ISO date, for app code that still holds `Date` objects. */
103
+ function fromISODate(value) {
104
+ const parts = dateParts(value);
105
+ if (!parts) return void 0;
106
+ const date = new Date(parts.year, parts.month - 1, parts.day);
107
+ date.setFullYear(parts.year);
108
+ return date;
109
+ }
110
+ export { toISODate as _, CalendarHeader as a, CalendarNext as c, CalendarWeekdays as d, CalendarWeeks as f, fromISODate as g, createCalendarController as h, CalendarGrid as i, CalendarPrevious as l, addDays as m, CalendarBody as n, CalendarHeading as o, CalendarYearSelect as p, CalendarDay as r, CalendarMonthSelect as s, Calendar as t, CalendarWeekday as u, todayDate as v };
@@ -0,0 +1,2 @@
1
+ import { C as todayDate, S as toISODate, _ as CaptionLayout, a as CalendarHeader, b as createCalendarController, c as CalendarMonthSelect, d as CalendarProps, f as CalendarValue, g as CalendarYearSelect, h as CalendarWeeks, i as CalendarGrid, l as CalendarNext, m as CalendarWeekdays, n as CalendarDay, o as CalendarHeading, p as CalendarWeekday, r as CalendarDayState, s as CalendarMode, t as Calendar, u as CalendarPrevious, v as DateMatchers, x as fromISODate, y as addDays } from "./calendar-DhsRPq2D.js";
2
+ export { Calendar, CalendarDay, type CalendarDayState, CalendarGrid, CalendarHeader, CalendarHeading, type CalendarMode, CalendarMonthSelect, CalendarNext, CalendarPrevious, type CalendarProps, type CalendarValue, CalendarWeekday, CalendarWeekdays, CalendarWeeks, CalendarYearSelect, type CaptionLayout, type DateMatchers, addDays, createCalendarController, fromISODate, toISODate, todayDate };
@@ -0,0 +1 @@
1
+ export { t as Calendar, r as CalendarDay, i as CalendarGrid, a as CalendarHeader, o as CalendarHeading, s as CalendarMonthSelect, c as CalendarNext, l as CalendarPrevious, u as CalendarWeekday, d as CalendarWeekdays, f as CalendarWeeks, p as CalendarYearSelect, m as addDays, h as createCalendarController, g as fromISODate, _ as toISODate, v as todayDate } from "./calendar-kbn4gZ1a.js";
@@ -0,0 +1,77 @@
1
+ import { renderElement } from "@ui-sdk/react/primitive";
2
+ import { cva } from "class-variance-authority";
3
+ import { n as withBase } from "./cn-B-fHM4Ov.js";
4
+ import { t as focusRing } from "./focus-ring-BpxMbGAn.js";
5
+ import { n as textVariants } from "./typography-Dy3PCTrL.js";
6
+ // src/card/card.tsx
7
+ const cardVariants = cva("flex flex-col rounded-surface border bg-card text-card-foreground shadow-xs", {
8
+ variants: {
9
+ size: {
10
+ default: "gap-4 p-6",
11
+ compact: "gap-3 p-4"
12
+ },
13
+ interactive: {
14
+ true: `cursor-pointer transition-colors hover:bg-accent hover:text-accent-foreground ${focusRing}`,
15
+ false: ""
16
+ }
17
+ },
18
+ defaultVariants: {
19
+ size: "default",
20
+ interactive: false
21
+ }
22
+ });
23
+ function Card({ size = "default", interactive = false, render, className, ...props }) {
24
+ return renderElement("div", {
25
+ ...props,
26
+ "data-slot": "card",
27
+ "data-size": size,
28
+ ...interactive && { "data-interactive": "" },
29
+ className: withBase(cardVariants({
30
+ size,
31
+ interactive
32
+ }), className)
33
+ }, render);
34
+ }
35
+ function CardHeader({ render, className, ...props }) {
36
+ return renderElement("div", {
37
+ ...props,
38
+ "data-slot": "card-header",
39
+ className: withBase("grid grid-cols-[minmax(0,1fr)_auto] items-start gap-x-4 gap-y-1", className)
40
+ }, render);
41
+ }
42
+ function CardTitle({ render, className, ...props }) {
43
+ return renderElement("div", {
44
+ ...props,
45
+ "data-slot": "card-title",
46
+ className: withBase(`${textVariants({ variant: "section-title" })} col-start-1 wrap-anywhere`, className)
47
+ }, render);
48
+ }
49
+ function CardDescription({ render, className, ...props }) {
50
+ return renderElement("div", {
51
+ ...props,
52
+ "data-slot": "card-description",
53
+ className: withBase(`${textVariants({ variant: "small" })} col-start-1 wrap-anywhere text-muted-foreground`, className)
54
+ }, render);
55
+ }
56
+ function CardAction({ render, className, ...props }) {
57
+ return renderElement("div", {
58
+ ...props,
59
+ "data-slot": "card-action",
60
+ className: withBase("col-start-2 row-span-2 row-start-1 flex items-center gap-2", className)
61
+ }, render);
62
+ }
63
+ function CardContent({ render, className, ...props }) {
64
+ return renderElement("div", {
65
+ ...props,
66
+ "data-slot": "card-content",
67
+ className: withBase("min-w-0", className)
68
+ }, render);
69
+ }
70
+ function CardFooter({ render, className, ...props }) {
71
+ return renderElement("div", {
72
+ ...props,
73
+ "data-slot": "card-footer",
74
+ className: withBase("flex flex-wrap items-center gap-2", className)
75
+ }, render);
76
+ }
77
+ export { CardFooter as a, cardVariants as c, CardDescription as i, CardAction as n, CardHeader as o, CardContent as r, CardTitle as s, Card as t };
package/dist/card.d.ts ADDED
@@ -0,0 +1,18 @@
1
+ import { PartProps } from "@ui-sdk/react/primitive";
2
+ import { VariantProps } from "class-variance-authority";
3
+ declare const cardVariants: (props?: ({
4
+ size?: "default" | "compact" | null | undefined;
5
+ interactive?: boolean | null | undefined;
6
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
7
+ type CardProps = PartProps<"div"> & Omit<VariantProps<typeof cardVariants>, "interactive"> & {
8
+ /** Styles the whole card as one target. Pass the link with `render={<a href />}`. */
9
+ interactive?: boolean;
10
+ };
11
+ declare function Card({ size, interactive, render, className, ...props }: CardProps): import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
12
+ declare function CardHeader({ render, className, ...props }: PartProps<"div">): import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
13
+ declare function CardTitle({ render, className, ...props }: PartProps<"div">): import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
14
+ declare function CardDescription({ render, className, ...props }: PartProps<"div">): import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
15
+ declare function CardAction({ render, className, ...props }: PartProps<"div">): import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
16
+ declare function CardContent({ render, className, ...props }: PartProps<"div">): import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
17
+ declare function CardFooter({ render, className, ...props }: PartProps<"div">): import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
18
+ export { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, type CardProps, CardTitle, cardVariants };
package/dist/card.js ADDED
@@ -0,0 +1 @@
1
+ export { t as Card, n as CardAction, r as CardContent, i as CardDescription, a as CardFooter, o as CardHeader, s as CardTitle, c as cardVariants } from "./card-tkP52GwZ.js";
@@ -0,0 +1,52 @@
1
+ import { PartProps } from "@ui-sdk/react/primitive";
2
+ import { ComponentProps, ReactElement, ReactNode } from "react";
3
+ import { DefaultLegendContentProps, Legend, Tooltip, TooltipContentProps, TooltipValueType } from "recharts";
4
+ /** One entry per series or slice. `color` is a CSS colour, normally a token such as `var(--chart-cat-1)`. */
5
+ type ChartConfig = Record<string, {
6
+ label?: ReactNode;
7
+ color?: string;
8
+ }>;
9
+ /** The colours charts draw with: one hue each for categories, one ramp for ordered values. */
10
+ declare const chartPalette: {
11
+ readonly categorical: string[];
12
+ readonly sequential: string[];
13
+ };
14
+ /** Spread onto a series (`<Bar {...useChartMotion()} />`) so it does not animate under reduced motion. */
15
+ declare function useChartMotion(): {
16
+ isAnimationActive: boolean;
17
+ };
18
+ type ChartContainerProps = Omit<PartProps<"div">, "children" | "aria-label"> & {
19
+ config: ChartConfig;
20
+ /** Names the chart. */
21
+ "aria-label": string;
22
+ /** Read after the name by assistive technology: what the chart shows, in a sentence. */
23
+ description?: string;
24
+ loading?: boolean;
25
+ empty?: boolean;
26
+ loadingLabel?: string;
27
+ emptyLabel?: string;
28
+ /** One recharts chart. */
29
+ children: ReactElement;
30
+ };
31
+ declare function ChartContainer({ config, description, loading, empty, loadingLabel, emptyLabel, children, render, className, style, onKeyDown, onPointerMove, onBlur, ...props }: ChartContainerProps): import("react").JSX.Element;
32
+ declare const ChartTooltip: typeof Tooltip;
33
+ declare function ChartLegend(props: ComponentProps<typeof Legend>): import("react").JSX.Element;
34
+ type Indicator = "dot" | "line" | "dashed";
35
+ type ChartTooltipContentProps = Partial<Pick<TooltipContentProps, "active" | "payload" | "label">> & {
36
+ hideLabel?: boolean;
37
+ /** The mark beside each series: a filled square, a bar, or a dashed rule. */
38
+ indicator?: Indicator;
39
+ /** Reads the `nameKey` of a pie slice from its data. */
40
+ nameKey?: string;
41
+ labelFormatter?: (label: ReactNode) => ReactNode;
42
+ valueFormatter?: (value: TooltipValueType) => ReactNode;
43
+ className?: string;
44
+ };
45
+ declare function ChartTooltipContent({ active, payload, label, hideLabel, indicator, nameKey, labelFormatter, valueFormatter, className }: ChartTooltipContentProps): import("react").JSX.Element | null;
46
+ type ChartLegendContentProps = Partial<Pick<DefaultLegendContentProps, "payload" | "verticalAlign">> & {
47
+ /** Reads the series name from the data of a pie slice. */
48
+ nameKey?: string;
49
+ className?: string;
50
+ };
51
+ declare function ChartLegendContent({ payload, verticalAlign, nameKey, className }: ChartLegendContentProps): import("react").JSX.Element | null;
52
+ export { type ChartConfig, ChartContainer, type ChartContainerProps, ChartLegend, ChartLegendContent, type ChartLegendContentProps, ChartTooltip, ChartTooltipContent, type ChartTooltipContentProps, chartPalette, useChartMotion };