@forgedevstack/bear 1.2.5 → 1.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -1
- package/dist/components/AppBar/AppBar.cjs +1 -1
- package/dist/components/AppBar/AppBar.const.cjs +1 -0
- package/dist/components/AppBar/AppBar.const.d.ts +36 -1
- package/dist/components/AppBar/AppBar.const.js +39 -0
- package/dist/components/AppBar/AppBar.js +66 -42
- package/dist/components/AppBar/AppBar.types.d.ts +9 -3
- package/dist/components/Autocomplete/Autocomplete.cjs +1 -1
- package/dist/components/Autocomplete/Autocomplete.js +32 -32
- package/dist/components/Backdrop/Backdrop.cjs +1 -0
- package/dist/components/Backdrop/Backdrop.const.cjs +1 -0
- package/dist/components/Backdrop/Backdrop.const.d.ts +8 -0
- package/dist/components/Backdrop/Backdrop.const.js +11 -0
- package/dist/components/Backdrop/Backdrop.d.ts +3 -0
- package/dist/components/Backdrop/Backdrop.js +50 -0
- package/dist/components/Backdrop/Backdrop.types.d.ts +14 -0
- package/dist/components/Backdrop/index.d.ts +2 -0
- package/dist/components/BottomNavigation/BottomNavigation.cjs +1 -1
- package/dist/components/BottomNavigation/BottomNavigation.const.cjs +1 -0
- package/dist/components/BottomNavigation/BottomNavigation.const.d.ts +8 -1
- package/dist/components/BottomNavigation/BottomNavigation.const.js +11 -0
- package/dist/components/BottomNavigation/BottomNavigation.js +64 -46
- package/dist/components/Breadcrumbs/Breadcrumbs.cjs +1 -1
- package/dist/components/Breadcrumbs/Breadcrumbs.js +65 -64
- 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 -0
- package/dist/components/Chip/Chip.const.d.ts +49 -0
- package/dist/components/Chip/Chip.const.js +53 -0
- package/dist/components/Chip/Chip.js +46 -65
- package/dist/components/ChipGroup/ChipGroup.cjs +1 -0
- package/dist/components/ChipGroup/ChipGroup.const.cjs +1 -0
- package/dist/components/ChipGroup/ChipGroup.const.d.ts +11 -0
- package/dist/components/ChipGroup/ChipGroup.const.js +14 -0
- package/dist/components/ChipGroup/ChipGroup.d.ts +3 -0
- package/dist/components/ChipGroup/ChipGroup.js +95 -0
- package/dist/components/ChipGroup/ChipGroup.types.d.ts +14 -0
- package/dist/components/ChipGroup/index.d.ts +2 -0
- package/dist/components/Drawer/Drawer.cjs +1 -1
- package/dist/components/Drawer/Drawer.js +68 -64
- 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 +108 -107
- package/dist/components/List/List.cjs +1 -1
- package/dist/components/List/List.js +133 -123
- package/dist/components/List/List.types.d.ts +2 -0
- package/dist/components/MessageList/MessageList.cjs +1 -1
- package/dist/components/MessageList/MessageList.const.cjs +1 -1
- package/dist/components/MessageList/MessageList.const.d.ts +6 -0
- package/dist/components/MessageList/MessageList.const.js +26 -20
- package/dist/components/MessageList/MessageList.d.ts +0 -16
- package/dist/components/MessageList/MessageList.js +133 -115
- package/dist/components/MessageList/MessageList.types.d.ts +4 -0
- package/dist/components/MessageList/MessageList.utils.cjs +1 -1
- package/dist/components/MessageList/MessageList.utils.d.ts +7 -0
- package/dist/components/MessageList/MessageList.utils.js +47 -28
- 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/Progress/Progress.cjs +1 -1
- package/dist/components/Progress/Progress.const.cjs +1 -0
- package/dist/components/Progress/Progress.const.d.ts +16 -1
- package/dist/components/Progress/Progress.const.js +19 -0
- package/dist/components/Progress/Progress.d.ts +0 -10
- package/dist/components/Progress/Progress.js +81 -71
- package/dist/components/Progress/Progress.types.d.ts +2 -11
- package/dist/components/PropsPlayground/PropsPlayground.cjs +1 -1
- package/dist/components/PropsPlayground/PropsPlayground.js +40 -40
- package/dist/components/Select/Select.cjs +1 -1
- package/dist/components/Select/Select.const.cjs +1 -0
- package/dist/components/Select/Select.const.d.ts +9 -0
- package/dist/components/Select/Select.const.js +13 -0
- package/dist/components/Select/Select.js +151 -66
- 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/Stepper/Stepper.cjs +1 -1
- package/dist/components/Stepper/Stepper.js +89 -83
- 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 -0
- package/dist/components/Toast/Toast.const.d.ts +4 -0
- package/dist/components/Toast/Toast.const.js +9 -0
- package/dist/components/Toast/Toast.d.ts +0 -1
- package/dist/components/Toast/Toast.js +111 -101
- package/dist/components/index.cjs +1 -1
- package/dist/components/index.d.ts +6 -0
- package/dist/components/index.js +285 -279
- package/dist/context/BearProvider.cjs +1 -1
- package/dist/context/BearProvider.d.ts +8 -0
- package/dist/context/BearProvider.js +149 -139
- package/dist/context/index.cjs +1 -1
- package/dist/context/index.d.ts +1 -1
- package/dist/context/index.js +12 -10
- 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 +464 -443
- package/dist/styles.css +67 -23
- 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
|
@@ -1 +1,50 @@
|
|
|
1
1
|
export declare const C_H_I_P_ROOT_CLASS = "Bear-Chip";
|
|
2
|
+
export declare const CHIP_COLOR_CLASSES: {
|
|
3
|
+
readonly filled: {
|
|
4
|
+
readonly default: "bear-bg-gray-600 bear-text-white dark:bear-bg-zinc-600";
|
|
5
|
+
readonly primary: "bear-bg-primary-500 bear-text-white";
|
|
6
|
+
readonly secondary: "bear-bg-purple-500 bear-text-white";
|
|
7
|
+
readonly success: "bear-bg-green-500 bear-text-white";
|
|
8
|
+
readonly warning: "bear-bg-yellow-500 bear-text-black";
|
|
9
|
+
readonly error: "bear-bg-red-500 bear-text-white";
|
|
10
|
+
readonly info: "bear-bg-blue-500 bear-text-white";
|
|
11
|
+
};
|
|
12
|
+
readonly outlined: {
|
|
13
|
+
readonly default: "bear-border bear-border-gray-400 bear-text-gray-700 dark:bear-border-zinc-500 dark:bear-text-zinc-300";
|
|
14
|
+
readonly primary: "bear-border bear-border-primary-500 bear-text-primary-600 dark:bear-text-primary-400";
|
|
15
|
+
readonly secondary: "bear-border bear-border-purple-500 bear-text-purple-600 dark:bear-text-purple-400";
|
|
16
|
+
readonly success: "bear-border bear-border-green-500 bear-text-green-700 dark:bear-text-green-400";
|
|
17
|
+
readonly warning: "bear-border bear-border-yellow-500 bear-text-yellow-700 dark:bear-text-yellow-400";
|
|
18
|
+
readonly error: "bear-border bear-border-red-500 bear-text-red-600 dark:bear-text-red-400";
|
|
19
|
+
readonly info: "bear-border bear-border-blue-500 bear-text-blue-600 dark:bear-text-blue-400";
|
|
20
|
+
};
|
|
21
|
+
readonly soft: {
|
|
22
|
+
readonly default: "bear-bg-gray-500/15 bear-text-gray-700 dark:bear-bg-zinc-500/20 dark:bear-text-zinc-300";
|
|
23
|
+
readonly primary: "bear-bg-primary-500/15 bear-text-primary-700 dark:bear-bg-primary-500/20 dark:bear-text-primary-400";
|
|
24
|
+
readonly secondary: "bear-bg-purple-500/15 bear-text-purple-700 dark:bear-bg-purple-500/20 dark:bear-text-purple-400";
|
|
25
|
+
readonly success: "bear-bg-green-500/15 bear-text-green-700 dark:bear-bg-green-500/20 dark:bear-text-green-400";
|
|
26
|
+
readonly warning: "bear-bg-yellow-500/15 bear-text-yellow-800 dark:bear-bg-yellow-500/20 dark:bear-text-yellow-400";
|
|
27
|
+
readonly error: "bear-bg-red-500/15 bear-text-red-700 dark:bear-bg-red-500/20 dark:bear-text-red-400";
|
|
28
|
+
readonly info: "bear-bg-blue-500/15 bear-text-blue-700 dark:bear-bg-blue-500/20 dark:bear-text-blue-400";
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
export declare const CHIP_SIZE_CLASSES: {
|
|
32
|
+
readonly sm: "bear-h-6 bear-text-xs bear-px-2 bear-gap-1";
|
|
33
|
+
readonly md: "bear-h-8 bear-text-sm bear-px-3 bear-gap-1.5";
|
|
34
|
+
readonly lg: "bear-h-10 bear-text-base bear-px-4 bear-gap-2";
|
|
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
|
+
};
|
|
46
|
+
export declare const CHIP_DELETE_ICON_SIZES: {
|
|
47
|
+
readonly sm: "bear-w-3 bear-h-3";
|
|
48
|
+
readonly md: "bear-w-4 bear-h-4";
|
|
49
|
+
readonly lg: "bear-w-5 bear-h-5";
|
|
50
|
+
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
const e = "Bear-Chip", r = {
|
|
2
|
+
filled: {
|
|
3
|
+
default: "bear-bg-gray-600 bear-text-white dark:bear-bg-zinc-600",
|
|
4
|
+
primary: "bear-bg-primary-500 bear-text-white",
|
|
5
|
+
secondary: "bear-bg-purple-500 bear-text-white",
|
|
6
|
+
success: "bear-bg-green-500 bear-text-white",
|
|
7
|
+
warning: "bear-bg-yellow-500 bear-text-black",
|
|
8
|
+
error: "bear-bg-red-500 bear-text-white",
|
|
9
|
+
info: "bear-bg-blue-500 bear-text-white"
|
|
10
|
+
},
|
|
11
|
+
outlined: {
|
|
12
|
+
default: "bear-border bear-border-gray-400 bear-text-gray-700 dark:bear-border-zinc-500 dark:bear-text-zinc-300",
|
|
13
|
+
primary: "bear-border bear-border-primary-500 bear-text-primary-600 dark:bear-text-primary-400",
|
|
14
|
+
secondary: "bear-border bear-border-purple-500 bear-text-purple-600 dark:bear-text-purple-400",
|
|
15
|
+
success: "bear-border bear-border-green-500 bear-text-green-700 dark:bear-text-green-400",
|
|
16
|
+
warning: "bear-border bear-border-yellow-500 bear-text-yellow-700 dark:bear-text-yellow-400",
|
|
17
|
+
error: "bear-border bear-border-red-500 bear-text-red-600 dark:bear-text-red-400",
|
|
18
|
+
info: "bear-border bear-border-blue-500 bear-text-blue-600 dark:bear-text-blue-400"
|
|
19
|
+
},
|
|
20
|
+
soft: {
|
|
21
|
+
default: "bear-bg-gray-500/15 bear-text-gray-700 dark:bear-bg-zinc-500/20 dark:bear-text-zinc-300",
|
|
22
|
+
primary: "bear-bg-primary-500/15 bear-text-primary-700 dark:bear-bg-primary-500/20 dark:bear-text-primary-400",
|
|
23
|
+
secondary: "bear-bg-purple-500/15 bear-text-purple-700 dark:bear-bg-purple-500/20 dark:bear-text-purple-400",
|
|
24
|
+
success: "bear-bg-green-500/15 bear-text-green-700 dark:bear-bg-green-500/20 dark:bear-text-green-400",
|
|
25
|
+
warning: "bear-bg-yellow-500/15 bear-text-yellow-800 dark:bear-bg-yellow-500/20 dark:bear-text-yellow-400",
|
|
26
|
+
error: "bear-bg-red-500/15 bear-text-red-700 dark:bear-bg-red-500/20 dark:bear-text-red-400",
|
|
27
|
+
info: "bear-bg-blue-500/15 bear-text-blue-700 dark:bear-bg-blue-500/20 dark:bear-text-blue-400"
|
|
28
|
+
}
|
|
29
|
+
}, a = {
|
|
30
|
+
sm: "bear-h-6 bear-text-xs bear-px-2 bear-gap-1",
|
|
31
|
+
md: "bear-h-8 bear-text-sm bear-px-3 bear-gap-1.5",
|
|
32
|
+
lg: "bear-h-10 bear-text-base bear-px-4 bear-gap-2"
|
|
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 = {
|
|
42
|
+
sm: "bear-w-3 bear-h-3",
|
|
43
|
+
md: "bear-w-4 bear-h-4",
|
|
44
|
+
lg: "bear-w-5 bear-h-5"
|
|
45
|
+
};
|
|
46
|
+
export {
|
|
47
|
+
t as CHIP_AVATAR_SIZE_CLASSES,
|
|
48
|
+
r as CHIP_COLOR_CLASSES,
|
|
49
|
+
d as CHIP_DELETE_ICON_SIZES,
|
|
50
|
+
a as CHIP_SIZE_CLASSES,
|
|
51
|
+
b as CHIP_SIZE_COMPACT_CLASSES,
|
|
52
|
+
e as C_H_I_P_ROOT_CLASS
|
|
53
|
+
};
|
|
@@ -1,80 +1,61 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import {
|
|
1
|
+
import { jsxs as h, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { C_H_I_P_ROOT_CLASS as a, CHIP_DELETE_ICON_SIZES as E, CHIP_COLOR_CLASSES as v, CHIP_AVATAR_SIZE_CLASSES as L, CHIP_SIZE_COMPACT_CLASSES as k, CHIP_SIZE_CLASSES as A } from "./Chip.const.js";
|
|
3
|
+
import { cn as i } from "../../utils/cn.js";
|
|
3
4
|
import "react";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
info: "bear-bg-blue-500 bear-text-white"
|
|
25
|
-
},
|
|
26
|
-
outlined: {
|
|
27
|
-
default: "bear-border bear-border-zinc-500 bear-text-zinc-300",
|
|
28
|
-
primary: "bear-border bear-border-primary-500 bear-text-primary-400",
|
|
29
|
-
secondary: "bear-border bear-border-purple-500 bear-text-purple-400",
|
|
30
|
-
success: "bear-border bear-border-green-500 bear-text-green-400",
|
|
31
|
-
warning: "bear-border bear-border-yellow-500 bear-text-yellow-400",
|
|
32
|
-
error: "bear-border bear-border-red-500 bear-text-red-400",
|
|
33
|
-
info: "bear-border bear-border-blue-500 bear-text-blue-400"
|
|
34
|
-
},
|
|
35
|
-
soft: {
|
|
36
|
-
default: "bear-bg-zinc-500/20 bear-text-zinc-300",
|
|
37
|
-
primary: "bear-bg-primary-500/20 bear-text-primary-400",
|
|
38
|
-
secondary: "bear-bg-purple-500/20 bear-text-purple-400",
|
|
39
|
-
success: "bear-bg-green-500/20 bear-text-green-400",
|
|
40
|
-
warning: "bear-bg-yellow-500/20 bear-text-yellow-400",
|
|
41
|
-
error: "bear-bg-red-500/20 bear-text-red-400",
|
|
42
|
-
info: "bear-bg-blue-500/20 bear-text-blue-400"
|
|
43
|
-
}
|
|
44
|
-
}, x = {
|
|
45
|
-
sm: "bear-h-6 bear-text-xs bear-px-2 bear-gap-1",
|
|
46
|
-
md: "bear-h-8 bear-text-sm bear-px-3 bear-gap-1.5",
|
|
47
|
-
lg: "bear-h-10 bear-text-base bear-px-4 bear-gap-2"
|
|
48
|
-
}, u = { sm: "bear-w-3 bear-h-3", md: "bear-w-4 bear-h-4", lg: "bear-w-5 bear-h-5" };
|
|
49
|
-
return /* @__PURE__ */ m(
|
|
50
|
-
a ? "button" : "span",
|
|
5
|
+
import { resolveBearId as N } from "../../utils/generateBearId.utils.js";
|
|
6
|
+
import { useBearId as P } from "../../utils/useBearId.js";
|
|
7
|
+
import { useBearDensityOptional as O } from "../../context/BearProvider.js";
|
|
8
|
+
const j = (c) => {
|
|
9
|
+
const {
|
|
10
|
+
children: d,
|
|
11
|
+
variant: m = "filled",
|
|
12
|
+
color: b = "default",
|
|
13
|
+
size: o = "md",
|
|
14
|
+
icon: n,
|
|
15
|
+
avatar: t,
|
|
16
|
+
onDelete: l,
|
|
17
|
+
onClick: s,
|
|
18
|
+
disabled: r = !1,
|
|
19
|
+
className: p,
|
|
20
|
+
id: _,
|
|
21
|
+
testId: C
|
|
22
|
+
} = c, S = P("Chip"), u = N(_, S), { density: I } = O();
|
|
23
|
+
return /* @__PURE__ */ h(
|
|
24
|
+
s ? "button" : "span",
|
|
51
25
|
{
|
|
52
|
-
|
|
26
|
+
id: u,
|
|
27
|
+
"data-testid": C,
|
|
28
|
+
onClick: s,
|
|
53
29
|
disabled: r,
|
|
54
|
-
className:
|
|
30
|
+
className: i(
|
|
31
|
+
a,
|
|
55
32
|
"bear-inline-flex bear-items-center bear-rounded-full bear-font-medium bear-transition-all",
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
33
|
+
(I === "compact" ? k : A)[o],
|
|
34
|
+
t && L[o],
|
|
35
|
+
v[m][b],
|
|
36
|
+
s && !r && "bear-cursor-pointer hover:bear-opacity-80",
|
|
59
37
|
r && "bear-opacity-50 bear-cursor-not-allowed",
|
|
60
|
-
|
|
38
|
+
p
|
|
61
39
|
),
|
|
62
40
|
children: [
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
/* @__PURE__ */ e("span", { children:
|
|
66
|
-
|
|
41
|
+
t && /* @__PURE__ */ e("span", { className: `${a}__avatar bear--ml-1`, children: t }),
|
|
42
|
+
n && /* @__PURE__ */ e("span", { className: `${a}__icon`, children: n }),
|
|
43
|
+
/* @__PURE__ */ e("span", { className: `${a}__label`, children: d }),
|
|
44
|
+
l && /* @__PURE__ */ e(
|
|
67
45
|
"button",
|
|
68
46
|
{
|
|
69
|
-
|
|
70
|
-
|
|
47
|
+
type: "button",
|
|
48
|
+
onClick: (f) => {
|
|
49
|
+
f.stopPropagation(), l();
|
|
71
50
|
},
|
|
72
51
|
disabled: r,
|
|
73
|
-
className:
|
|
74
|
-
|
|
52
|
+
className: i(
|
|
53
|
+
`${a}__delete`,
|
|
54
|
+
"bear-ml-1 bear-rounded-full bear-p-0.5 hover:bear-bg-black/10 dark:hover:bear-bg-black/20 bear-transition-colors",
|
|
75
55
|
r && "bear-cursor-not-allowed"
|
|
76
56
|
),
|
|
77
|
-
|
|
57
|
+
"aria-label": "Remove",
|
|
58
|
+
children: /* @__PURE__ */ e("svg", { className: E[o], fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) })
|
|
78
59
|
}
|
|
79
60
|
)
|
|
80
61
|
]
|
|
@@ -82,5 +63,5 @@ const z = ({
|
|
|
82
63
|
);
|
|
83
64
|
};
|
|
84
65
|
export {
|
|
85
|
-
|
|
66
|
+
j as Chip
|
|
86
67
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),s=require("react"),e=require("./ChipGroup.const.cjs"),n=require("../../utils/cn.cjs"),b=require("../../utils/generateBearId.utils.cjs"),h=require("../../utils/useBearId.cjs"),v=S=>{const{id:C,testId:m,children:O,max:l,size:P="md",spacing:p="md",overflowMenu:i=!1,onDeleteAll:_,deleteAllLabel:I=e.CHIP_GROUP_DEFAULT_DELETE_ALL_LABEL,className:A,...R}=S,E=h.useBearId("ChipGroup"),L=b.resolveBearId(C,E),[a,c]=s.useState(!1),o=s.Children.toArray(O).filter(s.isValidElement).map(t=>s.isValidElement(t)?s.cloneElement(t,{size:t.props.size??P}):t),G=typeof l=="number"?o.slice(0,l):o,d=typeof l=="number"?o.slice(l):[],u=d.length;return r.jsxs("div",{...R,id:L,"data-testid":m,className:n.cn(e.CHIP_GROUP_ROOT_CLASS,e.CHIP_GROUP_BASE_CLASSES,e.CHIP_GROUP_SPACING_CLASSES[p],A),children:[G,u>0&&r.jsxs("div",{className:`${e.CHIP_GROUP_ROOT_CLASS}__overflow-wrap bear-relative`,children:[r.jsxs("button",{type:"button",className:n.cn(`${e.CHIP_GROUP_ROOT_CLASS}__overflow`,e.CHIP_GROUP_OVERFLOW_CLASSES),onClick:()=>i&&c(t=>!t),"aria-expanded":i?a:void 0,"aria-haspopup":i?"menu":void 0,children:["+",u]}),i&&a&&r.jsxs("div",{role:"menu",className:n.cn(`${e.CHIP_GROUP_ROOT_CLASS}__menu`,e.CHIP_GROUP_MENU_CLASSES),children:[d.map((t,U)=>r.jsx("div",{role:"menuitem",className:n.cn(`${e.CHIP_GROUP_ROOT_CLASS}__menu-item`,e.CHIP_GROUP_MENU_ITEM_CLASSES),children:t},`overflow-${U}`)),_&&r.jsx("button",{type:"button",role:"menuitem",className:n.cn(`${e.CHIP_GROUP_ROOT_CLASS}__delete-all`,e.CHIP_GROUP_MENU_ITEM_CLASSES,"bear-text-red-600 dark:bear-text-red-400 bear-w-full bear-text-left"),onClick:()=>{_(),c(!1)},children:I})]})]})]})};exports.ChipGroup=v;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="Bear-ChipGroup",r="bear-inline-flex bear-flex-wrap bear-items-center",a={sm:"bear-gap-1",md:"bear-gap-2",lg:"bear-gap-3"},b="bear-inline-flex bear-items-center bear-justify-center bear-h-8 bear-min-w-8 bear-px-2 bear-rounded-full bear-text-sm bear-font-medium bear-bg-gray-200 bear-text-gray-700 dark:bear-bg-zinc-700 dark:bear-text-zinc-200 bear-border-none bear-cursor-pointer",_="Delete all",S="bear-absolute bear-z-20 bear-top-full bear-left-0 bear-mt-1 bear-min-w-[10rem] bear-rounded-lg bear-border bear-border-[var(--bear-border-default)] bear-bg-[var(--bear-bg-primary)] bear-shadow-lg bear-p-2 bear-flex bear-flex-col bear-gap-2",t="bear-text-sm";exports.CHIP_GROUP_BASE_CLASSES=r;exports.CHIP_GROUP_DEFAULT_DELETE_ALL_LABEL=_;exports.CHIP_GROUP_MENU_CLASSES=S;exports.CHIP_GROUP_MENU_ITEM_CLASSES=t;exports.CHIP_GROUP_OVERFLOW_CLASSES=b;exports.CHIP_GROUP_ROOT_CLASS=e;exports.CHIP_GROUP_SPACING_CLASSES=a;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const CHIP_GROUP_ROOT_CLASS = "Bear-ChipGroup";
|
|
2
|
+
export declare const CHIP_GROUP_BASE_CLASSES = "bear-inline-flex bear-flex-wrap bear-items-center";
|
|
3
|
+
export declare const CHIP_GROUP_SPACING_CLASSES: {
|
|
4
|
+
readonly sm: "bear-gap-1";
|
|
5
|
+
readonly md: "bear-gap-2";
|
|
6
|
+
readonly lg: "bear-gap-3";
|
|
7
|
+
};
|
|
8
|
+
export declare const CHIP_GROUP_OVERFLOW_CLASSES = "bear-inline-flex bear-items-center bear-justify-center bear-h-8 bear-min-w-8 bear-px-2 bear-rounded-full bear-text-sm bear-font-medium bear-bg-gray-200 bear-text-gray-700 dark:bear-bg-zinc-700 dark:bear-text-zinc-200 bear-border-none bear-cursor-pointer";
|
|
9
|
+
export declare const CHIP_GROUP_DEFAULT_DELETE_ALL_LABEL = "Delete all";
|
|
10
|
+
export declare const CHIP_GROUP_MENU_CLASSES = "bear-absolute bear-z-20 bear-top-full bear-left-0 bear-mt-1 bear-min-w-[10rem] bear-rounded-lg bear-border bear-border-[var(--bear-border-default)] bear-bg-[var(--bear-bg-primary)] bear-shadow-lg bear-p-2 bear-flex bear-flex-col bear-gap-2";
|
|
11
|
+
export declare const CHIP_GROUP_MENU_ITEM_CLASSES = "bear-text-sm";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
const e = "Bear-ChipGroup", r = "bear-inline-flex bear-flex-wrap bear-items-center", a = {
|
|
2
|
+
sm: "bear-gap-1",
|
|
3
|
+
md: "bear-gap-2",
|
|
4
|
+
lg: "bear-gap-3"
|
|
5
|
+
}, b = "bear-inline-flex bear-items-center bear-justify-center bear-h-8 bear-min-w-8 bear-px-2 bear-rounded-full bear-text-sm bear-font-medium bear-bg-gray-200 bear-text-gray-700 dark:bear-bg-zinc-700 dark:bear-text-zinc-200 bear-border-none bear-cursor-pointer", t = "Delete all", n = "bear-absolute bear-z-20 bear-top-full bear-left-0 bear-mt-1 bear-min-w-[10rem] bear-rounded-lg bear-border bear-border-[var(--bear-border-default)] bear-bg-[var(--bear-bg-primary)] bear-shadow-lg bear-p-2 bear-flex bear-flex-col bear-gap-2", _ = "bear-text-sm";
|
|
6
|
+
export {
|
|
7
|
+
r as CHIP_GROUP_BASE_CLASSES,
|
|
8
|
+
t as CHIP_GROUP_DEFAULT_DELETE_ALL_LABEL,
|
|
9
|
+
n as CHIP_GROUP_MENU_CLASSES,
|
|
10
|
+
_ as CHIP_GROUP_MENU_ITEM_CLASSES,
|
|
11
|
+
b as CHIP_GROUP_OVERFLOW_CLASSES,
|
|
12
|
+
e as CHIP_GROUP_ROOT_CLASS,
|
|
13
|
+
a as CHIP_GROUP_SPACING_CLASSES
|
|
14
|
+
};
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { jsxs as n, jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import { useState as N, Children as U, isValidElement as p, cloneElement as R } from "react";
|
|
3
|
+
import { CHIP_GROUP_DEFAULT_DELETE_ALL_LABEL as x, CHIP_GROUP_ROOT_CLASS as r, CHIP_GROUP_OVERFLOW_CLASSES as w, CHIP_GROUP_MENU_ITEM_CLASSES as u, CHIP_GROUP_MENU_CLASSES as y, CHIP_GROUP_SPACING_CLASSES as H, CHIP_GROUP_BASE_CLASSES as $ } from "./ChipGroup.const.js";
|
|
4
|
+
import { cn as t } from "../../utils/cn.js";
|
|
5
|
+
import { resolveBearId as M } from "../../utils/generateBearId.utils.js";
|
|
6
|
+
import { useBearId as z } from "../../utils/useBearId.js";
|
|
7
|
+
const V = (C) => {
|
|
8
|
+
const {
|
|
9
|
+
id: S,
|
|
10
|
+
testId: f,
|
|
11
|
+
children: E,
|
|
12
|
+
max: o,
|
|
13
|
+
size: A = "md",
|
|
14
|
+
spacing: P = "md",
|
|
15
|
+
overflowMenu: l = !1,
|
|
16
|
+
onDeleteAll: a,
|
|
17
|
+
deleteAllLabel: v = x,
|
|
18
|
+
className: I,
|
|
19
|
+
...L
|
|
20
|
+
} = C, b = z("ChipGroup"), h = M(S, b), [i, m] = N(!1), s = U.toArray(E).filter(p).map(
|
|
21
|
+
(e) => p(e) ? R(e, {
|
|
22
|
+
size: e.props.size ?? A
|
|
23
|
+
}) : e
|
|
24
|
+
), O = typeof o == "number" ? s.slice(0, o) : s, d = typeof o == "number" ? s.slice(o) : [], _ = d.length;
|
|
25
|
+
return /* @__PURE__ */ n(
|
|
26
|
+
"div",
|
|
27
|
+
{
|
|
28
|
+
...L,
|
|
29
|
+
id: h,
|
|
30
|
+
"data-testid": f,
|
|
31
|
+
className: t(
|
|
32
|
+
r,
|
|
33
|
+
$,
|
|
34
|
+
H[P],
|
|
35
|
+
I
|
|
36
|
+
),
|
|
37
|
+
children: [
|
|
38
|
+
O,
|
|
39
|
+
_ > 0 && /* @__PURE__ */ n("div", { className: `${r}__overflow-wrap bear-relative`, children: [
|
|
40
|
+
/* @__PURE__ */ n(
|
|
41
|
+
"button",
|
|
42
|
+
{
|
|
43
|
+
type: "button",
|
|
44
|
+
className: t(`${r}__overflow`, w),
|
|
45
|
+
onClick: () => l && m((e) => !e),
|
|
46
|
+
"aria-expanded": l ? i : void 0,
|
|
47
|
+
"aria-haspopup": l ? "menu" : void 0,
|
|
48
|
+
children: [
|
|
49
|
+
"+",
|
|
50
|
+
_
|
|
51
|
+
]
|
|
52
|
+
}
|
|
53
|
+
),
|
|
54
|
+
l && i && /* @__PURE__ */ n(
|
|
55
|
+
"div",
|
|
56
|
+
{
|
|
57
|
+
role: "menu",
|
|
58
|
+
className: t(`${r}__menu`, y),
|
|
59
|
+
children: [
|
|
60
|
+
d.map((e, G) => /* @__PURE__ */ c(
|
|
61
|
+
"div",
|
|
62
|
+
{
|
|
63
|
+
role: "menuitem",
|
|
64
|
+
className: t(`${r}__menu-item`, u),
|
|
65
|
+
children: e
|
|
66
|
+
},
|
|
67
|
+
`overflow-${G}`
|
|
68
|
+
)),
|
|
69
|
+
a && /* @__PURE__ */ c(
|
|
70
|
+
"button",
|
|
71
|
+
{
|
|
72
|
+
type: "button",
|
|
73
|
+
role: "menuitem",
|
|
74
|
+
className: t(
|
|
75
|
+
`${r}__delete-all`,
|
|
76
|
+
u,
|
|
77
|
+
"bear-text-red-600 dark:bear-text-red-400 bear-w-full bear-text-left"
|
|
78
|
+
),
|
|
79
|
+
onClick: () => {
|
|
80
|
+
a(), m(!1);
|
|
81
|
+
},
|
|
82
|
+
children: v
|
|
83
|
+
}
|
|
84
|
+
)
|
|
85
|
+
]
|
|
86
|
+
}
|
|
87
|
+
)
|
|
88
|
+
] })
|
|
89
|
+
]
|
|
90
|
+
}
|
|
91
|
+
);
|
|
92
|
+
};
|
|
93
|
+
export {
|
|
94
|
+
V as ChipGroup
|
|
95
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export type ChipGroupSize = 'sm' | 'md' | 'lg';
|
|
3
|
+
export interface ChipGroupProps extends HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
id?: string;
|
|
5
|
+
testId?: string;
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
max?: number;
|
|
8
|
+
size?: ChipGroupSize;
|
|
9
|
+
spacing?: 'sm' | 'md' | 'lg';
|
|
10
|
+
overflowMenu?: boolean;
|
|
11
|
+
onDeleteAll?: () => void;
|
|
12
|
+
deleteAllLabel?: string;
|
|
13
|
+
className?: string;
|
|
14
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("react"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("react"),M=require("react-dom"),q=require("../../context/BearProvider.cjs"),B=require("../../utils/cn.cjs"),j=require("../../utils/generateBearId.utils.cjs"),O=require("../../utils/useBearId.cjs"),T=require("../Icon/index.cjs"),C=require("../Backdrop/Backdrop.cjs"),r=require("./Drawer.const.cjs"),L=require("./Drawer.utils.cjs"),P=({isOpen:u,onClose:o,title:i,children:w,side:_="right",anchor:I,variant:F="temporary",size:D="md",showCloseButton:m=!0,closeOnBackdrop:N=!0,closeOnEscape:f=!0,className:g,container:A,id:E,testId:p})=>{const y=O.useBearId("Drawer"),c=j.resolveBearId(E,y),{direction:x}=q.useBearDirectionOptional(),l=I??_,n=x==="rtl"&&(l==="left"||l==="right")?l==="left"?"right":"left":l,[s,v]=t.useState(u),[S,b]=t.useState(!1),[h,k]=t.useState(!1);t.useEffect(()=>{if(u){v(!0),b(!1);const a=requestAnimationFrame(()=>k(!0));return()=>cancelAnimationFrame(a)}if(s){k(!1),b(!0);const a=setTimeout(()=>{v(!1),b(!1)},r.DRAWER_ANIMATION_MS);return()=>clearTimeout(a)}},[u,s]);const d=t.useCallback(a=>{f&&a.key==="Escape"&&o()},[f,o]);if(t.useEffect(()=>{if(s){document.addEventListener("keydown",d);const a=L.lockBodyScroll();return()=>{document.removeEventListener("keydown",d),a()}}return()=>{document.removeEventListener("keydown",d)}},[s,d]),!s)return null;const R=e.jsxs("div",{id:c,"data-testid":p,className:"Bear-Drawer bear-fixed bear-inset-0 bear-z-[11000]",children:[e.jsx(C.Backdrop,{open:h&&!S,keepMounted:!0,blur:!0,transitionDuration:r.DRAWER_ANIMATION_MS,className:"Bear-Drawer__backdrop",onClick:N?()=>o():void 0}),e.jsxs("div",{role:"dialog","aria-modal":"true","aria-labelledby":i?`${c}-title`:void 0,className:B.cn("Bear-Drawer__panel","bear-absolute bear-bg-white dark:bear-bg-neutral-900 bear-shadow-2xl","bear-border-neutral-200 dark:bear-border-neutral-700","bear-flex bear-flex-col bear-overflow-hidden","bear-transform bear-transition-transform",r.BORDER_SIDE_MAP[n],r.POSITION_CLASSES[n],r.SIZE_CLASSES[n][D],h&&!S?r.TRANSFORM_OPEN[n]:r.TRANSFORM_CLOSED[n],g),style:{transitionDuration:`${r.DRAWER_ANIMATION_MS}ms`},children:[(i||m)&&e.jsxs("div",{className:"bear-flex bear-items-center bear-justify-between bear-px-4 bear-py-3 bear-border-b bear-border-neutral-200 dark:bear-border-neutral-700 bear-shrink-0",dir:x,children:[i&&e.jsx("h2",{id:`${c}-title`,className:"bear-text-lg bear-font-semibold bear-text-neutral-900 dark:bear-text-white",children:i}),m&&e.jsx("button",{onClick:o,className:"bear-p-1 bear-rounded-lg bear-text-neutral-500 dark:bear-text-neutral-400 hover:bear-text-neutral-900 dark:hover:bear-text-white hover:bear-bg-neutral-100 dark:hover:bear-bg-neutral-700 bear-transition-colors","aria-label":"Close drawer",children:e.jsx(T.XIcon,{className:"bear-w-5 bear-h-5"})})]}),e.jsx("div",{className:"bear-flex-1 bear-min-h-0 bear-overflow-y-auto bear-overscroll-contain bear-p-4 bear-text-neutral-700 dark:bear-text-neutral-300",children:w})]})]});return M.createPortal(R,A??document.body)};exports.Drawer=P;
|
|
@@ -1,118 +1,122 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { createPortal as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { jsxs as c, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { useState as m, useEffect as S, useCallback as R } from "react";
|
|
3
|
+
import { createPortal as C } from "react-dom";
|
|
4
|
+
import { useBearDirectionOptional as L } from "../../context/BearProvider.js";
|
|
5
|
+
import { cn as T } from "../../utils/cn.js";
|
|
6
|
+
import { resolveBearId as F } from "../../utils/generateBearId.utils.js";
|
|
7
|
+
import { useBearId as P } from "../../utils/useBearId.js";
|
|
8
|
+
import { XIcon as j } from "../Icon/index.js";
|
|
9
|
+
import { Backdrop as $ } from "../Backdrop/Backdrop.js";
|
|
10
|
+
import { DRAWER_ANIMATION_MS as u, TRANSFORM_OPEN as q, TRANSFORM_CLOSED as z, SIZE_CLASSES as H, POSITION_CLASSES as W, BORDER_SIDE_MAP as X } from "./Drawer.const.js";
|
|
11
|
+
import { lockBodyScroll as Z } from "./Drawer.utils.js";
|
|
12
|
+
const ne = ({
|
|
13
|
+
isOpen: s,
|
|
10
14
|
onClose: o,
|
|
11
15
|
title: n,
|
|
12
|
-
children:
|
|
13
|
-
side:
|
|
14
|
-
anchor:
|
|
15
|
-
variant:
|
|
16
|
-
size:
|
|
17
|
-
showCloseButton:
|
|
18
|
-
closeOnBackdrop:
|
|
19
|
-
closeOnEscape:
|
|
20
|
-
className:
|
|
21
|
-
container:
|
|
22
|
-
id:
|
|
23
|
-
testId:
|
|
16
|
+
children: N,
|
|
17
|
+
side: g = "right",
|
|
18
|
+
anchor: E,
|
|
19
|
+
variant: G = "temporary",
|
|
20
|
+
size: I = "md",
|
|
21
|
+
showCloseButton: f = !0,
|
|
22
|
+
closeOnBackdrop: _ = !0,
|
|
23
|
+
closeOnEscape: p = !0,
|
|
24
|
+
className: y,
|
|
25
|
+
container: D,
|
|
26
|
+
id: A,
|
|
27
|
+
testId: B
|
|
24
28
|
}) => {
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
if (
|
|
28
|
-
|
|
29
|
-
const e = requestAnimationFrame(() =>
|
|
29
|
+
const M = P("Drawer"), d = F(A, M), { direction: h } = L(), i = E ?? g, r = h === "rtl" && (i === "left" || i === "right") ? i === "left" ? "right" : "left" : i, [a, v] = m(s), [k, b] = m(!1), [x, w] = m(!1);
|
|
30
|
+
S(() => {
|
|
31
|
+
if (s) {
|
|
32
|
+
v(!0), b(!1);
|
|
33
|
+
const e = requestAnimationFrame(() => w(!0));
|
|
30
34
|
return () => cancelAnimationFrame(e);
|
|
31
35
|
}
|
|
32
36
|
if (a) {
|
|
33
|
-
|
|
37
|
+
w(!1), b(!0);
|
|
34
38
|
const e = setTimeout(() => {
|
|
35
|
-
|
|
36
|
-
},
|
|
39
|
+
v(!1), b(!1);
|
|
40
|
+
}, u);
|
|
37
41
|
return () => clearTimeout(e);
|
|
38
42
|
}
|
|
39
|
-
}, [
|
|
40
|
-
const
|
|
43
|
+
}, [s, a]);
|
|
44
|
+
const l = R(
|
|
41
45
|
(e) => {
|
|
42
|
-
|
|
46
|
+
p && e.key === "Escape" && o();
|
|
43
47
|
},
|
|
44
|
-
[
|
|
48
|
+
[p, o]
|
|
45
49
|
);
|
|
46
|
-
if (
|
|
50
|
+
if (S(() => {
|
|
47
51
|
if (a) {
|
|
48
|
-
document.addEventListener("keydown",
|
|
49
|
-
const e =
|
|
52
|
+
document.addEventListener("keydown", l);
|
|
53
|
+
const e = Z();
|
|
50
54
|
return () => {
|
|
51
|
-
document.removeEventListener("keydown",
|
|
55
|
+
document.removeEventListener("keydown", l), e();
|
|
52
56
|
};
|
|
53
57
|
}
|
|
54
58
|
return () => {
|
|
55
|
-
document.removeEventListener("keydown",
|
|
59
|
+
document.removeEventListener("keydown", l);
|
|
56
60
|
};
|
|
57
|
-
}, [a,
|
|
58
|
-
const
|
|
61
|
+
}, [a, l]), !a) return null;
|
|
62
|
+
const O = /* @__PURE__ */ c("div", { id: d, "data-testid": B, className: "Bear-Drawer bear-fixed bear-inset-0 bear-z-[11000]", children: [
|
|
59
63
|
/* @__PURE__ */ t(
|
|
60
|
-
|
|
64
|
+
$,
|
|
61
65
|
{
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
onClick:
|
|
68
|
-
"aria-hidden": "true"
|
|
66
|
+
open: x && !k,
|
|
67
|
+
keepMounted: !0,
|
|
68
|
+
blur: !0,
|
|
69
|
+
transitionDuration: u,
|
|
70
|
+
className: "Bear-Drawer__backdrop",
|
|
71
|
+
onClick: _ ? () => o() : void 0
|
|
69
72
|
}
|
|
70
73
|
),
|
|
71
|
-
/* @__PURE__ */
|
|
74
|
+
/* @__PURE__ */ c(
|
|
72
75
|
"div",
|
|
73
76
|
{
|
|
74
77
|
role: "dialog",
|
|
75
78
|
"aria-modal": "true",
|
|
76
|
-
"aria-labelledby": n ?
|
|
77
|
-
className:
|
|
79
|
+
"aria-labelledby": n ? `${d}-title` : void 0,
|
|
80
|
+
className: T(
|
|
81
|
+
"Bear-Drawer__panel",
|
|
78
82
|
"bear-absolute bear-bg-white dark:bear-bg-neutral-900 bear-shadow-2xl",
|
|
79
83
|
"bear-border-neutral-200 dark:bear-border-neutral-700",
|
|
80
84
|
"bear-flex bear-flex-col bear-overflow-hidden",
|
|
81
85
|
"bear-transform bear-transition-transform",
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
86
|
+
X[r],
|
|
87
|
+
W[r],
|
|
88
|
+
H[r][I],
|
|
89
|
+
x && !k ? q[r] : z[r],
|
|
90
|
+
y
|
|
87
91
|
),
|
|
88
|
-
style: { transitionDuration: `${
|
|
92
|
+
style: { transitionDuration: `${u}ms` },
|
|
89
93
|
children: [
|
|
90
|
-
(n ||
|
|
94
|
+
(n || f) && /* @__PURE__ */ c("div", { className: "bear-flex bear-items-center bear-justify-between bear-px-4 bear-py-3 bear-border-b bear-border-neutral-200 dark:bear-border-neutral-700 bear-shrink-0", dir: h, children: [
|
|
91
95
|
n && /* @__PURE__ */ t(
|
|
92
96
|
"h2",
|
|
93
97
|
{
|
|
94
|
-
id:
|
|
98
|
+
id: `${d}-title`,
|
|
95
99
|
className: "bear-text-lg bear-font-semibold bear-text-neutral-900 dark:bear-text-white",
|
|
96
100
|
children: n
|
|
97
101
|
}
|
|
98
102
|
),
|
|
99
|
-
|
|
103
|
+
f && /* @__PURE__ */ t(
|
|
100
104
|
"button",
|
|
101
105
|
{
|
|
102
106
|
onClick: o,
|
|
103
107
|
className: "bear-p-1 bear-rounded-lg bear-text-neutral-500 dark:bear-text-neutral-400 hover:bear-text-neutral-900 dark:hover:bear-text-white hover:bear-bg-neutral-100 dark:hover:bear-bg-neutral-700 bear-transition-colors",
|
|
104
108
|
"aria-label": "Close drawer",
|
|
105
|
-
children: /* @__PURE__ */ t(
|
|
109
|
+
children: /* @__PURE__ */ t(j, { className: "bear-w-5 bear-h-5" })
|
|
106
110
|
}
|
|
107
111
|
)
|
|
108
112
|
] }),
|
|
109
|
-
/* @__PURE__ */ t("div", { className: "bear-flex-1 bear-min-h-0 bear-overflow-y-auto bear-overscroll-contain bear-p-4 bear-text-neutral-700 dark:bear-text-neutral-300", children:
|
|
113
|
+
/* @__PURE__ */ t("div", { className: "bear-flex-1 bear-min-h-0 bear-overflow-y-auto bear-overscroll-contain bear-p-4 bear-text-neutral-700 dark:bear-text-neutral-300", children: N })
|
|
110
114
|
]
|
|
111
115
|
}
|
|
112
116
|
)
|
|
113
117
|
] });
|
|
114
|
-
return
|
|
118
|
+
return C(O, D ?? document.body);
|
|
115
119
|
};
|
|
116
120
|
export {
|
|
117
|
-
|
|
121
|
+
ne as Drawer
|
|
118
122
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),e=require("./EmptyState.const.cjs"),a=require("../../utils/cn.cjs");require("react");const A=require("../../utils/generateBearId.utils.cjs"),m=require("../../utils/useBearId.cjs"),C=({className:r})=>s.jsx("svg",{className:r,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M20 13V6a2 2 0 00-2-2H6a2 2 0 00-2 2v7m16 0v5a2 2 0 01-2 2H6a2 2 0 01-2-2v-5m16 0h-2.586a1 1 0 00-.707.293l-2.414 2.414a1 1 0 01-.707.293h-3.172a1 1 0 01-.707-.293l-2.414-2.414A1 1 0 006.586 13H4"})}),h=({icon:r,title:l,description:S,action:n,secondaryAction:c,className:d,size:i="md",variant:E="default",id:T,testId:_})=>{const o=m.useBearId("EmptyState"),u=A.resolveBearId(T,o),t=e.EMPTY_STATE_SIZE_CLASSES[i];return s.jsxs("div",{id:u,"data-testid":_,className:a.cn(e.EMPTY_STATE_ROOT_CLASS,e.EMPTY_STATE_BASE_CLASSES,t.padding,E==="card"&&e.EMPTY_STATE_CARD_CLASSES,d),children:[s.jsx("div",{className:a.cn(e.EMPTY_STATE_ICON_CLASSES,t.icon),children:r||s.jsx(C,{className:"bear-w-full bear-h-full"})}),s.jsx("h3",{className:a.cn(e.EMPTY_STATE_TITLE_CLASSES,t.title),children:l}),S&&s.jsx("p",{className:a.cn(e.EMPTY_STATE_DESCRIPTION_CLASSES,t.desc),children:S}),(n||c)&&s.jsxs("div",{className:`${e.EMPTY_STATE_ROOT_CLASS}__actions bear-flex bear-items-center bear-gap-3`,children:[n,c]})]})};exports.EmptyState=h;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="Bear-EmptyState",S="bear-flex bear-flex-col bear-items-center bear-text-center",r="bear-bg-[var(--bear-bg-secondary)] bear-rounded-xl bear-border bear-border-[var(--bear-border-default)]",a="bear-text-[var(--bear-text-muted)] bear-mb-4",t="bear-font-semibold bear-text-[var(--bear-text-primary)] bear-mb-2",b="bear-text-[var(--bear-text-secondary)] bear-max-w-md bear-mb-6",T={sm:{icon:"bear-w-12 bear-h-12",title:"bear-text-lg",desc:"bear-text-sm",padding:"bear-py-6 bear-px-4"},md:{icon:"bear-w-16 bear-h-16",title:"bear-text-xl",desc:"bear-text-base",padding:"bear-py-10 bear-px-6"},lg:{icon:"bear-w-20 bear-h-20",title:"bear-text-2xl",desc:"bear-text-lg",padding:"bear-py-14 bear-px-8"}};exports.EMPTY_STATE_BASE_CLASSES=S;exports.EMPTY_STATE_CARD_CLASSES=r;exports.EMPTY_STATE_DESCRIPTION_CLASSES=b;exports.EMPTY_STATE_ICON_CLASSES=a;exports.EMPTY_STATE_ROOT_CLASS=e;exports.EMPTY_STATE_SIZE_CLASSES=T;exports.EMPTY_STATE_TITLE_CLASSES=t;
|