@forgedevstack/bear 1.2.7 → 1.2.9
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/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/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/StatCard/StatCard.cjs +1 -1
- package/dist/components/StatCard/StatCard.const.cjs +1 -0
- package/dist/components/StatCard/StatCard.const.d.ts +11 -1
- package/dist/components/StatCard/StatCard.const.js +14 -0
- package/dist/components/StatCard/StatCard.d.ts +0 -4
- package/dist/components/StatCard/StatCard.js +44 -32
- 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 +23 -11
- package/dist/components/Stepper/Stepper.const.js +60 -48
- package/dist/components/Stepper/Stepper.js +126 -118
- package/dist/components/index.cjs +1 -1
- package/dist/components/index.d.ts +4 -0
- package/dist/components/index.js +259 -255
- package/dist/index.cjs +1 -1
- package/dist/index.js +374 -370
- package/dist/styles.css +28 -20
- package/package.json +1 -1
|
@@ -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
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),j=require("react"),e=require("./Banner.const.cjs"),x=require("./helpers/BannerInfoSvg.cjs"),q=require("./helpers/BannerSuccessSvg.cjs"),D=require("./helpers/BannerWarningSvg.cjs"),f=require("./helpers/BannerErrorSvg.cjs"),F=require("../CloseButton/CloseButton.cjs"),U=require("../../utils/cn.cjs"),h=require("../../utils/generateBearId.utils.cjs"),p=require("../../utils/useBearId.cjs"),b=require("../../utils/liveRegion.utils.cjs"),P={info:n.jsx(x.BannerInfoSvg,{}),success:n.jsx(q.BannerSuccessSvg,{}),warning:n.jsx(D.BannerWarningSvg,{}),error:n.jsx(f.BannerErrorSvg,{})},W=l=>{const{severity:s=e.BANNER_DEFAULT_SEVERITY,title:c,children:N,action:a,icon:r=e.BANNER_DEFAULT_SHOW_ICON,dismissible:_=e.BANNER_DEFAULT_DISMISSIBLE,onDismiss:i,open:o,position:A=e.BANNER_DEFAULT_POSITION,fullWidth:E=e.BANNER_DEFAULT_FULL_WIDTH,translations:t,className:B,id:d,testId:u,...I}=l,[L,R]=j.useState(e.BANNER_DEFAULT_OPEN),T=o??L,v=p.useBearId("Banner"),g=h.resolveBearId(d,v),C=(t==null?void 0:t.dismissLabel)??e.BANNER_DEFAULT_TRANSLATIONS.dismissLabel,O=b.getBearLiveRegionProps(s);if(!T)return null;const m=()=>{o===void 0&&R(!1),i==null||i()},S=r===!1?null:r!==!0?r:P[s];return n.jsxs("div",{...I,...O,id:g,"data-testid":u,className:U.cn(e.BANNER_ROOT_CLASS,e.BANNER_BASE_CLASSES,e.BANNER_SEVERITY_CLASSES[s],e.BANNER_POSITION_CLASSES[A],E&&e.BANNER_FULL_WIDTH_CLASS,B),children:[S&&n.jsx("span",{className:e.BANNER_ICON_CLASS,children:S}),n.jsxs("div",{className:e.BANNER_CONTENT_CLASS,children:[c&&n.jsx("div",{className:e.BANNER_TITLE_CLASS,children:c}),N&&n.jsx("div",{className:e.BANNER_MESSAGE_CLASS,children:N})]}),a&&n.jsx("div",{className:e.BANNER_ACTION_CLASS,children:a}),_&&n.jsx("div",{className:e.BANNER_DISMISS_CLASS,children:n.jsx(F.CloseButton,{size:"sm",onClick:m,"aria-label":C})})]})};exports.Banner=W;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const N="Bear-Banner",_="info",S="static",A=!1,E=!0,e=!0,r=!0,a={dismissLabel:"Dismiss"},b="bear-flex bear-items-center bear-gap-3 bear-px-4 bear-py-3 bear-border-b bear-border-[var(--bear-border-default)]",t="bear-w-full",s={static:"",sticky:"bear-sticky bear-top-0 bear-z-40"},L={info:"bear-bg-[var(--bear-info-50,#eff6ff)] bear-text-[var(--bear-info-800,#1e40af)]",success:"bear-bg-[var(--bear-success-50,#f0fdf4)] bear-text-[var(--bear-success-800,#166534)]",warning:"bear-bg-[var(--bear-warning-50,#fffbeb)] bear-text-[var(--bear-warning-800,#92400e)]",error:"bear-bg-[var(--bear-danger-50,#fef2f2)] bear-text-[var(--bear-danger-800,#991b1b)]"},R=`${N}__icon bear-flex-shrink-0 bear-w-5 bear-h-5`,T=`${N}__content bear-flex-1 bear-min-w-0 bear-text-sm`,n=`${N}__title bear-font-semibold bear-mb-0.5`,B=`${N}__message`,I=`${N}__action bear-flex-shrink-0`,o=`${N}__dismiss bear-flex-shrink-0`,c=20,C=2;exports.BANNER_ACTION_CLASS=I;exports.BANNER_BASE_CLASSES=b;exports.BANNER_CONTENT_CLASS=T;exports.BANNER_DEFAULT_DISMISSIBLE=A;exports.BANNER_DEFAULT_FULL_WIDTH=E;exports.BANNER_DEFAULT_OPEN=r;exports.BANNER_DEFAULT_POSITION=S;exports.BANNER_DEFAULT_SEVERITY=_;exports.BANNER_DEFAULT_SHOW_ICON=e;exports.BANNER_DEFAULT_TRANSLATIONS=a;exports.BANNER_DISMISS_CLASS=o;exports.BANNER_FULL_WIDTH_CLASS=t;exports.BANNER_ICON_CLASS=R;exports.BANNER_ICON_SIZE=c;exports.BANNER_ICON_STROKE_WIDTH=C;exports.BANNER_MESSAGE_CLASS=B;exports.BANNER_POSITION_CLASSES=s;exports.BANNER_ROOT_CLASS=N;exports.BANNER_SEVERITY_CLASSES=L;exports.BANNER_TITLE_CLASS=n;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { BannerPosition, BannerSeverity, BannerTranslations } from './Banner.types';
|
|
2
|
+
export declare const BANNER_ROOT_CLASS = "Bear-Banner";
|
|
3
|
+
export declare const BANNER_DEFAULT_SEVERITY: BannerSeverity;
|
|
4
|
+
export declare const BANNER_DEFAULT_POSITION: BannerPosition;
|
|
5
|
+
export declare const BANNER_DEFAULT_DISMISSIBLE = false;
|
|
6
|
+
export declare const BANNER_DEFAULT_FULL_WIDTH = true;
|
|
7
|
+
export declare const BANNER_DEFAULT_SHOW_ICON = true;
|
|
8
|
+
export declare const BANNER_DEFAULT_OPEN = true;
|
|
9
|
+
export declare const BANNER_DEFAULT_TRANSLATIONS: BannerTranslations;
|
|
10
|
+
export declare const BANNER_BASE_CLASSES = "bear-flex bear-items-center bear-gap-3 bear-px-4 bear-py-3 bear-border-b bear-border-[var(--bear-border-default)]";
|
|
11
|
+
export declare const BANNER_FULL_WIDTH_CLASS = "bear-w-full";
|
|
12
|
+
export declare const BANNER_POSITION_CLASSES: Record<BannerPosition, string>;
|
|
13
|
+
export declare const BANNER_SEVERITY_CLASSES: Record<BannerSeverity, string>;
|
|
14
|
+
export declare const BANNER_ICON_CLASS = "Bear-Banner__icon bear-flex-shrink-0 bear-w-5 bear-h-5";
|
|
15
|
+
export declare const BANNER_CONTENT_CLASS = "Bear-Banner__content bear-flex-1 bear-min-w-0 bear-text-sm";
|
|
16
|
+
export declare const BANNER_TITLE_CLASS = "Bear-Banner__title bear-font-semibold bear-mb-0.5";
|
|
17
|
+
export declare const BANNER_MESSAGE_CLASS = "Bear-Banner__message";
|
|
18
|
+
export declare const BANNER_ACTION_CLASS = "Bear-Banner__action bear-flex-shrink-0";
|
|
19
|
+
export declare const BANNER_DISMISS_CLASS = "Bear-Banner__dismiss bear-flex-shrink-0";
|
|
20
|
+
export declare const BANNER_ICON_SIZE = 20;
|
|
21
|
+
export declare const BANNER_ICON_STROKE_WIDTH = 2;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
const e = "Bear-Banner", r = "info", a = "static", _ = !1, b = !0, N = !0, s = !0, t = {
|
|
2
|
+
dismissLabel: "Dismiss"
|
|
3
|
+
}, n = "bear-flex bear-items-center bear-gap-3 bear-px-4 bear-py-3 bear-border-b bear-border-[var(--bear-border-default)]", A = "bear-w-full", E = {
|
|
4
|
+
static: "",
|
|
5
|
+
sticky: "bear-sticky bear-top-0 bear-z-40"
|
|
6
|
+
}, S = {
|
|
7
|
+
info: "bear-bg-[var(--bear-info-50,#eff6ff)] bear-text-[var(--bear-info-800,#1e40af)]",
|
|
8
|
+
success: "bear-bg-[var(--bear-success-50,#f0fdf4)] bear-text-[var(--bear-success-800,#166534)]",
|
|
9
|
+
warning: "bear-bg-[var(--bear-warning-50,#fffbeb)] bear-text-[var(--bear-warning-800,#92400e)]",
|
|
10
|
+
error: "bear-bg-[var(--bear-danger-50,#fef2f2)] bear-text-[var(--bear-danger-800,#991b1b)]"
|
|
11
|
+
}, o = `${e}__icon bear-flex-shrink-0 bear-w-5 bear-h-5`, c = `${e}__content bear-flex-1 bear-min-w-0 bear-text-sm`, f = `${e}__title bear-font-semibold bear-mb-0.5`, i = `${e}__message`, L = `${e}__action bear-flex-shrink-0`, R = `${e}__dismiss bear-flex-shrink-0`, B = 20, T = 2;
|
|
12
|
+
export {
|
|
13
|
+
L as BANNER_ACTION_CLASS,
|
|
14
|
+
n as BANNER_BASE_CLASSES,
|
|
15
|
+
c as BANNER_CONTENT_CLASS,
|
|
16
|
+
_ as BANNER_DEFAULT_DISMISSIBLE,
|
|
17
|
+
b as BANNER_DEFAULT_FULL_WIDTH,
|
|
18
|
+
s as BANNER_DEFAULT_OPEN,
|
|
19
|
+
a as BANNER_DEFAULT_POSITION,
|
|
20
|
+
r as BANNER_DEFAULT_SEVERITY,
|
|
21
|
+
N as BANNER_DEFAULT_SHOW_ICON,
|
|
22
|
+
t as BANNER_DEFAULT_TRANSLATIONS,
|
|
23
|
+
R as BANNER_DISMISS_CLASS,
|
|
24
|
+
A as BANNER_FULL_WIDTH_CLASS,
|
|
25
|
+
o as BANNER_ICON_CLASS,
|
|
26
|
+
B as BANNER_ICON_SIZE,
|
|
27
|
+
T as BANNER_ICON_STROKE_WIDTH,
|
|
28
|
+
i as BANNER_MESSAGE_CLASS,
|
|
29
|
+
E as BANNER_POSITION_CLASSES,
|
|
30
|
+
e as BANNER_ROOT_CLASS,
|
|
31
|
+
S as BANNER_SEVERITY_CLASSES,
|
|
32
|
+
f as BANNER_TITLE_CLASS
|
|
33
|
+
};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { jsxs as A, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { useState as u } from "react";
|
|
3
|
+
import { BANNER_DEFAULT_SEVERITY as D, BANNER_DEFAULT_SHOW_ICON as g, BANNER_DEFAULT_DISMISSIBLE as F, BANNER_DEFAULT_POSITION as U, BANNER_DEFAULT_FULL_WIDTH as h, BANNER_DEFAULT_OPEN as b, BANNER_DEFAULT_TRANSLATIONS as P, BANNER_ICON_CLASS as W, BANNER_CONTENT_CLASS as x, BANNER_TITLE_CLASS as H, BANNER_MESSAGE_CLASS as M, BANNER_ACTION_CLASS as j, BANNER_DISMISS_CLASS as V, BANNER_FULL_WIDTH_CLASS as Y, BANNER_POSITION_CLASSES as k, BANNER_SEVERITY_CLASSES as w, BANNER_BASE_CLASSES as y, BANNER_ROOT_CLASS as z } from "./Banner.const.js";
|
|
4
|
+
import { BannerInfoSvg as G } from "./helpers/BannerInfoSvg.js";
|
|
5
|
+
import { BannerSuccessSvg as q } from "./helpers/BannerSuccessSvg.js";
|
|
6
|
+
import { BannerWarningSvg as J } from "./helpers/BannerWarningSvg.js";
|
|
7
|
+
import { BannerErrorSvg as K } from "./helpers/BannerErrorSvg.js";
|
|
8
|
+
import { CloseButton as Q } from "../CloseButton/CloseButton.js";
|
|
9
|
+
import { cn as X } from "../../utils/cn.js";
|
|
10
|
+
import { resolveBearId as Z } from "../../utils/generateBearId.utils.js";
|
|
11
|
+
import { useBearId as $ } from "../../utils/useBearId.js";
|
|
12
|
+
import { getBearLiveRegionProps as ee } from "../../utils/liveRegion.utils.js";
|
|
13
|
+
const re = {
|
|
14
|
+
info: /* @__PURE__ */ e(G, {}),
|
|
15
|
+
success: /* @__PURE__ */ e(q, {}),
|
|
16
|
+
warning: /* @__PURE__ */ e(J, {}),
|
|
17
|
+
error: /* @__PURE__ */ e(K, {})
|
|
18
|
+
}, le = (E) => {
|
|
19
|
+
const {
|
|
20
|
+
severity: r = D,
|
|
21
|
+
title: o,
|
|
22
|
+
children: N,
|
|
23
|
+
action: t,
|
|
24
|
+
icon: n = g,
|
|
25
|
+
dismissible: _ = F,
|
|
26
|
+
onDismiss: s,
|
|
27
|
+
open: S,
|
|
28
|
+
position: c = U,
|
|
29
|
+
fullWidth: m = h,
|
|
30
|
+
translations: i,
|
|
31
|
+
className: l,
|
|
32
|
+
id: d,
|
|
33
|
+
testId: B,
|
|
34
|
+
...L
|
|
35
|
+
} = E, [I, R] = u(b), T = S ?? I, f = $("Banner"), p = Z(d, f), C = (i == null ? void 0 : i.dismissLabel) ?? P.dismissLabel, O = ee(r);
|
|
36
|
+
if (!T)
|
|
37
|
+
return null;
|
|
38
|
+
const v = () => {
|
|
39
|
+
S === void 0 && R(!1), s == null || s();
|
|
40
|
+
}, a = n === !1 ? null : n !== !0 ? n : re[r];
|
|
41
|
+
return /* @__PURE__ */ A(
|
|
42
|
+
"div",
|
|
43
|
+
{
|
|
44
|
+
...L,
|
|
45
|
+
...O,
|
|
46
|
+
id: p,
|
|
47
|
+
"data-testid": B,
|
|
48
|
+
className: X(
|
|
49
|
+
z,
|
|
50
|
+
y,
|
|
51
|
+
w[r],
|
|
52
|
+
k[c],
|
|
53
|
+
m && Y,
|
|
54
|
+
l
|
|
55
|
+
),
|
|
56
|
+
children: [
|
|
57
|
+
a && /* @__PURE__ */ e("span", { className: W, children: a }),
|
|
58
|
+
/* @__PURE__ */ A("div", { className: x, children: [
|
|
59
|
+
o && /* @__PURE__ */ e("div", { className: H, children: o }),
|
|
60
|
+
N && /* @__PURE__ */ e("div", { className: M, children: N })
|
|
61
|
+
] }),
|
|
62
|
+
t && /* @__PURE__ */ e("div", { className: j, children: t }),
|
|
63
|
+
_ && /* @__PURE__ */ e("div", { className: V, children: /* @__PURE__ */ e(Q, { size: "sm", onClick: v, "aria-label": C }) })
|
|
64
|
+
]
|
|
65
|
+
}
|
|
66
|
+
);
|
|
67
|
+
};
|
|
68
|
+
export {
|
|
69
|
+
le as Banner
|
|
70
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export type BannerSeverity = 'info' | 'success' | 'warning' | 'error';
|
|
3
|
+
export type BannerPosition = 'static' | 'sticky';
|
|
4
|
+
export interface BannerTranslations {
|
|
5
|
+
dismissLabel: string;
|
|
6
|
+
}
|
|
7
|
+
export interface BannerProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
8
|
+
severity?: BannerSeverity;
|
|
9
|
+
title?: ReactNode;
|
|
10
|
+
children?: ReactNode;
|
|
11
|
+
action?: ReactNode;
|
|
12
|
+
icon?: boolean | ReactNode;
|
|
13
|
+
dismissible?: boolean;
|
|
14
|
+
onDismiss?: () => void;
|
|
15
|
+
open?: boolean;
|
|
16
|
+
position?: BannerPosition;
|
|
17
|
+
fullWidth?: boolean;
|
|
18
|
+
translations?: Partial<BannerTranslations>;
|
|
19
|
+
id?: string;
|
|
20
|
+
testId?: string;
|
|
21
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("../Banner.const.cjs"),n=()=>e.jsxs("svg",{width:r.BANNER_ICON_SIZE,height:r.BANNER_ICON_SIZE,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:r.BANNER_ICON_STROKE_WIDTH,"aria-hidden":"true",children:[e.jsx("circle",{cx:"12",cy:"12",r:"10"}),e.jsx("line",{x1:"15",y1:"9",x2:"9",y2:"15"}),e.jsx("line",{x1:"9",y1:"9",x2:"15",y2:"15"})]});exports.BannerErrorSvg=n;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsxs as i, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { BANNER_ICON_STROKE_WIDTH as o, BANNER_ICON_SIZE as e } from "../Banner.const.js";
|
|
3
|
+
const x = () => /* @__PURE__ */ i(
|
|
4
|
+
"svg",
|
|
5
|
+
{
|
|
6
|
+
width: e,
|
|
7
|
+
height: e,
|
|
8
|
+
viewBox: "0 0 24 24",
|
|
9
|
+
fill: "none",
|
|
10
|
+
stroke: "currentColor",
|
|
11
|
+
strokeWidth: o,
|
|
12
|
+
"aria-hidden": "true",
|
|
13
|
+
children: [
|
|
14
|
+
/* @__PURE__ */ r("circle", { cx: "12", cy: "12", r: "10" }),
|
|
15
|
+
/* @__PURE__ */ r("line", { x1: "15", y1: "9", x2: "9", y2: "15" }),
|
|
16
|
+
/* @__PURE__ */ r("line", { x1: "9", y1: "9", x2: "15", y2: "15" })
|
|
17
|
+
]
|
|
18
|
+
}
|
|
19
|
+
);
|
|
20
|
+
export {
|
|
21
|
+
x as BannerErrorSvg
|
|
22
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),n=require("../Banner.const.cjs"),r=()=>e.jsxs("svg",{width:n.BANNER_ICON_SIZE,height:n.BANNER_ICON_SIZE,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:n.BANNER_ICON_STROKE_WIDTH,"aria-hidden":"true",children:[e.jsx("circle",{cx:"12",cy:"12",r:"10"}),e.jsx("line",{x1:"12",y1:"16",x2:"12",y2:"12"}),e.jsx("line",{x1:"12",y1:"8",x2:"12.01",y2:"8"})]});exports.BannerInfoSvg=r;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsxs as i, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { BANNER_ICON_STROKE_WIDTH as o, BANNER_ICON_SIZE as e } from "../Banner.const.js";
|
|
3
|
+
const x = () => /* @__PURE__ */ i(
|
|
4
|
+
"svg",
|
|
5
|
+
{
|
|
6
|
+
width: e,
|
|
7
|
+
height: e,
|
|
8
|
+
viewBox: "0 0 24 24",
|
|
9
|
+
fill: "none",
|
|
10
|
+
stroke: "currentColor",
|
|
11
|
+
strokeWidth: o,
|
|
12
|
+
"aria-hidden": "true",
|
|
13
|
+
children: [
|
|
14
|
+
/* @__PURE__ */ r("circle", { cx: "12", cy: "12", r: "10" }),
|
|
15
|
+
/* @__PURE__ */ r("line", { x1: "12", y1: "16", x2: "12", y2: "12" }),
|
|
16
|
+
/* @__PURE__ */ r("line", { x1: "12", y1: "8", x2: "12.01", y2: "8" })
|
|
17
|
+
]
|
|
18
|
+
}
|
|
19
|
+
);
|
|
20
|
+
export {
|
|
21
|
+
x as BannerInfoSvg
|
|
22
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),n=require("../Banner.const.cjs"),t=()=>e.jsxs("svg",{width:n.BANNER_ICON_SIZE,height:n.BANNER_ICON_SIZE,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:n.BANNER_ICON_STROKE_WIDTH,"aria-hidden":"true",children:[e.jsx("path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14"}),e.jsx("polyline",{points:"22 4 12 14.01 9 11.01"})]});exports.BannerSuccessSvg=t;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsxs as e, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { BANNER_ICON_STROKE_WIDTH as t, BANNER_ICON_SIZE as r } from "../Banner.const.js";
|
|
3
|
+
const s = () => /* @__PURE__ */ e(
|
|
4
|
+
"svg",
|
|
5
|
+
{
|
|
6
|
+
width: r,
|
|
7
|
+
height: r,
|
|
8
|
+
viewBox: "0 0 24 24",
|
|
9
|
+
fill: "none",
|
|
10
|
+
stroke: "currentColor",
|
|
11
|
+
strokeWidth: t,
|
|
12
|
+
"aria-hidden": "true",
|
|
13
|
+
children: [
|
|
14
|
+
/* @__PURE__ */ o("path", { d: "M22 11.08V12a10 10 0 1 1-5.93-9.14" }),
|
|
15
|
+
/* @__PURE__ */ o("polyline", { points: "22 4 12 14.01 9 11.01" })
|
|
16
|
+
]
|
|
17
|
+
}
|
|
18
|
+
);
|
|
19
|
+
export {
|
|
20
|
+
s as BannerSuccessSvg
|
|
21
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),n=require("../Banner.const.cjs"),r=()=>e.jsxs("svg",{width:n.BANNER_ICON_SIZE,height:n.BANNER_ICON_SIZE,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:n.BANNER_ICON_STROKE_WIDTH,"aria-hidden":"true",children:[e.jsx("path",{d:"M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"}),e.jsx("line",{x1:"12",y1:"9",x2:"12",y2:"13"}),e.jsx("line",{x1:"12",y1:"17",x2:"12.01",y2:"17"})]});exports.BannerWarningSvg=r;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsxs as i, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { BANNER_ICON_STROKE_WIDTH as n, BANNER_ICON_SIZE as e } from "../Banner.const.js";
|
|
3
|
+
const a = () => /* @__PURE__ */ i(
|
|
4
|
+
"svg",
|
|
5
|
+
{
|
|
6
|
+
width: e,
|
|
7
|
+
height: e,
|
|
8
|
+
viewBox: "0 0 24 24",
|
|
9
|
+
fill: "none",
|
|
10
|
+
stroke: "currentColor",
|
|
11
|
+
strokeWidth: n,
|
|
12
|
+
"aria-hidden": "true",
|
|
13
|
+
children: [
|
|
14
|
+
/* @__PURE__ */ r("path", { d: "M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z" }),
|
|
15
|
+
/* @__PURE__ */ r("line", { x1: "12", y1: "9", x2: "12", y2: "13" }),
|
|
16
|
+
/* @__PURE__ */ r("line", { x1: "12", y1: "17", x2: "12.01", y2: "17" })
|
|
17
|
+
]
|
|
18
|
+
}
|
|
19
|
+
);
|
|
20
|
+
export {
|
|
21
|
+
a as BannerWarningSvg
|
|
22
|
+
};
|
|
@@ -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"),D=require("../../utils/cn.cjs");require("react");const o=require("../../utils/generateBearId.utils.cjs"),R=require("../../utils/useBearId.cjs"),e=require("./StatCard.const.cjs"),L=({title:_,value:a,color:s=e.DEFAULT_STAT_CARD_COLOR,icon:T,onClick:t,className:S,id:d,testId:n,...i})=>{const u=R.useBearId("StatCard"),C=o.resolveBearId(d,u),c=`linear-gradient(135deg, ${s}${e.STAT_CARD_GRADIENT_START_ALPHA}, ${s}${e.STAT_CARD_GRADIENT_END_ALPHA})`;return A.jsxs("div",{id:C,"data-testid":n,role:t?"button":void 0,tabIndex:t?0:void 0,className:D.cn(e.STAT_CARD_ROOT_CLASS,e.STAT_CARD_BASE_CLASSES,S),style:{background:c},onClick:t,onKeyDown:r=>{t&&(r.key==="Enter"||r.key===" ")&&(r.preventDefault(),t())},...i,children:[A.jsx("div",{className:e.STAT_CARD_DECORATION_CLASS,"aria-hidden":!0}),A.jsxs("div",{className:e.STAT_CARD_BODY_CLASS,children:[A.jsx("p",{className:e.STAT_CARD_TITLE_CLASS,children:_}),A.jsx("p",{className:e.STAT_CARD_VALUE_CLASS,children:a}),t&&A.jsxs("button",{type:"button",className:e.STAT_CARD_ACTION_CLASS,children:[T,e.DEFAULT_STAT_CARD_ACTION_LABEL]})]})]})};exports.StatCard=L;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="Bear-StatCard",A="bear-relative bear-overflow-hidden bear-rounded-2xl bear-p-6 bear-transition-transform hover:bear-scale-105 bear-cursor-pointer bear-border bear-border-[var(--bear-border-default)]",r="Bear-StatCard__decoration bear-absolute bear-top-0 bear-right-0 bear-w-32 bear-h-32 -bear-mr-8 -bear-mt-8 bear-rounded-full bear-opacity-20 bear-bg-white",_="Bear-StatCard__body bear-relative bear-z-10",a="Bear-StatCard__title bear-text-white/80 bear-text-sm bear-font-medium bear-mb-1",t="Bear-StatCard__value bear-text-white bear-text-3xl bear-font-bold bear-mb-4",T="Bear-StatCard__action bear-flex bear-items-center bear-gap-2 bear-px-4 bear-py-1.5 bear-bg-white/20 hover:bear-bg-white/30 bear-rounded-full bear-text-white bear-text-sm bear-font-medium bear-transition-colors bear-border-0",S="#6366f1",b="dd",C="99",o="View All";exports.DEFAULT_STAT_CARD_ACTION_LABEL=o;exports.DEFAULT_STAT_CARD_COLOR=S;exports.STAT_CARD_ACTION_CLASS=T;exports.STAT_CARD_BASE_CLASSES=A;exports.STAT_CARD_BODY_CLASS=_;exports.STAT_CARD_DECORATION_CLASS=r;exports.STAT_CARD_GRADIENT_END_ALPHA=C;exports.STAT_CARD_GRADIENT_START_ALPHA=b;exports.STAT_CARD_ROOT_CLASS=e;exports.STAT_CARD_TITLE_CLASS=a;exports.STAT_CARD_VALUE_CLASS=t;
|
|
@@ -1 +1,11 @@
|
|
|
1
|
-
export declare const
|
|
1
|
+
export declare const STAT_CARD_ROOT_CLASS = "Bear-StatCard";
|
|
2
|
+
export declare const STAT_CARD_BASE_CLASSES = "bear-relative bear-overflow-hidden bear-rounded-2xl bear-p-6 bear-transition-transform hover:bear-scale-105 bear-cursor-pointer bear-border bear-border-[var(--bear-border-default)]";
|
|
3
|
+
export declare const STAT_CARD_DECORATION_CLASS = "Bear-StatCard__decoration bear-absolute bear-top-0 bear-right-0 bear-w-32 bear-h-32 -bear-mr-8 -bear-mt-8 bear-rounded-full bear-opacity-20 bear-bg-white";
|
|
4
|
+
export declare const STAT_CARD_BODY_CLASS = "Bear-StatCard__body bear-relative bear-z-10";
|
|
5
|
+
export declare const STAT_CARD_TITLE_CLASS = "Bear-StatCard__title bear-text-white/80 bear-text-sm bear-font-medium bear-mb-1";
|
|
6
|
+
export declare const STAT_CARD_VALUE_CLASS = "Bear-StatCard__value bear-text-white bear-text-3xl bear-font-bold bear-mb-4";
|
|
7
|
+
export declare const STAT_CARD_ACTION_CLASS = "Bear-StatCard__action bear-flex bear-items-center bear-gap-2 bear-px-4 bear-py-1.5 bear-bg-white/20 hover:bear-bg-white/30 bear-rounded-full bear-text-white bear-text-sm bear-font-medium bear-transition-colors bear-border-0";
|
|
8
|
+
export declare const DEFAULT_STAT_CARD_COLOR = "#6366f1";
|
|
9
|
+
export declare const STAT_CARD_GRADIENT_START_ALPHA = "dd";
|
|
10
|
+
export declare const STAT_CARD_GRADIENT_END_ALPHA = "99";
|
|
11
|
+
export declare const DEFAULT_STAT_CARD_ACTION_LABEL = "View All";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
const e = "Bear-StatCard", r = "bear-relative bear-overflow-hidden bear-rounded-2xl bear-p-6 bear-transition-transform hover:bear-scale-105 bear-cursor-pointer bear-border bear-border-[var(--bear-border-default)]", a = "Bear-StatCard__decoration bear-absolute bear-top-0 bear-right-0 bear-w-32 bear-h-32 -bear-mr-8 -bear-mt-8 bear-rounded-full bear-opacity-20 bear-bg-white", t = "Bear-StatCard__body bear-relative bear-z-10", b = "Bear-StatCard__title bear-text-white/80 bear-text-sm bear-font-medium bear-mb-1", _ = "Bear-StatCard__value bear-text-white bear-text-3xl bear-font-bold bear-mb-4", A = "Bear-StatCard__action bear-flex bear-items-center bear-gap-2 bear-px-4 bear-py-1.5 bear-bg-white/20 hover:bear-bg-white/30 bear-rounded-full bear-text-white bear-text-sm bear-font-medium bear-transition-colors bear-border-0", o = "#6366f1", S = "dd", T = "99", C = "View All";
|
|
2
|
+
export {
|
|
3
|
+
C as DEFAULT_STAT_CARD_ACTION_LABEL,
|
|
4
|
+
o as DEFAULT_STAT_CARD_COLOR,
|
|
5
|
+
A as STAT_CARD_ACTION_CLASS,
|
|
6
|
+
r as STAT_CARD_BASE_CLASSES,
|
|
7
|
+
t as STAT_CARD_BODY_CLASS,
|
|
8
|
+
a as STAT_CARD_DECORATION_CLASS,
|
|
9
|
+
T as STAT_CARD_GRADIENT_END_ALPHA,
|
|
10
|
+
S as STAT_CARD_GRADIENT_START_ALPHA,
|
|
11
|
+
e as STAT_CARD_ROOT_CLASS,
|
|
12
|
+
b as STAT_CARD_TITLE_CLASS,
|
|
13
|
+
_ as STAT_CARD_VALUE_CLASS
|
|
14
|
+
};
|
|
@@ -1,37 +1,49 @@
|
|
|
1
|
-
import { jsxs as e, jsx as
|
|
1
|
+
import { jsxs as e, jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import { cn as n } from "../../utils/cn.js";
|
|
3
3
|
import "react";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
4
|
+
import { resolveBearId as R } from "../../utils/generateBearId.utils.js";
|
|
5
|
+
import { useBearId as L } from "../../utils/useBearId.js";
|
|
6
|
+
import { DEFAULT_STAT_CARD_COLOR as E, STAT_CARD_GRADIENT_START_ALPHA as N, STAT_CARD_GRADIENT_END_ALPHA as c, STAT_CARD_DECORATION_CLASS as p, STAT_CARD_BODY_CLASS as I, STAT_CARD_TITLE_CLASS as l, STAT_CARD_VALUE_CLASS as u, DEFAULT_STAT_CARD_ACTION_LABEL as O, STAT_CARD_ACTION_CLASS as f, STAT_CARD_BASE_CLASSES as h, STAT_CARD_ROOT_CLASS as b } from "./StatCard.const.js";
|
|
7
|
+
const U = ({
|
|
8
|
+
title: t,
|
|
9
|
+
value: S,
|
|
10
|
+
color: T = E,
|
|
11
|
+
icon: a,
|
|
12
|
+
onClick: A,
|
|
13
|
+
className: d,
|
|
14
|
+
id: s,
|
|
15
|
+
testId: o,
|
|
16
|
+
...D
|
|
17
|
+
}) => {
|
|
18
|
+
const i = L("StatCard"), C = R(s, i), m = `linear-gradient(135deg, ${T}${N}, ${T}${c})`;
|
|
19
|
+
return /* @__PURE__ */ e(
|
|
20
|
+
"div",
|
|
21
|
+
{
|
|
22
|
+
id: C,
|
|
23
|
+
"data-testid": o,
|
|
24
|
+
role: A ? "button" : void 0,
|
|
25
|
+
tabIndex: A ? 0 : void 0,
|
|
26
|
+
className: n(b, h, d),
|
|
27
|
+
style: { background: m },
|
|
28
|
+
onClick: A,
|
|
29
|
+
onKeyDown: (_) => {
|
|
30
|
+
A && (_.key === "Enter" || _.key === " ") && (_.preventDefault(), A());
|
|
31
|
+
},
|
|
32
|
+
...D,
|
|
33
|
+
children: [
|
|
34
|
+
/* @__PURE__ */ r("div", { className: p, "aria-hidden": !0 }),
|
|
35
|
+
/* @__PURE__ */ e("div", { className: I, children: [
|
|
36
|
+
/* @__PURE__ */ r("p", { className: l, children: t }),
|
|
37
|
+
/* @__PURE__ */ r("p", { className: u, children: S }),
|
|
38
|
+
A && /* @__PURE__ */ e("button", { type: "button", className: f, children: [
|
|
39
|
+
a,
|
|
40
|
+
O
|
|
41
|
+
] })
|
|
30
42
|
] })
|
|
31
|
-
]
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
43
|
+
]
|
|
44
|
+
}
|
|
45
|
+
);
|
|
46
|
+
};
|
|
35
47
|
export {
|
|
36
|
-
|
|
48
|
+
U as StatCard
|
|
37
49
|
};
|