@optimum-intelligence/opti-ui 0.0.0-stage → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +23 -0
- package/README.md +244 -2
- package/dist/components/accordion/Accordion.d.ts +17 -0
- package/dist/components/accordion/Accordion.js +204 -0
- package/dist/components/accordion/Accordion.js.map +1 -0
- package/dist/components/alert/Alert.d.ts +18 -0
- package/dist/components/alert/Alert.js +164 -0
- package/dist/components/alert/Alert.js.map +1 -0
- package/dist/components/app-shell/AppShell.d.ts +97 -0
- package/dist/components/app-shell/AppShell.js +689 -0
- package/dist/components/app-shell/AppShell.js.map +1 -0
- package/dist/components/avatar/Avatar.d.ts +21 -0
- package/dist/components/avatar/Avatar.js +190 -0
- package/dist/components/avatar/Avatar.js.map +1 -0
- package/dist/components/badge/Badge.d.ts +16 -0
- package/dist/components/badge/Badge.js +94 -0
- package/dist/components/badge/Badge.js.map +1 -0
- package/dist/components/breadcrumbs/Breadcrumbs.d.ts +18 -0
- package/dist/components/breadcrumbs/Breadcrumbs.js +154 -0
- package/dist/components/breadcrumbs/Breadcrumbs.js.map +1 -0
- package/dist/components/button/Button.d.ts +23 -0
- package/dist/components/button/Button.js +159 -0
- package/dist/components/button/Button.js.map +1 -0
- package/dist/components/calendar/Calendar.d.ts +59 -0
- package/dist/components/calendar/Calendar.js +709 -0
- package/dist/components/calendar/Calendar.js.map +1 -0
- package/dist/components/calendar/date-utils.d.ts +32 -0
- package/dist/components/calendar/date-utils.js +112 -0
- package/dist/components/calendar/date-utils.js.map +1 -0
- package/dist/components/card/Card.d.ts +42 -0
- package/dist/components/card/Card.js +82 -0
- package/dist/components/card/Card.js.map +1 -0
- package/dist/components/choice/Choice.d.ts +32 -0
- package/dist/components/choice/Choice.js +371 -0
- package/dist/components/choice/Choice.js.map +1 -0
- package/dist/components/collapsible/Collapsible.d.ts +15 -0
- package/dist/components/collapsible/Collapsible.js +155 -0
- package/dist/components/collapsible/Collapsible.js.map +1 -0
- package/dist/components/combobox/Combobox.d.ts +68 -0
- package/dist/components/combobox/Combobox.js +752 -0
- package/dist/components/combobox/Combobox.js.map +1 -0
- package/dist/components/command-palette/CommandPalette.d.ts +52 -0
- package/dist/components/command-palette/CommandPalette.js +328 -0
- package/dist/components/command-palette/CommandPalette.js.map +1 -0
- package/dist/components/data-table/DataTable.d.ts +73 -0
- package/dist/components/data-table/DataTable.js +478 -0
- package/dist/components/data-table/DataTable.js.map +1 -0
- package/dist/components/data-table/DataTableContent.d.ts +35 -0
- package/dist/components/data-table/DataTableContent.js +550 -0
- package/dist/components/data-table/DataTableContent.js.map +1 -0
- package/dist/components/data-table/DataTableFilters.d.ts +15 -0
- package/dist/components/data-table/DataTableFilters.js +284 -0
- package/dist/components/data-table/DataTableFilters.js.map +1 -0
- package/dist/components/data-table/DataTableRow.d.ts +33 -0
- package/dist/components/data-table/DataTableRow.js +552 -0
- package/dist/components/data-table/DataTableRow.js.map +1 -0
- package/dist/components/data-table/context.d.ts +5 -0
- package/dist/components/data-table/context.js +14 -0
- package/dist/components/data-table/context.js.map +1 -0
- package/dist/components/data-table/layout.d.ts +60 -0
- package/dist/components/data-table/layout.js +272 -0
- package/dist/components/data-table/layout.js.map +1 -0
- package/dist/components/data-table/types.d.ts +319 -0
- package/dist/components/data-table/useDataTable.d.ts +9 -0
- package/dist/components/data-table/useDataTable.js +666 -0
- package/dist/components/data-table/useDataTable.js.map +1 -0
- package/dist/components/date-picker/DatePicker.d.ts +50 -0
- package/dist/components/date-picker/DatePicker.js +485 -0
- package/dist/components/date-picker/DatePicker.js.map +1 -0
- package/dist/components/date-picker/DateRangePicker.d.ts +39 -0
- package/dist/components/date-picker/DateRangePicker.js +339 -0
- package/dist/components/date-picker/DateRangePicker.js.map +1 -0
- package/dist/components/date-picker/PickerField.d.ts +38 -0
- package/dist/components/date-picker/PickerField.js +238 -0
- package/dist/components/date-picker/PickerField.js.map +1 -0
- package/dist/components/dialog/Dialog.d.ts +70 -0
- package/dist/components/dialog/Dialog.js +354 -0
- package/dist/components/dialog/Dialog.js.map +1 -0
- package/dist/components/drawer/Drawer.d.ts +39 -0
- package/dist/components/drawer/Drawer.js +225 -0
- package/dist/components/drawer/Drawer.js.map +1 -0
- package/dist/components/empty-state/EmptyState.d.ts +12 -0
- package/dist/components/empty-state/EmptyState.js +116 -0
- package/dist/components/empty-state/EmptyState.js.map +1 -0
- package/dist/components/field/Field.d.ts +36 -0
- package/dist/components/field/Field.js +337 -0
- package/dist/components/field/Field.js.map +1 -0
- package/dist/components/file-upload/FileUpload.d.ts +91 -0
- package/dist/components/file-upload/FileUpload.js +714 -0
- package/dist/components/file-upload/FileUpload.js.map +1 -0
- package/dist/components/input/Input.d.ts +49 -0
- package/dist/components/input/Input.js +538 -0
- package/dist/components/input/Input.js.map +1 -0
- package/dist/components/link/Link.d.ts +17 -0
- package/dist/components/link/Link.js +91 -0
- package/dist/components/link/Link.js.map +1 -0
- package/dist/components/menu/Menu.d.ts +79 -0
- package/dist/components/menu/Menu.js +615 -0
- package/dist/components/menu/Menu.js.map +1 -0
- package/dist/components/number-field/NumberField.d.ts +16 -0
- package/dist/components/number-field/NumberField.js +188 -0
- package/dist/components/number-field/NumberField.js.map +1 -0
- package/dist/components/pagination/Pagination.d.ts +34 -0
- package/dist/components/pagination/Pagination.js +244 -0
- package/dist/components/pagination/Pagination.js.map +1 -0
- package/dist/components/popover/Popover.d.ts +22 -0
- package/dist/components/popover/Popover.js +186 -0
- package/dist/components/popover/Popover.js.map +1 -0
- package/dist/components/preview-card/PreviewCard.d.ts +20 -0
- package/dist/components/preview-card/PreviewCard.js +114 -0
- package/dist/components/preview-card/PreviewCard.js.map +1 -0
- package/dist/components/progress/Progress.d.ts +20 -0
- package/dist/components/progress/Progress.js +169 -0
- package/dist/components/progress/Progress.js.map +1 -0
- package/dist/components/scroll-area/ScrollArea.d.ts +8 -0
- package/dist/components/scroll-area/ScrollArea.js +112 -0
- package/dist/components/scroll-area/ScrollArea.js.map +1 -0
- package/dist/components/search-input/SearchInput.d.ts +14 -0
- package/dist/components/search-input/SearchInput.js +114 -0
- package/dist/components/search-input/SearchInput.js.map +1 -0
- package/dist/components/select/Select.d.ts +66 -0
- package/dist/components/select/Select.js +601 -0
- package/dist/components/select/Select.js.map +1 -0
- package/dist/components/separator/Separator.d.ts +4 -0
- package/dist/components/separator/Separator.js +46 -0
- package/dist/components/separator/Separator.js.map +1 -0
- package/dist/components/skeleton/Skeleton.d.ts +16 -0
- package/dist/components/skeleton/Skeleton.js +135 -0
- package/dist/components/skeleton/Skeleton.js.map +1 -0
- package/dist/components/slider/Slider.d.ts +11 -0
- package/dist/components/slider/Slider.js +107 -0
- package/dist/components/slider/Slider.js.map +1 -0
- package/dist/components/spinner/Spinner.d.ts +9 -0
- package/dist/components/spinner/Spinner.js +78 -0
- package/dist/components/spinner/Spinner.js.map +1 -0
- package/dist/components/stack/Stack.d.ts +23 -0
- package/dist/components/stack/Stack.js +79 -0
- package/dist/components/stack/Stack.js.map +1 -0
- package/dist/components/stat-card/StatCard.d.ts +22 -0
- package/dist/components/stat-card/StatCard.js +153 -0
- package/dist/components/stat-card/StatCard.js.map +1 -0
- package/dist/components/stepper/Stepper.d.ts +30 -0
- package/dist/components/stepper/Stepper.js +131 -0
- package/dist/components/stepper/Stepper.js.map +1 -0
- package/dist/components/table/Table.d.ts +53 -0
- package/dist/components/table/Table.js +221 -0
- package/dist/components/table/Table.js.map +1 -0
- package/dist/components/tabs/Tabs.d.ts +19 -0
- package/dist/components/tabs/Tabs.js +183 -0
- package/dist/components/tabs/Tabs.js.map +1 -0
- package/dist/components/tag/Tag.d.ts +22 -0
- package/dist/components/tag/Tag.js +121 -0
- package/dist/components/tag/Tag.js.map +1 -0
- package/dist/components/toast/Toast.d.ts +34 -0
- package/dist/components/toast/Toast.js +187 -0
- package/dist/components/toast/Toast.js.map +1 -0
- package/dist/components/toggle/Toggle.d.ts +31 -0
- package/dist/components/toggle/Toggle.js +197 -0
- package/dist/components/toggle/Toggle.js.map +1 -0
- package/dist/components/toolbar/Toolbar.d.ts +21 -0
- package/dist/components/toolbar/Toolbar.js +239 -0
- package/dist/components/toolbar/Toolbar.js.map +1 -0
- package/dist/components/tooltip/Tooltip.d.ts +33 -0
- package/dist/components/tooltip/Tooltip.js +182 -0
- package/dist/components/tooltip/Tooltip.js.map +1 -0
- package/dist/components/typography/Typography.d.ts +32 -0
- package/dist/components/typography/Typography.js +183 -0
- package/dist/components/typography/Typography.js.map +1 -0
- package/dist/fonts.css +3 -0
- package/dist/icons/index.d.ts +133 -0
- package/dist/icons/index.js +182 -0
- package/dist/icons/index.js.map +1 -0
- package/dist/index.d.ts +55 -0
- package/dist/index.js +58 -0
- package/dist/opti-ui.css +5692 -0
- package/dist/theme/ThemeProvider.d.ts +22 -0
- package/dist/theme/ThemeProvider.js +115 -0
- package/dist/theme/ThemeProvider.js.map +1 -0
- package/dist/theme/index.d.ts +2 -0
- package/dist/utils/cx.d.ts +10 -0
- package/dist/utils/cx.js +18 -0
- package/dist/utils/cx.js.map +1 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/portal.d.ts +8 -0
- package/dist/utils/portal.js +16 -0
- package/dist/utils/portal.js.map +1 -0
- package/dist/utils/primitive.d.ts +13 -0
- package/dist/utils/primitive.js +61 -0
- package/dist/utils/primitive.js.map +1 -0
- package/dist/utils/search.d.ts +4 -0
- package/dist/utils/search.js +15 -0
- package/dist/utils/search.js.map +1 -0
- package/package.json +71 -4
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { withClass } from "../../utils/cx.js";
|
|
3
|
+
import { Spinner } from "../spinner/Spinner.js";
|
|
4
|
+
import { c } from "react/compiler-runtime";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { Button } from "@base-ui/react/button";
|
|
7
|
+
//#region src/components/button/Button.tsx
|
|
8
|
+
function Button$1(t0) {
|
|
9
|
+
const $ = c(29);
|
|
10
|
+
let children;
|
|
11
|
+
let className;
|
|
12
|
+
let disabled;
|
|
13
|
+
let fullWidth;
|
|
14
|
+
let loading;
|
|
15
|
+
let props;
|
|
16
|
+
let ref;
|
|
17
|
+
let t1;
|
|
18
|
+
let t2;
|
|
19
|
+
let t3;
|
|
20
|
+
if ($[0] !== t0) {
|
|
21
|
+
({variant: t1, size: t2, shape: t3, fullWidth, loading, disabled, className, children, ref, ...props} = t0);
|
|
22
|
+
$[0] = t0;
|
|
23
|
+
$[1] = children;
|
|
24
|
+
$[2] = className;
|
|
25
|
+
$[3] = disabled;
|
|
26
|
+
$[4] = fullWidth;
|
|
27
|
+
$[5] = loading;
|
|
28
|
+
$[6] = props;
|
|
29
|
+
$[7] = ref;
|
|
30
|
+
$[8] = t1;
|
|
31
|
+
$[9] = t2;
|
|
32
|
+
$[10] = t3;
|
|
33
|
+
} else {
|
|
34
|
+
children = $[1];
|
|
35
|
+
className = $[2];
|
|
36
|
+
disabled = $[3];
|
|
37
|
+
fullWidth = $[4];
|
|
38
|
+
loading = $[5];
|
|
39
|
+
props = $[6];
|
|
40
|
+
ref = $[7];
|
|
41
|
+
t1 = $[8];
|
|
42
|
+
t2 = $[9];
|
|
43
|
+
t3 = $[10];
|
|
44
|
+
}
|
|
45
|
+
const variant = t1 === void 0 ? "primary" : t1;
|
|
46
|
+
const size = t2 === void 0 ? "md" : t2;
|
|
47
|
+
const shape = t3 === void 0 ? "pill" : t3;
|
|
48
|
+
let t4;
|
|
49
|
+
if ($[11] !== className) {
|
|
50
|
+
t4 = withClass("oui-button", className);
|
|
51
|
+
$[11] = className;
|
|
52
|
+
$[12] = t4;
|
|
53
|
+
} else t4 = $[12];
|
|
54
|
+
const t5 = fullWidth || void 0;
|
|
55
|
+
const t6 = loading || void 0;
|
|
56
|
+
const t7 = loading || void 0;
|
|
57
|
+
const t8 = disabled || loading;
|
|
58
|
+
let t9;
|
|
59
|
+
if ($[13] !== loading) {
|
|
60
|
+
t9 = loading && /* @__PURE__ */ jsx(Spinner, {
|
|
61
|
+
className: "oui-button__spinner",
|
|
62
|
+
label: null
|
|
63
|
+
});
|
|
64
|
+
$[13] = loading;
|
|
65
|
+
$[14] = t9;
|
|
66
|
+
} else t9 = $[14];
|
|
67
|
+
let t10;
|
|
68
|
+
if ($[15] !== children || $[16] !== loading || $[17] !== props || $[18] !== ref || $[19] !== shape || $[20] !== size || $[21] !== t4 || $[22] !== t5 || $[23] !== t6 || $[24] !== t7 || $[25] !== t8 || $[26] !== t9 || $[27] !== variant) {
|
|
69
|
+
t10 = /* @__PURE__ */ jsxs(Button, {
|
|
70
|
+
ref,
|
|
71
|
+
className: t4,
|
|
72
|
+
"data-variant": variant,
|
|
73
|
+
"data-size": size,
|
|
74
|
+
"data-shape": shape,
|
|
75
|
+
"data-full-width": t5,
|
|
76
|
+
"data-loading": t6,
|
|
77
|
+
"aria-busy": t7,
|
|
78
|
+
disabled: t8,
|
|
79
|
+
focusableWhenDisabled: loading,
|
|
80
|
+
...props,
|
|
81
|
+
children: [t9, children]
|
|
82
|
+
});
|
|
83
|
+
$[15] = children;
|
|
84
|
+
$[16] = loading;
|
|
85
|
+
$[17] = props;
|
|
86
|
+
$[18] = ref;
|
|
87
|
+
$[19] = shape;
|
|
88
|
+
$[20] = size;
|
|
89
|
+
$[21] = t4;
|
|
90
|
+
$[22] = t5;
|
|
91
|
+
$[23] = t6;
|
|
92
|
+
$[24] = t7;
|
|
93
|
+
$[25] = t8;
|
|
94
|
+
$[26] = t9;
|
|
95
|
+
$[27] = variant;
|
|
96
|
+
$[28] = t10;
|
|
97
|
+
} else t10 = $[28];
|
|
98
|
+
return t10;
|
|
99
|
+
}
|
|
100
|
+
/** Square button for a single icon. Defaults to the compact ghost style. */
|
|
101
|
+
function IconButton(t0) {
|
|
102
|
+
const $ = c(16);
|
|
103
|
+
let className;
|
|
104
|
+
let props;
|
|
105
|
+
let ref;
|
|
106
|
+
let t1;
|
|
107
|
+
let t2;
|
|
108
|
+
let t3;
|
|
109
|
+
if ($[0] !== t0) {
|
|
110
|
+
({variant: t1, size: t2, shape: t3, className, ref, ...props} = t0);
|
|
111
|
+
$[0] = t0;
|
|
112
|
+
$[1] = className;
|
|
113
|
+
$[2] = props;
|
|
114
|
+
$[3] = ref;
|
|
115
|
+
$[4] = t1;
|
|
116
|
+
$[5] = t2;
|
|
117
|
+
$[6] = t3;
|
|
118
|
+
} else {
|
|
119
|
+
className = $[1];
|
|
120
|
+
props = $[2];
|
|
121
|
+
ref = $[3];
|
|
122
|
+
t1 = $[4];
|
|
123
|
+
t2 = $[5];
|
|
124
|
+
t3 = $[6];
|
|
125
|
+
}
|
|
126
|
+
const variant = t1 === void 0 ? "ghost" : t1;
|
|
127
|
+
const size = t2 === void 0 ? "md" : t2;
|
|
128
|
+
const shape = t3 === void 0 ? "rounded" : t3;
|
|
129
|
+
let t4;
|
|
130
|
+
if ($[7] !== className) {
|
|
131
|
+
t4 = withClass("oui-icon-button", className);
|
|
132
|
+
$[7] = className;
|
|
133
|
+
$[8] = t4;
|
|
134
|
+
} else t4 = $[8];
|
|
135
|
+
const t5 = props;
|
|
136
|
+
let t6;
|
|
137
|
+
if ($[9] !== ref || $[10] !== shape || $[11] !== size || $[12] !== t4 || $[13] !== t5 || $[14] !== variant) {
|
|
138
|
+
t6 = /* @__PURE__ */ jsx(Button$1, {
|
|
139
|
+
ref,
|
|
140
|
+
variant,
|
|
141
|
+
size,
|
|
142
|
+
className: t4,
|
|
143
|
+
"data-shape": shape,
|
|
144
|
+
...t5
|
|
145
|
+
});
|
|
146
|
+
$[9] = ref;
|
|
147
|
+
$[10] = shape;
|
|
148
|
+
$[11] = size;
|
|
149
|
+
$[12] = t4;
|
|
150
|
+
$[13] = t5;
|
|
151
|
+
$[14] = variant;
|
|
152
|
+
$[15] = t6;
|
|
153
|
+
} else t6 = $[15];
|
|
154
|
+
return t6;
|
|
155
|
+
}
|
|
156
|
+
//#endregion
|
|
157
|
+
export { Button$1 as Button, IconButton };
|
|
158
|
+
|
|
159
|
+
//# sourceMappingURL=Button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Button.js","names":["Button","BaseButton","withClass","Spinner","ButtonVariant","ButtonSize","ButtonShape","ButtonProps","Props","variant","size","shape","fullWidth","loading","t0","$","_c","children","className","disabled","props","ref","t1","t2","t3","undefined","t4","t5","t6","t7","t8","t9","t10","IconButtonProps","Omit","IconButton","Button","_c","BaseButton"],"sources":["../../../src/components/button/Button.tsx"],"sourcesContent":["import { Button as BaseButton } from '@base-ui/react/button';\nimport { withClass } from '../../utils/cx';\nimport { Spinner } from '../spinner/Spinner';\n\nexport type ButtonVariant = 'primary' | 'accent' | 'secondary' | 'soft' | 'ghost' | 'danger';\nexport type ButtonSize = 'sm' | 'md' | 'lg';\nexport type ButtonShape = 'pill' | 'rounded';\n\nexport interface ButtonProps extends BaseButton.Props {\n /** Visual emphasis. */\n variant?: ButtonVariant;\n size?: ButtonSize;\n /** `pill` (default) or `rounded` corners. Override with `--oui-button-radius`. */\n shape?: ButtonShape;\n /** Stretch to the container width. */\n fullWidth?: boolean;\n /** Shows a spinner and blocks interaction while keeping focus. */\n loading?: boolean;\n}\n\nexport function Button({\n variant = 'primary',\n size = 'md',\n shape = 'pill',\n fullWidth,\n loading,\n disabled,\n className,\n children,\n ref,\n ...props\n}: ButtonProps) {\n return (\n <BaseButton\n ref={ref}\n className={withClass('oui-button', className)}\n data-variant={variant}\n data-size={size}\n data-shape={shape}\n data-full-width={fullWidth || undefined}\n data-loading={loading || undefined}\n aria-busy={loading || undefined}\n disabled={disabled || loading}\n focusableWhenDisabled={loading}\n {...props}\n >\n {loading && <Spinner className=\"oui-button__spinner\" label={null} />}\n {children}\n </BaseButton>\n );\n}\n\nexport interface IconButtonProps extends Omit<ButtonProps, 'shape' | 'fullWidth'> {\n /** Required: icon-only buttons need an accessible name. */\n 'aria-label': string;\n shape?: 'rounded' | 'circle';\n}\n\n/** Square button for a single icon. Defaults to the compact ghost style. */\nexport function IconButton({\n variant = 'ghost',\n size = 'md',\n shape = 'rounded',\n className,\n ref,\n ...props\n}: IconButtonProps) {\n return (\n <Button\n ref={ref}\n variant={variant}\n size={size}\n className={withClass('oui-icon-button', className)}\n data-shape={shape}\n {...(props as ButtonProps)}\n />\n );\n}\n"],"mappings":";;;;;;;AAoBA,SAAOA,SAAAc,IAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAP;CAAA,IAAAC;CAAA,IAAAO;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAT,EAAA,OAAAD,IAAA;EAAgB,CAAA,CAAAL,SAAAa,IAAAZ,MAAAa,IAAAZ,OAAAa,IAAAZ,WAAAC,SAAAM,UAAAD,WAAAD,UAAAI,KAAA,GAAAD,SAAAN;EAWTC,EAAA,KAAAD;EAAAC,EAAA,KAAAE;EAAAF,EAAA,KAAAG;EAAAH,EAAA,KAAAI;EAAAJ,EAAA,KAAAH;EAAAG,EAAA,KAAAF;EAAAE,EAAA,KAAAK;EAAAL,EAAA,KAAAM;EAAAN,EAAA,KAAAO;EAAAP,EAAA,KAAAQ;EAAAR,EAAA,MAAAS;CAAA,OAAA;EAAAP,WAAAF,EAAA;EAAAG,YAAAH,EAAA;EAAAI,WAAAJ,EAAA;EAAAH,YAAAG,EAAA;EAAAF,UAAAE,EAAA;EAAAK,QAAAL,EAAA;EAAAM,MAAAN,EAAA;EAAAO,KAAAP,EAAA;EAAAQ,KAAAR,EAAA;EAAAS,KAAAT,EAAA;CAAA;CAVZ,MAAAN,UAAAa,OAAAG,KAAAA,IAAA,YAAAH;CACA,MAAAZ,OAAAa,OAAAE,KAAAA,IAAA,OAAAF;CACA,MAAAZ,QAAAa,OAAAC,KAAAA,IAAA,SAAAD;CAAc,IAAAE;CAAA,IAAAX,EAAA,QAAAG,WAAA;EAYCQ,KAAAxB,UAAU,cAAcgB,SAAS;EAACH,E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Z,EAAA,MAAAN;EAAAM,EAAA,MAAAa;CAAA,OAAAA,KAAAb,EAAA;CAAA,OAPFa;AAOE"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { formatDate, formatDateLong, type DateRange } from './date-utils';
|
|
3
|
+
export type { DateRange };
|
|
4
|
+
export { formatDate, formatDateLong };
|
|
5
|
+
export interface CalendarLabels {
|
|
6
|
+
previousMonth: string;
|
|
7
|
+
nextMonth: string;
|
|
8
|
+
previousYear: string;
|
|
9
|
+
nextYear: string;
|
|
10
|
+
previousYears: string;
|
|
11
|
+
nextYears: string;
|
|
12
|
+
chooseMonth: string;
|
|
13
|
+
chooseYear: string;
|
|
14
|
+
}
|
|
15
|
+
interface CalendarOptions extends Omit<React.HTMLAttributes<HTMLDivElement>, 'defaultValue' | 'onChange'> {
|
|
16
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
17
|
+
/** Earliest selectable day (ISO date). */
|
|
18
|
+
min?: string;
|
|
19
|
+
/** Latest selectable day (ISO date). */
|
|
20
|
+
max?: string;
|
|
21
|
+
/** Return true to make a day unselectable. */
|
|
22
|
+
isDateDisabled?: (date: string) => boolean;
|
|
23
|
+
/** Month shown first when there is no value (any ISO date in that month). */
|
|
24
|
+
defaultMonth?: string;
|
|
25
|
+
/** BCP 47 locale for month and weekday names. Defaults to the browser's. */
|
|
26
|
+
locale?: string;
|
|
27
|
+
/** First column: 0 = Sunday, 1 = Monday (default). */
|
|
28
|
+
weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
29
|
+
/** Months shown side by side (default 1). */
|
|
30
|
+
numberOfMonths?: number;
|
|
31
|
+
/** Move focus to the selected day (or today) on mount, e.g. inside a popover. */
|
|
32
|
+
autoFocus?: boolean;
|
|
33
|
+
labels?: Partial<CalendarLabels>;
|
|
34
|
+
}
|
|
35
|
+
export interface CalendarProps extends CalendarOptions {
|
|
36
|
+
/** Selected day as an ISO date (`"2026-03-09"`). */
|
|
37
|
+
value?: string | null;
|
|
38
|
+
defaultValue?: string | null;
|
|
39
|
+
onValueChange?: (value: string) => void;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Month grid for picking one day. Keyboard: arrows move by day / week,
|
|
43
|
+
* Home / End jump within the week, PageUp / PageDown change month (with Shift: year).
|
|
44
|
+
* The month and year in the title open a list to jump straight to another one.
|
|
45
|
+
*/
|
|
46
|
+
export declare function Calendar({ value, defaultValue, onValueChange, ...props }: CalendarProps): React.JSX.Element;
|
|
47
|
+
export interface RangeCalendarProps extends CalendarOptions {
|
|
48
|
+
/** Selected days as ISO dates; both ends are inclusive. */
|
|
49
|
+
value?: DateRange | null;
|
|
50
|
+
defaultValue?: DateRange | null;
|
|
51
|
+
/** Called once both ends are picked, with `start` on or before `end`. */
|
|
52
|
+
onValueChange?: (value: DateRange) => void;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Month grid for picking a range of days: the first pick sets one end, the
|
|
56
|
+
* second completes the range (in either order). Same keyboard as Calendar.
|
|
57
|
+
* Disabled days cannot be picked as an end but may fall inside a range.
|
|
58
|
+
*/
|
|
59
|
+
export declare function RangeCalendar({ value, defaultValue, onValueChange, ...props }: RangeCalendarProps): React.JSX.Element;
|