@forgedevstack/bear 1.3.3 → 1.3.4
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 +145 -292
- 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/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 +10 -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 +12 -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 +20 -12
- package/dist/components/Modal/Modal.js +62 -59
- package/dist/components/Modal/Modal.types.d.ts +7 -0
- 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 +29 -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/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 +86 -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 +18 -0
- package/dist/components/Tooltip/Tooltip.js +59 -61
- package/dist/components/Tooltip/Tooltip.types.d.ts +7 -0
- package/dist/components/index.cjs +1 -1
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.js +428 -418
- 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/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 +575 -563
- package/dist/styles.css +52 -0
- package/package.json +1 -1
|
@@ -1,118 +1,101 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useId as
|
|
3
|
-
import { createPortal as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
const ae = (B) => {
|
|
1
|
+
import { jsxs as l, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { useId as I, useRef as k, useEffect as L } from "react";
|
|
3
|
+
import { createPortal as T } from "react-dom";
|
|
4
|
+
import { LABEL_CONFIRM as C, LABEL_CANCEL as R, VARIANT_DANGER as O, BOOLEAN_FALSE as m, BOOLEAN_TRUE as w, ALERT_DESC_ID_PREFIX as j, ALERT_TITLE_ID_PREFIX as F } from "../../constants/generals.const.js";
|
|
5
|
+
import { cn as n } from "../../utils/cn.js";
|
|
6
|
+
import { useFocusTrap as $ } from "../../hooks/useFocusTrap/useFocusTrap.js";
|
|
7
|
+
import { Button as f } from "../Button/Button.js";
|
|
8
|
+
import { Typography as g } from "../Typography/Typography.js";
|
|
9
|
+
const q = (p) => {
|
|
11
10
|
const {
|
|
12
|
-
isOpen:
|
|
13
|
-
onClose:
|
|
14
|
-
onConfirm:
|
|
15
|
-
title:
|
|
16
|
-
description:
|
|
17
|
-
confirmText:
|
|
18
|
-
cancelText:
|
|
19
|
-
confirmVariant:
|
|
20
|
-
loading:
|
|
21
|
-
loadingText:
|
|
22
|
-
closeOnBackdrop:
|
|
23
|
-
closeOnEscape:
|
|
24
|
-
icon:
|
|
25
|
-
className:
|
|
26
|
-
testId:
|
|
27
|
-
} =
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
return;
|
|
35
|
-
const i = n.current.querySelectorAll(
|
|
36
|
-
'button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'
|
|
37
|
-
);
|
|
38
|
-
if (i.length === A)
|
|
39
|
-
return;
|
|
40
|
-
const y = i[A], x = i[i.length - 1];
|
|
41
|
-
e.shiftKey && document.activeElement === y ? (e.preventDefault(), x.focus()) : !e.shiftKey && document.activeElement === x && (e.preventDefault(), y.focus());
|
|
42
|
-
}, []);
|
|
43
|
-
if (P(() => (l && (g.current = document.activeElement, document.addEventListener("keydown", c), document.addEventListener("keydown", s), document.body.style.overflow = "hidden", requestAnimationFrame(() => {
|
|
44
|
-
var e;
|
|
45
|
-
return (e = n.current) == null ? void 0 : e.focus();
|
|
46
|
-
})), () => {
|
|
47
|
-
var e;
|
|
48
|
-
document.removeEventListener("keydown", c), document.removeEventListener("keydown", s), document.body.style.overflow = "", (e = g.current) == null || e.focus();
|
|
49
|
-
}), [l, c, s]), !l)
|
|
11
|
+
isOpen: r,
|
|
12
|
+
onClose: i,
|
|
13
|
+
onConfirm: u,
|
|
14
|
+
title: _,
|
|
15
|
+
description: o,
|
|
16
|
+
confirmText: x = C,
|
|
17
|
+
cancelText: A = R,
|
|
18
|
+
confirmVariant: y = O,
|
|
19
|
+
loading: a = m,
|
|
20
|
+
loadingText: E,
|
|
21
|
+
closeOnBackdrop: h = m,
|
|
22
|
+
closeOnEscape: v = w,
|
|
23
|
+
icon: t,
|
|
24
|
+
className: N,
|
|
25
|
+
testId: B
|
|
26
|
+
} = p, d = I(), b = `${F}${d}`, s = `${j}${d}`, c = k(null);
|
|
27
|
+
if ($(c, {
|
|
28
|
+
enabled: r,
|
|
29
|
+
onEscape: v && !a ? i : void 0
|
|
30
|
+
}), L(() => (r && (document.body.style.overflow = "hidden"), () => {
|
|
31
|
+
document.body.style.overflow = "";
|
|
32
|
+
}), [r]), !r)
|
|
50
33
|
return null;
|
|
51
|
-
const
|
|
34
|
+
const D = /* @__PURE__ */ l(
|
|
52
35
|
"div",
|
|
53
36
|
{
|
|
54
37
|
className: "Bear-AlertDialog bear-fixed bear-inset-0 bear-z-50 bear-flex bear-items-center bear-justify-center bear-p-4",
|
|
55
|
-
"data-testid":
|
|
38
|
+
"data-testid": B,
|
|
56
39
|
children: [
|
|
57
|
-
/* @__PURE__ */
|
|
40
|
+
/* @__PURE__ */ e(
|
|
58
41
|
"div",
|
|
59
42
|
{
|
|
60
43
|
className: "Bear-AlertDialog__backdrop bear-absolute bear-inset-0 bear-bg-black/60 bear-backdrop-blur-sm bear-transition-opacity animate-fade-in",
|
|
61
|
-
onClick:
|
|
44
|
+
onClick: h && !a ? i : void 0,
|
|
62
45
|
"aria-hidden": "true"
|
|
63
46
|
}
|
|
64
47
|
),
|
|
65
|
-
/* @__PURE__ */
|
|
48
|
+
/* @__PURE__ */ l(
|
|
66
49
|
"div",
|
|
67
50
|
{
|
|
68
|
-
ref:
|
|
51
|
+
ref: c,
|
|
69
52
|
role: "alertdialog",
|
|
70
53
|
"aria-modal": "true",
|
|
71
|
-
"aria-labelledby":
|
|
72
|
-
"aria-describedby":
|
|
54
|
+
"aria-labelledby": b,
|
|
55
|
+
"aria-describedby": o ? s : void 0,
|
|
73
56
|
tabIndex: -1,
|
|
74
|
-
className:
|
|
57
|
+
className: n(
|
|
75
58
|
"Bear-AlertDialog__container bear-relative bear-w-full bear-max-w-md bear-bg-white dark:bear-bg-zinc-900 bear-rounded-xl bear-shadow-2xl bear-border bear-border-gray-200 dark:bear-border-zinc-700 bear-transform bear-transition-all animate-alert-dialog-in bear-p-6",
|
|
76
|
-
|
|
59
|
+
N
|
|
77
60
|
),
|
|
78
61
|
children: [
|
|
79
|
-
|
|
80
|
-
/* @__PURE__ */
|
|
81
|
-
|
|
62
|
+
t && /* @__PURE__ */ e("div", { className: "Bear-AlertDialog__icon bear-mb-4 bear-flex bear-justify-center", children: t }),
|
|
63
|
+
/* @__PURE__ */ e(
|
|
64
|
+
g,
|
|
82
65
|
{
|
|
83
66
|
variant: "h6",
|
|
84
|
-
id:
|
|
85
|
-
className:
|
|
86
|
-
children:
|
|
67
|
+
id: b,
|
|
68
|
+
className: n("Bear-AlertDialog__title bear-text-lg bear-font-semibold bear-text-gray-900 dark:bear-text-white", t && "bear-text-center"),
|
|
69
|
+
children: _
|
|
87
70
|
}
|
|
88
71
|
),
|
|
89
|
-
|
|
90
|
-
|
|
72
|
+
o && /* @__PURE__ */ e(
|
|
73
|
+
g,
|
|
91
74
|
{
|
|
92
75
|
variant: "body2",
|
|
93
|
-
id:
|
|
94
|
-
className:
|
|
95
|
-
children:
|
|
76
|
+
id: s,
|
|
77
|
+
className: n("Bear-AlertDialog__description bear-text-sm bear-text-gray-600 dark:bear-text-gray-400 bear-mt-2", t && "bear-text-center"),
|
|
78
|
+
children: o
|
|
96
79
|
}
|
|
97
80
|
),
|
|
98
|
-
/* @__PURE__ */
|
|
99
|
-
/* @__PURE__ */
|
|
100
|
-
|
|
81
|
+
/* @__PURE__ */ l("div", { className: "Bear-AlertDialog__footer bear-flex bear-items-center bear-justify-end bear-gap-3 bear-pt-6", children: [
|
|
82
|
+
/* @__PURE__ */ e(
|
|
83
|
+
f,
|
|
101
84
|
{
|
|
102
85
|
variant: "ghost",
|
|
103
|
-
onClick:
|
|
104
|
-
disabled:
|
|
105
|
-
children:
|
|
86
|
+
onClick: i,
|
|
87
|
+
disabled: a,
|
|
88
|
+
children: A
|
|
106
89
|
}
|
|
107
90
|
),
|
|
108
|
-
/* @__PURE__ */
|
|
109
|
-
|
|
91
|
+
/* @__PURE__ */ e(
|
|
92
|
+
f,
|
|
110
93
|
{
|
|
111
|
-
variant:
|
|
112
|
-
onClick:
|
|
113
|
-
loading:
|
|
114
|
-
loadingText:
|
|
115
|
-
children:
|
|
94
|
+
variant: y,
|
|
95
|
+
onClick: u,
|
|
96
|
+
loading: a,
|
|
97
|
+
loadingText: E,
|
|
98
|
+
children: x
|
|
116
99
|
}
|
|
117
100
|
)
|
|
118
101
|
] })
|
|
@@ -122,8 +105,8 @@ const ae = (B) => {
|
|
|
122
105
|
]
|
|
123
106
|
}
|
|
124
107
|
);
|
|
125
|
-
return
|
|
108
|
+
return T(D, document.body);
|
|
126
109
|
};
|
|
127
110
|
export {
|
|
128
|
-
|
|
111
|
+
q as AlertDialog
|
|
129
112
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),t=require("react"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),t=require("react"),R=require("react-dom"),g=require("../../hooks/useFocusTrap/useFocusTrap.cjs"),m=require("../../constants/numbers.const.cjs"),e=require("../../constants/generals.const.cjs"),F=require("../../constants/keys.const.cjs"),l=require("../../utils/cn.cjs"),b=require("../Box/Box.cjs"),j=require("../Button/Button.cjs"),O=require("../Flex/Flex.cjs"),q=require("@forgedevstack/bear-icons"),v=require("../Typography/Typography.cjs"),C=require("./BottomSheet.const.cjs"),U=_=>{const{isOpen:i,onClose:n,title:o,children:f,size:y=e.SIZE_MD,showCloseButton:h=e.BOOLEAN_TRUE,closeOnBackdrop:L=e.BOOLEAN_TRUE,closeOnEscape:c=e.BOOLEAN_TRUE,showHandle:N=e.BOOLEAN_TRUE,enableScroll:S=e.BOOLEAN_TRUE,isSticky:p=e.BOOLEAN_FALSE,className:T}=_,[a,x]=t.useState(i),[u,d]=t.useState(e.BOOLEAN_FALSE),[k,B]=t.useState(e.BOOLEAN_FALSE);t.useEffect(()=>{if(i){x(e.BOOLEAN_TRUE),d(e.BOOLEAN_FALSE);const s=requestAnimationFrame(()=>B(e.BOOLEAN_TRUE));return()=>cancelAnimationFrame(s)}if(a){B(e.BOOLEAN_FALSE),d(e.BOOLEAN_TRUE);const s=setTimeout(()=>{x(e.BOOLEAN_FALSE),d(e.BOOLEAN_FALSE)},m.THREE_HUNDRED);return()=>clearTimeout(s)}},[i,a]);const A=t.useRef(null);g.useFocusTrap(A,{enabled:a&&!u,onEscape:c?n:void 0});const E=t.useCallback(s=>{c&&s.key===F.KEY_ESCAPE&&n()},[c,n]);if(t.useEffect(()=>(a&&(document.addEventListener("keydown",E),document.body.style.overflow="hidden"),()=>{document.removeEventListener("keydown",E),document.body.style.overflow=""}),[a,E]),!a)return null;const w=r.jsxs(O.Flex,{className:"bear-fixed bear-inset-0 bear-items-end bear-justify-center",style:{zIndex:m.BACKDROP_DEFAULT_Z_INDEX},children:[r.jsx(b.Box,{className:l.cn("bear-absolute bear-inset-0 bear-bg-black/60 bear-backdrop-blur-sm bear-transition-opacity",u?"bear-opacity-0":"bear-opacity-100"),style:{transitionDuration:`${m.THREE_HUNDRED}ms`},onClick:L?n:void 0,"aria-hidden":"true"}),r.jsxs(b.Box,{ref:A,role:"dialog",tabIndex:-1,"aria-modal":"true","aria-labelledby":o?"bottom-sheet-title":void 0,className:l.cn("Bear-BottomSheet bear-relative bear-w-full bear-rounded-t-2xl bear-shadow-2xl bear-transition-transform bear-duration-300","bear-flex bear-flex-col bear-min-h-0 bear-overflow-hidden","bear-bg-white dark:bear-bg-neutral-900 bear-border-t bear-border-neutral-200 dark:bear-border-neutral-700",C.BOTTOM_SHEET_SIZE_CLASSES[y],k&&!u?"bear-translate-y-0":"bear-translate-y-full",T),children:[N&&r.jsx(O.Flex,{className:"bear-justify-center bear-pt-2 bear-pb-1",children:r.jsx(b.Box,{className:"bear-w-12 bear-h-1 bear-rounded-full bear-bg-neutral-300 dark:bear-bg-neutral-600","aria-hidden":!0})}),(o||h)&&r.jsxs(O.Flex,{className:l.cn("bear-items-center bear-justify-between bear-px-4 bear-py-3 bear-border-b bear-border-neutral-200 dark:bear-border-neutral-700 bear-shrink-0",p&&"bear-sticky bear-top-0 bear-z-10 bear-bg-white dark:bear-bg-neutral-900"),children:[o&&r.jsx(v.Typography,{id:"bottom-sheet-title",weight:"semibold",className:"bear-text-lg bear-text-neutral-900 dark:bear-text-white",children:o}),h&&r.jsx(j.Button,{variant:e.VARIANT_GHOST,onClick:n,"aria-label":e.LABEL_CLOSE,children:r.jsx(q.XIcon,{className:"bear-w-5 bear-h-5"})})]}),r.jsx(b.Box,{className:l.cn("bear-flex-1 bear-min-h-0 bear-p-4 bear-text-neutral-700 dark:bear-text-neutral-300",S?"bear-overflow-y-auto":"bear-overflow-hidden"),children:f})]})]});return R.createPortal(w,document.body)};exports.BottomSheet=U;
|
|
@@ -1,99 +1,107 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { createPortal as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
1
|
+
import { jsxs as f, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { useState as p, useEffect as w, useRef as I, useCallback as D } from "react";
|
|
3
|
+
import { createPortal as R } from "react-dom";
|
|
4
|
+
import { useFocusTrap as F } from "../../hooks/useFocusTrap/useFocusTrap.js";
|
|
5
|
+
import { THREE_HUNDRED as N, BACKDROP_DEFAULT_Z_INDEX as H } from "../../constants/numbers.const.js";
|
|
6
|
+
import { SIZE_MD as j, BOOLEAN_TRUE as e, BOOLEAN_FALSE as a, LABEL_CLOSE as M, VARIANT_GHOST as z } from "../../constants/generals.const.js";
|
|
7
|
+
import { KEY_ESCAPE as P } from "../../constants/keys.const.js";
|
|
7
8
|
import { cn as i } from "../../utils/cn.js";
|
|
8
|
-
import { Box as
|
|
9
|
-
import { Button as
|
|
10
|
-
import { Flex as
|
|
11
|
-
import { XIcon as
|
|
12
|
-
import { Typography as
|
|
13
|
-
import { BOTTOM_SHEET_SIZE_CLASSES as
|
|
14
|
-
const
|
|
9
|
+
import { Box as s } from "../Box/Box.js";
|
|
10
|
+
import { Button as U } from "../Button/Button.js";
|
|
11
|
+
import { Flex as h } from "../Flex/Flex.js";
|
|
12
|
+
import { XIcon as Z } from "@forgedevstack/bear-icons";
|
|
13
|
+
import { Typography as K } from "../Typography/Typography.js";
|
|
14
|
+
import { BOTTOM_SHEET_SIZE_CLASSES as X } from "./BottomSheet.const.js";
|
|
15
|
+
const be = (S) => {
|
|
15
16
|
const {
|
|
16
|
-
isOpen:
|
|
17
|
-
onClose:
|
|
17
|
+
isOpen: l,
|
|
18
|
+
onClose: o,
|
|
18
19
|
title: b,
|
|
19
|
-
children:
|
|
20
|
-
size:
|
|
21
|
-
showCloseButton:
|
|
22
|
-
closeOnBackdrop:
|
|
23
|
-
closeOnEscape:
|
|
20
|
+
children: O,
|
|
21
|
+
size: g = j,
|
|
22
|
+
showCloseButton: y = e,
|
|
23
|
+
closeOnBackdrop: v = e,
|
|
24
|
+
closeOnEscape: d = e,
|
|
24
25
|
showHandle: _ = e,
|
|
25
|
-
enableScroll:
|
|
26
|
-
isSticky:
|
|
27
|
-
className:
|
|
28
|
-
} =
|
|
26
|
+
enableScroll: A = e,
|
|
27
|
+
isSticky: B = a,
|
|
28
|
+
className: T
|
|
29
|
+
} = S, [t, E] = p(l), [m, c] = p(a), [C, k] = p(a);
|
|
29
30
|
w(() => {
|
|
30
|
-
if (
|
|
31
|
-
|
|
32
|
-
const
|
|
33
|
-
return () => cancelAnimationFrame(
|
|
31
|
+
if (l) {
|
|
32
|
+
E(e), c(a);
|
|
33
|
+
const n = requestAnimationFrame(() => k(e));
|
|
34
|
+
return () => cancelAnimationFrame(n);
|
|
34
35
|
}
|
|
35
36
|
if (t) {
|
|
36
|
-
k(a),
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
},
|
|
40
|
-
return () => clearTimeout(
|
|
37
|
+
k(a), c(e);
|
|
38
|
+
const n = setTimeout(() => {
|
|
39
|
+
E(a), c(a);
|
|
40
|
+
}, N);
|
|
41
|
+
return () => clearTimeout(n);
|
|
41
42
|
}
|
|
42
|
-
}, [
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
|
|
43
|
+
}, [l, t]);
|
|
44
|
+
const x = I(null);
|
|
45
|
+
F(x, {
|
|
46
|
+
enabled: t && !m,
|
|
47
|
+
onEscape: d ? o : void 0
|
|
48
|
+
});
|
|
49
|
+
const u = D(
|
|
50
|
+
(n) => {
|
|
51
|
+
d && n.key === P && o();
|
|
46
52
|
},
|
|
47
|
-
[
|
|
53
|
+
[d, o]
|
|
48
54
|
);
|
|
49
|
-
if (w(() => (t && (document.addEventListener("keydown",
|
|
50
|
-
document.removeEventListener("keydown",
|
|
51
|
-
}), [t,
|
|
55
|
+
if (w(() => (t && (document.addEventListener("keydown", u), document.body.style.overflow = "hidden"), () => {
|
|
56
|
+
document.removeEventListener("keydown", u), document.body.style.overflow = "";
|
|
57
|
+
}), [t, u]), !t)
|
|
52
58
|
return null;
|
|
53
|
-
const
|
|
54
|
-
|
|
59
|
+
const L = /* @__PURE__ */ f(
|
|
60
|
+
h,
|
|
55
61
|
{
|
|
56
62
|
className: "bear-fixed bear-inset-0 bear-items-end bear-justify-center",
|
|
57
|
-
style: { zIndex:
|
|
63
|
+
style: { zIndex: H },
|
|
58
64
|
children: [
|
|
59
65
|
/* @__PURE__ */ r(
|
|
60
|
-
|
|
66
|
+
s,
|
|
61
67
|
{
|
|
62
68
|
className: i(
|
|
63
69
|
"bear-absolute bear-inset-0 bear-bg-black/60 bear-backdrop-blur-sm bear-transition-opacity",
|
|
64
|
-
|
|
70
|
+
m ? "bear-opacity-0" : "bear-opacity-100"
|
|
65
71
|
),
|
|
66
|
-
style: { transitionDuration: `${
|
|
67
|
-
onClick:
|
|
72
|
+
style: { transitionDuration: `${N}ms` },
|
|
73
|
+
onClick: v ? o : void 0,
|
|
68
74
|
"aria-hidden": "true"
|
|
69
75
|
}
|
|
70
76
|
),
|
|
71
|
-
/* @__PURE__ */
|
|
72
|
-
|
|
77
|
+
/* @__PURE__ */ f(
|
|
78
|
+
s,
|
|
73
79
|
{
|
|
80
|
+
ref: x,
|
|
74
81
|
role: "dialog",
|
|
82
|
+
tabIndex: -1,
|
|
75
83
|
"aria-modal": "true",
|
|
76
84
|
"aria-labelledby": b ? "bottom-sheet-title" : void 0,
|
|
77
85
|
className: i(
|
|
78
86
|
"Bear-BottomSheet bear-relative bear-w-full bear-rounded-t-2xl bear-shadow-2xl bear-transition-transform bear-duration-300",
|
|
79
87
|
"bear-flex bear-flex-col bear-min-h-0 bear-overflow-hidden",
|
|
80
88
|
"bear-bg-white dark:bear-bg-neutral-900 bear-border-t bear-border-neutral-200 dark:bear-border-neutral-700",
|
|
81
|
-
|
|
82
|
-
C && !
|
|
83
|
-
|
|
89
|
+
X[g],
|
|
90
|
+
C && !m ? "bear-translate-y-0" : "bear-translate-y-full",
|
|
91
|
+
T
|
|
84
92
|
),
|
|
85
93
|
children: [
|
|
86
|
-
_ && /* @__PURE__ */ r(
|
|
87
|
-
(b ||
|
|
88
|
-
|
|
94
|
+
_ && /* @__PURE__ */ r(h, { className: "bear-justify-center bear-pt-2 bear-pb-1", children: /* @__PURE__ */ r(s, { className: "bear-w-12 bear-h-1 bear-rounded-full bear-bg-neutral-300 dark:bear-bg-neutral-600", "aria-hidden": !0 }) }),
|
|
95
|
+
(b || y) && /* @__PURE__ */ f(
|
|
96
|
+
h,
|
|
89
97
|
{
|
|
90
98
|
className: i(
|
|
91
99
|
"bear-items-center bear-justify-between bear-px-4 bear-py-3 bear-border-b bear-border-neutral-200 dark:bear-border-neutral-700 bear-shrink-0",
|
|
92
|
-
|
|
100
|
+
B && "bear-sticky bear-top-0 bear-z-10 bear-bg-white dark:bear-bg-neutral-900"
|
|
93
101
|
),
|
|
94
102
|
children: [
|
|
95
103
|
b && /* @__PURE__ */ r(
|
|
96
|
-
|
|
104
|
+
K,
|
|
97
105
|
{
|
|
98
106
|
id: "bottom-sheet-title",
|
|
99
107
|
weight: "semibold",
|
|
@@ -101,18 +109,18 @@ const ae = (N) => {
|
|
|
101
109
|
children: b
|
|
102
110
|
}
|
|
103
111
|
),
|
|
104
|
-
|
|
112
|
+
y && /* @__PURE__ */ r(U, { variant: z, onClick: o, "aria-label": M, children: /* @__PURE__ */ r(Z, { className: "bear-w-5 bear-h-5" }) })
|
|
105
113
|
]
|
|
106
114
|
}
|
|
107
115
|
),
|
|
108
116
|
/* @__PURE__ */ r(
|
|
109
|
-
|
|
117
|
+
s,
|
|
110
118
|
{
|
|
111
119
|
className: i(
|
|
112
120
|
"bear-flex-1 bear-min-h-0 bear-p-4 bear-text-neutral-700 dark:bear-text-neutral-300",
|
|
113
|
-
|
|
121
|
+
A ? "bear-overflow-y-auto" : "bear-overflow-hidden"
|
|
114
122
|
),
|
|
115
|
-
children:
|
|
123
|
+
children: O
|
|
116
124
|
}
|
|
117
125
|
)
|
|
118
126
|
]
|
|
@@ -121,8 +129,8 @@ const ae = (N) => {
|
|
|
121
129
|
]
|
|
122
130
|
}
|
|
123
131
|
);
|
|
124
|
-
return
|
|
132
|
+
return R(L, document.body);
|
|
125
133
|
};
|
|
126
134
|
export {
|
|
127
|
-
|
|
135
|
+
be as BottomSheet
|
|
128
136
|
};
|
|
@@ -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;
|