@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
|
@@ -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;
|
|
@@ -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
|
};
|