@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,103 +1,104 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { ZERO as m, ONE as
|
|
3
|
-
import { cn as
|
|
1
|
+
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
2
|
+
import { ZERO as m, ONE as y } from "../../constants/numbers.const.js";
|
|
3
|
+
import { cn as f } from "../../utils/cn.js";
|
|
4
4
|
import "react";
|
|
5
|
-
import { resolveBearId as
|
|
6
|
-
import { useBearId as
|
|
7
|
-
import { CHART as
|
|
8
|
-
import { polarToCartesian as i, getChartColor as
|
|
9
|
-
const
|
|
5
|
+
import { resolveBearId as $ } from "../../utils/generateBearId.utils.js";
|
|
6
|
+
import { useBearId as F } from "../../utils/useBearId.js";
|
|
7
|
+
import { CHART as e } from "./Chart.const.js";
|
|
8
|
+
import { polarToCartesian as i, chartMotionClass as G, getChartColor as A } from "./Chart.utils.js";
|
|
9
|
+
const X = (g) => {
|
|
10
10
|
const {
|
|
11
|
-
data:
|
|
12
|
-
height: x =
|
|
13
|
-
showLabels:
|
|
14
|
-
showValues:
|
|
11
|
+
data: s,
|
|
12
|
+
height: x = e.DEFAULT_HEIGHT,
|
|
13
|
+
showLabels: C = !0,
|
|
14
|
+
showValues: S = !1,
|
|
15
15
|
animated: I = !0,
|
|
16
|
+
motion: N,
|
|
16
17
|
color: c,
|
|
17
18
|
className: h,
|
|
18
|
-
id:
|
|
19
|
-
testId:
|
|
20
|
-
...
|
|
21
|
-
} = g,
|
|
19
|
+
id: U,
|
|
20
|
+
testId: R,
|
|
21
|
+
...E
|
|
22
|
+
} = g, B = F("RadarChart"), p = $(U, B), d = s.length, T = { "--Bear-Chart-height": `${x}px` };
|
|
22
23
|
if (d === m)
|
|
23
|
-
return /* @__PURE__ */
|
|
24
|
+
return /* @__PURE__ */ l(
|
|
24
25
|
"div",
|
|
25
26
|
{
|
|
26
|
-
id:
|
|
27
|
-
"data-testid":
|
|
28
|
-
className:
|
|
29
|
-
style:
|
|
30
|
-
...
|
|
27
|
+
id: p,
|
|
28
|
+
"data-testid": R,
|
|
29
|
+
className: f("Bear-Chart Bear-Chart--radar Bear-Chart--empty", h),
|
|
30
|
+
style: T,
|
|
31
|
+
...E
|
|
31
32
|
}
|
|
32
33
|
);
|
|
33
|
-
const
|
|
34
|
-
const t =
|
|
34
|
+
const D = Math.max(...s.map((a) => a.value), y), n = e.FULL_SWEEP / d, _ = s.map((a, r) => {
|
|
35
|
+
const t = e.DEFAULT_START_ANGLE + r * n, o = a.value / D * e.OUTER_RADIUS;
|
|
35
36
|
return i(t, o);
|
|
36
|
-
}),
|
|
37
|
-
const t = (r +
|
|
38
|
-
return Array.from({ length: d }, (o,
|
|
39
|
-
const
|
|
40
|
-
return i(
|
|
37
|
+
}), L = _.map((a) => `${a.x},${a.y}`).join(" "), b = Array.from({ length: e.RADAR_RINGS }, (a, r) => {
|
|
38
|
+
const t = (r + y) / e.RADAR_RINGS * e.OUTER_RADIUS;
|
|
39
|
+
return Array.from({ length: d }, (o, v) => {
|
|
40
|
+
const O = e.DEFAULT_START_ANGLE + v * n;
|
|
41
|
+
return i(O, t);
|
|
41
42
|
});
|
|
42
43
|
});
|
|
43
|
-
return /* @__PURE__ */
|
|
44
|
+
return /* @__PURE__ */ l(
|
|
44
45
|
"div",
|
|
45
46
|
{
|
|
46
|
-
id:
|
|
47
|
-
"data-testid":
|
|
48
|
-
className:
|
|
49
|
-
style:
|
|
50
|
-
...
|
|
51
|
-
children: /* @__PURE__ */
|
|
52
|
-
|
|
47
|
+
id: p,
|
|
48
|
+
"data-testid": R,
|
|
49
|
+
className: f("Bear-Chart Bear-Chart--radar", h),
|
|
50
|
+
style: T,
|
|
51
|
+
...E,
|
|
52
|
+
children: /* @__PURE__ */ u("svg", { viewBox: `0 0 ${e.VIEWBOX} ${e.VIEWBOX}`, className: "Bear-Chart__svg", children: [
|
|
53
|
+
b.map((a, r) => /* @__PURE__ */ l(
|
|
53
54
|
"polygon",
|
|
54
55
|
{
|
|
55
|
-
points:
|
|
56
|
+
points: a.map((t) => `${t.x},${t.y}`).join(" "),
|
|
56
57
|
fill: "none",
|
|
57
58
|
stroke: "var(--bear-border-default, #e5e5e5)",
|
|
58
59
|
strokeWidth: 0.4
|
|
59
60
|
},
|
|
60
61
|
r
|
|
61
62
|
)),
|
|
62
|
-
|
|
63
|
-
const t =
|
|
64
|
-
return /* @__PURE__ */
|
|
63
|
+
s.map((a, r) => {
|
|
64
|
+
const t = e.DEFAULT_START_ANGLE + r * n, o = i(t, e.OUTER_RADIUS);
|
|
65
|
+
return /* @__PURE__ */ l(
|
|
65
66
|
"line",
|
|
66
67
|
{
|
|
67
|
-
x1:
|
|
68
|
-
y1:
|
|
68
|
+
x1: e.CENTER,
|
|
69
|
+
y1: e.CENTER,
|
|
69
70
|
x2: o.x,
|
|
70
71
|
y2: o.y,
|
|
71
72
|
stroke: "var(--bear-border-default, #e5e5e5)",
|
|
72
73
|
strokeWidth: 0.4
|
|
73
74
|
},
|
|
74
|
-
|
|
75
|
+
a.label
|
|
75
76
|
);
|
|
76
77
|
}),
|
|
77
|
-
/* @__PURE__ */
|
|
78
|
+
/* @__PURE__ */ l(
|
|
78
79
|
"polygon",
|
|
79
80
|
{
|
|
80
|
-
points:
|
|
81
|
-
fill:
|
|
81
|
+
points: L,
|
|
82
|
+
fill: A(m, c),
|
|
82
83
|
fillOpacity: 0.25,
|
|
83
|
-
stroke:
|
|
84
|
+
stroke: A(m, c),
|
|
84
85
|
strokeWidth: 0.8,
|
|
85
|
-
className:
|
|
86
|
+
className: G(I, N, "animate-scale-in")
|
|
86
87
|
}
|
|
87
88
|
),
|
|
88
|
-
|
|
89
|
+
_.map((a, r) => /* @__PURE__ */ l(
|
|
89
90
|
"circle",
|
|
90
91
|
{
|
|
91
|
-
cx:
|
|
92
|
-
cy:
|
|
93
|
-
r:
|
|
94
|
-
fill:
|
|
92
|
+
cx: a.x,
|
|
93
|
+
cy: a.y,
|
|
94
|
+
r: e.DOT_RADIUS,
|
|
95
|
+
fill: A(r, s[r].color || c)
|
|
95
96
|
},
|
|
96
|
-
|
|
97
|
+
s[r].label
|
|
97
98
|
)),
|
|
98
|
-
|
|
99
|
-
const t =
|
|
100
|
-
return /* @__PURE__ */
|
|
99
|
+
C && s.map((a, r) => {
|
|
100
|
+
const t = e.DEFAULT_START_ANGLE + r * n, o = i(t, e.OUTER_RADIUS + e.RADAR_LABEL_OFFSET);
|
|
101
|
+
return /* @__PURE__ */ u(
|
|
101
102
|
"text",
|
|
102
103
|
{
|
|
103
104
|
x: o.x,
|
|
@@ -107,11 +108,11 @@ const P = (g) => {
|
|
|
107
108
|
className: "bear-fill-[var(--bear-text-secondary)]",
|
|
108
109
|
fontSize: 4,
|
|
109
110
|
children: [
|
|
110
|
-
|
|
111
|
-
|
|
111
|
+
a.label,
|
|
112
|
+
S ? ` ${a.value}` : ""
|
|
112
113
|
]
|
|
113
114
|
},
|
|
114
|
-
`${
|
|
115
|
+
`${a.label}-label`
|
|
115
116
|
);
|
|
116
117
|
})
|
|
117
118
|
] })
|
|
@@ -119,5 +120,5 @@ const P = (g) => {
|
|
|
119
120
|
);
|
|
120
121
|
};
|
|
121
122
|
export {
|
|
122
|
-
|
|
123
|
+
X as RadarChart
|
|
123
124
|
};
|
|
@@ -4,4 +4,4 @@ export { LineChart } from './LineChart';
|
|
|
4
4
|
export { PieChart } from './PieChart';
|
|
5
5
|
export { RadarChart } from './RadarChart';
|
|
6
6
|
export { FunnelChart } from './FunnelChart';
|
|
7
|
-
export type { ChartProps, BarChartProps, LineChartProps, PieChartProps, RadarChartProps, FunnelChartProps, ChartDataPoint, ChartType, PieView, ChartLegendPosition, } from './Chart.types';
|
|
7
|
+
export type { ChartProps, BarChartProps, LineChartProps, PieChartProps, RadarChartProps, FunnelChartProps, ChartDataPoint, ChartType, ChartMotion, PieView, ChartLegendPosition, } from './Chart.types';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),r=require("react"),e=require("./ChipGroup.const.cjs"),n=require("../../utils/cn.cjs"),T=require("../../utils/generateBearId.utils.cjs"),h=require("../../utils/useBearId.cjs"),M=require("../../context/BearProvider.cjs");require("../../context/defaultTheme.cjs");const l=require("../../constants/generals.const.cjs"),x=O=>{const{id:P,testId:m,children:I,max:i,size:p="md",spacing:A="md",overflowMenu:_=!1,onDeleteAll:c,deleteAllLabel:E=e.CHIP_GROUP_DEFAULT_DELETE_ALL_LABEL,className:R,...L}=O,{density:G}=M.useBearDensityOptional(),o=G===l.DENSITY_COMPACT,U=o?l.SIZE_SM:A,f=o?l.SIZE_SM:p,v=h.useBearId(e.COMPONENT_NAME_CHIP_GROUP),b=T.resolveBearId(P,v),[d,S]=r.useState(!1),a=r.Children.toArray(I).filter(r.isValidElement).map(t=>r.isValidElement(t)?r.cloneElement(t,{size:t.props.size??f}):t),H=typeof i=="number"?a.slice(0,i):a,C=typeof i=="number"?a.slice(i):[],u=C.length;return s.jsxs("div",{...L,id:b,"data-testid":m,className:n.cn(e.CHIP_GROUP_ROOT_CLASS,e.CHIP_GROUP_BASE_CLASSES,e.CHIP_GROUP_SPACING_CLASSES[U],o&&e.CHIP_GROUP_COMPACT_CLASS,R),children:[H,u>0&&s.jsxs("div",{className:`${e.CHIP_GROUP_ROOT_CLASS}__overflow-wrap bear-relative`,children:[s.jsxs("button",{type:"button",className:n.cn(`${e.CHIP_GROUP_ROOT_CLASS}__overflow`,e.CHIP_GROUP_OVERFLOW_CLASSES),onClick:()=>_&&S(t=>!t),"aria-expanded":_?d:void 0,"aria-haspopup":_?"menu":void 0,children:["+",u]}),_&&d&&s.jsxs("div",{role:"menu",className:n.cn(`${e.CHIP_GROUP_ROOT_CLASS}__menu`,e.CHIP_GROUP_MENU_CLASSES),children:[C.map((t,N)=>s.jsx("div",{role:"menuitem",className:n.cn(`${e.CHIP_GROUP_ROOT_CLASS}__menu-item`,e.CHIP_GROUP_MENU_ITEM_CLASSES),children:t},`overflow-${N}`)),c&&s.jsx("button",{type:"button",role:"menuitem",className:n.cn(`${e.CHIP_GROUP_ROOT_CLASS}__delete-all`,e.CHIP_GROUP_MENU_ITEM_CLASSES,"bear-text-red-600 dark:bear-text-red-400 bear-w-full bear-text-left"),onClick:()=>{c(),S(!1)},children:E})]})]})]})};exports.ChipGroup=x;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="Bear-ChipGroup",r="bear-inline-flex bear-flex-wrap bear-items-center",a={sm:"bear-gap-1",md:"bear-gap-2",lg:"bear-gap-3"},
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="Bear-ChipGroup",r="bear-inline-flex bear-flex-wrap bear-items-center",a={sm:"bear-gap-1",md:"bear-gap-2",lg:"bear-gap-3"},_="bear-inline-flex bear-items-center bear-justify-center bear-h-8 bear-min-w-8 bear-px-2 bear-rounded-full bear-text-sm bear-font-medium bear-bg-gray-200 bear-text-gray-700 dark:bear-bg-zinc-700 dark:bear-text-zinc-200 bear-border-none bear-cursor-pointer",b="Delete all",S="bear-absolute bear-z-20 bear-top-full bear-left-0 bear-mt-1 bear-min-w-[10rem] bear-rounded-lg bear-border bear-border-[var(--bear-border-default)] bear-bg-[var(--bear-bg-primary)] bear-shadow-lg bear-p-2 bear-flex bear-flex-col bear-gap-2",C="bear-text-sm",P="ChipGroup",t="Bear-ChipGroup--compact";exports.CHIP_GROUP_BASE_CLASSES=r;exports.CHIP_GROUP_COMPACT_CLASS=t;exports.CHIP_GROUP_DEFAULT_DELETE_ALL_LABEL=b;exports.CHIP_GROUP_MENU_CLASSES=S;exports.CHIP_GROUP_MENU_ITEM_CLASSES=C;exports.CHIP_GROUP_OVERFLOW_CLASSES=_;exports.CHIP_GROUP_ROOT_CLASS=e;exports.CHIP_GROUP_SPACING_CLASSES=a;exports.COMPONENT_NAME_CHIP_GROUP=P;
|
|
@@ -9,3 +9,5 @@ export declare const CHIP_GROUP_OVERFLOW_CLASSES = "bear-inline-flex bear-items-
|
|
|
9
9
|
export declare const CHIP_GROUP_DEFAULT_DELETE_ALL_LABEL = "Delete all";
|
|
10
10
|
export declare const CHIP_GROUP_MENU_CLASSES = "bear-absolute bear-z-20 bear-top-full bear-left-0 bear-mt-1 bear-min-w-[10rem] bear-rounded-lg bear-border bear-border-[var(--bear-border-default)] bear-bg-[var(--bear-bg-primary)] bear-shadow-lg bear-p-2 bear-flex bear-flex-col bear-gap-2";
|
|
11
11
|
export declare const CHIP_GROUP_MENU_ITEM_CLASSES = "bear-text-sm";
|
|
12
|
+
export declare const COMPONENT_NAME_CHIP_GROUP = "ChipGroup";
|
|
13
|
+
export declare const CHIP_GROUP_COMPACT_CLASS = "Bear-ChipGroup--compact";
|
|
@@ -2,13 +2,15 @@ const e = "Bear-ChipGroup", r = "bear-inline-flex bear-flex-wrap bear-items-cent
|
|
|
2
2
|
sm: "bear-gap-1",
|
|
3
3
|
md: "bear-gap-2",
|
|
4
4
|
lg: "bear-gap-3"
|
|
5
|
-
}, b = "bear-inline-flex bear-items-center bear-justify-center bear-h-8 bear-min-w-8 bear-px-2 bear-rounded-full bear-text-sm bear-font-medium bear-bg-gray-200 bear-text-gray-700 dark:bear-bg-zinc-700 dark:bear-text-zinc-200 bear-border-none bear-cursor-pointer", t = "Delete all",
|
|
5
|
+
}, b = "bear-inline-flex bear-items-center bear-justify-center bear-h-8 bear-min-w-8 bear-px-2 bear-rounded-full bear-text-sm bear-font-medium bear-bg-gray-200 bear-text-gray-700 dark:bear-bg-zinc-700 dark:bear-text-zinc-200 bear-border-none bear-cursor-pointer", t = "Delete all", _ = "bear-absolute bear-z-20 bear-top-full bear-left-0 bear-mt-1 bear-min-w-[10rem] bear-rounded-lg bear-border bear-border-[var(--bear-border-default)] bear-bg-[var(--bear-bg-primary)] bear-shadow-lg bear-p-2 bear-flex bear-flex-col bear-gap-2", o = "bear-text-sm", n = "ChipGroup", C = "Bear-ChipGroup--compact";
|
|
6
6
|
export {
|
|
7
7
|
r as CHIP_GROUP_BASE_CLASSES,
|
|
8
|
+
C as CHIP_GROUP_COMPACT_CLASS,
|
|
8
9
|
t as CHIP_GROUP_DEFAULT_DELETE_ALL_LABEL,
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
_ as CHIP_GROUP_MENU_CLASSES,
|
|
11
|
+
o as CHIP_GROUP_MENU_ITEM_CLASSES,
|
|
11
12
|
b as CHIP_GROUP_OVERFLOW_CLASSES,
|
|
12
13
|
e as CHIP_GROUP_ROOT_CLASS,
|
|
13
|
-
a as CHIP_GROUP_SPACING_CLASSES
|
|
14
|
+
a as CHIP_GROUP_SPACING_CLASSES,
|
|
15
|
+
n as COMPONENT_NAME_CHIP_GROUP
|
|
14
16
|
};
|
|
@@ -1,83 +1,87 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { CHIP_GROUP_DEFAULT_DELETE_ALL_LABEL as
|
|
4
|
-
import { cn as
|
|
5
|
-
import { resolveBearId as
|
|
6
|
-
import { useBearId as
|
|
7
|
-
|
|
1
|
+
import { jsxs as i, jsx as p } from "react/jsx-runtime";
|
|
2
|
+
import { useState as H, Children as x, isValidElement as C, cloneElement as T } from "react";
|
|
3
|
+
import { CHIP_GROUP_DEFAULT_DELETE_ALL_LABEL as w, COMPONENT_NAME_CHIP_GROUP as $, CHIP_GROUP_ROOT_CLASS as t, CHIP_GROUP_OVERFLOW_CLASSES as z, CHIP_GROUP_MENU_ITEM_CLASSES as S, CHIP_GROUP_MENU_CLASSES as B, CHIP_GROUP_COMPACT_CLASS as D, CHIP_GROUP_SPACING_CLASSES as g, CHIP_GROUP_BASE_CLASSES as k } from "./ChipGroup.const.js";
|
|
4
|
+
import { cn as r } from "../../utils/cn.js";
|
|
5
|
+
import { resolveBearId as j } from "../../utils/generateBearId.utils.js";
|
|
6
|
+
import { useBearId as F } from "../../utils/useBearId.js";
|
|
7
|
+
import { useBearDensityOptional as V } from "../../context/BearProvider.js";
|
|
8
|
+
import "../../context/defaultTheme.js";
|
|
9
|
+
import { SIZE_SM as f, DENSITY_COMPACT as W } from "../../constants/generals.const.js";
|
|
10
|
+
const oe = (u) => {
|
|
8
11
|
const {
|
|
9
|
-
id:
|
|
10
|
-
testId:
|
|
11
|
-
children:
|
|
12
|
+
id: P,
|
|
13
|
+
testId: E,
|
|
14
|
+
children: A,
|
|
12
15
|
max: o,
|
|
13
|
-
size:
|
|
14
|
-
spacing:
|
|
15
|
-
overflowMenu:
|
|
16
|
+
size: O = "md",
|
|
17
|
+
spacing: I = "md",
|
|
18
|
+
overflowMenu: n = !1,
|
|
16
19
|
onDeleteAll: a,
|
|
17
|
-
deleteAllLabel: v =
|
|
18
|
-
className:
|
|
19
|
-
...
|
|
20
|
-
} =
|
|
21
|
-
(e) =>
|
|
22
|
-
size: e.props.size ??
|
|
20
|
+
deleteAllLabel: v = w,
|
|
21
|
+
className: L,
|
|
22
|
+
...N
|
|
23
|
+
} = u, { density: b } = V(), s = b === W, h = s ? f : I, U = s ? f : O, G = F($), R = j(P, G), [m, _] = H(!1), l = x.toArray(A).filter(C).map(
|
|
24
|
+
(e) => C(e) ? T(e, {
|
|
25
|
+
size: e.props.size ?? U
|
|
23
26
|
}) : e
|
|
24
|
-
),
|
|
25
|
-
return /* @__PURE__ */
|
|
27
|
+
), M = typeof o == "number" ? l.slice(0, o) : l, d = typeof o == "number" ? l.slice(o) : [], c = d.length;
|
|
28
|
+
return /* @__PURE__ */ i(
|
|
26
29
|
"div",
|
|
27
30
|
{
|
|
28
|
-
...
|
|
29
|
-
id:
|
|
30
|
-
"data-testid":
|
|
31
|
-
className:
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
31
|
+
...N,
|
|
32
|
+
id: R,
|
|
33
|
+
"data-testid": E,
|
|
34
|
+
className: r(
|
|
35
|
+
t,
|
|
36
|
+
k,
|
|
37
|
+
g[h],
|
|
38
|
+
s && D,
|
|
39
|
+
L
|
|
36
40
|
),
|
|
37
41
|
children: [
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
/* @__PURE__ */
|
|
42
|
+
M,
|
|
43
|
+
c > 0 && /* @__PURE__ */ i("div", { className: `${t}__overflow-wrap bear-relative`, children: [
|
|
44
|
+
/* @__PURE__ */ i(
|
|
41
45
|
"button",
|
|
42
46
|
{
|
|
43
47
|
type: "button",
|
|
44
|
-
className:
|
|
45
|
-
onClick: () =>
|
|
46
|
-
"aria-expanded":
|
|
47
|
-
"aria-haspopup":
|
|
48
|
+
className: r(`${t}__overflow`, z),
|
|
49
|
+
onClick: () => n && _((e) => !e),
|
|
50
|
+
"aria-expanded": n ? m : void 0,
|
|
51
|
+
"aria-haspopup": n ? "menu" : void 0,
|
|
48
52
|
children: [
|
|
49
53
|
"+",
|
|
50
|
-
|
|
54
|
+
c
|
|
51
55
|
]
|
|
52
56
|
}
|
|
53
57
|
),
|
|
54
|
-
|
|
58
|
+
n && m && /* @__PURE__ */ i(
|
|
55
59
|
"div",
|
|
56
60
|
{
|
|
57
61
|
role: "menu",
|
|
58
|
-
className:
|
|
62
|
+
className: r(`${t}__menu`, B),
|
|
59
63
|
children: [
|
|
60
|
-
d.map((e,
|
|
64
|
+
d.map((e, y) => /* @__PURE__ */ p(
|
|
61
65
|
"div",
|
|
62
66
|
{
|
|
63
67
|
role: "menuitem",
|
|
64
|
-
className:
|
|
68
|
+
className: r(`${t}__menu-item`, S),
|
|
65
69
|
children: e
|
|
66
70
|
},
|
|
67
|
-
`overflow-${
|
|
71
|
+
`overflow-${y}`
|
|
68
72
|
)),
|
|
69
|
-
a && /* @__PURE__ */
|
|
73
|
+
a && /* @__PURE__ */ p(
|
|
70
74
|
"button",
|
|
71
75
|
{
|
|
72
76
|
type: "button",
|
|
73
77
|
role: "menuitem",
|
|
74
|
-
className:
|
|
75
|
-
`${
|
|
76
|
-
|
|
78
|
+
className: r(
|
|
79
|
+
`${t}__delete-all`,
|
|
80
|
+
S,
|
|
77
81
|
"bear-text-red-600 dark:bear-text-red-400 bear-w-full bear-text-left"
|
|
78
82
|
),
|
|
79
83
|
onClick: () => {
|
|
80
|
-
a(),
|
|
84
|
+
a(), _(!1);
|
|
81
85
|
},
|
|
82
86
|
children: v
|
|
83
87
|
}
|
|
@@ -91,5 +95,5 @@ const V = (C) => {
|
|
|
91
95
|
);
|
|
92
96
|
};
|
|
93
97
|
export {
|
|
94
|
-
|
|
98
|
+
oe as ChipGroup
|
|
95
99
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),s=require("../../utils/cn.cjs");require("react");const n=require("./CommandPalette.utils.cjs"),l=({command:e,isHighlighted:a,onSelect:t})=>r.jsxs("button",{type:"button",onClick:t,disabled:e.disabled,className:s.cn("Bear-CommandPalette__item bear-w-full bear-flex bear-items-center bear-gap-3 bear-px-4 bear-py-2.5 bear-text-left bear-transition-colors",a?"bear-bg-primary-500/20 bear-text-primary-400":"bear-text-gray-700 dark:bear-text-zinc-300 hover:bear-bg-gray-100 dark:hover:bear-bg-zinc-700",e.disabled&&"bear-opacity-50 bear-cursor-not-allowed"),children:[e.icon&&r.jsx("span",{className:"Bear-CommandPalette__item-icon bear-text-gray-500 dark:bear-text-zinc-400 bear-shrink-0",children:e.icon}),r.jsxs("div",{className:"Bear-CommandPalette__item-content bear-flex-1 bear-min-w-0",children:[r.jsx("div",{className:"Bear-CommandPalette__item-label bear-text-sm bear-font-medium bear-truncate",children:e.label}),e.description&&r.jsx("div",{className:"Bear-CommandPalette__item-description bear-text-xs bear-text-gray-500 dark:bear-text-zinc-500 bear-truncate",children:e.description})]}),e.shortcut&&r.jsx("div",{className:"Bear-CommandPalette__item-shortcut bear-flex bear-gap-1 bear-shrink-0",children:n.formatShortcut(e.shortcut).map((b,i)=>r.jsx("kbd",{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",children:b},i))})]});exports.CommandItem=l;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { jsxs as a, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { cn as l } from "../../utils/cn.js";
|
|
3
|
+
import "react";
|
|
4
|
+
import { formatShortcut as o } from "./CommandPalette.utils.js";
|
|
5
|
+
const x = ({
|
|
6
|
+
command: e,
|
|
7
|
+
isHighlighted: t,
|
|
8
|
+
onSelect: b
|
|
9
|
+
}) => /* @__PURE__ */ a(
|
|
10
|
+
"button",
|
|
11
|
+
{
|
|
12
|
+
type: "button",
|
|
13
|
+
onClick: b,
|
|
14
|
+
disabled: e.disabled,
|
|
15
|
+
className: l(
|
|
16
|
+
"Bear-CommandPalette__item bear-w-full bear-flex bear-items-center bear-gap-3 bear-px-4 bear-py-2.5 bear-text-left bear-transition-colors",
|
|
17
|
+
t ? "bear-bg-primary-500/20 bear-text-primary-400" : "bear-text-gray-700 dark:bear-text-zinc-300 hover:bear-bg-gray-100 dark:hover:bear-bg-zinc-700",
|
|
18
|
+
e.disabled && "bear-opacity-50 bear-cursor-not-allowed"
|
|
19
|
+
),
|
|
20
|
+
children: [
|
|
21
|
+
e.icon && /* @__PURE__ */ r("span", { className: "Bear-CommandPalette__item-icon bear-text-gray-500 dark:bear-text-zinc-400 bear-shrink-0", children: e.icon }),
|
|
22
|
+
/* @__PURE__ */ a("div", { className: "Bear-CommandPalette__item-content bear-flex-1 bear-min-w-0", children: [
|
|
23
|
+
/* @__PURE__ */ r("div", { className: "Bear-CommandPalette__item-label bear-text-sm bear-font-medium bear-truncate", children: e.label }),
|
|
24
|
+
e.description && /* @__PURE__ */ r("div", { className: "Bear-CommandPalette__item-description bear-text-xs bear-text-gray-500 dark:bear-text-zinc-500 bear-truncate", children: e.description })
|
|
25
|
+
] }),
|
|
26
|
+
e.shortcut && /* @__PURE__ */ r("div", { className: "Bear-CommandPalette__item-shortcut bear-flex bear-gap-1 bear-shrink-0", children: o(e.shortcut).map((i, n) => /* @__PURE__ */ r(
|
|
27
|
+
"kbd",
|
|
28
|
+
{
|
|
29
|
+
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",
|
|
30
|
+
children: i
|
|
31
|
+
},
|
|
32
|
+
n
|
|
33
|
+
)) })
|
|
34
|
+
]
|
|
35
|
+
}
|
|
36
|
+
);
|
|
37
|
+
export {
|
|
38
|
+
x as CommandItem
|
|
39
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),t=require("react"),Q=require("react-dom"),V=require("../../utils/cn.cjs"),W=require("../../hooks/useFocusTrap/useFocusTrap.cjs"),_=require("./CommandPalette.const.cjs"),B=require("./CommandPalette.utils.cjs"),P=require("./CommandItem.cjs"),Y=({commands:m,open:S,onOpenChange:f,placeholder:L,showRecent:w=!0,maxRecent:p=_.COMMAND_PALETTE_MAX_RECENT,recentIds:q,onRecentChange:h,groupByCategory:v=!1,filterFn:E=B.defaultFilterFn,triggerKey:I=_.COMMAND_PALETTE_TRIGGER_KEY,className:R,testId:F,translations:z,icon:O,footer:D})=>{const[K,H]=t.useState(!1),[n,T]=t.useState(""),[s,g]=t.useState(0),[G,U]=t.useState([]),C=t.useRef(null),j=t.useRef(null),M=t.useRef(null),i=S??K,l=t.useCallback(e=>{f==null||f(e),H(e)},[f]);W.useFocusTrap(M,{enabled:i,initialFocusRef:C,onEscape:()=>l(!1)});const c=q??G,A=t.useCallback(e=>{h==null||h(e),U(e)},[h]),k=t.useMemo(()=>({..._.COMMAND_PALETTE_DEFAULT_TRANSLATIONS,...z}),[z]),u=t.useMemo(()=>n.trim()?m.filter(e=>E(e,n)):m,[m,n,E]),d=t.useMemo(()=>!w||n.trim()?[]:c.slice(0,p).map(e=>m.find(r=>r.id===e)).filter(Boolean),[w,n,c,p,m]),y=t.useMemo(()=>v?B.groupCommandsByCategory(u):null,[u,v]),o=t.useMemo(()=>{const e=[];return d.length>0&&e.push(...d),e.push(...u.filter(r=>!c.includes(r.id))),e},[d,u,c]);t.useEffect(()=>{const e=r=>{(r.metaKey||r.ctrlKey)&&r.key.toLowerCase()===I&&(r.preventDefault(),l(!i)),r.key==="Escape"&&i&&(r.preventDefault(),l(!1))};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[i,I,l]),t.useEffect(()=>{i&&(T(""),g(0),setTimeout(()=>{var e;return(e=C.current)==null?void 0:e.focus()},50))},[i]),t.useEffect(()=>{if(s>=0&&j.current){const r=j.current.querySelectorAll("[data-command-item]")[s];r&&r.scrollIntoView({block:"nearest"})}},[s]);const x=t.useCallback(e=>{const r=[e.id,...c.filter(b=>b!==e.id)].slice(0,p);A(r),l(!1),e.onSelect()},[c,p,A,l]),X=t.useCallback(e=>{switch(e.key){case"ArrowDown":e.preventDefault(),g(r=>r<o.length-1?r+1:0);break;case"ArrowUp":e.preventDefault(),g(r=>r>0?r-1:o.length-1);break;case"Enter":e.preventDefault(),o[s]&&!o[s].disabled&&x(o[s]);break;case"Escape":e.preventDefault(),l(!1);break}},[o,s,x,l]);return i&&typeof document<"u"?Q.createPortal(a.jsxs("div",{className:V.cn("Bear-CommandPalette bear-fixed bear-inset-0 bear-flex bear-items-start bear-justify-center bear-pt-[15vh]",R),style:{zIndex:_.COMMAND_PALETTE_Z_INDEX},"data-testid":F,children:[a.jsx("div",{className:"Bear-CommandPalette__backdrop bear-absolute bear-inset-0 bear-bg-black/50 bear-backdrop-blur-sm",onClick:()=>l(!1)}),a.jsxs("div",{ref:M,tabIndex:-1,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",children:[a.jsxs("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:[O??a.jsx("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:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),a.jsx("input",{ref:C,type:"text",value:n,onChange:e=>{T(e.target.value),g(0)},onKeyDown:X,placeholder:L||k.placeholder,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"}),a.jsx("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"})]}),a.jsx("div",{ref:j,className:"Bear-CommandPalette__list bear-max-h-[60vh] bear-overflow-y-auto",children:o.length===0?a.jsx("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:k.noResults}):a.jsxs(a.Fragment,{children:[d.length>0&&!n.trim()&&a.jsxs("div",{className:"Bear-CommandPalette__group",children:[a.jsx("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:k.recentCommands}),d.map((e,r)=>a.jsx("div",{"data-command-item":!0,children:a.jsx(P.CommandItem,{command:e,isHighlighted:s===r,onSelect:()=>x(e)})},`recent-${e.id}`))]}),v&&y?y.map(e=>{const r=d.length+y.slice(0,y.indexOf(e)).reduce((b,N)=>b+N.commands.length,0);return a.jsxs("div",{className:"Bear-CommandPalette__group",children:[a.jsx("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}),e.commands.map((b,N)=>a.jsx("div",{"data-command-item":!0,children:a.jsx(P.CommandItem,{command:b,isHighlighted:s===r+N,onSelect:()=>x(b)})},b.id))]},e.name)}):a.jsxs("div",{className:"Bear-CommandPalette__group",children:[!n.trim()&&d.length>0&&a.jsx("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:k.allCommands}),u.filter(e=>!c.includes(e.id)||n.trim()).map((e,r)=>a.jsx("div",{"data-command-item":!0,children:a.jsx(P.CommandItem,{command:e,isHighlighted:s===d.length+r,onSelect:()=>x(e)})},e.id))]})]})}),D&&a.jsx("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:D})]})]}),document.body):null};exports.CommandPalette=Y;
|