@xola/ui-kit 3.6.0 → 3.7.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/README.md +98 -19
- package/build/components/Alert.js +29 -0
- package/build/components/Animation/FadeIn.js +40 -0
- package/build/components/Animation/SlideDown.js +25 -0
- package/build/components/Avatar.js +28 -0
- package/build/components/Badge.js +51 -0
- package/build/components/BottomSheet.js +114 -0
- package/build/components/Breadcrumb.js +33 -0
- package/build/components/Breakdown.js +81 -0
- package/build/components/Buttons/Button.js +89 -0
- package/build/components/Buttons/ButtonGroup.js +58 -0
- package/build/components/Buttons/SecondaryButton.js +31 -0
- package/build/components/Buttons/SubmitButton.js +89 -0
- package/build/components/Buttons/ToggleButton.js +33 -0
- package/build/components/Charts/BaseChartOptions.js +95 -0
- package/build/components/Charts/HistogramOptions.js +69 -0
- package/build/components/Charts/PieOptions.js +55 -0
- package/build/components/Counter.js +20 -0
- package/build/components/DatePicker/DatePicker.helpers.js +33 -0
- package/build/components/DatePicker/DatePicker.js +214 -0
- package/build/components/DatePicker/DatePickerPopover.js +90 -0
- package/build/components/DatePicker/Day.js +43 -0
- package/build/components/DatePicker/LocalizedDayPicker.js +17 -0
- package/build/components/DatePicker/MonthGrid.js +39 -0
- package/build/components/DatePicker/MonthPicker.js +33 -0
- package/build/components/DatePicker/MonthSelector.js +46 -0
- package/build/components/DatePicker/MonthYearSelector.js +23 -0
- package/build/components/DatePicker/NavbarElement.js +34 -0
- package/build/components/DatePicker/RangeDatePicker.js +111 -0
- package/build/components/DatePicker/RelativeDateRange.js +290 -0
- package/build/components/DatePicker/UpcomingDatePicker.js +31 -0
- package/build/components/Dot/Dot.js +29 -0
- package/build/components/Dot/DotProgress.js +15 -0
- package/build/components/Drawer.js +134 -0
- package/build/components/Forms/BaseInput.js +57 -0
- package/build/components/Forms/Checkbox.js +37 -0
- package/build/components/Forms/Checkbox.module.css.js +7 -0
- package/build/components/Forms/ComboBox.js +41 -0
- package/build/components/Forms/FormGroup.js +10 -0
- package/build/components/Forms/InlineValuePopover.js +41 -0
- package/build/components/Forms/Input.js +17 -0
- package/build/components/Forms/Label.js +23 -0
- package/build/components/Forms/RangeSlider.js +58 -0
- package/build/components/Forms/Select.js +7 -0
- package/build/components/Forms/Switch.js +70 -0
- package/build/components/Forms/Textarea.js +42 -0
- package/build/components/Forms/ValuePopoverText.js +7 -0
- package/build/components/GooglePlacesAutocomplete.js +112 -0
- package/build/components/HeaderToolbar.js +41 -0
- package/build/components/ImageUpload.js +83 -0
- package/build/components/Key.js +33 -0
- package/build/components/Logo.js +17 -0
- package/build/components/Modal.js +141 -0
- package/build/components/Popover/Popover.js +53 -0
- package/build/components/Popover/Popover.module.css.js +7 -0
- package/build/components/Popover/PopoverList.js +57 -0
- package/build/components/Popover/PopoverScroll.module.css.js +4 -0
- package/build/components/Provider.js +16 -0
- package/build/components/Screens/Login.js +115 -0
- package/build/components/Search.js +144 -0
- package/build/components/Sidebar/Sidebar.Account.js +49 -0
- package/build/components/Sidebar/Sidebar.Button.js +47 -0
- package/build/components/Sidebar/Sidebar.Footer.js +10 -0
- package/build/components/Sidebar/Sidebar.Heading.js +13 -0
- package/build/components/Sidebar/Sidebar.Link.js +92 -0
- package/build/components/Sidebar/Sidebar.Menu.js +54 -0
- package/build/components/Sidebar/Sidebar.Menu.module.css.js +7 -0
- package/build/components/Sidebar/Sidebar.Notifications.js +107 -0
- package/build/components/Sidebar/Sidebar.js +212 -0
- package/build/components/Sidebar/SidebarContext.js +15 -0
- package/build/components/Sidebar/SidebarScroll.module.css.js +4 -0
- package/build/components/Sidebar/sidebarWidth.js +41 -0
- package/build/components/Sidebar/useSidebarWidthState.js +115 -0
- package/build/components/Skeleton.js +28 -0
- package/build/components/Skeleton.module.css.js +7 -0
- package/build/components/Spinner.js +35 -0
- package/build/components/Table.js +107 -0
- package/build/components/Tabs/Tabs.Panel.js +11 -0
- package/build/components/Tabs/Tabs.Tab.js +42 -0
- package/build/components/Tabs/Tabs.js +28 -0
- package/build/components/Tag.js +41 -0
- package/build/components/Tooltip.js +22 -0
- package/build/components/Utilities/Currency.js +56 -0
- package/build/components/Utilities/Number.js +17 -0
- package/build/components/Utilities/Phone.js +25 -0
- package/build/helpers/browser.js +9 -0
- package/build/helpers/children.js +6 -0
- package/build/helpers/classnames.js +8 -0
- package/build/helpers/environment.js +10 -0
- package/build/helpers/flash.js +86 -0
- package/build/hooks/useIsClient.js +10 -0
- package/build/hooks/useIsMobile.js +8 -0
- package/build/hooks/useViewportHeight.js +9 -0
- package/build/icons/src/AnnounceIcon.js +12 -0
- package/build/icons/src/BellIcon.js +26 -0
- package/build/icons/src/CalendarIcon.js +15 -0
- package/build/icons/src/CheckIcon.js +7 -0
- package/build/icons/src/ChevronDownIcon.js +7 -0
- package/build/icons/src/ChevronLeftIcon.js +7 -0
- package/build/icons/src/ChevronRightIcon.js +7 -0
- package/build/icons/src/CircleNotch.js +5 -0
- package/build/icons/src/CloseIcon.js +13 -0
- package/build/icons/src/DownArrowIcon.js +15 -0
- package/build/icons/src/ImageIcon.js +26 -0
- package/build/icons/src/SearchIcon.js +15 -0
- package/build/icons/src/TrashIcon.js +19 -0
- package/build/icons/src/WarningDiamondIcon.js +26 -0
- package/build/icons/src/helpers/icon.js +7 -0
- package/build/icons/src/helpers/iconSizes.js +13 -0
- package/build/icons/src/images/XolaLogoSimple.js +13 -0
- package/build/index.js +155 -0
- package/build/style.css +1 -1
- package/build/theme.js +374 -0
- package/build/utils/avatar.js +8 -0
- package/build/utils/currency.js +11 -0
- package/build/utils/date.js +46 -0
- package/build/utils/numbers.js +19 -0
- package/build/utils/phone.js +15 -0
- package/build/utils/userLocale.js +6 -0
- package/index.d.ts +132 -79
- package/package.json +76 -45
- package/postcss.config.js +1 -1
- package/skills/README.md +27 -0
- package/skills/migrate-2.6-to-3.7/SKILL.md +110 -0
- package/tailwind.config.js +9 -5
- package/build/ui-kit.es.js +0 -16771
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import e from "prop-types";
|
|
2
|
+
import i from "react";
|
|
3
|
+
import m from "../../helpers/classnames.js";
|
|
4
|
+
const n = {
|
|
5
|
+
standard: {
|
|
6
|
+
common: "border-transparent text-white",
|
|
7
|
+
// Common classes for each style
|
|
8
|
+
primary: "bg-primary hover:bg-primary-darker active:bg-primary",
|
|
9
|
+
secondary: "bg-secondary text-white hover:bg-secondary-dark border-transparent active:bg-secondary",
|
|
10
|
+
success: "bg-success hover:bg-success-dark active:bg-success",
|
|
11
|
+
warning: "bg-warning hover:bg-warning-dark active:bg-warning",
|
|
12
|
+
caution: "bg-caution hover:bg-caution-dark active:bg-caution",
|
|
13
|
+
danger: "bg-danger hover:bg-danger-dark active:bg-danger"
|
|
14
|
+
},
|
|
15
|
+
outline: {
|
|
16
|
+
common: "bg-white border hover:bg-white active:text-white",
|
|
17
|
+
// Common classes for each style
|
|
18
|
+
default: "border-gray-light hover:border-gray-dark active:bg-primary-lighter active:text-black active:border-primary",
|
|
19
|
+
primary: "text-primary border-primary hover:text-primary-dark hover:border-primary-dark active:bg-primary-light",
|
|
20
|
+
secondary: "border-gray-light hover:border-gray-dark active:bg-primary-lighter active:text-black active:border-primary",
|
|
21
|
+
success: "text-success border-success hover:text-success-dark hover:border-success-dark active:bg-success-light",
|
|
22
|
+
warning: "text-warning border-warning hover:text-warning-dark hover:border-warning-dark active:bg-warning-light",
|
|
23
|
+
caution: "text-caution border-caution hover:text-caution-dark hover:border-caution-dark active:bg-caution-light",
|
|
24
|
+
danger: "text-danger border-danger hover:text-danger-dark hover:border-danger-dark active:bg-danger-light"
|
|
25
|
+
},
|
|
26
|
+
link: {
|
|
27
|
+
common: "border-transparent hover:underline",
|
|
28
|
+
primary: "text-primary",
|
|
29
|
+
secondary: "text-secondary",
|
|
30
|
+
success: "text-success",
|
|
31
|
+
warning: "text-warning",
|
|
32
|
+
caution: "text-caution",
|
|
33
|
+
danger: "text-danger"
|
|
34
|
+
}
|
|
35
|
+
}, c = {
|
|
36
|
+
tiny: "px-2 py-0.5 text-xs leading-xs",
|
|
37
|
+
// 20px
|
|
38
|
+
small: "px-3 py-2 h-7.5 text-sm leading-sm",
|
|
39
|
+
// 30px
|
|
40
|
+
medium: "px-4.5 py-3 h-10 text-base leading-base",
|
|
41
|
+
// 40px
|
|
42
|
+
large: "px-6 py-4 h-[50px] text-md leading-md"
|
|
43
|
+
// 50px
|
|
44
|
+
}, u = ({
|
|
45
|
+
as: r = "button",
|
|
46
|
+
variant: t = "standard",
|
|
47
|
+
color: s = "primary",
|
|
48
|
+
size: d = "medium",
|
|
49
|
+
icon: a,
|
|
50
|
+
iconPlacement: o = "left",
|
|
51
|
+
className: g,
|
|
52
|
+
children: b,
|
|
53
|
+
...l
|
|
54
|
+
}) => /* @__PURE__ */ i.createElement(
|
|
55
|
+
r,
|
|
56
|
+
{
|
|
57
|
+
className: m(
|
|
58
|
+
"ui-button",
|
|
59
|
+
"inline-flex rounded border transition-colors focus:ring disabled:cursor-default disabled:bg-gray-lighter disabled:text-gray-darker",
|
|
60
|
+
"items-center justify-center font-semibold",
|
|
61
|
+
n[t].common,
|
|
62
|
+
n[t][s],
|
|
63
|
+
c[d],
|
|
64
|
+
g
|
|
65
|
+
),
|
|
66
|
+
...l
|
|
67
|
+
},
|
|
68
|
+
a && o === "left" ? /* @__PURE__ */ i.createElement("span", { className: "mr-2 flex-shrink-0" }, a) : null,
|
|
69
|
+
b,
|
|
70
|
+
a && o === "right" ? /* @__PURE__ */ i.createElement("span", { className: "ml-2 flex-shrink-0" }, a) : null
|
|
71
|
+
);
|
|
72
|
+
u.propTypes = {
|
|
73
|
+
// as: PropTypes.string,
|
|
74
|
+
color: e.oneOf(Object.keys(n.outline)),
|
|
75
|
+
variant: e.oneOf(Object.keys(n)),
|
|
76
|
+
size: e.oneOf(Object.keys(c)),
|
|
77
|
+
className: e.string,
|
|
78
|
+
children: e.oneOfType([e.arrayOf(e.node), e.node]),
|
|
79
|
+
icon(r, ...t) {
|
|
80
|
+
return r.icon && !r.children ? new Error(
|
|
81
|
+
"UI Kit: You are using an icon without specifying children. If you want to use an icon only specify it as a child instead of prop"
|
|
82
|
+
) : e.element(r, ...t);
|
|
83
|
+
},
|
|
84
|
+
iconPlacement: e.string
|
|
85
|
+
};
|
|
86
|
+
export {
|
|
87
|
+
u as Button,
|
|
88
|
+
n as colors
|
|
89
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import e from "prop-types";
|
|
2
|
+
import l, { Children as y, cloneElement as h } from "react";
|
|
3
|
+
import f from "../../helpers/classnames.js";
|
|
4
|
+
const m = {
|
|
5
|
+
small: "px-2 py-1.5 text-sm",
|
|
6
|
+
medium: "py-3 px-2.5 text-base",
|
|
7
|
+
large: "px-4 py-3.5 text-lg"
|
|
8
|
+
}, b = ({ size: a, value: r, isCollapsed: p = !1, onChange: d, className: u, children: t, ...n }) => /* @__PURE__ */ l.createElement("span", { className: f("ui-button-group", "inline-flex whitespace-nowrap", u), ...n }, y.map(t, (i, s) => {
|
|
9
|
+
const o = { size: a };
|
|
10
|
+
if (!i.props.isHidden)
|
|
11
|
+
return r !== void 0 && (o.isActive = r === s), p && r >= 0 && r !== s && (o.shouldShowText = !1), d && (o.onClick = () => d(s)), h(i, o);
|
|
12
|
+
}));
|
|
13
|
+
b.propTypes = {
|
|
14
|
+
className: e.string,
|
|
15
|
+
size: e.oneOf(Object.keys(m)).isRequired,
|
|
16
|
+
value: e.number.isRequired,
|
|
17
|
+
isCollapsed: e.bool,
|
|
18
|
+
onChange: e.func.isRequired,
|
|
19
|
+
children: e.node.isRequired
|
|
20
|
+
};
|
|
21
|
+
const c = ({
|
|
22
|
+
as: a = "button",
|
|
23
|
+
isActive: r,
|
|
24
|
+
shouldShowText: p = !0,
|
|
25
|
+
/* eslint-disable-next-line @typescript-eslint/no-unused-vars */
|
|
26
|
+
isHidden: d = !1,
|
|
27
|
+
size: u = "medium",
|
|
28
|
+
icon: t,
|
|
29
|
+
iconPlacement: n = "left",
|
|
30
|
+
className: i,
|
|
31
|
+
children: s,
|
|
32
|
+
...o
|
|
33
|
+
}) => {
|
|
34
|
+
const g = f(
|
|
35
|
+
"ui-button-group-button",
|
|
36
|
+
"inline-flex border-t border-l border-b last:border-r first:rounded-l-md last:rounded-r-md transition-colors focus:ring disabled:opacity-60 focus:z-10 leading-none",
|
|
37
|
+
m[u],
|
|
38
|
+
r ? "bg-primary border-primary text-white hover:bg-primary-dark" : "border-gray-light hover:bg-gray-lighter text-gray-darker",
|
|
39
|
+
i
|
|
40
|
+
);
|
|
41
|
+
return /* @__PURE__ */ l.createElement(a, { "aria-pressed": r, className: g, ...o }, t && n === "left" ? /* @__PURE__ */ l.createElement("span", { className: "mr-2 flex-shrink-0" }, t) : null, p ? s : t ? null : s, t && n === "right" ? /* @__PURE__ */ l.createElement("span", { className: "ml-2 flex-shrink-0" }, t) : null);
|
|
42
|
+
};
|
|
43
|
+
c.displayName = "ButtonGroup.Button";
|
|
44
|
+
c.propTypes = {
|
|
45
|
+
as: e.oneOfType([e.string, e.elementType]),
|
|
46
|
+
isActive: e.bool,
|
|
47
|
+
shouldShowText: e.bool,
|
|
48
|
+
isHidden: e.bool,
|
|
49
|
+
size: e.oneOf(Object.keys(m)),
|
|
50
|
+
icon: e.element,
|
|
51
|
+
iconPlacement: e.oneOf(["left", "right"]),
|
|
52
|
+
className: e.string,
|
|
53
|
+
children: e.node.isRequired
|
|
54
|
+
};
|
|
55
|
+
b.Button = c;
|
|
56
|
+
export {
|
|
57
|
+
b as ButtonGroup
|
|
58
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import a from "prop-types";
|
|
2
|
+
import s from "react";
|
|
3
|
+
import i from "../../helpers/classnames.js";
|
|
4
|
+
import { Button as e } from "./Button.js";
|
|
5
|
+
const c = ({
|
|
6
|
+
type: t = "button",
|
|
7
|
+
size: r = "medium",
|
|
8
|
+
disabled: o = !1,
|
|
9
|
+
className: n,
|
|
10
|
+
children: p,
|
|
11
|
+
...m
|
|
12
|
+
}) => /* @__PURE__ */ s.createElement(
|
|
13
|
+
e,
|
|
14
|
+
{
|
|
15
|
+
type: t,
|
|
16
|
+
size: r,
|
|
17
|
+
disabled: o,
|
|
18
|
+
variant: "outline",
|
|
19
|
+
color: "secondary",
|
|
20
|
+
className: i(o ? "pointer-events-none" : "pointer-events-auto", n),
|
|
21
|
+
...m
|
|
22
|
+
},
|
|
23
|
+
p
|
|
24
|
+
);
|
|
25
|
+
c.propTypes = {
|
|
26
|
+
...e.propTypes,
|
|
27
|
+
disabled: a.bool
|
|
28
|
+
};
|
|
29
|
+
export {
|
|
30
|
+
c as SecondaryButton
|
|
31
|
+
};
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { Transition as h } from "@headlessui/react";
|
|
2
|
+
import s from "prop-types";
|
|
3
|
+
import t, { useState as d, useEffect as w } from "react";
|
|
4
|
+
import a from "../../helpers/classnames.js";
|
|
5
|
+
import { Spinner as T } from "../Spinner.js";
|
|
6
|
+
import { Button as m, colors as x } from "./Button.js";
|
|
7
|
+
import { CheckIcon as E } from "../../icons/src/CheckIcon.js";
|
|
8
|
+
const S = {
|
|
9
|
+
primary: "!bg-primary-light",
|
|
10
|
+
secondary: "!bg-secondary-light",
|
|
11
|
+
success: "!bg-success-light",
|
|
12
|
+
warning: "!bg-warning-light",
|
|
13
|
+
caution: "!bg-caution-light",
|
|
14
|
+
danger: "!bg-danger-light"
|
|
15
|
+
}, N = ({
|
|
16
|
+
color: n = "primary",
|
|
17
|
+
isLoading: r,
|
|
18
|
+
isSuccess: c,
|
|
19
|
+
disabled: p = !1,
|
|
20
|
+
variant: l = "standard",
|
|
21
|
+
type: u = "submit",
|
|
22
|
+
className: f,
|
|
23
|
+
children: b,
|
|
24
|
+
...y
|
|
25
|
+
}) => {
|
|
26
|
+
const [o, i] = d(!1);
|
|
27
|
+
w(() => {
|
|
28
|
+
if (c && !r) {
|
|
29
|
+
i(!0);
|
|
30
|
+
const g = setTimeout(() => i(!1), 3e3);
|
|
31
|
+
return () => clearTimeout(g);
|
|
32
|
+
}
|
|
33
|
+
r && o && i(!1);
|
|
34
|
+
}, [c, r]);
|
|
35
|
+
const e = r || o;
|
|
36
|
+
return /* @__PURE__ */ t.createElement(
|
|
37
|
+
m,
|
|
38
|
+
{
|
|
39
|
+
type: u,
|
|
40
|
+
color: n,
|
|
41
|
+
disabled: e || p,
|
|
42
|
+
variant: l,
|
|
43
|
+
className: a(f, "relative", e && S[n]),
|
|
44
|
+
...y
|
|
45
|
+
},
|
|
46
|
+
/* @__PURE__ */ t.createElement(
|
|
47
|
+
"span",
|
|
48
|
+
{
|
|
49
|
+
className: a(
|
|
50
|
+
"absolute inset-0 flex items-center justify-center",
|
|
51
|
+
e ? "opacity-100" : "opacity-0"
|
|
52
|
+
)
|
|
53
|
+
},
|
|
54
|
+
e && /* @__PURE__ */ t.createElement(
|
|
55
|
+
h,
|
|
56
|
+
{
|
|
57
|
+
appear: !0,
|
|
58
|
+
as: "span",
|
|
59
|
+
show: e,
|
|
60
|
+
enter: "transition-all duration-700",
|
|
61
|
+
enterFrom: "opacity-0",
|
|
62
|
+
enterTo: "opacity-100"
|
|
63
|
+
},
|
|
64
|
+
o && /* @__PURE__ */ t.createElement(
|
|
65
|
+
E,
|
|
66
|
+
{
|
|
67
|
+
size: "medium",
|
|
68
|
+
color: "current",
|
|
69
|
+
className: a("relative -top-0.25 text-white", {
|
|
70
|
+
"text-black": l === "outline"
|
|
71
|
+
})
|
|
72
|
+
}
|
|
73
|
+
),
|
|
74
|
+
r && !o && /* @__PURE__ */ t.createElement(T, { size: "current", color: "current", className: "relative -top-0.25 text-white" })
|
|
75
|
+
)
|
|
76
|
+
),
|
|
77
|
+
/* @__PURE__ */ t.createElement("span", { className: a(e ? "flex-shrink flex-grow opacity-0" : "opacity-100") }, b)
|
|
78
|
+
);
|
|
79
|
+
};
|
|
80
|
+
N.propTypes = {
|
|
81
|
+
...m.propTypes,
|
|
82
|
+
isLoading: s.bool,
|
|
83
|
+
isSuccess: s.bool,
|
|
84
|
+
variant: s.oneOf(Object.keys(x)),
|
|
85
|
+
disabled: s.bool
|
|
86
|
+
};
|
|
87
|
+
export {
|
|
88
|
+
N as SubmitButton
|
|
89
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import b from "prop-types";
|
|
2
|
+
import d from "react";
|
|
3
|
+
import a from "../../helpers/classnames.js";
|
|
4
|
+
import { Button as o } from "./Button.js";
|
|
5
|
+
const s = {
|
|
6
|
+
outline: {
|
|
7
|
+
primary: "bg-primary-lighter border border-primary hover:bg-primary-light hover:border-primary-dark",
|
|
8
|
+
secondary: "bg-secondary-light border border-secondary-light hover:bg-secondary-light hover:border-secondary",
|
|
9
|
+
success: "bg-success-lightish border border-success hover:bg-success-light hover:border-success-dark",
|
|
10
|
+
warning: "bg-warning-lightish border border-warning hover:bg-warning-light hover:border-warning-dark",
|
|
11
|
+
caution: "bg-caution-lightish border border-caution hover:bg-caution-light hover:border-caution-dark",
|
|
12
|
+
danger: "bg-danger-lightish border border-danger hover:bg-danger-light hover:border-danger-dark"
|
|
13
|
+
}
|
|
14
|
+
}, h = ({ color: r = "primary", variant: e = "outline", isActive: i, className: g, ...t }) => /* @__PURE__ */ d.createElement(
|
|
15
|
+
o,
|
|
16
|
+
{
|
|
17
|
+
color: r,
|
|
18
|
+
variant: e,
|
|
19
|
+
className: a(
|
|
20
|
+
"text-black",
|
|
21
|
+
g,
|
|
22
|
+
i ? s[e][r] : `bg-white hover:bg-${r}-lighter hover:border-${r}`
|
|
23
|
+
),
|
|
24
|
+
...t
|
|
25
|
+
}
|
|
26
|
+
);
|
|
27
|
+
h.propTypes = {
|
|
28
|
+
...o.propTypes,
|
|
29
|
+
isActive: b.bool.isRequired
|
|
30
|
+
};
|
|
31
|
+
export {
|
|
32
|
+
h as ToggleButton
|
|
33
|
+
};
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { merge as t } from "lodash-es";
|
|
2
|
+
import { theme as o } from "../../theme.js";
|
|
3
|
+
const { colors: e } = o, r = {
|
|
4
|
+
color: e.gray.darker,
|
|
5
|
+
fontSize: o.fontSize.sm,
|
|
6
|
+
// 12px
|
|
7
|
+
fontWeight: 400,
|
|
8
|
+
cursor: "pointer",
|
|
9
|
+
textOverflow: "ellipsis",
|
|
10
|
+
fontFamily: o.extend.fontFamily.sans
|
|
11
|
+
}, s = {
|
|
12
|
+
global: {
|
|
13
|
+
useUTC: !1
|
|
14
|
+
},
|
|
15
|
+
chart: {
|
|
16
|
+
spacingLeft: 0
|
|
17
|
+
},
|
|
18
|
+
colors: [
|
|
19
|
+
e.primary,
|
|
20
|
+
e.success,
|
|
21
|
+
e.warning,
|
|
22
|
+
e.caution,
|
|
23
|
+
e.danger,
|
|
24
|
+
e.blue.darker,
|
|
25
|
+
e.green.darker,
|
|
26
|
+
e.red.darker,
|
|
27
|
+
e.yellow.darker,
|
|
28
|
+
e.orange.darker
|
|
29
|
+
],
|
|
30
|
+
xAxis: {
|
|
31
|
+
title: { style: t({}, r, { color: e.black }) },
|
|
32
|
+
labels: { style: r }
|
|
33
|
+
},
|
|
34
|
+
yAxis: {
|
|
35
|
+
title: { style: t({}, r, { color: e.black }) },
|
|
36
|
+
labels: { style: r }
|
|
37
|
+
},
|
|
38
|
+
tooltip: {
|
|
39
|
+
enabled: !0,
|
|
40
|
+
backgroundColor: e.black,
|
|
41
|
+
borderColor: e.black,
|
|
42
|
+
borderRadius: 4,
|
|
43
|
+
borderWidth: 1,
|
|
44
|
+
valueDecimals: 2,
|
|
45
|
+
crosshairs: [!0, !0],
|
|
46
|
+
// Show crosshairs when you browse over the toolips
|
|
47
|
+
shadow: !1,
|
|
48
|
+
useHTML: !0,
|
|
49
|
+
// This is used to insert spans with classes for custom css
|
|
50
|
+
style: t({}, r, {
|
|
51
|
+
opacity: 0.9,
|
|
52
|
+
color: "#cccccc"
|
|
53
|
+
})
|
|
54
|
+
},
|
|
55
|
+
title: {
|
|
56
|
+
text: "",
|
|
57
|
+
// No title by default
|
|
58
|
+
style: t({}, r, { color: e.black, fontSize: "18px", fontWeight: 600 })
|
|
59
|
+
},
|
|
60
|
+
plotOptions: {
|
|
61
|
+
series: {
|
|
62
|
+
// Markers are not shown by default, except when you hover
|
|
63
|
+
marker: {
|
|
64
|
+
enabled: !0,
|
|
65
|
+
states: {
|
|
66
|
+
hover: {
|
|
67
|
+
enabled: !0,
|
|
68
|
+
// Width and radius of the marker when you hover
|
|
69
|
+
lineWidth: 1,
|
|
70
|
+
radius: 4
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
legend: {
|
|
77
|
+
enabled: !1,
|
|
78
|
+
// By default legend is disabled
|
|
79
|
+
// The style applied to each item in the legend
|
|
80
|
+
itemStyle: r,
|
|
81
|
+
itemMarginBottom: 5,
|
|
82
|
+
align: "center",
|
|
83
|
+
// Center it in the chart canvas
|
|
84
|
+
layout: "vertical",
|
|
85
|
+
// Legend items are shown as a list
|
|
86
|
+
borderWidth: 0
|
|
87
|
+
},
|
|
88
|
+
credits: {
|
|
89
|
+
// Don't show the 'Powered by Highcharts' text
|
|
90
|
+
enabled: !1
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
export {
|
|
94
|
+
s as BaseChartOptions
|
|
95
|
+
};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { merge as i } from "lodash-es";
|
|
2
|
+
import { theme as e } from "../../theme.js";
|
|
3
|
+
import { BaseChartOptions as t } from "./BaseChartOptions.js";
|
|
4
|
+
const n = i({}, t, {
|
|
5
|
+
chart: {
|
|
6
|
+
type: "line"
|
|
7
|
+
},
|
|
8
|
+
title: {
|
|
9
|
+
align: "left",
|
|
10
|
+
margin: 20,
|
|
11
|
+
verticalAlign: "top"
|
|
12
|
+
},
|
|
13
|
+
xAxis: {
|
|
14
|
+
type: "datetime",
|
|
15
|
+
// This will convert time into proper dates on the axis
|
|
16
|
+
step: 1,
|
|
17
|
+
minTickInterval: 24 * 3600 * 1e3,
|
|
18
|
+
lineColor: e.colors.gray.darker,
|
|
19
|
+
lineWidth: 1,
|
|
20
|
+
gridLineWidth: "1",
|
|
21
|
+
gridLineColor: "#DEDEDE",
|
|
22
|
+
gridLineDashStyle: "dot"
|
|
23
|
+
},
|
|
24
|
+
yAxis: {
|
|
25
|
+
lineColor: e.colors.gray.darker,
|
|
26
|
+
lineWidth: 1,
|
|
27
|
+
gridLineWidth: "1",
|
|
28
|
+
gridLineColor: "#DEDEDE",
|
|
29
|
+
gridLineDashStyle: "dot"
|
|
30
|
+
},
|
|
31
|
+
plotOptions: {
|
|
32
|
+
series: {
|
|
33
|
+
// Markers are not shown by default, except when you hover
|
|
34
|
+
marker: {
|
|
35
|
+
enabled: !0,
|
|
36
|
+
lineWidth: 1,
|
|
37
|
+
radius: 3,
|
|
38
|
+
states: {
|
|
39
|
+
hover: {
|
|
40
|
+
enabled: !0,
|
|
41
|
+
// Width and radius of the marker when you hover
|
|
42
|
+
lineWidth: 1,
|
|
43
|
+
radius: 4
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
legend: {
|
|
50
|
+
// By default legend is disabled
|
|
51
|
+
enabled: !1,
|
|
52
|
+
// The style applied to each item in the legend
|
|
53
|
+
itemStyle: {
|
|
54
|
+
fontSize: "14px",
|
|
55
|
+
color: "#666666",
|
|
56
|
+
textTransform: "capitalize",
|
|
57
|
+
fontFamily: e.extend.fontFamily.sans
|
|
58
|
+
},
|
|
59
|
+
itemMarginBottom: 5,
|
|
60
|
+
align: "center",
|
|
61
|
+
// Center it in the chart canvas
|
|
62
|
+
layout: "vertical",
|
|
63
|
+
// Legend items are shown as a list
|
|
64
|
+
borderWidth: 0
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
export {
|
|
68
|
+
n as HistogramOptions
|
|
69
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { merge as t } from "lodash-es";
|
|
2
|
+
import { theme as e } from "../../theme.js";
|
|
3
|
+
import { BaseChartOptions as o } from "./BaseChartOptions.js";
|
|
4
|
+
const a = t({}, o, {
|
|
5
|
+
chart: {
|
|
6
|
+
type: "pie"
|
|
7
|
+
},
|
|
8
|
+
tooltip: {
|
|
9
|
+
pointFormat: "<b>{point.percentage:.1f}%</b>"
|
|
10
|
+
},
|
|
11
|
+
plotOptions: {
|
|
12
|
+
pie: {
|
|
13
|
+
size: 180,
|
|
14
|
+
center: [80, 90],
|
|
15
|
+
allowPointSelect: !0,
|
|
16
|
+
cursor: "pointer",
|
|
17
|
+
dataLabels: {
|
|
18
|
+
enabled: !1
|
|
19
|
+
},
|
|
20
|
+
showInLegend: !0,
|
|
21
|
+
innerSize: 110
|
|
22
|
+
// Donuts. Krispy Kreme 4tw
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
legend: {
|
|
26
|
+
enabled: !0,
|
|
27
|
+
maxHeight: 120,
|
|
28
|
+
width: 220,
|
|
29
|
+
navigation: {
|
|
30
|
+
// This is the navigation for the legend. A scrollable list
|
|
31
|
+
activeColor: e.colors.gray.darker,
|
|
32
|
+
animation: "true",
|
|
33
|
+
style: e.extend.fontFamily.sans
|
|
34
|
+
},
|
|
35
|
+
padding: 5,
|
|
36
|
+
backgroundColor: e.colors.white,
|
|
37
|
+
// For debugging
|
|
38
|
+
itemMarginTop: 1,
|
|
39
|
+
itemMarginBottom: 3,
|
|
40
|
+
itemStyle: e.extend.fontFamily.sans,
|
|
41
|
+
style: { overflow: "hidden" },
|
|
42
|
+
align: "left",
|
|
43
|
+
layout: "horizontal",
|
|
44
|
+
verticalAlign: "proximate",
|
|
45
|
+
y: 240
|
|
46
|
+
// To get the legend to show right below the pie
|
|
47
|
+
},
|
|
48
|
+
credits: {
|
|
49
|
+
// Don't show the 'Powered by Highcharts' text
|
|
50
|
+
enabled: !1
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
export {
|
|
54
|
+
a as PieOptions
|
|
55
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import t from "prop-types";
|
|
2
|
+
import n from "react";
|
|
3
|
+
import o from "../helpers/classnames.js";
|
|
4
|
+
const i = ({ className: e, ...r }) => /* @__PURE__ */ n.createElement(
|
|
5
|
+
"span",
|
|
6
|
+
{
|
|
7
|
+
className: o(
|
|
8
|
+
"ui-counter",
|
|
9
|
+
"inline-flex items-center justify-center rounded-full bg-danger-dark px-2 py-1 font-semibold leading-none text-white",
|
|
10
|
+
e
|
|
11
|
+
),
|
|
12
|
+
...r
|
|
13
|
+
}
|
|
14
|
+
);
|
|
15
|
+
i.propTypes = {
|
|
16
|
+
className: t.string
|
|
17
|
+
};
|
|
18
|
+
export {
|
|
19
|
+
i as Counter
|
|
20
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import * as s from "dayjs/locale/de.js";
|
|
2
|
+
import * as e from "dayjs/locale/en.js";
|
|
3
|
+
import * as a from "dayjs/locale/en-gb.js";
|
|
4
|
+
import * as t from "dayjs/locale/es.js";
|
|
5
|
+
import * as n from "dayjs/locale/es-mx.js";
|
|
6
|
+
import * as m from "dayjs/locale/fr.js";
|
|
7
|
+
const c = {
|
|
8
|
+
en: e,
|
|
9
|
+
"en-US": e,
|
|
10
|
+
"en-GB": a,
|
|
11
|
+
es: t,
|
|
12
|
+
"es-ES": t,
|
|
13
|
+
"es-MX": n,
|
|
14
|
+
fr: m,
|
|
15
|
+
de: s
|
|
16
|
+
}, i = async (r) => {
|
|
17
|
+
try {
|
|
18
|
+
const o = await c[r];
|
|
19
|
+
return {
|
|
20
|
+
locale: r,
|
|
21
|
+
weekdaysLong: o.weekdays,
|
|
22
|
+
weekdaysShort: o.weekdaysShort,
|
|
23
|
+
months: o.months,
|
|
24
|
+
monthsShort: o.monthsShort,
|
|
25
|
+
firstDayOfWeek: o.weekStart
|
|
26
|
+
};
|
|
27
|
+
} catch (o) {
|
|
28
|
+
throw console.error("Error: React Day Picker localization error", o), o;
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
export {
|
|
32
|
+
i as getLocalizationProps
|
|
33
|
+
};
|