@forgedevstack/bear 1.2.6 → 1.2.7
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 +6 -2
- package/dist/components/AppBar/AppBar.cjs +1 -1
- package/dist/components/AppBar/AppBar.js +37 -36
- package/dist/components/Autocomplete/Autocomplete.cjs +1 -1
- package/dist/components/Autocomplete/Autocomplete.js +32 -32
- package/dist/components/Backdrop/Backdrop.cjs +1 -1
- package/dist/components/Backdrop/Backdrop.const.cjs +1 -1
- package/dist/components/Backdrop/Backdrop.const.d.ts +2 -1
- package/dist/components/Backdrop/Backdrop.const.js +4 -3
- package/dist/components/Backdrop/Backdrop.js +36 -29
- package/dist/components/Backdrop/Backdrop.types.d.ts +2 -0
- package/dist/components/Button/Button.cjs +1 -1
- package/dist/components/Button/Button.js +48 -48
- package/dist/components/Chip/Chip.cjs +1 -1
- package/dist/components/Chip/Chip.const.cjs +1 -1
- package/dist/components/Chip/Chip.const.d.ts +10 -0
- package/dist/components/Chip/Chip.const.js +11 -1
- package/dist/components/Chip/Chip.js +24 -22
- 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 +6 -3
- package/dist/components/ChipGroup/ChipGroup.const.js +6 -3
- package/dist/components/ChipGroup/ChipGroup.js +83 -29
- package/dist/components/ChipGroup/ChipGroup.types.d.ts +5 -0
- package/dist/components/Drawer/Drawer.cjs +1 -1
- package/dist/components/Drawer/Drawer.js +57 -54
- package/dist/components/EmptyState/EmptyState.cjs +1 -1
- package/dist/components/EmptyState/EmptyState.const.cjs +1 -0
- package/dist/components/EmptyState/EmptyState.const.d.ts +26 -1
- package/dist/components/EmptyState/EmptyState.const.js +29 -0
- package/dist/components/EmptyState/EmptyState.js +49 -31
- package/dist/components/Input/Input.cjs +1 -1
- package/dist/components/Input/Input.const.cjs +1 -1
- package/dist/components/Input/Input.const.d.ts +10 -0
- package/dist/components/Input/Input.const.js +16 -6
- package/dist/components/Input/Input.js +96 -96
- package/dist/components/MessageList/MessageList.cjs +1 -1
- package/dist/components/MessageList/MessageList.js +98 -92
- package/dist/components/MessageList/MessageList.types.d.ts +2 -0
- package/dist/components/Modal/Modal.cjs +1 -1
- package/dist/components/Modal/Modal.const.cjs +1 -1
- package/dist/components/Modal/Modal.const.js +7 -8
- package/dist/components/Modal/Modal.js +60 -55
- package/dist/components/PageHeader/PageHeader.cjs +1 -0
- package/dist/components/PageHeader/PageHeader.const.cjs +1 -0
- package/dist/components/PageHeader/PageHeader.const.d.ts +6 -0
- package/dist/components/PageHeader/PageHeader.const.js +9 -0
- package/dist/components/PageHeader/PageHeader.d.ts +3 -0
- package/dist/components/PageHeader/PageHeader.js +57 -0
- package/dist/components/PageHeader/PageHeader.types.d.ts +10 -0
- package/dist/components/PageHeader/index.d.ts +2 -0
- package/dist/components/Select/Select.cjs +1 -1
- package/dist/components/Select/Select.js +108 -99
- package/dist/components/Select/Select.types.d.ts +3 -1
- package/dist/components/Snackbar/Snackbar.cjs +1 -1
- package/dist/components/Snackbar/Snackbar.js +62 -60
- package/dist/components/Snackbar/Snackbar.types.d.ts +2 -0
- package/dist/components/Tabs/Tabs.cjs +1 -1
- package/dist/components/Tabs/Tabs.const.cjs +1 -0
- package/dist/components/Tabs/Tabs.const.d.ts +2 -0
- package/dist/components/Tabs/Tabs.const.js +5 -0
- package/dist/components/Tabs/Tabs.js +40 -35
- package/dist/components/Tabs/Tabs.types.d.ts +1 -0
- package/dist/components/Toast/Toast.cjs +1 -1
- package/dist/components/Toast/Toast.const.cjs +1 -1
- package/dist/components/Toast/Toast.const.js +7 -15
- package/dist/components/Toast/Toast.js +99 -95
- package/dist/components/index.cjs +1 -1
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.js +267 -265
- package/dist/context/BearProvider.js +1 -1
- package/dist/hooks/index.cjs +1 -1
- package/dist/hooks/index.d.ts +3 -0
- package/dist/hooks/index.js +45 -41
- package/dist/hooks/useBreakpoint/index.d.ts +4 -0
- package/dist/hooks/useBreakpoint/useBreakpoint.cjs +1 -0
- package/dist/hooks/useBreakpoint/useBreakpoint.const.cjs +1 -0
- package/dist/hooks/useBreakpoint/useBreakpoint.const.d.ts +8 -0
- package/dist/hooks/useBreakpoint/useBreakpoint.const.js +10 -0
- package/dist/hooks/useBreakpoint/useBreakpoint.d.ts +2 -0
- package/dist/hooks/useBreakpoint/useBreakpoint.js +26 -0
- package/dist/hooks/useBreakpoint/useBreakpoint.types.d.ts +12 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +446 -431
- package/dist/styles.css +0 -4
- package/dist/utils/generateBearId.const.cjs +1 -1
- package/dist/utils/generateBearId.const.d.ts +4 -2
- package/dist/utils/generateBearId.const.js +6 -4
- package/dist/utils/generateBearId.utils.cjs +1 -1
- package/dist/utils/generateBearId.utils.js +33 -21
- package/dist/utils/index.cjs +1 -1
- package/dist/utils/index.d.ts +4 -1
- package/dist/utils/index.js +27 -18
- package/dist/utils/liveRegion.const.cjs +1 -0
- package/dist/utils/liveRegion.const.d.ts +5 -0
- package/dist/utils/liveRegion.const.js +17 -0
- package/dist/utils/liveRegion.utils.cjs +1 -0
- package/dist/utils/liveRegion.utils.d.ts +7 -0
- package/dist/utils/liveRegion.utils.js +10 -0
- package/dist/utils/useBearId.cjs +1 -1
- package/dist/utils/useBearId.js +5 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @forgedevstack/bear
|
|
2
2
|
|
|
3
|
-
Strong, reliable React UI components.
|
|
3
|
+
Strong, reliable React UI components. AeroCraft-powered, zero config required. The protective force of ForgeStack.
|
|
4
4
|
|
|
5
5
|
## Portal
|
|
6
6
|
|
|
@@ -19,7 +19,11 @@ cd portal && npm run test:e2e:smoke
|
|
|
19
19
|
cd portal && npm run test:e2e
|
|
20
20
|
```
|
|
21
21
|
|
|
22
|
-
`BEAR_E2E_SMOKE=1` runs `e2e/specs/smoke.spec.ts` only. The e2e webServer builds Bear, then starts the portal on port `5174`.
|
|
22
|
+
`BEAR_E2E_SMOKE=1` runs `e2e/specs/smoke.spec.ts` only (includes RTL direction + Toast aria-live checks). The e2e webServer builds Bear, then starts the portal on port `5174`.
|
|
23
|
+
|
|
24
|
+
### Auto DOM ids
|
|
25
|
+
|
|
26
|
+
Public components generate root `id` values as `Bear-{Component}-{alphanumeric}` (e.g. `Bear-Button-a48293100123`). Pass `id` to override; keep `testId` on `data-testid`.
|
|
23
27
|
|
|
24
28
|
## Features
|
|
25
29
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const A=require("react/jsx-runtime"),_=require("./AppBar.const.cjs"),N=require("../../context/BearProvider.cjs");require("../../context/defaultTheme.cjs");const e=require("../../utils/cn.cjs");require("react");const l=require("../../utils/generateBearId.utils.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const A=require("react/jsx-runtime"),_=require("./AppBar.const.cjs"),N=require("../../context/BearProvider.cjs");require("../../context/defaultTheme.cjs");const e=require("../../utils/cn.cjs");require("react");const l=require("../../utils/generateBearId.utils.cjs"),u=require("../../utils/useBearId.cjs"),D=P=>{const{children:t,position:n=_.DEFAULT_APP_BAR_POSITION,variant:s=_.DEFAULT_APP_BAR_VARIANT,color:r=_.DEFAULT_APP_BAR_COLOR,className:E,leftContent:B,rightContent:R,centerContent:a,elevation:i=_.DEFAULT_APP_BAR_ELEVATION,dense:C,disableGutters:c=_.DEFAULT_APP_BAR_DISABLE_GUTTERS,enableColorOnDark:o=_.DEFAULT_APP_BAR_ENABLE_COLOR_ON_DARK,id:O,testId:T}=P,{density:d}=N.useBearDensityOptional(),S=C??d==="compact",L=u.useBearId("AppBar"),I=l.resolveBearId(O,L);return A.jsx("header",{id:I,"data-testid":T,className:e.cn(_.APP_BAR_ROOT_CLASS,_.APP_BAR_BASE_CLASS,S?_.APP_BAR_HEIGHT_DENSE:_.APP_BAR_HEIGHT_COMFORTABLE,!c&&(S?_.APP_BAR_GUTTER_X_DENSE:_.APP_BAR_GUTTER_X),_.APP_BAR_POSITION_CLASSES[n],_.APP_BAR_VARIANT_CLASSES[s],_.APP_BAR_COLOR_CLASSES[r],o&&r==="default"&&_.APP_BAR_COLOR_ON_DARK_CLASS,i&&_.APP_BAR_ELEVATION_CLASS,S&&_.APP_BAR_DENSE_MODIFIER_CLASS,E),style:{backgroundColor:r==="primary"?"var(--bear-primary-600)":void 0},children:t??A.jsxs(A.Fragment,{children:[A.jsx("div",{className:e.cn(_.APP_BAR_SECTION_CLASS,_.APP_BAR_SECTION_BASE_CLASS),children:B}),A.jsx("div",{className:e.cn(_.APP_BAR_SECTION_CLASS,_.APP_BAR_SECTION_CENTER_CLASS,_.APP_BAR_SECTION_BASE_CLASS,_.APP_BAR_SECTION_GROW_CLASS),children:a}),A.jsx("div",{className:e.cn(_.APP_BAR_SECTION_CLASS,_.APP_BAR_SECTION_END_CLASS,_.APP_BAR_SECTION_BASE_CLASS),children:R})]})})};exports.AppBar=D;
|
|
@@ -1,71 +1,72 @@
|
|
|
1
|
-
import { jsx as _, jsxs as
|
|
2
|
-
import { DEFAULT_APP_BAR_POSITION as
|
|
3
|
-
import { useBearDensityOptional as
|
|
1
|
+
import { jsx as _, jsxs as m, Fragment as I } from "react/jsx-runtime";
|
|
2
|
+
import { DEFAULT_APP_BAR_POSITION as p, DEFAULT_APP_BAR_VARIANT as D, DEFAULT_APP_BAR_COLOR as v, DEFAULT_APP_BAR_ELEVATION as F, DEFAULT_APP_BAR_DISABLE_GUTTERS as U, DEFAULT_APP_BAR_ENABLE_COLOR_ON_DARK as f, APP_BAR_SECTION_BASE_CLASS as P, APP_BAR_SECTION_CLASS as t, APP_BAR_SECTION_GROW_CLASS as h, APP_BAR_SECTION_CENTER_CLASS as G, APP_BAR_SECTION_END_CLASS as u, APP_BAR_DENSE_MODIFIER_CLASS as y, APP_BAR_ELEVATION_CLASS as b, APP_BAR_COLOR_ON_DARK_CLASS as g, APP_BAR_COLOR_CLASSES as H, APP_BAR_VARIANT_CLASSES as V, APP_BAR_POSITION_CLASSES as x, APP_BAR_GUTTER_X_DENSE as j, APP_BAR_GUTTER_X as k, APP_BAR_HEIGHT_DENSE as K, APP_BAR_HEIGHT_COMFORTABLE as M, APP_BAR_BASE_CLASS as X, APP_BAR_ROOT_CLASS as W } from "./AppBar.const.js";
|
|
3
|
+
import { useBearDensityOptional as q } from "../../context/BearProvider.js";
|
|
4
4
|
import "../../context/defaultTheme.js";
|
|
5
5
|
import { cn as A } from "../../utils/cn.js";
|
|
6
6
|
import "react";
|
|
7
|
-
import {
|
|
8
|
-
|
|
7
|
+
import { resolveBearId as w } from "../../utils/generateBearId.utils.js";
|
|
8
|
+
import { useBearId as z } from "../../utils/useBearId.js";
|
|
9
|
+
const r_ = (S) => {
|
|
9
10
|
const {
|
|
10
|
-
children:
|
|
11
|
-
position:
|
|
12
|
-
variant:
|
|
13
|
-
color:
|
|
11
|
+
children: o,
|
|
12
|
+
position: E = p,
|
|
13
|
+
variant: R = D,
|
|
14
|
+
color: e = v,
|
|
14
15
|
className: a,
|
|
15
16
|
leftContent: n,
|
|
16
|
-
rightContent:
|
|
17
|
-
centerContent:
|
|
18
|
-
elevation:
|
|
17
|
+
rightContent: s,
|
|
18
|
+
centerContent: i,
|
|
19
|
+
elevation: B = F,
|
|
19
20
|
dense: C,
|
|
20
21
|
disableGutters: O = U,
|
|
21
|
-
enableColorOnDark: L =
|
|
22
|
+
enableColorOnDark: L = f,
|
|
22
23
|
id: T,
|
|
23
24
|
testId: d
|
|
24
|
-
} =
|
|
25
|
+
} = S, { density: N } = q(), r = C ?? N === "compact", c = z("AppBar"), l = w(T, c);
|
|
25
26
|
return /* @__PURE__ */ _(
|
|
26
27
|
"header",
|
|
27
28
|
{
|
|
28
|
-
id:
|
|
29
|
+
id: l,
|
|
29
30
|
"data-testid": d,
|
|
30
31
|
className: A(
|
|
32
|
+
W,
|
|
31
33
|
X,
|
|
32
|
-
M,
|
|
33
|
-
|
|
34
|
-
|
|
34
|
+
r ? K : M,
|
|
35
|
+
!O && (r ? j : k),
|
|
36
|
+
x[E],
|
|
35
37
|
V[R],
|
|
36
|
-
H[
|
|
37
|
-
g
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
e && u,
|
|
38
|
+
H[e],
|
|
39
|
+
L && e === "default" && g,
|
|
40
|
+
B && b,
|
|
41
|
+
r && y,
|
|
41
42
|
a
|
|
42
43
|
),
|
|
43
44
|
style: {
|
|
44
|
-
backgroundColor:
|
|
45
|
+
backgroundColor: e === "primary" ? "var(--bear-primary-600)" : void 0
|
|
45
46
|
},
|
|
46
|
-
children:
|
|
47
|
-
/* @__PURE__ */ _("div", { className: A(
|
|
47
|
+
children: o ?? /* @__PURE__ */ m(I, { children: [
|
|
48
|
+
/* @__PURE__ */ _("div", { className: A(t, P), children: n }),
|
|
48
49
|
/* @__PURE__ */ _(
|
|
49
50
|
"div",
|
|
50
51
|
{
|
|
51
52
|
className: A(
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
53
|
+
t,
|
|
54
|
+
G,
|
|
55
|
+
P,
|
|
56
|
+
h
|
|
56
57
|
),
|
|
57
|
-
children:
|
|
58
|
+
children: i
|
|
58
59
|
}
|
|
59
60
|
),
|
|
60
61
|
/* @__PURE__ */ _(
|
|
61
62
|
"div",
|
|
62
63
|
{
|
|
63
64
|
className: A(
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
65
|
+
t,
|
|
66
|
+
u,
|
|
67
|
+
P
|
|
67
68
|
),
|
|
68
|
-
children:
|
|
69
|
+
children: s
|
|
69
70
|
}
|
|
70
71
|
)
|
|
71
72
|
] })
|
|
@@ -73,5 +74,5 @@ const __ = (t) => {
|
|
|
73
74
|
);
|
|
74
75
|
};
|
|
75
76
|
export {
|
|
76
|
-
|
|
77
|
+
r_ as AppBar
|
|
77
78
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),a=require("react"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),a=require("react"),m=require("../../utils/cn.cjs"),D=require("../Portal/Portal.cjs"),V=require("./Autocomplete.utils.cjs"),M=require("./Autocomplete.const.cjs"),C=({options:z,value:b="",onChange:i,onSelect:x,placeholder:I="Start typing...",label:v,helperText:j,error:u,disabled:f=!1,freeSolo:k=!1,loading:E=!1,filterOptions:q=V.defaultFilter,className:_,testId:B})=>{const[c,s]=a.useState(!1),[n,h]=a.useState(-1),[l,T]=a.useState({top:0,left:0,width:0}),N=a.useRef(null),P=a.useRef(null),p=a.useRef(null),A=a.useRef(null),w=a.useRef(null),o=q(z,b),g=c&&!f&&o.length>0,y=c&&!f&&o.length===0&&!!b&&!E;a.useEffect(()=>{if(!g&&!y)return;const e=()=>{var d;const r=(d=P.current)==null?void 0:d.getBoundingClientRect();r&&T({top:r.bottom+4,left:Math.max(8,Math.min(r.left,window.innerWidth-r.width-8)),width:r.width})};return e(),window.addEventListener("resize",e),window.addEventListener("scroll",e,!0),()=>{window.removeEventListener("resize",e),window.removeEventListener("scroll",e,!0)}},[g,y]),a.useEffect(()=>{if(!c)return;const e=r=>{var R,O;const d=r.target;(R=N.current)!=null&&R.contains(d)||(O=p.current)!=null&&O.contains(d)||s(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[c]),a.useEffect(()=>{h(-1)},[b]),a.useEffect(()=>{if(n>=0&&w.current){const e=w.current.children[n];e&&e.scrollIntoView({block:"nearest"})}},[n]);const U=e=>{const r=e.target.value;i==null||i(r),s(!0)},L=e=>{var r;i==null||i(e.label),x==null||x(e),s(!1),(r=A.current)==null||r.blur()},W=e=>{if(!c){(e.key==="ArrowDown"||e.key==="ArrowUp")&&(s(!0),e.preventDefault());return}switch(e.key){case"ArrowDown":e.preventDefault(),h(r=>r<o.length-1?r+1:0);break;case"ArrowUp":e.preventDefault(),h(r=>r>0?r-1:o.length-1);break;case"Enter":e.preventDefault(),n>=0&&o[n]?L(o[n]):k&&b&&s(!1);break;case"Escape":s(!1);break}};return t.jsxs("div",{className:m.cn("bear-w-full bear-relative",_),ref:N,"data-testid":B,children:[v&&t.jsx("label",{className:"bear-block bear-text-sm bear-font-medium bear-text-gray-700 dark:bear-text-gray-200 bear-mb-1.5",children:v}),t.jsxs("div",{className:"bear-relative",ref:P,children:[t.jsx("input",{ref:A,type:"text",value:b,onChange:U,onFocus:()=>s(!0),onKeyDown:W,placeholder:I,disabled:f,className:m.cn("bear-w-full bear-px-4 bear-py-2.5 bear-pr-10 bear-rounded-lg bear-border","bear-bg-[var(--bear-bg-primary)]","bear-text-sm bear-text-[var(--bear-text-primary)]","placeholder:bear-text-[var(--bear-text-muted)]","bear-transition-colors bear-outline-none",u?"bear-border-red-500 focus:bear-ring-2 focus:bear-ring-red-500/20":"bear-border-[var(--bear-border-default)] focus:bear-border-amber-500 focus:bear-ring-2 focus:bear-ring-amber-500/20",f&&"bear-opacity-50 bear-cursor-not-allowed bear-bg-[var(--bear-bg-secondary)]")}),t.jsx("div",{className:"bear-absolute bear-right-3 bear-top-1/2 bear-transform bear--translate-y-1/2",children:E?t.jsxs("svg",{className:"bear-animate-spin bear-w-4 bear-h-4 bear-text-gray-400",viewBox:"0 0 24 24",fill:"none",children:[t.jsx("circle",{className:"bear-opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),t.jsx("path",{className:"bear-opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}):t.jsx("svg",{className:"bear-w-4 bear-h-4 bear-text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})})})]}),g&&t.jsx(D.Portal,{children:t.jsx("div",{ref:p,className:"bear-fixed bear-rounded-lg bear-border bear-border-[var(--bear-border-default)] bear-shadow-lg bear-bg-[var(--bear-bg-primary)]",style:{top:l.top,left:l.left,width:l.width,zIndex:M.AUTOCOMPLETE_PANEL_Z},children:t.jsx("div",{ref:w,className:"bear-max-h-60 bear-overflow-auto bear-py-1",children:o.map((e,r)=>t.jsxs("button",{type:"button",disabled:e.disabled,onClick:()=>L(e),className:m.cn("bear-w-full bear-px-4 bear-py-2 bear-text-left bear-text-sm bear-transition-colors","bear-text-[var(--bear-text-primary)]",r===n?"bear-bg-[var(--bear-bg-tertiary)]":"hover:bear-bg-[var(--bear-bg-secondary)]",e.disabled&&"bear-opacity-50 bear-cursor-not-allowed"),children:[t.jsx("div",{className:"bear-font-medium",children:e.label}),e.description&&t.jsx("div",{className:"bear-text-xs bear-text-[var(--bear-text-muted)] bear-mt-0.5",children:e.description})]},e.value))})})}),y&&t.jsx(D.Portal,{children:t.jsx("div",{ref:p,className:"bear-fixed bear-py-3 bear-px-4 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-text-sm bear-text-gray-500",style:{top:l.top,left:l.left,width:l.width,zIndex:M.AUTOCOMPLETE_PANEL_Z},children:k?"Press Enter to use this value":"No results found"})}),(j||u)&&t.jsx("p",{className:m.cn("bear-mt-1.5 bear-text-xs",u?"bear-text-red-500":"bear-text-gray-500 dark:bear-text-gray-400"),children:u||j})]})};exports.Autocomplete=C;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as m, jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import { useState as N, useRef as c, useEffect as
|
|
3
|
-
import { cn as
|
|
2
|
+
import { useState as N, useRef as c, useEffect as p } from "react";
|
|
3
|
+
import { cn as h } from "../../utils/cn.js";
|
|
4
4
|
import { Portal as B } from "../Portal/Portal.js";
|
|
5
5
|
import { defaultFilter as T } from "./Autocomplete.utils.js";
|
|
6
6
|
import { AUTOCOMPLETE_PANEL_Z as W } from "./Autocomplete.const.js";
|
|
@@ -20,9 +20,9 @@ const Y = ({
|
|
|
20
20
|
className: F,
|
|
21
21
|
testId: H
|
|
22
22
|
}) => {
|
|
23
|
-
const [l, a] = N(!1), [n,
|
|
24
|
-
|
|
25
|
-
if (!
|
|
23
|
+
const [l, a] = N(!1), [n, x] = N(-1), [i, K] = N({ top: 0, left: 0, width: 0 }), D = c(null), z = c(null), g = c(null), I = c(null), y = c(null), s = V(j, b), v = l && !f && s.length > 0, k = l && !f && s.length === 0 && !!b && !A;
|
|
24
|
+
p(() => {
|
|
25
|
+
if (!v && !k) return;
|
|
26
26
|
const e = () => {
|
|
27
27
|
var d;
|
|
28
28
|
const r = (d = z.current) == null ? void 0 : d.getBoundingClientRect();
|
|
@@ -35,19 +35,19 @@ const Y = ({
|
|
|
35
35
|
return e(), window.addEventListener("resize", e), window.addEventListener("scroll", e, !0), () => {
|
|
36
36
|
window.removeEventListener("resize", e), window.removeEventListener("scroll", e, !0);
|
|
37
37
|
};
|
|
38
|
-
}, [
|
|
38
|
+
}, [v, k]), p(() => {
|
|
39
39
|
if (!l) return;
|
|
40
40
|
const e = (r) => {
|
|
41
41
|
var M, O;
|
|
42
42
|
const d = r.target;
|
|
43
|
-
(M = D.current) != null && M.contains(d) || (O =
|
|
43
|
+
(M = D.current) != null && M.contains(d) || (O = g.current) != null && O.contains(d) || a(!1);
|
|
44
44
|
};
|
|
45
45
|
return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
|
|
46
|
-
}, [l]),
|
|
47
|
-
|
|
48
|
-
}, [b]),
|
|
49
|
-
if (n >= 0 &&
|
|
50
|
-
const e =
|
|
46
|
+
}, [l]), p(() => {
|
|
47
|
+
x(-1);
|
|
48
|
+
}, [b]), p(() => {
|
|
49
|
+
if (n >= 0 && y.current) {
|
|
50
|
+
const e = y.current.children[n];
|
|
51
51
|
e && e.scrollIntoView({ block: "nearest" });
|
|
52
52
|
}
|
|
53
53
|
}, [n]);
|
|
@@ -64,12 +64,12 @@ const Y = ({
|
|
|
64
64
|
}
|
|
65
65
|
switch (e.key) {
|
|
66
66
|
case "ArrowDown":
|
|
67
|
-
e.preventDefault(),
|
|
67
|
+
e.preventDefault(), x(
|
|
68
68
|
(r) => r < s.length - 1 ? r + 1 : 0
|
|
69
69
|
);
|
|
70
70
|
break;
|
|
71
71
|
case "ArrowUp":
|
|
72
|
-
e.preventDefault(),
|
|
72
|
+
e.preventDefault(), x(
|
|
73
73
|
(r) => r > 0 ? r - 1 : s.length - 1
|
|
74
74
|
);
|
|
75
75
|
break;
|
|
@@ -81,7 +81,7 @@ const Y = ({
|
|
|
81
81
|
break;
|
|
82
82
|
}
|
|
83
83
|
};
|
|
84
|
-
return /* @__PURE__ */ m("div", { className:
|
|
84
|
+
return /* @__PURE__ */ m("div", { className: h("bear-w-full bear-relative", F), ref: D, "data-testid": H, children: [
|
|
85
85
|
E && /* @__PURE__ */ t("label", { className: "bear-block bear-text-sm bear-font-medium bear-text-gray-700 dark:bear-text-gray-200 bear-mb-1.5", children: E }),
|
|
86
86
|
/* @__PURE__ */ m("div", { className: "bear-relative", ref: z, children: [
|
|
87
87
|
/* @__PURE__ */ t(
|
|
@@ -95,14 +95,14 @@ const Y = ({
|
|
|
95
95
|
onKeyDown: C,
|
|
96
96
|
placeholder: U,
|
|
97
97
|
disabled: f,
|
|
98
|
-
className:
|
|
98
|
+
className: h(
|
|
99
99
|
"bear-w-full bear-px-4 bear-py-2.5 bear-pr-10 bear-rounded-lg bear-border",
|
|
100
|
-
"bear-bg-
|
|
101
|
-
"bear-text-sm bear-text-
|
|
102
|
-
"placeholder:bear-text-
|
|
100
|
+
"bear-bg-[var(--bear-bg-primary)]",
|
|
101
|
+
"bear-text-sm bear-text-[var(--bear-text-primary)]",
|
|
102
|
+
"placeholder:bear-text-[var(--bear-text-muted)]",
|
|
103
103
|
"bear-transition-colors bear-outline-none",
|
|
104
|
-
u ? "bear-border-red-500 focus:bear-ring-2 focus:bear-ring-red-500/20" : "bear-border-
|
|
105
|
-
f && "bear-opacity-50 bear-cursor-not-allowed bear-bg-
|
|
104
|
+
u ? "bear-border-red-500 focus:bear-ring-2 focus:bear-ring-red-500/20" : "bear-border-[var(--bear-border-default)] focus:bear-border-amber-500 focus:bear-ring-2 focus:bear-ring-amber-500/20",
|
|
105
|
+
f && "bear-opacity-50 bear-cursor-not-allowed bear-bg-[var(--bear-bg-secondary)]"
|
|
106
106
|
)
|
|
107
107
|
}
|
|
108
108
|
),
|
|
@@ -111,42 +111,42 @@ const Y = ({
|
|
|
111
111
|
/* @__PURE__ */ t("path", { className: "bear-opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z" })
|
|
112
112
|
] }) : /* @__PURE__ */ t("svg", { className: "bear-w-4 bear-h-4 bear-text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ t("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z" }) }) })
|
|
113
113
|
] }),
|
|
114
|
-
|
|
114
|
+
v && /* @__PURE__ */ t(B, { children: /* @__PURE__ */ t(
|
|
115
115
|
"div",
|
|
116
116
|
{
|
|
117
|
-
ref:
|
|
118
|
-
className: "bear-fixed bear-rounded-lg bear-border bear-border-
|
|
117
|
+
ref: g,
|
|
118
|
+
className: "bear-fixed bear-rounded-lg bear-border bear-border-[var(--bear-border-default)] bear-shadow-lg bear-bg-[var(--bear-bg-primary)]",
|
|
119
119
|
style: {
|
|
120
120
|
top: i.top,
|
|
121
121
|
left: i.left,
|
|
122
122
|
width: i.width,
|
|
123
123
|
zIndex: W
|
|
124
124
|
},
|
|
125
|
-
children: /* @__PURE__ */ t("div", { ref:
|
|
125
|
+
children: /* @__PURE__ */ t("div", { ref: y, className: "bear-max-h-60 bear-overflow-auto bear-py-1", children: s.map((e, r) => /* @__PURE__ */ m(
|
|
126
126
|
"button",
|
|
127
127
|
{
|
|
128
128
|
type: "button",
|
|
129
129
|
disabled: e.disabled,
|
|
130
130
|
onClick: () => R(e),
|
|
131
|
-
className:
|
|
131
|
+
className: h(
|
|
132
132
|
"bear-w-full bear-px-4 bear-py-2 bear-text-left bear-text-sm bear-transition-colors",
|
|
133
|
-
"bear-text-
|
|
134
|
-
r === n ? "bear-bg-
|
|
133
|
+
"bear-text-[var(--bear-text-primary)]",
|
|
134
|
+
r === n ? "bear-bg-[var(--bear-bg-tertiary)]" : "hover:bear-bg-[var(--bear-bg-secondary)]",
|
|
135
135
|
e.disabled && "bear-opacity-50 bear-cursor-not-allowed"
|
|
136
136
|
),
|
|
137
137
|
children: [
|
|
138
138
|
/* @__PURE__ */ t("div", { className: "bear-font-medium", children: e.label }),
|
|
139
|
-
e.description && /* @__PURE__ */ t("div", { className: "bear-text-xs bear-text-
|
|
139
|
+
e.description && /* @__PURE__ */ t("div", { className: "bear-text-xs bear-text-[var(--bear-text-muted)] bear-mt-0.5", children: e.description })
|
|
140
140
|
]
|
|
141
141
|
},
|
|
142
142
|
e.value
|
|
143
143
|
)) })
|
|
144
144
|
}
|
|
145
145
|
) }),
|
|
146
|
-
|
|
146
|
+
k && /* @__PURE__ */ t(B, { children: /* @__PURE__ */ t(
|
|
147
147
|
"div",
|
|
148
148
|
{
|
|
149
|
-
ref:
|
|
149
|
+
ref: g,
|
|
150
150
|
className: "bear-fixed bear-py-3 bear-px-4 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-text-sm bear-text-gray-500",
|
|
151
151
|
style: {
|
|
152
152
|
top: i.top,
|
|
@@ -157,7 +157,7 @@ const Y = ({
|
|
|
157
157
|
children: P ? "Press Enter to use this value" : "No results found"
|
|
158
158
|
}
|
|
159
159
|
) }),
|
|
160
|
-
(L || u) && /* @__PURE__ */ t("p", { className:
|
|
160
|
+
(L || u) && /* @__PURE__ */ t("p", { className: h(
|
|
161
161
|
"bear-mt-1.5 bear-text-xs",
|
|
162
162
|
u ? "bear-text-red-500" : "bear-text-gray-500 dark:bear-text-gray-400"
|
|
163
163
|
), children: u || L })
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const D=require("react/jsx-runtime"),e=require("./Backdrop.const.cjs"),I=require("../../utils/cn.cjs");require("react");const O=require("../../utils/generateBearId.utils.cjs"),R=require("../../utils/useBearId.cjs"),E=s=>{const{id:n,testId:i,open:r=!0,invisible:a=!1,blur:o=!1,zIndex:d=e.BACKDROP_DEFAULT_Z_INDEX,transitionDuration:S=e.BACKDROP_DEFAULT_TRANSITION_MS,keepMounted:c=!1,onClick:u,children:t,className:_,style:B,...l}=s,A=R.useBearId("Backdrop"),C=O.resolveBearId(n,A);return!r&&!c&&!t?null:D.jsx("div",{...l,id:C,"data-testid":i,"aria-hidden":!r,onClick:u,className:I.cn(e.BACKDROP_ROOT_CLASS,e.BACKDROP_BASE_CLASSES,r?e.BACKDROP_VISIBLE_CLASSES:e.BACKDROP_HIDDEN_CLASSES,!a&&e.BACKDROP_TINT_CLASSES,o&&e.BACKDROP_BLUR_CLASSES,_),style:{zIndex:d,transitionDuration:`${S}ms`,...B},children:t})};exports.Backdrop=E;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S="Bear-Backdrop",e=11e3,A="bear-fixed bear-inset-0 bear-flex bear-items-center bear-justify-center bear-transition-opacity
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S="Bear-Backdrop",e=11e3,A=200,_="bear-fixed bear-inset-0 bear-flex bear-items-center bear-justify-center bear-transition-opacity",t="bear-opacity-100 bear-pointer-events-auto",C="bear-opacity-0 bear-pointer-events-none",r="bear-bg-black/50 dark:bear-bg-black/60",a="bear-backdrop-blur-sm";exports.BACKDROP_BASE_CLASSES=_;exports.BACKDROP_BLUR_CLASSES=a;exports.BACKDROP_DEFAULT_TRANSITION_MS=A;exports.BACKDROP_DEFAULT_Z_INDEX=e;exports.BACKDROP_HIDDEN_CLASSES=C;exports.BACKDROP_ROOT_CLASS=S;exports.BACKDROP_TINT_CLASSES=r;exports.BACKDROP_VISIBLE_CLASSES=t;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export declare const BACKDROP_ROOT_CLASS = "Bear-Backdrop";
|
|
2
2
|
export declare const BACKDROP_DEFAULT_Z_INDEX = 11000;
|
|
3
|
-
export declare const
|
|
3
|
+
export declare const BACKDROP_DEFAULT_TRANSITION_MS = 200;
|
|
4
|
+
export declare const BACKDROP_BASE_CLASSES = "bear-fixed bear-inset-0 bear-flex bear-items-center bear-justify-center bear-transition-opacity";
|
|
4
5
|
export declare const BACKDROP_VISIBLE_CLASSES = "bear-opacity-100 bear-pointer-events-auto";
|
|
5
6
|
export declare const BACKDROP_HIDDEN_CLASSES = "bear-opacity-0 bear-pointer-events-none";
|
|
6
7
|
export declare const BACKDROP_TINT_CLASSES = "bear-bg-black/50 dark:bear-bg-black/60";
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
const e = "Bear-Backdrop", a = 11e3, r = "bear-fixed bear-inset-0 bear-flex bear-items-center bear-justify-center bear-transition-opacity
|
|
1
|
+
const e = "Bear-Backdrop", a = 11e3, r = 200, t = "bear-fixed bear-inset-0 bear-flex bear-items-center bear-justify-center bear-transition-opacity", S = "bear-opacity-100 bear-pointer-events-auto", b = "bear-opacity-0 bear-pointer-events-none", n = "bear-bg-black/50 dark:bear-bg-black/60", o = "bear-backdrop-blur-sm";
|
|
2
2
|
export {
|
|
3
|
-
|
|
3
|
+
t as BACKDROP_BASE_CLASSES,
|
|
4
4
|
o as BACKDROP_BLUR_CLASSES,
|
|
5
|
+
r as BACKDROP_DEFAULT_TRANSITION_MS,
|
|
5
6
|
a as BACKDROP_DEFAULT_Z_INDEX,
|
|
6
7
|
b as BACKDROP_HIDDEN_CLASSES,
|
|
7
8
|
e as BACKDROP_ROOT_CLASS,
|
|
8
9
|
n as BACKDROP_TINT_CLASSES,
|
|
9
|
-
|
|
10
|
+
S as BACKDROP_VISIBLE_CLASSES
|
|
10
11
|
};
|
|
@@ -1,43 +1,50 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { BACKDROP_DEFAULT_Z_INDEX as
|
|
3
|
-
import { cn as
|
|
1
|
+
import { jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import { BACKDROP_DEFAULT_Z_INDEX as I, BACKDROP_DEFAULT_TRANSITION_MS as c, BACKDROP_BLUR_CLASSES as p, BACKDROP_TINT_CLASSES as E, BACKDROP_VISIBLE_CLASSES as O, BACKDROP_HIDDEN_CLASSES as R, BACKDROP_BASE_CLASSES as L, BACKDROP_ROOT_CLASS as f } from "./Backdrop.const.js";
|
|
3
|
+
import { cn as u } from "../../utils/cn.js";
|
|
4
4
|
import "react";
|
|
5
|
-
import { resolveBearId as
|
|
6
|
-
import { useBearId as
|
|
7
|
-
const
|
|
5
|
+
import { resolveBearId as K } from "../../utils/generateBearId.utils.js";
|
|
6
|
+
import { useBearId as P } from "../../utils/useBearId.js";
|
|
7
|
+
const b = (t) => {
|
|
8
8
|
const {
|
|
9
|
-
id:
|
|
10
|
-
testId:
|
|
9
|
+
id: o,
|
|
10
|
+
testId: i,
|
|
11
11
|
open: r = !0,
|
|
12
|
-
invisible:
|
|
13
|
-
blur:
|
|
14
|
-
zIndex:
|
|
15
|
-
|
|
12
|
+
invisible: s = !1,
|
|
13
|
+
blur: n = !1,
|
|
14
|
+
zIndex: S = I,
|
|
15
|
+
transitionDuration: a = c,
|
|
16
|
+
keepMounted: d = !1,
|
|
17
|
+
onClick: A,
|
|
16
18
|
children: e,
|
|
17
|
-
className:
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
className: _,
|
|
20
|
+
style: m,
|
|
21
|
+
...B
|
|
22
|
+
} = t, C = P("Backdrop"), D = K(o, C);
|
|
23
|
+
return !r && !d && !e ? null : /* @__PURE__ */ l(
|
|
21
24
|
"div",
|
|
22
25
|
{
|
|
23
|
-
...
|
|
24
|
-
id:
|
|
25
|
-
"data-testid":
|
|
26
|
+
...B,
|
|
27
|
+
id: D,
|
|
28
|
+
"data-testid": i,
|
|
26
29
|
"aria-hidden": !r,
|
|
27
|
-
onClick:
|
|
28
|
-
className:
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
r ?
|
|
32
|
-
!
|
|
33
|
-
|
|
34
|
-
|
|
30
|
+
onClick: A,
|
|
31
|
+
className: u(
|
|
32
|
+
f,
|
|
33
|
+
L,
|
|
34
|
+
r ? O : R,
|
|
35
|
+
!s && E,
|
|
36
|
+
n && p,
|
|
37
|
+
_
|
|
35
38
|
),
|
|
36
|
-
style: {
|
|
39
|
+
style: {
|
|
40
|
+
zIndex: S,
|
|
41
|
+
transitionDuration: `${a}ms`,
|
|
42
|
+
...m
|
|
43
|
+
},
|
|
37
44
|
children: e
|
|
38
45
|
}
|
|
39
46
|
);
|
|
40
47
|
};
|
|
41
48
|
export {
|
|
42
|
-
|
|
49
|
+
b as Backdrop
|
|
43
50
|
};
|
|
@@ -6,6 +6,8 @@ export interface BackdropProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onC
|
|
|
6
6
|
invisible?: boolean;
|
|
7
7
|
blur?: boolean;
|
|
8
8
|
zIndex?: number;
|
|
9
|
+
transitionDuration?: number;
|
|
10
|
+
keepMounted?: boolean;
|
|
9
11
|
onClick?: (event: MouseEvent<HTMLDivElement>) => void;
|
|
10
12
|
children?: ReactNode;
|
|
11
13
|
className?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),B=require("react"),l=require("../../utils/cn.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),B=require("react"),l=require("../../utils/cn.cjs"),Te=require("../../utils/generateBearId.utils.cjs"),Se=require("../../utils/useBearId.cjs"),Ce=require("../Spinner/Spinner.cjs"),z=require("../Typography/Typography.cjs"),Me=require("../../hooks/useBearStyles.cjs");require("../../hooks/useBearComponent/useBearComponent.cjs");const P=require("../../context/BearProvider.cjs");require("../FormControl/FormControl.context.cjs");const n=require("./Button.constants.cjs"),D=require("./Button.utils.cjs"),$e=require("./useSpotlight.cjs"),L=B.forwardRef((Z,d)=>{var U,V;const{variant:e="primary",size:o="md",loading:c=!1,loadingText:m,fullWidth:F=!1,icon:p,iconPosition:T="left",leftIcon:Y,rightIcon:H,textVariant:S="inherit",iconOnly:W=!1,radius:X="default",ripple:G=!1,disableRipple:J=!1,disableElevation:K=!1,href:u,component:Q="button",tooltip:ee,compact:te,gradient:b,gradientDirection:C=135,prefix:M,suffix:$,spotlight:j=!1,spotlightColor:re="rgba(255, 255, 255, 0.35)",spotlightSize:f=150,disabled:ne,className:ae,children:oe,id:ie,testId:se,bis:le,style:ce,onMouseMove:ue,onMouseEnter:be,onMouseLeave:de,onClick:_,...pe}=Z,fe=Se.useBearId("Button"),ge=Te.resolveBearId(ie,fe),{density:he}=P.useBearDensityOptional(),Be=te??he==="compact",O=G&&!J,x=ne||c,v=Me.useBearStyles(le,ce),q=Y??(p&&T==="left"?p:void 0),R=H??(p&&T==="right"?p:void 0),[w,E]=B.useState(null),me=r=>{if(O){const g=r.currentTarget.getBoundingClientRect(),h=Math.max(g.width,g.height)*2;E({width:h,height:h,left:r.clientX-g.left-h/2,top:r.clientY-g.top-h/2}),setTimeout(()=>E(null),600)}_==null||_(r)},i=B.useContext(P.BearContext),y=((V=(U=i==null?void 0:i.components)==null?void 0:U.Button)==null?void 0:V.root)||{},k=(i==null?void 0:i.customVariants)||{},N=!D.isBuiltInVariant(e)&&e in k,a=N?k[e]:null,{spotlightRef:_e,position:A,isHovered:xe,handlers:I}=$e.useSpotlight({enabled:j,onMouseMove:ue,onMouseEnter:be,onMouseLeave:de}),s=n.VARIANT_DEFAULTS[e]||n.VARIANT_DEFAULTS.primary,ve=B.useMemo(()=>N&&a?{backgroundColor:`var(--bear-${e}-bg, ${a.bg})`,color:a.text||"#ffffff",borderColor:a.border,"--bear-ring-color":a.ring||a.bg,...y,...v}:{backgroundColor:b?void 0:`var(--bear-btn-${e}-bg, ${s.bg})`,background:b?`linear-gradient(${C}deg, ${b[0]}, ${b[1]})`:void 0,color:e==="outline"||e==="ghost"?`var(--bear-btn-${e}-text, ${s.text||"inherit"})`:"white",borderColor:e==="outline"?`var(--bear-btn-${e}-border, ${s.border||s.bg})`:void 0,"--bear-ring-color":`var(--bear-btn-${e}-ring, ${s.ring})`,...y,...v},[e,s,y,v,N,a,b,C]),ye=r=>{_e.current=r,typeof d=="function"?d(r):d&&(d.current=r)},Ne=u?"a":Q,Ie=u?{href:x?void 0:u}:{};return t.jsxs(Ne,{ref:ye,id:ge,disabled:u?void 0:x,"aria-disabled":u&&x?!0:void 0,"aria-busy":c||void 0,style:ve,title:ee,className:l.cn("Bear-Button","bear-inline-flex bear-items-center bear-justify-center bear-font-medium bear-transition-all bear-duration-200 bear-outline-none bear-relative bear-overflow-hidden",!K&&"bear-shadow-sm",n.BUTTON_RADIUS[X],W?n.BUTTON_ICON_ONLY_SIZE[o]:Be?n.BUTTON_COMPACT_SIZE[o]:n.BUTTON_SIZE[o],D.isBuiltInVariant(e)?n.BUTTON_VARIANT[e]:"bear-btn-custom bear-text-white focus:bear-ring-2 focus:bear-ring-offset-2 disabled:bear-opacity-50 disabled:bear-cursor-not-allowed hover:bear-brightness-110 active:bear-brightness-95",F&&"bear-w-full",c&&"bear-cursor-wait",ae),"data-testid":se,onClick:me,onMouseMove:I.handleMouseMove,onMouseEnter:I.handleMouseEnter,onMouseLeave:I.handleMouseLeave,...Ie,...pe,children:[j&&t.jsx("span",{className:l.cn("Bear-Button__spotlight","bear-absolute bear-left-0 bear-top-0 bear-rounded-full bear-pointer-events-none bear-z-[1]","bear-transition-opacity bear-duration-150 bear-ease-out",xe?"bear-opacity-100":"bear-opacity-0"),"aria-hidden":"true",style:{width:f,height:f,background:`radial-gradient(circle at center, ${re} 0%, transparent 70%)`,transform:`translate(${A.x-f/2}px, ${A.y-f/2}px)`,mixBlendMode:"overlay"}}),c&&t.jsxs("span",{className:l.cn("Bear-Button__loading bear-inline-flex bear-items-center bear-gap-2 bear-relative bear-z-10",!m&&"bear-absolute"),children:[t.jsx(Ce.Spinner,{size:o==="xs"?"xs":"sm",className:"Bear-Button__spinner"}),m&&t.jsx(z.Typography,{variant:S,className:"Bear-Button__text",children:m})]}),t.jsxs("span",{className:l.cn("Bear-Button__content bear-inline-flex bear-items-center bear-gap-inherit bear-relative bear-z-10",c&&"bear-invisible"),children:[M&&t.jsx("span",{className:"Bear-Button__prefix bear-inline-flex bear-shrink-0",children:M}),q&&t.jsx("span",{className:l.cn("Bear-Button__icon Bear-Button__icon--left bear-inline-flex bear-shrink-0",n.BUTTON_ICON_SIZE[o]),children:q}),t.jsx(z.Typography,{variant:S,className:"Bear-Button__text",children:oe}),R&&t.jsx("span",{className:l.cn("Bear-Button__icon Bear-Button__icon--right bear-inline-flex bear-shrink-0",n.BUTTON_ICON_SIZE[o]),children:R}),$&&t.jsx("span",{className:"Bear-Button__suffix bear-inline-flex bear-shrink-0",children:$})]}),O&&w&&t.jsx("span",{className:"Bear-Button__ripple bear-absolute bear-rounded-full bear-pointer-events-none bear-z-[2] bear-animate-ping bear-opacity-30 bear-bg-white",style:w,"aria-hidden":"true"})]})});L.displayName="Button";exports.Button=L;
|