@forgedevstack/bear 1.2.0 → 1.2.1
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 +4 -0
- package/dist/components/Autocomplete/Autocomplete.cjs +1 -1
- package/dist/components/Autocomplete/Autocomplete.const.cjs +1 -0
- package/dist/components/Autocomplete/Autocomplete.const.d.ts +1 -0
- package/dist/components/Autocomplete/Autocomplete.const.js +4 -0
- package/dist/components/Autocomplete/Autocomplete.js +110 -72
- package/dist/components/BottomSheet/BottomSheet.cjs +1 -1
- package/dist/components/BottomSheet/BottomSheet.js +74 -53
- package/dist/components/BottomSheet/BottomSheet.types.d.ts +2 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.cjs +1 -1
- package/dist/components/Breadcrumbs/Breadcrumbs.js +126 -46
- package/dist/components/Breadcrumbs/Breadcrumbs.types.d.ts +11 -4
- package/dist/components/Breadcrumbs/index.d.ts +1 -1
- package/dist/components/Cascader/Cascader.cjs +1 -1
- package/dist/components/Cascader/Cascader.const.cjs +1 -1
- package/dist/components/Cascader/Cascader.const.d.ts +1 -1
- package/dist/components/Cascader/Cascader.const.js +1 -1
- package/dist/components/Cascader/Cascader.js +109 -146
- package/dist/components/Cascader/components/CascaderPanel/CascaderPanel.cjs +1 -0
- package/dist/components/Cascader/components/CascaderPanel/CascaderPanel.d.ts +3 -0
- package/dist/components/Cascader/components/CascaderPanel/CascaderPanel.js +50 -0
- package/dist/components/Cascader/components/CascaderPanel/index.d.ts +1 -0
- package/dist/components/Chart/BarChart.cjs +1 -0
- package/dist/components/Chart/BarChart.d.ts +3 -0
- package/dist/components/Chart/BarChart.js +65 -0
- package/dist/components/Chart/Chart.cjs +1 -1
- package/dist/components/Chart/Chart.const.cjs +1 -1
- package/dist/components/Chart/Chart.const.d.ts +7 -0
- package/dist/components/Chart/Chart.const.js +12 -2
- package/dist/components/Chart/Chart.d.ts +1 -13
- package/dist/components/Chart/Chart.js +18 -204
- package/dist/components/Chart/Chart.types.d.ts +7 -1
- package/dist/components/Chart/LineChart.cjs +1 -0
- package/dist/components/Chart/LineChart.d.ts +3 -0
- package/dist/components/Chart/LineChart.js +73 -0
- package/dist/components/Chart/PieChart.cjs +1 -0
- package/dist/components/Chart/PieChart.d.ts +3 -0
- package/dist/components/Chart/PieChart.js +110 -0
- package/dist/components/Chart/index.d.ts +4 -1
- package/dist/components/ColorPicker/ColorPicker.cjs +1 -1
- package/dist/components/ColorPicker/ColorPicker.const.cjs +1 -1
- package/dist/components/ColorPicker/ColorPicker.const.d.ts +4 -2
- package/dist/components/ColorPicker/ColorPicker.const.js +8 -6
- package/dist/components/ColorPicker/ColorPicker.js +135 -73
- package/dist/components/ColorPicker/ColorPicker.utils.cjs +1 -0
- package/dist/components/ColorPicker/ColorPicker.utils.d.ts +17 -0
- package/dist/components/ColorPicker/ColorPicker.utils.js +43 -0
- package/dist/components/CountdownTimer/CountdownTimer.cjs +1 -1
- package/dist/components/CountdownTimer/CountdownTimer.const.cjs +1 -1
- package/dist/components/CountdownTimer/CountdownTimer.const.d.ts +2 -0
- package/dist/components/CountdownTimer/CountdownTimer.const.js +29 -17
- package/dist/components/CountdownTimer/CountdownTimer.js +91 -61
- package/dist/components/CountdownTimer/CountdownTimer.types.d.ts +11 -2
- package/dist/components/CreditInput/CreditInput.cjs +1 -1
- package/dist/components/CreditInput/CreditInput.js +80 -78
- package/dist/components/DateRangePicker/DateRangePicker.cjs +1 -1
- package/dist/components/DateRangePicker/DateRangePicker.js +89 -84
- package/dist/components/DiffSquares/DiffSquares.cjs +1 -0
- package/dist/components/DiffSquares/DiffSquares.const.cjs +1 -0
- package/dist/components/DiffSquares/DiffSquares.const.d.ts +3 -0
- package/dist/components/DiffSquares/DiffSquares.const.js +6 -0
- package/dist/components/DiffSquares/DiffSquares.d.ts +3 -0
- package/dist/components/DiffSquares/DiffSquares.js +70 -0
- package/dist/components/DiffSquares/DiffSquares.types.d.ts +23 -0
- package/dist/components/DiffSquares/DiffSquares.utils.cjs +1 -0
- package/dist/components/DiffSquares/DiffSquares.utils.d.ts +3 -0
- package/dist/components/DiffSquares/DiffSquares.utils.js +12 -0
- package/dist/components/DiffSquares/index.d.ts +2 -0
- package/dist/components/Drawer/Drawer.cjs +1 -1
- package/dist/components/Drawer/Drawer.js +41 -41
- package/dist/components/Dropdown/Dropdown.cjs +1 -1
- package/dist/components/Dropdown/Dropdown.const.cjs +1 -0
- package/dist/components/Dropdown/Dropdown.const.d.ts +7 -0
- package/dist/components/Dropdown/Dropdown.const.js +10 -0
- package/dist/components/Dropdown/Dropdown.d.ts +0 -1
- package/dist/components/Dropdown/Dropdown.js +102 -92
- package/dist/components/Dropdown/Dropdown.types.d.ts +2 -0
- package/dist/components/Gauge/Gauge.cjs +1 -1
- package/dist/components/Gauge/Gauge.js +61 -50
- package/dist/components/Gauge/Gauge.types.d.ts +2 -0
- package/dist/components/HoverCard/HoverCard.cjs +6 -6
- package/dist/components/HoverCard/HoverCard.js +72 -54
- package/dist/components/Icon/icons/status.js +1 -1
- package/dist/components/MentionsInput/MentionsInput.cjs +1 -1
- package/dist/components/MentionsInput/MentionsInput.js +106 -83
- package/dist/components/Menu/Menu.cjs +1 -1
- package/dist/components/Menu/Menu.js +91 -80
- 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 -1
- package/dist/components/Modal/Modal.const.js +1 -1
- package/dist/components/Modal/Modal.js +50 -44
- package/dist/components/Modal/Modal.types.d.ts +6 -0
- package/dist/components/MultiSelect/MultiSelect.cjs +1 -1
- package/dist/components/MultiSelect/MultiSelect.js +123 -78
- package/dist/components/NavigableSelect/NavigableSelect.cjs +1 -1
- package/dist/components/NavigableSelect/NavigableSelect.const.cjs +1 -1
- package/dist/components/NavigableSelect/NavigableSelect.const.d.ts +1 -1
- package/dist/components/NavigableSelect/NavigableSelect.const.js +1 -1
- package/dist/components/NavigableSelect/NavigableSelect.js +167 -143
- package/dist/components/NotificationCenter/NotificationCenter.cjs +1 -1
- package/dist/components/NotificationCenter/NotificationCenter.const.cjs +1 -1
- package/dist/components/NotificationCenter/NotificationCenter.const.d.ts +1 -1
- package/dist/components/NotificationCenter/NotificationCenter.const.js +1 -1
- package/dist/components/NotificationCenter/NotificationCenter.js +87 -81
- package/dist/components/OTPInput/OTPInput.cjs +1 -1
- package/dist/components/OTPInput/OTPInput.const.cjs +1 -0
- package/dist/components/OTPInput/OTPInput.const.d.ts +6 -0
- package/dist/components/OTPInput/OTPInput.const.js +14 -0
- package/dist/components/OTPInput/OTPInput.js +99 -65
- package/dist/components/OTPInput/OTPInput.types.d.ts +7 -0
- package/dist/components/PhoneInput/PhoneInput.cjs +1 -1
- package/dist/components/PhoneInput/PhoneInput.const.cjs +1 -1
- package/dist/components/PhoneInput/PhoneInput.const.d.ts +1 -1
- package/dist/components/PhoneInput/PhoneInput.const.js +1 -1
- package/dist/components/PhoneInput/PhoneInput.js +88 -83
- package/dist/components/Popconfirm/Popconfirm.cjs +1 -1
- package/dist/components/Popconfirm/Popconfirm.const.cjs +1 -1
- package/dist/components/Popconfirm/Popconfirm.const.d.ts +1 -3
- package/dist/components/Popconfirm/Popconfirm.const.js +12 -18
- package/dist/components/Popconfirm/Popconfirm.js +71 -51
- package/dist/components/Popover/Popover.cjs +1 -1
- package/dist/components/Popover/Popover.js +36 -31
- package/dist/components/Portal/Portal.cjs +1 -1
- package/dist/components/Portal/Portal.d.ts +0 -3
- package/dist/components/Portal/Portal.js +4 -10
- package/dist/components/Select/Select.cjs +1 -1
- package/dist/components/Select/Select.js +71 -51
- package/dist/components/Stepper/Stepper.cjs +1 -1
- package/dist/components/Stepper/Stepper.const.cjs +1 -1
- package/dist/components/Stepper/Stepper.const.d.ts +3 -2
- package/dist/components/Stepper/Stepper.const.js +15 -14
- package/dist/components/Stepper/Stepper.d.ts +0 -7
- package/dist/components/Stepper/Stepper.js +164 -117
- package/dist/components/Stepper/Stepper.types.d.ts +3 -0
- package/dist/components/Tabs/TabList.cjs +1 -1
- package/dist/components/Tabs/TabList.js +72 -57
- package/dist/components/Tabs/Tabs.types.d.ts +4 -2
- package/dist/components/Tabs/index.d.ts +2 -2
- package/dist/components/TimePicker/components/TimePickerDialDropdown/TimePickerDialDropdown.cjs +1 -1
- package/dist/components/TimePicker/components/TimePickerDialDropdown/TimePickerDialDropdown.js +26 -26
- package/dist/components/TimePicker/helpers/ClockFaceSvg.cjs +1 -1
- package/dist/components/TimePicker/helpers/ClockFaceSvg.js +17 -17
- package/dist/components/Toast/Toast.cjs +1 -1
- package/dist/components/Toast/Toast.js +86 -82
- package/dist/components/Toast/Toast.types.d.ts +2 -0
- package/dist/components/Tooltip/Tooltip.cjs +1 -1
- package/dist/components/Tooltip/Tooltip.js +52 -44
- package/dist/components/TreeSelect/TreeSelect.cjs +1 -1
- package/dist/components/TreeSelect/TreeSelect.const.cjs +1 -1
- package/dist/components/TreeSelect/TreeSelect.const.d.ts +1 -1
- package/dist/components/TreeSelect/TreeSelect.const.js +3 -3
- package/dist/components/TreeSelect/TreeSelect.js +120 -88
- package/dist/components/Watermark/Watermark.cjs +1 -1
- package/dist/components/Watermark/Watermark.const.cjs +1 -1
- package/dist/components/Watermark/Watermark.const.d.ts +6 -3
- package/dist/components/Watermark/Watermark.const.js +13 -11
- package/dist/components/Watermark/Watermark.js +87 -61
- package/dist/components/Watermark/Watermark.types.d.ts +2 -0
- package/dist/components/index.cjs +1 -1
- package/dist/components/index.d.ts +5 -3
- package/dist/components/index.js +292 -286
- package/dist/hooks/index.cjs +1 -1
- package/dist/hooks/index.d.ts +1 -1
- package/dist/hooks/index.js +55 -54
- package/dist/hooks/useClickOutside.cjs +1 -1
- package/dist/hooks/useClickOutside.d.ts +4 -11
- package/dist/hooks/useClickOutside.js +26 -7
- package/dist/index.cjs +1 -1
- package/dist/index.js +386 -379
- package/dist/styles/_effects.css +17 -0
- package/dist/styles.css +1 -1
- package/dist/utils/maxVisible.utils.cjs +1 -0
- package/dist/utils/maxVisible.utils.d.ts +12 -0
- package/dist/utils/maxVisible.utils.js +15 -0
- package/package.json +1 -1
- package/dist/components/HoverCard/HoverCard.utils.cjs +0 -1
- package/dist/components/HoverCard/HoverCard.utils.js +0 -23
|
@@ -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"),r=require("react"),k=require("../../utils/cn.cjs"),W=require("../Portal/Portal.cjs"),Z=require("./MentionsInput.utils.cjs"),G=1e4,J={sm:"bear-h-8 bear-text-sm bear-px-3",md:"bear-h-10 bear-text-base bear-px-4",lg:"bear-h-12 bear-text-lg bear-px-5"},X=({value:x,defaultValue:L="",onChange:o,onMentionSelect:w,options:O,trigger:l="@",placeholder:P="Type @ to mention...",disabled:E=!1,maxSuggestions:D=5,filterOptions:T=Z.defaultFilter,size:A="md",fullWidth:_=!1,className:$})=>{const[B,I]=r.useState(L),[d,K]=r.useState(""),[Q,f]=r.useState(!1),[u,h]=r.useState(0),[p,F]=r.useState(null),q=r.useRef(null),g=r.useRef(null),m=r.useRef(null),z=r.useRef(null),[v,H]=r.useState({top:0,left:0,width:0}),i=x??B,b=T(O,d).slice(0,D),R=Q&&d.length>=0,y=R&&b.length>0,j=r.useCallback(()=>{const e=i.lastIndexOf(l);if(e===-1)return{query:"",start:null};const t=i.slice(e+l.length),n=t.indexOf(" ");return{query:n===-1?t:t.slice(0,n),start:e}},[i,l]);r.useEffect(()=>{const{query:e,start:t}=j();K(e),F(t),f(t!==null&&!e.includes(" "))},[i,j]),r.useEffect(()=>{h(0)},[d]),r.useEffect(()=>{if(u>=0&&m.current){const e=m.current.children[u];e==null||e.scrollIntoView({block:"nearest"})}},[u]),r.useEffect(()=>{if(!y)return;const e=()=>{var n;const t=(n=g.current)==null?void 0:n.getBoundingClientRect();t&&H({top:t.bottom+4,left:Math.max(8,Math.min(t.left,window.innerWidth-t.width-8)),width:t.width})};return e(),window.addEventListener("resize",e),window.addEventListener("scroll",e,!0),()=>{window.removeEventListener("resize",e),window.removeEventListener("scroll",e,!0)}},[y]),r.useEffect(()=>{const e=t=>{var s,c;const n=t.target;(s=q.current)!=null&&s.contains(n)||(c=z.current)!=null&&c.contains(n)||f(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);const M=e=>{const t=new RegExp(`${l}(\\w+)`,"g"),n=[];let s;for(;(s=t.exec(e))!==null;)n.push(s[1]);return[...new Set(n)]},U=e=>{const t=e.target.value;x===void 0&&I(t),o==null||o(t,M(t))},N=e=>{var S;if(p==null)return;const t=i.slice(0,p),n=i.slice(p+l.length+d.length),s=`${l}${e.value}`,c=t+s+" "+n;x===void 0&&I(c),o==null||o(c,M(c)),w==null||w(e),f(!1),(S=g.current)==null||S.focus()},V=e=>{if(!(!R||b.length===0)){if(e.key==="ArrowDown"){e.preventDefault(),h(t=>Math.min(t+1,b.length-1));return}if(e.key==="ArrowUp"){e.preventDefault(),h(t=>Math.max(t-1,0));return}if(e.key==="Enter"||e.key==="Tab"){e.preventDefault();const t=b[u];t&&N(t);return}e.key==="Escape"&&f(!1)}};return a.jsxs("div",{ref:q,className:k.cn("Bear-MentionsInput bear-relative",_&&"bear-w-full",$),children:[a.jsx("input",{ref:g,type:"text",value:i,onChange:U,onKeyDown:V,placeholder:P,disabled:E,className:k.cn("bear-w-full bear-rounded-lg bear-border bear-border-gray-300 dark:bear-border-zinc-600 bear-bg-white dark:bear-bg-zinc-900 bear-text-gray-900 dark:bear-text-white placeholder:bear-text-gray-500 dark:placeholder:bear-text-zinc-500 bear-outline-none bear-transition-colors focus:bear-border-bear-500 focus:bear-ring-2 focus:bear-ring-bear-500/20",E&&"bear-opacity-50 bear-cursor-not-allowed",J[A])}),y&&a.jsx(W.Portal,{children:a.jsx("div",{ref:z,className:"bear-fixed bear-rounded-lg bear-border bear-border-gray-200 dark:bear-border-zinc-600 bear-bg-white dark:bear-bg-zinc-800 bear-shadow-lg",style:{top:v.top,left:v.left,width:v.width,zIndex:G},children:a.jsx("div",{ref:m,className:"bear-max-h-48 bear-overflow-auto bear-py-1",children:b.map((e,t)=>a.jsxs("button",{type:"button",className:k.cn("bear-w-full bear-flex bear-items-center bear-gap-2 bear-px-3 bear-py-2 bear-text-left bear-text-gray-800 dark:bear-text-zinc-200 hover:bear-bg-gray-100 dark:hover:bear-bg-zinc-700 bear-transition-colors",t===u&&"bear-bg-gray-100 dark:bear-bg-zinc-700"),onMouseEnter:()=>h(t),onClick:()=>N(e),children:[e.avatar&&a.jsx("span",{className:"bear-shrink-0",children:e.avatar}),a.jsx("span",{children:e.label})]},e.value))})})})]})};exports.MentionsInput=X;
|
|
@@ -1,136 +1,159 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { cn as
|
|
4
|
-
import {
|
|
5
|
-
|
|
1
|
+
import { jsxs as T, jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import { useState as c, useRef as p, useCallback as J, useEffect as d } from "react";
|
|
3
|
+
import { cn as z } from "../../utils/cn.js";
|
|
4
|
+
import { Portal as X } from "../Portal/Portal.js";
|
|
5
|
+
import { defaultFilter as Y } from "./MentionsInput.utils.js";
|
|
6
|
+
const C = 1e4, ee = {
|
|
6
7
|
sm: "bear-h-8 bear-text-sm bear-px-3",
|
|
7
8
|
md: "bear-h-10 bear-text-base bear-px-4",
|
|
8
9
|
lg: "bear-h-12 bear-text-lg bear-px-5"
|
|
9
|
-
},
|
|
10
|
-
value:
|
|
11
|
-
defaultValue:
|
|
12
|
-
onChange:
|
|
13
|
-
onMentionSelect:
|
|
14
|
-
options:
|
|
15
|
-
trigger:
|
|
16
|
-
placeholder:
|
|
17
|
-
disabled:
|
|
18
|
-
maxSuggestions:
|
|
19
|
-
filterOptions:
|
|
20
|
-
size:
|
|
21
|
-
fullWidth:
|
|
22
|
-
className:
|
|
10
|
+
}, oe = ({
|
|
11
|
+
value: w,
|
|
12
|
+
defaultValue: A = "",
|
|
13
|
+
onChange: s,
|
|
14
|
+
onMentionSelect: x,
|
|
15
|
+
options: $,
|
|
16
|
+
trigger: o = "@",
|
|
17
|
+
placeholder: j = "Type @ to mention...",
|
|
18
|
+
disabled: I = !1,
|
|
19
|
+
maxSuggestions: B = 5,
|
|
20
|
+
filterOptions: K = Y,
|
|
21
|
+
size: Q = "md",
|
|
22
|
+
fullWidth: S = !1,
|
|
23
|
+
className: _
|
|
23
24
|
}) => {
|
|
24
|
-
const [F,
|
|
25
|
-
const e =
|
|
25
|
+
const [F, N] = c(A), [f, H] = c(""), [U, h] = c(!1), [u, m] = c(0), [g, V] = c(null), L = p(null), v = p(null), y = p(null), q = p(null), [k, W] = c({ top: 0, left: 0, width: 0 }), a = w ?? F, b = K($, f).slice(0, B), M = U && f.length >= 0, E = M && b.length > 0, O = J(() => {
|
|
26
|
+
const e = a.lastIndexOf(o);
|
|
26
27
|
if (e === -1) return { query: "", start: null };
|
|
27
|
-
const
|
|
28
|
-
return { query:
|
|
29
|
-
}, [
|
|
30
|
-
|
|
31
|
-
const { query: e, start:
|
|
32
|
-
H(e), V(
|
|
33
|
-
}, [
|
|
34
|
-
|
|
35
|
-
}, [
|
|
36
|
-
if (
|
|
37
|
-
const e = y.current.children[
|
|
28
|
+
const t = a.slice(e + o.length), r = t.indexOf(" ");
|
|
29
|
+
return { query: r === -1 ? t : t.slice(0, r), start: e };
|
|
30
|
+
}, [a, o]);
|
|
31
|
+
d(() => {
|
|
32
|
+
const { query: e, start: t } = O();
|
|
33
|
+
H(e), V(t), h(t !== null && !e.includes(" "));
|
|
34
|
+
}, [a, O]), d(() => {
|
|
35
|
+
m(0);
|
|
36
|
+
}, [f]), d(() => {
|
|
37
|
+
if (u >= 0 && y.current) {
|
|
38
|
+
const e = y.current.children[u];
|
|
38
39
|
e == null || e.scrollIntoView({ block: "nearest" });
|
|
39
40
|
}
|
|
40
|
-
}, [
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
}, [u]), d(() => {
|
|
42
|
+
if (!E) return;
|
|
43
|
+
const e = () => {
|
|
44
|
+
var r;
|
|
45
|
+
const t = (r = v.current) == null ? void 0 : r.getBoundingClientRect();
|
|
46
|
+
t && W({
|
|
47
|
+
top: t.bottom + 4,
|
|
48
|
+
left: Math.max(8, Math.min(t.left, window.innerWidth - t.width - 8)),
|
|
49
|
+
width: t.width
|
|
50
|
+
});
|
|
51
|
+
};
|
|
52
|
+
return e(), window.addEventListener("resize", e), window.addEventListener("scroll", e, !0), () => {
|
|
53
|
+
window.removeEventListener("resize", e), window.removeEventListener("scroll", e, !0);
|
|
54
|
+
};
|
|
55
|
+
}, [E]), d(() => {
|
|
56
|
+
const e = (t) => {
|
|
57
|
+
var n, i;
|
|
58
|
+
const r = t.target;
|
|
59
|
+
(n = L.current) != null && n.contains(r) || (i = q.current) != null && i.contains(r) || h(!1);
|
|
43
60
|
};
|
|
44
61
|
return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
|
|
45
62
|
}, []);
|
|
46
|
-
const
|
|
47
|
-
const
|
|
48
|
-
let
|
|
49
|
-
for (; (
|
|
50
|
-
|
|
51
|
-
return [...new Set(
|
|
63
|
+
const R = (e) => {
|
|
64
|
+
const t = new RegExp(`${o}(\\w+)`, "g"), r = [];
|
|
65
|
+
let n;
|
|
66
|
+
for (; (n = t.exec(e)) !== null; )
|
|
67
|
+
r.push(n[1]);
|
|
68
|
+
return [...new Set(r)];
|
|
69
|
+
}, Z = (e) => {
|
|
70
|
+
const t = e.target.value;
|
|
71
|
+
w === void 0 && N(t), s == null || s(t, R(t));
|
|
72
|
+
}, D = (e) => {
|
|
73
|
+
var P;
|
|
74
|
+
if (g == null) return;
|
|
75
|
+
const t = a.slice(0, g), r = a.slice(g + o.length + f.length), n = `${o}${e.value}`, i = t + n + " " + r;
|
|
76
|
+
w === void 0 && N(i), s == null || s(i, R(i)), x == null || x(e), h(!1), (P = v.current) == null || P.focus();
|
|
52
77
|
}, G = (e) => {
|
|
53
|
-
|
|
54
|
-
p === void 0 && I(r), n == null || n(r, O(r));
|
|
55
|
-
}, N = (e) => {
|
|
56
|
-
var R;
|
|
57
|
-
if (x == null) return;
|
|
58
|
-
const r = t.slice(0, x), a = t.slice(x + s.length + i.length), c = `${s}${e.value}`, w = r + c + " " + a;
|
|
59
|
-
p === void 0 && I(w), n == null || n(w, O(w)), m == null || m(e), u(!1), (R = q.current) == null || R.focus();
|
|
60
|
-
}, J = (e) => {
|
|
61
|
-
if (!(!E || o.length === 0)) {
|
|
78
|
+
if (!(!M || b.length === 0)) {
|
|
62
79
|
if (e.key === "ArrowDown") {
|
|
63
|
-
e.preventDefault(),
|
|
80
|
+
e.preventDefault(), m((t) => Math.min(t + 1, b.length - 1));
|
|
64
81
|
return;
|
|
65
82
|
}
|
|
66
83
|
if (e.key === "ArrowUp") {
|
|
67
|
-
e.preventDefault(),
|
|
84
|
+
e.preventDefault(), m((t) => Math.max(t - 1, 0));
|
|
68
85
|
return;
|
|
69
86
|
}
|
|
70
87
|
if (e.key === "Enter" || e.key === "Tab") {
|
|
71
88
|
e.preventDefault();
|
|
72
|
-
const
|
|
73
|
-
|
|
89
|
+
const t = b[u];
|
|
90
|
+
t && D(t);
|
|
74
91
|
return;
|
|
75
92
|
}
|
|
76
|
-
e.key === "Escape" &&
|
|
93
|
+
e.key === "Escape" && h(!1);
|
|
77
94
|
}
|
|
78
95
|
};
|
|
79
|
-
return /* @__PURE__ */
|
|
96
|
+
return /* @__PURE__ */ T(
|
|
80
97
|
"div",
|
|
81
98
|
{
|
|
82
|
-
ref:
|
|
83
|
-
className:
|
|
99
|
+
ref: L,
|
|
100
|
+
className: z(
|
|
84
101
|
"Bear-MentionsInput bear-relative",
|
|
85
|
-
|
|
86
|
-
|
|
102
|
+
S && "bear-w-full",
|
|
103
|
+
_
|
|
87
104
|
),
|
|
88
105
|
children: [
|
|
89
|
-
/* @__PURE__ */
|
|
106
|
+
/* @__PURE__ */ l(
|
|
90
107
|
"input",
|
|
91
108
|
{
|
|
92
|
-
ref:
|
|
109
|
+
ref: v,
|
|
93
110
|
type: "text",
|
|
94
|
-
value:
|
|
95
|
-
onChange:
|
|
96
|
-
onKeyDown:
|
|
97
|
-
placeholder:
|
|
98
|
-
disabled:
|
|
99
|
-
className:
|
|
111
|
+
value: a,
|
|
112
|
+
onChange: Z,
|
|
113
|
+
onKeyDown: G,
|
|
114
|
+
placeholder: j,
|
|
115
|
+
disabled: I,
|
|
116
|
+
className: z(
|
|
100
117
|
"bear-w-full bear-rounded-lg bear-border bear-border-gray-300 dark:bear-border-zinc-600 bear-bg-white dark:bear-bg-zinc-900 bear-text-gray-900 dark:bear-text-white placeholder:bear-text-gray-500 dark:placeholder:bear-text-zinc-500 bear-outline-none bear-transition-colors focus:bear-border-bear-500 focus:bear-ring-2 focus:bear-ring-bear-500/20",
|
|
101
|
-
|
|
102
|
-
|
|
118
|
+
I && "bear-opacity-50 bear-cursor-not-allowed",
|
|
119
|
+
ee[Q]
|
|
103
120
|
)
|
|
104
121
|
}
|
|
105
122
|
),
|
|
106
|
-
E &&
|
|
123
|
+
E && /* @__PURE__ */ l(X, { children: /* @__PURE__ */ l(
|
|
107
124
|
"div",
|
|
108
125
|
{
|
|
109
|
-
ref:
|
|
110
|
-
className: "bear-
|
|
111
|
-
|
|
126
|
+
ref: q,
|
|
127
|
+
className: "bear-fixed bear-rounded-lg bear-border bear-border-gray-200 dark:bear-border-zinc-600 bear-bg-white dark:bear-bg-zinc-800 bear-shadow-lg",
|
|
128
|
+
style: {
|
|
129
|
+
top: k.top,
|
|
130
|
+
left: k.left,
|
|
131
|
+
width: k.width,
|
|
132
|
+
zIndex: C
|
|
133
|
+
},
|
|
134
|
+
children: /* @__PURE__ */ l("div", { ref: y, className: "bear-max-h-48 bear-overflow-auto bear-py-1", children: b.map((e, t) => /* @__PURE__ */ T(
|
|
112
135
|
"button",
|
|
113
136
|
{
|
|
114
137
|
type: "button",
|
|
115
|
-
className:
|
|
138
|
+
className: z(
|
|
116
139
|
"bear-w-full bear-flex bear-items-center bear-gap-2 bear-px-3 bear-py-2 bear-text-left bear-text-gray-800 dark:bear-text-zinc-200 hover:bear-bg-gray-100 dark:hover:bear-bg-zinc-700 bear-transition-colors",
|
|
117
|
-
|
|
140
|
+
t === u && "bear-bg-gray-100 dark:bear-bg-zinc-700"
|
|
118
141
|
),
|
|
119
|
-
onMouseEnter: () =>
|
|
120
|
-
onClick: () =>
|
|
142
|
+
onMouseEnter: () => m(t),
|
|
143
|
+
onClick: () => D(e),
|
|
121
144
|
children: [
|
|
122
|
-
e.avatar && /* @__PURE__ */
|
|
123
|
-
/* @__PURE__ */
|
|
145
|
+
e.avatar && /* @__PURE__ */ l("span", { className: "bear-shrink-0", children: e.avatar }),
|
|
146
|
+
/* @__PURE__ */ l("span", { children: e.label })
|
|
124
147
|
]
|
|
125
148
|
},
|
|
126
149
|
e.value
|
|
127
|
-
))
|
|
150
|
+
)) })
|
|
128
151
|
}
|
|
129
|
-
)
|
|
152
|
+
) })
|
|
130
153
|
]
|
|
131
154
|
}
|
|
132
155
|
);
|
|
133
156
|
};
|
|
134
157
|
export {
|
|
135
|
-
|
|
158
|
+
oe as MentionsInput
|
|
136
159
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),g=require("react"),p=require("../../utils/cn.cjs"),j=require("../Portal/Portal.cjs"),L=12e3,N=({icon:t,disabled:r=!1,selected:n=!1,divider:l=!1,children:f,onClick:a,className:d,testId:v,...y})=>o.jsxs(o.Fragment,{children:[o.jsxs("div",{role:"menuitem",tabIndex:r?-1:0,className:p.cn("bear-flex bear-items-center bear-gap-3 bear-px-4 bear-py-2 bear-cursor-pointer bear-transition-colors","hover:bear-bg-gray-100 dark:hover:bear-bg-gray-700","focus:bear-outline-none focus:bear-bg-gray-100 dark:focus:bear-bg-gray-700",n&&"bear-bg-pink-50 dark:bear-bg-pink-900/20 bear-text-pink-600",r&&"bear-opacity-50 bear-cursor-not-allowed hover:bear-bg-transparent",d),onClick:r?void 0:a,onKeyDown:m=>{(m.key==="Enter"||m.key===" ")&&!r&&(a==null||a())},"data-testid":v,...y,children:[t&&o.jsx("span",{className:"bear-flex-shrink-0 bear-text-gray-500",children:t}),o.jsx("span",{className:"bear-flex-1 bear-text-sm",children:f})]}),l&&o.jsx(h,{})]}),h=({className:t})=>o.jsx("div",{className:p.cn("bear-h-px bear-bg-gray-200 dark:bear-bg-gray-700 bear-my-1",t)}),R=({open:t=!1,anchorEl:r,onClose:n,children:l,position:f="bottom-start",minWidth:a=180,maxHeight:d=300,className:v,testId:y,...m})=>{const c=g.useRef(null),[x,M]=g.useState({top:0,left:0});return g.useLayoutEffect(()=>{if(!t||!r)return;const s=()=>{const e=r.getBoundingClientRect(),k=c.current,w=k?k.offsetHeight:Math.min(d,200);let u=0,i=0;switch(f){case"bottom-start":u=e.bottom+4,i=e.left;break;case"bottom-end":u=e.bottom+4,i=e.right-a;break;case"top-start":u=e.top-w-4,i=e.left;break;case"top-end":u=e.top-w-4,i=e.right-a;break}i=Math.max(8,Math.min(i,window.innerWidth-a-8));const E=window.innerHeight-w-8;u=Math.max(8,Math.min(u,E)),M({top:u,left:i})};s();const b=c.current&&typeof ResizeObserver<"u"?new ResizeObserver(s):null;return c.current&&b&&b.observe(c.current),window.addEventListener("resize",s),window.addEventListener("scroll",s,!0),()=>{b==null||b.disconnect(),window.removeEventListener("resize",s),window.removeEventListener("scroll",s,!0)}},[t,r,f,a,d]),g.useEffect(()=>{if(!t)return;const s=e=>{c.current&&!c.current.contains(e.target)&&r&&!r.contains(e.target)&&(n==null||n())},b=e=>{e.key==="Escape"&&(n==null||n())};return document.addEventListener("mousedown",s),document.addEventListener("keydown",b),()=>{document.removeEventListener("mousedown",s),document.removeEventListener("keydown",b)}},[t,r,n]),t?o.jsx(j.Portal,{children:o.jsx("div",{ref:c,role:"menu",className:p.cn("bear-fixed bear-bg-white dark:bear-bg-gray-800","bear-border bear-border-gray-200 dark:bear-border-gray-700","bear-rounded-lg bear-shadow-lg bear-py-1","bear-overflow-y-auto",v),style:{top:x.top,left:x.left,minWidth:a,maxHeight:d,zIndex:L},"data-testid":y,...m,children:l})}):null};exports.Menu=R;exports.MenuDivider=h;exports.MenuItem=N;
|
|
@@ -1,111 +1,122 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useRef as
|
|
3
|
-
import { cn as
|
|
4
|
-
|
|
1
|
+
import { jsx as c, jsxs as x, Fragment as L } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as M, useState as N, useLayoutEffect as z, useEffect as R } from "react";
|
|
3
|
+
import { cn as y } from "../../utils/cn.js";
|
|
4
|
+
import { Portal as I } from "../Portal/Portal.js";
|
|
5
|
+
const D = 12e3, H = ({
|
|
5
6
|
icon: t,
|
|
6
|
-
disabled:
|
|
7
|
-
selected:
|
|
8
|
-
divider:
|
|
9
|
-
children:
|
|
10
|
-
onClick:
|
|
11
|
-
className:
|
|
12
|
-
testId:
|
|
13
|
-
...
|
|
14
|
-
}) => /* @__PURE__ */
|
|
15
|
-
/* @__PURE__ */
|
|
7
|
+
disabled: r = !1,
|
|
8
|
+
selected: n = !1,
|
|
9
|
+
divider: g = !1,
|
|
10
|
+
children: f,
|
|
11
|
+
onClick: a,
|
|
12
|
+
className: u,
|
|
13
|
+
testId: l,
|
|
14
|
+
...p
|
|
15
|
+
}) => /* @__PURE__ */ x(L, { children: [
|
|
16
|
+
/* @__PURE__ */ x(
|
|
16
17
|
"div",
|
|
17
18
|
{
|
|
18
19
|
role: "menuitem",
|
|
19
|
-
tabIndex:
|
|
20
|
-
className:
|
|
20
|
+
tabIndex: r ? -1 : 0,
|
|
21
|
+
className: y(
|
|
21
22
|
"bear-flex bear-items-center bear-gap-3 bear-px-4 bear-py-2 bear-cursor-pointer bear-transition-colors",
|
|
22
23
|
"hover:bear-bg-gray-100 dark:hover:bear-bg-gray-700",
|
|
23
24
|
"focus:bear-outline-none focus:bear-bg-gray-100 dark:focus:bear-bg-gray-700",
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
n && "bear-bg-pink-50 dark:bear-bg-pink-900/20 bear-text-pink-600",
|
|
26
|
+
r && "bear-opacity-50 bear-cursor-not-allowed hover:bear-bg-transparent",
|
|
27
|
+
u
|
|
27
28
|
),
|
|
28
|
-
onClick:
|
|
29
|
-
onKeyDown: (
|
|
30
|
-
(
|
|
29
|
+
onClick: r ? void 0 : a,
|
|
30
|
+
onKeyDown: (m) => {
|
|
31
|
+
(m.key === "Enter" || m.key === " ") && !r && (a == null || a());
|
|
31
32
|
},
|
|
32
|
-
"data-testid":
|
|
33
|
-
...
|
|
33
|
+
"data-testid": l,
|
|
34
|
+
...p,
|
|
34
35
|
children: [
|
|
35
|
-
t && /* @__PURE__ */
|
|
36
|
-
/* @__PURE__ */
|
|
36
|
+
t && /* @__PURE__ */ c("span", { className: "bear-flex-shrink-0 bear-text-gray-500", children: t }),
|
|
37
|
+
/* @__PURE__ */ c("span", { className: "bear-flex-1 bear-text-sm", children: f })
|
|
37
38
|
]
|
|
38
39
|
}
|
|
39
40
|
),
|
|
40
|
-
|
|
41
|
-
] }),
|
|
41
|
+
g && /* @__PURE__ */ c(O, {})
|
|
42
|
+
] }), O = ({ className: t }) => /* @__PURE__ */ c("div", { className: y("bear-h-px bear-bg-gray-200 dark:bear-bg-gray-700 bear-my-1", t) }), K = ({
|
|
42
43
|
open: t = !1,
|
|
43
|
-
anchorEl:
|
|
44
|
-
onClose:
|
|
45
|
-
children:
|
|
46
|
-
position:
|
|
47
|
-
minWidth:
|
|
48
|
-
maxHeight:
|
|
49
|
-
className:
|
|
50
|
-
testId:
|
|
51
|
-
...
|
|
44
|
+
anchorEl: r,
|
|
45
|
+
onClose: n,
|
|
46
|
+
children: g,
|
|
47
|
+
position: f = "bottom-start",
|
|
48
|
+
minWidth: a = 180,
|
|
49
|
+
maxHeight: u = 300,
|
|
50
|
+
className: l,
|
|
51
|
+
testId: p,
|
|
52
|
+
...m
|
|
52
53
|
}) => {
|
|
53
|
-
const
|
|
54
|
-
return
|
|
55
|
-
if (!t || !
|
|
56
|
-
const
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
54
|
+
const b = M(null), [w, h] = N({ top: 0, left: 0 });
|
|
55
|
+
return z(() => {
|
|
56
|
+
if (!t || !r) return;
|
|
57
|
+
const s = () => {
|
|
58
|
+
const e = r.getBoundingClientRect(), k = b.current, v = k ? k.offsetHeight : Math.min(u, 200);
|
|
59
|
+
let d = 0, i = 0;
|
|
60
|
+
switch (f) {
|
|
61
|
+
case "bottom-start":
|
|
62
|
+
d = e.bottom + 4, i = e.left;
|
|
63
|
+
break;
|
|
64
|
+
case "bottom-end":
|
|
65
|
+
d = e.bottom + 4, i = e.right - a;
|
|
66
|
+
break;
|
|
67
|
+
case "top-start":
|
|
68
|
+
d = e.top - v - 4, i = e.left;
|
|
69
|
+
break;
|
|
70
|
+
case "top-end":
|
|
71
|
+
d = e.top - v - 4, i = e.right - a;
|
|
72
|
+
break;
|
|
73
|
+
}
|
|
74
|
+
i = Math.max(8, Math.min(i, window.innerWidth - a - 8));
|
|
75
|
+
const E = window.innerHeight - v - 8;
|
|
76
|
+
d = Math.max(8, Math.min(d, E)), h({ top: d, left: i });
|
|
77
|
+
};
|
|
78
|
+
s();
|
|
79
|
+
const o = b.current && typeof ResizeObserver < "u" ? new ResizeObserver(s) : null;
|
|
80
|
+
return b.current && o && o.observe(b.current), window.addEventListener("resize", s), window.addEventListener("scroll", s, !0), () => {
|
|
81
|
+
o == null || o.disconnect(), window.removeEventListener("resize", s), window.removeEventListener("scroll", s, !0);
|
|
82
|
+
};
|
|
83
|
+
}, [t, r, f, a, u]), R(() => {
|
|
74
84
|
if (!t) return;
|
|
75
|
-
const
|
|
76
|
-
|
|
77
|
-
},
|
|
78
|
-
|
|
85
|
+
const s = (e) => {
|
|
86
|
+
b.current && !b.current.contains(e.target) && r && !r.contains(e.target) && (n == null || n());
|
|
87
|
+
}, o = (e) => {
|
|
88
|
+
e.key === "Escape" && (n == null || n());
|
|
79
89
|
};
|
|
80
|
-
return document.addEventListener("mousedown",
|
|
81
|
-
document.removeEventListener("mousedown",
|
|
90
|
+
return document.addEventListener("mousedown", s), document.addEventListener("keydown", o), () => {
|
|
91
|
+
document.removeEventListener("mousedown", s), document.removeEventListener("keydown", o);
|
|
82
92
|
};
|
|
83
|
-
}, [t,
|
|
93
|
+
}, [t, r, n]), t ? /* @__PURE__ */ c(I, { children: /* @__PURE__ */ c(
|
|
84
94
|
"div",
|
|
85
95
|
{
|
|
86
|
-
ref:
|
|
96
|
+
ref: b,
|
|
87
97
|
role: "menu",
|
|
88
|
-
className:
|
|
89
|
-
"bear-fixed bear-
|
|
98
|
+
className: y(
|
|
99
|
+
"bear-fixed bear-bg-white dark:bear-bg-gray-800",
|
|
90
100
|
"bear-border bear-border-gray-200 dark:bear-border-gray-700",
|
|
91
101
|
"bear-rounded-lg bear-shadow-lg bear-py-1",
|
|
92
102
|
"bear-overflow-y-auto",
|
|
93
|
-
|
|
103
|
+
l
|
|
94
104
|
),
|
|
95
105
|
style: {
|
|
96
|
-
top:
|
|
97
|
-
left:
|
|
98
|
-
minWidth:
|
|
99
|
-
maxHeight:
|
|
106
|
+
top: w.top,
|
|
107
|
+
left: w.left,
|
|
108
|
+
minWidth: a,
|
|
109
|
+
maxHeight: u,
|
|
110
|
+
zIndex: D
|
|
100
111
|
},
|
|
101
|
-
"data-testid":
|
|
102
|
-
...
|
|
103
|
-
children:
|
|
112
|
+
"data-testid": p,
|
|
113
|
+
...m,
|
|
114
|
+
children: g
|
|
104
115
|
}
|
|
105
|
-
) : null;
|
|
116
|
+
) }) : null;
|
|
106
117
|
};
|
|
107
118
|
export {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
119
|
+
K as Menu,
|
|
120
|
+
O as MenuDivider,
|
|
121
|
+
H as MenuItem
|
|
111
122
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),S=require("react"),h=require("react-dom"),o=require("../../utils/cn.cjs"),y=require("../Icon/icons/navigation.cjs"),a=require("./Modal.const.cjs"),k=_=>{const{isOpen:c,onClose:l,title:r,children:m,size:C="md",showCloseButton:t=!0,closeOnEscape:n=!0,lockBodyScroll:b=!0,cancelPreventScroll:E=!1,closeOnBackdrop:L=!0,isCancelBackgroundClick:d,className:M,footer:i,testId:A,id:O}=_,u=b&&!E,v=d!==void 0?d:L,s=S.useCallback(f=>{n&&f.key==="Escape"&&l()},[n,l]);if(S.useEffect(()=>{if(c)return document.addEventListener("keydown",s),u&&(document.body.style.overflow="hidden"),()=>{document.removeEventListener("keydown",s),document.body.style.overflow=""}},[c,s,u]),!c)return null;const B=e.jsxs("div",{className:"Bear-Modal bear-fixed bear-inset-0 bear-z-[11000] bear-flex bear-items-center bear-justify-center bear-p-4",id:O,"data-testid":A,children:[e.jsx("div",{className:o.cn("Bear-Modal__backdrop",a.MODAL_BACKDROP_CLASSES),onClick:v?l:void 0,"aria-hidden":"true"}),e.jsxs("div",{role:"dialog","aria-modal":"true","aria-labelledby":r?"modal-title":void 0,className:o.cn("Bear-Modal__container",a.MODAL_CONTAINER_CLASSES,a.MODAL_SIZE_CLASSES[C],M),children:[(r||t)&&e.jsxs("div",{className:o.cn("Bear-Modal__header",a.MODAL_HEADER_CLASSES),children:[r&&e.jsx("h2",{id:"modal-title",className:o.cn("Bear-Modal__title",a.MODAL_TITLE_CLASSES),children:r}),t&&e.jsx("button",{onClick:l,className:o.cn("Bear-Modal__close",a.MODAL_CLOSE_CLASSES),"aria-label":"Close modal",children:e.jsx(y.CloseIcon,{className:"bear-w-5 bear-h-5"})})]}),e.jsx("div",{className:o.cn("Bear-Modal__body",a.MODAL_BODY_CLASSES),children:m}),i&&e.jsx("div",{className:o.cn("Bear-Modal__footer",a.MODAL_FOOTER_CLASSES),children:i})]})]});return h.createPortal(B,document.body)};exports.Modal=k;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r={sm:"bear-max-w-sm",md:"bear-max-w-md",lg:"bear-max-w-lg",xl:"bear-max-w-xl",full:"bear-max-w-full bear-mx-4"},e="bear-absolute bear-inset-0 bear-bg-black/60 bear-backdrop-blur-sm bear-transition-opacity",a="bear-relative bear-w-full 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 bear-animate-in bear-fade-in bear-zoom-in-95",b="bear-flex bear-items-center bear-justify-between bear-px-6 bear-py-4 bear-border-b bear-border-gray-200 dark:bear-border-zinc-700",t="bear-text-lg bear-font-semibold bear-text-gray-900 dark:bear-text-white",S="bear-p-1 bear-rounded-lg bear-text-gray-400 dark:bear-text-zinc-500 hover:bear-text-gray-600 dark:hover:bear-text-white hover:bear-bg-gray-100 dark:hover:bear-bg-zinc-700 bear-transition-colors",o="bear-px-6 bear-py-4 bear-text-gray-600 dark:bear-text-gray-300",A="bear-flex bear-items-center bear-justify-end bear-gap-3 bear-px-6 bear-py-4 bear-border-t bear-border-gray-200 dark:bear-border-zinc-700";exports.MODAL_BACKDROP_CLASSES=e;exports.MODAL_BODY_CLASSES=o;exports.MODAL_CLOSE_CLASSES=S;exports.MODAL_CONTAINER_CLASSES=a;exports.MODAL_FOOTER_CLASSES=A;exports.MODAL_HEADER_CLASSES=b;exports.MODAL_SIZE_CLASSES=r;exports.MODAL_TITLE_CLASSES=t;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r={sm:"bear-max-w-sm",md:"bear-max-w-md",lg:"bear-max-w-lg",xl:"bear-max-w-xl",full:"bear-max-w-full bear-mx-4"},e="bear-absolute bear-inset-0 bear-bg-black/60 bear-backdrop-blur-sm bear-transition-opacity",a="bear-relative bear-w-full bear-max-h-[calc(100vh-2rem)] bear-overflow-y-auto 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 bear-animate-in bear-fade-in bear-zoom-in-95",b="bear-flex bear-items-center bear-justify-between bear-px-6 bear-py-4 bear-border-b bear-border-gray-200 dark:bear-border-zinc-700",t="bear-text-lg bear-font-semibold bear-text-gray-900 dark:bear-text-white",S="bear-p-1 bear-rounded-lg bear-text-gray-400 dark:bear-text-zinc-500 hover:bear-text-gray-600 dark:hover:bear-text-white hover:bear-bg-gray-100 dark:hover:bear-bg-zinc-700 bear-transition-colors",o="bear-px-6 bear-py-4 bear-text-gray-600 dark:bear-text-gray-300",A="bear-flex bear-items-center bear-justify-end bear-gap-3 bear-px-6 bear-py-4 bear-border-t bear-border-gray-200 dark:bear-border-zinc-700";exports.MODAL_BACKDROP_CLASSES=e;exports.MODAL_BODY_CLASSES=o;exports.MODAL_CLOSE_CLASSES=S;exports.MODAL_CONTAINER_CLASSES=a;exports.MODAL_FOOTER_CLASSES=A;exports.MODAL_HEADER_CLASSES=b;exports.MODAL_SIZE_CLASSES=r;exports.MODAL_TITLE_CLASSES=t;
|
|
@@ -2,7 +2,7 @@ import { ModalSize } from './Modal.types';
|
|
|
2
2
|
export declare const MODAL_Z_INDEX = 50;
|
|
3
3
|
export declare const MODAL_SIZE_CLASSES: Record<ModalSize, string>;
|
|
4
4
|
export declare const MODAL_BACKDROP_CLASSES = "bear-absolute bear-inset-0 bear-bg-black/60 bear-backdrop-blur-sm bear-transition-opacity";
|
|
5
|
-
export declare const MODAL_CONTAINER_CLASSES = "bear-relative bear-w-full 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 bear-animate-in bear-fade-in bear-zoom-in-95";
|
|
5
|
+
export declare const MODAL_CONTAINER_CLASSES = "bear-relative bear-w-full bear-max-h-[calc(100vh-2rem)] bear-overflow-y-auto 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 bear-animate-in bear-fade-in bear-zoom-in-95";
|
|
6
6
|
export declare const MODAL_HEADER_CLASSES = "bear-flex bear-items-center bear-justify-between bear-px-6 bear-py-4 bear-border-b bear-border-gray-200 dark:bear-border-zinc-700";
|
|
7
7
|
export declare const MODAL_TITLE_CLASSES = "bear-text-lg bear-font-semibold bear-text-gray-900 dark:bear-text-white";
|
|
8
8
|
export declare const MODAL_CLOSE_CLASSES = "bear-p-1 bear-rounded-lg bear-text-gray-400 dark:bear-text-zinc-500 hover:bear-text-gray-600 dark:hover:bear-text-white hover:bear-bg-gray-100 dark:hover:bear-bg-zinc-700 bear-transition-colors";
|
|
@@ -4,7 +4,7 @@ const r = {
|
|
|
4
4
|
lg: "bear-max-w-lg",
|
|
5
5
|
xl: "bear-max-w-xl",
|
|
6
6
|
full: "bear-max-w-full bear-mx-4"
|
|
7
|
-
}, e = "bear-absolute bear-inset-0 bear-bg-black/60 bear-backdrop-blur-sm bear-transition-opacity", a = "bear-relative bear-w-full 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 bear-animate-in bear-fade-in bear-zoom-in-95", b = "bear-flex bear-items-center bear-justify-between bear-px-6 bear-py-4 bear-border-b bear-border-gray-200 dark:bear-border-zinc-700", t = "bear-text-lg bear-font-semibold bear-text-gray-900 dark:bear-text-white", o = "bear-p-1 bear-rounded-lg bear-text-gray-400 dark:bear-text-zinc-500 hover:bear-text-gray-600 dark:hover:bear-text-white hover:bear-bg-gray-100 dark:hover:bear-bg-zinc-700 bear-transition-colors", n = "bear-px-6 bear-py-4 bear-text-gray-600 dark:bear-text-gray-300", d = "bear-flex bear-items-center bear-justify-end bear-gap-3 bear-px-6 bear-py-4 bear-border-t bear-border-gray-200 dark:bear-border-zinc-700";
|
|
7
|
+
}, e = "bear-absolute bear-inset-0 bear-bg-black/60 bear-backdrop-blur-sm bear-transition-opacity", a = "bear-relative bear-w-full bear-max-h-[calc(100vh-2rem)] bear-overflow-y-auto 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 bear-animate-in bear-fade-in bear-zoom-in-95", b = "bear-flex bear-items-center bear-justify-between bear-px-6 bear-py-4 bear-border-b bear-border-gray-200 dark:bear-border-zinc-700", t = "bear-text-lg bear-font-semibold bear-text-gray-900 dark:bear-text-white", o = "bear-p-1 bear-rounded-lg bear-text-gray-400 dark:bear-text-zinc-500 hover:bear-text-gray-600 dark:hover:bear-text-white hover:bear-bg-gray-100 dark:hover:bear-bg-zinc-700 bear-transition-colors", n = "bear-px-6 bear-py-4 bear-text-gray-600 dark:bear-text-gray-300", d = "bear-flex bear-items-center bear-justify-end bear-gap-3 bear-px-6 bear-py-4 bear-border-t bear-border-gray-200 dark:bear-border-zinc-700";
|
|
8
8
|
export {
|
|
9
9
|
e as MODAL_BACKDROP_CLASSES,
|
|
10
10
|
n as MODAL_BODY_CLASSES,
|