@optimum-intelligence/opti-ui 0.5.1 → 0.6.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/dist/components/app-shell/AppShell.js +139 -121
- package/dist/components/app-shell/AppShell.js.map +1 -1
- package/dist/components/badge/Badge.d.ts +4 -2
- package/dist/components/badge/Badge.js.map +1 -1
- package/dist/components/button/Button.d.ts +6 -1
- package/dist/components/button/Button.js +31 -26
- package/dist/components/button/Button.js.map +1 -1
- package/dist/components/data-table/DataTable.d.ts +14 -2
- package/dist/components/data-table/DataTable.js +113 -98
- package/dist/components/data-table/DataTable.js.map +1 -1
- package/dist/components/data-table/DataTableFilters.d.ts +1 -1
- package/dist/components/data-table/DataTableFilters.js +85 -44
- package/dist/components/data-table/DataTableFilters.js.map +1 -1
- package/dist/components/data-table/export.d.ts +3 -0
- package/dist/components/data-table/export.js +31 -0
- package/dist/components/data-table/export.js.map +1 -0
- package/dist/components/data-table/types.d.ts +32 -5
- package/dist/components/data-table/useDataTable.js +18 -4
- package/dist/components/data-table/useDataTable.js.map +1 -1
- package/dist/components/description-list/DescriptionList.d.ts +29 -0
- package/dist/components/description-list/DescriptionList.js +125 -0
- package/dist/components/description-list/DescriptionList.js.map +1 -0
- package/dist/components/dialog/ConfirmDialog.d.ts +59 -0
- package/dist/components/dialog/ConfirmDialog.js +165 -0
- package/dist/components/dialog/ConfirmDialog.js.map +1 -0
- package/dist/components/dialog/Dialog.d.ts +15 -2
- package/dist/components/dialog/Dialog.js +115 -86
- package/dist/components/dialog/Dialog.js.map +1 -1
- package/dist/components/drawer/Drawer.d.ts +6 -1
- package/dist/components/drawer/Drawer.js +139 -132
- package/dist/components/drawer/Drawer.js.map +1 -1
- package/dist/components/select/Select.d.ts +6 -1
- package/dist/components/select/Select.js +110 -92
- package/dist/components/select/Select.js.map +1 -1
- package/dist/components.json +298 -20
- package/dist/icons/index.d.ts +4 -0
- package/dist/icons/index.js +6 -1
- package/dist/icons/index.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +5 -3
- package/dist/llms-full.txt +106 -5
- package/dist/llms.txt +3 -0
- package/dist/opti-ui.css +445 -20
- package/package.json +4 -1
|
@@ -14,210 +14,217 @@ import { Dialog } from "@base-ui/react/dialog";
|
|
|
14
14
|
* sheet use `Dialog.Content` with `placement`.
|
|
15
15
|
*/
|
|
16
16
|
function Drawer(t0) {
|
|
17
|
-
const $ = c(
|
|
18
|
-
const { open: openProp, defaultOpen: t1, onOpenChange, trigger, title, eyebrow, description, actions, footer, side: t2, size: t3, dismissible: t4, modal: t5,
|
|
17
|
+
const $ = c(59);
|
|
18
|
+
const { open: openProp, defaultOpen: t1, onOpenChange, onOpenChangeComplete, trigger, title, eyebrow, description, actions, footer, side: t2, size: t3, dismissible: t4, modal: t5, backdropBlur: t6, closeLabel: t7, className, bodyProps, children, ref } = t0;
|
|
19
19
|
const defaultOpen = t1 === void 0 ? false : t1;
|
|
20
20
|
const side = t2 === void 0 ? "right" : t2;
|
|
21
21
|
const size = t3 === void 0 ? "md" : t3;
|
|
22
22
|
const dismissible = t4 === void 0 ? true : t4;
|
|
23
23
|
const modal = t5 === void 0 ? true : t5;
|
|
24
|
-
const
|
|
24
|
+
const backdropBlur = t6 === void 0 ? "md" : t6;
|
|
25
|
+
const closeLabel = t7 === void 0 ? "Close" : t7;
|
|
25
26
|
const [inner, setInner] = React.useState(defaultOpen);
|
|
26
27
|
const open = openProp ?? inner;
|
|
27
28
|
const container = usePortalContainer();
|
|
28
|
-
let
|
|
29
|
+
let t8;
|
|
29
30
|
if ($[0] !== dismissible || $[1] !== onOpenChange) {
|
|
30
|
-
|
|
31
|
+
t8 = (next) => {
|
|
31
32
|
if (!next && !dismissible) return;
|
|
32
33
|
setInner(next);
|
|
33
34
|
onOpenChange?.(next);
|
|
34
35
|
};
|
|
35
36
|
$[0] = dismissible;
|
|
36
37
|
$[1] = onOpenChange;
|
|
37
|
-
$[2] =
|
|
38
|
-
} else
|
|
39
|
-
let
|
|
38
|
+
$[2] = t8;
|
|
39
|
+
} else t8 = $[2];
|
|
40
|
+
let t9;
|
|
40
41
|
if ($[3] !== trigger) {
|
|
41
|
-
|
|
42
|
+
t9 = trigger && /* @__PURE__ */ jsx(Dialog.Trigger, { render: trigger });
|
|
42
43
|
$[3] = trigger;
|
|
43
|
-
$[4] =
|
|
44
|
-
} else
|
|
45
|
-
let t9;
|
|
46
|
-
if ($[5] !== modal) {
|
|
47
|
-
t9 = modal && /* @__PURE__ */ jsx(Dialog.Backdrop, { className: "oui-dialog__backdrop" });
|
|
48
|
-
$[5] = modal;
|
|
49
|
-
$[6] = t9;
|
|
50
|
-
} else t9 = $[6];
|
|
44
|
+
$[4] = t9;
|
|
45
|
+
} else t9 = $[4];
|
|
51
46
|
let t10;
|
|
52
|
-
if ($[
|
|
53
|
-
t10 =
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
47
|
+
if ($[5] !== backdropBlur || $[6] !== modal) {
|
|
48
|
+
t10 = modal && /* @__PURE__ */ jsx(Dialog.Backdrop, {
|
|
49
|
+
className: "oui-dialog__backdrop",
|
|
50
|
+
"data-blur": backdropBlur
|
|
51
|
+
});
|
|
52
|
+
$[5] = backdropBlur;
|
|
53
|
+
$[6] = modal;
|
|
54
|
+
$[7] = t10;
|
|
55
|
+
} else t10 = $[7];
|
|
57
56
|
let t11;
|
|
58
|
-
if ($[
|
|
59
|
-
t11 =
|
|
57
|
+
if ($[8] !== className) {
|
|
58
|
+
t11 = cx("oui-drawer", className);
|
|
59
|
+
$[8] = className;
|
|
60
|
+
$[9] = t11;
|
|
61
|
+
} else t11 = $[9];
|
|
62
|
+
let t12;
|
|
63
|
+
if ($[10] !== eyebrow) {
|
|
64
|
+
t12 = eyebrow && /* @__PURE__ */ jsx("div", {
|
|
60
65
|
className: "oui-drawer__eyebrow",
|
|
61
66
|
children: eyebrow
|
|
62
67
|
});
|
|
63
|
-
$[
|
|
64
|
-
$[
|
|
65
|
-
} else
|
|
66
|
-
let
|
|
67
|
-
if ($[
|
|
68
|
-
|
|
68
|
+
$[10] = eyebrow;
|
|
69
|
+
$[11] = t12;
|
|
70
|
+
} else t12 = $[11];
|
|
71
|
+
let t13;
|
|
72
|
+
if ($[12] !== title) {
|
|
73
|
+
t13 = /* @__PURE__ */ jsx(Dialog.Title, {
|
|
69
74
|
className: "oui-drawer__title",
|
|
70
75
|
children: title
|
|
71
76
|
});
|
|
72
|
-
$[
|
|
73
|
-
$[
|
|
74
|
-
} else
|
|
75
|
-
let
|
|
76
|
-
if ($[
|
|
77
|
-
|
|
77
|
+
$[12] = title;
|
|
78
|
+
$[13] = t13;
|
|
79
|
+
} else t13 = $[13];
|
|
80
|
+
let t14;
|
|
81
|
+
if ($[14] !== description) {
|
|
82
|
+
t14 = description && /* @__PURE__ */ jsx(Dialog.Description, {
|
|
78
83
|
className: "oui-drawer__description",
|
|
79
84
|
children: description
|
|
80
85
|
});
|
|
81
|
-
$[
|
|
82
|
-
$[
|
|
83
|
-
} else
|
|
84
|
-
let
|
|
85
|
-
if ($[
|
|
86
|
-
|
|
86
|
+
$[14] = description;
|
|
87
|
+
$[15] = t14;
|
|
88
|
+
} else t14 = $[15];
|
|
89
|
+
let t15;
|
|
90
|
+
if ($[16] !== t12 || $[17] !== t13 || $[18] !== t14) {
|
|
91
|
+
t15 = /* @__PURE__ */ jsxs("div", {
|
|
87
92
|
className: "oui-drawer__heading",
|
|
88
93
|
children: [
|
|
89
|
-
t11,
|
|
90
94
|
t12,
|
|
91
|
-
t13
|
|
95
|
+
t13,
|
|
96
|
+
t14
|
|
92
97
|
]
|
|
93
98
|
});
|
|
94
|
-
$[15] = t11;
|
|
95
99
|
$[16] = t12;
|
|
96
100
|
$[17] = t13;
|
|
97
101
|
$[18] = t14;
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
102
|
+
$[19] = t15;
|
|
103
|
+
} else t15 = $[19];
|
|
104
|
+
const t16 = !dismissible;
|
|
105
|
+
let t17;
|
|
106
|
+
if ($[20] !== closeLabel || $[21] !== t16) {
|
|
107
|
+
t17 = /* @__PURE__ */ jsx(IconButton, {
|
|
103
108
|
"aria-label": closeLabel,
|
|
104
|
-
disabled:
|
|
109
|
+
disabled: t16
|
|
105
110
|
});
|
|
106
|
-
$[
|
|
107
|
-
$[20] = t15;
|
|
111
|
+
$[20] = closeLabel;
|
|
108
112
|
$[21] = t16;
|
|
109
|
-
} else t16 = $[21];
|
|
110
|
-
let t17;
|
|
111
|
-
if ($[22] === Symbol.for("react.memo_cache_sentinel")) {
|
|
112
|
-
t17 = /* @__PURE__ */ jsx(XIcon, {});
|
|
113
113
|
$[22] = t17;
|
|
114
114
|
} else t17 = $[22];
|
|
115
115
|
let t18;
|
|
116
|
-
if ($[23]
|
|
117
|
-
t18 = /* @__PURE__ */ jsx(
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
});
|
|
121
|
-
$[23] = t16;
|
|
122
|
-
$[24] = t18;
|
|
123
|
-
} else t18 = $[24];
|
|
116
|
+
if ($[23] === Symbol.for("react.memo_cache_sentinel")) {
|
|
117
|
+
t18 = /* @__PURE__ */ jsx(XIcon, {});
|
|
118
|
+
$[23] = t18;
|
|
119
|
+
} else t18 = $[23];
|
|
124
120
|
let t19;
|
|
125
|
-
if ($[
|
|
126
|
-
t19 = /* @__PURE__ */
|
|
121
|
+
if ($[24] !== t17) {
|
|
122
|
+
t19 = /* @__PURE__ */ jsx(Dialog.Close, {
|
|
123
|
+
render: t17,
|
|
124
|
+
children: t18
|
|
125
|
+
});
|
|
126
|
+
$[24] = t17;
|
|
127
|
+
$[25] = t19;
|
|
128
|
+
} else t19 = $[25];
|
|
129
|
+
let t20;
|
|
130
|
+
if ($[26] !== actions || $[27] !== t19) {
|
|
131
|
+
t20 = /* @__PURE__ */ jsxs("div", {
|
|
127
132
|
className: "oui-drawer__actions",
|
|
128
|
-
children: [actions,
|
|
133
|
+
children: [actions, t19]
|
|
129
134
|
});
|
|
130
|
-
$[
|
|
131
|
-
$[26] = t18;
|
|
135
|
+
$[26] = actions;
|
|
132
136
|
$[27] = t19;
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
+
$[28] = t20;
|
|
138
|
+
} else t20 = $[28];
|
|
139
|
+
let t21;
|
|
140
|
+
if ($[29] !== t15 || $[30] !== t20) {
|
|
141
|
+
t21 = /* @__PURE__ */ jsxs("header", {
|
|
137
142
|
className: "oui-drawer__header",
|
|
138
|
-
children: [
|
|
143
|
+
children: [t15, t20]
|
|
139
144
|
});
|
|
140
|
-
$[
|
|
141
|
-
$[29] = t19;
|
|
145
|
+
$[29] = t15;
|
|
142
146
|
$[30] = t20;
|
|
143
|
-
} else t20 = $[30];
|
|
144
|
-
const t21 = bodyProps?.className;
|
|
145
|
-
let t22;
|
|
146
|
-
if ($[31] !== t21) {
|
|
147
|
-
t22 = cx("oui-drawer__body", t21);
|
|
148
147
|
$[31] = t21;
|
|
149
|
-
|
|
150
|
-
|
|
148
|
+
} else t21 = $[31];
|
|
149
|
+
const t22 = bodyProps?.className;
|
|
151
150
|
let t23;
|
|
152
|
-
if ($[
|
|
153
|
-
t23 =
|
|
151
|
+
if ($[32] !== t22) {
|
|
152
|
+
t23 = cx("oui-drawer__body", t22);
|
|
153
|
+
$[32] = t22;
|
|
154
|
+
$[33] = t23;
|
|
155
|
+
} else t23 = $[33];
|
|
156
|
+
let t24;
|
|
157
|
+
if ($[34] !== bodyProps || $[35] !== children || $[36] !== t23) {
|
|
158
|
+
t24 = /* @__PURE__ */ jsx("div", {
|
|
154
159
|
...bodyProps,
|
|
155
|
-
className:
|
|
160
|
+
className: t23,
|
|
156
161
|
children
|
|
157
162
|
});
|
|
158
|
-
$[
|
|
159
|
-
$[
|
|
160
|
-
$[35] = t22;
|
|
163
|
+
$[34] = bodyProps;
|
|
164
|
+
$[35] = children;
|
|
161
165
|
$[36] = t23;
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
+
$[37] = t24;
|
|
167
|
+
} else t24 = $[37];
|
|
168
|
+
let t25;
|
|
169
|
+
if ($[38] !== footer) {
|
|
170
|
+
t25 = footer && /* @__PURE__ */ jsx("footer", {
|
|
166
171
|
className: "oui-drawer__footer",
|
|
167
172
|
children: footer
|
|
168
173
|
});
|
|
169
|
-
$[
|
|
170
|
-
$[
|
|
171
|
-
} else
|
|
172
|
-
let
|
|
173
|
-
if ($[
|
|
174
|
-
|
|
174
|
+
$[38] = footer;
|
|
175
|
+
$[39] = t25;
|
|
176
|
+
} else t25 = $[39];
|
|
177
|
+
let t26;
|
|
178
|
+
if ($[40] !== ref || $[41] !== side || $[42] !== size || $[43] !== t11 || $[44] !== t21 || $[45] !== t24 || $[46] !== t25) {
|
|
179
|
+
t26 = /* @__PURE__ */ jsxs(Dialog.Popup, {
|
|
175
180
|
ref,
|
|
176
|
-
className:
|
|
181
|
+
className: t11,
|
|
177
182
|
"data-side": side,
|
|
178
183
|
"data-size": size,
|
|
179
184
|
children: [
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
185
|
+
t21,
|
|
186
|
+
t24,
|
|
187
|
+
t25
|
|
183
188
|
]
|
|
184
189
|
});
|
|
185
|
-
$[
|
|
186
|
-
$[
|
|
187
|
-
$[
|
|
188
|
-
$[
|
|
189
|
-
$[
|
|
190
|
-
$[44] = t23;
|
|
190
|
+
$[40] = ref;
|
|
191
|
+
$[41] = side;
|
|
192
|
+
$[42] = size;
|
|
193
|
+
$[43] = t11;
|
|
194
|
+
$[44] = t21;
|
|
191
195
|
$[45] = t24;
|
|
192
196
|
$[46] = t25;
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
+
$[47] = t26;
|
|
198
|
+
} else t26 = $[47];
|
|
199
|
+
let t27;
|
|
200
|
+
if ($[48] !== container || $[49] !== t10 || $[50] !== t26) {
|
|
201
|
+
t27 = /* @__PURE__ */ jsxs(Dialog.Portal, {
|
|
197
202
|
container,
|
|
198
|
-
children: [
|
|
203
|
+
children: [t10, t26]
|
|
199
204
|
});
|
|
200
|
-
$[
|
|
201
|
-
$[
|
|
202
|
-
$[49] = t9;
|
|
205
|
+
$[48] = container;
|
|
206
|
+
$[49] = t10;
|
|
203
207
|
$[50] = t26;
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
+
$[51] = t27;
|
|
209
|
+
} else t27 = $[51];
|
|
210
|
+
let t28;
|
|
211
|
+
if ($[52] !== modal || $[53] !== onOpenChangeComplete || $[54] !== open || $[55] !== t27 || $[56] !== t8 || $[57] !== t9) {
|
|
212
|
+
t28 = /* @__PURE__ */ jsxs(Dialog.Root, {
|
|
208
213
|
open,
|
|
209
214
|
modal,
|
|
210
|
-
|
|
211
|
-
|
|
215
|
+
onOpenChangeComplete,
|
|
216
|
+
onOpenChange: t8,
|
|
217
|
+
children: [t9, t27]
|
|
212
218
|
});
|
|
213
|
-
$[
|
|
214
|
-
$[
|
|
215
|
-
$[
|
|
216
|
-
$[
|
|
217
|
-
$[
|
|
218
|
-
$[
|
|
219
|
-
|
|
220
|
-
|
|
219
|
+
$[52] = modal;
|
|
220
|
+
$[53] = onOpenChangeComplete;
|
|
221
|
+
$[54] = open;
|
|
222
|
+
$[55] = t27;
|
|
223
|
+
$[56] = t8;
|
|
224
|
+
$[57] = t9;
|
|
225
|
+
$[58] = t28;
|
|
226
|
+
} else t28 = $[58];
|
|
227
|
+
return t28;
|
|
221
228
|
}
|
|
222
229
|
//#endregion
|
|
223
230
|
export { Drawer };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Drawer.js","names":["React","Dialog","BaseDialog","cx","usePortalContainer","XIcon","IconButton","DrawerSize","DrawerProps","ref","Ref","HTMLDivElement","open","defaultOpen","onOpenChange","trigger","ReactElement","title","ReactNode","eyebrow","description","actions","footer","side","size","dismissible","modal","closeLabel","className","bodyProps","HTMLAttributes","children","Drawer","t0","$","_c","openProp","t1","t2","t3","t4","t5","t6","undefined","inner","setInner","useState","container","t7","next","t8","t9","t10","t11","t12","t13","t14","t15","t16","t17","Symbol","for","t18","t19","t20","t21","t22","t23","t24","t25","t26","t27","_c","BaseDialog"],"sources":["../../../src/components/drawer/Drawer.tsx"],"sourcesContent":["import * as React from 'react';\nimport { Dialog as BaseDialog } from '@base-ui/react/dialog';\nimport { cx } from '../../utils/cx';\nimport { usePortalContainer } from '../../utils/portal';\nimport { XIcon } from '../../icons';\nimport { IconButton } from '../button/Button';\n\nexport type DrawerSize = 'sm' | 'md' | 'lg' | 'xl';\n\nexport interface DrawerProps {\n /** Ref to the drawer panel. */\n ref?: React.Ref<HTMLDivElement>;\n /** Whether the drawer is open (controlled). */\n open?: boolean;\n /** Initial state when uncontrolled. */\n defaultOpen?: boolean;\n /** Called when the drawer opens or closes. */\n onOpenChange?: (open: boolean) => void;\n /** Element that opens the drawer, e.g. `<Button>Details</Button>`. Omit when `open` is controlled. */\n trigger?: React.ReactElement;\n /** Header title; also the drawer's accessible name. */\n title: React.ReactNode;\n /** Small label above the title, e.g. the record type. */\n eyebrow?: React.ReactNode;\n /** Supporting text under the title. */\n description?: React.ReactNode;\n /** Header content next to the close button (edit, delete, a menu…). */\n actions?: React.ReactNode;\n /** Pinned to the bottom, for form buttons. */\n footer?: React.ReactNode;\n /** Edge the drawer slides in from. */\n side?: 'right' | 'left';\n /** Width: sm 24rem, md 32rem (default), lg 48rem, xl 60rem. Override with `--oui-drawer-width`. */\n size?: DrawerSize;\n /**\n * Set to `false` to block Esc, outside clicks and the close button, e.g.\n * while a form inside is saving.\n */\n dismissible?: boolean;\n /** `false` leaves the page behind interactive and drops the backdrop. */\n modal?: boolean;\n /** Accessible name of the close button. */\n closeLabel?: string;\n /** Class name for the drawer panel. */\n className?: string;\n /** Props for the scrolling content area. */\n bodyProps?: React.HTMLAttributes<HTMLDivElement>;\n /** Drawer body content. */\n children?: React.ReactNode;\n}\n\n/**\n * Side panel for inspecting or editing a record without leaving the page:\n * pinned header, scrolling body, optional pinned footer. For a free-form\n * sheet use `Dialog.Content` with `placement`.\n */\nexport function Drawer({\n open: openProp,\n defaultOpen = false,\n onOpenChange,\n trigger,\n title,\n eyebrow,\n description,\n actions,\n footer,\n side = 'right',\n size = 'md',\n dismissible = true,\n modal = true,\n closeLabel = 'Close',\n className,\n bodyProps,\n children,\n ref,\n}: DrawerProps) {\n const [inner, setInner] = React.useState(defaultOpen);\n const open = openProp ?? inner;\n const container = usePortalContainer();\n\n return (\n <BaseDialog.Root\n open={open}\n modal={modal}\n onOpenChange={(next) => {\n if (!next && !dismissible) return;\n setInner(next);\n onOpenChange?.(next);\n }}\n >\n {trigger && <BaseDialog.Trigger render={trigger} />}\n <BaseDialog.Portal container={container}>\n {modal && <BaseDialog.Backdrop className=\"oui-dialog__backdrop\" />}\n <BaseDialog.Popup ref={ref} className={cx('oui-drawer', className)} data-side={side} data-size={size}>\n <header className=\"oui-drawer__header\">\n <div className=\"oui-drawer__heading\">\n {eyebrow && <div className=\"oui-drawer__eyebrow\">{eyebrow}</div>}\n <BaseDialog.Title className=\"oui-drawer__title\">{title}</BaseDialog.Title>\n {description && (\n <BaseDialog.Description className=\"oui-drawer__description\">{description}</BaseDialog.Description>\n )}\n </div>\n <div className=\"oui-drawer__actions\">\n {actions}\n <BaseDialog.Close render={<IconButton aria-label={closeLabel} disabled={!dismissible} />}>\n <XIcon />\n </BaseDialog.Close>\n </div>\n </header>\n <div {...bodyProps} className={cx('oui-drawer__body', bodyProps?.className)}>\n {children}\n </div>\n {footer && <footer className=\"oui-drawer__footer\">{footer}</footer>}\n </BaseDialog.Popup>\n </BaseDialog.Portal>\n </BaseDialog.Root>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;AAwDA,SAAOgC,OAAAC,IAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAAgB,MAAA,EAAAvB,MAAAwB,UAAAvB,aAAAwB,IAAAvB,cAAAC,SAAAE,OAAAE,S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QAAAgB,IAAA;EAjCtBqB,MAAA,qBAAAE,OAAA,MAAA;GACQ7D;GACCc;GACO,cAAAsB;GAHhB,UAAA,CASGE,IACDoB,GAwBF;;EAAkBpC,EAAA,MAAAR;EAAAQ,EAAA,MAAAtB;EAAAsB,EAAA,MAAAoC;EAAApC,EAAA,MAAAc;EAAAd,EAAA,MAAAgB;EAAAhB,EAAA,MAAAqC;CAAA,OAAAA,MAAArC,EAAA;CAAA,OAlClBqC;AAkCkB"}
|
|
1
|
+
{"version":3,"file":"Drawer.js","names":["React","Dialog","BaseDialog","cx","usePortalContainer","XIcon","IconButton","DialogBackdropBlur","DrawerSize","DrawerProps","ref","Ref","HTMLDivElement","open","defaultOpen","onOpenChange","onOpenChangeComplete","trigger","ReactElement","title","ReactNode","eyebrow","description","actions","footer","side","size","dismissible","modal","backdropBlur","closeLabel","className","bodyProps","HTMLAttributes","children","Drawer","t0","$","_c","openProp","t1","t2","t3","t4","t5","t6","t7","undefined","inner","setInner","useState","container","t8","next","t9","t10","t11","t12","t13","t14","t15","t16","t17","t18","Symbol","for","t19","t20","t21","t22","t23","t24","t25","t26","t27","t28","_c","BaseDialog"],"sources":["../../../src/components/drawer/Drawer.tsx"],"sourcesContent":["import * as React from 'react';\nimport { Dialog as BaseDialog } from '@base-ui/react/dialog';\nimport { cx } from '../../utils/cx';\nimport { usePortalContainer } from '../../utils/portal';\nimport { XIcon } from '../../icons';\nimport { IconButton } from '../button/Button';\nimport type { DialogBackdropBlur } from '../dialog/Dialog';\n\nexport type DrawerSize = 'sm' | 'md' | 'lg' | 'xl';\n\nexport interface DrawerProps {\n /** Ref to the drawer panel. */\n ref?: React.Ref<HTMLDivElement>;\n /** Whether the drawer is open (controlled). */\n open?: boolean;\n /** Initial state when uncontrolled. */\n defaultOpen?: boolean;\n /** Called when the drawer opens or closes. */\n onOpenChange?: (open: boolean) => void;\n /** Called once the open or close transition has finished, e.g. to unmount the drawer after it slid out. */\n onOpenChangeComplete?: (open: boolean) => void;\n /** Element that opens the drawer, e.g. `<Button>Details</Button>`. Omit when `open` is controlled. */\n trigger?: React.ReactElement;\n /** Header title; also the drawer's accessible name. */\n title: React.ReactNode;\n /** Small label above the title, e.g. the record type. */\n eyebrow?: React.ReactNode;\n /** Supporting text under the title. */\n description?: React.ReactNode;\n /** Header content next to the close button (edit, delete, a menu…). */\n actions?: React.ReactNode;\n /** Pinned to the bottom, for form buttons. */\n footer?: React.ReactNode;\n /** Edge the drawer slides in from. */\n side?: 'right' | 'left';\n /** Width: sm 24rem, md 32rem (default), lg 48rem, xl 60rem. Override with `--oui-drawer-width`. */\n size?: DrawerSize;\n /**\n * Set to `false` to block Esc, outside clicks and the close button, e.g.\n * while a form inside is saving.\n */\n dismissible?: boolean;\n /** `false` leaves the page behind interactive and drops the backdrop. */\n modal?: boolean;\n /** How strongly the page behind a modal drawer is blurred. Override the radius with `--oui-backdrop-blur`. */\n backdropBlur?: DialogBackdropBlur;\n /** Accessible name of the close button. */\n closeLabel?: string;\n /** Class name for the drawer panel. */\n className?: string;\n /** Props for the scrolling content area. */\n bodyProps?: React.HTMLAttributes<HTMLDivElement>;\n /** Drawer body content. */\n children?: React.ReactNode;\n}\n\n/**\n * Side panel for inspecting or editing a record without leaving the page:\n * pinned header, scrolling body, optional pinned footer. For a free-form\n * sheet use `Dialog.Content` with `placement`.\n */\nexport function Drawer({\n open: openProp,\n defaultOpen = false,\n onOpenChange,\n onOpenChangeComplete,\n trigger,\n title,\n eyebrow,\n description,\n actions,\n footer,\n side = 'right',\n size = 'md',\n dismissible = true,\n modal = true,\n backdropBlur = 'md',\n closeLabel = 'Close',\n className,\n bodyProps,\n children,\n ref,\n}: DrawerProps) {\n const [inner, setInner] = React.useState(defaultOpen);\n const open = openProp ?? inner;\n const container = usePortalContainer();\n\n return (\n <BaseDialog.Root\n open={open}\n modal={modal}\n onOpenChangeComplete={onOpenChangeComplete}\n onOpenChange={(next) => {\n if (!next && !dismissible) return;\n setInner(next);\n onOpenChange?.(next);\n }}\n >\n {trigger && <BaseDialog.Trigger render={trigger} />}\n <BaseDialog.Portal container={container}>\n {modal && <BaseDialog.Backdrop className=\"oui-dialog__backdrop\" data-blur={backdropBlur} />}\n <BaseDialog.Popup ref={ref} className={cx('oui-drawer', className)} data-side={side} data-size={size}>\n <header className=\"oui-drawer__header\">\n <div className=\"oui-drawer__heading\">\n {eyebrow && <div className=\"oui-drawer__eyebrow\">{eyebrow}</div>}\n <BaseDialog.Title className=\"oui-drawer__title\">{title}</BaseDialog.Title>\n {description && (\n <BaseDialog.Description className=\"oui-drawer__description\">{description}</BaseDialog.Description>\n )}\n </div>\n <div className=\"oui-drawer__actions\">\n {actions}\n <BaseDialog.Close render={<IconButton aria-label={closeLabel} disabled={!dismissible} />}>\n <XIcon />\n </BaseDialog.Close>\n </div>\n </header>\n <div {...bodyProps} className={cx('oui-drawer__body', bodyProps?.className)}>\n {children}\n </div>\n {footer && <footer className=\"oui-drawer__footer\">{footer}</footer>}\n </BaseDialog.Popup>\n </BaseDialog.Portal>\n </BaseDialog.Root>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;AA6DA,SAAOmC,OAAAC,IAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAAgB,MAAA,EAAAzB,MAAA0B,UAAAzB,aAAA0B,IAAAzB,cAAAC,sBAAAC,SAAAE,OAAAE,SAAAC,aAAAC,SAAAC,QAAAC,MAAAgB,IAAAf,MAAAgB,IAAAf,aAAAgB,IAAAf,OAAAgB,IAAAf,cAAAgB,IAAAf,YAAAgB,IAAAf,WAAAC,WAAAE,UAAAxB,QAAA0B;CAErB,MAAAtB,cAAA0B,OAAAO,KAAAA,IAAA,QAAAP;CASA,MAAAf,OAAAgB,OAAAM,KAAAA,IAAA,UAAAN;CACA,MAAAf,OAAAgB,OAAAK,KAAAA,IAAA,OAAAL;CACA,MAAAf,cAAAgB,OAAAI,KAAAA,IAAA,OAAAJ;CACA,MAAAf,QAAAgB,OAAAG,KAAAA,IAAA,OAAAH;CACA,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;EAAAjB,EAAA,MAAAsC;CAAA,OAAAA,MAAAtC,EAAA;CAAA,OAnClBsC;AAmCkB"}
|
|
@@ -50,6 +50,11 @@ export interface SelectProps extends RootProps {
|
|
|
50
50
|
error?: React.ReactNode;
|
|
51
51
|
/** Text shown while nothing is selected. */
|
|
52
52
|
placeholder?: React.ReactNode;
|
|
53
|
+
/**
|
|
54
|
+
* Adds a first option for "no choice", such as "All" in a filter. Choosing it
|
|
55
|
+
* reports `null`, and it shows while the value is `null`.
|
|
56
|
+
*/
|
|
57
|
+
allLabel?: React.ReactNode;
|
|
53
58
|
/** Control height. */
|
|
54
59
|
size?: ControlSize;
|
|
55
60
|
/** Props passed to the trigger button (className, style, aria-*). */
|
|
@@ -57,7 +62,7 @@ export interface SelectProps extends RootProps {
|
|
|
57
62
|
/** Props for the popup (side, align, className…). */
|
|
58
63
|
contentProps?: Omit<SelectContentProps, 'children'>;
|
|
59
64
|
}
|
|
60
|
-
declare function SelectComponent({ items, label, description, error, placeholder, size, triggerProps, contentProps, name, disabled, required, ...rootProps }: SelectProps): React.JSX.Element;
|
|
65
|
+
declare function SelectComponent({ items, label, description, error, placeholder, allLabel, size, triggerProps, contentProps, name, disabled, required, ...rootProps }: SelectProps): React.JSX.Element;
|
|
61
66
|
/**
|
|
62
67
|
* `<Select items={…} />` renders a complete labelled select. For full control
|
|
63
68
|
* compose the parts: `Select.Root`, `Select.Trigger`, `Select.Content`,
|