@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
|
@@ -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;
|
|
@@ -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 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;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { jsxs as N, jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as
|
|
2
|
+
import { forwardRef as Ie, useState as Ce, useContext as Te, useMemo as Se } from "react";
|
|
3
3
|
import { cn as s } from "../../utils/cn.js";
|
|
4
|
-
import { resolveBearId as
|
|
5
|
-
import { useBearId as
|
|
6
|
-
import { Spinner as
|
|
7
|
-
import { Typography as
|
|
8
|
-
import { useBearStyles as
|
|
4
|
+
import { resolveBearId as Me } from "../../utils/generateBearId.utils.js";
|
|
5
|
+
import { useBearId as $e } from "../../utils/useBearId.js";
|
|
6
|
+
import { Spinner as we } from "../Spinner/Spinner.js";
|
|
7
|
+
import { Typography as D } from "../Typography/Typography.js";
|
|
8
|
+
import { useBearStyles as Oe } from "../../hooks/useBearStyles.js";
|
|
9
9
|
import "../../hooks/useBearComponent/useBearComponent.js";
|
|
10
|
-
import { BearContext as
|
|
10
|
+
import { useBearDensityOptional as ke, BearContext as Ee } from "../../context/BearProvider.js";
|
|
11
11
|
import "../FormControl/FormControl.context.js";
|
|
12
|
-
import { VARIANT_DEFAULTS as
|
|
12
|
+
import { VARIANT_DEFAULTS as L, BUTTON_ICON_SIZE as P, BUTTON_VARIANT as Re, BUTTON_ICON_ONLY_SIZE as ze, BUTTON_COMPACT_SIZE as Ue, BUTTON_SIZE as Ve, BUTTON_RADIUS as Ae } from "./Button.constants.js";
|
|
13
13
|
import { isBuiltInVariant as Z } from "./Button.utils.js";
|
|
14
|
-
import { useSpotlight as
|
|
15
|
-
const
|
|
14
|
+
import { useSpotlight as De } from "./useSpotlight.js";
|
|
15
|
+
const Le = Ie(
|
|
16
16
|
(j, d) => {
|
|
17
17
|
var V, A;
|
|
18
18
|
const {
|
|
@@ -25,18 +25,18 @@ const Ve = ye(
|
|
|
25
25
|
iconPosition: I = "left",
|
|
26
26
|
leftIcon: F,
|
|
27
27
|
rightIcon: H,
|
|
28
|
-
textVariant:
|
|
28
|
+
textVariant: C = "inherit",
|
|
29
29
|
iconOnly: W = !1,
|
|
30
30
|
radius: X = "default",
|
|
31
31
|
ripple: q = !1,
|
|
32
32
|
disableRipple: G = !1,
|
|
33
33
|
disableElevation: J = !1,
|
|
34
|
-
href:
|
|
34
|
+
href: c,
|
|
35
35
|
component: K = "button",
|
|
36
36
|
tooltip: Q,
|
|
37
|
-
compact: ee
|
|
38
|
-
gradient:
|
|
39
|
-
gradientDirection:
|
|
37
|
+
compact: ee,
|
|
38
|
+
gradient: b,
|
|
39
|
+
gradientDirection: T = 135,
|
|
40
40
|
prefix: S,
|
|
41
41
|
suffix: M,
|
|
42
42
|
spotlight: $ = !1,
|
|
@@ -49,12 +49,12 @@ const Ve = ye(
|
|
|
49
49
|
testId: ie,
|
|
50
50
|
bis: se,
|
|
51
51
|
style: le,
|
|
52
|
-
onMouseMove:
|
|
53
|
-
onMouseEnter:
|
|
52
|
+
onMouseMove: ce,
|
|
53
|
+
onMouseEnter: be,
|
|
54
54
|
onMouseLeave: de,
|
|
55
55
|
onClick: g,
|
|
56
56
|
...ue
|
|
57
|
-
} = j, pe =
|
|
57
|
+
} = j, pe = $e("Button"), fe = Me(ne, pe), { density: me } = ke(), he = ee ?? me === "compact", w = q && !G, B = re || l, v = Oe(se, le), O = F ?? (u && I === "left" ? u : void 0), k = H ?? (u && I === "right" ? u : void 0), [E, R] = Ce(null), ge = (t) => {
|
|
58
58
|
if (w) {
|
|
59
59
|
const f = t.currentTarget.getBoundingClientRect(), m = Math.max(f.width, f.height) * 2;
|
|
60
60
|
R({
|
|
@@ -65,12 +65,12 @@ const Ve = ye(
|
|
|
65
65
|
}), setTimeout(() => R(null), 600);
|
|
66
66
|
}
|
|
67
67
|
g == null || g(t);
|
|
68
|
-
}, n =
|
|
68
|
+
}, n = Te(Ee), _ = ((A = (V = n == null ? void 0 : n.components) == null ? void 0 : V.Button) == null ? void 0 : A.root) || {}, z = (n == null ? void 0 : n.customVariants) || {}, y = !Z(e) && e in z, a = y ? z[e] : null, { spotlightRef: Be, position: U, isHovered: ve, handlers: x } = De({
|
|
69
69
|
enabled: $,
|
|
70
|
-
onMouseMove:
|
|
71
|
-
onMouseEnter:
|
|
70
|
+
onMouseMove: ce,
|
|
71
|
+
onMouseEnter: be,
|
|
72
72
|
onMouseLeave: de
|
|
73
|
-
}), i =
|
|
73
|
+
}), i = L[e] || L.primary, _e = Se(() => y && a ? {
|
|
74
74
|
backgroundColor: `var(--bear-${e}-bg, ${a.bg})`,
|
|
75
75
|
color: a.text || "#ffffff",
|
|
76
76
|
borderColor: a.border,
|
|
@@ -78,43 +78,43 @@ const Ve = ye(
|
|
|
78
78
|
..._,
|
|
79
79
|
...v
|
|
80
80
|
} : {
|
|
81
|
-
backgroundColor:
|
|
82
|
-
background:
|
|
81
|
+
backgroundColor: b ? void 0 : `var(--bear-btn-${e}-bg, ${i.bg})`,
|
|
82
|
+
background: b ? `linear-gradient(${T}deg, ${b[0]}, ${b[1]})` : void 0,
|
|
83
83
|
color: e === "outline" || e === "ghost" ? `var(--bear-btn-${e}-text, ${i.text || "inherit"})` : "white",
|
|
84
84
|
borderColor: e === "outline" ? `var(--bear-btn-${e}-border, ${i.border || i.bg})` : void 0,
|
|
85
85
|
"--bear-ring-color": `var(--bear-btn-${e}-ring, ${i.ring})`,
|
|
86
86
|
..._,
|
|
87
87
|
...v
|
|
88
|
-
}, [e, i, _, v,
|
|
89
|
-
|
|
90
|
-
},
|
|
88
|
+
}, [e, i, _, v, y, a, b, T]), ye = (t) => {
|
|
89
|
+
Be.current = t, typeof d == "function" ? d(t) : d && (d.current = t);
|
|
90
|
+
}, xe = c ? "a" : K, Ne = c ? { href: B ? void 0 : c } : {};
|
|
91
91
|
return /* @__PURE__ */ N(
|
|
92
|
-
|
|
92
|
+
xe,
|
|
93
93
|
{
|
|
94
|
-
ref:
|
|
94
|
+
ref: ye,
|
|
95
95
|
id: fe,
|
|
96
|
-
disabled:
|
|
97
|
-
"aria-disabled":
|
|
96
|
+
disabled: c ? void 0 : B,
|
|
97
|
+
"aria-disabled": c && B ? !0 : void 0,
|
|
98
98
|
"aria-busy": l || void 0,
|
|
99
|
-
style:
|
|
99
|
+
style: _e,
|
|
100
100
|
title: Q,
|
|
101
101
|
className: s(
|
|
102
102
|
"Bear-Button",
|
|
103
103
|
"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",
|
|
104
104
|
!J && "bear-shadow-sm",
|
|
105
|
-
|
|
106
|
-
W ?
|
|
107
|
-
Z(e) ?
|
|
105
|
+
Ae[X],
|
|
106
|
+
W ? ze[o] : he ? Ue[o] : Ve[o],
|
|
107
|
+
Z(e) ? Re[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",
|
|
108
108
|
Y && "bear-w-full",
|
|
109
109
|
l && "bear-cursor-wait",
|
|
110
110
|
ae
|
|
111
111
|
),
|
|
112
112
|
"data-testid": ie,
|
|
113
|
-
onClick:
|
|
114
|
-
onMouseMove:
|
|
115
|
-
onMouseEnter:
|
|
116
|
-
onMouseLeave:
|
|
117
|
-
...
|
|
113
|
+
onClick: ge,
|
|
114
|
+
onMouseMove: x.handleMouseMove,
|
|
115
|
+
onMouseEnter: x.handleMouseEnter,
|
|
116
|
+
onMouseLeave: x.handleMouseLeave,
|
|
117
|
+
...Ne,
|
|
118
118
|
...ue,
|
|
119
119
|
children: [
|
|
120
120
|
$ && /* @__PURE__ */ r(
|
|
@@ -124,7 +124,7 @@ const Ve = ye(
|
|
|
124
124
|
"Bear-Button__spotlight",
|
|
125
125
|
"bear-absolute bear-left-0 bear-top-0 bear-rounded-full bear-pointer-events-none bear-z-[1]",
|
|
126
126
|
"bear-transition-opacity bear-duration-150 bear-ease-out",
|
|
127
|
-
|
|
127
|
+
ve ? "bear-opacity-100" : "bear-opacity-0"
|
|
128
128
|
),
|
|
129
129
|
"aria-hidden": "true",
|
|
130
130
|
style: {
|
|
@@ -140,8 +140,8 @@ const Ve = ye(
|
|
|
140
140
|
"Bear-Button__loading bear-inline-flex bear-items-center bear-gap-2 bear-relative bear-z-10",
|
|
141
141
|
!h && "bear-absolute"
|
|
142
142
|
), children: [
|
|
143
|
-
/* @__PURE__ */ r(
|
|
144
|
-
h && /* @__PURE__ */ r(
|
|
143
|
+
/* @__PURE__ */ r(we, { size: o === "xs" ? "xs" : "sm", className: "Bear-Button__spinner" }),
|
|
144
|
+
h && /* @__PURE__ */ r(D, { variant: C, className: "Bear-Button__text", children: h })
|
|
145
145
|
] }),
|
|
146
146
|
/* @__PURE__ */ N(
|
|
147
147
|
"span",
|
|
@@ -152,9 +152,9 @@ const Ve = ye(
|
|
|
152
152
|
),
|
|
153
153
|
children: [
|
|
154
154
|
S && /* @__PURE__ */ r("span", { className: "Bear-Button__prefix bear-inline-flex bear-shrink-0", children: S }),
|
|
155
|
-
O && /* @__PURE__ */ r("span", { className: s("Bear-Button__icon Bear-Button__icon--left bear-inline-flex bear-shrink-0",
|
|
156
|
-
/* @__PURE__ */ r(
|
|
157
|
-
k && /* @__PURE__ */ r("span", { className: s("Bear-Button__icon Bear-Button__icon--right bear-inline-flex bear-shrink-0",
|
|
155
|
+
O && /* @__PURE__ */ r("span", { className: s("Bear-Button__icon Bear-Button__icon--left bear-inline-flex bear-shrink-0", P[o]), children: O }),
|
|
156
|
+
/* @__PURE__ */ r(D, { variant: C, className: "Bear-Button__text", children: oe }),
|
|
157
|
+
k && /* @__PURE__ */ r("span", { className: s("Bear-Button__icon Bear-Button__icon--right bear-inline-flex bear-shrink-0", P[o]), children: k }),
|
|
158
158
|
M && /* @__PURE__ */ r("span", { className: "Bear-Button__suffix bear-inline-flex bear-shrink-0", children: M })
|
|
159
159
|
]
|
|
160
160
|
}
|
|
@@ -172,7 +172,7 @@ const Ve = ye(
|
|
|
172
172
|
);
|
|
173
173
|
}
|
|
174
174
|
);
|
|
175
|
-
|
|
175
|
+
Le.displayName = "Button";
|
|
176
176
|
export {
|
|
177
|
-
|
|
177
|
+
Le as Button
|
|
178
178
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),e=require("./Chip.const.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),e=require("./Chip.const.cjs"),l=require("../../utils/cn.cjs");require("react");const P=require("../../utils/generateBearId.utils.cjs"),A=require("../../utils/useBearId.cjs"),v=require("../../context/BearProvider.cjs"),E=c=>{const{children:_,variant:d="filled",color:C="default",size:s="md",icon:t,avatar:o,onDelete:i,onClick:n,disabled:a=!1,className:u,id:b,testId:S}=c,I=A.useBearId("Chip"),p=P.resolveBearId(b,I),{density:m}=v.useBearDensityOptional(),O=m==="compact"?e.CHIP_SIZE_COMPACT_CLASSES:e.CHIP_SIZE_CLASSES,h=n?"button":"span";return r.jsxs(h,{id:p,"data-testid":S,onClick:n,disabled:a,className:l.cn(e.C_H_I_P_ROOT_CLASS,"bear-inline-flex bear-items-center bear-rounded-full bear-font-medium bear-transition-all",O[s],o&&e.CHIP_AVATAR_SIZE_CLASSES[s],e.CHIP_COLOR_CLASSES[d][C],n&&!a&&"bear-cursor-pointer hover:bear-opacity-80",a&&"bear-opacity-50 bear-cursor-not-allowed",u),children:[o&&r.jsx("span",{className:`${e.C_H_I_P_ROOT_CLASS}__avatar bear--ml-1`,children:o}),t&&r.jsx("span",{className:`${e.C_H_I_P_ROOT_CLASS}__icon`,children:t}),r.jsx("span",{className:`${e.C_H_I_P_ROOT_CLASS}__label`,children:_}),i&&r.jsx("button",{type:"button",onClick:L=>{L.stopPropagation(),i()},disabled:a,className:l.cn(`${e.C_H_I_P_ROOT_CLASS}__delete`,"bear-ml-1 bear-rounded-full bear-p-0.5 hover:bear-bg-black/10 dark:hover:bear-bg-black/20 bear-transition-colors",a&&"bear-cursor-not-allowed"),"aria-label":"Remove",children:r.jsx("svg",{className:e.CHIP_DELETE_ICON_SIZES[s],fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})};exports.Chip=E;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="Bear-Chip",r={filled:{default:"bear-bg-gray-600 bear-text-white dark:bear-bg-zinc-600",primary:"bear-bg-primary-500 bear-text-white",secondary:"bear-bg-purple-500 bear-text-white",success:"bear-bg-green-500 bear-text-white",warning:"bear-bg-yellow-500 bear-text-black",error:"bear-bg-red-500 bear-text-white",info:"bear-bg-blue-500 bear-text-white"},outlined:{default:"bear-border bear-border-gray-400 bear-text-gray-700 dark:bear-border-zinc-500 dark:bear-text-zinc-300",primary:"bear-border bear-border-primary-500 bear-text-primary-600 dark:bear-text-primary-400",secondary:"bear-border bear-border-purple-500 bear-text-purple-600 dark:bear-text-purple-400",success:"bear-border bear-border-green-500 bear-text-green-700 dark:bear-text-green-400",warning:"bear-border bear-border-yellow-500 bear-text-yellow-700 dark:bear-text-yellow-400",error:"bear-border bear-border-red-500 bear-text-red-600 dark:bear-text-red-400",info:"bear-border bear-border-blue-500 bear-text-blue-600 dark:bear-text-blue-400"},soft:{default:"bear-bg-gray-500/15 bear-text-gray-700 dark:bear-bg-zinc-500/20 dark:bear-text-zinc-300",primary:"bear-bg-primary-500/15 bear-text-primary-700 dark:bear-bg-primary-500/20 dark:bear-text-primary-400",secondary:"bear-bg-purple-500/15 bear-text-purple-700 dark:bear-bg-purple-500/20 dark:bear-text-purple-400",success:"bear-bg-green-500/15 bear-text-green-700 dark:bear-bg-green-500/20 dark:bear-text-green-400",warning:"bear-bg-yellow-500/15 bear-text-yellow-800 dark:bear-bg-yellow-500/20 dark:bear-text-yellow-400",error:"bear-bg-red-500/15 bear-text-red-700 dark:bear-bg-red-500/20 dark:bear-text-red-400",info:"bear-bg-blue-500/15 bear-text-blue-700 dark:bear-bg-blue-500/20 dark:bear-text-blue-400"}},a={sm:"bear-h-6 bear-text-xs bear-px-2 bear-gap-1",md:"bear-h-8 bear-text-sm bear-px-3 bear-gap-1.5",lg:"bear-h-10 bear-text-base bear-px-4 bear-gap-2"},b={sm:"bear-w-3 bear-h-3",md:"bear-w-4 bear-h-4",lg:"bear-w-5 bear-h-5"};exports.CHIP_COLOR_CLASSES=r;exports.CHIP_DELETE_ICON_SIZES=
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="Bear-Chip",r={filled:{default:"bear-bg-gray-600 bear-text-white dark:bear-bg-zinc-600",primary:"bear-bg-primary-500 bear-text-white",secondary:"bear-bg-purple-500 bear-text-white",success:"bear-bg-green-500 bear-text-white",warning:"bear-bg-yellow-500 bear-text-black",error:"bear-bg-red-500 bear-text-white",info:"bear-bg-blue-500 bear-text-white"},outlined:{default:"bear-border bear-border-gray-400 bear-text-gray-700 dark:bear-border-zinc-500 dark:bear-text-zinc-300",primary:"bear-border bear-border-primary-500 bear-text-primary-600 dark:bear-text-primary-400",secondary:"bear-border bear-border-purple-500 bear-text-purple-600 dark:bear-text-purple-400",success:"bear-border bear-border-green-500 bear-text-green-700 dark:bear-text-green-400",warning:"bear-border bear-border-yellow-500 bear-text-yellow-700 dark:bear-text-yellow-400",error:"bear-border bear-border-red-500 bear-text-red-600 dark:bear-text-red-400",info:"bear-border bear-border-blue-500 bear-text-blue-600 dark:bear-text-blue-400"},soft:{default:"bear-bg-gray-500/15 bear-text-gray-700 dark:bear-bg-zinc-500/20 dark:bear-text-zinc-300",primary:"bear-bg-primary-500/15 bear-text-primary-700 dark:bear-bg-primary-500/20 dark:bear-text-primary-400",secondary:"bear-bg-purple-500/15 bear-text-purple-700 dark:bear-bg-purple-500/20 dark:bear-text-purple-400",success:"bear-bg-green-500/15 bear-text-green-700 dark:bear-bg-green-500/20 dark:bear-text-green-400",warning:"bear-bg-yellow-500/15 bear-text-yellow-800 dark:bear-bg-yellow-500/20 dark:bear-text-yellow-400",error:"bear-bg-red-500/15 bear-text-red-700 dark:bear-bg-red-500/20 dark:bear-text-red-400",info:"bear-bg-blue-500/15 bear-text-blue-700 dark:bear-bg-blue-500/20 dark:bear-text-blue-400"}},a={sm:"bear-h-6 bear-text-xs bear-px-2 bear-gap-1",md:"bear-h-8 bear-text-sm bear-px-3 bear-gap-1.5",lg:"bear-h-10 bear-text-base bear-px-4 bear-gap-2"},b={sm:"bear-h-5 bear-text-xs bear-px-1.5 bear-gap-0.5",md:"bear-h-6 bear-text-xs bear-px-2 bear-gap-1",lg:"bear-h-8 bear-text-sm bear-px-3 bear-gap-1.5"},t={sm:"[&_.Bear-Avatar]:bear-w-4 [&_.Bear-Avatar]:bear-h-4",md:"[&_.Bear-Avatar]:bear-w-5 [&_.Bear-Avatar]:bear-h-5",lg:"[&_.Bear-Avatar]:bear-w-6 [&_.Bear-Avatar]:bear-h-6"},d={sm:"bear-w-3 bear-h-3",md:"bear-w-4 bear-h-4",lg:"bear-w-5 bear-h-5"};exports.CHIP_AVATAR_SIZE_CLASSES=t;exports.CHIP_COLOR_CLASSES=r;exports.CHIP_DELETE_ICON_SIZES=d;exports.CHIP_SIZE_CLASSES=a;exports.CHIP_SIZE_COMPACT_CLASSES=b;exports.C_H_I_P_ROOT_CLASS=e;
|
|
@@ -33,6 +33,16 @@ export declare const CHIP_SIZE_CLASSES: {
|
|
|
33
33
|
readonly md: "bear-h-8 bear-text-sm bear-px-3 bear-gap-1.5";
|
|
34
34
|
readonly lg: "bear-h-10 bear-text-base bear-px-4 bear-gap-2";
|
|
35
35
|
};
|
|
36
|
+
export declare const CHIP_SIZE_COMPACT_CLASSES: {
|
|
37
|
+
readonly sm: "bear-h-5 bear-text-xs bear-px-1.5 bear-gap-0.5";
|
|
38
|
+
readonly md: "bear-h-6 bear-text-xs bear-px-2 bear-gap-1";
|
|
39
|
+
readonly lg: "bear-h-8 bear-text-sm bear-px-3 bear-gap-1.5";
|
|
40
|
+
};
|
|
41
|
+
export declare const CHIP_AVATAR_SIZE_CLASSES: {
|
|
42
|
+
readonly sm: "[&_.Bear-Avatar]:bear-w-4 [&_.Bear-Avatar]:bear-h-4";
|
|
43
|
+
readonly md: "[&_.Bear-Avatar]:bear-w-5 [&_.Bear-Avatar]:bear-h-5";
|
|
44
|
+
readonly lg: "[&_.Bear-Avatar]:bear-w-6 [&_.Bear-Avatar]:bear-h-6";
|
|
45
|
+
};
|
|
36
46
|
export declare const CHIP_DELETE_ICON_SIZES: {
|
|
37
47
|
readonly sm: "bear-w-3 bear-h-3";
|
|
38
48
|
readonly md: "bear-w-4 bear-h-4";
|
|
@@ -31,13 +31,23 @@ const e = "Bear-Chip", r = {
|
|
|
31
31
|
md: "bear-h-8 bear-text-sm bear-px-3 bear-gap-1.5",
|
|
32
32
|
lg: "bear-h-10 bear-text-base bear-px-4 bear-gap-2"
|
|
33
33
|
}, b = {
|
|
34
|
+
sm: "bear-h-5 bear-text-xs bear-px-1.5 bear-gap-0.5",
|
|
35
|
+
md: "bear-h-6 bear-text-xs bear-px-2 bear-gap-1",
|
|
36
|
+
lg: "bear-h-8 bear-text-sm bear-px-3 bear-gap-1.5"
|
|
37
|
+
}, t = {
|
|
38
|
+
sm: "[&_.Bear-Avatar]:bear-w-4 [&_.Bear-Avatar]:bear-h-4",
|
|
39
|
+
md: "[&_.Bear-Avatar]:bear-w-5 [&_.Bear-Avatar]:bear-h-5",
|
|
40
|
+
lg: "[&_.Bear-Avatar]:bear-w-6 [&_.Bear-Avatar]:bear-h-6"
|
|
41
|
+
}, d = {
|
|
34
42
|
sm: "bear-w-3 bear-h-3",
|
|
35
43
|
md: "bear-w-4 bear-h-4",
|
|
36
44
|
lg: "bear-w-5 bear-h-5"
|
|
37
45
|
};
|
|
38
46
|
export {
|
|
47
|
+
t as CHIP_AVATAR_SIZE_CLASSES,
|
|
39
48
|
r as CHIP_COLOR_CLASSES,
|
|
40
|
-
|
|
49
|
+
d as CHIP_DELETE_ICON_SIZES,
|
|
41
50
|
a as CHIP_SIZE_CLASSES,
|
|
51
|
+
b as CHIP_SIZE_COMPACT_CLASSES,
|
|
42
52
|
e as C_H_I_P_ROOT_CLASS
|
|
43
53
|
};
|