@forgedevstack/bear 1.0.3 → 1.0.4
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/Accordion/Accordion.cjs +1 -1
- package/dist/components/Accordion/Accordion.const.cjs +1 -0
- package/dist/components/Accordion/Accordion.const.d.ts +10 -0
- package/dist/components/Accordion/Accordion.const.js +8 -0
- package/dist/components/Accordion/Accordion.d.ts +1 -0
- package/dist/components/Accordion/Accordion.js +49 -44
- package/dist/components/Accordion/Accordion.types.d.ts +2 -0
- package/dist/components/Accordion/index.d.ts +3 -2
- package/dist/components/ActivityItem/ActivityItem.cjs +1 -0
- package/dist/components/ActivityItem/ActivityItem.d.ts +7 -0
- package/dist/components/ActivityItem/ActivityItem.js +44 -0
- package/dist/components/ActivityItem/ActivityItem.types.d.ts +17 -0
- package/dist/components/ActivityItem/index.d.ts +2 -0
- package/dist/components/Alert/Alert.cjs +1 -1
- package/dist/components/Alert/Alert.const.cjs +1 -0
- package/dist/components/Alert/Alert.const.d.ts +14 -0
- package/dist/components/Alert/Alert.const.js +27 -0
- package/dist/components/Alert/Alert.js +54 -63
- package/dist/components/Alert/Alert.types.d.ts +3 -1
- package/dist/components/Avatar/Avatar.cjs +1 -1
- package/dist/components/Avatar/Avatar.const.cjs +1 -0
- package/dist/components/Avatar/Avatar.const.d.ts +28 -0
- package/dist/components/Avatar/Avatar.const.js +28 -0
- package/dist/components/Avatar/Avatar.js +49 -60
- package/dist/components/Avatar/index.d.ts +1 -0
- package/dist/components/Badge/Badge.cjs +1 -1
- package/dist/components/Badge/Badge.js +24 -22
- package/dist/components/BearLogo/EmberLogo.cjs +17 -0
- package/dist/components/BearLogo/EmberLogo.js +91 -0
- package/dist/components/BearLogo/index.d.ts +2 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.cjs +1 -1
- package/dist/components/Breadcrumbs/Breadcrumbs.const.cjs +1 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.const.d.ts +16 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.const.js +19 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.js +49 -34
- package/dist/components/Breadcrumbs/Breadcrumbs.types.d.ts +8 -1
- package/dist/components/Button/Button.cjs +1 -1
- package/dist/components/Button/Button.constants.cjs +1 -1
- package/dist/components/Button/Button.constants.d.ts +2 -2
- package/dist/components/Button/Button.constants.js +2 -2
- package/dist/components/Button/Button.js +41 -46
- package/dist/components/Calendar/Calendar.cjs +1 -1
- package/dist/components/Calendar/Calendar.helpers.cjs +1 -0
- package/dist/components/Calendar/Calendar.helpers.d.ts +10 -0
- package/dist/components/Calendar/Calendar.helpers.js +9 -0
- package/dist/components/Calendar/Calendar.js +112 -115
- package/dist/components/Card/Card.cjs +1 -1
- package/dist/components/Card/Card.const.cjs +1 -0
- package/dist/components/Card/Card.const.d.ts +13 -0
- package/dist/components/Card/Card.const.js +32 -0
- package/dist/components/Card/Card.d.ts +1 -0
- package/dist/components/Card/Card.js +101 -105
- package/dist/components/Card/index.d.ts +3 -2
- package/dist/components/Chart/Chart.cjs +1 -0
- package/dist/components/Chart/Chart.const.d.ts +15 -0
- package/dist/components/Chart/Chart.d.ts +18 -0
- package/dist/components/Chart/Chart.js +225 -0
- package/dist/components/Chart/Chart.types.d.ts +51 -0
- package/dist/components/Chart/Chart.utils.d.ts +31 -0
- package/dist/components/Chart/index.d.ts +2 -0
- package/dist/components/CodeBlock/CodeBlock.cjs +2 -2
- package/dist/components/CodeBlock/CodeBlock.js +65 -52
- package/dist/components/CodeBlock/CodeBlock.types.d.ts +12 -1
- package/dist/components/Editable/Editable.cjs +1 -1
- package/dist/components/Editable/Editable.js +115 -115
- package/dist/components/Gauge/Gauge.cjs +1 -0
- package/dist/components/Gauge/Gauge.d.ts +3 -0
- package/dist/components/Gauge/Gauge.js +92 -0
- package/dist/components/Gauge/Gauge.types.d.ts +27 -0
- package/dist/components/Gauge/index.d.ts +2 -0
- package/dist/components/Icon/icons/editor.cjs +1 -1
- package/dist/components/Icon/icons/editor.d.ts +1 -0
- package/dist/components/Icon/icons/editor.js +66 -61
- package/dist/components/Icon/icons/misc.cjs +1 -1
- package/dist/components/Icon/icons/misc.d.ts +13 -0
- package/dist/components/Icon/icons/misc.js +157 -88
- package/dist/components/Icon/index.d.ts +22 -0
- package/dist/components/Input/Input.cjs +1 -1
- package/dist/components/Input/Input.js +36 -35
- package/dist/components/Modal/Modal.cjs +1 -1
- package/dist/components/Modal/Modal.const.cjs +1 -0
- package/dist/components/Modal/Modal.const.d.ts +10 -0
- package/dist/components/Modal/Modal.const.js +17 -0
- package/dist/components/Modal/Modal.d.ts +11 -0
- package/dist/components/Modal/Modal.js +80 -77
- package/dist/components/Modal/Modal.types.d.ts +6 -1
- package/dist/components/Modal/index.d.ts +3 -2
- package/dist/components/Rating/Rating.cjs +1 -1
- package/dist/components/Rating/Rating.const.cjs +1 -0
- package/dist/components/Rating/Rating.const.d.ts +14 -0
- package/dist/components/Rating/Rating.const.js +22 -0
- package/dist/components/Rating/Rating.d.ts +5 -10
- package/dist/components/Rating/Rating.js +135 -93
- package/dist/components/Rating/Rating.types.d.ts +27 -25
- package/dist/components/Rating/index.d.ts +2 -2
- package/dist/components/RichEditor/RichEditor.cjs +1 -10
- package/dist/components/RichEditor/RichEditor.const.cjs +141 -0
- package/dist/components/RichEditor/RichEditor.const.d.ts +137 -0
- package/dist/components/RichEditor/RichEditor.const.js +279 -0
- package/dist/components/RichEditor/RichEditor.d.ts +14 -0
- package/dist/components/RichEditor/RichEditor.js +341 -129
- package/dist/components/RichEditor/RichEditor.types.d.ts +38 -1
- package/dist/components/RichEditor/components/ToolbarButton/ToolbarButton.cjs +1 -0
- package/dist/components/RichEditor/components/ToolbarButton/ToolbarButton.d.ts +4 -0
- package/dist/components/RichEditor/components/ToolbarButton/ToolbarButton.js +25 -0
- package/dist/components/RichEditor/components/ToolbarButton/index.d.ts +1 -0
- package/dist/components/RichEditor/components/ToolbarColorPicker/ToolbarColorPicker.cjs +1 -0
- package/dist/components/RichEditor/components/ToolbarColorPicker/ToolbarColorPicker.d.ts +4 -0
- package/dist/components/RichEditor/components/ToolbarColorPicker/ToolbarColorPicker.js +126 -0
- package/dist/components/RichEditor/components/ToolbarColorPicker/index.d.ts +1 -0
- package/dist/components/RichEditor/components/ToolbarDropdown/ToolbarDropdown.cjs +1 -0
- package/dist/components/RichEditor/components/ToolbarDropdown/ToolbarDropdown.d.ts +4 -0
- package/dist/components/RichEditor/components/ToolbarDropdown/ToolbarDropdown.js +57 -0
- package/dist/components/RichEditor/components/ToolbarDropdown/index.d.ts +1 -0
- package/dist/components/RichEditor/components/ToolbarMore/ToolbarMore.cjs +1 -0
- package/dist/components/RichEditor/components/ToolbarMore/ToolbarMore.d.ts +7 -0
- package/dist/components/RichEditor/components/ToolbarMore/ToolbarMore.js +45 -0
- package/dist/components/RichEditor/components/ToolbarMore/index.d.ts +2 -0
- package/dist/components/RichEditor/components/index.d.ts +4 -0
- package/dist/components/RichEditor/helpers/formatHelpers.cjs +1 -0
- package/dist/components/RichEditor/helpers/formatHelpers.d.ts +57 -0
- package/dist/components/RichEditor/helpers/formatHelpers.js +26 -0
- package/dist/components/RichEditor/helpers/index.d.ts +1 -0
- package/dist/components/RichEditor/index.d.ts +4 -2
- package/dist/components/Sidebar/Sidebar.cjs +1 -1
- package/dist/components/Sidebar/Sidebar.const.cjs +1 -0
- package/dist/components/Sidebar/Sidebar.const.d.ts +16 -0
- package/dist/components/Sidebar/Sidebar.const.js +22 -0
- package/dist/components/Sidebar/Sidebar.d.ts +14 -2
- package/dist/components/Sidebar/Sidebar.js +50 -138
- package/dist/components/Sidebar/Sidebar.types.d.ts +7 -3
- package/dist/components/Sidebar/components/SidebarGroup/SidebarGroup.cjs +1 -0
- package/dist/components/Sidebar/components/SidebarGroup/SidebarGroup.d.ts +4 -0
- package/dist/components/Sidebar/components/SidebarGroup/SidebarGroup.js +45 -0
- package/dist/components/Sidebar/components/SidebarGroup/index.d.ts +2 -0
- package/dist/components/Sidebar/components/SidebarItem/SidebarItem.cjs +1 -0
- package/dist/components/Sidebar/components/SidebarItem/SidebarItem.d.ts +4 -0
- package/dist/components/Sidebar/components/SidebarItem/SidebarItem.js +66 -0
- package/dist/components/Sidebar/components/SidebarItem/index.d.ts +2 -0
- package/dist/components/Sidebar/components/index.d.ts +2 -0
- package/dist/components/Sidebar/index.d.ts +5 -2
- package/dist/components/SignPad/SignPad.cjs +1 -0
- package/dist/components/SignPad/SignPad.const.cjs +1 -0
- package/dist/components/SignPad/SignPad.const.d.ts +19 -0
- package/dist/components/SignPad/SignPad.const.js +20 -0
- package/dist/components/SignPad/SignPad.d.ts +17 -0
- package/dist/components/SignPad/SignPad.js +161 -0
- package/dist/components/SignPad/SignPad.types.d.ts +37 -0
- package/dist/components/SignPad/index.d.ts +3 -0
- package/dist/components/Skeleton/Skeleton.cjs +1 -1
- package/dist/components/Skeleton/Skeleton.const.cjs +36 -0
- package/dist/components/Skeleton/Skeleton.const.d.ts +12 -0
- package/dist/components/Skeleton/Skeleton.const.js +58 -0
- package/dist/components/Skeleton/Skeleton.d.ts +15 -24
- package/dist/components/Skeleton/Skeleton.js +132 -103
- package/dist/components/Skeleton/Skeleton.types.d.ts +18 -8
- package/dist/components/Skeleton/index.d.ts +2 -2
- package/dist/components/Sparkline/Sparkline.cjs +1 -0
- package/dist/components/Sparkline/Sparkline.const.cjs +1 -0
- package/dist/components/Sparkline/Sparkline.const.d.ts +16 -0
- package/dist/components/Sparkline/Sparkline.const.js +16 -0
- package/dist/components/Sparkline/Sparkline.d.ts +3 -0
- package/dist/components/Sparkline/Sparkline.js +80 -0
- package/dist/components/Sparkline/Sparkline.types.d.ts +19 -0
- package/dist/components/Sparkline/Sparkline.utils.cjs +1 -0
- package/dist/components/Sparkline/Sparkline.utils.d.ts +27 -0
- package/dist/components/Sparkline/Sparkline.utils.js +30 -0
- package/dist/components/Sparkline/index.d.ts +5 -0
- package/dist/components/SpeedDial/SpeedDial.cjs +12 -1
- package/dist/components/SpeedDial/SpeedDial.const.cjs +1 -0
- package/dist/components/SpeedDial/SpeedDial.const.d.ts +22 -0
- package/dist/components/SpeedDial/SpeedDial.const.js +26 -0
- package/dist/components/SpeedDial/SpeedDial.d.ts +5 -7
- package/dist/components/SpeedDial/SpeedDial.js +154 -144
- package/dist/components/SpeedDial/SpeedDial.types.d.ts +26 -29
- package/dist/components/SpeedDial/index.d.ts +1 -1
- package/dist/components/Spinner/Spinner.cjs +1 -1
- package/dist/components/Spinner/Spinner.js +17 -15
- package/dist/components/StatCard/StatCard.cjs +1 -0
- package/dist/components/StatCard/StatCard.d.ts +7 -0
- package/dist/components/StatCard/StatCard.js +36 -0
- package/dist/components/StatCard/StatCard.types.d.ts +13 -0
- package/dist/components/StatCard/index.d.ts +2 -0
- package/dist/components/Stepper/Stepper.cjs +1 -1
- package/dist/components/Stepper/Stepper.const.cjs +1 -0
- package/dist/components/Stepper/Stepper.const.d.ts +29 -0
- package/dist/components/Stepper/Stepper.const.js +46 -0
- package/dist/components/Stepper/Stepper.d.ts +10 -3
- package/dist/components/Stepper/Stepper.js +143 -92
- package/dist/components/Stepper/Stepper.types.d.ts +63 -13
- package/dist/components/Stepper/index.d.ts +2 -2
- package/dist/components/Switch/Switch.cjs +1 -1
- package/dist/components/Switch/Switch.js +74 -47
- package/dist/components/Switch/Switch.types.d.ts +11 -1
- package/dist/components/Tabs/Tabs.cjs +1 -1
- package/dist/components/Tabs/Tabs.js +33 -29
- package/dist/components/TimePicker/TimePicker.cjs +1 -1
- package/dist/components/TimePicker/TimePicker.constants.cjs +1 -1
- package/dist/components/TimePicker/TimePicker.constants.d.ts +14 -0
- package/dist/components/TimePicker/TimePicker.constants.js +18 -4
- package/dist/components/TimePicker/TimePicker.js +92 -91
- package/dist/components/Timeline/Timeline.cjs +1 -1
- package/dist/components/Timeline/Timeline.const.cjs +1 -0
- package/dist/components/Timeline/Timeline.const.d.ts +40 -0
- package/dist/components/Timeline/Timeline.const.js +58 -0
- package/dist/components/Timeline/Timeline.d.ts +16 -2
- package/dist/components/Timeline/Timeline.js +131 -63
- package/dist/components/Timeline/Timeline.types.d.ts +30 -11
- package/dist/components/Timeline/index.d.ts +1 -1
- package/dist/components/Tooltip/Tooltip.cjs +1 -1
- package/dist/components/Tooltip/Tooltip.js +37 -35
- package/dist/components/Typography/Typography.cjs +1 -1
- package/dist/components/Typography/Typography.js +38 -36
- package/dist/components/index.cjs +1 -1
- package/dist/components/index.d.ts +17 -5
- package/dist/components/index.js +216 -195
- package/dist/hooks/index.cjs +1 -1
- package/dist/hooks/index.d.ts +24 -0
- package/dist/hooks/index.js +42 -14
- package/dist/hooks/useBounce/index.d.ts +2 -0
- package/dist/hooks/useBounce/useBounce.cjs +1 -0
- package/dist/hooks/useBounce/useBounce.d.ts +2 -0
- package/dist/hooks/useBounce/useBounce.js +36 -0
- package/dist/hooks/useBounce/useBounce.types.d.ts +27 -0
- package/dist/hooks/useClickOutside/index.d.ts +2 -0
- package/dist/hooks/useClickOutside/useClickOutside.d.ts +22 -0
- package/dist/hooks/useClickOutside/useClickOutside.types.d.ts +10 -0
- package/dist/hooks/useClipboard/index.d.ts +2 -0
- package/dist/hooks/useClipboard/useClipboard.cjs +1 -0
- package/dist/hooks/useClipboard/useClipboard.d.ts +15 -0
- package/dist/hooks/useClipboard/useClipboard.js +22 -0
- package/dist/hooks/useClipboard/useClipboard.types.d.ts +20 -0
- package/dist/hooks/useDebounce/index.d.ts +2 -0
- package/dist/hooks/useDebounce/useDebounce.cjs +1 -0
- package/dist/hooks/useDebounce/useDebounce.d.ts +32 -0
- package/dist/hooks/useDebounce/useDebounce.js +39 -0
- package/dist/hooks/useDebounce/useDebounce.types.d.ts +20 -0
- package/dist/hooks/useFloat/index.d.ts +2 -0
- package/dist/hooks/useFloat/useFloat.cjs +1 -0
- package/dist/hooks/useFloat/useFloat.d.ts +2 -0
- package/dist/hooks/useFloat/useFloat.js +37 -0
- package/dist/hooks/useFloat/useFloat.types.d.ts +25 -0
- package/dist/hooks/useIntersectionObserver/index.d.ts +2 -0
- package/dist/hooks/useIntersectionObserver/useIntersectionObserver.cjs +1 -0
- package/dist/hooks/useIntersectionObserver/useIntersectionObserver.d.ts +25 -0
- package/dist/hooks/useIntersectionObserver/useIntersectionObserver.js +39 -0
- package/dist/hooks/useIntersectionObserver/useIntersectionObserver.types.d.ts +22 -0
- package/dist/hooks/useKeyPress/index.d.ts +2 -0
- package/dist/hooks/useKeyPress/useKeyPress.cjs +1 -0
- package/dist/hooks/useKeyPress/useKeyPress.d.ts +22 -0
- package/dist/hooks/useKeyPress/useKeyPress.js +39 -0
- package/dist/hooks/useKeyPress/useKeyPress.types.d.ts +19 -0
- package/dist/hooks/useLocalStorage/index.d.ts +2 -0
- package/dist/hooks/useLocalStorage/useLocalStorage.cjs +1 -0
- package/dist/hooks/useLocalStorage/useLocalStorage.d.ts +11 -0
- package/dist/hooks/useLocalStorage/useLocalStorage.js +47 -0
- package/dist/hooks/useLocalStorage/useLocalStorage.types.d.ts +16 -0
- package/dist/hooks/useMediaQuery/index.d.ts +3 -0
- package/dist/hooks/useMediaQuery/useMediaQuery.d.ts +12 -0
- package/dist/hooks/useMediaQuery/useMediaQuery.types.d.ts +21 -0
- package/dist/hooks/useParallax/index.d.ts +2 -0
- package/dist/hooks/useParallax/useParallax.cjs +1 -0
- package/dist/hooks/useParallax/useParallax.d.ts +2 -0
- package/dist/hooks/useParallax/useParallax.js +36 -0
- package/dist/hooks/useParallax/useParallax.types.d.ts +19 -0
- package/dist/hooks/usePulse/index.d.ts +2 -0
- package/dist/hooks/usePulse/usePulse.cjs +1 -0
- package/dist/hooks/usePulse/usePulse.d.ts +2 -0
- package/dist/hooks/usePulse/usePulse.js +38 -0
- package/dist/hooks/usePulse/usePulse.types.d.ts +29 -0
- package/dist/hooks/useShake/index.d.ts +2 -0
- package/dist/hooks/useShake/useShake.cjs +1 -0
- package/dist/hooks/useShake/useShake.d.ts +2 -0
- package/dist/hooks/useShake/useShake.js +14 -0
- package/dist/hooks/useShake/useShake.types.d.ts +19 -0
- package/dist/hooks/useSlide/index.d.ts +2 -0
- package/dist/hooks/useSlide/useSlide.cjs +1 -0
- package/dist/hooks/useSlide/useSlide.d.ts +2 -0
- package/dist/hooks/useSlide/useSlide.js +68 -0
- package/dist/hooks/useSlide/useSlide.types.d.ts +36 -0
- package/dist/hooks/useThrottle/index.d.ts +2 -0
- package/dist/hooks/useThrottle/useThrottle.cjs +1 -0
- package/dist/hooks/useThrottle/useThrottle.d.ts +26 -0
- package/dist/hooks/useThrottle/useThrottle.js +44 -0
- package/dist/hooks/useThrottle/useThrottle.types.d.ts +8 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +273 -224
- package/dist/styles.css +1 -1
- package/package.json +14 -21
- package/dist/components/RichEditor/RichEditor.icons.cjs +0 -1
- package/dist/components/RichEditor/RichEditor.icons.d.ts +0 -16
- package/dist/components/RichEditor/RichEditor.icons.js +0 -62
- package/dist/components/RichEditor/RichEditor.utils.cjs +0 -1
- package/dist/components/RichEditor/RichEditor.utils.d.ts +0 -3
- package/dist/components/RichEditor/RichEditor.utils.js +0 -22
|
@@ -1,61 +1,56 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { cn as
|
|
4
|
-
import { Spinner as
|
|
5
|
-
import { useBearStyles as
|
|
6
|
-
import {
|
|
7
|
-
const
|
|
8
|
-
({
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
return /* @__PURE__ */
|
|
1
|
+
import { jsxs as s, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as x } from "react";
|
|
3
|
+
import { cn as o } from "../../utils/cn.js";
|
|
4
|
+
import { Spinner as y } from "../Spinner/Spinner.js";
|
|
5
|
+
import { useBearStyles as g } from "../../hooks/useBearStyles.js";
|
|
6
|
+
import { BUTTON_VARIANT as I, BUTTON_SIZE as T } from "./Button.constants.js";
|
|
7
|
+
const j = x(
|
|
8
|
+
(l, c) => {
|
|
9
|
+
const {
|
|
10
|
+
variant: m = "primary",
|
|
11
|
+
size: t = "md",
|
|
12
|
+
loading: e = !1,
|
|
13
|
+
fullWidth: b = !1,
|
|
14
|
+
leftIcon: a,
|
|
15
|
+
rightIcon: n,
|
|
16
|
+
disabled: d,
|
|
17
|
+
className: u,
|
|
18
|
+
children: B,
|
|
19
|
+
testId: f,
|
|
20
|
+
bis: p,
|
|
21
|
+
style: _,
|
|
22
|
+
...h
|
|
23
|
+
} = l, N = d || e, i = g(p, _);
|
|
24
|
+
return /* @__PURE__ */ s(
|
|
25
25
|
"button",
|
|
26
26
|
{
|
|
27
|
-
ref:
|
|
28
|
-
disabled:
|
|
29
|
-
style: Object.keys(
|
|
30
|
-
className:
|
|
31
|
-
|
|
27
|
+
ref: c,
|
|
28
|
+
disabled: N,
|
|
29
|
+
style: Object.keys(i).length ? i : void 0,
|
|
30
|
+
className: o(
|
|
31
|
+
"Bear-Button",
|
|
32
32
|
"bear-inline-flex bear-items-center bear-justify-center bear-font-medium bear-rounded-lg bear-transition-all bear-duration-200 bear-outline-none",
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
// Variant
|
|
36
|
-
v[m],
|
|
37
|
-
// Full width
|
|
33
|
+
T[t],
|
|
34
|
+
I[m],
|
|
38
35
|
b && "bear-w-full",
|
|
39
|
-
// Loading
|
|
40
36
|
e && "bear-cursor-wait",
|
|
41
|
-
|
|
42
|
-
c
|
|
37
|
+
u
|
|
43
38
|
),
|
|
44
|
-
"data-testid":
|
|
45
|
-
...
|
|
39
|
+
"data-testid": f,
|
|
40
|
+
...h,
|
|
46
41
|
children: [
|
|
47
|
-
e && /* @__PURE__ */ r(
|
|
48
|
-
/* @__PURE__ */
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
42
|
+
e && /* @__PURE__ */ r(y, { size: t === "xs" ? "xs" : "sm", className: "Bear-Button__spinner bear-absolute" }),
|
|
43
|
+
/* @__PURE__ */ s("span", { className: o("Bear-Button__content bear-inline-flex bear-items-center bear-gap-inherit", e && "bear-invisible"), children: [
|
|
44
|
+
a && /* @__PURE__ */ r("span", { className: "Bear-Button__icon Bear-Button__icon--left bear-inline-flex bear-shrink-0", children: a }),
|
|
45
|
+
/* @__PURE__ */ r("span", { className: "Bear-Button__text", children: B }),
|
|
46
|
+
n && /* @__PURE__ */ r("span", { className: "Bear-Button__icon Bear-Button__icon--right bear-inline-flex bear-shrink-0", children: n })
|
|
52
47
|
] })
|
|
53
48
|
]
|
|
54
49
|
}
|
|
55
50
|
);
|
|
56
51
|
}
|
|
57
52
|
);
|
|
58
|
-
|
|
53
|
+
j.displayName = "Button";
|
|
59
54
|
export {
|
|
60
|
-
|
|
55
|
+
j as Button
|
|
61
56
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),d=require("react"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),d=require("react"),w=require("../../utils/cn.cjs"),ue=require("../../hooks/useBearStyles.cjs"),v=require("../Icon/index.cjs"),c=require("./Calendar.const.cjs"),u=require("./Calendar.utils.cjs"),xe=require("./Calendar.helpers.cjs"),he=F=>{const{viewDate:M,value:B=null,onSelect:N,onViewChange:s,minDate:g,maxDate:z,disabledDates:P=[],highlightedDates:R=[],weekdayLabels:S=c.DEFAULT_WEEKDAYS,firstDayOfWeek:k=c.NUMBER.ZERO,showWeekNumbers:be=!1,slots:t={},clearable:I=!0,onClear:x,showTodayButton:A=!0,onToday:h,bis:G,style:K,inline:Z=!1,className:J}=F,a=M.getFullYear(),O=ue.useBearStyles(G,K),i=M.getMonth(),Q=d.useMemo(()=>new Date,[]),p=d.useCallback(()=>{s==null||s(new Date(a-c.NUMBER.ONE,i,c.NUMBER.ONE))},[a,i,s]),L=d.useCallback(()=>{s==null||s(new Date(a,i-c.NUMBER.ONE,c.NUMBER.ONE))},[a,i,s]),T=d.useCallback(()=>{s==null||s(new Date(a,i+c.NUMBER.ONE,c.NUMBER.ONE))},[a,i,s]),f=d.useCallback(()=>{s==null||s(new Date(a+c.NUMBER.ONE,i,c.NUMBER.ONE))},[a,i,s]),j=L,C=T,X={onPrevYear:p,onPrevMonth:L,onNextMonth:T,onNextYear:f},$=d.useCallback(r=>g&&r<g||z&&r>z?!0:P.some(n=>u.isSameDay(n,r)),[g,z,P]),V=d.useCallback(r=>R.some(n=>u.isSameDay(n,r)),[R]),ee=d.useMemo(()=>u.buildCalendarGrid(a,i,k),[a,i,k]),U=d.useMemo(()=>u.reorderWeekdays(S,k),[S,k]),W=c.MONTHS[i],D=B!=null,te=Z?"block w-full bg-white dark:bg-gray-900 rounded-xl shadow-none border border-zinc-200 dark:border-zinc-700 p-4 text-zinc-900 dark:text-zinc-100":"absolute z-50 mt-2 bg-white dark:bg-gray-900 rounded-xl shadow-xl border border-zinc-200 dark:border-zinc-700 p-4 w-80 text-zinc-900 dark:text-zinc-100",ne=()=>{if(t.header)return t.header({month:W,year:a,onPrev:j,onNext:C,nav:X});const r=t.navPrevYear,n=t.navPrev,o=t.navNext,l=t.navNextYear,m=t.headerLabel||xe.DefaultHeaderLabel;return e.jsxs("div",{className:"flex items-center justify-between gap-1 mb-4",children:[e.jsxs("div",{className:"flex items-center gap-0.5",children:[r?r({onClick:p}):e.jsx("button",{type:"button",onClick:p,className:"p-1.5 rounded text-zinc-500 dark:text-zinc-400 hover:bg-zinc-100 dark:hover:bg-zinc-800 transition-colors","aria-label":"Previous year",children:e.jsx(v.ChevronsLeftIcon,{size:16})}),n?n({onClick:j}):e.jsx("button",{type:"button",onClick:j,className:"p-1.5 rounded text-zinc-500 dark:text-zinc-400 hover:bg-zinc-100 dark:hover:bg-zinc-800 transition-colors","aria-label":"Previous month",children:e.jsx(v.ChevronLeftIcon,{size:16})})]}),m({month:W,year:a}),e.jsxs("div",{className:"flex items-center gap-0.5",children:[o?o({onClick:C}):e.jsx("button",{type:"button",onClick:C,className:"p-1.5 rounded text-zinc-500 dark:text-zinc-400 hover:bg-zinc-100 dark:hover:bg-zinc-800 transition-colors","aria-label":"Next month",children:e.jsx(v.ChevronRightIcon,{size:16})}),l?l({onClick:f}):e.jsx("button",{type:"button",onClick:f,className:"p-1.5 rounded text-zinc-500 dark:text-zinc-400 hover:bg-zinc-100 dark:hover:bg-zinc-800 transition-colors","aria-label":"Next year",children:e.jsx(v.ChevronsRightIcon,{size:16})})]})]})},re=()=>{if(t.weekdays)return t.weekdays({days:U});const r=t.weekday;return e.jsx("div",{className:"grid grid-cols-7 gap-1 mb-2",children:U.map(n=>r?e.jsx("div",{children:r({label:n})},n):e.jsx("div",{className:w.cn("text-center text-xs font-medium uppercase",c.WEEKEND_LABELS.includes(n)&&"text-red-500"),children:n},n))})},se=(r,n)=>{const{date:o,isCurrentMonth:l}=r,m=o.getDate(),ie=o.getDay(),de=u.isWeekendDay(ie),b=u.isSameDay(B,o),E=u.isSameDay(Q,o),y=$(o),_=V(o),H=()=>{y||N==null||N(o)},le={date:o,day:m,isCurrentMonth:l,isSelected:b,isToday:E,isDisabled:y,isHighlighted:_,onClick:H};return t.day?e.jsx("span",{children:t.day(le)},n):e.jsx("button",{type:"button",onClick:H,disabled:y,className:w.cn("w-8 h-8 rounded-full text-sm font-medium transition-colors flex items-center justify-center",b&&"bg-pink-500 text-white hover:bg-pink-600",!b&&E&&"ring-2 ring-pink-500/50 bg-transparent",!b&&!E&&(l?de?"text-red-500 dark:text-red-400 hover:bg-zinc-100 dark:hover:bg-zinc-800":"text-zinc-700 dark:text-zinc-300 hover:bg-zinc-100 dark:hover:bg-zinc-800":"text-zinc-400 dark:text-zinc-600 hover:bg-zinc-50 dark:hover:bg-zinc-800/50"),_&&!b&&"bg-pink-500/15",y&&"opacity-40 cursor-not-allowed"),children:m},n)},oe=()=>{const r=ee.map((n,o)=>se(n,o));return t.daysGrid?t.daysGrid({children:r,className:"grid grid-cols-7 gap-1"}):e.jsx("div",{className:"grid grid-cols-7 gap-1",children:r})},ae=()=>{const r=I&&D&&x,n=A&&h;if(!r&&!n)return null;if(t.footer){const o=t.clearButton,l=t.todayButton;return t.footer({children:e.jsxs("div",{className:"flex justify-between gap-2 mt-4 pt-3 border-t border-zinc-200 dark:border-zinc-700",children:[r&&o?o({onClick:x,hasSelection:D}):r?e.jsx("button",{type:"button",onClick:x,className:"text-sm text-zinc-500 dark:text-zinc-400 hover:text-zinc-700 dark:hover:text-zinc-200",children:"Clear"}):e.jsx("span",{}),n&&l?l({onClick:h}):n?e.jsx("button",{type:"button",onClick:h,className:"text-sm text-pink-600 hover:text-pink-700 font-medium",children:"Today"}):null]})})}return t.clearButton&&t.todayButton?e.jsxs("div",{className:"flex justify-between gap-2 mt-4 pt-3 border-t border-zinc-200 dark:border-zinc-700",children:[r&&t.clearButton({onClick:x,hasSelection:D}),n&&t.todayButton({onClick:h})]}):e.jsxs("div",{className:"flex justify-between gap-2 mt-4 pt-3 border-t border-zinc-200 dark:border-zinc-700",children:[r?e.jsx("button",{type:"button",onClick:x,className:"text-sm text-zinc-500 dark:text-zinc-400 hover:text-zinc-700 dark:hover:text-zinc-200 transition-colors",children:"Clear"}):e.jsx("span",{}),n?e.jsx("button",{type:"button",onClick:h,className:"text-sm text-pink-600 dark:text-pink-400 hover:text-pink-700 dark:hover:text-pink-300 font-medium transition-colors",children:"Today"}):null]})},Y=e.jsxs(e.Fragment,{children:[ne(),re(),oe(),ae()]}),q=w.cn(te,J),ce=Object.keys(O).length?O:void 0;return t.root?t.root({children:Y,className:q}):e.jsx("div",{className:q,style:ce,children:Y})};exports.Calendar=he;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),a=({month:e,year:t})=>s.jsxs("span",{className:"font-semibold text-sm select-none",children:[e," ",t]});exports.DefaultHeaderLabel=a;
|
|
@@ -1,117 +1,114 @@
|
|
|
1
|
-
import { jsxs as l, Fragment as ue, jsx as
|
|
2
|
-
import { useMemo as
|
|
1
|
+
import { jsxs as l, Fragment as ue, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as P, useCallback as h } from "react";
|
|
3
3
|
import { cn as O } from "../../utils/cn.js";
|
|
4
|
-
import { useBearStyles as
|
|
5
|
-
import { ChevronsLeftIcon as
|
|
6
|
-
import {
|
|
7
|
-
import { isSameDay as
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}) => {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
}, [i, d, c]), Y = R, B = S, X = {
|
|
43
|
-
onPrevYear: E,
|
|
44
|
-
onPrevMonth: R,
|
|
4
|
+
import { useBearStyles as me } from "../../hooks/useBearStyles.js";
|
|
5
|
+
import { ChevronsLeftIcon as be, ChevronLeftIcon as ke, ChevronRightIcon as xe, ChevronsRightIcon as ve } from "../Icon/index.js";
|
|
6
|
+
import { DEFAULT_WEEKDAYS as ye, NUMBER as c, MONTHS as pe, WEEKEND_LABELS as ze } from "./Calendar.const.js";
|
|
7
|
+
import { isSameDay as y, buildCalendarGrid as ge, reorderWeekdays as Ne, isWeekendDay as fe } from "./Calendar.utils.js";
|
|
8
|
+
import { DefaultHeaderLabel as Ce } from "./Calendar.helpers.js";
|
|
9
|
+
const Te = (_) => {
|
|
10
|
+
const {
|
|
11
|
+
viewDate: B,
|
|
12
|
+
value: L = null,
|
|
13
|
+
onSelect: p,
|
|
14
|
+
onViewChange: o,
|
|
15
|
+
minDate: z,
|
|
16
|
+
maxDate: g,
|
|
17
|
+
disabledDates: W = [],
|
|
18
|
+
highlightedDates: Y = [],
|
|
19
|
+
weekdayLabels: M = ye,
|
|
20
|
+
firstDayOfWeek: k = c.ZERO,
|
|
21
|
+
showWeekNumbers: De = !1,
|
|
22
|
+
slots: e = {},
|
|
23
|
+
clearable: K = !0,
|
|
24
|
+
onClear: u,
|
|
25
|
+
showTodayButton: U = !0,
|
|
26
|
+
onToday: m,
|
|
27
|
+
bis: Z,
|
|
28
|
+
style: q,
|
|
29
|
+
inline: J = !1,
|
|
30
|
+
className: Q
|
|
31
|
+
} = _, i = B.getFullYear(), T = me(Z, q), s = B.getMonth(), X = P(() => /* @__PURE__ */ new Date(), []), N = h(() => {
|
|
32
|
+
o == null || o(new Date(i - c.ONE, s, c.ONE));
|
|
33
|
+
}, [i, s, o]), j = h(() => {
|
|
34
|
+
o == null || o(new Date(i, s - c.ONE, c.ONE));
|
|
35
|
+
}, [i, s, o]), S = h(() => {
|
|
36
|
+
o == null || o(new Date(i, s + c.ONE, c.ONE));
|
|
37
|
+
}, [i, s, o]), f = h(() => {
|
|
38
|
+
o == null || o(new Date(i + c.ONE, s, c.ONE));
|
|
39
|
+
}, [i, s, o]), C = j, D = S, $ = {
|
|
40
|
+
onPrevYear: N,
|
|
41
|
+
onPrevMonth: j,
|
|
45
42
|
onNextMonth: S,
|
|
46
|
-
onNextYear:
|
|
47
|
-
},
|
|
48
|
-
(
|
|
49
|
-
[
|
|
50
|
-
),
|
|
51
|
-
(
|
|
52
|
-
[
|
|
53
|
-
),
|
|
54
|
-
() =>
|
|
55
|
-
[i,
|
|
56
|
-
),
|
|
57
|
-
() =>
|
|
58
|
-
[
|
|
59
|
-
),
|
|
43
|
+
onNextYear: f
|
|
44
|
+
}, V = h(
|
|
45
|
+
(n) => z && n < z || g && n > g ? !0 : W.some((t) => y(t, n)),
|
|
46
|
+
[z, g, W]
|
|
47
|
+
), ee = h(
|
|
48
|
+
(n) => Y.some((t) => y(t, n)),
|
|
49
|
+
[Y]
|
|
50
|
+
), te = P(
|
|
51
|
+
() => ge(i, s, k),
|
|
52
|
+
[i, s, k]
|
|
53
|
+
), H = P(
|
|
54
|
+
() => Ne(M, k),
|
|
55
|
+
[M, k]
|
|
56
|
+
), F = pe[s], w = L != null, ne = J ? "block w-full bg-white dark:bg-gray-900 rounded-xl shadow-none border border-zinc-200 dark:border-zinc-700 p-4 text-zinc-900 dark:text-zinc-100" : "absolute z-50 mt-2 bg-white dark:bg-gray-900 rounded-xl shadow-xl border border-zinc-200 dark:border-zinc-700 p-4 w-80 text-zinc-900 dark:text-zinc-100", re = () => {
|
|
60
57
|
if (e.header)
|
|
61
|
-
return e.header({ month:
|
|
62
|
-
const
|
|
58
|
+
return e.header({ month: F, year: i, onPrev: C, onNext: D, nav: $ });
|
|
59
|
+
const n = e.navPrevYear, t = e.navPrev, a = e.navNext, d = e.navNextYear, x = e.headerLabel || Ce;
|
|
63
60
|
return /* @__PURE__ */ l("div", { className: "flex items-center justify-between gap-1 mb-4", children: [
|
|
64
61
|
/* @__PURE__ */ l("div", { className: "flex items-center gap-0.5", children: [
|
|
65
|
-
|
|
62
|
+
n ? n({ onClick: N }) : /* @__PURE__ */ r(
|
|
66
63
|
"button",
|
|
67
64
|
{
|
|
68
65
|
type: "button",
|
|
69
|
-
onClick:
|
|
66
|
+
onClick: N,
|
|
70
67
|
className: "p-1.5 rounded text-zinc-500 dark:text-zinc-400 hover:bg-zinc-100 dark:hover:bg-zinc-800 transition-colors",
|
|
71
68
|
"aria-label": "Previous year",
|
|
72
|
-
children: /* @__PURE__ */
|
|
69
|
+
children: /* @__PURE__ */ r(be, { size: 16 })
|
|
73
70
|
}
|
|
74
71
|
),
|
|
75
|
-
t ? t({ onClick:
|
|
72
|
+
t ? t({ onClick: C }) : /* @__PURE__ */ r(
|
|
76
73
|
"button",
|
|
77
74
|
{
|
|
78
75
|
type: "button",
|
|
79
|
-
onClick:
|
|
76
|
+
onClick: C,
|
|
80
77
|
className: "p-1.5 rounded text-zinc-500 dark:text-zinc-400 hover:bg-zinc-100 dark:hover:bg-zinc-800 transition-colors",
|
|
81
78
|
"aria-label": "Previous month",
|
|
82
|
-
children: /* @__PURE__ */
|
|
79
|
+
children: /* @__PURE__ */ r(ke, { size: 16 })
|
|
83
80
|
}
|
|
84
81
|
)
|
|
85
82
|
] }),
|
|
86
|
-
|
|
83
|
+
x({ month: F, year: i }),
|
|
87
84
|
/* @__PURE__ */ l("div", { className: "flex items-center gap-0.5", children: [
|
|
88
|
-
|
|
85
|
+
a ? a({ onClick: D }) : /* @__PURE__ */ r(
|
|
89
86
|
"button",
|
|
90
87
|
{
|
|
91
88
|
type: "button",
|
|
92
|
-
onClick:
|
|
89
|
+
onClick: D,
|
|
93
90
|
className: "p-1.5 rounded text-zinc-500 dark:text-zinc-400 hover:bg-zinc-100 dark:hover:bg-zinc-800 transition-colors",
|
|
94
91
|
"aria-label": "Next month",
|
|
95
|
-
children: /* @__PURE__ */
|
|
92
|
+
children: /* @__PURE__ */ r(xe, { size: 16 })
|
|
96
93
|
}
|
|
97
94
|
),
|
|
98
|
-
|
|
95
|
+
d ? d({ onClick: f }) : /* @__PURE__ */ r(
|
|
99
96
|
"button",
|
|
100
97
|
{
|
|
101
98
|
type: "button",
|
|
102
|
-
onClick:
|
|
99
|
+
onClick: f,
|
|
103
100
|
className: "p-1.5 rounded text-zinc-500 dark:text-zinc-400 hover:bg-zinc-100 dark:hover:bg-zinc-800 transition-colors",
|
|
104
101
|
"aria-label": "Next year",
|
|
105
|
-
children: /* @__PURE__ */
|
|
102
|
+
children: /* @__PURE__ */ r(ve, { size: 16 })
|
|
106
103
|
}
|
|
107
104
|
)
|
|
108
105
|
] })
|
|
109
106
|
] });
|
|
110
|
-
},
|
|
111
|
-
if (e.weekdays) return e.weekdays({ days:
|
|
112
|
-
const
|
|
113
|
-
return /* @__PURE__ */
|
|
114
|
-
(t) =>
|
|
107
|
+
}, oe = () => {
|
|
108
|
+
if (e.weekdays) return e.weekdays({ days: H });
|
|
109
|
+
const n = e.weekday;
|
|
110
|
+
return /* @__PURE__ */ r("div", { className: "grid grid-cols-7 gap-1 mb-2", children: H.map(
|
|
111
|
+
(t) => n ? /* @__PURE__ */ r("div", { children: n({ label: t }) }, t) : /* @__PURE__ */ r(
|
|
115
112
|
"div",
|
|
116
113
|
{
|
|
117
114
|
className: O(
|
|
@@ -123,67 +120,67 @@ const ge = ({ month: k, year: x }) => /* @__PURE__ */ l("span", { className: "fo
|
|
|
123
120
|
t
|
|
124
121
|
)
|
|
125
122
|
) });
|
|
126
|
-
},
|
|
127
|
-
const { date:
|
|
128
|
-
|
|
129
|
-
},
|
|
130
|
-
date:
|
|
131
|
-
day:
|
|
132
|
-
isCurrentMonth:
|
|
133
|
-
isSelected:
|
|
134
|
-
isToday:
|
|
135
|
-
isDisabled:
|
|
136
|
-
isHighlighted:
|
|
137
|
-
onClick:
|
|
123
|
+
}, ae = (n, t) => {
|
|
124
|
+
const { date: a, isCurrentMonth: d } = n, x = a.getDate(), de = a.getDay(), le = fe(de), b = y(L, a), E = y(X, a), v = V(a), A = ee(a), G = () => {
|
|
125
|
+
v || p == null || p(a);
|
|
126
|
+
}, he = {
|
|
127
|
+
date: a,
|
|
128
|
+
day: x,
|
|
129
|
+
isCurrentMonth: d,
|
|
130
|
+
isSelected: b,
|
|
131
|
+
isToday: E,
|
|
132
|
+
isDisabled: v,
|
|
133
|
+
isHighlighted: A,
|
|
134
|
+
onClick: G
|
|
138
135
|
};
|
|
139
|
-
return e.day ? /* @__PURE__ */
|
|
136
|
+
return e.day ? /* @__PURE__ */ r("span", { children: e.day(he) }, t) : /* @__PURE__ */ r(
|
|
140
137
|
"button",
|
|
141
138
|
{
|
|
142
139
|
type: "button",
|
|
143
|
-
onClick:
|
|
144
|
-
disabled:
|
|
140
|
+
onClick: G,
|
|
141
|
+
disabled: v,
|
|
145
142
|
className: O(
|
|
146
143
|
"w-8 h-8 rounded-full text-sm font-medium transition-colors flex items-center justify-center",
|
|
147
|
-
|
|
148
|
-
!
|
|
149
|
-
!
|
|
150
|
-
|
|
151
|
-
|
|
144
|
+
b && "bg-pink-500 text-white hover:bg-pink-600",
|
|
145
|
+
!b && E && "ring-2 ring-pink-500/50 bg-transparent",
|
|
146
|
+
!b && !E && (d ? le ? "text-red-500 dark:text-red-400 hover:bg-zinc-100 dark:hover:bg-zinc-800" : "text-zinc-700 dark:text-zinc-300 hover:bg-zinc-100 dark:hover:bg-zinc-800" : "text-zinc-400 dark:text-zinc-600 hover:bg-zinc-50 dark:hover:bg-zinc-800/50"),
|
|
147
|
+
A && !b && "bg-pink-500/15",
|
|
148
|
+
v && "opacity-40 cursor-not-allowed"
|
|
152
149
|
),
|
|
153
|
-
children:
|
|
150
|
+
children: x
|
|
154
151
|
},
|
|
155
152
|
t
|
|
156
153
|
);
|
|
157
|
-
}, oe = () => {
|
|
158
|
-
const r = ee.map((t, o) => ce(t, o));
|
|
159
|
-
return e.daysGrid ? e.daysGrid({ children: r, className: "grid grid-cols-7 gap-1" }) : /* @__PURE__ */ n("div", { className: "grid grid-cols-7 gap-1", children: r });
|
|
160
154
|
}, ie = () => {
|
|
161
|
-
const
|
|
162
|
-
|
|
155
|
+
const n = te.map((t, a) => ae(t, a));
|
|
156
|
+
return e.daysGrid ? e.daysGrid({ children: n, className: "grid grid-cols-7 gap-1" }) : /* @__PURE__ */ r("div", { className: "grid grid-cols-7 gap-1", children: n });
|
|
157
|
+
}, se = () => {
|
|
158
|
+
const n = K && w && u, t = U && m;
|
|
159
|
+
if (!n && !t) return null;
|
|
163
160
|
if (e.footer) {
|
|
164
|
-
const
|
|
161
|
+
const a = e.clearButton, d = e.todayButton;
|
|
165
162
|
return e.footer({
|
|
166
163
|
children: /* @__PURE__ */ l("div", { className: "flex justify-between gap-2 mt-4 pt-3 border-t border-zinc-200 dark:border-zinc-700", children: [
|
|
167
|
-
|
|
168
|
-
t &&
|
|
164
|
+
n && a ? a({ onClick: u, hasSelection: w }) : n ? /* @__PURE__ */ r("button", { type: "button", onClick: u, className: "text-sm text-zinc-500 dark:text-zinc-400 hover:text-zinc-700 dark:hover:text-zinc-200", children: "Clear" }) : /* @__PURE__ */ r("span", {}),
|
|
165
|
+
t && d ? d({ onClick: m }) : t ? /* @__PURE__ */ r("button", { type: "button", onClick: m, className: "text-sm text-pink-600 hover:text-pink-700 font-medium", children: "Today" }) : null
|
|
169
166
|
] })
|
|
170
167
|
});
|
|
171
168
|
}
|
|
172
169
|
return e.clearButton && e.todayButton ? /* @__PURE__ */ l("div", { className: "flex justify-between gap-2 mt-4 pt-3 border-t border-zinc-200 dark:border-zinc-700", children: [
|
|
173
|
-
|
|
170
|
+
n && e.clearButton({ onClick: u, hasSelection: w }),
|
|
174
171
|
t && e.todayButton({ onClick: m })
|
|
175
172
|
] }) : /* @__PURE__ */ l("div", { className: "flex justify-between gap-2 mt-4 pt-3 border-t border-zinc-200 dark:border-zinc-700", children: [
|
|
176
|
-
|
|
177
|
-
t ? /* @__PURE__ */
|
|
173
|
+
n ? /* @__PURE__ */ r("button", { type: "button", onClick: u, className: "text-sm text-zinc-500 dark:text-zinc-400 hover:text-zinc-700 dark:hover:text-zinc-200 transition-colors", children: "Clear" }) : /* @__PURE__ */ r("span", {}),
|
|
174
|
+
t ? /* @__PURE__ */ r("button", { type: "button", onClick: m, className: "text-sm text-pink-600 dark:text-pink-400 hover:text-pink-700 dark:hover:text-pink-300 font-medium transition-colors", children: "Today" }) : null
|
|
178
175
|
] });
|
|
179
|
-
},
|
|
176
|
+
}, I = /* @__PURE__ */ l(ue, { children: [
|
|
180
177
|
re(),
|
|
181
|
-
ne(),
|
|
182
178
|
oe(),
|
|
183
|
-
ie()
|
|
184
|
-
|
|
185
|
-
|
|
179
|
+
ie(),
|
|
180
|
+
se()
|
|
181
|
+
] }), R = O(ne, Q), ce = Object.keys(T).length ? T : void 0;
|
|
182
|
+
return e.root ? e.root({ children: I, className: R }) : /* @__PURE__ */ r("div", { className: R, style: ce, children: I });
|
|
186
183
|
};
|
|
187
184
|
export {
|
|
188
|
-
|
|
185
|
+
Te as Calendar
|
|
189
186
|
};
|
|
@@ -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"),C=require("react"),c=require("../../utils/cn.cjs"),e=require("./Card.const.cjs"),_=C.forwardRef((t,n)=>{const{variant:r="elevated",padding:a="none",interactive:d=!1,radius:i="lg",className:o,children:l,testId:m,id:E,...N}=t;return s.jsx("div",{ref:n,id:E,className:c.cn("Bear-Card",`Bear-Card--${r}`,"bear-overflow-hidden",e.CARD_VARIANT_CLASSES[r],e.CARD_PADDING_CLASSES[a],e.CARD_RADIUS_CLASSES[i],d&&`Bear-Card--interactive ${e.CARD_INTERACTIVE_CLASSES}`,o),"data-testid":m,...N,children:l})});_.displayName="Card";const S=C.forwardRef((t,n)=>{const{title:r,subtitle:a,action:d,className:i,children:o,...l}=t;return s.jsxs("div",{ref:n,className:c.cn("Bear-Card__header",e.CARD_HEADER_CLASSES,i),...l,children:[s.jsxs("div",{className:"Bear-Card__header-content bear-flex-1 bear-min-w-0",children:[r&&s.jsx("h3",{className:c.cn("Bear-Card__title",e.CARD_TITLE_CLASSES),children:r}),a&&s.jsx("p",{className:c.cn("Bear-Card__subtitle",e.CARD_SUBTITLE_CLASSES),children:a}),o]}),d&&s.jsx("div",{className:"Bear-Card__header-action bear-ml-4 bear-shrink-0",children:d})]})});S.displayName="CardHeader";const A=C.forwardRef((t,n)=>{const{className:r,children:a,...d}=t;return s.jsx("div",{ref:n,className:c.cn("Bear-Card__body",e.CARD_BODY_CLASSES,r),...d,children:a})});A.displayName="CardBody";const R=C.forwardRef((t,n)=>{const{divider:r=!0,className:a,children:d,...i}=t;return s.jsx("div",{ref:n,className:c.cn("Bear-Card__footer",e.CARD_FOOTER_CLASSES,r&&e.CARD_FOOTER_DIVIDER_CLASSES,a),...i,children:d})});R.displayName="CardFooter";const u=Object.assign(_,{Header:S,Body:A,Footer:R});exports.Card=_;exports.CardBody=A;exports.CardCompound=u;exports.CardFooter=R;exports.CardHeader=S;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r={none:"",xs:"bear-p-2",sm:"bear-p-3",md:"bear-p-4",lg:"bear-p-6",xl:"bear-p-8"},e={none:"",sm:"bear-rounded-sm",md:"bear-rounded-md",lg:"bear-rounded-lg",xl:"bear-rounded-xl","2xl":"bear-rounded-2xl"},a={elevated:"bear-bg-white dark:bear-bg-zinc-900 bear-shadow-md",outlined:"bear-bg-white dark:bear-bg-zinc-900 bear-border bear-border-gray-200 dark:bear-border-zinc-700",filled:"bear-bg-gray-100 dark:bear-bg-zinc-800",ghost:"bear-bg-transparent"},b="bear-transition-all bear-duration-200 bear-cursor-pointer hover:bear-shadow-lg hover:bear-scale-[1.02]",S="bear-flex bear-items-start bear-justify-between bear-p-4 bear-border-b bear-border-gray-200 dark:bear-border-zinc-700",A="bear-text-lg bear-font-semibold bear-text-gray-900 dark:bear-text-white bear-truncate",t="bear-text-sm bear-text-gray-500 dark:bear-text-gray-400 bear-mt-1",o="bear-p-4",C="bear-p-4",_="bear-border-t bear-border-gray-200 dark:bear-border-zinc-700";exports.CARD_BODY_CLASSES=o;exports.CARD_FOOTER_CLASSES=C;exports.CARD_FOOTER_DIVIDER_CLASSES=_;exports.CARD_HEADER_CLASSES=S;exports.CARD_INTERACTIVE_CLASSES=b;exports.CARD_PADDING_CLASSES=r;exports.CARD_RADIUS_CLASSES=e;exports.CARD_SUBTITLE_CLASSES=t;exports.CARD_TITLE_CLASSES=A;exports.CARD_VARIANT_CLASSES=a;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { EmberSize } from '../../types';
|
|
2
|
+
export type CardRadius = 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';
|
|
3
|
+
export type CardVariant = 'elevated' | 'outlined' | 'filled' | 'ghost';
|
|
4
|
+
export declare const CARD_PADDING_CLASSES: Record<EmberSize | 'none', string>;
|
|
5
|
+
export declare const CARD_RADIUS_CLASSES: Record<CardRadius, string>;
|
|
6
|
+
export declare const CARD_VARIANT_CLASSES: Record<CardVariant, string>;
|
|
7
|
+
export declare const CARD_INTERACTIVE_CLASSES = "bear-transition-all bear-duration-200 bear-cursor-pointer hover:bear-shadow-lg hover:bear-scale-[1.02]";
|
|
8
|
+
export declare const CARD_HEADER_CLASSES = "bear-flex bear-items-start bear-justify-between bear-p-4 bear-border-b bear-border-gray-200 dark:bear-border-zinc-700";
|
|
9
|
+
export declare const CARD_TITLE_CLASSES = "bear-text-lg bear-font-semibold bear-text-gray-900 dark:bear-text-white bear-truncate";
|
|
10
|
+
export declare const CARD_SUBTITLE_CLASSES = "bear-text-sm bear-text-gray-500 dark:bear-text-gray-400 bear-mt-1";
|
|
11
|
+
export declare const CARD_BODY_CLASSES = "bear-p-4";
|
|
12
|
+
export declare const CARD_FOOTER_CLASSES = "bear-p-4";
|
|
13
|
+
export declare const CARD_FOOTER_DIVIDER_CLASSES = "bear-border-t bear-border-gray-200 dark:bear-border-zinc-700";
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
const r = {
|
|
2
|
+
none: "",
|
|
3
|
+
xs: "bear-p-2",
|
|
4
|
+
sm: "bear-p-3",
|
|
5
|
+
md: "bear-p-4",
|
|
6
|
+
lg: "bear-p-6",
|
|
7
|
+
xl: "bear-p-8"
|
|
8
|
+
}, e = {
|
|
9
|
+
none: "",
|
|
10
|
+
sm: "bear-rounded-sm",
|
|
11
|
+
md: "bear-rounded-md",
|
|
12
|
+
lg: "bear-rounded-lg",
|
|
13
|
+
xl: "bear-rounded-xl",
|
|
14
|
+
"2xl": "bear-rounded-2xl"
|
|
15
|
+
}, a = {
|
|
16
|
+
elevated: "bear-bg-white dark:bear-bg-zinc-900 bear-shadow-md",
|
|
17
|
+
outlined: "bear-bg-white dark:bear-bg-zinc-900 bear-border bear-border-gray-200 dark:bear-border-zinc-700",
|
|
18
|
+
filled: "bear-bg-gray-100 dark:bear-bg-zinc-800",
|
|
19
|
+
ghost: "bear-bg-transparent"
|
|
20
|
+
}, b = "bear-transition-all bear-duration-200 bear-cursor-pointer hover:bear-shadow-lg hover:bear-scale-[1.02]", t = "bear-flex bear-items-start bear-justify-between bear-p-4 bear-border-b bear-border-gray-200 dark:bear-border-zinc-700", o = "bear-text-lg bear-font-semibold bear-text-gray-900 dark:bear-text-white bear-truncate", d = "bear-text-sm bear-text-gray-500 dark:bear-text-gray-400 bear-mt-1", n = "bear-p-4", S = "bear-p-4", s = "bear-border-t bear-border-gray-200 dark:bear-border-zinc-700";
|
|
21
|
+
export {
|
|
22
|
+
n as CARD_BODY_CLASSES,
|
|
23
|
+
S as CARD_FOOTER_CLASSES,
|
|
24
|
+
s as CARD_FOOTER_DIVIDER_CLASSES,
|
|
25
|
+
t as CARD_HEADER_CLASSES,
|
|
26
|
+
b as CARD_INTERACTIVE_CLASSES,
|
|
27
|
+
r as CARD_PADDING_CLASSES,
|
|
28
|
+
e as CARD_RADIUS_CLASSES,
|
|
29
|
+
d as CARD_SUBTITLE_CLASSES,
|
|
30
|
+
o as CARD_TITLE_CLASSES,
|
|
31
|
+
a as CARD_VARIANT_CLASSES
|
|
32
|
+
};
|
|
@@ -29,3 +29,4 @@ export declare const CardCompound: import('react').ForwardRefExoticComponent<Car
|
|
|
29
29
|
Body: import('react').ForwardRefExoticComponent<CardBodyProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
30
30
|
Footer: import('react').ForwardRefExoticComponent<CardFooterProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
31
31
|
};
|
|
32
|
+
export default Card;
|