@forgedevstack/bear 1.0.0 → 1.0.2
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/Alert/Alert.cjs +1 -1
- package/dist/components/Alert/Alert.js +38 -38
- package/dist/components/AppBar/AppBar.cjs +1 -1
- package/dist/components/AppBar/AppBar.js +15 -15
- package/dist/components/Badge/Badge.cjs +1 -1
- package/dist/components/Badge/Badge.constants.cjs +1 -0
- package/dist/components/Badge/Badge.constants.d.ts +6 -0
- package/dist/components/Badge/Badge.constants.js +34 -0
- package/dist/components/Badge/Badge.js +27 -52
- package/dist/components/Button/Button.cjs +1 -57
- package/dist/components/Button/Button.constants.cjs +57 -0
- package/dist/components/Button/Button.constants.d.ts +3 -0
- package/dist/components/Button/Button.constants.js +77 -0
- package/dist/components/Button/Button.js +55 -119
- package/dist/components/Button/Button.types.d.ts +6 -1
- package/dist/components/ButtonGroup/ButtonGroup.cjs +1 -1
- package/dist/components/ButtonGroup/ButtonGroup.js +17 -17
- package/dist/components/Calendar/Calendar.cjs +1 -0
- package/dist/components/Calendar/Calendar.d.ts +3 -0
- package/dist/components/Calendar/Calendar.js +203 -0
- package/dist/components/Calendar/Calendar.types.d.ts +124 -0
- package/dist/components/Calendar/index.d.ts +2 -0
- package/dist/components/Card/Card.cjs +1 -1
- package/dist/components/Card/Card.js +65 -65
- package/dist/components/Checkbox/Checkbox.cjs +1 -1
- package/dist/components/Checkbox/Checkbox.js +48 -48
- package/dist/components/Container/Container.cjs +1 -1
- package/dist/components/Container/Container.js +15 -15
- package/dist/components/DatePicker/DatePicker.cjs +1 -1
- package/dist/components/DatePicker/DatePicker.js +77 -85
- package/dist/components/DatePicker/DatePicker.types.d.ts +9 -0
- package/dist/components/DatePicker/DatePicker.utils.cjs +1 -0
- package/dist/components/DatePicker/DatePicker.utils.d.ts +1 -0
- package/dist/components/DatePicker/DatePicker.utils.js +9 -0
- package/dist/components/DateTimePicker/DateTimePicker.cjs +1 -0
- package/dist/components/DateTimePicker/DateTimePicker.d.ts +3 -0
- package/dist/components/DateTimePicker/DateTimePicker.js +178 -0
- package/dist/components/DateTimePicker/DateTimePicker.types.d.ts +26 -0
- package/dist/components/DateTimePicker/DateTimePicker.utils.cjs +1 -0
- package/dist/components/DateTimePicker/DateTimePicker.utils.d.ts +2 -0
- package/dist/components/DateTimePicker/DateTimePicker.utils.js +16 -0
- package/dist/components/DateTimePicker/index.d.ts +2 -0
- package/dist/components/Divider/Divider.cjs +1 -1
- package/dist/components/Divider/Divider.js +29 -29
- package/dist/components/Dropdown/Dropdown.cjs +1 -1
- package/dist/components/Dropdown/Dropdown.js +70 -70
- package/dist/components/Fab/Fab.cjs +1 -1
- package/dist/components/Fab/Fab.js +42 -42
- package/dist/components/FileUpload/FileUpload.cjs +1 -1
- package/dist/components/FileUpload/FileUpload.js +46 -49
- package/dist/components/FileUpload/FileUpload.utils.cjs +1 -0
- package/dist/components/FileUpload/FileUpload.utils.d.ts +1 -0
- package/dist/components/FileUpload/FileUpload.utils.js +9 -0
- package/dist/components/Flex/Flex.cjs +1 -1
- package/dist/components/Flex/Flex.js +58 -58
- package/dist/components/Grid/Grid.cjs +1 -1
- package/dist/components/Grid/Grid.js +60 -60
- package/dist/components/Link/Link.cjs +1 -1
- package/dist/components/Link/Link.js +47 -47
- package/dist/components/List/List.cjs +1 -1
- package/dist/components/List/List.js +117 -117
- package/dist/components/Menu/Menu.cjs +1 -1
- package/dist/components/Menu/Menu.js +58 -58
- package/dist/components/Paper/Paper.cjs +1 -1
- package/dist/components/Paper/Paper.js +36 -36
- package/dist/components/Radio/Radio.cjs +1 -1
- package/dist/components/Radio/Radio.js +79 -79
- package/dist/components/Rating/Rating.cjs +1 -1
- package/dist/components/Rating/Rating.js +37 -37
- package/dist/components/SpeedDial/SpeedDial.cjs +1 -1
- package/dist/components/SpeedDial/SpeedDial.js +40 -40
- package/dist/components/Spinner/Spinner.cjs +1 -1
- package/dist/components/Spinner/Spinner.js +24 -24
- package/dist/components/TimePicker/TimePicker.cjs +1 -1
- package/dist/components/TimePicker/TimePicker.constants.cjs +1 -0
- package/dist/components/TimePicker/TimePicker.constants.d.ts +5 -0
- package/dist/components/TimePicker/TimePicker.constants.js +16 -0
- package/dist/components/TimePicker/TimePicker.js +91 -70
- package/dist/components/TimePicker/TimePicker.types.d.ts +5 -2
- package/dist/components/TimePicker/TimePicker.utils.cjs +1 -0
- package/dist/components/TimePicker/TimePicker.utils.d.ts +1 -0
- package/dist/components/TimePicker/TimePicker.utils.js +7 -0
- package/dist/components/TransferList/TransferList.cjs +1 -1
- package/dist/components/TransferList/TransferList.js +74 -74
- package/dist/components/Typography/Typography.cjs +1 -1
- package/dist/components/Typography/Typography.js +52 -52
- package/dist/components/index.cjs +1 -1
- package/dist/components/index.d.ts +4 -0
- package/dist/components/index.js +67 -63
- package/dist/context/BearProvider.cjs +1 -1
- package/dist/context/BearProvider.d.ts +6 -1
- package/dist/context/BearProvider.js +42 -38
- package/dist/context/index.cjs +1 -1
- package/dist/context/index.d.ts +1 -1
- package/dist/context/index.js +6 -5
- package/dist/hooks/bearStyled.cjs +1 -0
- package/dist/hooks/bearStyled.d.ts +17 -0
- package/dist/hooks/bearStyled.js +17 -0
- package/dist/hooks/index.cjs +1 -1
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/index.js +14 -10
- package/dist/hooks/useBearStyles.cjs +1 -0
- package/dist/hooks/useBearStyles.d.ts +11 -0
- package/dist/hooks/useBearStyles.js +14 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +99 -90
- package/dist/styles.css +1 -0
- package/dist/types/bis.types.d.ts +9 -0
- package/dist/types/component.types.d.ts +3 -0
- package/dist/types/index.d.ts +1 -0
- package/package.json +2 -2
|
@@ -1,111 +1,111 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { cn as
|
|
1
|
+
import { jsx as b, jsxs as i } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as o } from "react";
|
|
3
|
+
import { cn as t } from "../../utils/cn.js";
|
|
4
4
|
const h = {
|
|
5
5
|
none: "",
|
|
6
|
-
xs: "
|
|
7
|
-
sm: "
|
|
8
|
-
md: "
|
|
9
|
-
lg: "
|
|
10
|
-
xl: "
|
|
6
|
+
xs: "bear-p-2",
|
|
7
|
+
sm: "bear-p-3",
|
|
8
|
+
md: "bear-p-4",
|
|
9
|
+
lg: "bear-p-6",
|
|
10
|
+
xl: "bear-p-8"
|
|
11
11
|
}, u = {
|
|
12
12
|
none: "",
|
|
13
|
-
sm: "
|
|
14
|
-
md: "
|
|
15
|
-
lg: "
|
|
16
|
-
xl: "
|
|
17
|
-
"2xl": "
|
|
13
|
+
sm: "bear-rounded-sm",
|
|
14
|
+
md: "bear-rounded-md",
|
|
15
|
+
lg: "bear-rounded-lg",
|
|
16
|
+
xl: "bear-rounded-xl",
|
|
17
|
+
"2xl": "bear-rounded-2xl"
|
|
18
18
|
}, C = {
|
|
19
|
-
elevated: "
|
|
20
|
-
outlined: "
|
|
21
|
-
filled: "
|
|
22
|
-
ghost: "
|
|
23
|
-
},
|
|
19
|
+
elevated: "bear-bg-white dark:bear-bg-gray-900 bear-shadow-md",
|
|
20
|
+
outlined: "bear-bg-white dark:bear-bg-gray-900 bear-border bear-border-gray-200 dark:bear-border-gray-700",
|
|
21
|
+
filled: "bear-bg-gray-100 dark:bear-bg-gray-800",
|
|
22
|
+
ghost: "bear-bg-transparent"
|
|
23
|
+
}, m = o(
|
|
24
24
|
({
|
|
25
|
-
variant:
|
|
26
|
-
padding:
|
|
27
|
-
interactive:
|
|
28
|
-
radius:
|
|
29
|
-
className:
|
|
30
|
-
children:
|
|
31
|
-
testId:
|
|
25
|
+
variant: r = "elevated",
|
|
26
|
+
padding: e = "none",
|
|
27
|
+
interactive: a = !1,
|
|
28
|
+
radius: d = "lg",
|
|
29
|
+
className: s,
|
|
30
|
+
children: n,
|
|
31
|
+
testId: l,
|
|
32
32
|
...y
|
|
33
|
-
}, x) => /* @__PURE__ */
|
|
33
|
+
}, x) => /* @__PURE__ */ b(
|
|
34
34
|
"div",
|
|
35
35
|
{
|
|
36
36
|
ref: x,
|
|
37
|
-
className:
|
|
38
|
-
"
|
|
39
|
-
C[
|
|
40
|
-
h[
|
|
41
|
-
u[
|
|
42
|
-
|
|
43
|
-
|
|
37
|
+
className: t(
|
|
38
|
+
"bear-overflow-hidden",
|
|
39
|
+
C[r],
|
|
40
|
+
h[e],
|
|
41
|
+
u[d],
|
|
42
|
+
a && "bear-transition-all bear-duration-200 bear-cursor-pointer hover:bear-shadow-lg hover:bear-scale-[1.02]",
|
|
43
|
+
s
|
|
44
44
|
),
|
|
45
|
-
"data-testid":
|
|
45
|
+
"data-testid": l,
|
|
46
46
|
...y,
|
|
47
|
-
children:
|
|
47
|
+
children: n
|
|
48
48
|
}
|
|
49
49
|
)
|
|
50
50
|
);
|
|
51
|
-
|
|
52
|
-
const g =
|
|
53
|
-
({ title:
|
|
51
|
+
m.displayName = "Card";
|
|
52
|
+
const g = o(
|
|
53
|
+
({ title: r, subtitle: e, action: a, className: d, children: s, ...n }, l) => /* @__PURE__ */ i(
|
|
54
54
|
"div",
|
|
55
55
|
{
|
|
56
|
-
ref:
|
|
57
|
-
className:
|
|
58
|
-
"
|
|
59
|
-
|
|
56
|
+
ref: l,
|
|
57
|
+
className: t(
|
|
58
|
+
"bear-flex bear-items-start bear-justify-between bear-p-4 bear-border-b bear-border-gray-200 dark:bear-border-gray-700",
|
|
59
|
+
d
|
|
60
60
|
),
|
|
61
|
-
...
|
|
61
|
+
...n,
|
|
62
62
|
children: [
|
|
63
|
-
/* @__PURE__ */
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
63
|
+
/* @__PURE__ */ i("div", { className: "bear-flex-1 bear-min-w-0", children: [
|
|
64
|
+
r && /* @__PURE__ */ b("h3", { className: "bear-text-lg bear-font-semibold bear-text-gray-900 dark:bear-text-white bear-truncate", children: r }),
|
|
65
|
+
e && /* @__PURE__ */ b("p", { className: "bear-text-sm bear-text-gray-500 dark:bear-text-gray-400 bear-mt-1", children: e }),
|
|
66
|
+
s
|
|
67
67
|
] }),
|
|
68
|
-
|
|
68
|
+
a && /* @__PURE__ */ b("div", { className: "bear-ml-4 bear-shrink-0", children: a })
|
|
69
69
|
]
|
|
70
70
|
}
|
|
71
71
|
)
|
|
72
72
|
);
|
|
73
73
|
g.displayName = "CardHeader";
|
|
74
|
-
const c =
|
|
75
|
-
({ className:
|
|
74
|
+
const c = o(
|
|
75
|
+
({ className: r, children: e, ...a }, d) => /* @__PURE__ */ b(
|
|
76
76
|
"div",
|
|
77
77
|
{
|
|
78
|
-
ref:
|
|
79
|
-
className:
|
|
80
|
-
...
|
|
81
|
-
children:
|
|
78
|
+
ref: d,
|
|
79
|
+
className: t("bear-p-4", r),
|
|
80
|
+
...a,
|
|
81
|
+
children: e
|
|
82
82
|
}
|
|
83
83
|
)
|
|
84
84
|
);
|
|
85
85
|
c.displayName = "CardBody";
|
|
86
|
-
const p =
|
|
87
|
-
({ divider:
|
|
86
|
+
const p = o(
|
|
87
|
+
({ divider: r = !0, className: e, children: a, ...d }, s) => /* @__PURE__ */ b(
|
|
88
88
|
"div",
|
|
89
89
|
{
|
|
90
|
-
ref:
|
|
91
|
-
className:
|
|
92
|
-
"
|
|
93
|
-
|
|
94
|
-
|
|
90
|
+
ref: s,
|
|
91
|
+
className: t(
|
|
92
|
+
"bear-p-4",
|
|
93
|
+
r && "bear-border-t bear-border-gray-200 dark:bear-border-gray-700",
|
|
94
|
+
e
|
|
95
95
|
),
|
|
96
|
-
...
|
|
97
|
-
children:
|
|
96
|
+
...d,
|
|
97
|
+
children: a
|
|
98
98
|
}
|
|
99
99
|
)
|
|
100
100
|
);
|
|
101
101
|
p.displayName = "CardFooter";
|
|
102
|
-
const k = Object.assign(
|
|
102
|
+
const k = Object.assign(m, {
|
|
103
103
|
Header: g,
|
|
104
104
|
Body: c,
|
|
105
105
|
Footer: p
|
|
106
106
|
});
|
|
107
107
|
export {
|
|
108
|
-
|
|
108
|
+
m as Card,
|
|
109
109
|
c as CardBody,
|
|
110
110
|
k as CardCompound,
|
|
111
111
|
p as CardFooter,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),c=require("react"),t=require("../../utils/cn.cjs"),I={xs:"bear-w-3.5 bear-h-3.5",sm:"bear-w-4 bear-h-4",md:"bear-w-5 bear-h-5",lg:"bear-w-6 bear-h-6",xl:"bear-w-7 bear-h-7"},L={xs:10,sm:12,md:14,lg:18,xl:22},E={xs:"bear-text-xs",sm:"bear-text-sm",md:"bear-text-base",lg:"bear-text-lg",xl:"bear-text-xl"},R={primary:"#ec4899",secondary:"#6b7280",success:"#22c55e",danger:"#ef4444",warning:"#f59e0b",info:"#3b82f6",ghost:"#9ca3af",outline:"#374151",error:"#ef4444"},f=c.forwardRef(({label:i,size:b="md",variant:m="primary",color:y,checked:x,defaultChecked:d,indeterminate:a=!1,disabled:l=!1,error:s=!1,helperText:h,className:g,testId:j,onChange:p,...k},w)=>{const S=c.useRef(null),r=w||S,v=c.useId(),u=y??R[m],n=L[b];c.useEffect(()=>{typeof r=="object"&&(r!=null&&r.current)&&(r.current.indeterminate=a)},[a,r]);const C=()=>e.jsx("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:"white",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("polyline",{points:"20 6 9 17 4 12"})}),N=()=>e.jsx("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:"white",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"})}),o=x??d;return e.jsxs("div",{className:t.cn("bear-flex bear-flex-col",g),children:[e.jsxs("label",{className:t.cn("bear-inline-flex bear-items-center bear-gap-2 bear-cursor-pointer",l&&"bear-opacity-50 bear-cursor-not-allowed"),children:[e.jsxs("div",{className:"bear-relative bear-flex bear-items-center bear-justify-center",children:[e.jsx("input",{ref:r,type:"checkbox",checked:x,defaultChecked:d,disabled:l,onChange:p,className:"bear-sr-only",id:v,"data-testid":j,...k}),e.jsx("div",{className:t.cn(I[b],"bear-rounded bear-border-2 bear-transition-all bear-flex bear-items-center bear-justify-center",s?"bear-border-red-500":"bear-border-gray-300 dark:bear-border-gray-600",(o||a)&&!s&&"bear-border-transparent",!l&&"hover:bear-border-gray-400"),style:{backgroundColor:o||a?s?"#ef4444":u:"transparent",borderColor:(o||a)&&!s?u:void 0},children:a?e.jsx(N,{}):o?e.jsx(C,{}):null})]}),i&&e.jsx("span",{className:t.cn(E[b],"bear-text-gray-700 dark:bear-text-gray-300",s&&"bear-text-red-500"),children:i})]}),h&&e.jsx("span",{className:t.cn("bear-text-xs bear-mt-1 bear-ml-7",s?"bear-text-red-500":"bear-text-gray-500"),children:h})]})});f.displayName="Checkbox";exports.Checkbox=f;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsxs as l, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as I, useRef as L, useId as j, useEffect as E } from "react";
|
|
3
|
-
import { cn as
|
|
3
|
+
import { cn as o } from "../../utils/cn.js";
|
|
4
4
|
const A = {
|
|
5
|
-
xs: "
|
|
6
|
-
sm: "
|
|
7
|
-
md: "
|
|
8
|
-
lg: "
|
|
9
|
-
xl: "
|
|
5
|
+
xs: "bear-w-3.5 bear-h-3.5",
|
|
6
|
+
sm: "bear-w-4 bear-h-4",
|
|
7
|
+
md: "bear-w-5 bear-h-5",
|
|
8
|
+
lg: "bear-w-6 bear-h-6",
|
|
9
|
+
xl: "bear-w-7 bear-h-7"
|
|
10
10
|
}, R = {
|
|
11
11
|
xs: 10,
|
|
12
12
|
sm: 12,
|
|
@@ -14,11 +14,11 @@ const A = {
|
|
|
14
14
|
lg: 18,
|
|
15
15
|
xl: 22
|
|
16
16
|
}, _ = {
|
|
17
|
-
xs: "
|
|
18
|
-
sm: "
|
|
19
|
-
md: "
|
|
20
|
-
lg: "
|
|
21
|
-
xl: "
|
|
17
|
+
xs: "bear-text-xs",
|
|
18
|
+
sm: "bear-text-sm",
|
|
19
|
+
md: "bear-text-base",
|
|
20
|
+
lg: "bear-text-lg",
|
|
21
|
+
xl: "bear-text-xl"
|
|
22
22
|
}, B = {
|
|
23
23
|
primary: "#ec4899",
|
|
24
24
|
secondary: "#6b7280",
|
|
@@ -32,28 +32,28 @@ const A = {
|
|
|
32
32
|
}, O = I(({
|
|
33
33
|
label: i,
|
|
34
34
|
size: b = "md",
|
|
35
|
-
variant:
|
|
35
|
+
variant: m = "primary",
|
|
36
36
|
color: p,
|
|
37
|
-
checked:
|
|
38
|
-
defaultChecked:
|
|
39
|
-
indeterminate:
|
|
37
|
+
checked: d,
|
|
38
|
+
defaultChecked: x,
|
|
39
|
+
indeterminate: a = !1,
|
|
40
40
|
disabled: c = !1,
|
|
41
|
-
error:
|
|
42
|
-
helperText:
|
|
41
|
+
error: t = !1,
|
|
42
|
+
helperText: f,
|
|
43
43
|
className: u,
|
|
44
44
|
testId: y,
|
|
45
45
|
onChange: g,
|
|
46
46
|
...k
|
|
47
47
|
}, w) => {
|
|
48
|
-
const S = L(null), r = w || S, v = j(),
|
|
48
|
+
const S = L(null), r = w || S, v = j(), h = p ?? B[m], s = R[b];
|
|
49
49
|
E(() => {
|
|
50
|
-
typeof r == "object" && (r != null && r.current) && (r.current.indeterminate =
|
|
51
|
-
}, [
|
|
50
|
+
typeof r == "object" && (r != null && r.current) && (r.current.indeterminate = a);
|
|
51
|
+
}, [a, r]);
|
|
52
52
|
const C = () => /* @__PURE__ */ e(
|
|
53
53
|
"svg",
|
|
54
54
|
{
|
|
55
|
-
width:
|
|
56
|
-
height:
|
|
55
|
+
width: s,
|
|
56
|
+
height: s,
|
|
57
57
|
viewBox: "0 0 24 24",
|
|
58
58
|
fill: "none",
|
|
59
59
|
stroke: "white",
|
|
@@ -65,8 +65,8 @@ const A = {
|
|
|
65
65
|
), N = () => /* @__PURE__ */ e(
|
|
66
66
|
"svg",
|
|
67
67
|
{
|
|
68
|
-
width:
|
|
69
|
-
height:
|
|
68
|
+
width: s,
|
|
69
|
+
height: s,
|
|
70
70
|
viewBox: "0 0 24 24",
|
|
71
71
|
fill: "none",
|
|
72
72
|
stroke: "white",
|
|
@@ -75,27 +75,27 @@ const A = {
|
|
|
75
75
|
strokeLinejoin: "round",
|
|
76
76
|
children: /* @__PURE__ */ e("line", { x1: "5", y1: "12", x2: "19", y2: "12" })
|
|
77
77
|
}
|
|
78
|
-
), n =
|
|
79
|
-
return /* @__PURE__ */ l("div", { className:
|
|
78
|
+
), n = d ?? x;
|
|
79
|
+
return /* @__PURE__ */ l("div", { className: o("bear-flex bear-flex-col", u), children: [
|
|
80
80
|
/* @__PURE__ */ l(
|
|
81
81
|
"label",
|
|
82
82
|
{
|
|
83
|
-
className:
|
|
84
|
-
"
|
|
85
|
-
c && "
|
|
83
|
+
className: o(
|
|
84
|
+
"bear-inline-flex bear-items-center bear-gap-2 bear-cursor-pointer",
|
|
85
|
+
c && "bear-opacity-50 bear-cursor-not-allowed"
|
|
86
86
|
),
|
|
87
87
|
children: [
|
|
88
|
-
/* @__PURE__ */ l("div", { className: "
|
|
88
|
+
/* @__PURE__ */ l("div", { className: "bear-relative bear-flex bear-items-center bear-justify-center", children: [
|
|
89
89
|
/* @__PURE__ */ e(
|
|
90
90
|
"input",
|
|
91
91
|
{
|
|
92
92
|
ref: r,
|
|
93
93
|
type: "checkbox",
|
|
94
|
-
checked:
|
|
95
|
-
defaultChecked:
|
|
94
|
+
checked: d,
|
|
95
|
+
defaultChecked: x,
|
|
96
96
|
disabled: c,
|
|
97
97
|
onChange: g,
|
|
98
|
-
className: "
|
|
98
|
+
className: "bear-sr-only",
|
|
99
99
|
id: v,
|
|
100
100
|
"data-testid": y,
|
|
101
101
|
...k
|
|
@@ -104,33 +104,33 @@ const A = {
|
|
|
104
104
|
/* @__PURE__ */ e(
|
|
105
105
|
"div",
|
|
106
106
|
{
|
|
107
|
-
className:
|
|
107
|
+
className: o(
|
|
108
108
|
A[b],
|
|
109
|
-
"
|
|
110
|
-
|
|
111
|
-
(n ||
|
|
112
|
-
!c && "hover:
|
|
109
|
+
"bear-rounded bear-border-2 bear-transition-all bear-flex bear-items-center bear-justify-center",
|
|
110
|
+
t ? "bear-border-red-500" : "bear-border-gray-300 dark:bear-border-gray-600",
|
|
111
|
+
(n || a) && !t && "bear-border-transparent",
|
|
112
|
+
!c && "hover:bear-border-gray-400"
|
|
113
113
|
),
|
|
114
114
|
style: {
|
|
115
|
-
backgroundColor: n ||
|
|
116
|
-
borderColor: (n ||
|
|
115
|
+
backgroundColor: n || a ? t ? "#ef4444" : h : "transparent",
|
|
116
|
+
borderColor: (n || a) && !t ? h : void 0
|
|
117
117
|
},
|
|
118
|
-
children:
|
|
118
|
+
children: a ? /* @__PURE__ */ e(N, {}) : n ? /* @__PURE__ */ e(C, {}) : null
|
|
119
119
|
}
|
|
120
120
|
)
|
|
121
121
|
] }),
|
|
122
|
-
i && /* @__PURE__ */ e("span", { className:
|
|
122
|
+
i && /* @__PURE__ */ e("span", { className: o(
|
|
123
123
|
_[b],
|
|
124
|
-
"
|
|
125
|
-
|
|
124
|
+
"bear-text-gray-700 dark:bear-text-gray-300",
|
|
125
|
+
t && "bear-text-red-500"
|
|
126
126
|
), children: i })
|
|
127
127
|
]
|
|
128
128
|
}
|
|
129
129
|
),
|
|
130
|
-
|
|
131
|
-
"
|
|
132
|
-
|
|
133
|
-
), children:
|
|
130
|
+
f && /* @__PURE__ */ e("span", { className: o(
|
|
131
|
+
"bear-text-xs bear-mt-1 bear-ml-7",
|
|
132
|
+
t ? "bear-text-red-500" : "bear-text-gray-500"
|
|
133
|
+
), children: f })
|
|
134
134
|
] });
|
|
135
135
|
});
|
|
136
136
|
O.displayName = "Checkbox";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("react/jsx-runtime"),i=require("react"),o=require("../../utils/cn.cjs"),u={sm:"bear-max-w-screen-sm",md:"bear-max-w-screen-md",lg:"bear-max-w-screen-lg",xl:"bear-max-w-screen-xl","2xl":"bear-max-w-screen-2xl",full:"bear-max-w-full"},e=i.forwardRef(({size:r="xl",centered:a=!0,padding:s=!0,className:t,children:n,testId:l,...x},c)=>m.jsx("div",{ref:c,className:o.cn("bear-w-full",u[r],a&&"bear-mx-auto",s&&"bear-px-4 sm:bear-px-6 lg:bear-px-8",t),"data-testid":l,...x,children:n}));e.displayName="Container";exports.Container=e;
|
|
@@ -2,19 +2,19 @@ import { jsx as n } from "react/jsx-runtime";
|
|
|
2
2
|
import { forwardRef as o } from "react";
|
|
3
3
|
import { cn as b } from "../../utils/cn.js";
|
|
4
4
|
const c = {
|
|
5
|
-
sm: "
|
|
6
|
-
md: "
|
|
7
|
-
lg: "
|
|
8
|
-
xl: "
|
|
9
|
-
"2xl": "
|
|
10
|
-
full: "
|
|
5
|
+
sm: "bear-max-w-screen-sm",
|
|
6
|
+
md: "bear-max-w-screen-md",
|
|
7
|
+
lg: "bear-max-w-screen-lg",
|
|
8
|
+
xl: "bear-max-w-screen-xl",
|
|
9
|
+
"2xl": "bear-max-w-screen-2xl",
|
|
10
|
+
full: "bear-max-w-full"
|
|
11
11
|
}, i = o(
|
|
12
12
|
({
|
|
13
13
|
size: e = "xl",
|
|
14
|
-
centered:
|
|
15
|
-
padding:
|
|
16
|
-
className:
|
|
17
|
-
children:
|
|
14
|
+
centered: r = !0,
|
|
15
|
+
padding: a = !0,
|
|
16
|
+
className: m,
|
|
17
|
+
children: s,
|
|
18
18
|
testId: l,
|
|
19
19
|
...x
|
|
20
20
|
}, t) => /* @__PURE__ */ n(
|
|
@@ -22,15 +22,15 @@ const c = {
|
|
|
22
22
|
{
|
|
23
23
|
ref: t,
|
|
24
24
|
className: b(
|
|
25
|
-
"
|
|
25
|
+
"bear-w-full",
|
|
26
26
|
c[e],
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
r && "bear-mx-auto",
|
|
28
|
+
a && "bear-px-4 sm:bear-px-6 lg:bear-px-8",
|
|
29
|
+
m
|
|
30
30
|
),
|
|
31
31
|
"data-testid": l,
|
|
32
32
|
...x,
|
|
33
|
-
children:
|
|
33
|
+
children: s
|
|
34
34
|
}
|
|
35
35
|
)
|
|
36
36
|
);
|
|
@@ -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"),H=require("../Calendar/Calendar.cjs"),m=require("../../utils/cn.cjs"),I=require("../../hooks/useBearStyles.cjs"),W=require("./DatePicker.utils.cjs"),_=({value:s,onChange:e,minDate:x,maxDate:f,disabled:n=!1,placeholder:p="Select date",label:i,error:l,helperText:o,format:k="MM/DD/YYYY",clearable:w=!0,className:y,style:j,bis:z,showWeekNumbers:D=!1,disabledDates:S=[],highlightedDates:v=[],slots:q,weekdayLabels:N,firstDayOfWeek:V=0,size:h="md",variant:M="default"})=>{const[u,c]=r.useState(!1),[O,B]=r.useState(s??new Date),b=r.useRef(null),d=I.useBearStyles(z,j);r.useEffect(()=>{const a=T=>{b.current&&!b.current.contains(T.target)&&c(!1)};return document.addEventListener("mousedown",a),()=>document.removeEventListener("mousedown",a)},[]);const L=r.useCallback(a=>{e==null||e(a),c(!1)},[e]),P=r.useCallback(()=>{e==null||e(null),c(!1)},[e]),R=r.useCallback(a=>{B(a)},[]),Y={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"},E={default:"bear-bg-zinc-800 bear-border-zinc-600",filled:"bear-bg-zinc-700 bear-border-transparent",outline:"bear-bg-transparent bear-border-zinc-500"};return t.jsxs("div",{ref:b,className:m.cn("bear-relative",y),style:Object.keys(d).length?d:void 0,children:[i&&t.jsx("label",{className:"bear-block bear-text-sm bear-font-medium bear-text-zinc-300 bear-mb-1.5",children:i}),t.jsxs("button",{type:"button",onClick:()=>!n&&c(!u),disabled:n,className:m.cn("bear-w-full bear-flex bear-items-center bear-justify-between bear-rounded-lg bear-border bear-text-left bear-transition-colors",Y[h],E[M],l?"bear-border-red-500":"focus:bear-border-pink-500",n&&"bear-opacity-50 bear-cursor-not-allowed",s?"bear-text-white":"bear-text-zinc-500"),children:[t.jsx("span",{children:s?W.formatDate(s,k):p}),t.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:t.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"})})]}),l&&t.jsx("p",{className:"bear-mt-1 bear-text-xs bear-text-red-400",children:l}),o&&!l&&t.jsx("p",{className:"bear-mt-1 bear-text-xs bear-text-zinc-500",children:o}),u&&t.jsx(H.Calendar,{viewDate:O,onViewChange:R,value:s??null,onSelect:L,minDate:x,maxDate:f,disabledDates:S,highlightedDates:v,slots:q,weekdayLabels:N,firstDayOfWeek:V,showWeekNumbers:D,clearable:w,onClear:P,showTodayButton:!0,onToday:()=>{e==null||e(new Date),c(!1)}})]})};exports.DatePicker=_;
|