@wrdagency/blockout 1.0.29 → 1.0.31
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/assets/index2.css +1 -1
- package/dist/assets/index9.css +1 -1
- package/dist/assets/static.css +1 -1
- package/dist/assets/style16.css +1 -1
- package/dist/assets/style20.css +1 -1
- package/dist/assets/style25.css +1 -1
- package/dist/components/controls/select-control/control.js +23 -23
- package/dist/components/controls/select-control/props.d.ts +2 -2
- package/dist/components/controls/select-control/select.js +85 -71
- package/dist/components/controls/tag-control/ariakit-experimental.js +1067 -1081
- package/dist/components/data-view/api.d.ts +2 -2
- package/dist/components/data-view/api.js +14 -17
- package/dist/components/data-view/data/normalize.d.ts +0 -2
- package/dist/components/data-view/data/normalize.js +24 -36
- package/dist/components/data-view/layouts/grid/group.js +3 -2
- package/dist/components/data-view/layouts/kanban/group.js +3 -2
- package/dist/components/data-view/layouts/list/group.js +3 -2
- package/dist/components/data-view/layouts/table/empty.js +3 -2
- package/dist/components/data-view/layouts/table/group.js +3 -2
- package/dist/components/data-view/layouts/table/root.js +3 -2
- package/dist/components/data-view/layouts/tile/group.js +3 -2
- package/dist/components/data-view/parts/controls/index.js +3 -2
- package/dist/components/data-view/parts/controls/search.js +3 -2
- package/dist/components/data-view/parts/footer/actions.js +43 -62
- package/dist/components/data-view/parts/footer/index.js +3 -2
- package/dist/components/data-view/parts/footer/selection.js +3 -2
- package/dist/components/data-view/parts/view-control/index.js +18 -17
- package/dist/components/data-view/root.js +3 -2
- package/dist/components/data-view/slots/item/actions.js +20 -34
- package/dist/components/data-view/types/actions.d.ts +4 -14
- package/dist/components/menu/context.d.ts +7 -0
- package/dist/components/menu/context.js +10 -0
- package/dist/components/menu/index.d.ts +5 -4
- package/dist/components/menu/index.js +19 -17
- package/dist/components/menu/item.d.ts +1 -1
- package/dist/components/menu/items/action.d.ts +1 -1
- package/dist/components/menu/items/action.js +10 -7
- package/dist/components/menu/items/submenu.d.ts +1 -1
- package/dist/components/menu/items/toggle.d.ts +1 -1
- package/dist/components/menu/items/toggle.js +20 -19
- package/dist/components/menu/types.d.ts +9 -9
- package/dist/primitives/popover/root.d.ts +2 -3
- package/dist/{select-popover-Dheunyb0.js → select-popover-CGgkyRb4.js} +227 -210
- package/dist/types/options.d.ts +15 -0
- package/dist/types/options.js +44 -12
- package/package.json +1 -1
|
@@ -41,6 +41,7 @@ import { ToggleGroupControl as n } from "../../../controls/toggle-group-control/
|
|
|
41
41
|
import { viewFieldsToListItems as _, getLayoutOptions as y, getSortDirectionOptions as H, getRelationshipVisiblityOptions as C, listItemsToViewFields as F } from "../../data/options.js";
|
|
42
42
|
import { R as N } from "../../../../index-CLl-PPjx.js";
|
|
43
43
|
import "../../slots/group/context.js";
|
|
44
|
+
import "../../../menu/context.js";
|
|
44
45
|
/* empty css */
|
|
45
46
|
import "../../slots/item/context.js";
|
|
46
47
|
import "../../slots/property/context.js";
|
|
@@ -100,27 +101,27 @@ const S = /* @__PURE__ */ new Map([
|
|
|
100
101
|
]
|
|
101
102
|
]), A = a.forwardRef((m, t) => /* @__PURE__ */ a.createElement(u, { ref: t, ...m, weights: S }));
|
|
102
103
|
A.displayName = "SelectionSlashIcon";
|
|
103
|
-
const
|
|
104
|
-
const { view: t, setView: d, fields:
|
|
104
|
+
const y0 = ({ className: m }) => {
|
|
105
|
+
const { view: t, setView: d, fields: l, hierarchy: g } = N.use(), r = (e, w) => {
|
|
105
106
|
d({
|
|
106
107
|
...t,
|
|
107
108
|
[e]: w
|
|
108
109
|
});
|
|
109
110
|
}, V = c(
|
|
110
|
-
() =>
|
|
111
|
+
() => l.filter((e) => e.sorting.sortable).map((e) => ({
|
|
111
112
|
value: e.id,
|
|
112
113
|
label: e.display.label
|
|
113
114
|
})),
|
|
114
|
-
[t,
|
|
115
|
+
[t, l]
|
|
115
116
|
), i = c(
|
|
116
|
-
() =>
|
|
117
|
+
() => l.filter((e) => e.sorting.groupable).map((e) => ({
|
|
117
118
|
value: e.id,
|
|
118
119
|
label: e.display.label
|
|
119
120
|
})),
|
|
120
|
-
[
|
|
121
|
+
[l]
|
|
121
122
|
), M = c(
|
|
122
|
-
() => _(t.fields,
|
|
123
|
-
[
|
|
123
|
+
() => _(t.fields, l),
|
|
124
|
+
[l]
|
|
124
125
|
), p = !!t.search;
|
|
125
126
|
return /* @__PURE__ */ s("div", { className: b("component-view-control", m), children: [
|
|
126
127
|
/* @__PURE__ */ o("fieldset", { className: "component-view-control__row", children: /* @__PURE__ */ o(
|
|
@@ -128,7 +129,7 @@ const _0 = ({ className: m }) => {
|
|
|
128
129
|
{
|
|
129
130
|
label: "Layout",
|
|
130
131
|
value: t.layout,
|
|
131
|
-
onChangeValue: (e) =>
|
|
132
|
+
onChangeValue: (e) => r("layout", e),
|
|
132
133
|
options: y(i.length > 0)
|
|
133
134
|
}
|
|
134
135
|
) }),
|
|
@@ -139,7 +140,7 @@ const _0 = ({ className: m }) => {
|
|
|
139
140
|
className: "component-view-control__row__grow",
|
|
140
141
|
label: "Sort by",
|
|
141
142
|
value: t.sortBy,
|
|
142
|
-
onChangeValue: (e) =>
|
|
143
|
+
onChangeValue: (e) => r("sortBy", e),
|
|
143
144
|
options: V,
|
|
144
145
|
disabled: p,
|
|
145
146
|
help: p && "Sorting by search relevance."
|
|
@@ -149,7 +150,7 @@ const _0 = ({ className: m }) => {
|
|
|
149
150
|
n,
|
|
150
151
|
{
|
|
151
152
|
value: t.sortOrder,
|
|
152
|
-
onChangeValue: (e) =>
|
|
153
|
+
onChangeValue: (e) => r("sortOrder", e),
|
|
153
154
|
options: H(),
|
|
154
155
|
disabled: p,
|
|
155
156
|
noLabels: !0
|
|
@@ -163,7 +164,7 @@ const _0 = ({ className: m }) => {
|
|
|
163
164
|
className: "component-view-control__row__grow",
|
|
164
165
|
label: "Group by",
|
|
165
166
|
value: t.groupBy || "",
|
|
166
|
-
onChangeValue: (e) =>
|
|
167
|
+
onChangeValue: (e) => r("groupBy", e),
|
|
167
168
|
options: [{ value: "", label: "" }, ...i]
|
|
168
169
|
}
|
|
169
170
|
),
|
|
@@ -174,7 +175,7 @@ const _0 = ({ className: m }) => {
|
|
|
174
175
|
onLabel: /* @__PURE__ */ o(v, {}),
|
|
175
176
|
offLabel: /* @__PURE__ */ o(A, {}),
|
|
176
177
|
value: !t.includeEmptyGroups,
|
|
177
|
-
onChangeValue: (e) =>
|
|
178
|
+
onChangeValue: (e) => r("includeEmptyGroups", !e),
|
|
178
179
|
disabled: !t.groupBy
|
|
179
180
|
}
|
|
180
181
|
) }),
|
|
@@ -182,7 +183,7 @@ const _0 = ({ className: m }) => {
|
|
|
182
183
|
n,
|
|
183
184
|
{
|
|
184
185
|
value: t.groupOrder,
|
|
185
|
-
onChangeValue: (e) =>
|
|
186
|
+
onChangeValue: (e) => r("groupOrder", e),
|
|
186
187
|
options: H(),
|
|
187
188
|
noLabels: !0,
|
|
188
189
|
disabled: !t.groupBy
|
|
@@ -195,7 +196,7 @@ const _0 = ({ className: m }) => {
|
|
|
195
196
|
className: "component-view-control__row__grow",
|
|
196
197
|
label: "Sub-items",
|
|
197
198
|
value: t.relationships,
|
|
198
|
-
onChangeValue: (e) =>
|
|
199
|
+
onChangeValue: (e) => r("relationships", e),
|
|
199
200
|
options: C()
|
|
200
201
|
}
|
|
201
202
|
) }),
|
|
@@ -205,12 +206,12 @@ const _0 = ({ className: m }) => {
|
|
|
205
206
|
className: "component-view-control__row__grow",
|
|
206
207
|
label: "Properties",
|
|
207
208
|
value: M,
|
|
208
|
-
onChangeValue: (e) =>
|
|
209
|
+
onChangeValue: (e) => r("fields", F(e)),
|
|
209
210
|
multiple: !0
|
|
210
211
|
}
|
|
211
212
|
) })
|
|
212
213
|
] });
|
|
213
214
|
};
|
|
214
215
|
export {
|
|
215
|
-
|
|
216
|
+
y0 as ViewControl
|
|
216
217
|
};
|
|
@@ -47,13 +47,14 @@ import "../../match-sorter.esm-MNVE8H_6.js";
|
|
|
47
47
|
/* empty css */
|
|
48
48
|
import { R as N } from "../../index-CLl-PPjx.js";
|
|
49
49
|
import "./slots/group/context.js";
|
|
50
|
+
import "../menu/context.js";
|
|
50
51
|
/* empty css */
|
|
51
52
|
import "./slots/item/context.js";
|
|
52
53
|
import "./slots/property/context.js";
|
|
53
54
|
/* empty css */
|
|
54
55
|
import "../tag/index.js";
|
|
55
56
|
import "./parts/view-control/index.js";
|
|
56
|
-
const
|
|
57
|
+
const yo = ({
|
|
57
58
|
className: s,
|
|
58
59
|
items: p,
|
|
59
60
|
primaryKey: i,
|
|
@@ -106,5 +107,5 @@ const qo = ({
|
|
|
106
107
|
] }) });
|
|
107
108
|
};
|
|
108
109
|
export {
|
|
109
|
-
|
|
110
|
+
yo as Root
|
|
110
111
|
};
|
|
@@ -1,44 +1,30 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { Menu as
|
|
3
|
-
import { cn as
|
|
4
|
-
import * as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
type: "action",
|
|
17
|
-
label: e.label,
|
|
18
|
-
icon: e.icon,
|
|
19
|
-
disabled: e.disabled,
|
|
20
|
-
onClick: () => a(e)
|
|
21
|
-
})
|
|
22
|
-
),
|
|
23
|
-
[o]
|
|
24
|
-
), a = (e) => {
|
|
25
|
-
var s;
|
|
26
|
-
(s = e.singleFn) == null || s.call(e, l);
|
|
27
|
-
};
|
|
28
|
-
if (r.length !== 0)
|
|
29
|
-
return /* @__PURE__ */ m(
|
|
30
|
-
c,
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { Menu as s } from "../../../menu/index.js";
|
|
3
|
+
import { cn as a } from "../../../../utils/css.js";
|
|
4
|
+
import * as e from "react";
|
|
5
|
+
import { w as n } from "../../../../SSRBase.es-BUXS72ra.js";
|
|
6
|
+
import { a as c } from "../../../../DotsThreeVertical.es-uadrGk3y.js";
|
|
7
|
+
import { R as l } from "../../../../index-CLl-PPjx.js";
|
|
8
|
+
import { useItem as f } from "./context.js";
|
|
9
|
+
const i = e.forwardRef((o, t) => /* @__PURE__ */ e.createElement(n, { ref: t, ...o, weights: c }));
|
|
10
|
+
i.displayName = "DotsThreeVerticalIcon";
|
|
11
|
+
const x = ({ className: o }) => {
|
|
12
|
+
const { actions: t } = l.use(), { item: m } = f();
|
|
13
|
+
if (t.length !== 0)
|
|
14
|
+
return /* @__PURE__ */ r(
|
|
15
|
+
s,
|
|
31
16
|
{
|
|
32
|
-
className:
|
|
17
|
+
className: a("data-view-slot__item__actions", o),
|
|
33
18
|
iconOnly: !0,
|
|
34
19
|
variant: "ghost",
|
|
35
20
|
size: "small",
|
|
36
21
|
"aria-label": "More Actions",
|
|
37
|
-
|
|
38
|
-
|
|
22
|
+
context: [m],
|
|
23
|
+
items: t,
|
|
24
|
+
children: /* @__PURE__ */ r(i, {})
|
|
39
25
|
}
|
|
40
26
|
);
|
|
41
27
|
};
|
|
42
28
|
export {
|
|
43
|
-
|
|
29
|
+
x as Actions
|
|
44
30
|
};
|
|
@@ -1,15 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export type Action<TData extends object = object> = {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
variant: "primary" | "secondary";
|
|
6
|
-
icon?: FC<{
|
|
7
|
-
className?: string;
|
|
8
|
-
}>;
|
|
9
|
-
disabled: boolean;
|
|
10
|
-
singleFn?: (item: TData) => Promise<void> | void;
|
|
11
|
-
bulkFn?: (item: TData[]) => Promise<void> | void;
|
|
12
|
-
};
|
|
13
|
-
export type PartialAction<TData extends object = object> = Partial<Action<TData>> & {
|
|
14
|
-
id: string;
|
|
1
|
+
import { AnyMenuItem } from '../../menu/types';
|
|
2
|
+
export type Action<TData extends object = object> = AnyMenuItem<TData[]> & {
|
|
3
|
+
primary?: boolean;
|
|
4
|
+
disabled?: boolean;
|
|
15
5
|
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as n, useContext as s } from "react";
|
|
3
|
+
const e = n(void 0), c = ({
|
|
4
|
+
children: o,
|
|
5
|
+
actionContext: r
|
|
6
|
+
}) => /* @__PURE__ */ t(e.Provider, { value: { actionContext: r }, children: o }), m = () => s(e);
|
|
7
|
+
export {
|
|
8
|
+
c as MenuProvider,
|
|
9
|
+
m as useMenu
|
|
10
|
+
};
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
2
2
|
import { ButtonProps } from '../button/button';
|
|
3
3
|
import { AnyMenuItem } from './types';
|
|
4
|
-
interface MenuProps extends PropsWithChildren {
|
|
4
|
+
interface MenuProps<Context> extends PropsWithChildren {
|
|
5
5
|
className?: string;
|
|
6
6
|
iconOnly?: boolean;
|
|
7
7
|
variant?: ButtonProps["variant"];
|
|
8
8
|
size?: ButtonProps["size"];
|
|
9
|
-
items: AnyMenuItem[];
|
|
9
|
+
items: AnyMenuItem<Context>[];
|
|
10
|
+
context?: Context;
|
|
10
11
|
}
|
|
11
|
-
export declare
|
|
12
|
+
export declare function Menu<Context>({ className, iconOnly, items, variant, size, children, context, }: MenuProps<Context>): import("react/jsx-runtime").JSX.Element;
|
|
12
13
|
export {};
|
|
@@ -1,30 +1,32 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { cn as
|
|
3
|
-
import { useState as
|
|
1
|
+
import { jsx as e, jsxs as l } from "react/jsx-runtime";
|
|
2
|
+
import { cn as M } from "../../utils/css.js";
|
|
3
|
+
import { useState as w } from "react";
|
|
4
4
|
import { Button as r } from "../button/index.js";
|
|
5
|
-
import {
|
|
5
|
+
import { MenuProvider as _ } from "./context.js";
|
|
6
|
+
import { M as h } from "../../item-CmTk8eHD.js";
|
|
6
7
|
import '../../assets/style20.css';/* empty css */
|
|
7
|
-
import { M as
|
|
8
|
-
|
|
8
|
+
import { M as v, a as x, b as P } from "../../menu-button-GQO5dB3U.js";
|
|
9
|
+
function C({
|
|
9
10
|
className: n,
|
|
10
11
|
iconOnly: t = !1,
|
|
11
12
|
items: m,
|
|
12
13
|
variant: s,
|
|
13
14
|
size: a,
|
|
14
|
-
children: p
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
children: p,
|
|
16
|
+
context: i
|
|
17
|
+
}) {
|
|
18
|
+
const [o, u] = w(!1), c = t ? r.Icon : r;
|
|
19
|
+
return /* @__PURE__ */ e(_, { actionContext: i, children: /* @__PURE__ */ l(v, { open: o, setOpen: u, children: [
|
|
18
20
|
/* @__PURE__ */ e(
|
|
19
|
-
|
|
21
|
+
x,
|
|
20
22
|
{
|
|
21
|
-
className:
|
|
23
|
+
className: M("component-menu__button", n),
|
|
22
24
|
render: /* @__PURE__ */ e(c, { variant: s, size: a }),
|
|
23
25
|
children: p
|
|
24
26
|
}
|
|
25
27
|
),
|
|
26
28
|
o && /* @__PURE__ */ e(
|
|
27
|
-
|
|
29
|
+
P,
|
|
28
30
|
{
|
|
29
31
|
wrapperProps: {
|
|
30
32
|
className: "component-menu__menu-wrapper"
|
|
@@ -34,11 +36,11 @@ const I = ({
|
|
|
34
36
|
gutter: 8,
|
|
35
37
|
overflowPadding: 4,
|
|
36
38
|
className: "component-menu__window",
|
|
37
|
-
children: m.map((
|
|
39
|
+
children: m.map((f, d) => /* @__PURE__ */ e(h, { item: f }, d))
|
|
38
40
|
}
|
|
39
41
|
)
|
|
40
|
-
] });
|
|
41
|
-
}
|
|
42
|
+
] }) });
|
|
43
|
+
}
|
|
42
44
|
export {
|
|
43
|
-
|
|
45
|
+
C as Menu
|
|
44
46
|
};
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import { jsxs as o, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
import { useMenu as t } from "../context.js";
|
|
3
|
+
import { EmptyIcon as i } from "../icon.js";
|
|
4
|
+
import { M as _ } from "../../../2NBKRL7C-DBbnghCe.js";
|
|
5
|
+
const d = ({ item: n }) => {
|
|
6
|
+
const { actionContext: c } = t(), m = n.icon || i;
|
|
6
7
|
return /* @__PURE__ */ o(
|
|
7
|
-
|
|
8
|
+
_,
|
|
8
9
|
{
|
|
9
10
|
className: "component-menu__item component-menu__item--action",
|
|
10
|
-
onClick:
|
|
11
|
+
onClick: () => {
|
|
12
|
+
n.onClick(c);
|
|
13
|
+
},
|
|
11
14
|
disabled: n.disabled,
|
|
12
15
|
children: [
|
|
13
16
|
/* @__PURE__ */ e(m, { className: "component-menu__item__icon component-menu__item__icon--pictoral" }),
|
|
@@ -20,5 +23,5 @@ const l = ({ item: n }) => {
|
|
|
20
23
|
);
|
|
21
24
|
};
|
|
22
25
|
export {
|
|
23
|
-
|
|
26
|
+
d as ActionMenuItem
|
|
24
27
|
};
|
|
@@ -1,29 +1,30 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { cn as
|
|
3
|
-
import { r as a, a as
|
|
1
|
+
import { jsxs as c, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { cn as i } from "../../../utils/css.js";
|
|
3
|
+
import { r as a, a as p } from "../../../Square.es-KJLdY11q.js";
|
|
4
4
|
import "react";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
5
|
+
import { useMenu as d } from "../context.js";
|
|
6
|
+
import { EmptyIcon as u } from "../icon.js";
|
|
7
|
+
import { M as h } from "../../../2NBKRL7C-DBbnghCe.js";
|
|
8
|
+
const I = ({ item: e }) => {
|
|
9
|
+
const { actionContext: o } = d(), l = e.icon || u, r = () => {
|
|
10
|
+
var m, t, s;
|
|
11
|
+
const _ = !e.checked;
|
|
12
|
+
return (m = e.onToggle) == null || m.call(e, _, o), _ ? (t = e.onCheck) == null ? void 0 : t.call(e, o) : (s = e.onUncheck) == null ? void 0 : s.call(e, o);
|
|
12
13
|
};
|
|
13
|
-
return /* @__PURE__ */
|
|
14
|
-
|
|
14
|
+
return /* @__PURE__ */ c(
|
|
15
|
+
h,
|
|
15
16
|
{
|
|
16
17
|
hideOnClick: !1,
|
|
17
|
-
className:
|
|
18
|
+
className: i(
|
|
18
19
|
"component-menu__item component-menu__item--toggle",
|
|
19
20
|
e.checked && "component-menu__item--toggle--checked"
|
|
20
21
|
),
|
|
21
22
|
disabled: e.disabled,
|
|
22
|
-
onClick:
|
|
23
|
+
onClick: r,
|
|
23
24
|
children: [
|
|
24
|
-
/* @__PURE__ */ n(
|
|
25
|
-
/* @__PURE__ */
|
|
26
|
-
/* @__PURE__ */
|
|
25
|
+
/* @__PURE__ */ n(l, { className: "component-menu__item__icon component-menu__item__icon--pictoral" }),
|
|
26
|
+
/* @__PURE__ */ c("div", { className: "component-menu__item__text", children: [
|
|
27
|
+
/* @__PURE__ */ c("div", { className: "component-menu__item__text__header", children: [
|
|
27
28
|
/* @__PURE__ */ n("div", { className: "component-menu__item__label", children: e.label }),
|
|
28
29
|
e.checked ? /* @__PURE__ */ n(
|
|
29
30
|
a,
|
|
@@ -31,7 +32,7 @@ const x = ({ item: e }) => {
|
|
|
31
32
|
weight: "fill",
|
|
32
33
|
className: "component-menu__item__icon component-menu__item__icon--checkbox"
|
|
33
34
|
}
|
|
34
|
-
) : /* @__PURE__ */ n(
|
|
35
|
+
) : /* @__PURE__ */ n(p, { className: "component-menu__item__icon component-menu__item__icon--checkbox" })
|
|
35
36
|
] }),
|
|
36
37
|
/* @__PURE__ */ n("p", { className: "component-menu__item__description", children: e.description })
|
|
37
38
|
] })
|
|
@@ -40,5 +41,5 @@ const x = ({ item: e }) => {
|
|
|
40
41
|
);
|
|
41
42
|
};
|
|
42
43
|
export {
|
|
43
|
-
|
|
44
|
+
I as ToggleMenuItem
|
|
44
45
|
};
|
|
@@ -8,22 +8,22 @@ export interface MenuItem {
|
|
|
8
8
|
description?: string;
|
|
9
9
|
disabled?: boolean;
|
|
10
10
|
}
|
|
11
|
-
export interface MenuItemAction extends MenuItem {
|
|
11
|
+
export interface MenuItemAction<Context> extends MenuItem {
|
|
12
12
|
type: "action";
|
|
13
|
-
onClick: () => void;
|
|
13
|
+
onClick: (context: Context) => void;
|
|
14
14
|
}
|
|
15
|
-
export interface MenuItemToggle extends MenuItem {
|
|
15
|
+
export interface MenuItemToggle<Context> extends MenuItem {
|
|
16
16
|
type: "toggle";
|
|
17
17
|
checked: boolean;
|
|
18
|
-
onToggle?: (checked: boolean) => void;
|
|
19
|
-
onCheck?: () => void;
|
|
20
|
-
onUncheck?: () => void;
|
|
18
|
+
onToggle?: (checked: boolean, context: Context) => void;
|
|
19
|
+
onCheck?: (context: Context) => void;
|
|
20
|
+
onUncheck?: (context: Context) => void;
|
|
21
21
|
}
|
|
22
|
-
export interface MenuItemSubmenu extends MenuItem {
|
|
22
|
+
export interface MenuItemSubmenu<Context> extends MenuItem {
|
|
23
23
|
type: "submenu";
|
|
24
|
-
children: AnyMenuItem[];
|
|
24
|
+
children: AnyMenuItem<Context>[];
|
|
25
25
|
}
|
|
26
26
|
export type MenuItemSeparator = {
|
|
27
27
|
type: "separator";
|
|
28
28
|
};
|
|
29
|
-
export type AnyMenuItem = MenuItemAction | MenuItemToggle | MenuItemSubmenu | MenuItemSeparator;
|
|
29
|
+
export type AnyMenuItem<Context> = MenuItemAction<Context> | MenuItemToggle<Context> | MenuItemSubmenu<Context> | MenuItemSeparator;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { FC, PropsWithChildren } from 'react';
|
|
2
|
-
|
|
3
|
-
type Placement = BasePlacement | `${BasePlacement}-start` | `${BasePlacement}-end`;
|
|
2
|
+
import * as Ariakit from "@ariakit/react";
|
|
4
3
|
interface RootProps extends PropsWithChildren {
|
|
5
4
|
open?: boolean;
|
|
6
5
|
setOpen?: (open: boolean) => void;
|
|
7
|
-
placement?:
|
|
6
|
+
placement?: Ariakit.PopoverStoreState["placement"];
|
|
8
7
|
}
|
|
9
8
|
export declare const Root: FC<RootProps>;
|
|
10
9
|
export {};
|