@gouno/ui 0.3.2

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 (231) hide show
  1. package/CHANGELOG.md +120 -0
  2. package/LICENSE +21 -0
  3. package/README.md +144 -0
  4. package/dist/base.css +239 -0
  5. package/dist/bootstrap.js +22 -0
  6. package/dist/components/primitives/alert-dialog.d.ts +18 -0
  7. package/dist/components/primitives/alert-dialog.js +43 -0
  8. package/dist/components/primitives/alert.d.ts +9 -0
  9. package/dist/components/primitives/alert.js +25 -0
  10. package/dist/components/primitives/avatar.d.ts +14 -0
  11. package/dist/components/primitives/avatar.js +42 -0
  12. package/dist/components/primitives/badge.d.ts +9 -0
  13. package/dist/components/primitives/badge.js +25 -0
  14. package/dist/components/primitives/button.d.ts +10 -0
  15. package/dist/components/primitives/button.js +36 -0
  16. package/dist/components/primitives/checkbox.d.ts +4 -0
  17. package/dist/components/primitives/checkbox.js +10 -0
  18. package/dist/components/primitives/dialog.d.ts +20 -0
  19. package/dist/components/primitives/dialog.js +37 -0
  20. package/dist/components/primitives/dropdown-menu.d.ts +25 -0
  21. package/dist/components/primitives/dropdown-menu.js +51 -0
  22. package/dist/components/primitives/empty.d.ts +11 -0
  23. package/dist/components/primitives/empty.js +33 -0
  24. package/dist/components/primitives/field.d.ts +24 -0
  25. package/dist/components/primitives/field.js +75 -0
  26. package/dist/components/primitives/input.d.ts +3 -0
  27. package/dist/components/primitives/input.js +7 -0
  28. package/dist/components/primitives/label.d.ts +4 -0
  29. package/dist/components/primitives/label.js +8 -0
  30. package/dist/components/primitives/popover.d.ts +16 -0
  31. package/dist/components/primitives/popover.js +31 -0
  32. package/dist/components/primitives/radio-group.d.ts +5 -0
  33. package/dist/components/primitives/radio-group.js +13 -0
  34. package/dist/components/primitives/select.d.ts +15 -0
  35. package/dist/components/primitives/select.js +38 -0
  36. package/dist/components/primitives/separator.d.ts +4 -0
  37. package/dist/components/primitives/separator.js +8 -0
  38. package/dist/components/primitives/sheet.d.ts +17 -0
  39. package/dist/components/primitives/sheet.js +41 -0
  40. package/dist/components/primitives/skeleton.d.ts +2 -0
  41. package/dist/components/primitives/skeleton.js +6 -0
  42. package/dist/components/primitives/switch.d.ts +6 -0
  43. package/dist/components/primitives/switch.js +8 -0
  44. package/dist/components/primitives/table.d.ts +28 -0
  45. package/dist/components/primitives/table.js +44 -0
  46. package/dist/components/primitives/tabs.d.ts +11 -0
  47. package/dist/components/primitives/tabs.js +30 -0
  48. package/dist/components/primitives/textarea.d.ts +3 -0
  49. package/dist/components/primitives/textarea.js +7 -0
  50. package/dist/components/primitives/tooltip.d.ts +13 -0
  51. package/dist/components/primitives/tooltip.js +24 -0
  52. package/dist/core/affix.d.ts +14 -0
  53. package/dist/core/affix.js +29 -0
  54. package/dist/core/alert.d.ts +54 -0
  55. package/dist/core/alert.js +56 -0
  56. package/dist/core/anchor.d.ts +16 -0
  57. package/dist/core/anchor.js +31 -0
  58. package/dist/core/app.d.ts +5 -0
  59. package/dist/core/app.js +5 -0
  60. package/dist/core/aspect-ratio.d.ts +6 -0
  61. package/dist/core/aspect-ratio.js +6 -0
  62. package/dist/core/autocomplete.d.ts +24 -0
  63. package/dist/core/autocomplete.js +139 -0
  64. package/dist/core/avatar.d.ts +26 -0
  65. package/dist/core/avatar.js +20 -0
  66. package/dist/core/badge.d.ts +16 -0
  67. package/dist/core/badge.js +22 -0
  68. package/dist/core/breadcrumb.d.ts +55 -0
  69. package/dist/core/breadcrumb.js +69 -0
  70. package/dist/core/button.d.ts +49 -0
  71. package/dist/core/button.js +66 -0
  72. package/dist/core/calendar.d.ts +48 -0
  73. package/dist/core/calendar.js +179 -0
  74. package/dist/core/card.d.ts +30 -0
  75. package/dist/core/card.js +12 -0
  76. package/dist/core/carousel.d.ts +49 -0
  77. package/dist/core/carousel.js +166 -0
  78. package/dist/core/cascader.d.ts +19 -0
  79. package/dist/core/cascader.js +45 -0
  80. package/dist/core/code-block.d.ts +16 -0
  81. package/dist/core/code-block.js +47 -0
  82. package/dist/core/collapse.d.ts +49 -0
  83. package/dist/core/collapse.js +96 -0
  84. package/dist/core/color-picker.d.ts +9 -0
  85. package/dist/core/color-picker.js +8 -0
  86. package/dist/core/config-provider.d.ts +10 -0
  87. package/dist/core/config-provider.js +14 -0
  88. package/dist/core/control-types.d.ts +2 -0
  89. package/dist/core/control-types.js +7 -0
  90. package/dist/core/date-picker.d.ts +13 -0
  91. package/dist/core/date-picker.js +14 -0
  92. package/dist/core/date-range-picker.d.ts +26 -0
  93. package/dist/core/date-range-picker.js +10 -0
  94. package/dist/core/descriptions.d.ts +41 -0
  95. package/dist/core/descriptions.js +133 -0
  96. package/dist/core/drawer.d.ts +9 -0
  97. package/dist/core/drawer.js +58 -0
  98. package/dist/core/empty.d.ts +8 -0
  99. package/dist/core/empty.js +5 -0
  100. package/dist/core/feedback.d.ts +5 -0
  101. package/dist/core/feedback.js +5 -0
  102. package/dist/core/field.d.ts +15 -0
  103. package/dist/core/field.js +19 -0
  104. package/dist/core/float-button.d.ts +13 -0
  105. package/dist/core/float-button.js +22 -0
  106. package/dist/core/form.d.ts +19 -0
  107. package/dist/core/form.js +56 -0
  108. package/dist/core/icon-button.d.ts +7 -0
  109. package/dist/core/icon-button.js +4 -0
  110. package/dist/core/icon.d.ts +17 -0
  111. package/dist/core/icon.js +35 -0
  112. package/dist/core/image.d.ts +76 -0
  113. package/dist/core/image.js +189 -0
  114. package/dist/core/index.d.ts +79 -0
  115. package/dist/core/index.js +77 -0
  116. package/dist/core/input-number.d.ts +24 -0
  117. package/dist/core/input-number.js +70 -0
  118. package/dist/core/input-otp.d.ts +14 -0
  119. package/dist/core/input-otp.js +76 -0
  120. package/dist/core/input.d.ts +14 -0
  121. package/dist/core/input.js +51 -0
  122. package/dist/core/kbd.d.ts +8 -0
  123. package/dist/core/kbd.js +11 -0
  124. package/dist/core/layout-primitives.d.ts +11 -0
  125. package/dist/core/layout-primitives.js +8 -0
  126. package/dist/core/layout.d.ts +71 -0
  127. package/dist/core/layout.js +119 -0
  128. package/dist/core/list.d.ts +37 -0
  129. package/dist/core/list.js +35 -0
  130. package/dist/core/locale.d.ts +48 -0
  131. package/dist/core/locale.js +32 -0
  132. package/dist/core/mentions.d.ts +10 -0
  133. package/dist/core/mentions.js +112 -0
  134. package/dist/core/menu.d.ts +79 -0
  135. package/dist/core/menu.js +265 -0
  136. package/dist/core/message.d.ts +16 -0
  137. package/dist/core/message.js +36 -0
  138. package/dist/core/modal.d.ts +40 -0
  139. package/dist/core/modal.js +67 -0
  140. package/dist/core/notification.d.ts +15 -0
  141. package/dist/core/notification.js +39 -0
  142. package/dist/core/page-layout.d.ts +6 -0
  143. package/dist/core/page-layout.js +7 -0
  144. package/dist/core/pagination.d.ts +28 -0
  145. package/dist/core/pagination.js +69 -0
  146. package/dist/core/popconfirm.d.ts +13 -0
  147. package/dist/core/popconfirm.js +42 -0
  148. package/dist/core/progress.d.ts +6 -0
  149. package/dist/core/progress.js +8 -0
  150. package/dist/core/public-props.d.ts +82 -0
  151. package/dist/core/public-props.js +1 -0
  152. package/dist/core/qrcode.d.ts +14 -0
  153. package/dist/core/qrcode.js +17 -0
  154. package/dist/core/rate.d.ts +11 -0
  155. package/dist/core/rate.js +48 -0
  156. package/dist/core/result.d.ts +12 -0
  157. package/dist/core/result.js +19 -0
  158. package/dist/core/segmented.d.ts +29 -0
  159. package/dist/core/segmented.js +38 -0
  160. package/dist/core/select.d.ts +27 -0
  161. package/dist/core/select.js +143 -0
  162. package/dist/core/selection-controls.d.ts +12 -0
  163. package/dist/core/selection-controls.js +23 -0
  164. package/dist/core/separator.d.ts +24 -0
  165. package/dist/core/separator.js +17 -0
  166. package/dist/core/slider.d.ts +2 -0
  167. package/dist/core/slider.js +6 -0
  168. package/dist/core/spin.d.ts +7 -0
  169. package/dist/core/spin.js +7 -0
  170. package/dist/core/spinner.d.ts +3 -0
  171. package/dist/core/spinner.js +6 -0
  172. package/dist/core/splitter.d.ts +44 -0
  173. package/dist/core/splitter.js +208 -0
  174. package/dist/core/statistic.d.ts +12 -0
  175. package/dist/core/statistic.js +6 -0
  176. package/dist/core/steps.d.ts +54 -0
  177. package/dist/core/steps.js +106 -0
  178. package/dist/core/tabs.d.ts +40 -0
  179. package/dist/core/tabs.js +80 -0
  180. package/dist/core/tag.d.ts +19 -0
  181. package/dist/core/tag.js +29 -0
  182. package/dist/core/textarea.d.ts +8 -0
  183. package/dist/core/textarea.js +14 -0
  184. package/dist/core/time-picker.d.ts +9 -0
  185. package/dist/core/time-picker.js +8 -0
  186. package/dist/core/timeline.d.ts +37 -0
  187. package/dist/core/timeline.js +48 -0
  188. package/dist/core/tour.d.ts +18 -0
  189. package/dist/core/tour.js +51 -0
  190. package/dist/core/transfer.d.ts +16 -0
  191. package/dist/core/transfer.js +46 -0
  192. package/dist/core/tree-select.d.ts +19 -0
  193. package/dist/core/tree-select.js +19 -0
  194. package/dist/core/tree.d.ts +89 -0
  195. package/dist/core/tree.js +386 -0
  196. package/dist/core/typography.d.ts +20 -0
  197. package/dist/core/typography.js +12 -0
  198. package/dist/core/upload.d.ts +20 -0
  199. package/dist/core/upload.js +72 -0
  200. package/dist/core/watermark.d.ts +10 -0
  201. package/dist/core/watermark.js +21 -0
  202. package/dist/fonts/inter-LICENSE +93 -0
  203. package/dist/fonts/inter-latin-wght-normal.woff2 +0 -0
  204. package/dist/fonts/jetbrains-mono-LICENSE +93 -0
  205. package/dist/fonts/jetbrains-mono-latin-400-normal.woff2 +0 -0
  206. package/dist/gouno/app-shell.d.ts +22 -0
  207. package/dist/gouno/app-shell.js +27 -0
  208. package/dist/gouno/index.d.ts +4 -0
  209. package/dist/gouno/index.js +4 -0
  210. package/dist/gouno/page-container.d.ts +4 -0
  211. package/dist/gouno/page-container.js +6 -0
  212. package/dist/gouno/page-header.d.ts +8 -0
  213. package/dist/gouno/page-header.js +6 -0
  214. package/dist/hooks/use-overlay-body.d.ts +6 -0
  215. package/dist/hooks/use-overlay-body.js +18 -0
  216. package/dist/index.d.ts +5 -0
  217. package/dist/index.js +5 -0
  218. package/dist/lib/utils.d.ts +2 -0
  219. package/dist/lib/utils.js +5 -0
  220. package/dist/patterns/bulk-action-bar.d.ts +8 -0
  221. package/dist/patterns/bulk-action-bar.js +7 -0
  222. package/dist/patterns/index.d.ts +5 -0
  223. package/dist/patterns/index.js +5 -0
  224. package/dist/theme/index.d.ts +2 -0
  225. package/dist/theme/index.js +2 -0
  226. package/dist/theme/provider.d.ts +22 -0
  227. package/dist/theme/provider.js +76 -0
  228. package/dist/theme/theme-toggle.d.ts +6 -0
  229. package/dist/theme/theme-toggle.js +10 -0
  230. package/dist/tokens.css +164 -0
  231. package/package.json +111 -0
