@forgedevstack/bear 1.2.6 → 1.2.8
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/AppShell/AppShell.cjs +1 -0
- package/dist/components/AppShell/AppShell.const.cjs +1 -0
- package/dist/components/AppShell/AppShell.const.d.ts +19 -0
- package/dist/components/AppShell/AppShell.const.js +25 -0
- package/dist/components/AppShell/AppShell.d.ts +3 -0
- package/dist/components/AppShell/AppShell.js +82 -0
- package/dist/components/AppShell/AppShell.types.d.ts +16 -0
- package/dist/components/AppShell/index.d.ts +2 -0
- 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/Banner/Banner.cjs +1 -0
- package/dist/components/Banner/Banner.const.cjs +1 -0
- package/dist/components/Banner/Banner.const.d.ts +21 -0
- package/dist/components/Banner/Banner.const.js +33 -0
- package/dist/components/Banner/Banner.d.ts +3 -0
- package/dist/components/Banner/Banner.js +70 -0
- package/dist/components/Banner/Banner.types.d.ts +21 -0
- package/dist/components/Banner/helpers/BannerErrorSvg.cjs +1 -0
- package/dist/components/Banner/helpers/BannerErrorSvg.d.ts +2 -0
- package/dist/components/Banner/helpers/BannerErrorSvg.js +22 -0
- package/dist/components/Banner/helpers/BannerInfoSvg.cjs +1 -0
- package/dist/components/Banner/helpers/BannerInfoSvg.d.ts +2 -0
- package/dist/components/Banner/helpers/BannerInfoSvg.js +22 -0
- package/dist/components/Banner/helpers/BannerSuccessSvg.cjs +1 -0
- package/dist/components/Banner/helpers/BannerSuccessSvg.d.ts +2 -0
- package/dist/components/Banner/helpers/BannerSuccessSvg.js +21 -0
- package/dist/components/Banner/helpers/BannerWarningSvg.cjs +1 -0
- package/dist/components/Banner/helpers/BannerWarningSvg.d.ts +2 -0
- package/dist/components/Banner/helpers/BannerWarningSvg.js +22 -0
- package/dist/components/Banner/helpers/index.d.ts +4 -0
- package/dist/components/Banner/index.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 +6 -0
- package/dist/components/index.js +277 -271
- 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 +452 -433
- 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
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S=require("react/jsx-runtime"),e=require("./AppShell.const.cjs"),_=require("../../utils/cn.cjs");require("react");const I=require("../../utils/generateBearId.utils.cjs"),N=require("../../utils/useBearId.cjs"),T=r=>{const{header:A,navbar:L,aside:s,footer:E,children:P,navbarCollapsed:a=e.APP_SHELL_DEFAULT_NAVBAR_COLLAPSED,navbarWidth:d=e.APP_SHELL_DEFAULT_NAVBAR_WIDTH,stickyHeader:i=e.APP_SHELL_DEFAULT_STICKY_HEADER,stickyFooter:c=e.APP_SHELL_DEFAULT_STICKY_FOOTER,padding:n=e.APP_SHELL_DEFAULT_PADDING,className:t,id:l,testId:H,...o}=r,C=N.useBearId("AppShell"),D=I.resolveBearId(l,C);return S.jsxs("div",{...o,id:D,"data-testid":H,className:_.cn(e.APP_SHELL_ROOT_CLASS,e.APP_SHELL_BASE_CLASSES,t),children:[A&&S.jsx("div",{className:_.cn(e.APP_SHELL_HEADER_CLASSES,i&&e.APP_SHELL_HEADER_STICKY_CLASS),children:A}),S.jsxs("div",{className:e.APP_SHELL_BODY_CLASSES,children:[L!==void 0&&S.jsx("aside",{className:_.cn(e.APP_SHELL_NAVBAR_BASE_CLASSES,a?e.APP_SHELL_NAVBAR_COLLAPSED_CLASS:e.APP_SHELL_NAVBAR_WIDTH_CLASSES[d]),"aria-hidden":a||void 0,children:L}),S.jsx("main",{className:_.cn(e.APP_SHELL_MAIN_CLASSES,n&&e.APP_SHELL_MAIN_PADDING_CLASS),children:P}),s&&S.jsx("aside",{className:e.APP_SHELL_ASIDE_CLASSES,children:s})]}),E&&S.jsx("div",{className:_.cn(e.APP_SHELL_FOOTER_CLASSES,c&&e.APP_SHELL_FOOTER_STICKY_CLASS),children:E})]})};exports.AppShell=T;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _="Bear-AppShell",S=!1,r="md",A=!0,L=!1,e=!0,a="bear-flex bear-flex-col bear-min-h-0 bear-w-full bear-bg-[var(--bear-bg-primary)] bear-text-[var(--bear-text-primary)]",E=`${_}__body bear-flex bear-flex-1 bear-min-h-0 bear-w-full`,b=`${_}__header bear-w-full bear-z-30 bear-bg-[var(--bear-bg-primary)] bear-border-b bear-border-[var(--bear-border-default)]`,P="bear-sticky bear-top-0",o=`${_}__navbar bear-flex-shrink-0 bear-overflow-y-auto bear-border-e bear-border-[var(--bear-border-default)] bear-bg-[var(--bear-bg-secondary)]`,H={sm:"bear-w-56",md:"bear-w-64",lg:"bear-w-72"},t="bear-w-0 bear-overflow-hidden bear-border-e-0",C=`${_}__main bear-flex-1 bear-min-w-0 bear-overflow-auto`,D="bear-p-4 md:bear-p-6",l=`${_}__aside bear-w-64 bear-flex-shrink-0 bear-overflow-y-auto bear-border-s bear-border-[var(--bear-border-default)] bear-bg-[var(--bear-bg-secondary)] bear-hidden lg:bear-block`,d=`${_}__footer bear-w-full bear-z-20 bear-bg-[var(--bear-bg-primary)] bear-border-t bear-border-[var(--bear-border-default)]`,n="bear-sticky bear-bottom-0";exports.APP_SHELL_ASIDE_CLASSES=l;exports.APP_SHELL_BASE_CLASSES=a;exports.APP_SHELL_BODY_CLASSES=E;exports.APP_SHELL_DEFAULT_NAVBAR_COLLAPSED=S;exports.APP_SHELL_DEFAULT_NAVBAR_WIDTH=r;exports.APP_SHELL_DEFAULT_PADDING=e;exports.APP_SHELL_DEFAULT_STICKY_FOOTER=L;exports.APP_SHELL_DEFAULT_STICKY_HEADER=A;exports.APP_SHELL_FOOTER_CLASSES=d;exports.APP_SHELL_FOOTER_STICKY_CLASS=n;exports.APP_SHELL_HEADER_CLASSES=b;exports.APP_SHELL_HEADER_STICKY_CLASS=P;exports.APP_SHELL_MAIN_CLASSES=C;exports.APP_SHELL_MAIN_PADDING_CLASS=D;exports.APP_SHELL_NAVBAR_BASE_CLASSES=o;exports.APP_SHELL_NAVBAR_COLLAPSED_CLASS=t;exports.APP_SHELL_NAVBAR_WIDTH_CLASSES=H;exports.APP_SHELL_ROOT_CLASS=_;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { AppShellNavbarWidth } from './AppShell.types';
|
|
2
|
+
export declare const APP_SHELL_ROOT_CLASS = "Bear-AppShell";
|
|
3
|
+
export declare const APP_SHELL_DEFAULT_NAVBAR_COLLAPSED = false;
|
|
4
|
+
export declare const APP_SHELL_DEFAULT_NAVBAR_WIDTH: AppShellNavbarWidth;
|
|
5
|
+
export declare const APP_SHELL_DEFAULT_STICKY_HEADER = true;
|
|
6
|
+
export declare const APP_SHELL_DEFAULT_STICKY_FOOTER = false;
|
|
7
|
+
export declare const APP_SHELL_DEFAULT_PADDING = true;
|
|
8
|
+
export declare const APP_SHELL_BASE_CLASSES = "bear-flex bear-flex-col bear-min-h-0 bear-w-full bear-bg-[var(--bear-bg-primary)] bear-text-[var(--bear-text-primary)]";
|
|
9
|
+
export declare const APP_SHELL_BODY_CLASSES = "Bear-AppShell__body bear-flex bear-flex-1 bear-min-h-0 bear-w-full";
|
|
10
|
+
export declare const APP_SHELL_HEADER_CLASSES = "Bear-AppShell__header bear-w-full bear-z-30 bear-bg-[var(--bear-bg-primary)] bear-border-b bear-border-[var(--bear-border-default)]";
|
|
11
|
+
export declare const APP_SHELL_HEADER_STICKY_CLASS = "bear-sticky bear-top-0";
|
|
12
|
+
export declare const APP_SHELL_NAVBAR_BASE_CLASSES = "Bear-AppShell__navbar bear-flex-shrink-0 bear-overflow-y-auto bear-border-e bear-border-[var(--bear-border-default)] bear-bg-[var(--bear-bg-secondary)]";
|
|
13
|
+
export declare const APP_SHELL_NAVBAR_WIDTH_CLASSES: Record<AppShellNavbarWidth, string>;
|
|
14
|
+
export declare const APP_SHELL_NAVBAR_COLLAPSED_CLASS = "bear-w-0 bear-overflow-hidden bear-border-e-0";
|
|
15
|
+
export declare const APP_SHELL_MAIN_CLASSES = "Bear-AppShell__main bear-flex-1 bear-min-w-0 bear-overflow-auto";
|
|
16
|
+
export declare const APP_SHELL_MAIN_PADDING_CLASS = "bear-p-4 md:bear-p-6";
|
|
17
|
+
export declare const APP_SHELL_ASIDE_CLASSES = "Bear-AppShell__aside bear-w-64 bear-flex-shrink-0 bear-overflow-y-auto bear-border-s bear-border-[var(--bear-border-default)] bear-bg-[var(--bear-bg-secondary)] bear-hidden lg:bear-block";
|
|
18
|
+
export declare const APP_SHELL_FOOTER_CLASSES = "Bear-AppShell__footer bear-w-full bear-z-20 bear-bg-[var(--bear-bg-primary)] bear-border-t bear-border-[var(--bear-border-default)]";
|
|
19
|
+
export declare const APP_SHELL_FOOTER_STICKY_CLASS = "bear-sticky bear-bottom-0";
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
const r = "Bear-AppShell", e = !1, a = "md", b = !0, _ = !1, S = !0, A = "bear-flex bear-flex-col bear-min-h-0 bear-w-full bear-bg-[var(--bear-bg-primary)] bear-text-[var(--bear-text-primary)]", L = `${r}__body bear-flex bear-flex-1 bear-min-h-0 bear-w-full`, o = `${r}__header bear-w-full bear-z-30 bear-bg-[var(--bear-bg-primary)] bear-border-b bear-border-[var(--bear-border-default)]`, E = "bear-sticky bear-top-0", P = `${r}__navbar bear-flex-shrink-0 bear-overflow-y-auto bear-border-e bear-border-[var(--bear-border-default)] bear-bg-[var(--bear-bg-secondary)]`, t = {
|
|
2
|
+
sm: "bear-w-56",
|
|
3
|
+
md: "bear-w-64",
|
|
4
|
+
lg: "bear-w-72"
|
|
5
|
+
}, l = "bear-w-0 bear-overflow-hidden bear-border-e-0", d = `${r}__main bear-flex-1 bear-min-w-0 bear-overflow-auto`, n = "bear-p-4 md:bear-p-6", s = `${r}__aside bear-w-64 bear-flex-shrink-0 bear-overflow-y-auto bear-border-s bear-border-[var(--bear-border-default)] bear-bg-[var(--bear-bg-secondary)] bear-hidden lg:bear-block`, c = `${r}__footer bear-w-full bear-z-20 bear-bg-[var(--bear-bg-primary)] bear-border-t bear-border-[var(--bear-border-default)]`, H = "bear-sticky bear-bottom-0";
|
|
6
|
+
export {
|
|
7
|
+
s as APP_SHELL_ASIDE_CLASSES,
|
|
8
|
+
A as APP_SHELL_BASE_CLASSES,
|
|
9
|
+
L as APP_SHELL_BODY_CLASSES,
|
|
10
|
+
e as APP_SHELL_DEFAULT_NAVBAR_COLLAPSED,
|
|
11
|
+
a as APP_SHELL_DEFAULT_NAVBAR_WIDTH,
|
|
12
|
+
S as APP_SHELL_DEFAULT_PADDING,
|
|
13
|
+
_ as APP_SHELL_DEFAULT_STICKY_FOOTER,
|
|
14
|
+
b as APP_SHELL_DEFAULT_STICKY_HEADER,
|
|
15
|
+
c as APP_SHELL_FOOTER_CLASSES,
|
|
16
|
+
H as APP_SHELL_FOOTER_STICKY_CLASS,
|
|
17
|
+
o as APP_SHELL_HEADER_CLASSES,
|
|
18
|
+
E as APP_SHELL_HEADER_STICKY_CLASS,
|
|
19
|
+
d as APP_SHELL_MAIN_CLASSES,
|
|
20
|
+
n as APP_SHELL_MAIN_PADDING_CLASS,
|
|
21
|
+
P as APP_SHELL_NAVBAR_BASE_CLASSES,
|
|
22
|
+
l as APP_SHELL_NAVBAR_COLLAPSED_CLASS,
|
|
23
|
+
t as APP_SHELL_NAVBAR_WIDTH_CLASSES,
|
|
24
|
+
r as APP_SHELL_ROOT_CLASS
|
|
25
|
+
};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { jsxs as a, jsx as _ } from "react/jsx-runtime";
|
|
2
|
+
import { APP_SHELL_DEFAULT_NAVBAR_COLLAPSED as D, APP_SHELL_DEFAULT_NAVBAR_WIDTH as N, APP_SHELL_DEFAULT_STICKY_HEADER as I, APP_SHELL_DEFAULT_STICKY_FOOTER as T, APP_SHELL_DEFAULT_PADDING as p, APP_SHELL_HEADER_STICKY_CLASS as h, APP_SHELL_HEADER_CLASSES as R, APP_SHELL_BODY_CLASSES as O, APP_SHELL_NAVBAR_COLLAPSED_CLASS as v, APP_SHELL_NAVBAR_WIDTH_CLASSES as B, APP_SHELL_NAVBAR_BASE_CLASSES as F, APP_SHELL_MAIN_PADDING_CLASS as f, APP_SHELL_MAIN_CLASSES as U, APP_SHELL_ASIDE_CLASSES as V, APP_SHELL_FOOTER_STICKY_CLASS as Y, APP_SHELL_FOOTER_CLASSES as K, APP_SHELL_BASE_CLASSES as b, APP_SHELL_ROOT_CLASS as x } from "./AppShell.const.js";
|
|
3
|
+
import { cn as S } from "../../utils/cn.js";
|
|
4
|
+
import "react";
|
|
5
|
+
import { resolveBearId as W } from "../../utils/generateBearId.utils.js";
|
|
6
|
+
import { useBearId as g } from "../../utils/useBearId.js";
|
|
7
|
+
const q = (d) => {
|
|
8
|
+
const {
|
|
9
|
+
header: A,
|
|
10
|
+
navbar: L,
|
|
11
|
+
aside: E,
|
|
12
|
+
footer: e,
|
|
13
|
+
children: r,
|
|
14
|
+
navbarCollapsed: P = D,
|
|
15
|
+
navbarWidth: s = N,
|
|
16
|
+
stickyHeader: i = I,
|
|
17
|
+
stickyFooter: o = T,
|
|
18
|
+
padding: t = p,
|
|
19
|
+
className: H,
|
|
20
|
+
id: c,
|
|
21
|
+
testId: l,
|
|
22
|
+
...m
|
|
23
|
+
} = d, n = g("AppShell"), C = W(c, n);
|
|
24
|
+
return /* @__PURE__ */ a(
|
|
25
|
+
"div",
|
|
26
|
+
{
|
|
27
|
+
...m,
|
|
28
|
+
id: C,
|
|
29
|
+
"data-testid": l,
|
|
30
|
+
className: S(x, b, H),
|
|
31
|
+
children: [
|
|
32
|
+
A && /* @__PURE__ */ _(
|
|
33
|
+
"div",
|
|
34
|
+
{
|
|
35
|
+
className: S(
|
|
36
|
+
R,
|
|
37
|
+
i && h
|
|
38
|
+
),
|
|
39
|
+
children: A
|
|
40
|
+
}
|
|
41
|
+
),
|
|
42
|
+
/* @__PURE__ */ a("div", { className: O, children: [
|
|
43
|
+
L !== void 0 && /* @__PURE__ */ _(
|
|
44
|
+
"aside",
|
|
45
|
+
{
|
|
46
|
+
className: S(
|
|
47
|
+
F,
|
|
48
|
+
P ? v : B[s]
|
|
49
|
+
),
|
|
50
|
+
"aria-hidden": P || void 0,
|
|
51
|
+
children: L
|
|
52
|
+
}
|
|
53
|
+
),
|
|
54
|
+
/* @__PURE__ */ _(
|
|
55
|
+
"main",
|
|
56
|
+
{
|
|
57
|
+
className: S(
|
|
58
|
+
U,
|
|
59
|
+
t && f
|
|
60
|
+
),
|
|
61
|
+
children: r
|
|
62
|
+
}
|
|
63
|
+
),
|
|
64
|
+
E && /* @__PURE__ */ _("aside", { className: V, children: E })
|
|
65
|
+
] }),
|
|
66
|
+
e && /* @__PURE__ */ _(
|
|
67
|
+
"div",
|
|
68
|
+
{
|
|
69
|
+
className: S(
|
|
70
|
+
K,
|
|
71
|
+
o && Y
|
|
72
|
+
),
|
|
73
|
+
children: e
|
|
74
|
+
}
|
|
75
|
+
)
|
|
76
|
+
]
|
|
77
|
+
}
|
|
78
|
+
);
|
|
79
|
+
};
|
|
80
|
+
export {
|
|
81
|
+
q as AppShell
|
|
82
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export type AppShellNavbarWidth = 'sm' | 'md' | 'lg';
|
|
3
|
+
export interface AppShellProps extends HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
header?: ReactNode;
|
|
5
|
+
navbar?: ReactNode;
|
|
6
|
+
aside?: ReactNode;
|
|
7
|
+
footer?: ReactNode;
|
|
8
|
+
children?: ReactNode;
|
|
9
|
+
navbarCollapsed?: boolean;
|
|
10
|
+
navbarWidth?: AppShellNavbarWidth;
|
|
11
|
+
stickyHeader?: boolean;
|
|
12
|
+
stickyFooter?: boolean;
|
|
13
|
+
padding?: boolean;
|
|
14
|
+
id?: string;
|
|
15
|
+
testId?: string;
|
|
16
|
+
}
|
|
@@ -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
|
};
|