@forgedevstack/bear 1.3.3 → 1.3.5
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/README.md +100 -290
- package/dist/components/Alert/Alert.cjs +1 -1
- package/dist/components/Alert/Alert.const.cjs +1 -1
- package/dist/components/Alert/Alert.const.d.ts +1 -6
- package/dist/components/Alert/Alert.const.js +10 -30
- package/dist/components/Alert/Alert.js +49 -54
- package/dist/components/AlertDialog/AlertDialog.cjs +1 -1
- package/dist/components/AlertDialog/AlertDialog.js +67 -84
- package/dist/components/BottomSheet/BottomSheet.cjs +1 -1
- package/dist/components/BottomSheet/BottomSheet.js +72 -64
- package/dist/components/Calendar/Calendar.cjs +1 -1
- package/dist/components/Calendar/Calendar.js +122 -112
- package/dist/components/Chart/BarChart.cjs +1 -1
- package/dist/components/Chart/BarChart.js +37 -36
- package/dist/components/Chart/Chart.types.d.ts +2 -0
- package/dist/components/Chart/Chart.utils.cjs +1 -1
- package/dist/components/Chart/Chart.utils.d.ts +2 -0
- package/dist/components/Chart/Chart.utils.js +32 -31
- package/dist/components/Chart/FunnelChart.cjs +1 -1
- package/dist/components/Chart/FunnelChart.js +29 -28
- package/dist/components/Chart/LineChart.cjs +1 -1
- package/dist/components/Chart/LineChart.js +45 -44
- package/dist/components/Chart/PieChart.cjs +1 -1
- package/dist/components/Chart/PieChart.js +52 -51
- package/dist/components/Chart/RadarChart.cjs +1 -1
- package/dist/components/Chart/RadarChart.js +63 -62
- package/dist/components/Chart/index.d.ts +1 -1
- package/dist/components/ChipGroup/ChipGroup.cjs +1 -1
- package/dist/components/ChipGroup/ChipGroup.const.cjs +1 -1
- package/dist/components/ChipGroup/ChipGroup.const.d.ts +2 -0
- package/dist/components/ChipGroup/ChipGroup.const.js +6 -4
- package/dist/components/ChipGroup/ChipGroup.js +52 -48
- package/dist/components/CommandPalette/CommandItem.cjs +1 -0
- package/dist/components/CommandPalette/CommandItem.d.ts +6 -0
- package/dist/components/CommandPalette/CommandItem.js +39 -0
- package/dist/components/CommandPalette/CommandPalette.cjs +1 -1
- package/dist/components/CommandPalette/CommandPalette.js +129 -144
- package/dist/components/Drawer/Drawer.cjs +1 -1
- package/dist/components/Drawer/Drawer.js +72 -66
- package/dist/components/EmptyState/EmptyState.cjs +1 -1
- package/dist/components/EmptyState/EmptyState.const.cjs +1 -1
- package/dist/components/EmptyState/EmptyState.const.d.ts +5 -0
- package/dist/components/EmptyState/EmptyState.const.js +30 -15
- package/dist/components/EmptyState/EmptyState.js +35 -35
- package/dist/components/EmptyState/EmptyState.types.d.ts +2 -2
- package/dist/components/HoverCard/HoverCard.cjs +4 -3
- package/dist/components/HoverCard/HoverCard.const.cjs +1 -0
- package/dist/components/HoverCard/HoverCard.const.d.ts +1 -0
- package/dist/components/HoverCard/HoverCard.const.js +5 -0
- package/dist/components/HoverCard/HoverCard.js +62 -56
- package/dist/components/HoverCard/HoverCard.types.d.ts +7 -0
- package/dist/components/Menu/Menu.cjs +1 -1
- package/dist/components/Menu/Menu.const.cjs +1 -0
- package/dist/components/Menu/Menu.const.d.ts +2 -0
- package/dist/components/Menu/Menu.const.js +7 -0
- package/dist/components/Menu/Menu.d.ts +3 -9
- package/dist/components/Menu/Menu.js +57 -89
- package/dist/components/Menu/Menu.types.d.ts +8 -1
- package/dist/components/Menu/MenuDivider.cjs +1 -0
- package/dist/components/Menu/MenuDivider.d.ts +6 -0
- package/dist/components/Menu/MenuDivider.js +7 -0
- package/dist/components/Menu/MenuItem.cjs +1 -0
- package/dist/components/Menu/MenuItem.d.ts +6 -0
- package/dist/components/Menu/MenuItem.js +46 -0
- package/dist/components/Modal/Modal.cjs +1 -1
- package/dist/components/Modal/Modal.const.cjs +1 -1
- package/dist/components/Modal/Modal.const.d.ts +1 -0
- package/dist/components/Modal/Modal.const.js +15 -12
- package/dist/components/Modal/Modal.js +62 -59
- package/dist/components/Modal/Modal.types.d.ts +7 -0
- package/dist/components/ModalsProvider/components/StackedModal/StackedModal.cjs +1 -1
- package/dist/components/ModalsProvider/components/StackedModal/StackedModal.js +10 -9
- package/dist/components/OverlayPortal/OverlayPortal.cjs +1 -1
- package/dist/components/OverlayPortal/OverlayPortal.const.cjs +1 -1
- package/dist/components/OverlayPortal/OverlayPortal.const.d.ts +4 -0
- package/dist/components/OverlayPortal/OverlayPortal.const.js +21 -5
- package/dist/components/OverlayPortal/OverlayPortal.js +44 -38
- package/dist/components/Popover/Popover.cjs +1 -1
- package/dist/components/Popover/Popover.const.cjs +1 -0
- package/dist/components/Popover/Popover.const.d.ts +15 -1
- package/dist/components/Popover/Popover.const.js +24 -0
- package/dist/components/Popover/Popover.js +77 -73
- package/dist/components/Popover/Popover.types.d.ts +7 -0
- package/dist/components/Select/Select.cjs +1 -1
- package/dist/components/Select/Select.const.cjs +1 -1
- package/dist/components/Select/Select.const.d.ts +1 -0
- package/dist/components/Select/Select.const.js +7 -6
- package/dist/components/Select/Select.js +101 -96
- package/dist/components/Tabs/TabList.cjs +1 -1
- package/dist/components/Tabs/TabList.js +1 -1
- package/dist/components/Toast/Toast.cjs +1 -1
- package/dist/components/Toast/Toast.const.cjs +1 -1
- package/dist/components/Toast/Toast.const.d.ts +2 -0
- package/dist/components/Toast/Toast.const.js +11 -8
- package/dist/components/Toast/Toast.context.cjs +1 -0
- package/dist/components/Toast/Toast.context.d.ts +3 -0
- package/dist/components/Toast/Toast.context.js +11 -0
- package/dist/components/Toast/Toast.d.ts +4 -3
- package/dist/components/Toast/Toast.icons.cjs +1 -0
- package/dist/components/Toast/Toast.icons.d.ts +4 -0
- package/dist/components/Toast/Toast.icons.js +29 -0
- package/dist/components/Toast/Toast.js +32 -160
- package/dist/components/Toast/ToastContainer.cjs +1 -0
- package/dist/components/Toast/ToastContainer.d.ts +3 -0
- package/dist/components/Toast/ToastContainer.js +39 -0
- package/dist/components/Toast/ToastItem.cjs +1 -0
- package/dist/components/Toast/ToastItem.d.ts +5 -0
- package/dist/components/Toast/ToastItem.js +86 -0
- package/dist/components/ToggleGroup/ToggleGroup.cjs +1 -0
- package/dist/components/ToggleGroup/ToggleGroup.const.cjs +1 -0
- package/dist/components/ToggleGroup/ToggleGroup.const.d.ts +15 -0
- package/dist/components/ToggleGroup/ToggleGroup.const.js +33 -0
- package/dist/components/ToggleGroup/ToggleGroup.context.cjs +1 -0
- package/dist/components/ToggleGroup/ToggleGroup.context.d.ts +2 -0
- package/dist/components/ToggleGroup/ToggleGroup.context.js +5 -0
- package/dist/components/ToggleGroup/ToggleGroup.d.ts +2 -0
- package/dist/components/ToggleGroup/ToggleGroup.js +89 -0
- package/dist/components/ToggleGroup/ToggleGroup.types.d.ts +48 -0
- package/dist/components/ToggleGroup/ToggleGroupItem.cjs +1 -0
- package/dist/components/ToggleGroup/ToggleGroupItem.d.ts +2 -0
- package/dist/components/ToggleGroup/ToggleGroupItem.js +50 -0
- package/dist/components/ToggleGroup/hooks/useToggleGroupContext.cjs +1 -0
- package/dist/components/ToggleGroup/hooks/useToggleGroupContext.d.ts +1 -0
- package/dist/components/ToggleGroup/hooks/useToggleGroupContext.js +6 -0
- package/dist/components/ToggleGroup/index.d.ts +4 -0
- package/dist/components/Tooltip/Tooltip.cjs +1 -1
- package/dist/components/Tooltip/Tooltip.const.cjs +1 -0
- package/dist/components/Tooltip/Tooltip.const.d.ts +8 -0
- package/dist/components/Tooltip/Tooltip.const.js +13 -0
- package/dist/components/Tooltip/Tooltip.js +59 -61
- package/dist/components/Tooltip/Tooltip.types.d.ts +7 -0
- package/dist/components/Transition/Transition.cjs +1 -1
- package/dist/components/Transition/Transition.const.cjs +1 -1
- package/dist/components/Transition/Transition.const.js +26 -8
- package/dist/components/Transition/Transition.js +77 -74
- package/dist/components/Transition/Transition.types.d.ts +8 -2
- package/dist/components/Typography/Typography.const.cjs +1 -1
- package/dist/components/Typography/Typography.const.js +2 -1
- package/dist/components/index.cjs +1 -1
- package/dist/components/index.d.ts +3 -1
- package/dist/components/index.js +429 -419
- package/dist/constants/generals.const.cjs +1 -1
- package/dist/constants/generals.const.js +85 -86
- package/dist/constants/numbers.const.cjs +1 -1
- package/dist/constants/numbers.const.d.ts +3 -0
- package/dist/constants/numbers.const.js +37 -34
- package/dist/hooks/index.cjs +1 -1
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/index.js +6 -4
- package/dist/hooks/useFixedAnchorPosition/index.d.ts +1 -1
- package/dist/hooks/useFixedAnchorPosition/useFixedAnchorPosition.const.cjs +1 -1
- package/dist/hooks/useFixedAnchorPosition/useFixedAnchorPosition.const.d.ts +3 -0
- package/dist/hooks/useFixedAnchorPosition/useFixedAnchorPosition.const.js +17 -14
- package/dist/hooks/useFixedAnchorPosition/useFixedAnchorPosition.types.d.ts +1 -1
- package/dist/hooks/useFocusTrap/index.d.ts +2 -0
- package/dist/hooks/useFocusTrap/useFocusTrap.cjs +1 -0
- package/dist/hooks/useFocusTrap/useFocusTrap.d.ts +3 -0
- package/dist/hooks/useFocusTrap/useFocusTrap.js +41 -0
- package/dist/hooks/useFocusTrap/useFocusTrap.types.d.ts +8 -0
- package/dist/hooks/useFocusTrap/useFocusTrap.utils.cjs +1 -0
- package/dist/hooks/useFocusTrap/useFocusTrap.utils.d.ts +1 -0
- package/dist/hooks/useFocusTrap/useFocusTrap.utils.js +23 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +580 -568
- package/dist/styles/_alerts.css +85 -4
- package/dist/styles/_drawer.css +60 -0
- package/dist/styles/_effects.css +33 -0
- package/dist/styles.css +231 -4
- package/package.json +3 -5
|
@@ -1,89 +1,66 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
1
|
+
import { jsxs as c, jsx as a, Fragment as Y } from "react/jsx-runtime";
|
|
2
|
+
import { useState as v, useRef as z, useCallback as N, useMemo as p, useEffect as I } from "react";
|
|
3
3
|
import { createPortal as Z } from "react-dom";
|
|
4
|
-
import { cn as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
children: [
|
|
23
|
-
t.icon && /* @__PURE__ */ a("span", { className: "Bear-CommandPalette__item-icon bear-text-gray-500 dark:bear-text-zinc-400 bear-shrink-0", children: t.icon }),
|
|
24
|
-
/* @__PURE__ */ l("div", { className: "Bear-CommandPalette__item-content bear-flex-1 bear-min-w-0", children: [
|
|
25
|
-
/* @__PURE__ */ a("div", { className: "Bear-CommandPalette__item-label bear-text-sm bear-font-medium bear-truncate", children: t.label }),
|
|
26
|
-
t.description && /* @__PURE__ */ a("div", { className: "Bear-CommandPalette__item-description bear-text-xs bear-text-gray-500 dark:bear-text-zinc-500 bear-truncate", children: t.description })
|
|
27
|
-
] }),
|
|
28
|
-
t.shortcut && /* @__PURE__ */ a("div", { className: "Bear-CommandPalette__item-shortcut bear-flex bear-gap-1 bear-shrink-0", children: ne(t.shortcut).map((P, h) => /* @__PURE__ */ a(
|
|
29
|
-
"kbd",
|
|
30
|
-
{
|
|
31
|
-
className: "bear-px-1.5 bear-py-0.5 bear-text-xs bear-font-mono bear-bg-gray-200 bear-text-gray-600 dark:bear-bg-zinc-700 dark:bear-text-zinc-400 bear-rounded",
|
|
32
|
-
children: P
|
|
33
|
-
},
|
|
34
|
-
h
|
|
35
|
-
)) })
|
|
36
|
-
]
|
|
37
|
-
}
|
|
38
|
-
), ce = ({
|
|
39
|
-
commands: t,
|
|
40
|
-
open: w,
|
|
41
|
-
onOpenChange: m,
|
|
42
|
-
placeholder: P,
|
|
43
|
-
showRecent: h = !0,
|
|
44
|
-
maxRecent: g = J,
|
|
45
|
-
recentIds: F,
|
|
46
|
-
onRecentChange: y,
|
|
47
|
-
groupByCategory: z = !1,
|
|
48
|
-
filterFn: A = ae,
|
|
49
|
-
triggerKey: T = ee,
|
|
50
|
-
className: R,
|
|
4
|
+
import { cn as $ } from "../../utils/cn.js";
|
|
5
|
+
import { useFocusTrap as J } from "../../hooks/useFocusTrap/useFocusTrap.js";
|
|
6
|
+
import { COMMAND_PALETTE_DEFAULT_TRANSLATIONS as ee, COMMAND_PALETTE_MAX_RECENT as re, COMMAND_PALETTE_TRIGGER_KEY as ae, COMMAND_PALETTE_Z_INDEX as te } from "./CommandPalette.const.js";
|
|
7
|
+
import { defaultFilterFn as ne, groupCommandsByCategory as le } from "./CommandPalette.utils.js";
|
|
8
|
+
import { CommandItem as D } from "./CommandItem.js";
|
|
9
|
+
const fe = ({
|
|
10
|
+
commands: m,
|
|
11
|
+
open: O,
|
|
12
|
+
onOpenChange: x,
|
|
13
|
+
placeholder: R,
|
|
14
|
+
showRecent: A = !0,
|
|
15
|
+
maxRecent: h = re,
|
|
16
|
+
recentIds: j,
|
|
17
|
+
onRecentChange: g,
|
|
18
|
+
groupByCategory: w = !1,
|
|
19
|
+
filterFn: B = ne,
|
|
20
|
+
triggerKey: T = ae,
|
|
21
|
+
className: H,
|
|
51
22
|
testId: q,
|
|
52
23
|
translations: L,
|
|
53
24
|
icon: G,
|
|
54
25
|
footer: M
|
|
55
26
|
}) => {
|
|
56
|
-
const [U, X] =
|
|
57
|
-
|
|
58
|
-
}, [
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
27
|
+
const [U, X] = v(!1), [n, S] = v(""), [t, k] = v(0), [Q, V] = v([]), C = z(null), E = z(null), F = z(null), i = O ?? U, l = N((e) => {
|
|
28
|
+
x == null || x(e), X(e);
|
|
29
|
+
}, [x]);
|
|
30
|
+
J(F, {
|
|
31
|
+
enabled: i,
|
|
32
|
+
initialFocusRef: C,
|
|
33
|
+
onEscape: () => l(!1)
|
|
34
|
+
});
|
|
35
|
+
const s = j ?? Q, K = N((e) => {
|
|
36
|
+
g == null || g(e), V(e);
|
|
37
|
+
}, [g]), y = p(() => ({
|
|
38
|
+
...ee,
|
|
62
39
|
...L
|
|
63
|
-
}), [L]),
|
|
40
|
+
}), [L]), u = p(() => n.trim() ? m.filter((e) => B(e, n)) : m, [m, n, B]), d = p(() => !A || n.trim() ? [] : s.slice(0, h).map((e) => m.find((r) => r.id === e)).filter(Boolean), [A, n, s, h, m]), _ = p(() => w ? le(u) : null, [u, w]), o = p(() => {
|
|
64
41
|
const e = [];
|
|
65
|
-
return
|
|
66
|
-
}, [
|
|
42
|
+
return d.length > 0 && e.push(...d), e.push(...u.filter((r) => !s.includes(r.id))), e;
|
|
43
|
+
}, [d, u, s]);
|
|
67
44
|
I(() => {
|
|
68
45
|
const e = (r) => {
|
|
69
|
-
(r.metaKey || r.ctrlKey) && r.key.toLowerCase() === T && (r.preventDefault(),
|
|
46
|
+
(r.metaKey || r.ctrlKey) && r.key.toLowerCase() === T && (r.preventDefault(), l(!i)), r.key === "Escape" && i && (r.preventDefault(), l(!1));
|
|
70
47
|
};
|
|
71
48
|
return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
|
|
72
|
-
}, [
|
|
73
|
-
|
|
49
|
+
}, [i, T, l]), I(() => {
|
|
50
|
+
i && (S(""), k(0), setTimeout(() => {
|
|
74
51
|
var e;
|
|
75
|
-
return (e =
|
|
52
|
+
return (e = C.current) == null ? void 0 : e.focus();
|
|
76
53
|
}, 50));
|
|
77
|
-
}, [
|
|
78
|
-
if (
|
|
79
|
-
const r =
|
|
54
|
+
}, [i]), I(() => {
|
|
55
|
+
if (t >= 0 && E.current) {
|
|
56
|
+
const r = E.current.querySelectorAll("[data-command-item]")[t];
|
|
80
57
|
r && r.scrollIntoView({ block: "nearest" });
|
|
81
58
|
}
|
|
82
|
-
}, [
|
|
83
|
-
const
|
|
84
|
-
const r = [e.id, ...s.filter((
|
|
85
|
-
|
|
86
|
-
}, [s,
|
|
59
|
+
}, [t]);
|
|
60
|
+
const f = N((e) => {
|
|
61
|
+
const r = [e.id, ...s.filter((b) => b !== e.id)].slice(0, h);
|
|
62
|
+
K(r), l(!1), e.onSelect();
|
|
63
|
+
}, [s, h, K, l]), W = N((e) => {
|
|
87
64
|
switch (e.key) {
|
|
88
65
|
case "ArrowDown":
|
|
89
66
|
e.preventDefault(), k((r) => r < o.length - 1 ? r + 1 : 0);
|
|
@@ -92,93 +69,101 @@ const D = ({
|
|
|
92
69
|
e.preventDefault(), k((r) => r > 0 ? r - 1 : o.length - 1);
|
|
93
70
|
break;
|
|
94
71
|
case "Enter":
|
|
95
|
-
e.preventDefault(), o[
|
|
72
|
+
e.preventDefault(), o[t] && !o[t].disabled && f(o[t]);
|
|
96
73
|
break;
|
|
97
74
|
case "Escape":
|
|
98
|
-
e.preventDefault(),
|
|
75
|
+
e.preventDefault(), l(!1);
|
|
99
76
|
break;
|
|
100
77
|
}
|
|
101
|
-
}, [o,
|
|
102
|
-
return
|
|
103
|
-
/* @__PURE__ */
|
|
78
|
+
}, [o, t, f, l]);
|
|
79
|
+
return i && typeof document < "u" ? Z(
|
|
80
|
+
/* @__PURE__ */ c(
|
|
104
81
|
"div",
|
|
105
82
|
{
|
|
106
|
-
className:
|
|
107
|
-
style: { zIndex:
|
|
83
|
+
className: $("Bear-CommandPalette bear-fixed bear-inset-0 bear-flex bear-items-start bear-justify-center bear-pt-[15vh]", H),
|
|
84
|
+
style: { zIndex: te },
|
|
108
85
|
"data-testid": q,
|
|
109
86
|
children: [
|
|
110
87
|
/* @__PURE__ */ a(
|
|
111
88
|
"div",
|
|
112
89
|
{
|
|
113
90
|
className: "Bear-CommandPalette__backdrop bear-absolute bear-inset-0 bear-bg-black/50 bear-backdrop-blur-sm",
|
|
114
|
-
onClick: () =>
|
|
91
|
+
onClick: () => l(!1)
|
|
115
92
|
}
|
|
116
93
|
),
|
|
117
|
-
/* @__PURE__ */
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
94
|
+
/* @__PURE__ */ c(
|
|
95
|
+
"div",
|
|
96
|
+
{
|
|
97
|
+
ref: F,
|
|
98
|
+
tabIndex: -1,
|
|
99
|
+
className: "Bear-CommandPalette__content bear-relative bear-w-full bear-max-w-xl bear-bg-white dark:bear-bg-zinc-800 bear-border bear-border-gray-200 dark:bear-border-zinc-700 bear-rounded-xl bear-shadow-2xl bear-overflow-hidden",
|
|
100
|
+
children: [
|
|
101
|
+
/* @__PURE__ */ c("div", { className: "Bear-CommandPalette__search bear-flex bear-items-center bear-gap-3 bear-px-4 bear-py-3 bear-border-b bear-border-gray-200 dark:bear-border-zinc-700", children: [
|
|
102
|
+
G ?? /* @__PURE__ */ a("svg", { className: "bear-w-5 bear-h-5 bear-text-gray-500 dark:bear-text-zinc-400 bear-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ a("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z" }) }),
|
|
103
|
+
/* @__PURE__ */ a(
|
|
104
|
+
"input",
|
|
105
|
+
{
|
|
106
|
+
ref: C,
|
|
107
|
+
type: "text",
|
|
108
|
+
value: n,
|
|
109
|
+
onChange: (e) => {
|
|
110
|
+
S(e.target.value), k(0);
|
|
111
|
+
},
|
|
112
|
+
onKeyDown: W,
|
|
113
|
+
placeholder: R || y.placeholder,
|
|
114
|
+
className: "Bear-CommandPalette__input bear-flex-1 bear-bg-transparent bear-border-0 bear-outline-none bear-text-gray-900 dark:bear-text-white placeholder:bear-text-gray-400 dark:placeholder:bear-text-zinc-500"
|
|
115
|
+
}
|
|
116
|
+
),
|
|
117
|
+
/* @__PURE__ */ a("kbd", { className: "bear-px-2 bear-py-1 bear-text-xs bear-font-mono bear-bg-gray-200 bear-text-gray-600 dark:bear-bg-zinc-700 dark:bear-text-zinc-400 bear-rounded", children: "esc" })
|
|
118
|
+
] }),
|
|
119
|
+
/* @__PURE__ */ a(
|
|
120
|
+
"div",
|
|
121
|
+
{
|
|
122
|
+
ref: E,
|
|
123
|
+
className: "Bear-CommandPalette__list bear-max-h-[60vh] bear-overflow-y-auto",
|
|
124
|
+
children: o.length === 0 ? /* @__PURE__ */ a("div", { className: "Bear-CommandPalette__empty bear-px-4 bear-py-8 bear-text-center bear-text-sm bear-text-gray-500 dark:bear-text-zinc-500", children: y.noResults }) : /* @__PURE__ */ c(Y, { children: [
|
|
125
|
+
d.length > 0 && !n.trim() && /* @__PURE__ */ c("div", { className: "Bear-CommandPalette__group", children: [
|
|
126
|
+
/* @__PURE__ */ a("div", { className: "Bear-CommandPalette__group-header bear-px-4 bear-py-2 bear-text-xs bear-font-medium bear-text-gray-500 dark:bear-text-zinc-500 bear-uppercase bear-tracking-wider bear-bg-gray-50 dark:bear-bg-zinc-800/50", children: y.recentCommands }),
|
|
127
|
+
d.map((e, r) => /* @__PURE__ */ a("div", { "data-command-item": !0, children: /* @__PURE__ */ a(
|
|
128
|
+
D,
|
|
129
|
+
{
|
|
130
|
+
command: e,
|
|
131
|
+
isHighlighted: t === r,
|
|
132
|
+
onSelect: () => f(e)
|
|
133
|
+
}
|
|
134
|
+
) }, `recent-${e.id}`))
|
|
135
|
+
] }),
|
|
136
|
+
w && _ ? _.map((e) => {
|
|
137
|
+
const r = d.length + _.slice(0, _.indexOf(e)).reduce((b, P) => b + P.commands.length, 0);
|
|
138
|
+
return /* @__PURE__ */ c("div", { className: "Bear-CommandPalette__group", children: [
|
|
139
|
+
/* @__PURE__ */ a("div", { className: "Bear-CommandPalette__group-header bear-px-4 bear-py-2 bear-text-xs bear-font-medium bear-text-gray-500 dark:bear-text-zinc-500 bear-uppercase bear-tracking-wider bear-bg-gray-50 dark:bear-bg-zinc-800/50", children: e.name }),
|
|
140
|
+
e.commands.map((b, P) => /* @__PURE__ */ a("div", { "data-command-item": !0, children: /* @__PURE__ */ a(
|
|
141
|
+
D,
|
|
142
|
+
{
|
|
143
|
+
command: b,
|
|
144
|
+
isHighlighted: t === r + P,
|
|
145
|
+
onSelect: () => f(b)
|
|
146
|
+
}
|
|
147
|
+
) }, b.id))
|
|
148
|
+
] }, e.name);
|
|
149
|
+
}) : /* @__PURE__ */ c("div", { className: "Bear-CommandPalette__group", children: [
|
|
150
|
+
!n.trim() && d.length > 0 && /* @__PURE__ */ a("div", { className: "Bear-CommandPalette__group-header bear-px-4 bear-py-2 bear-text-xs bear-font-medium bear-text-gray-500 dark:bear-text-zinc-500 bear-uppercase bear-tracking-wider bear-bg-gray-50 dark:bear-bg-zinc-800/50", children: y.allCommands }),
|
|
151
|
+
u.filter((e) => !s.includes(e.id) || n.trim()).map((e, r) => /* @__PURE__ */ a("div", { "data-command-item": !0, children: /* @__PURE__ */ a(
|
|
152
|
+
D,
|
|
153
|
+
{
|
|
154
|
+
command: e,
|
|
155
|
+
isHighlighted: t === d.length + r,
|
|
156
|
+
onSelect: () => f(e)
|
|
157
|
+
}
|
|
158
|
+
) }, e.id))
|
|
159
|
+
] })
|
|
160
|
+
] })
|
|
161
|
+
}
|
|
162
|
+
),
|
|
163
|
+
M && /* @__PURE__ */ a("div", { className: "Bear-CommandPalette__footer bear-px-4 bear-py-2 bear-border-t bear-border-gray-200 dark:bear-border-zinc-700 bear-text-xs bear-text-gray-500 dark:bear-text-zinc-500", children: M })
|
|
164
|
+
]
|
|
165
|
+
}
|
|
166
|
+
)
|
|
182
167
|
]
|
|
183
168
|
}
|
|
184
169
|
),
|
|
@@ -186,5 +171,5 @@ const D = ({
|
|
|
186
171
|
) : null;
|
|
187
172
|
};
|
|
188
173
|
export {
|
|
189
|
-
|
|
174
|
+
fe as CommandPalette
|
|
190
175
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),C=require("react"),j=require("react-dom"),W=require("../../context/BearProvider.cjs"),N=require("../../utils/cn.cjs"),g=require("../../utils/generateBearId.utils.cjs"),$=require("../../utils/useBearId.cjs"),V=require("../../hooks/useFocusTrap/useFocusTrap.cjs"),e=require("../../constants/generals.const.cjs"),H=require("../../hooks/useFixedAnchorPosition/useFixedAnchorPosition.const.cjs"),Y=require("../../hooks/useFixedAnchorPosition/useFixedAnchorPosition.utils.cjs"),z=require("../Backdrop/Backdrop.cjs"),l=require("../Box/Box.cjs"),t=require("./Drawer.const.cjs"),Z=require("./helpers/DrawerOptionalHeader.cjs"),G=require("./hooks/useDrawer.cjs"),J=d=>{const{isOpen:w,onClose:s,title:c,children:T,side:f=t.DRAWER_DEFAULT_SIDE,anchor:q,variant:i=t.DRAWER_DEFAULT_VARIANT,size:I=t.DRAWER_DEFAULT_SIZE,showCloseButton:u=e.BOOLEAN_TRUE,closeOnBackdrop:L=e.BOOLEAN_TRUE,closeOnEscape:E=e.BOOLEAN_TRUE,className:m,container:x,id:F,testId:b}=d,r=i===e.DRAWER_VARIANT_PERMANENT,o=i===e.DRAWER_VARIANT_TEMPORARY,{openEffect:_,closeEffect:A}=Y.resolveOverlayEffects(d,H.OVERLAY_OPEN_EFFECT_DEFAULT),v=$.useBearId(e.COMPONENT_NAME_DRAWER),B=g.resolveBearId(F,v),{direction:P}=W.useBearDirectionOptional(),O=q??f,{isMounted:h,isPanelOpen:a}=G.useDrawer({isOpen:r?e.BOOLEAN_TRUE:w,onClose:s,closeOnEscape:r?e.BOOLEAN_FALSE:E,openEffect:_,closeEffect:A,lockScroll:o,alwaysMounted:r}),y=a?_:A,D=C.useRef(null);if(V.useFocusTrap(D,{enabled:o&&a,onEscape:E?s:void 0}),!h)return null;const M=!!c||u,R=`${B}-title`,S=L&&o?()=>s():void 0,k=c?R:void 0,U=r?"complementary":"dialog",p=n.jsxs(l.Box,{id:B,"data-testid":b,className:N.cn("Bear-Drawer",`Bear-Drawer--${i}`),children:[o&&n.jsx(z.Backdrop,{open:a,keepMounted:!0,blur:!0,nested:!0,transitionDuration:t.DRAWER_ANIMATION_MS,className:"Bear-Drawer__backdrop",onClick:S}),n.jsxs(l.Box,{ref:D,role:U,tabIndex:-1,"aria-modal":o?e.BOOLEAN_TRUE:e.BOOLEAN_FALSE,"aria-labelledby":k,className:N.cn("Bear-Drawer__panel",`Bear-Drawer__panel--${O}`,`Bear-Drawer__panel--${I}`,`Bear-Drawer__panel--effect-${y}`,a&&"Bear-Drawer__panel--open",m),children:[n.jsx(Z.DrawerOptionalHeader,{showHeader:M,side:O,title:c,titleId:R,showCloseButton:r?e.BOOLEAN_FALSE:u,onClose:s,direction:P}),n.jsx(l.Box,{className:"Bear-Drawer__body",children:T})]})]});return r?p:j.createPortal(p,x??document.body)};exports.Drawer=J;
|
|
@@ -1,101 +1,107 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import "
|
|
6
|
-
import { resolveBearId as
|
|
7
|
-
import { useBearId as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
1
|
+
import { jsxs as B, jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as $ } from "react";
|
|
3
|
+
import { createPortal as V } from "react-dom";
|
|
4
|
+
import { useBearDirectionOptional as g } from "../../context/BearProvider.js";
|
|
5
|
+
import { cn as O } from "../../utils/cn.js";
|
|
6
|
+
import { resolveBearId as j } from "../../utils/generateBearId.utils.js";
|
|
7
|
+
import { useBearId as H } from "../../utils/useBearId.js";
|
|
8
|
+
import { useFocusTrap as Y } from "../../hooks/useFocusTrap/useFocusTrap.js";
|
|
9
|
+
import { BOOLEAN_TRUE as o, COMPONENT_NAME_DRAWER as z, BOOLEAN_FALSE as i, DRAWER_VARIANT_TEMPORARY as Z, DRAWER_VARIANT_PERMANENT as q } from "../../constants/generals.const.js";
|
|
10
|
+
import { OVERLAY_OPEN_EFFECT_DEFAULT as G } from "../../hooks/useFixedAnchorPosition/useFixedAnchorPosition.const.js";
|
|
11
|
+
import { resolveOverlayEffects as J } from "../../hooks/useFixedAnchorPosition/useFixedAnchorPosition.utils.js";
|
|
12
|
+
import { Backdrop as K } from "../Backdrop/Backdrop.js";
|
|
12
13
|
import { Box as c } from "../Box/Box.js";
|
|
13
|
-
import { DRAWER_DEFAULT_SIDE as
|
|
14
|
-
import { DrawerOptionalHeader as
|
|
15
|
-
import { useDrawer as
|
|
16
|
-
const
|
|
14
|
+
import { DRAWER_DEFAULT_SIDE as Q, DRAWER_DEFAULT_VARIANT as X, DRAWER_DEFAULT_SIZE as ee, DRAWER_ANIMATION_MS as re } from "./Drawer.const.js";
|
|
15
|
+
import { DrawerOptionalHeader as oe } from "./helpers/DrawerOptionalHeader.js";
|
|
16
|
+
import { useDrawer as ae } from "./hooks/useDrawer.js";
|
|
17
|
+
const Be = (d) => {
|
|
17
18
|
const {
|
|
18
|
-
isOpen:
|
|
19
|
-
onClose:
|
|
20
|
-
title:
|
|
21
|
-
children:
|
|
22
|
-
side:
|
|
23
|
-
anchor:
|
|
24
|
-
variant:
|
|
25
|
-
size:
|
|
26
|
-
showCloseButton: m =
|
|
27
|
-
closeOnBackdrop:
|
|
28
|
-
closeOnEscape:
|
|
29
|
-
className:
|
|
30
|
-
container:
|
|
31
|
-
id:
|
|
19
|
+
isOpen: N,
|
|
20
|
+
onClose: a,
|
|
21
|
+
title: n,
|
|
22
|
+
children: w,
|
|
23
|
+
side: T = Q,
|
|
24
|
+
anchor: I,
|
|
25
|
+
variant: s = X,
|
|
26
|
+
size: b = ee,
|
|
27
|
+
showCloseButton: m = o,
|
|
28
|
+
closeOnBackdrop: v = o,
|
|
29
|
+
closeOnEscape: p = o,
|
|
30
|
+
className: M,
|
|
31
|
+
container: h,
|
|
32
|
+
id: k,
|
|
32
33
|
testId: y
|
|
33
|
-
} = d, e =
|
|
34
|
-
isOpen: e ?
|
|
35
|
-
onClose:
|
|
36
|
-
closeOnEscape: e ?
|
|
37
|
-
openEffect:
|
|
34
|
+
} = d, e = s === q, r = s === Z, { openEffect: E, closeEffect: _ } = J(d, G), C = H(z), f = j(k, C), { direction: F } = g(), A = I ?? T, { isMounted: L, isPanelOpen: t } = ae({
|
|
35
|
+
isOpen: e ? o : N,
|
|
36
|
+
onClose: a,
|
|
37
|
+
closeOnEscape: e ? i : p,
|
|
38
|
+
openEffect: E,
|
|
38
39
|
closeEffect: _,
|
|
39
|
-
lockScroll:
|
|
40
|
+
lockScroll: r,
|
|
40
41
|
alwaysMounted: e
|
|
41
|
-
}),
|
|
42
|
-
if (
|
|
42
|
+
}), P = t ? E : _, D = $(null);
|
|
43
|
+
if (Y(D, {
|
|
44
|
+
enabled: r && t,
|
|
45
|
+
onEscape: p ? a : void 0
|
|
46
|
+
}), !L)
|
|
43
47
|
return null;
|
|
44
|
-
const
|
|
48
|
+
const W = !!n || m, R = `${f}-title`, S = v && r ? () => a() : void 0, x = n ? R : void 0, U = e ? "complementary" : "dialog", u = /* @__PURE__ */ B(
|
|
45
49
|
c,
|
|
46
50
|
{
|
|
47
|
-
id:
|
|
51
|
+
id: f,
|
|
48
52
|
"data-testid": y,
|
|
49
|
-
className:
|
|
53
|
+
className: O("Bear-Drawer", `Bear-Drawer--${s}`),
|
|
50
54
|
children: [
|
|
51
|
-
|
|
52
|
-
|
|
55
|
+
r && /* @__PURE__ */ l(
|
|
56
|
+
K,
|
|
53
57
|
{
|
|
54
|
-
open:
|
|
58
|
+
open: t,
|
|
55
59
|
keepMounted: !0,
|
|
56
60
|
blur: !0,
|
|
57
61
|
nested: !0,
|
|
58
|
-
transitionDuration:
|
|
62
|
+
transitionDuration: re,
|
|
59
63
|
className: "Bear-Drawer__backdrop",
|
|
60
|
-
onClick:
|
|
64
|
+
onClick: S
|
|
61
65
|
}
|
|
62
66
|
),
|
|
63
|
-
/* @__PURE__ */
|
|
67
|
+
/* @__PURE__ */ B(
|
|
64
68
|
c,
|
|
65
69
|
{
|
|
70
|
+
ref: D,
|
|
66
71
|
role: U,
|
|
67
|
-
|
|
68
|
-
"aria-
|
|
69
|
-
|
|
72
|
+
tabIndex: -1,
|
|
73
|
+
"aria-modal": r ? o : i,
|
|
74
|
+
"aria-labelledby": x,
|
|
75
|
+
className: O(
|
|
70
76
|
"Bear-Drawer__panel",
|
|
71
|
-
`Bear-Drawer__panel--${
|
|
72
|
-
`Bear-Drawer__panel--${
|
|
73
|
-
`Bear-Drawer__panel--effect-${
|
|
74
|
-
|
|
75
|
-
|
|
77
|
+
`Bear-Drawer__panel--${A}`,
|
|
78
|
+
`Bear-Drawer__panel--${b}`,
|
|
79
|
+
`Bear-Drawer__panel--effect-${P}`,
|
|
80
|
+
t && "Bear-Drawer__panel--open",
|
|
81
|
+
M
|
|
76
82
|
),
|
|
77
83
|
children: [
|
|
78
|
-
/* @__PURE__ */
|
|
79
|
-
|
|
84
|
+
/* @__PURE__ */ l(
|
|
85
|
+
oe,
|
|
80
86
|
{
|
|
81
|
-
showHeader:
|
|
82
|
-
side:
|
|
83
|
-
title:
|
|
84
|
-
titleId:
|
|
85
|
-
showCloseButton: e ?
|
|
86
|
-
onClose:
|
|
87
|
-
direction:
|
|
87
|
+
showHeader: W,
|
|
88
|
+
side: A,
|
|
89
|
+
title: n,
|
|
90
|
+
titleId: R,
|
|
91
|
+
showCloseButton: e ? i : m,
|
|
92
|
+
onClose: a,
|
|
93
|
+
direction: F
|
|
88
94
|
}
|
|
89
95
|
),
|
|
90
|
-
/* @__PURE__ */
|
|
96
|
+
/* @__PURE__ */ l(c, { className: "Bear-Drawer__body", children: w })
|
|
91
97
|
]
|
|
92
98
|
}
|
|
93
99
|
)
|
|
94
100
|
]
|
|
95
101
|
}
|
|
96
102
|
);
|
|
97
|
-
return e ?
|
|
103
|
+
return e ? u : V(u, h ?? document.body);
|
|
98
104
|
};
|
|
99
105
|
export {
|
|
100
|
-
|
|
106
|
+
Be as Drawer
|
|
101
107
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),T=require("../Box/Box.cjs"),I=require("../Flex/Flex.cjs"),_=require("../Typography/Typography.cjs"),r=require("../../utils/cn.cjs");require("react");const M=require("../../utils/generateBearId.utils.cjs"),g=require("../../utils/useBearId.cjs"),e=require("./EmptyState.const.cjs"),h=d=>{const{icon:l,title:S,description:c,action:n,secondaryAction:i,className:p,size:m=e.EMPTY_STATE_DEFAULT_SIZE,variant:u=e.EMPTY_STATE_DEFAULT_VARIANT,preset:a=e.EMPTY_STATE_DEFAULT_PRESET,id:y,testId:A}=d,P=g.useBearId(e.COMPONENT_NAME_EMPTY_STATE),B=M.resolveBearId(y,P),s=e.EMPTY_STATE_SIZE_CLASSES[m],N=e.EMPTY_STATE_PRESET_ICON[a],x=l??t.jsx(N,{className:"bear-w-full bear-h-full"}),o=e.EMPTY_STATE_PRESET_DEFAULTS[a]??e.EMPTY_STATE_PRESET_DEFAULTS.empty,E=c!==void 0?c:o.description;return t.jsxs(T.Box,{id:B,"data-testid":A,className:r.cn("Bear-EmptyState",u==="card"&&"Bear-EmptyState--card",`Bear-EmptyState--${a}`,s.padding,p),children:[t.jsx(T.Box,{className:r.cn("Bear-EmptyState__icon",s.icon),children:x}),t.jsx(_.Typography,{className:r.cn("Bear-EmptyState__title",s.title),children:S??o.title}),E&&t.jsx(_.Typography,{className:r.cn("Bear-EmptyState__description",s.desc),children:E}),(n||i)&&t.jsxs(I.Flex,{className:"Bear-EmptyState__actions",align:"center",gap:3,children:[n,i]})]})};exports.EmptyState=h;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../../constants/generals.const.cjs"),r=require("./helpers/EmptyStateErrorSvg.cjs"),e=require("./helpers/EmptyStateInboxSvg.cjs"),E=require("./helpers/EmptyStateSearchSvg.cjs"),T=t.SIZE_MD,o=t.VARIANT_DEFAULT,a=t.EMPTY_STATE_PRESET_EMPTY,S="EmptyState",i={[t.EMPTY_STATE_PRESET_EMPTY]:e.EmptyStateInboxSvg,[t.EMPTY_STATE_PRESET_INBOX]:e.EmptyStateInboxSvg,[t.EMPTY_STATE_PRESET_SEARCH]:E.EmptyStateSearchSvg,[t.EMPTY_STATE_PRESET_ERROR]:r.EmptyStateErrorSvg,"no-data":e.EmptyStateInboxSvg,404:E.EmptyStateSearchSvg,offline:r.EmptyStateErrorSvg,"filter-empty":E.EmptyStateSearchSvg},n={empty:{title:"No items yet",description:"Get started by creating your first item."},inbox:{title:"Your inbox is empty",description:"All caught up! Check back later for new messages."},search:{title:"No results found",description:"Try adjusting your search or filter keywords."},error:{title:"Something went wrong",description:"We encountered an error loading this content."},"no-data":{title:"No data available",description:"There is no data to display right now."},404:{title:"Page not found",description:"The requested page or resource could not be located."},offline:{title:"Connection lost",description:"Please check your internet connection and try again."},"filter-empty":{title:"No matching filters",description:"No records match the selected filter criteria."}},_={sm:{icon:"bear-w-12 bear-h-12",title:"bear-text-lg",desc:"bear-text-sm",padding:"bear-py-6 bear-px-4"},md:{icon:"bear-w-16 bear-h-16",title:"bear-text-xl",desc:"bear-text-base",padding:"bear-py-10 bear-px-6"},lg:{icon:"bear-w-20 bear-h-20",title:"bear-text-2xl",desc:"bear-text-lg",padding:"bear-py-14 bear-px-8"}};exports.COMPONENT_NAME_EMPTY_STATE=S;exports.EMPTY_STATE_DEFAULT_PRESET=a;exports.EMPTY_STATE_DEFAULT_SIZE=T;exports.EMPTY_STATE_DEFAULT_VARIANT=o;exports.EMPTY_STATE_PRESET_DEFAULTS=n;exports.EMPTY_STATE_PRESET_ICON=i;exports.EMPTY_STATE_SIZE_CLASSES=_;
|
|
@@ -3,9 +3,14 @@ import { EmptyStatePreset } from './EmptyState.types';
|
|
|
3
3
|
export declare const EMPTY_STATE_DEFAULT_SIZE: "md";
|
|
4
4
|
export declare const EMPTY_STATE_DEFAULT_VARIANT: "default";
|
|
5
5
|
export declare const EMPTY_STATE_DEFAULT_PRESET: EmptyStatePreset;
|
|
6
|
+
export declare const COMPONENT_NAME_EMPTY_STATE = "EmptyState";
|
|
6
7
|
export declare const EMPTY_STATE_PRESET_ICON: Record<EmptyStatePreset, ComponentType<{
|
|
7
8
|
className?: string;
|
|
8
9
|
}>>;
|
|
10
|
+
export declare const EMPTY_STATE_PRESET_DEFAULTS: Record<EmptyStatePreset, {
|
|
11
|
+
title: string;
|
|
12
|
+
description: string;
|
|
13
|
+
}>;
|
|
9
14
|
export declare const EMPTY_STATE_SIZE_CLASSES: {
|
|
10
15
|
readonly sm: {
|
|
11
16
|
readonly icon: "bear-w-12 bear-h-12";
|
|
@@ -1,13 +1,26 @@
|
|
|
1
|
-
import { SIZE_MD as
|
|
2
|
-
import { EmptyStateErrorSvg as
|
|
3
|
-
import { EmptyStateInboxSvg as
|
|
4
|
-
import { EmptyStateSearchSvg as
|
|
5
|
-
const
|
|
6
|
-
[
|
|
7
|
-
[
|
|
8
|
-
[
|
|
9
|
-
[
|
|
10
|
-
|
|
1
|
+
import { SIZE_MD as i, VARIANT_DEFAULT as a, EMPTY_STATE_PRESET_EMPTY as o, EMPTY_STATE_PRESET_ERROR as n, EMPTY_STATE_PRESET_SEARCH as E, EMPTY_STATE_PRESET_INBOX as T } from "../../constants/generals.const.js";
|
|
2
|
+
import { EmptyStateErrorSvg as r } from "./helpers/EmptyStateErrorSvg.js";
|
|
3
|
+
import { EmptyStateInboxSvg as e } from "./helpers/EmptyStateInboxSvg.js";
|
|
4
|
+
import { EmptyStateSearchSvg as t } from "./helpers/EmptyStateSearchSvg.js";
|
|
5
|
+
const S = i, _ = a, p = o, b = "EmptyState", m = {
|
|
6
|
+
[o]: e,
|
|
7
|
+
[T]: e,
|
|
8
|
+
[E]: t,
|
|
9
|
+
[n]: r,
|
|
10
|
+
"no-data": e,
|
|
11
|
+
404: t,
|
|
12
|
+
offline: r,
|
|
13
|
+
"filter-empty": t
|
|
14
|
+
}, A = {
|
|
15
|
+
empty: { title: "No items yet", description: "Get started by creating your first item." },
|
|
16
|
+
inbox: { title: "Your inbox is empty", description: "All caught up! Check back later for new messages." },
|
|
17
|
+
search: { title: "No results found", description: "Try adjusting your search or filter keywords." },
|
|
18
|
+
error: { title: "Something went wrong", description: "We encountered an error loading this content." },
|
|
19
|
+
"no-data": { title: "No data available", description: "There is no data to display right now." },
|
|
20
|
+
404: { title: "Page not found", description: "The requested page or resource could not be located." },
|
|
21
|
+
offline: { title: "Connection lost", description: "Please check your internet connection and try again." },
|
|
22
|
+
"filter-empty": { title: "No matching filters", description: "No records match the selected filter criteria." }
|
|
23
|
+
}, P = {
|
|
11
24
|
sm: {
|
|
12
25
|
icon: "bear-w-12 bear-h-12",
|
|
13
26
|
title: "bear-text-lg",
|
|
@@ -28,9 +41,11 @@ const m = t, i = e, x = T, c = {
|
|
|
28
41
|
}
|
|
29
42
|
};
|
|
30
43
|
export {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
44
|
+
b as COMPONENT_NAME_EMPTY_STATE,
|
|
45
|
+
p as EMPTY_STATE_DEFAULT_PRESET,
|
|
46
|
+
S as EMPTY_STATE_DEFAULT_SIZE,
|
|
47
|
+
_ as EMPTY_STATE_DEFAULT_VARIANT,
|
|
48
|
+
A as EMPTY_STATE_PRESET_DEFAULTS,
|
|
49
|
+
m as EMPTY_STATE_PRESET_ICON,
|
|
50
|
+
P as EMPTY_STATE_SIZE_CLASSES
|
|
36
51
|
};
|