@@ -0,0 +1,24 @@
1
+ import { type InputHTMLAttributes, type ReactNode } from "react";
2
+ import { type ControlSize } from "./control-types.js";
3
+ type AutoCompleteOption = string | {
4
+ value: string;
5
+ label?: string;
6
+ disabled?: boolean;
7
+ };
8
+ type NormalizedAutoCompleteOption = {
9
+ value: string;
10
+ label: string;
11
+ disabled: boolean;
12
+ };
13
+ export interface AutoCompleteProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "value" | "defaultValue" | "onChange" | "onSelect" | "role" | "aria-expanded" | "aria-controls" | "aria-activedescendant" | "aria-autocomplete"> {
14
+ options: readonly AutoCompleteOption[];
15
+ value?: string;
16
+ defaultValue?: string;
17
+ onChange?: (value: string) => void;
18
+ onSelect?: (value: string, option: NormalizedAutoCompleteOption) => void;
19
+ emptyText?: ReactNode;
20
+ size?: ControlSize;
21
+ status?: "error" | "warning";
22
+ }
23
+ export declare const AutoComplete: import("react").ForwardRefExoticComponent<AutoCompleteProps & import("react").RefAttributes<HTMLInputElement>>;
24
+ export {};
@@ -0,0 +1,139 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { forwardRef, useId, useState, } from "react";
3
+ import { Input as PrimitiveInput } from "../components/primitives/input.js";
4
+ import { cn } from "../lib/utils.js";
5
+ import { controlSizeClass } from "./control-types.js";
6
+ function normalizeOptions(options) {
7
+ return options.map((option) => typeof option === "string"
8
+ ? { value: option, label: option, disabled: false }
9
+ : {
10
+ value: option.value,
11
+ label: option.label ?? option.value,
12
+ disabled: option.disabled ?? false,
13
+ });
14
+ }
15
+ function filterOptions(options, input) {
16
+ const query = input.toLocaleLowerCase();
17
+ return options.filter((option) => option.value.toLocaleLowerCase().includes(query) ||
18
+ option.label.toLocaleLowerCase().includes(query));
19
+ }
20
+ function firstEnabledIndex(options) {
21
+ return options.findIndex((option) => !option.disabled);
22
+ }
23
+ function lastEnabledIndex(options) {
24
+ for (let index = options.length - 1; index >= 0; index -= 1) {
25
+ if (!options[index]?.disabled)
26
+ return index;
27
+ }
28
+ return -1;
29
+ }
30
+ function moveEnabledIndex(options, current, delta) {
31
+ if (options.length === 0)
32
+ return -1;
33
+ let index = current;
34
+ for (let offset = 0; offset < options.length; offset += 1) {
35
+ index = (index + delta + options.length) % options.length;
36
+ if (!options[index]?.disabled)
37
+ return index;
38
+ }
39
+ return -1;
40
+ }
41
+ export const AutoComplete = forwardRef(function AutoComplete({ options, value, defaultValue = "", onChange, onSelect, emptyText, size = "middle", status, className, disabled, readOnly, onFocus, onBlur, onKeyDown, ...props }, ref) {
42
+ const [inner, setInner] = useState(defaultValue);
43
+ const [open, setOpen] = useState(false);
44
+ const [highlighted, setHighlighted] = useState(-1);
45
+ const listboxId = useId();
46
+ const current = value ?? inner;
47
+ const normalized = normalizeOptions(options);
48
+ const matches = filterOptions(normalized, current);
49
+ const fallbackIndex = firstEnabledIndex(matches);
50
+ const activeIndex = highlighted >= 0 &&
51
+ highlighted < matches.length &&
52
+ !matches[highlighted]?.disabled
53
+ ? highlighted
54
+ : fallbackIndex;
55
+ const popupOpen = open && !disabled && !readOnly && (matches.length > 0 || emptyText != null);
56
+ const update = (next) => {
57
+ if (value === undefined)
58
+ setInner(next);
59
+ onChange?.(next);
60
+ };
61
+ const choose = (option) => {
62
+ if (option.disabled || disabled || readOnly)
63
+ return;
64
+ update(option.value);
65
+ onSelect?.(option.value, option);
66
+ setOpen(false);
67
+ setHighlighted(-1);
68
+ };
69
+ const handleKeyDown = (event) => {
70
+ onKeyDown?.(event);
71
+ if (event.defaultPrevented || disabled || readOnly)
72
+ return;
73
+ if (event.key === "ArrowDown") {
74
+ event.preventDefault();
75
+ if (!open) {
76
+ setOpen(true);
77
+ setHighlighted(fallbackIndex);
78
+ }
79
+ else {
80
+ setHighlighted(moveEnabledIndex(matches, activeIndex, 1));
81
+ }
82
+ }
83
+ else if (event.key === "ArrowUp") {
84
+ event.preventDefault();
85
+ if (!open) {
86
+ setOpen(true);
87
+ setHighlighted(lastEnabledIndex(matches));
88
+ }
89
+ else {
90
+ setHighlighted(moveEnabledIndex(matches, activeIndex, -1));
91
+ }
92
+ }
93
+ else if (event.key === "Home" && open) {
94
+ event.preventDefault();
95
+ setHighlighted(firstEnabledIndex(matches));
96
+ }
97
+ else if (event.key === "End" && open) {
98
+ event.preventDefault();
99
+ setHighlighted(lastEnabledIndex(matches));
100
+ }
101
+ else if (event.key === "Enter" && popupOpen && activeIndex >= 0) {
102
+ event.preventDefault();
103
+ const option = matches[activeIndex];
104
+ if (option)
105
+ choose(option);
106
+ }
107
+ else if (event.key === "Escape" && open) {
108
+ event.preventDefault();
109
+ setOpen(false);
110
+ setHighlighted(-1);
111
+ }
112
+ };
113
+ return (_jsxs("div", { "data-slot": "auto-complete", className: "relative min-w-0", children: [_jsx(PrimitiveInput, { ...props, ref: ref, "data-slot": "auto-complete-input", role: "combobox", "aria-expanded": popupOpen, "aria-controls": popupOpen ? listboxId : undefined, "aria-autocomplete": "list", "aria-activedescendant": popupOpen && activeIndex >= 0
114
+ ? `${listboxId}-option-${activeIndex}`
115
+ : undefined, "aria-invalid": status === "error" ? true : props["aria-invalid"] || undefined, "data-status": status, value: current, disabled: disabled, readOnly: readOnly, onFocus: (event) => {
116
+ onFocus?.(event);
117
+ if (!event.defaultPrevented && !disabled && !readOnly) {
118
+ setOpen(true);
119
+ setHighlighted(fallbackIndex);
120
+ }
121
+ }, onBlur: (event) => {
122
+ onBlur?.(event);
123
+ setOpen(false);
124
+ setHighlighted(-1);
125
+ }, onKeyDown: handleKeyDown, onChange: (event) => {
126
+ const next = event.target.value;
127
+ update(next);
128
+ setOpen(true);
129
+ setHighlighted(firstEnabledIndex(filterOptions(normalized, next)));
130
+ }, className: cn("bg-input text-foreground placeholder:text-muted-foreground", controlSizeClass(size), status === "warning" &&
131
+ "border-warning focus-visible:ring-warning/30", className) }), popupOpen ? (_jsx("ul", { id: listboxId, role: "listbox", "data-slot": "auto-complete-popup", className: "absolute z-50 mt-1 max-h-48 w-full overflow-auto rounded-md border bg-popover p-1 text-popover-foreground shadow-overlay", children: matches.length > 0
132
+ ? matches.map((option, index) => (_jsx("li", { id: `${listboxId}-option-${index}`, role: "option", "aria-selected": option.value === current, "aria-disabled": option.disabled || undefined, "data-slot": "auto-complete-option", "data-highlighted": index === activeIndex || undefined, className: cn("cursor-pointer rounded px-2 py-1.5 text-sm", index === activeIndex && "bg-accent text-accent-foreground", option.disabled
133
+ ? "cursor-not-allowed opacity-50"
134
+ : "hover:bg-accent hover:text-accent-foreground"), onMouseDown: (event) => {
135
+ event.preventDefault();
136
+ choose(option);
137
+ }, children: option.label }, `${option.value}-${index}`)))
138
+ : emptyText != null && (_jsx("li", { role: "presentation", "data-slot": "auto-complete-empty", className: "px-2 py-1.5 text-sm text-muted-foreground", children: emptyText })) })) : null] }));
139
+ });
@@ -0,0 +1,26 @@
1
+ import { type ComponentProps, type ComponentPropsWithoutRef, type ReactNode } from "react";
2
+ import { Avatar as PrimitiveAvatar, AvatarGroup as PrimitiveAvatarGroup } from "../components/primitives/avatar.js";
3
+ import type { ControlSize } from "./control-types.js";
4
+ export type AvatarSize = ControlSize | number;
5
+ export type AvatarShape = "circle" | "square";
6
+ /** @deprecated Use `small`, `middle`, `large`, or a numeric size. */
7
+ export type AvatarLegacySize = "sm" | "default" | "lg";
8
+ export interface AvatarProps extends Omit<ComponentPropsWithoutRef<typeof PrimitiveAvatar>, "size" | "shape"> {
9
+ size?: AvatarSize | AvatarLegacySize;
10
+ shape?: AvatarShape;
11
+ }
12
+ export declare const Avatar: import("react").ForwardRefExoticComponent<AvatarProps & import("react").RefAttributes<HTMLSpanElement>>;
13
+ export declare const AvatarImage: import("react").ForwardRefExoticComponent<Omit<import("@radix-ui/react-avatar").AvatarImageProps & import("react").RefAttributes<HTMLImageElement>, "ref"> & import("react").RefAttributes<HTMLImageElement>>;
14
+ export declare const AvatarFallback: import("react").ForwardRefExoticComponent<Omit<import("@radix-ui/react-avatar").AvatarFallbackProps & import("react").RefAttributes<HTMLSpanElement>, "ref"> & import("react").RefAttributes<HTMLSpanElement>>;
15
+ export declare const AvatarBadge: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & import("react").RefAttributes<HTMLSpanElement>>;
16
+ export declare const AvatarGroupCount: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
17
+ export type AvatarImageProps = ComponentProps<typeof AvatarImage>;
18
+ export type AvatarFallbackProps = ComponentProps<typeof AvatarFallback>;
19
+ export type AvatarBadgeProps = ComponentProps<typeof AvatarBadge>;
20
+ export type AvatarGroupCountProps = ComponentProps<typeof AvatarGroupCount>;
21
+ export interface AvatarGroupProps extends Omit<ComponentPropsWithoutRef<typeof PrimitiveAvatarGroup>, "children"> {
22
+ children?: ReactNode;
23
+ max?: number;
24
+ overflowRender?: (omittedCount: number) => ReactNode;
25
+ }
26
+ export declare const AvatarGroup: import("react").ForwardRefExoticComponent<AvatarGroupProps & import("react").RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,20 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Children, forwardRef, } from "react";
3
+ import { Avatar as PrimitiveAvatar, AvatarBadge as PrimitiveAvatarBadge, AvatarFallback as PrimitiveAvatarFallback, AvatarGroup as PrimitiveAvatarGroup, AvatarGroupCount as PrimitiveAvatarGroupCount, AvatarImage as PrimitiveAvatarImage, } from "../components/primitives/avatar.js";
4
+ export const Avatar = forwardRef(function Avatar(props, ref) {
5
+ return _jsx(PrimitiveAvatar, { ...props, ref: ref });
6
+ });
7
+ export const AvatarImage = PrimitiveAvatarImage;
8
+ export const AvatarFallback = PrimitiveAvatarFallback;
9
+ export const AvatarBadge = PrimitiveAvatarBadge;
10
+ export const AvatarGroupCount = PrimitiveAvatarGroupCount;
11
+ export const AvatarGroup = forwardRef(function AvatarGroup({ children, max, overflowRender, ...props }, ref) {
12
+ const items = Children.toArray(children);
13
+ const finiteMax = max !== undefined && Number.isFinite(max)
14
+ ? Math.max(1, Math.floor(max))
15
+ : undefined;
16
+ const hasOverflow = finiteMax !== undefined && items.length > finiteMax;
17
+ const visibleCount = hasOverflow ? Math.max(0, finiteMax - 1) : items.length;
18
+ const omittedCount = items.length - visibleCount;
19
+ return (_jsxs(PrimitiveAvatarGroup, { ...props, ref: ref, "data-max": finiteMax, "data-overflow": hasOverflow || undefined, children: [items.slice(0, visibleCount), hasOverflow ? (_jsx(PrimitiveAvatarGroupCount, { children: overflowRender ? overflowRender(omittedCount) : `+${omittedCount}` })) : null] }));
20
+ });
@@ -0,0 +1,16 @@
1
+ import type { HTMLAttributes, ReactNode } from "react";
2
+ export type BadgeStatus = "success" | "processing" | "default" | "error" | "warning";
3
+ export type BadgeSize = "default" | "small";
4
+ export interface BadgeProps extends Omit<HTMLAttributes<HTMLSpanElement>, "color"> {
5
+ count?: ReactNode;
6
+ dot?: boolean;
7
+ showZero?: boolean;
8
+ overflowCount?: number;
9
+ status?: BadgeStatus;
10
+ text?: ReactNode;
11
+ color?: string;
12
+ size?: BadgeSize;
13
+ offset?: [number, number];
14
+ children?: ReactNode;
15
+ }
16
+ export declare function Badge({ count, dot, showZero, overflowCount, status, text, color, size, offset, children, className, style, title, ...props }: BadgeProps): import("react").JSX.Element;
@@ -0,0 +1,22 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { cn } from "../lib/utils.js";
3
+ const statusColor = {
4
+ success: "bg-success",
5
+ processing: "bg-primary",
6
+ default: "bg-muted-foreground",
7
+ error: "bg-destructive",
8
+ warning: "bg-warning",
9
+ };
10
+ export function Badge({ count, dot = false, showZero = false, overflowCount = 99, status, text, color, size = "default", offset, children, className, style, title, ...props }) {
11
+ if ((status || color) && children === undefined && count === undefined && !dot) {
12
+ return _jsxs("span", { ...props, className: cn("inline-flex items-center gap-2 text-sm", className), style: style, children: [_jsx("span", { "aria-hidden": "true", className: cn("size-2 rounded-full", status && statusColor[status], status === "processing" && "animate-pulse"), style: color ? { backgroundColor: color } : undefined }), text !== undefined ? _jsx("span", { children: text }) : null] });
13
+ }
14
+ const numericCount = typeof count === "number" ? count : undefined;
15
+ const hidden = !dot && (count === undefined || (numericCount === 0 && !showZero));
16
+ const display = dot ? null : numericCount !== undefined && numericCount > overflowCount ? `${overflowCount}+` : count;
17
+ const indicatorStyle = { backgroundColor: color, marginTop: offset?.[1], marginInlineStart: offset?.[0] };
18
+ const indicator = hidden ? null : _jsx("sup", { role: "status", "aria-label": title ?? (dot ? "notification" : String(display)), title: title ?? (display === null ? undefined : String(display)), className: cn("z-10 inline-flex items-center justify-center rounded-full bg-destructive text-destructive-foreground ring-2 ring-background", dot ? "size-2 p-0" : size === "small" ? "min-w-4 px-1 text-[10px] leading-4" : "min-w-5 px-1.5 text-xs leading-5", children && "absolute right-0 top-0 translate-x-1/2 -translate-y-1/2"), style: indicatorStyle, children: display });
19
+ if (children !== undefined)
20
+ return _jsxs("span", { ...props, className: cn("relative inline-flex", className), style: style, children: [children, indicator] });
21
+ return _jsx("span", { ...props, className: cn("inline-flex", className), style: style, children: indicator });
22
+ }
@@ -0,0 +1,55 @@
1
+ import { type CSSProperties, type HTMLAttributes, type Key, type MouseEvent, type ReactNode, type Ref } from "react";
2
+ export interface BreadcrumbMenuItem {
3
+ key: Key;
4
+ title: ReactNode;
5
+ href?: string;
6
+ disabled?: boolean;
7
+ onClick?: () => void;
8
+ }
9
+ export interface BreadcrumbMenu {
10
+ items: readonly BreadcrumbMenuItem[];
11
+ "aria-label"?: string;
12
+ }
13
+ export interface BreadcrumbRouteItem {
14
+ key: Key;
15
+ title: ReactNode;
16
+ href?: string;
17
+ path?: string;
18
+ className?: string;
19
+ style?: CSSProperties;
20
+ menu?: BreadcrumbMenu;
21
+ onClick?: (event: MouseEvent<HTMLElement>) => void;
22
+ }
23
+ export interface BreadcrumbSeparatorItem {
24
+ key: Key;
25
+ type: "separator";
26
+ separator?: ReactNode;
27
+ }
28
+ export type BreadcrumbItem = BreadcrumbRouteItem | BreadcrumbSeparatorItem;
29
+ export type BreadcrumbSemantic = "root" | "item" | "separator";
30
+ export interface BreadcrumbSemanticInfo {
31
+ props: Readonly<{
32
+ itemCount: number;
33
+ }>;
34
+ }
35
+ export type BreadcrumbClassNames = Partial<Record<BreadcrumbSemantic, string>> | ((info: BreadcrumbSemanticInfo) => Partial<Record<BreadcrumbSemantic, string>>);
36
+ export type BreadcrumbStyles = Partial<Record<BreadcrumbSemantic, CSSProperties>> | ((info: BreadcrumbSemanticInfo) => Partial<Record<BreadcrumbSemantic, CSSProperties>>);
37
+ export interface BreadcrumbItemRenderInfo {
38
+ item: BreadcrumbRouteItem;
39
+ index: number;
40
+ items: readonly BreadcrumbItem[];
41
+ paths: readonly string[];
42
+ href?: string;
43
+ isLast: boolean;
44
+ }
45
+ export interface BreadcrumbProps extends Omit<HTMLAttributes<HTMLElement>, "children"> {
46
+ items: readonly BreadcrumbItem[];
47
+ separator?: ReactNode;
48
+ dropdownIcon?: ReactNode;
49
+ params?: Readonly<Record<string, string | number>>;
50
+ itemRender?: (info: BreadcrumbItemRenderInfo) => ReactNode;
51
+ classNames?: BreadcrumbClassNames;
52
+ styles?: BreadcrumbStyles;
53
+ ref?: Ref<HTMLElement>;
54
+ }
55
+ export declare function Breadcrumb({ items, separator, dropdownIcon, params, itemRender, classNames, styles, className, style, "aria-label": breadcrumbLabel, ref, ...props }: BreadcrumbProps): import("react").JSX.Element;
@@ -0,0 +1,69 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import {} from "react";
3
+ import { ChevronDown } from "lucide-react";
4
+ import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger, } from "../components/primitives/dropdown-menu.js";
5
+ import { cn } from "../lib/utils.js";
6
+ function isSeparatorItem(item) {
7
+ return "type" in item && item.type === "separator";
8
+ }
9
+ function interpolatePath(path, params) {
10
+ return path.replace(/:([A-Za-z0-9_]+)/g, (match, name) => name in params ? encodeURIComponent(String(params[name])) : match);
11
+ }
12
+ function joinRoutePaths(paths) {
13
+ const joined = paths
14
+ .filter(Boolean)
15
+ .map((path) => path.replace(/^\/+|\/+$/g, ""))
16
+ .filter(Boolean)
17
+ .join("/");
18
+ return joined ? `/${joined}` : "/";
19
+ }
20
+ function routeEntries(items) {
21
+ return items.filter((item) => !isSeparatorItem(item));
22
+ }
23
+ function menuItemNode(item) {
24
+ const content = (_jsx("span", { className: "flex min-w-0 items-center gap-2", children: _jsx("span", { className: "min-w-0 truncate", children: item.title }) }));
25
+ if (item.href) {
26
+ return (_jsx(DropdownMenuItem, { asChild: true, disabled: item.disabled, children: _jsx("a", { href: item.href, onClick: (event) => {
27
+ if (item.disabled) {
28
+ event.preventDefault();
29
+ return;
30
+ }
31
+ item.onClick?.();
32
+ }, children: content }) }, item.key));
33
+ }
34
+ return (_jsx(DropdownMenuItem, { disabled: item.disabled, onSelect: () => item.onClick?.(), children: content }, item.key));
35
+ }
36
+ export function Breadcrumb({ items, separator = "/", dropdownIcon = _jsx(ChevronDown, { "aria-hidden": "true" }), params = {}, itemRender, classNames, styles, className, style, "aria-label": breadcrumbLabel = "Breadcrumb", ref, ...props }) {
37
+ const routes = routeEntries(items);
38
+ const semanticInfo = {
39
+ props: { itemCount: routes.length },
40
+ };
41
+ const semanticClassNames = typeof classNames === "function" ? classNames(semanticInfo) : (classNames ?? {});
42
+ const semanticStyles = typeof styles === "function" ? styles(semanticInfo) : (styles ?? {});
43
+ const paths = [];
44
+ let routeIndex = -1;
45
+ return (_jsx("nav", { ...props, ref: ref, "aria-label": breadcrumbLabel, "data-slot": "breadcrumb", className: cn("min-w-0", semanticClassNames.root, className), style: { ...semanticStyles.root, ...style }, children: _jsx("ol", { className: "m-0 flex min-w-0 list-none flex-wrap items-center gap-x-2 gap-y-1 p-0 text-sm text-muted-foreground", children: items.map((item, itemIndex) => {
46
+ if (isSeparatorItem(item)) {
47
+ return (_jsx("li", { "aria-hidden": "true", "data-slot": "breadcrumb-separator", className: cn("flex shrink-0 items-center text-muted-foreground/80", semanticClassNames.separator), style: semanticStyles.separator, children: item.separator ?? separator }, item.key));
48
+ }
49
+ routeIndex += 1;
50
+ const hasPath = item.path !== undefined;
51
+ if (hasPath)
52
+ paths.push(interpolatePath(item.path ?? "", params));
53
+ const href = item.href ?? (hasPath ? joinRoutePaths(paths) : undefined);
54
+ const isLast = routeIndex === routes.length - 1;
55
+ const previousItem = items[itemIndex - 1];
56
+ const hasExplicitLeadingSeparator = previousItem !== undefined && isSeparatorItem(previousItem);
57
+ const rendered = itemRender?.({
58
+ item,
59
+ index: routeIndex,
60
+ items,
61
+ paths: [...paths],
62
+ href,
63
+ isLast,
64
+ });
65
+ const titleNode = rendered ??
66
+ (href ? (_jsx("a", { href: href, onClick: (event) => item.onClick?.(event), "aria-current": isLast ? "page" : undefined, className: "inline-flex min-w-0 items-center gap-1 rounded-sm text-inherit transition-colors hover:text-foreground hover:underline focus-visible:text-foreground", children: _jsx("span", { className: "min-w-0 truncate", children: item.title }) })) : (_jsx("span", { "aria-current": isLast ? "page" : undefined, className: cn("inline-flex min-w-0 items-center gap-1 truncate", isLast && "text-foreground"), children: item.title })));
67
+ return (_jsxs("li", { "data-slot": "breadcrumb-item", className: cn("flex min-w-0 items-center gap-2", semanticClassNames.item, item.className), style: { ...semanticStyles.item, ...item.style }, children: [routeIndex > 0 && !hasExplicitLeadingSeparator ? (_jsx("span", { "aria-hidden": "true", "data-slot": "breadcrumb-separator", className: cn("flex shrink-0 items-center text-muted-foreground/80", semanticClassNames.separator), style: semanticStyles.separator, children: separator })) : null, _jsxs("span", { className: "flex min-w-0 items-center gap-1", children: [titleNode, item.menu ? (_jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsx("button", { type: "button", "aria-label": item.menu["aria-label"] ?? "Open breadcrumb menu", className: "inline-flex size-6 shrink-0 items-center justify-center rounded-sm text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", children: _jsx("span", { className: "flex size-4 items-center justify-center [&_svg]:size-3.5", children: dropdownIcon }) }) }), _jsx(DropdownMenuContent, { align: "start", children: item.menu.items.map(menuItemNode) })] })) : null] })] }, item.key));
68
+ }) }) }));
69
+ }
@@ -0,0 +1,49 @@
1
+ import { type AnchorHTMLAttributes, type ButtonHTMLAttributes, type ComponentType, type ReactNode, type Ref } from "react";
2
+ export type ButtonVariant = "solid" | "outline" | "ghost" | "link" | "text" | "dashed";
3
+ export type ButtonColor = "default" | "primary" | "success" | "warning" | "error" | "info";
4
+ export type ButtonSize = "small" | "middle" | "large";
5
+ export type ButtonIconPlacement = "start" | "end";
6
+ export type ButtonShape = "default" | "round" | "circle";
7
+ export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
8
+ variant?: ButtonVariant;
9
+ color?: ButtonColor;
10
+ size?: ButtonSize;
11
+ loading?: boolean;
12
+ loadingText?: ReactNode;
13
+ icon?: ReactNode;
14
+ iconPlacement?: ButtonIconPlacement;
15
+ shape?: ButtonShape;
16
+ block?: boolean;
17
+ ref?: Ref<HTMLButtonElement>;
18
+ }
19
+ export declare function Button({ variant, color, size, loading, loadingText, icon, iconPlacement, shape, block, children, disabled, className, type, ...props }: ButtonProps): import("react").JSX.Element;
20
+ export interface LinkAdapterProps extends AnchorHTMLAttributes<HTMLAnchorElement> {
21
+ to: string;
22
+ ref?: Ref<HTMLAnchorElement>;
23
+ }
24
+ export declare function NavigationProvider({ link, children }: {
25
+ link: ComponentType<LinkAdapterProps>;
26
+ children: ReactNode;
27
+ }): import("react").JSX.Element;
28
+ export interface ButtonLinkProps extends Omit<LinkAdapterProps, "to"> {
29
+ to?: string;
30
+ href?: string;
31
+ variant?: ButtonVariant;
32
+ color?: ButtonColor;
33
+ size?: ButtonSize;
34
+ icon?: ReactNode;
35
+ iconPlacement?: ButtonIconPlacement;
36
+ shape?: ButtonShape;
37
+ disabled?: boolean;
38
+ loading?: boolean;
39
+ loadingText?: ReactNode;
40
+ block?: boolean;
41
+ }
42
+ export declare function ButtonLink({ to, href, variant, color, size, icon, iconPlacement, shape, disabled, loading, loadingText, block, children, onClick, className, ...props }: ButtonLinkProps): import("react").JSX.Element;
43
+ export declare function IconButtonLink({ label, icon, className, variant, ...props }: ButtonLinkProps & {
44
+ label: string;
45
+ icon: ReactNode;
46
+ }): import("react").JSX.Element;
47
+ export declare function ChoiceButton({ selected, className, ...props }: ButtonProps & {
48
+ selected?: boolean;
49
+ }): import("react").JSX.Element;
@@ -0,0 +1,66 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { createContext, useContext, } from "react";
3
+ import { LoaderCircle } from "lucide-react";
4
+ import { Button as PrimitiveButton } from "../components/primitives/button.js";
5
+ import { cn } from "../lib/utils.js";
6
+ const variants = { solid: "default", outline: "outline", dashed: "outline", ghost: "ghost", text: "ghost", link: "link" };
7
+ const sizes = { small: "sm", middle: "default", large: "lg" };
8
+ const shapeClass = { default: undefined, round: "rounded-full", circle: "rounded-full aspect-square px-0" };
9
+ const solidColorClass = {
10
+ primary: "bg-primary text-primary-foreground hover:bg-primary/90 focus-visible:ring-primary/20",
11
+ success: "bg-success text-background hover:bg-success/90 focus-visible:ring-success/20",
12
+ warning: "bg-warning text-background hover:bg-warning/90 focus-visible:ring-warning/20",
13
+ error: "bg-destructive text-destructive-foreground hover:bg-destructive/90 focus-visible:ring-destructive/20",
14
+ info: "bg-info text-background hover:bg-info/90 focus-visible:ring-info/20",
15
+ };
16
+ const outlineColorClass = {
17
+ primary: "border-primary text-primary hover:bg-accent hover:text-accent-foreground focus-visible:ring-primary/20",
18
+ success: "border-success/50 text-success hover:bg-success-subtle focus-visible:ring-success/20",
19
+ warning: "border-warning/50 text-warning hover:bg-warning-subtle focus-visible:ring-warning/20",
20
+ error: "border-destructive/50 text-destructive hover:bg-danger-subtle focus-visible:ring-destructive/20",
21
+ info: "border-info/50 text-info hover:bg-info-subtle focus-visible:ring-info/20",
22
+ };
23
+ const ghostColorClass = {
24
+ primary: "text-primary hover:bg-accent hover:text-accent-foreground focus-visible:ring-primary/20",
25
+ success: "text-success hover:bg-success-subtle focus-visible:ring-success/20",
26
+ warning: "text-warning hover:bg-warning-subtle focus-visible:ring-warning/20",
27
+ error: "text-destructive hover:bg-danger-subtle focus-visible:ring-destructive/20",
28
+ info: "text-info hover:bg-info-subtle focus-visible:ring-info/20",
29
+ };
30
+ const linkColorClass = {
31
+ primary: "text-primary focus-visible:ring-primary/20",
32
+ success: "text-success focus-visible:ring-success/20",
33
+ warning: "text-warning focus-visible:ring-warning/20",
34
+ error: "text-destructive focus-visible:ring-destructive/20",
35
+ info: "text-info focus-visible:ring-info/20",
36
+ };
37
+ function resolveColorClass(variant, color) {
38
+ if (color === "default")
39
+ return undefined;
40
+ if (variant === "solid")
41
+ return solidColorClass[color];
42
+ if (variant === "outline" || variant === "dashed")
43
+ return outlineColorClass[color];
44
+ if (variant === "link")
45
+ return linkColorClass[color];
46
+ return ghostColorClass[color];
47
+ }
48
+ export function Button({ variant = "outline", color = "default", size = "middle", loading = false, loadingText, icon, iconPlacement = "start", shape = "default", block = false, children, disabled, className, type = "button", ...props }) {
49
+ const hasLabel = children !== undefined && children !== null && children !== "";
50
+ const primitiveVariant = color === "error" && variant === "solid" ? "destructive" : variants[variant];
51
+ return _jsxs(PrimitiveButton, { ...props, type: type, variant: primitiveVariant, size: sizes[size], disabled: disabled || loading, "aria-busy": loading || undefined, className: cn(resolveColorClass(variant, color), variant === "dashed" && "border-dashed", shapeClass[shape], block && "w-full", className), children: [loading ? _jsx(LoaderCircle, { className: "animate-spin", "aria-hidden": "true" }) : icon && iconPlacement === "start" ? _jsx("span", { className: "btn__icon", "aria-hidden": "true", children: icon }) : null, hasLabel || loadingText ? _jsx("span", { children: loading && loadingText ? loadingText : children }) : null, !loading && icon && iconPlacement === "end" ? _jsx("span", { className: "btn__icon", "aria-hidden": "true", children: icon }) : null] });
52
+ }
53
+ const LinkContext = createContext(({ to, ...props }) => _jsx("a", { href: to, ...props }));
54
+ export function NavigationProvider({ link, children }) { return _jsx(LinkContext.Provider, { value: link, children: children }); }
55
+ export function ButtonLink({ to, href, variant = "link", color = "default", size = "middle", icon, iconPlacement = "start", shape = "default", disabled, loading, loadingText, block, children, onClick, className, ...props }) {
56
+ const Link = useContext(LinkContext);
57
+ const inactive = disabled || loading;
58
+ const hasLabel = children !== undefined && children !== null && children !== "";
59
+ const primitiveVariant = color === "error" && variant === "solid" ? "destructive" : variants[variant];
60
+ return _jsx(PrimitiveButton, { asChild: true, variant: primitiveVariant, size: sizes[size], children: _jsxs(Link, { ...props, to: to ?? href ?? "#", className: cn(resolveColorClass(variant, color), variant === "dashed" && "border-dashed", shapeClass[shape], block && "w-full", inactive && "pointer-events-none opacity-50", className), "aria-disabled": inactive || undefined, "aria-busy": loading || undefined, tabIndex: inactive ? -1 : props.tabIndex, onClick: (event) => { if (inactive) {
61
+ event.preventDefault();
62
+ return;
63
+ } onClick?.(event); }, children: [loading ? _jsx(LoaderCircle, { className: "animate-spin", "aria-hidden": "true" }) : icon && iconPlacement === "start" ? _jsx("span", { className: "btn__icon", "aria-hidden": "true", children: icon }) : null, hasLabel || loadingText ? _jsx("span", { children: loading && loadingText ? loadingText : children }) : null, !loading && icon && iconPlacement === "end" ? _jsx("span", { className: "btn__icon", "aria-hidden": "true", children: icon }) : null] }) });
64
+ }
65
+ export function IconButtonLink({ label, icon, className, variant = "outline", ...props }) { return _jsx(ButtonLink, { ...props, size: "small", shape: "circle", icon: icon, variant: variant, className: cn("icon-button", className), "aria-label": label, title: label }); }
66
+ export function ChoiceButton({ selected, className, ...props }) { return _jsx(Button, { ...props, className: cn("justify-start", className), variant: selected ? "solid" : "ghost", color: selected ? "primary" : "default", "aria-pressed": selected }); }
@@ -0,0 +1,48 @@
1
+ import { type CSSProperties, type HTMLAttributes, type ReactNode, type Ref } from "react";
2
+ export type CalendarMode = "month" | "year";
3
+ export type CalendarSelectSource = "year" | "month" | "date" | "customize";
4
+ export type CalendarSemantic = "root" | "header" | "body" | "weekHeader" | "weekNumber" | "cell" | "cellInner";
5
+ export interface CalendarCellInfo {
6
+ originNode: ReactNode;
7
+ today: Date;
8
+ mode: CalendarMode;
9
+ range?: "start" | "end";
10
+ }
11
+ export interface CalendarHeaderRenderProps {
12
+ value: Date;
13
+ mode: CalendarMode;
14
+ onChange: (date: Date) => void;
15
+ onModeChange: (mode: CalendarMode) => void;
16
+ }
17
+ export interface CalendarSemanticInfo {
18
+ props: Readonly<{
19
+ mode: CalendarMode;
20
+ fullscreen: boolean;
21
+ showWeek: boolean;
22
+ }>;
23
+ }
24
+ export type CalendarClassNames = Partial<Record<CalendarSemantic, string>> | ((info: CalendarSemanticInfo) => Partial<Record<CalendarSemantic, string>>);
25
+ export type CalendarStyles = Partial<Record<CalendarSemantic, CSSProperties>> | ((info: CalendarSemanticInfo) => Partial<Record<CalendarSemantic, CSSProperties>>);
26
+ export interface CalendarProps extends Omit<HTMLAttributes<HTMLDivElement>, "children" | "defaultValue" | "onChange" | "onSelect"> {
27
+ value?: Date;
28
+ defaultValue?: Date;
29
+ mode?: CalendarMode;
30
+ defaultMode?: CalendarMode;
31
+ fullscreen?: boolean;
32
+ showWeek?: boolean;
33
+ disabledDate?: (date: Date) => boolean;
34
+ validRange?: readonly [Date, Date];
35
+ locale?: string;
36
+ cellRender?: (date: Date, info: CalendarCellInfo) => ReactNode;
37
+ fullCellRender?: (date: Date, info: CalendarCellInfo) => ReactNode;
38
+ headerRender?: (props: CalendarHeaderRenderProps) => ReactNode;
39
+ onChange?: (date: Date) => void;
40
+ onPanelChange?: (date: Date, mode: CalendarMode) => void;
41
+ onSelect?: (date: Date, info: {
42
+ source: CalendarSelectSource;
43
+ }) => void;
44
+ classNames?: CalendarClassNames;
45
+ styles?: CalendarStyles;
46
+ ref?: Ref<HTMLDivElement>;
47
+ }
48
+ export declare function Calendar({ value, defaultValue, mode, defaultMode, fullscreen, showWeek, disabledDate, validRange, locale, cellRender, fullCellRender, headerRender, onChange, onPanelChange, onSelect, classNames, styles, className, style, ref, ...props }: CalendarProps): import("react").JSX.Element;