@wrdagency/blockout 0.0.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/2NBKRL7C-DnAMmXv4.js +81 -0
- package/dist/CaretDown.es-eySGHzTJ.js +32 -0
- package/dist/CaretUp.es-Cy8czlHG.js +32 -0
- package/dist/P7GR5CS5-BryEvRCz.js +621 -0
- package/dist/SSRBase.es-BUXS72ra.js +33 -0
- package/dist/T7VMP3TM--1s529fr.js +3544 -0
- package/dist/UQQRIHDV-Bfi_RJby.js +1046 -0
- package/dist/VIIRIBF3-XWA2y8Hu.js +21 -0
- package/dist/_commonjsHelpers-C6fGbg64.js +6 -0
- package/dist/assets/index.css +1 -0
- package/dist/assets/index10.css +1 -0
- package/dist/assets/index11.css +1 -0
- package/dist/assets/index2.css +1 -0
- package/dist/assets/index3.css +1 -0
- package/dist/assets/index4.css +1 -0
- package/dist/assets/index5.css +1 -0
- package/dist/assets/index6.css +1 -0
- package/dist/assets/index7.css +1 -0
- package/dist/assets/index8.css +1 -0
- package/dist/assets/index9.css +1 -0
- package/dist/components/button/index.d.ts +9 -0
- package/dist/components/button/index.js +28 -0
- package/dist/components/button-group/index.d.ts +6 -0
- package/dist/components/button-group/index.js +6 -0
- package/dist/components/controls/base-control/index.d.ts +3 -0
- package/dist/components/controls/base-control/index.js +26 -0
- package/dist/components/controls/base-control/props.d.ts +23 -0
- package/dist/components/controls/base-control/props.js +21 -0
- package/dist/components/controls/index.d.ts +6 -0
- package/dist/components/controls/index.js +14 -0
- package/dist/components/controls/number-control/index.d.ts +6 -0
- package/dist/components/controls/number-control/index.js +52 -0
- package/dist/components/controls/select-control/index.d.ts +9 -0
- package/dist/components/controls/select-control/index.js +591 -0
- package/dist/components/controls/select-control/options.d.ts +11 -0
- package/dist/components/controls/select-control/options.js +12 -0
- package/dist/components/controls/text-control/index.d.ts +6 -0
- package/dist/components/controls/text-control/index.js +12 -0
- package/dist/components/controls/textarea-control/index.d.ts +6 -0
- package/dist/components/controls/textarea-control/index.js +18 -0
- package/dist/components/controls/toggle-control/index.d.ts +8 -0
- package/dist/components/controls/toggle-control/index.js +46 -0
- package/dist/components/data-table/column.d.ts +4 -0
- package/dist/components/data-table/column.js +874 -0
- package/dist/components/data-table/context.d.ts +7 -0
- package/dist/components/data-table/context.js +36 -0
- package/dist/components/data-table/example.d.ts +1 -0
- package/dist/components/data-table/example.js +5 -0
- package/dist/components/data-table/footer.d.ts +2 -0
- package/dist/components/data-table/footer.js +23 -0
- package/dist/components/data-table/header.d.ts +7 -0
- package/dist/components/data-table/header.js +408 -0
- package/dist/components/data-table/index.d.ts +10 -0
- package/dist/components/data-table/index.js +86 -0
- package/dist/components/data-table/types.d.ts +75 -0
- package/dist/components/data-table/types.js +1 -0
- package/dist/components/index.d.ts +5 -0
- package/dist/components/index.js +23 -0
- package/dist/components/menu/icon.d.ts +4 -0
- package/dist/components/menu/icon.js +6 -0
- package/dist/components/menu/index.d.ts +8 -0
- package/dist/components/menu/index.js +131 -0
- package/dist/components/menu/item.d.ts +7 -0
- package/dist/components/menu/item.js +8 -0
- package/dist/components/menu/items/action.d.ts +7 -0
- package/dist/components/menu/items/action.js +23 -0
- package/dist/components/menu/items/spacer.d.ts +2 -0
- package/dist/components/menu/items/spacer.js +46 -0
- package/dist/components/menu/items/submenu.d.ts +7 -0
- package/dist/components/menu/items/submenu.js +7 -0
- package/dist/components/menu/items/toggle.d.ts +7 -0
- package/dist/components/menu/items/toggle.js +109 -0
- package/dist/components/menu/types.d.ts +28 -0
- package/dist/components/menu/types.js +1 -0
- package/dist/components/visually-hidden/index.d.ts +2 -0
- package/dist/components/visually-hidden/index.js +5 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +25 -0
- package/dist/item-CPVd5mKo.js +758 -0
- package/dist/primitives/draggable/index.d.ts +17 -0
- package/dist/primitives/draggable/index.js +52 -0
- package/dist/primitives/index.d.ts +1 -0
- package/dist/primitives/index.js +4 -0
- package/dist/primitives/resizable/index.d.ts +7 -0
- package/dist/primitives/resizable/index.js +76 -0
- package/dist/types/component.d.ts +4 -0
- package/dist/types/component.js +1 -0
- package/dist/types/math.d.ts +10 -0
- package/dist/types/math.js +1 -0
- package/dist/utils/css.d.ts +1 -0
- package/dist/utils/css.js +6 -0
- package/dist/utils/noop.d.ts +1 -0
- package/dist/utils/noop.js +5 -0
- package/package.json +61 -0
- package/readme.md +3 -0
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export type ColumnContext<T> = {
|
|
3
|
+
column: Column<T>;
|
|
4
|
+
data: T[];
|
|
5
|
+
};
|
|
6
|
+
export type CellContext<T> = {
|
|
7
|
+
column: Column<T>;
|
|
8
|
+
row: T;
|
|
9
|
+
data: T[];
|
|
10
|
+
};
|
|
11
|
+
export type SortDirection = "ascending" | "descending" | "none";
|
|
12
|
+
export type SortFn<T> = (a: T, b: T) => number;
|
|
13
|
+
export type ColumnDef<T> = {
|
|
14
|
+
id?: string;
|
|
15
|
+
accessorKey?: keyof T;
|
|
16
|
+
header?: ReactNode | ((context: ColumnContext<T>) => ReactNode);
|
|
17
|
+
cell?: ReactNode | ((context: CellContext<T>) => ReactNode);
|
|
18
|
+
footer?: ReactNode | ((context: ColumnContext<T>) => ReactNode);
|
|
19
|
+
sortable?: SortFn<T> | false | true;
|
|
20
|
+
};
|
|
21
|
+
export type NormalizedColumnDef<T> = {
|
|
22
|
+
id: string;
|
|
23
|
+
accessorKey: keyof T | undefined;
|
|
24
|
+
header: (context: ColumnContext<T>) => ReactNode;
|
|
25
|
+
cell: (context: CellContext<T>) => ReactNode;
|
|
26
|
+
footer: (context: ColumnContext<T>) => ReactNode;
|
|
27
|
+
sortable: SortFn<T> | undefined;
|
|
28
|
+
};
|
|
29
|
+
export type Column<T> = {
|
|
30
|
+
id: string;
|
|
31
|
+
accessorKey: keyof T | undefined;
|
|
32
|
+
header: (context: ColumnContext<T>) => ReactNode;
|
|
33
|
+
cell: (context: CellContext<T>) => ReactNode;
|
|
34
|
+
footer: (context: ColumnContext<T>) => ReactNode;
|
|
35
|
+
position: {
|
|
36
|
+
index: number;
|
|
37
|
+
isFirst: () => boolean;
|
|
38
|
+
isLast: () => boolean;
|
|
39
|
+
moveTo: (index: number) => void;
|
|
40
|
+
moveLeft: () => void;
|
|
41
|
+
moveRight: () => void;
|
|
42
|
+
moveToStart: () => void;
|
|
43
|
+
moveToEnd: () => void;
|
|
44
|
+
};
|
|
45
|
+
sticky: {
|
|
46
|
+
stuck: boolean;
|
|
47
|
+
stick: () => void;
|
|
48
|
+
unstick: () => void;
|
|
49
|
+
};
|
|
50
|
+
visibility: {
|
|
51
|
+
hidden: boolean;
|
|
52
|
+
toggle: () => void;
|
|
53
|
+
hide: () => void;
|
|
54
|
+
show: () => void;
|
|
55
|
+
};
|
|
56
|
+
sort?: {
|
|
57
|
+
direction: SortDirection;
|
|
58
|
+
compare: SortFn<T>;
|
|
59
|
+
clear: () => void;
|
|
60
|
+
toggle: () => void;
|
|
61
|
+
ascending: () => void;
|
|
62
|
+
descending: () => void;
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
export type ColumnState = {
|
|
66
|
+
id: string;
|
|
67
|
+
isSticky: boolean;
|
|
68
|
+
isHidden: boolean;
|
|
69
|
+
width: number;
|
|
70
|
+
sortDirection: SortDirection;
|
|
71
|
+
};
|
|
72
|
+
export type Table<T> = {
|
|
73
|
+
data: T[];
|
|
74
|
+
columns: Column<T>[];
|
|
75
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { Button } from './button';
|
|
2
|
+
export { ButtonGroup } from './button-group';
|
|
3
|
+
export { BaseControl, NumberControl, SelectControl, TextareaControl, TextControl, ToggleControl, } from './controls';
|
|
4
|
+
export { DataTable, ExampleDataTable } from './data-table';
|
|
5
|
+
export { Menu } from './menu';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Button as t } from "./button/index.js";
|
|
2
|
+
import { ButtonGroup as x } from "./button-group/index.js";
|
|
3
|
+
import { BaseControl as p } from "./controls/base-control/index.js";
|
|
4
|
+
import { NumberControl as a } from "./controls/number-control/index.js";
|
|
5
|
+
import { SelectControl as n } from "./controls/select-control/index.js";
|
|
6
|
+
import { TextControl as u } from "./controls/text-control/index.js";
|
|
7
|
+
import { TextareaControl as b } from "./controls/textarea-control/index.js";
|
|
8
|
+
import { ToggleControl as g } from "./controls/toggle-control/index.js";
|
|
9
|
+
import { DataTable as c, ExampleDataTable as s } from "./data-table/index.js";
|
|
10
|
+
import { Menu as G } from "./menu/index.js";
|
|
11
|
+
export {
|
|
12
|
+
p as BaseControl,
|
|
13
|
+
t as Button,
|
|
14
|
+
x as ButtonGroup,
|
|
15
|
+
c as DataTable,
|
|
16
|
+
s as ExampleDataTable,
|
|
17
|
+
G as Menu,
|
|
18
|
+
a as NumberControl,
|
|
19
|
+
n as SelectControl,
|
|
20
|
+
u as TextControl,
|
|
21
|
+
b as TextareaControl,
|
|
22
|
+
g as ToggleControl
|
|
23
|
+
};
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { jsx as a, jsxs as m } from "react/jsx-runtime";
|
|
2
|
+
import { cn as E } from "../../utils/css.js";
|
|
3
|
+
import { M as V, a as C, b as R, c as z } from "../../item-CPVd5mKo.js";
|
|
4
|
+
import { a as H } from "../../VIIRIBF3-XWA2y8Hu.js";
|
|
5
|
+
import { b as P, _, q as I, i as O, r as j, h as L, j as f, s as T, t as U, v as B, w as D, m as q, f as x, d as y } from "../../P7GR5CS5-BryEvRCz.js";
|
|
6
|
+
import { u as k } from "../../UQQRIHDV-Bfi_RJby.js";
|
|
7
|
+
import { useMemo as w, useState as Z } from "react";
|
|
8
|
+
import '../../assets/index10.css';var g = "M23 27.8C24.1 29 26.4 30 28 30H30H0H2C3.7 30 5.9 29 7 27.8L14 20.6C14.7 19.8 15.3 19.8 16 20.6L23 27.8Z", F = "div", h = 30, s = h / 2, G = {
|
|
9
|
+
top: `rotate(180 ${s} ${s})`,
|
|
10
|
+
right: `rotate(-90 ${s} ${s})`,
|
|
11
|
+
bottom: `rotate(0 ${s} ${s})`,
|
|
12
|
+
left: `rotate(90 ${s} ${s})`
|
|
13
|
+
};
|
|
14
|
+
function J(o) {
|
|
15
|
+
const [r, t] = Z(), e = k(o, "contentElement");
|
|
16
|
+
return B(() => {
|
|
17
|
+
if (!e) return;
|
|
18
|
+
const u = D(e).getComputedStyle(e);
|
|
19
|
+
t(u);
|
|
20
|
+
}, [e]), r;
|
|
21
|
+
}
|
|
22
|
+
function K(o) {
|
|
23
|
+
var r;
|
|
24
|
+
return o ? (r = o.getPropertyValue("box-shadow").match(/0px 0px 0px ([^0]+px)/)) == null ? void 0 : r[1] : void 0;
|
|
25
|
+
}
|
|
26
|
+
var M = P(
|
|
27
|
+
function(r) {
|
|
28
|
+
var t = r, {
|
|
29
|
+
store: e,
|
|
30
|
+
size: i = h,
|
|
31
|
+
borderWidth: u
|
|
32
|
+
} = t, c = _(t, [
|
|
33
|
+
"store",
|
|
34
|
+
"size",
|
|
35
|
+
"borderWidth"
|
|
36
|
+
]);
|
|
37
|
+
const $ = I();
|
|
38
|
+
e = e || $, O(
|
|
39
|
+
e,
|
|
40
|
+
process.env.NODE_ENV !== "production" && "PopoverArrow must be wrapped in a Popover component."
|
|
41
|
+
);
|
|
42
|
+
const d = k(
|
|
43
|
+
e,
|
|
44
|
+
(p) => p.currentPlacement.split("-")[0]
|
|
45
|
+
), l = j(), n = J(e), S = (n == null ? void 0 : n.getPropertyValue("background-color")) || "none", W = (n == null ? void 0 : n.getPropertyValue(`border-${d}-color`)) || "none", A = w(() => {
|
|
46
|
+
if (u != null) return u;
|
|
47
|
+
if (!n) return 0;
|
|
48
|
+
const p = K(n);
|
|
49
|
+
if (p) return Number.parseInt(p);
|
|
50
|
+
const b = n.getPropertyValue(`border-${d}-width`);
|
|
51
|
+
return b ? Number.parseInt(b) : 0;
|
|
52
|
+
}, [u, n, d]) * 2 * (h / i), v = G[d], N = w(
|
|
53
|
+
() => /* @__PURE__ */ a("svg", { display: "block", viewBox: "0 0 30 30", children: /* @__PURE__ */ m("g", { transform: v, children: [
|
|
54
|
+
/* @__PURE__ */ a("path", { fill: "none", d: g, mask: `url(#${l})` }),
|
|
55
|
+
/* @__PURE__ */ a("path", { stroke: "none", d: g }),
|
|
56
|
+
/* @__PURE__ */ a("mask", { id: l, maskUnits: "userSpaceOnUse", children: /* @__PURE__ */ a(
|
|
57
|
+
"rect",
|
|
58
|
+
{
|
|
59
|
+
x: "-15",
|
|
60
|
+
y: "0",
|
|
61
|
+
width: "60",
|
|
62
|
+
height: "30",
|
|
63
|
+
fill: "white",
|
|
64
|
+
stroke: "black"
|
|
65
|
+
}
|
|
66
|
+
) })
|
|
67
|
+
] }) }),
|
|
68
|
+
[v, l]
|
|
69
|
+
);
|
|
70
|
+
return c = L(f({
|
|
71
|
+
children: N,
|
|
72
|
+
"aria-hidden": !0
|
|
73
|
+
}, c), {
|
|
74
|
+
ref: T(e.setArrowElement, c.ref),
|
|
75
|
+
style: f({
|
|
76
|
+
position: "absolute",
|
|
77
|
+
fontSize: i,
|
|
78
|
+
width: "1em",
|
|
79
|
+
height: "1em",
|
|
80
|
+
pointerEvents: "none",
|
|
81
|
+
fill: `var(--ak-layer, ${S})`,
|
|
82
|
+
stroke: `var(--ak-layer-border, ${W})`,
|
|
83
|
+
strokeWidth: A
|
|
84
|
+
}, c.style)
|
|
85
|
+
}), U(c);
|
|
86
|
+
}
|
|
87
|
+
);
|
|
88
|
+
q(
|
|
89
|
+
x(function(r) {
|
|
90
|
+
const t = M(r);
|
|
91
|
+
return y(F, t);
|
|
92
|
+
})
|
|
93
|
+
);
|
|
94
|
+
var Q = "div", X = P(
|
|
95
|
+
function(r) {
|
|
96
|
+
var t = r, { store: e } = t, i = _(t, ["store"]);
|
|
97
|
+
const u = H();
|
|
98
|
+
return e = e || u, M(f({ store: e }, i));
|
|
99
|
+
}
|
|
100
|
+
), Y = x(function(r) {
|
|
101
|
+
const t = X(r);
|
|
102
|
+
return y(Q, t);
|
|
103
|
+
});
|
|
104
|
+
const ue = ({ className: o, items: r, children: t }) => /* @__PURE__ */ m(V, { children: [
|
|
105
|
+
/* @__PURE__ */ a(C, { className: E("component-menu__button", o), children: t }),
|
|
106
|
+
/* @__PURE__ */ m(
|
|
107
|
+
R,
|
|
108
|
+
{
|
|
109
|
+
wrapperProps: {
|
|
110
|
+
className: "component-menu__menu-wrapper"
|
|
111
|
+
},
|
|
112
|
+
portal: !0,
|
|
113
|
+
gutter: -16,
|
|
114
|
+
className: "component-menu",
|
|
115
|
+
children: [
|
|
116
|
+
/* @__PURE__ */ a(
|
|
117
|
+
Y,
|
|
118
|
+
{
|
|
119
|
+
className: "component-menu__arrow",
|
|
120
|
+
borderWidth: 1,
|
|
121
|
+
size: 24
|
|
122
|
+
}
|
|
123
|
+
),
|
|
124
|
+
r.map((e, i) => /* @__PURE__ */ a(z, { item: e }, i))
|
|
125
|
+
]
|
|
126
|
+
}
|
|
127
|
+
)
|
|
128
|
+
] });
|
|
129
|
+
export {
|
|
130
|
+
ue as Menu
|
|
131
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsxs as o, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { EmptyIcon as c } from "../icon.js";
|
|
3
|
+
import { M as t } from "../../../2NBKRL7C-DnAMmXv4.js";
|
|
4
|
+
const l = ({ item: n }) => {
|
|
5
|
+
const m = n.icon || c;
|
|
6
|
+
return /* @__PURE__ */ o(
|
|
7
|
+
t,
|
|
8
|
+
{
|
|
9
|
+
className: "component-menu__item component-menu__item--action",
|
|
10
|
+
onClick: n.onClick,
|
|
11
|
+
children: [
|
|
12
|
+
/* @__PURE__ */ e(m, { className: "component-menu__item__icon component-menu__item__icon--pictoral" }),
|
|
13
|
+
/* @__PURE__ */ o("div", { className: "component-menu__item__text", children: [
|
|
14
|
+
/* @__PURE__ */ e("div", { className: "component-menu__item__label", children: n.label }),
|
|
15
|
+
/* @__PURE__ */ e("p", { className: "component-menu__item__description", children: n.description })
|
|
16
|
+
] })
|
|
17
|
+
]
|
|
18
|
+
}
|
|
19
|
+
);
|
|
20
|
+
};
|
|
21
|
+
export {
|
|
22
|
+
l as ActionMenuItem
|
|
23
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { jsx as f } from "react/jsx-runtime";
|
|
2
|
+
import { a as l } from "../../../VIIRIBF3-XWA2y8Hu.js";
|
|
3
|
+
import { b as s, _ as p, j as i, f as u, d as m, p as h, i as C, h as b } from "../../../P7GR5CS5-BryEvRCz.js";
|
|
4
|
+
var d = "hr", c = s(
|
|
5
|
+
function(o) {
|
|
6
|
+
var r = o, { orientation: e = "horizontal" } = r, t = p(r, ["orientation"]);
|
|
7
|
+
return t = i({
|
|
8
|
+
role: "separator",
|
|
9
|
+
"aria-orientation": e
|
|
10
|
+
}, t), t;
|
|
11
|
+
}
|
|
12
|
+
);
|
|
13
|
+
u(function(o) {
|
|
14
|
+
const r = c(o);
|
|
15
|
+
return m(d, r);
|
|
16
|
+
});
|
|
17
|
+
var x = "hr", v = s(function(o) {
|
|
18
|
+
var r = o, { store: e } = r, t = p(r, ["store"]);
|
|
19
|
+
const n = h();
|
|
20
|
+
e = e || n, C(
|
|
21
|
+
e,
|
|
22
|
+
process.env.NODE_ENV !== "production" && "CompositeSeparator must be wrapped in a Composite component."
|
|
23
|
+
);
|
|
24
|
+
const S = e.useState(
|
|
25
|
+
(_) => _.orientation === "horizontal" ? "vertical" : "horizontal"
|
|
26
|
+
);
|
|
27
|
+
return t = c(b(i({}, t), { orientation: S })), t;
|
|
28
|
+
});
|
|
29
|
+
u(function(o) {
|
|
30
|
+
const r = v(o);
|
|
31
|
+
return m(x, r);
|
|
32
|
+
});
|
|
33
|
+
var M = "hr", N = s(
|
|
34
|
+
function(o) {
|
|
35
|
+
var r = o, { store: e } = r, t = p(r, ["store"]);
|
|
36
|
+
const n = l();
|
|
37
|
+
return e = e || n, t = v(i({ store: e }, t)), t;
|
|
38
|
+
}
|
|
39
|
+
), P = u(function(o) {
|
|
40
|
+
const r = N(o);
|
|
41
|
+
return m(M, r);
|
|
42
|
+
});
|
|
43
|
+
const E = () => /* @__PURE__ */ f(P, { className: "component-menu__separator" });
|
|
44
|
+
export {
|
|
45
|
+
E as SeparatorMenuItem
|
|
46
|
+
};
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { jsxs as l, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { cn as d } from "../../../utils/css.js";
|
|
3
|
+
import * as e from "react";
|
|
4
|
+
import { w as H } from "../../../SSRBase.es-BUXS72ra.js";
|
|
5
|
+
import { EmptyIcon as h } from "../icon.js";
|
|
6
|
+
import { M as i } from "../../../2NBKRL7C-DnAMmXv4.js";
|
|
7
|
+
const s = /* @__PURE__ */ new Map([
|
|
8
|
+
[
|
|
9
|
+
"bold",
|
|
10
|
+
/* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("path", { d: "M79.51,144.49a12,12,0,1,1,17-17L112,143l47.51-47.52a12,12,0,0,1,17,17l-56,56a12,12,0,0,1-17,0ZM228,48V208a20,20,0,0,1-20,20H48a20,20,0,0,1-20-20V48A20,20,0,0,1,48,28H208A20,20,0,0,1,228,48Zm-24,4H52V204H204Z" }))
|
|
11
|
+
],
|
|
12
|
+
[
|
|
13
|
+
"duotone",
|
|
14
|
+
/* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement(
|
|
15
|
+
"path",
|
|
16
|
+
{
|
|
17
|
+
d: "M216,48V208a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V48a8,8,0,0,1,8-8H208A8,8,0,0,1,216,48Z",
|
|
18
|
+
opacity: "0.2"
|
|
19
|
+
}
|
|
20
|
+
), /* @__PURE__ */ e.createElement("path", { d: "M173.66,98.34a8,8,0,0,1,0,11.32l-56,56a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35A8,8,0,0,1,173.66,98.34ZM224,48V208a16,16,0,0,1-16,16H48a16,16,0,0,1-16-16V48A16,16,0,0,1,48,32H208A16,16,0,0,1,224,48ZM208,208V48H48V208H208Z" }))
|
|
21
|
+
],
|
|
22
|
+
[
|
|
23
|
+
"fill",
|
|
24
|
+
/* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("path", { d: "M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32Zm-34.34,77.66-56,56a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35a8,8,0,0,1,11.32,11.32Z" }))
|
|
25
|
+
],
|
|
26
|
+
[
|
|
27
|
+
"light",
|
|
28
|
+
/* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("path", { d: "M172.24,99.76a6,6,0,0,1,0,8.48l-56,56a6,6,0,0,1-8.48,0l-24-24a6,6,0,0,1,8.48-8.48L112,151.51l51.76-51.75A6,6,0,0,1,172.24,99.76ZM222,48V208a14,14,0,0,1-14,14H48a14,14,0,0,1-14-14V48A14,14,0,0,1,48,34H208A14,14,0,0,1,222,48Zm-12,0a2,2,0,0,0-2-2H48a2,2,0,0,0-2,2V208a2,2,0,0,0,2,2H208a2,2,0,0,0,2-2Z" }))
|
|
29
|
+
],
|
|
30
|
+
[
|
|
31
|
+
"regular",
|
|
32
|
+
/* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("path", { d: "M173.66,98.34a8,8,0,0,1,0,11.32l-56,56a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35A8,8,0,0,1,173.66,98.34ZM224,48V208a16,16,0,0,1-16,16H48a16,16,0,0,1-16-16V48A16,16,0,0,1,48,32H208A16,16,0,0,1,224,48ZM208,208V48H48V208H208Z" }))
|
|
33
|
+
],
|
|
34
|
+
[
|
|
35
|
+
"thin",
|
|
36
|
+
/* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("path", { d: "M170.83,101.17a4,4,0,0,1,0,5.66l-56,56a4,4,0,0,1-5.66,0l-24-24a4,4,0,0,1,5.66-5.66L112,154.34l53.17-53.17A4,4,0,0,1,170.83,101.17ZM220,48V208a12,12,0,0,1-12,12H48a12,12,0,0,1-12-12V48A12,12,0,0,1,48,36H208A12,12,0,0,1,220,48Zm-8,0a4,4,0,0,0-4-4H48a4,4,0,0,0-4,4V208a4,4,0,0,0,4,4H208a4,4,0,0,0,4-4Z" }))
|
|
37
|
+
]
|
|
38
|
+
]), _ = e.forwardRef((a, n) => /* @__PURE__ */ e.createElement(H, { ref: n, ...a, weights: s }));
|
|
39
|
+
_.displayName = "CheckSquareIcon";
|
|
40
|
+
const u = /* @__PURE__ */ new Map([
|
|
41
|
+
[
|
|
42
|
+
"bold",
|
|
43
|
+
/* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("path", { d: "M208,28H48A20,20,0,0,0,28,48V208a20,20,0,0,0,20,20H208a20,20,0,0,0,20-20V48A20,20,0,0,0,208,28Zm-4,176H52V52H204Z" }))
|
|
44
|
+
],
|
|
45
|
+
[
|
|
46
|
+
"duotone",
|
|
47
|
+
/* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement(
|
|
48
|
+
"path",
|
|
49
|
+
{
|
|
50
|
+
d: "M216,48V208a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V48a8,8,0,0,1,8-8H208A8,8,0,0,1,216,48Z",
|
|
51
|
+
opacity: "0.2"
|
|
52
|
+
}
|
|
53
|
+
), /* @__PURE__ */ e.createElement("path", { d: "M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32Zm0,176H48V48H208V208Z" }))
|
|
54
|
+
],
|
|
55
|
+
[
|
|
56
|
+
"fill",
|
|
57
|
+
/* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("path", { d: "M224,48V208a16,16,0,0,1-16,16H48a16,16,0,0,1-16-16V48A16,16,0,0,1,48,32H208A16,16,0,0,1,224,48Z" }))
|
|
58
|
+
],
|
|
59
|
+
[
|
|
60
|
+
"light",
|
|
61
|
+
/* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("path", { d: "M208,34H48A14,14,0,0,0,34,48V208a14,14,0,0,0,14,14H208a14,14,0,0,0,14-14V48A14,14,0,0,0,208,34Zm2,174a2,2,0,0,1-2,2H48a2,2,0,0,1-2-2V48a2,2,0,0,1,2-2H208a2,2,0,0,1,2,2Z" }))
|
|
62
|
+
],
|
|
63
|
+
[
|
|
64
|
+
"regular",
|
|
65
|
+
/* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("path", { d: "M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32Zm0,176H48V48H208V208Z" }))
|
|
66
|
+
],
|
|
67
|
+
[
|
|
68
|
+
"thin",
|
|
69
|
+
/* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("path", { d: "M208,36H48A12,12,0,0,0,36,48V208a12,12,0,0,0,12,12H208a12,12,0,0,0,12-12V48A12,12,0,0,0,208,36Zm4,172a4,4,0,0,1-4,4H48a4,4,0,0,1-4-4V48a4,4,0,0,1,4-4H208a4,4,0,0,1,4,4Z" }))
|
|
70
|
+
]
|
|
71
|
+
]), p = e.forwardRef((a, n) => /* @__PURE__ */ e.createElement(H, { ref: n, ...a, weights: u }));
|
|
72
|
+
p.displayName = "SquareIcon";
|
|
73
|
+
const f = ({ item: a }) => {
|
|
74
|
+
const n = a.icon || h, V = () => {
|
|
75
|
+
var m, o, r;
|
|
76
|
+
const c = !a.checked;
|
|
77
|
+
(m = a.onToggle) == null || m.call(a, c), c ? (o = a.onCheck) == null || o.call(a) : (r = a.onUncheck) == null || r.call(a);
|
|
78
|
+
};
|
|
79
|
+
return /* @__PURE__ */ l(
|
|
80
|
+
i,
|
|
81
|
+
{
|
|
82
|
+
hideOnClick: !1,
|
|
83
|
+
className: d(
|
|
84
|
+
"component-menu__item component-menu__item--toggle",
|
|
85
|
+
a.checked && "component-menu__item--toggle--checked"
|
|
86
|
+
),
|
|
87
|
+
onClick: V,
|
|
88
|
+
children: [
|
|
89
|
+
/* @__PURE__ */ t(n, { className: "component-menu__item__icon component-menu__item__icon--pictoral" }),
|
|
90
|
+
/* @__PURE__ */ l("div", { className: "component-menu__item__text", children: [
|
|
91
|
+
/* @__PURE__ */ l("div", { className: "component-menu__item__text__header", children: [
|
|
92
|
+
/* @__PURE__ */ t("div", { className: "component-menu__item__label", children: a.label }),
|
|
93
|
+
a.checked ? /* @__PURE__ */ t(
|
|
94
|
+
_,
|
|
95
|
+
{
|
|
96
|
+
weight: "fill",
|
|
97
|
+
className: "component-menu__item__icon component-menu__item__icon--checkbox"
|
|
98
|
+
}
|
|
99
|
+
) : /* @__PURE__ */ t(p, { className: "component-menu__item__icon component-menu__item__icon--checkbox" })
|
|
100
|
+
] }),
|
|
101
|
+
/* @__PURE__ */ t("p", { className: "component-menu__item__description", children: a.description })
|
|
102
|
+
] })
|
|
103
|
+
]
|
|
104
|
+
}
|
|
105
|
+
);
|
|
106
|
+
};
|
|
107
|
+
export {
|
|
108
|
+
f as ToggleMenuItem
|
|
109
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
export interface MenuItem {
|
|
3
|
+
type: string;
|
|
4
|
+
label: string;
|
|
5
|
+
icon?: FC<{
|
|
6
|
+
className?: string;
|
|
7
|
+
}>;
|
|
8
|
+
description?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface MenuItemAction extends MenuItem {
|
|
11
|
+
type: "action";
|
|
12
|
+
onClick: () => void;
|
|
13
|
+
}
|
|
14
|
+
export interface MenuItemToggle extends MenuItem {
|
|
15
|
+
type: "toggle";
|
|
16
|
+
checked: boolean;
|
|
17
|
+
onToggle?: (checked: boolean) => void;
|
|
18
|
+
onCheck?: () => void;
|
|
19
|
+
onUncheck?: () => void;
|
|
20
|
+
}
|
|
21
|
+
export interface MenuItemSubmenu extends MenuItem {
|
|
22
|
+
type: "submenu";
|
|
23
|
+
children: AnyMenuItem[];
|
|
24
|
+
}
|
|
25
|
+
export type MenuItemSeparator = {
|
|
26
|
+
type: "separator";
|
|
27
|
+
};
|
|
28
|
+
export type AnyMenuItem = MenuItemAction | MenuItemToggle | MenuItemSubmenu | MenuItemSeparator;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Button as t } from "./components/button/index.js";
|
|
2
|
+
import { ButtonGroup as x } from "./components/button-group/index.js";
|
|
3
|
+
import { BaseControl as p } from "./components/controls/base-control/index.js";
|
|
4
|
+
import { NumberControl as l } from "./components/controls/number-control/index.js";
|
|
5
|
+
import { SelectControl as n } from "./components/controls/select-control/index.js";
|
|
6
|
+
import { TextControl as u } from "./components/controls/text-control/index.js";
|
|
7
|
+
import { TextareaControl as b } from "./components/controls/textarea-control/index.js";
|
|
8
|
+
import { ToggleControl as B } from "./components/controls/toggle-control/index.js";
|
|
9
|
+
import { DataTable as c, ExampleDataTable as s } from "./components/data-table/index.js";
|
|
10
|
+
import { Menu as G } from "./components/menu/index.js";
|
|
11
|
+
import { Draggable as N } from "./primitives/draggable/index.js";
|
|
12
|
+
export {
|
|
13
|
+
p as BaseControl,
|
|
14
|
+
t as Button,
|
|
15
|
+
x as ButtonGroup,
|
|
16
|
+
c as DataTable,
|
|
17
|
+
N as Draggable,
|
|
18
|
+
s as ExampleDataTable,
|
|
19
|
+
G as Menu,
|
|
20
|
+
l as NumberControl,
|
|
21
|
+
n as SelectControl,
|
|
22
|
+
u as TextControl,
|
|
23
|
+
b as TextareaControl,
|
|
24
|
+
B as ToggleControl
|
|
25
|
+
};
|