@forgedevstack/bear 1.1.9 → 1.2.0
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/AlertDialog/AlertDialog.cjs +1 -1
- package/dist/components/AlertDialog/AlertDialog.const.cjs +1 -1
- package/dist/components/AlertDialog/AlertDialog.const.d.ts +2 -2
- package/dist/components/AlertDialog/AlertDialog.const.js +4 -4
- package/dist/components/AlertDialog/AlertDialog.js +76 -62
- package/dist/components/Calendar/Calendar.cjs +1 -1
- package/dist/components/Calendar/Calendar.js +3 -2
- package/dist/components/CloseButton/CloseButton.cjs +1 -0
- package/dist/components/CloseButton/CloseButton.d.ts +4 -0
- package/dist/components/CloseButton/CloseButton.js +60 -0
- package/dist/components/CloseButton/CloseButton.types.d.ts +15 -0
- package/dist/components/CloseButton/index.d.ts +2 -0
- package/dist/components/DatePicker/DatePicker.cjs +1 -1
- package/dist/components/DatePicker/DatePicker.js +12 -11
- package/dist/components/Icon/icons/commerce.cjs +1 -0
- package/dist/components/Icon/icons/commerce.d.ts +25 -0
- package/dist/components/Icon/icons/commerce.js +124 -0
- package/dist/components/Icon/icons/device.cjs +1 -0
- package/dist/components/Icon/icons/device.d.ts +27 -0
- package/dist/components/Icon/icons/device.js +122 -0
- package/dist/components/Icon/icons/file.cjs +1 -0
- package/dist/components/Icon/icons/file.d.ts +25 -0
- package/dist/components/Icon/icons/file.js +120 -0
- package/dist/components/Icon/icons/social.cjs +1 -0
- package/dist/components/Icon/icons/social.d.ts +24 -0
- package/dist/components/Icon/icons/social.js +89 -0
- package/dist/components/Icon/index.cjs +1 -1
- package/dist/components/Icon/index.d.ts +93 -56
- package/dist/components/Icon/index.js +38 -26
- package/dist/components/Overlay/Overlay.cjs +1 -0
- package/dist/components/Overlay/Overlay.d.ts +4 -0
- package/dist/components/Overlay/Overlay.js +38 -0
- package/dist/components/Overlay/Overlay.types.d.ts +23 -0
- package/dist/components/Overlay/index.d.ts +2 -0
- package/dist/components/Portal/Portal.cjs +1 -0
- package/dist/components/Portal/Portal.d.ts +11 -0
- package/dist/components/Portal/Portal.js +12 -0
- package/dist/components/Portal/index.d.ts +2 -0
- package/dist/components/ThemeIcon/ThemeIcon.cjs +1 -0
- package/dist/components/ThemeIcon/ThemeIcon.d.ts +4 -0
- package/dist/components/ThemeIcon/ThemeIcon.js +54 -0
- package/dist/components/ThemeIcon/ThemeIcon.types.d.ts +22 -0
- package/dist/components/ThemeIcon/index.d.ts +2 -0
- package/dist/components/VisuallyHidden/VisuallyHidden.cjs +1 -0
- package/dist/components/VisuallyHidden/VisuallyHidden.d.ts +6 -0
- package/dist/components/VisuallyHidden/VisuallyHidden.js +22 -0
- package/dist/components/VisuallyHidden/index.d.ts +2 -0
- package/dist/components/index.cjs +1 -1
- package/dist/components/index.d.ts +10 -0
- package/dist/components/index.js +54 -44
- package/dist/hooks/bearStyled.cjs +1 -1
- package/dist/hooks/bearStyled.d.ts +31 -9
- package/dist/hooks/bearStyled.js +17 -12
- package/dist/hooks/useMediaQuery/useMediaQuery.d.ts +9 -1
- package/dist/hooks/useResponsive.cjs +1 -1
- package/dist/hooks/useResponsive.d.ts +2 -17
- package/dist/hooks/useResponsive.js +47 -41
- package/dist/index.cjs +1 -1
- package/dist/index.js +183 -173
- package/dist/styles/_effects.css +9 -0
- package/dist/styles.css +1 -1
- package/dist/types/theme.types.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),r=require("react"),B=require("react-dom"),a=require("../../utils/cn.cjs"),v=require("../Button/Button.cjs"),x=require("../Typography/Typography.cjs"),o=require("./AlertDialog.const.cjs"),N=p=>{const{isOpen:d,onClose:i,onConfirm:D,title:L,description:u,confirmText:S="Confirm",cancelText:T="Cancel",confirmVariant:C="danger",loading:n=!1,loadingText:R,closeOnBackdrop:I=!1,closeOnEscape:m=!0,icon:c,className:O,testId:j}=p,A=r.useId(),_=`bear-alert-title-${A}`,y=`bear-alert-desc-${A}`,l=r.useRef(null),E=r.useRef(null),b=r.useCallback(e=>{m&&e.key==="Escape"&&!n&&i()},[m,i,n]),f=r.useCallback(e=>{if(e.key!=="Tab"||!l.current)return;const s=l.current.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])');if(s.length===0)return;const g=s[0],h=s[s.length-1];e.shiftKey&&document.activeElement===g?(e.preventDefault(),h.focus()):!e.shiftKey&&document.activeElement===h&&(e.preventDefault(),g.focus())},[]);if(r.useEffect(()=>(d&&(E.current=document.activeElement,document.addEventListener("keydown",b),document.addEventListener("keydown",f),document.body.style.overflow="hidden",requestAnimationFrame(()=>{var e;return(e=l.current)==null?void 0:e.focus()})),()=>{var e;document.removeEventListener("keydown",b),document.removeEventListener("keydown",f),document.body.style.overflow="",(e=E.current)==null||e.focus()}),[d,b,f]),!d)return null;const k=t.jsxs("div",{className:"Bear-AlertDialog bear-fixed bear-inset-0 bear-z-50 bear-flex bear-items-center bear-justify-center bear-p-4","data-testid":j,children:[t.jsx("div",{className:a.cn("Bear-AlertDialog__backdrop",o.ALERT_DIALOG_BACKDROP_CLASSES),onClick:I&&!n?i:void 0,"aria-hidden":"true"}),t.jsxs("div",{ref:l,role:"alertdialog","aria-modal":"true","aria-labelledby":_,"aria-describedby":u?y:void 0,tabIndex:-1,className:a.cn("Bear-AlertDialog__container",o.ALERT_DIALOG_CONTAINER_CLASSES,"bear-p-6",O),children:[c&&t.jsx("div",{className:"Bear-AlertDialog__icon bear-mb-4 bear-flex bear-justify-center",children:c}),t.jsx(x.Typography,{variant:"h6",id:_,className:a.cn("Bear-AlertDialog__title",o.ALERT_DIALOG_TITLE_CLASSES,c&&"bear-text-center"),children:L}),u&&t.jsx(x.Typography,{variant:"body2",id:y,className:a.cn("Bear-AlertDialog__description",o.ALERT_DIALOG_DESCRIPTION_CLASSES,c&&"bear-text-center"),children:u}),t.jsxs("div",{className:a.cn("Bear-AlertDialog__footer",o.ALERT_DIALOG_FOOTER_CLASSES),children:[t.jsx(v.Button,{variant:"ghost",onClick:i,disabled:n,children:T}),t.jsx(v.Button,{variant:C,onClick:D,loading:n,loadingText:R,children:S})]})]})]});return B.createPortal(k,document.body)};exports.AlertDialog=N;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="bear-absolute bear-inset-0 bear-bg-black/60 bear-backdrop-blur-sm bear-transition-opacity",
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="bear-absolute bear-inset-0 bear-bg-black/60 bear-backdrop-blur-sm bear-transition-opacity animate-fade-in",a="bear-relative bear-w-full bear-max-w-md bear-bg-white dark:bear-bg-zinc-900 bear-rounded-xl bear-shadow-2xl bear-border bear-border-gray-200 dark:bear-border-zinc-700 bear-transform bear-transition-all animate-alert-dialog-in",r="bear-text-lg bear-font-semibold bear-text-gray-900 dark:bear-text-white",b="bear-text-sm bear-text-gray-600 dark:bear-text-gray-400 bear-mt-2",t="bear-flex bear-items-center bear-justify-end bear-gap-3 bear-pt-6";exports.ALERT_DIALOG_BACKDROP_CLASSES=e;exports.ALERT_DIALOG_CONTAINER_CLASSES=a;exports.ALERT_DIALOG_DESCRIPTION_CLASSES=b;exports.ALERT_DIALOG_FOOTER_CLASSES=t;exports.ALERT_DIALOG_TITLE_CLASSES=r;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export declare const ALERT_DIALOG_BACKDROP_CLASSES = "bear-absolute bear-inset-0 bear-bg-black/60 bear-backdrop-blur-sm bear-transition-opacity";
|
|
2
|
-
export declare const ALERT_DIALOG_CONTAINER_CLASSES = "bear-relative bear-w-full bear-max-w-md bear-bg-white dark:bear-bg-zinc-900 bear-rounded-xl bear-shadow-2xl bear-border bear-border-gray-200 dark:bear-border-zinc-700 bear-transform bear-transition-all
|
|
1
|
+
export declare const ALERT_DIALOG_BACKDROP_CLASSES = "bear-absolute bear-inset-0 bear-bg-black/60 bear-backdrop-blur-sm bear-transition-opacity animate-fade-in";
|
|
2
|
+
export declare const ALERT_DIALOG_CONTAINER_CLASSES = "bear-relative bear-w-full bear-max-w-md bear-bg-white dark:bear-bg-zinc-900 bear-rounded-xl bear-shadow-2xl bear-border bear-border-gray-200 dark:bear-border-zinc-700 bear-transform bear-transition-all animate-alert-dialog-in";
|
|
3
3
|
export declare const ALERT_DIALOG_TITLE_CLASSES = "bear-text-lg bear-font-semibold bear-text-gray-900 dark:bear-text-white";
|
|
4
4
|
export declare const ALERT_DIALOG_DESCRIPTION_CLASSES = "bear-text-sm bear-text-gray-600 dark:bear-text-gray-400 bear-mt-2";
|
|
5
5
|
export declare const ALERT_DIALOG_FOOTER_CLASSES = "bear-flex bear-items-center bear-justify-end bear-gap-3 bear-pt-6";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a = "bear-absolute bear-inset-0 bear-bg-black/60 bear-backdrop-blur-sm bear-transition-opacity animate-fade-in", e = "bear-relative bear-w-full bear-max-w-md bear-bg-white dark:bear-bg-zinc-900 bear-rounded-xl bear-shadow-2xl bear-border bear-border-gray-200 dark:bear-border-zinc-700 bear-transform bear-transition-all animate-alert-dialog-in", r = "bear-text-lg bear-font-semibold bear-text-gray-900 dark:bear-text-white", b = "bear-text-sm bear-text-gray-600 dark:bear-text-gray-400 bear-mt-2", t = "bear-flex bear-items-center bear-justify-end bear-gap-3 bear-pt-6";
|
|
2
2
|
export {
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
a as ALERT_DIALOG_BACKDROP_CLASSES,
|
|
4
|
+
e as ALERT_DIALOG_CONTAINER_CLASSES,
|
|
5
5
|
b as ALERT_DIALOG_DESCRIPTION_CLASSES,
|
|
6
6
|
t as ALERT_DIALOG_FOOTER_CLASSES,
|
|
7
|
-
|
|
7
|
+
r as ALERT_DIALOG_TITLE_CLASSES
|
|
8
8
|
};
|
|
@@ -1,96 +1,110 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import {
|
|
3
|
-
import { createPortal as
|
|
1
|
+
import { jsxs as m, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { useId as w, useRef as y, useCallback as h, useEffect as G } from "react";
|
|
3
|
+
import { createPortal as j } from "react-dom";
|
|
4
4
|
import { cn as a } from "../../utils/cn.js";
|
|
5
|
-
import { Button as
|
|
6
|
-
import { Typography as
|
|
7
|
-
import { ALERT_DIALOG_BACKDROP_CLASSES as
|
|
8
|
-
const
|
|
5
|
+
import { Button as L } from "../Button/Button.js";
|
|
6
|
+
import { Typography as g } from "../Typography/Typography.js";
|
|
7
|
+
import { ALERT_DIALOG_BACKDROP_CLASSES as F, ALERT_DIALOG_TITLE_CLASSES as K, ALERT_DIALOG_DESCRIPTION_CLASSES as P, ALERT_DIALOG_FOOTER_CLASSES as q, ALERT_DIALOG_CONTAINER_CLASSES as $ } from "./AlertDialog.const.js";
|
|
8
|
+
const W = (C) => {
|
|
9
9
|
const {
|
|
10
|
-
isOpen:
|
|
11
|
-
onClose:
|
|
12
|
-
onConfirm:
|
|
13
|
-
title:
|
|
14
|
-
description:
|
|
15
|
-
confirmText:
|
|
16
|
-
cancelText:
|
|
17
|
-
confirmVariant:
|
|
10
|
+
isOpen: c,
|
|
11
|
+
onClose: n,
|
|
12
|
+
onConfirm: D,
|
|
13
|
+
title: S,
|
|
14
|
+
description: d,
|
|
15
|
+
confirmText: T = "Confirm",
|
|
16
|
+
cancelText: x = "Cancel",
|
|
17
|
+
confirmVariant: I = "danger",
|
|
18
18
|
loading: r = !1,
|
|
19
|
-
loadingText:
|
|
20
|
-
closeOnBackdrop:
|
|
21
|
-
closeOnEscape:
|
|
22
|
-
icon:
|
|
23
|
-
className:
|
|
24
|
-
testId:
|
|
25
|
-
} = _,
|
|
26
|
-
(
|
|
27
|
-
|
|
19
|
+
loadingText: O,
|
|
20
|
+
closeOnBackdrop: k = !1,
|
|
21
|
+
closeOnEscape: f = !0,
|
|
22
|
+
icon: o,
|
|
23
|
+
className: R,
|
|
24
|
+
testId: N
|
|
25
|
+
} = C, b = w(), A = `bear-alert-title-${b}`, _ = `bear-alert-desc-${b}`, i = y(null), E = y(null), s = h(
|
|
26
|
+
(e) => {
|
|
27
|
+
f && e.key === "Escape" && !r && n();
|
|
28
28
|
},
|
|
29
|
-
[
|
|
30
|
-
)
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
29
|
+
[f, n, r]
|
|
30
|
+
), u = h((e) => {
|
|
31
|
+
if (e.key !== "Tab" || !i.current) return;
|
|
32
|
+
const l = i.current.querySelectorAll(
|
|
33
|
+
'button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'
|
|
34
|
+
);
|
|
35
|
+
if (l.length === 0) return;
|
|
36
|
+
const p = l[0], v = l[l.length - 1];
|
|
37
|
+
e.shiftKey && document.activeElement === p ? (e.preventDefault(), v.focus()) : !e.shiftKey && document.activeElement === v && (e.preventDefault(), p.focus());
|
|
38
|
+
}, []);
|
|
39
|
+
if (G(() => (c && (E.current = document.activeElement, document.addEventListener("keydown", s), document.addEventListener("keydown", u), document.body.style.overflow = "hidden", requestAnimationFrame(() => {
|
|
40
|
+
var e;
|
|
41
|
+
return (e = i.current) == null ? void 0 : e.focus();
|
|
42
|
+
})), () => {
|
|
43
|
+
var e;
|
|
44
|
+
document.removeEventListener("keydown", s), document.removeEventListener("keydown", u), document.body.style.overflow = "", (e = E.current) == null || e.focus();
|
|
45
|
+
}), [c, s, u]), !c) return null;
|
|
46
|
+
const B = /* @__PURE__ */ m(
|
|
35
47
|
"div",
|
|
36
48
|
{
|
|
37
49
|
className: "Bear-AlertDialog bear-fixed bear-inset-0 bear-z-50 bear-flex bear-items-center bear-justify-center bear-p-4",
|
|
38
|
-
"data-testid":
|
|
50
|
+
"data-testid": N,
|
|
39
51
|
children: [
|
|
40
|
-
/* @__PURE__ */
|
|
52
|
+
/* @__PURE__ */ t(
|
|
41
53
|
"div",
|
|
42
54
|
{
|
|
43
|
-
className: a("Bear-AlertDialog__backdrop",
|
|
44
|
-
onClick:
|
|
55
|
+
className: a("Bear-AlertDialog__backdrop", F),
|
|
56
|
+
onClick: k && !r ? n : void 0,
|
|
45
57
|
"aria-hidden": "true"
|
|
46
58
|
}
|
|
47
59
|
),
|
|
48
|
-
/* @__PURE__ */
|
|
60
|
+
/* @__PURE__ */ m(
|
|
49
61
|
"div",
|
|
50
62
|
{
|
|
63
|
+
ref: i,
|
|
51
64
|
role: "alertdialog",
|
|
52
65
|
"aria-modal": "true",
|
|
53
|
-
"aria-labelledby":
|
|
54
|
-
"aria-describedby":
|
|
55
|
-
|
|
66
|
+
"aria-labelledby": A,
|
|
67
|
+
"aria-describedby": d ? _ : void 0,
|
|
68
|
+
tabIndex: -1,
|
|
69
|
+
className: a("Bear-AlertDialog__container", $, "bear-p-6", R),
|
|
56
70
|
children: [
|
|
57
|
-
|
|
58
|
-
/* @__PURE__ */
|
|
59
|
-
|
|
71
|
+
o && /* @__PURE__ */ t("div", { className: "Bear-AlertDialog__icon bear-mb-4 bear-flex bear-justify-center", children: o }),
|
|
72
|
+
/* @__PURE__ */ t(
|
|
73
|
+
g,
|
|
60
74
|
{
|
|
61
75
|
variant: "h6",
|
|
62
|
-
id:
|
|
63
|
-
className: a("Bear-AlertDialog__title",
|
|
64
|
-
children:
|
|
76
|
+
id: A,
|
|
77
|
+
className: a("Bear-AlertDialog__title", K, o && "bear-text-center"),
|
|
78
|
+
children: S
|
|
65
79
|
}
|
|
66
80
|
),
|
|
67
|
-
|
|
68
|
-
|
|
81
|
+
d && /* @__PURE__ */ t(
|
|
82
|
+
g,
|
|
69
83
|
{
|
|
70
84
|
variant: "body2",
|
|
71
|
-
id:
|
|
72
|
-
className: a("Bear-AlertDialog__description",
|
|
73
|
-
children:
|
|
85
|
+
id: _,
|
|
86
|
+
className: a("Bear-AlertDialog__description", P, o && "bear-text-center"),
|
|
87
|
+
children: d
|
|
74
88
|
}
|
|
75
89
|
),
|
|
76
|
-
/* @__PURE__ */
|
|
77
|
-
/* @__PURE__ */
|
|
78
|
-
|
|
90
|
+
/* @__PURE__ */ m("div", { className: a("Bear-AlertDialog__footer", q), children: [
|
|
91
|
+
/* @__PURE__ */ t(
|
|
92
|
+
L,
|
|
79
93
|
{
|
|
80
94
|
variant: "ghost",
|
|
81
|
-
onClick:
|
|
95
|
+
onClick: n,
|
|
82
96
|
disabled: r,
|
|
83
|
-
children:
|
|
97
|
+
children: x
|
|
84
98
|
}
|
|
85
99
|
),
|
|
86
|
-
/* @__PURE__ */
|
|
87
|
-
|
|
100
|
+
/* @__PURE__ */ t(
|
|
101
|
+
L,
|
|
88
102
|
{
|
|
89
|
-
variant:
|
|
90
|
-
onClick:
|
|
103
|
+
variant: I,
|
|
104
|
+
onClick: D,
|
|
91
105
|
loading: r,
|
|
92
|
-
loadingText:
|
|
93
|
-
children:
|
|
106
|
+
loadingText: O,
|
|
107
|
+
children: T
|
|
94
108
|
}
|
|
95
109
|
)
|
|
96
110
|
] })
|
|
@@ -100,8 +114,8 @@ const z = (_) => {
|
|
|
100
114
|
]
|
|
101
115
|
}
|
|
102
116
|
);
|
|
103
|
-
return
|
|
117
|
+
return j(B, document.body);
|
|
104
118
|
};
|
|
105
119
|
export {
|
|
106
|
-
|
|
120
|
+
W as AlertDialog
|
|
107
121
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),i=require("react"),D=require("../../utils/cn.cjs"),he=require("../../hooks/useBearStyles.cjs");require("../../hooks/useBearComponent/useBearComponent.cjs");const v=require("../Icon/index.cjs"),s=require("./Calendar.const.cjs"),l=require("./Calendar.utils.cjs"),xe=require("./Calendar.helpers.cjs"),ke=G=>{const{viewDate:w,value:E=null,onSelect:C,onViewChange:n,minDate:N,maxDate:_,disabledDates:M=[],highlightedDates:R=[],weekdayLabels:S=s.DEFAULT_WEEKDAYS,firstDayOfWeek:k=s.NUMBER.ZERO,showWeekNumbers:ye=!1,slots:r={},clearable:K=!0,onClear:u,showTodayButton:Z=!0,onToday:h,bis:X,style:J,inline:O=!1,className:Q}=G,b=w.getFullYear(),P=he.useBearStyles(X,J),d=w.getMonth(),$=i.useMemo(()=>new Date,[]),g=i.useCallback(()=>{n==null||n(new Date(b-s.NUMBER.ONE,d,s.NUMBER.ONE))},[b,d,n]),L=i.useCallback(()=>{n==null||n(new Date(b,d-s.NUMBER.ONE,s.NUMBER.ONE))},[b,d,n]),W=i.useCallback(()=>{n==null||n(new Date(b,d+s.NUMBER.ONE,s.NUMBER.ONE))},[b,d,n]),z=i.useCallback(()=>{n==null||n(new Date(b+s.NUMBER.ONE,d,s.NUMBER.ONE))},[b,d,n]),p=L,B=W,V={onPrevYear:g,onPrevMonth:L,onNextMonth:W,onNextYear:z},ee=i.useCallback(t=>N&&t<N||_&&t>_?!0:M.some(a=>l.isSameDay(a,t)),[N,_,M]),re=i.useCallback(t=>R.some(a=>l.isSameDay(a,t)),[R]),ae=i.useMemo(()=>l.buildCalendarGrid(b,d,k),[b,d,k]),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),i=require("react"),D=require("../../utils/cn.cjs"),he=require("../../hooks/useBearStyles.cjs");require("../../hooks/useBearComponent/useBearComponent.cjs");require("../../context/BearProvider.cjs");const v=require("../Icon/index.cjs"),s=require("./Calendar.const.cjs"),l=require("./Calendar.utils.cjs"),xe=require("./Calendar.helpers.cjs"),ke=G=>{const{viewDate:w,value:E=null,onSelect:C,onViewChange:n,minDate:N,maxDate:_,disabledDates:M=[],highlightedDates:R=[],weekdayLabels:S=s.DEFAULT_WEEKDAYS,firstDayOfWeek:k=s.NUMBER.ZERO,showWeekNumbers:ye=!1,slots:r={},clearable:K=!0,onClear:u,showTodayButton:Z=!0,onToday:h,bis:X,style:J,inline:O=!1,className:Q}=G,b=w.getFullYear(),P=he.useBearStyles(X,J),d=w.getMonth(),$=i.useMemo(()=>new Date,[]),g=i.useCallback(()=>{n==null||n(new Date(b-s.NUMBER.ONE,d,s.NUMBER.ONE))},[b,d,n]),L=i.useCallback(()=>{n==null||n(new Date(b,d-s.NUMBER.ONE,s.NUMBER.ONE))},[b,d,n]),W=i.useCallback(()=>{n==null||n(new Date(b,d+s.NUMBER.ONE,s.NUMBER.ONE))},[b,d,n]),z=i.useCallback(()=>{n==null||n(new Date(b+s.NUMBER.ONE,d,s.NUMBER.ONE))},[b,d,n]),p=L,B=W,V={onPrevYear:g,onPrevMonth:L,onNextMonth:W,onNextYear:z},ee=i.useCallback(t=>N&&t<N||_&&t>_?!0:M.some(a=>l.isSameDay(a,t)),[N,_,M]),re=i.useCallback(t=>R.some(a=>l.isSameDay(a,t)),[R]),ae=i.useMemo(()=>l.buildCalendarGrid(b,d,k),[b,d,k]),q=i.useMemo(()=>l.reorderWeekdays(S,k),[S,k]),T=s.MONTHS[d],f=E!=null,te=O?"Bear-Calendar Bear-Calendar--inline bear-block bear-w-full bear-bg-white dark:bear-bg-zinc-900 bear-rounded-xl bear-shadow-none bear-border bear-border-zinc-200 dark:bear-border-zinc-700 bear-p-4 bear-text-zinc-900 dark:bear-text-zinc-100":"Bear-Calendar Bear-Calendar--dropdown bear-mt-2 bear-bg-white dark:bear-bg-zinc-900 bear-rounded-xl bear-shadow-xl bear-border bear-border-zinc-200 dark:bear-border-zinc-700 bear-p-4 bear-w-80 bear-text-zinc-900 dark:bear-text-zinc-100",U=O?void 0:{zIndex:s.CALENDAR_DROPDOWN_Z_INDEX},ne=()=>{if(r.header)return r.header({month:T,year:b,onPrev:p,onNext:B,nav:V});const t=r.navPrevYear,a=r.navPrev,o=r.navNext,c=r.navNextYear,y=r.headerLabel||xe.DefaultHeaderLabel;return e.jsxs("div",{className:"Bear-Calendar__header bear-flex bear-items-center bear-justify-between bear-gap-1 bear-mb-4",children:[e.jsxs("div",{className:"Bear-Calendar__nav-left bear-flex bear-items-center bear-gap-0.5",children:[t?t({onClick:g}):e.jsx("button",{type:"button",onClick:g,className:"Bear-Calendar__nav-btn bear-p-1.5 bear-rounded bear-text-zinc-500 dark:bear-text-zinc-400 hover:bear-bg-zinc-100 dark:hover:bear-bg-zinc-800 bear-transition-colors","aria-label":"Previous year",children:e.jsx(v.ChevronsLeftIcon,{size:16})}),a?a({onClick:p}):e.jsx("button",{type:"button",onClick:p,className:"Bear-Calendar__nav-btn bear-p-1.5 bear-rounded bear-text-zinc-500 dark:bear-text-zinc-400 hover:bear-bg-zinc-100 dark:hover:bear-bg-zinc-800 bear-transition-colors","aria-label":"Previous month",children:e.jsx(v.ChevronLeftIcon,{size:16})})]}),y({month:T,year:b}),e.jsxs("div",{className:"Bear-Calendar__nav-right bear-flex bear-items-center bear-gap-0.5",children:[o?o({onClick:B}):e.jsx("button",{type:"button",onClick:B,className:"Bear-Calendar__nav-btn bear-p-1.5 bear-rounded bear-text-zinc-500 dark:bear-text-zinc-400 hover:bear-bg-zinc-100 dark:hover:bear-bg-zinc-800 bear-transition-colors","aria-label":"Next month",children:e.jsx(v.ChevronRightIcon,{size:16})}),c?c({onClick:z}):e.jsx("button",{type:"button",onClick:z,className:"Bear-Calendar__nav-btn bear-p-1.5 bear-rounded bear-text-zinc-500 dark:bear-text-zinc-400 hover:bear-bg-zinc-100 dark:hover:bear-bg-zinc-800 bear-transition-colors","aria-label":"Next year",children:e.jsx(v.ChevronsRightIcon,{size:16})})]})]})},oe=()=>{if(r.weekdays)return r.weekdays({days:q});const t=r.weekday;return e.jsx("div",{className:"Bear-Calendar__weekdays bear-grid bear-grid-cols-7 bear-gap-1 bear-mb-2",children:q.map(a=>t?e.jsx("div",{children:t({label:a})},a):e.jsx("div",{className:D.cn("Bear-Calendar__weekday bear-text-center bear-text-xs bear-font-medium bear-uppercase bear-text-zinc-500 dark:bear-text-zinc-400",s.WEEKEND_LABELS.includes(a)&&"bear-text-red-500"),children:a},a))})},se=(t,a)=>{const{date:o,isCurrentMonth:c}=t,y=o.getDate(),ce=o.getDay(),le=l.isWeekendDay(ce),x=l.isSameDay(E,o),j=l.isSameDay($,o),m=ee(o),H=re(o),F=()=>{m||C==null||C(o)},ue={date:o,day:y,isCurrentMonth:c,isSelected:x,isToday:j,isDisabled:m,isHighlighted:H,onClick:F};return r.day?e.jsx("span",{children:r.day(ue)},a):e.jsx("button",{type:"button",onClick:F,disabled:m,className:D.cn("Bear-Calendar__day bear-w-8 bear-h-8 bear-rounded-full bear-text-sm bear-font-medium bear-transition-colors bear-flex bear-items-center bear-justify-center",x&&"Bear-Calendar__day--selected bear-bg-pink-500 bear-text-white hover:bear-bg-pink-600",!x&&j&&"Bear-Calendar__day--today bear-ring-2 bear-ring-pink-500/50 bear-bg-transparent",!x&&!j&&(c?le?"Bear-Calendar__day--weekend bear-text-red-500 dark:bear-text-red-400 hover:bear-bg-zinc-100 dark:hover:bear-bg-zinc-800":"bear-text-zinc-700 dark:bear-text-zinc-300 hover:bear-bg-zinc-100 dark:hover:bear-bg-zinc-800":"Bear-Calendar__day--other bear-text-zinc-500 dark:bear-text-zinc-600 hover:bear-bg-zinc-50 dark:hover:bear-bg-zinc-800/50"),H&&!x&&"Bear-Calendar__day--highlighted bear-bg-pink-500/15",m&&"Bear-Calendar__day--disabled bear-opacity-40 bear-cursor-not-allowed"),children:y},a)},be=()=>{const t=ae.map((a,o)=>se(a,o));return r.daysGrid?r.daysGrid({children:t,className:"Bear-Calendar__grid bear-grid bear-grid-cols-7 bear-gap-1"}):e.jsx("div",{className:"Bear-Calendar__grid bear-grid bear-grid-cols-7 bear-gap-1",children:t})},de=()=>{const t=K&&f&&u,a=Z&&h;if(!t&&!a)return null;if(r.footer){const o=r.clearButton,c=r.todayButton;return r.footer({children:e.jsxs("div",{className:"Bear-Calendar__footer bear-flex bear-justify-between bear-gap-2 bear-mt-4 bear-pt-3 bear-border-t bear-border-zinc-200 dark:bear-border-zinc-700",children:[t&&o?o({onClick:u,hasSelection:f}):t?e.jsx("button",{type:"button",onClick:u,className:"Bear-Calendar__clear-btn bear-text-sm bear-text-zinc-500 dark:bear-text-zinc-400 hover:bear-text-zinc-700 dark:hover:bear-text-zinc-200 bear-transition-colors",children:"Clear"}):e.jsx("span",{}),a&&c?c({onClick:h}):a?e.jsx("button",{type:"button",onClick:h,className:"Bear-Calendar__today-btn bear-text-sm bear-text-pink-600 dark:bear-text-pink-400 hover:bear-text-pink-700 dark:hover:bear-text-pink-300 bear-font-medium",children:"Today"}):null]})})}return r.clearButton&&r.todayButton?e.jsxs("div",{className:"Bear-Calendar__footer bear-flex bear-justify-between bear-gap-2 bear-mt-4 bear-pt-3 bear-border-t bear-border-zinc-200 dark:bear-border-zinc-700",children:[t&&r.clearButton({onClick:u,hasSelection:f}),a&&r.todayButton({onClick:h})]}):e.jsxs("div",{className:"Bear-Calendar__footer bear-flex bear-justify-between bear-gap-2 bear-mt-4 bear-pt-3 bear-border-t bear-border-zinc-200 dark:bear-border-zinc-700",children:[t?e.jsx("button",{type:"button",onClick:u,className:"Bear-Calendar__clear-btn bear-text-sm bear-text-zinc-500 dark:bear-text-zinc-400 hover:bear-text-zinc-700 dark:hover:bear-text-zinc-200 bear-transition-colors",children:"Clear"}):e.jsx("span",{}),a?e.jsx("button",{type:"button",onClick:h,className:"Bear-Calendar__today-btn bear-text-sm bear-text-pink-400 hover:bear-text-pink-300 bear-font-medium bear-transition-colors",children:"Today"}):null]})},Y=e.jsxs(e.Fragment,{children:[ne(),oe(),be(),de()]}),I=D.cn(te,Q),A=Object.keys(P).length?P:void 0,ie=U?{...A,...U}:A;return r.root?r.root({children:Y,className:I}):e.jsx("div",{className:I,style:ie,children:Y})};exports.Calendar=ke;
|
|
@@ -3,11 +3,12 @@ import { useMemo as D, useCallback as l } from "react";
|
|
|
3
3
|
import { cn as E } from "../../utils/cn.js";
|
|
4
4
|
import { useBearStyles as ke } from "../../hooks/useBearStyles.js";
|
|
5
5
|
import "../../hooks/useBearComponent/useBearComponent.js";
|
|
6
|
+
import "../../context/BearProvider.js";
|
|
6
7
|
import { ChevronsLeftIcon as ye, ChevronLeftIcon as xe, ChevronRightIcon as ve, ChevronsRightIcon as pe } from "../Icon/index.js";
|
|
7
8
|
import { DEFAULT_WEEKDAYS as ze, NUMBER as i, CALENDAR_DROPDOWN_Z_INDEX as Ce, MONTHS as _e, WEEKEND_LABELS as ge } from "./Calendar.const.js";
|
|
8
9
|
import { isSameDay as v, buildCalendarGrid as Ne, reorderWeekdays as fe, isWeekendDay as Be } from "./Calendar.utils.js";
|
|
9
10
|
import { DefaultHeaderLabel as we } from "./Calendar.helpers.js";
|
|
10
|
-
const
|
|
11
|
+
const Re = (Z) => {
|
|
11
12
|
const {
|
|
12
13
|
viewDate: O,
|
|
13
14
|
value: P = null,
|
|
@@ -183,5 +184,5 @@ const Ie = (Z) => {
|
|
|
183
184
|
return e.root ? e.root({ children: H, className: F }) : /* @__PURE__ */ t("div", { className: F, style: se, children: H });
|
|
184
185
|
};
|
|
185
186
|
export {
|
|
186
|
-
|
|
187
|
+
Re as Calendar
|
|
187
188
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),c=require("../../utils/cn.cjs");require("react");const t={xs:{btn:"bear-w-5 bear-h-5",icon:10},sm:{btn:"bear-w-7 bear-h-7",icon:14},md:{btn:"bear-w-8 bear-h-8",icon:16},lg:{btn:"bear-w-10 bear-h-10",icon:18},xl:{btn:"bear-w-12 bear-h-12",icon:20}},d=({onClick:n,size:a="md",disabled:o=!1,"aria-label":i="Close",className:b,testId:s})=>{const{btn:l,icon:r}=t[a]??t.md;return e.jsx("button",{type:"button",onClick:n,disabled:o,"aria-label":i,"data-testid":s,className:c.cn("Bear-CloseButton","bear-inline-flex bear-items-center bear-justify-center bear-rounded-md","bear-text-gray-400 dark:bear-text-zinc-500","hover:bear-text-gray-600 dark:hover:bear-text-white","hover:bear-bg-gray-100 dark:hover:bear-bg-zinc-700","bear-transition-colors bear-cursor-pointer","disabled:bear-opacity-40 disabled:bear-cursor-not-allowed",l,b),children:e.jsxs("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})};exports.CloseButton=d;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { jsx as e, jsxs as c } from "react/jsx-runtime";
|
|
2
|
+
import { cn as d } from "../../utils/cn.js";
|
|
3
|
+
import "react";
|
|
4
|
+
const t = {
|
|
5
|
+
xs: { btn: "bear-w-5 bear-h-5", icon: 10 },
|
|
6
|
+
sm: { btn: "bear-w-7 bear-h-7", icon: 14 },
|
|
7
|
+
md: { btn: "bear-w-8 bear-h-8", icon: 16 },
|
|
8
|
+
lg: { btn: "bear-w-10 bear-h-10", icon: 18 },
|
|
9
|
+
xl: { btn: "bear-w-12 bear-h-12", icon: 20 }
|
|
10
|
+
}, u = ({
|
|
11
|
+
onClick: a,
|
|
12
|
+
size: o = "md",
|
|
13
|
+
disabled: n = !1,
|
|
14
|
+
"aria-label": b = "Close",
|
|
15
|
+
className: i,
|
|
16
|
+
testId: s
|
|
17
|
+
}) => {
|
|
18
|
+
const { btn: l, icon: r } = t[o] ?? t.md;
|
|
19
|
+
return /* @__PURE__ */ e(
|
|
20
|
+
"button",
|
|
21
|
+
{
|
|
22
|
+
type: "button",
|
|
23
|
+
onClick: a,
|
|
24
|
+
disabled: n,
|
|
25
|
+
"aria-label": b,
|
|
26
|
+
"data-testid": s,
|
|
27
|
+
className: d(
|
|
28
|
+
"Bear-CloseButton",
|
|
29
|
+
"bear-inline-flex bear-items-center bear-justify-center bear-rounded-md",
|
|
30
|
+
"bear-text-gray-400 dark:bear-text-zinc-500",
|
|
31
|
+
"hover:bear-text-gray-600 dark:hover:bear-text-white",
|
|
32
|
+
"hover:bear-bg-gray-100 dark:hover:bear-bg-zinc-700",
|
|
33
|
+
"bear-transition-colors bear-cursor-pointer",
|
|
34
|
+
"disabled:bear-opacity-40 disabled:bear-cursor-not-allowed",
|
|
35
|
+
l,
|
|
36
|
+
i
|
|
37
|
+
),
|
|
38
|
+
children: /* @__PURE__ */ c(
|
|
39
|
+
"svg",
|
|
40
|
+
{
|
|
41
|
+
width: r,
|
|
42
|
+
height: r,
|
|
43
|
+
viewBox: "0 0 24 24",
|
|
44
|
+
fill: "none",
|
|
45
|
+
stroke: "currentColor",
|
|
46
|
+
strokeWidth: "2",
|
|
47
|
+
strokeLinecap: "round",
|
|
48
|
+
strokeLinejoin: "round",
|
|
49
|
+
children: [
|
|
50
|
+
/* @__PURE__ */ e("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
|
|
51
|
+
/* @__PURE__ */ e("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
|
|
52
|
+
]
|
|
53
|
+
}
|
|
54
|
+
)
|
|
55
|
+
}
|
|
56
|
+
);
|
|
57
|
+
};
|
|
58
|
+
export {
|
|
59
|
+
u as CloseButton
|
|
60
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { BearSize } from '../../types';
|
|
2
|
+
export interface CloseButtonProps {
|
|
3
|
+
/** Click handler */
|
|
4
|
+
onClick?: () => void;
|
|
5
|
+
/** Button size */
|
|
6
|
+
size?: BearSize;
|
|
7
|
+
/** Disabled state */
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
/** Accessible label */
|
|
10
|
+
'aria-label'?: string;
|
|
11
|
+
/** Additional class name */
|
|
12
|
+
className?: string;
|
|
13
|
+
/** Test ID */
|
|
14
|
+
testId?: string;
|
|
15
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),a=require("react"),J=require("react-dom"),K=require("../Calendar/Calendar.cjs"),D=require("../../utils/cn.cjs"),Q=require("../../hooks/useBearStyles.cjs");require("../../hooks/useBearComponent/useBearComponent.cjs");const U=require("./DatePicker.utils.cjs"),X=({value:c,onChange:t,minDate:y,maxDate:j,disabled:b=!1,placeholder:z="Select date",label:p,error:
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),a=require("react"),J=require("react-dom"),K=require("../Calendar/Calendar.cjs"),D=require("../../utils/cn.cjs"),Q=require("../../hooks/useBearStyles.cjs");require("../../hooks/useBearComponent/useBearComponent.cjs");require("../../context/BearProvider.cjs");const U=require("./DatePicker.utils.cjs"),X=({value:c,onChange:t,minDate:y,maxDate:j,disabled:b=!1,placeholder:z="Select date",label:p,error:i,helperText:m,format:B="MM/DD/YYYY",clearable:P=!0,className:_,style:h,bis:v,showWeekNumbers:S=!1,disabledDates:q=[],highlightedDates:N=[],slots:g,weekdayLabels:R,firstDayOfWeek:V=0,size:H="md",variant:M="default",icon:O})=>{const[o,n]=a.useState(!1),[E,L]=a.useState(c??new Date),[x,Y]=a.useState({top:0,left:0}),k=a.useRef(null),d=a.useRef(null),w=Q.useBearStyles(v,h);a.useEffect(()=>{if(o&&d.current){const e=d.current.getBoundingClientRect(),l=8,s=360,G=window.innerHeight-e.bottom<s&&e.top>s;Y({top:G?e.top-s-l:e.bottom+l,left:e.left})}},[o]),a.useEffect(()=>{const e=l=>{var u,f;const s=l.target;(u=k.current)!=null&&u.contains(s)||(f=s.closest)!=null&&f.call(s,"[data-bear-datepicker-calendar]")||n(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);const T=a.useCallback(e=>{t==null||t(e),n(!1)},[t]),A=a.useCallback(()=>{t==null||t(null),n(!1)},[t]),I=a.useCallback(e=>{L(e)},[]),W={sm:"bear-py-1.5 bear-px-3 bear-text-sm",md:"bear-py-2 bear-px-4",lg:"bear-py-2.5 bear-px-5 bear-text-lg"},F={default:"bear-bg-white dark:bear-bg-zinc-800 bear-border-zinc-300 dark:bear-border-zinc-600",filled:"bear-bg-zinc-100 dark:bear-bg-zinc-700 bear-border-transparent",outline:"bear-bg-transparent bear-border-zinc-400 dark:bear-border-zinc-500"};return r.jsxs("div",{ref:k,className:D.cn("Bear-DatePicker bear-relative",_),style:Object.keys(w).length?w:void 0,children:[p&&r.jsx("label",{className:"Bear-DatePicker__label bear-block bear-text-sm bear-font-medium bear-text-zinc-700 dark:bear-text-zinc-300 bear-mb-1.5",children:p}),r.jsxs("button",{ref:d,type:"button",onClick:()=>!b&&n(!o),disabled:b,className:D.cn("Bear-DatePicker__trigger bear-w-full bear-flex bear-items-center bear-justify-between bear-rounded-lg bear-border bear-text-left bear-transition-colors",W[H],F[M],i?"bear-border-red-500":"focus:bear-border-pink-500",b&&"bear-opacity-50 bear-cursor-not-allowed",c?"bear-text-zinc-900 dark:bear-text-white":"bear-text-zinc-500"),children:[r.jsx("span",{className:"Bear-DatePicker__value",children:c?U.formatDate(c,B):z}),r.jsx("span",{className:"Bear-DatePicker__icon",children:O??r.jsx("svg",{className:"bear-w-5 bear-h-5 bear-text-zinc-400 bear-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"})})})]}),i&&r.jsx("p",{className:"Bear-DatePicker__error bear-mt-1 bear-text-xs bear-text-red-400",children:i}),m&&!i&&r.jsx("p",{className:"Bear-DatePicker__helper bear-mt-1 bear-text-xs bear-text-zinc-500",children:m}),o&&typeof document<"u"&&J.createPortal(r.jsx("div",{"data-bear-datepicker-calendar":!0,className:"Bear-DatePicker__dropdown bear-fixed bear-z-[9999]",style:{top:x.top,left:x.left},children:r.jsx(K.Calendar,{viewDate:E,onViewChange:I,value:c??null,onSelect:T,minDate:y,maxDate:j,disabledDates:q,highlightedDates:N,slots:g,weekdayLabels:R,firstDayOfWeek:V,showWeekNumbers:S,clearable:P,onClear:A,showTodayButton:!0,onToday:()=>{t==null||t(new Date),n(!1)}})}),document.body)]})};exports.DatePicker=X;
|
|
@@ -5,8 +5,9 @@ import { Calendar as Z } from "../Calendar/Calendar.js";
|
|
|
5
5
|
import { cn as B } from "../../utils/cn.js";
|
|
6
6
|
import { useBearStyles as $ } from "../../hooks/useBearStyles.js";
|
|
7
7
|
import "../../hooks/useBearComponent/useBearComponent.js";
|
|
8
|
+
import "../../context/BearProvider.js";
|
|
8
9
|
import { formatDate as C } from "./DatePicker.utils.js";
|
|
9
|
-
const
|
|
10
|
+
const le = ({
|
|
10
11
|
value: o,
|
|
11
12
|
onChange: t,
|
|
12
13
|
minDate: _,
|
|
@@ -31,19 +32,19 @@ const ie = ({
|
|
|
31
32
|
variant: A = "default",
|
|
32
33
|
icon: I
|
|
33
34
|
}) => {
|
|
34
|
-
const [
|
|
35
|
+
const [i, s] = p(!1), [T, W] = p(o ?? /* @__PURE__ */ new Date()), [w, q] = p({ top: 0, left: 0 }), x = y(null), b = y(null), D = $(j, V);
|
|
35
36
|
h(() => {
|
|
36
|
-
if (
|
|
37
|
-
const e = b.current.getBoundingClientRect(),
|
|
37
|
+
if (i && b.current) {
|
|
38
|
+
const e = b.current.getBoundingClientRect(), c = 8, a = 360, U = window.innerHeight - e.bottom < a && e.top > a;
|
|
38
39
|
q({
|
|
39
|
-
top: U ? e.top - a -
|
|
40
|
+
top: U ? e.top - a - c : e.bottom + c,
|
|
40
41
|
left: e.left
|
|
41
42
|
});
|
|
42
43
|
}
|
|
43
|
-
}, [
|
|
44
|
-
const e = (
|
|
44
|
+
}, [i]), h(() => {
|
|
45
|
+
const e = (c) => {
|
|
45
46
|
var d, m;
|
|
46
|
-
const a =
|
|
47
|
+
const a = c.target;
|
|
47
48
|
(d = x.current) != null && d.contains(a) || (m = a.closest) != null && m.call(a, "[data-bear-datepicker-calendar]") || s(!1);
|
|
48
49
|
};
|
|
49
50
|
return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
|
|
@@ -69,7 +70,7 @@ const ie = ({
|
|
|
69
70
|
{
|
|
70
71
|
ref: b,
|
|
71
72
|
type: "button",
|
|
72
|
-
onClick: () => !l && s(!
|
|
73
|
+
onClick: () => !l && s(!i),
|
|
73
74
|
disabled: l,
|
|
74
75
|
className: B(
|
|
75
76
|
"Bear-DatePicker__trigger bear-w-full bear-flex bear-items-center bear-justify-between bear-rounded-lg bear-border bear-text-left bear-transition-colors",
|
|
@@ -87,7 +88,7 @@ const ie = ({
|
|
|
87
88
|
),
|
|
88
89
|
n && /* @__PURE__ */ r("p", { className: "Bear-DatePicker__error bear-mt-1 bear-text-xs bear-text-red-400", children: n }),
|
|
89
90
|
k && !n && /* @__PURE__ */ r("p", { className: "Bear-DatePicker__helper bear-mt-1 bear-text-xs bear-text-zinc-500", children: k }),
|
|
90
|
-
|
|
91
|
+
i && typeof document < "u" && X(
|
|
91
92
|
/* @__PURE__ */ r(
|
|
92
93
|
"div",
|
|
93
94
|
{
|
|
@@ -124,5 +125,5 @@ const ie = ({
|
|
|
124
125
|
] });
|
|
125
126
|
};
|
|
126
127
|
export {
|
|
127
|
-
|
|
128
|
+
le as DatePicker
|
|
128
129
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),c=require("../Icon.cjs"),x=s=>n.jsxs(c.Icon,{...s,children:[n.jsx("circle",{cx:"9",cy:"21",r:"1"}),n.jsx("circle",{cx:"20",cy:"21",r:"1"}),n.jsx("path",{d:"M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6"})]}),o=s=>n.jsxs(c.Icon,{...s,children:[n.jsx("path",{d:"M6 2L3 6v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6l-3-4z"}),n.jsx("line",{x1:"3",y1:"6",x2:"21",y2:"6"}),n.jsx("path",{d:"M16 10a4 4 0 0 1-8 0"})]}),t=s=>n.jsxs(c.Icon,{...s,children:[n.jsx("rect",{x:"1",y:"4",width:"22",height:"16",rx:"2",ry:"2"}),n.jsx("line",{x1:"1",y1:"10",x2:"23",y2:"10"})]}),h=s=>n.jsxs(c.Icon,{...s,children:[n.jsx("line",{x1:"12",y1:"1",x2:"12",y2:"23"}),n.jsx("path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6"})]}),j=s=>n.jsxs(c.Icon,{...s,children:[n.jsx("path",{d:"M4 10h12"}),n.jsx("path",{d:"M4 14h12"}),n.jsx("path",{d:"M19 6a7.7 7.7 0 0 0-5.2-2A7.9 7.9 0 0 0 6 12a7.9 7.9 0 0 0 7.8 8 7.7 7.7 0 0 0 5.2-2"})]}),a=s=>n.jsxs(c.Icon,{...s,children:[n.jsx("path",{d:"M4 18h12"}),n.jsx("path",{d:"M4 14h8"}),n.jsx("path",{d:"M17 4a4 4 0 0 0-7.4 2.1L8 18"})]}),e=s=>n.jsxs(c.Icon,{...s,children:[n.jsx("rect",{x:"2",y:"6",width:"20",height:"14",rx:"2"}),n.jsx("path",{d:"M2 10h20"}),n.jsx("path",{d:"M16 14h2"})]}),i=s=>n.jsxs(c.Icon,{...s,children:[n.jsx("path",{d:"M4 2v20l2-1 2 1 2-1 2 1 2-1 2 1 2-1 2 1V2l-2 1-2-1-2 1-2-1-2 1-2-1-2 1-2-1z"}),n.jsx("line",{x1:"8",y1:"8",x2:"16",y2:"8"}),n.jsx("line",{x1:"8",y1:"12",x2:"16",y2:"12"}),n.jsx("line",{x1:"8",y1:"16",x2:"12",y2:"16"})]}),l=s=>n.jsxs(c.Icon,{...s,children:[n.jsx("path",{d:"M20.59 13.41l-7.17 7.17a2 2 0 0 1-2.83 0L2 12V2h10l8.59 8.59a2 2 0 0 1 0 2.82z"}),n.jsx("line",{x1:"7",y1:"7",x2:"7.01",y2:"7"})]}),d=s=>n.jsxs(c.Icon,{...s,children:[n.jsx("path",{d:"M20.59 13.41l-7.17 7.17a2 2 0 0 1-2.83 0L2 12V2h10l8.59 8.59a2 2 0 0 1 0 2.82z"}),n.jsx("line",{x1:"7",y1:"7",x2:"7.01",y2:"7"}),n.jsx("path",{d:"M22 7l-8.97 8.97"})]}),r=s=>n.jsxs(c.Icon,{...s,children:[n.jsx("line",{x1:"19",y1:"5",x2:"5",y2:"19"}),n.jsx("circle",{cx:"6.5",cy:"6.5",r:"2.5"}),n.jsx("circle",{cx:"17.5",cy:"17.5",r:"2.5"})]}),p=s=>n.jsxs(c.Icon,{...s,children:[n.jsx("polyline",{points:"23 6 13.5 15.5 8.5 10.5 1 18"}),n.jsx("polyline",{points:"17 6 23 6 23 12"})]}),I=s=>n.jsxs(c.Icon,{...s,children:[n.jsx("polyline",{points:"23 18 13.5 8.5 8.5 13.5 1 6"}),n.jsx("polyline",{points:"17 18 23 18 23 12"})]}),y=s=>n.jsxs(c.Icon,{...s,children:[n.jsx("path",{d:"M3 5v14"}),n.jsx("path",{d:"M8 5v14"}),n.jsx("path",{d:"M12 5v14"}),n.jsx("path",{d:"M17 5v14"}),n.jsx("path",{d:"M21 5v14"}),n.jsx("path",{d:"M6 5v14"}),n.jsx("path",{d:"M14 5v14"}),n.jsx("path",{d:"M10 5v14"}),n.jsx("path",{d:"M19 5v14"})]}),M=s=>n.jsxs(c.Icon,{...s,children:[n.jsx("polyline",{points:"20 12 20 22 4 22 4 12"}),n.jsx("rect",{x:"2",y:"7",width:"20",height:"5"}),n.jsx("line",{x1:"12",y1:"22",x2:"12",y2:"7"}),n.jsx("path",{d:"M12 7H7.5a2.5 2.5 0 0 1 0-5C11 2 12 7 12 7z"}),n.jsx("path",{d:"M12 7h4.5a2.5 2.5 0 0 0 0-5C13 2 12 7 12 7z"})]}),v=s=>n.jsxs(c.Icon,{...s,children:[n.jsx("path",{d:"M3 9l1-4h16l1 4"}),n.jsx("path",{d:"M3 9v10a1 1 0 0 0 1 1h16a1 1 0 0 0 1-1V9"}),n.jsx("path",{d:"M9 21V12h6v9"}),n.jsx("path",{d:"M3 9a3 3 0 0 0 3 3 3 3 0 0 0 3-3"}),n.jsx("path",{d:"M9 9a3 3 0 0 0 3 3 3 3 0 0 0 3-3"}),n.jsx("path",{d:"M15 9a3 3 0 0 0 3 3 3 3 0 0 0 3-3"})]}),g=s=>n.jsxs(c.Icon,{...s,children:[n.jsx("rect",{x:"1",y:"3",width:"15",height:"13"}),n.jsx("polygon",{points:"16 8 20 8 23 11 23 16 16 16 16 8"}),n.jsx("circle",{cx:"5.5",cy:"18.5",r:"2.5"}),n.jsx("circle",{cx:"18.5",cy:"18.5",r:"2.5"})]}),u=s=>n.jsxs(c.Icon,{...s,children:[n.jsx("line",{x1:"16.5",y1:"9.4",x2:"7.5",y2:"4.21"}),n.jsx("path",{d:"M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"}),n.jsx("polyline",{points:"3.27 6.96 12 12.01 20.73 6.96"}),n.jsx("line",{x1:"12",y1:"22.08",x2:"12",y2:"12"})]}),T=s=>n.jsxs(c.Icon,{...s,children:[n.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),n.jsx("polyline",{points:"14 2 14 8 20 8"}),n.jsx("line",{x1:"8",y1:"13",x2:"16",y2:"13"}),n.jsx("line",{x1:"8",y1:"17",x2:"12",y2:"17"}),n.jsx("line",{x1:"14",y1:"17",x2:"16",y2:"17"})]}),C=s=>n.jsxs(c.Icon,{...s,children:[n.jsx("rect",{x:"2",y:"7",width:"20",height:"14",rx:"2",ry:"2"}),n.jsx("path",{d:"M16 21V5a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16"})]}),S=s=>n.jsxs(c.Icon,{...s,children:[n.jsx("path",{d:"M3 22h18"}),n.jsx("path",{d:"M6 18v-4"}),n.jsx("path",{d:"M10 18v-4"}),n.jsx("path",{d:"M14 18v-4"}),n.jsx("path",{d:"M18 18v-4"}),n.jsx("path",{d:"M3 10l9-7 9 7"}),n.jsx("path",{d:"M3 10h18v4H3z"})]});exports.BankIcon=S;exports.BarCodeIcon=y;exports.BriefcaseIcon=C;exports.CreditCardIcon=t;exports.DollarSignIcon=h;exports.EuroIcon=j;exports.GiftIcon=M;exports.InvoiceIcon=T;exports.PackageIcon=u;exports.PercentIcon=r;exports.PoundIcon=a;exports.ReceiptIcon=i;exports.ShoppingBagIcon=o;exports.ShoppingCartIcon=x;exports.StoreIcon=v;exports.TagIcon=l;exports.TagsIcon=d;exports.TrendDownIcon=I;exports.TrendUpIcon=p;exports.TruckIcon=g;exports.WalletIcon=e;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { IconProps } from '../Icon.types';
|
|
3
|
+
type IconComponent = FC<Omit<IconProps, 'children'>>;
|
|
4
|
+
export declare const ShoppingCartIcon: IconComponent;
|
|
5
|
+
export declare const ShoppingBagIcon: IconComponent;
|
|
6
|
+
export declare const CreditCardIcon: IconComponent;
|
|
7
|
+
export declare const DollarSignIcon: IconComponent;
|
|
8
|
+
export declare const EuroIcon: IconComponent;
|
|
9
|
+
export declare const PoundIcon: IconComponent;
|
|
10
|
+
export declare const WalletIcon: IconComponent;
|
|
11
|
+
export declare const ReceiptIcon: IconComponent;
|
|
12
|
+
export declare const TagIcon: IconComponent;
|
|
13
|
+
export declare const TagsIcon: IconComponent;
|
|
14
|
+
export declare const PercentIcon: IconComponent;
|
|
15
|
+
export declare const TrendUpIcon: IconComponent;
|
|
16
|
+
export declare const TrendDownIcon: IconComponent;
|
|
17
|
+
export declare const BarCodeIcon: IconComponent;
|
|
18
|
+
export declare const GiftIcon: IconComponent;
|
|
19
|
+
export declare const StoreIcon: IconComponent;
|
|
20
|
+
export declare const TruckIcon: IconComponent;
|
|
21
|
+
export declare const PackageIcon: IconComponent;
|
|
22
|
+
export declare const InvoiceIcon: IconComponent;
|
|
23
|
+
export declare const BriefcaseIcon: IconComponent;
|
|
24
|
+
export declare const BankIcon: IconComponent;
|
|
25
|
+
export {};
|