@xola/ui-kit 3.5.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 +136 -87
- package/build/components/Alert.js +18 -13
- package/build/components/Animation/FadeIn.js +36 -25
- package/build/components/Animation/SlideDown.js +14 -9
- package/build/components/Avatar.js +17 -10
- package/build/components/Badge.js +33 -24
- package/build/components/BottomSheet.js +114 -0
- package/build/components/Breadcrumb.js +27 -21
- package/build/components/Breakdown.js +66 -74
- package/build/components/Buttons/Button.js +53 -47
- package/build/components/Buttons/ButtonGroup.js +42 -39
- package/build/components/Buttons/SecondaryButton.js +31 -0
- package/build/components/Buttons/SubmitButton.js +72 -66
- package/build/components/Buttons/ToggleButton.js +15 -16
- package/build/components/Counter.js +10 -6
- package/build/components/DatePicker/DatePicker.helpers.js +24 -13
- package/build/components/DatePicker/DatePicker.js +196 -223
- package/build/components/DatePicker/DatePickerPopover.js +75 -66
- package/build/components/DatePicker/Day.js +35 -32
- package/build/components/DatePicker/LocalizedDayPicker.js +15 -18
- package/build/components/DatePicker/MonthGrid.js +35 -48
- package/build/components/DatePicker/MonthPicker.js +25 -20
- package/build/components/DatePicker/MonthSelector.js +39 -40
- package/build/components/DatePicker/MonthYearSelector.js +18 -39
- package/build/components/DatePicker/NavbarElement.js +26 -35
- package/build/components/DatePicker/RangeDatePicker.js +104 -123
- package/build/components/DatePicker/RelativeDateRange.js +153 -143
- package/build/components/DatePicker/UpcomingDatePicker.js +29 -25
- package/build/components/Dot/Dot.js +13 -8
- package/build/components/Dot/DotProgress.js +12 -7
- package/build/components/Drawer.js +109 -101
- package/build/components/Forms/BaseInput.js +50 -34
- package/build/components/Forms/Checkbox.js +33 -30
- package/build/components/Forms/ComboBox.js +35 -35
- package/build/components/Forms/FormGroup.js +7 -3
- package/build/components/Forms/InlineValuePopover.js +33 -39
- package/build/components/Forms/Input.js +15 -7
- package/build/components/Forms/Label.js +14 -8
- package/build/components/Forms/RangeSlider.js +41 -22
- package/build/components/Forms/Select.js +5 -6
- package/build/components/Forms/Switch.js +46 -38
- package/build/components/Forms/Textarea.js +37 -30
- package/build/components/Forms/ValuePopoverText.js +5 -8
- package/build/components/GooglePlacesAutocomplete.js +112 -0
- package/build/components/HeaderToolbar.js +30 -22
- package/build/components/ImageUpload.js +76 -79
- package/build/components/Key.js +21 -16
- package/build/components/Logo.js +12 -5
- package/build/components/Modal.js +87 -72
- package/build/components/Popover/Popover.js +40 -31
- package/build/components/Popover/PopoverList.js +43 -36
- package/build/components/Provider.js +7 -8
- package/build/components/Screens/Login.js +97 -126
- package/build/components/Search.js +114 -144
- package/build/components/Sidebar/Sidebar.Account.js +39 -46
- package/build/components/Sidebar/Sidebar.Button.js +45 -19
- package/build/components/Sidebar/Sidebar.Footer.js +8 -7
- package/build/components/Sidebar/Sidebar.Heading.js +11 -8
- package/build/components/Sidebar/Sidebar.Link.js +79 -44
- package/build/components/Sidebar/Sidebar.Menu.js +52 -28
- package/build/components/Sidebar/Sidebar.Notifications.js +107 -0
- package/build/components/Sidebar/Sidebar.js +207 -214
- package/build/components/Sidebar/SidebarContext.js +15 -0
- package/build/components/Sidebar/sidebarWidth.js +41 -0
- package/build/components/Sidebar/useSidebarWidthState.js +115 -0
- package/build/components/Skeleton.js +19 -20
- package/build/components/Spinner.js +18 -10
- package/build/components/Table.js +86 -50
- package/build/components/Tabs/Tabs.Panel.js +9 -5
- package/build/components/Tabs/Tabs.Tab.js +28 -23
- package/build/components/Tabs/Tabs.js +23 -23
- package/build/components/Tag.js +28 -23
- package/build/components/Tooltip.js +19 -5
- package/build/components/Utilities/Currency.js +49 -42
- package/build/components/Utilities/Number.js +14 -12
- package/build/components/Utilities/Phone.js +18 -12
- package/build/helpers/environment.js +10 -0
- package/build/helpers/flash.js +45 -46
- package/build/hooks/useIsMobile.js +8 -0
- package/build/hooks/useViewportHeight.js +6 -12
- package/build/icons/src/AnnounceIcon.js +3 -4
- package/build/icons/src/BellIcon.js +0 -1
- package/build/icons/src/CalendarIcon.js +0 -1
- package/build/icons/src/CheckIcon.js +0 -1
- package/build/icons/src/ChevronDownIcon.js +4 -5
- package/build/icons/src/ChevronLeftIcon.js +0 -1
- package/build/icons/src/ChevronRightIcon.js +0 -1
- package/build/icons/src/CircleNotch.js +0 -1
- package/build/icons/src/CloseIcon.js +11 -9
- package/build/icons/src/DownArrowIcon.js +0 -1
- package/build/icons/src/ImageIcon.js +0 -1
- package/build/icons/src/SearchIcon.js +4 -5
- package/build/icons/src/TrashIcon.js +0 -1
- package/build/icons/src/WarningDiamondIcon.js +0 -1
- package/build/icons/src/helpers/icon.js +5 -9
- package/build/icons/src/images/XolaLogoSimple.js +2 -3
- package/build/index.js +143 -130
- package/build/style.css +1 -0
- package/build/theme.css +76 -0
- package/build/theme.js +2 -0
- package/build/utils/currency.js +5 -5
- package/build/{helpers → utils}/date.js +17 -20
- package/build/utils/numbers.js +12 -12
- package/build/utils/phone.js +12 -14
- package/build/utils/userLocale.js +6 -0
- package/index.css +96 -4
- package/index.d.ts +204 -0
- package/package.json +87 -77
- package/skills/README.md +27 -0
- package/skills/migrate-2.6-to-3.7/SKILL.md +110 -0
- package/tailwind.config.js +5 -2
- package/build/base.css +0 -2
- package/build/components/Alert.d.ts +0 -18
- package/build/components/Animation/FadeIn.d.ts +0 -13
- package/build/components/Animation/SlideDown.d.ts +0 -6
- package/build/components/Avatar.d.ts +0 -16
- package/build/components/Badge.d.ts +0 -28
- package/build/components/Breadcrumb.d.ts +0 -21
- package/build/components/Breakdown.d.ts +0 -63
- package/build/components/Buttons/Button.d.ts +0 -53
- package/build/components/Buttons/ButtonGroup.d.ts +0 -35
- package/build/components/Buttons/SubmitButton.d.ts +0 -11
- package/build/components/Buttons/ToggleButton.d.ts +0 -21
- package/build/components/Charts/BaseChartOptions.d.ts +0 -136
- package/build/components/Charts/HistogramOptions.d.ts +0 -192
- package/build/components/Charts/PieOptions.d.ts +0 -177
- package/build/components/Counter.d.ts +0 -5
- package/build/components/DatePicker/DatePicker.d.ts +0 -41
- package/build/components/DatePicker/DatePicker.helpers.d.ts +0 -17
- package/build/components/DatePicker/DatePickerPopover.d.ts +0 -29
- package/build/components/DatePicker/Day.d.ts +0 -13
- package/build/components/DatePicker/LocalizedDayPicker.d.ts +0 -6
- package/build/components/DatePicker/MonthGrid.d.ts +0 -11
- package/build/components/DatePicker/MonthPicker.d.ts +0 -7
- package/build/components/DatePicker/MonthSelector.d.ts +0 -8
- package/build/components/DatePicker/MonthYearSelector.d.ts +0 -8
- package/build/components/DatePicker/NavbarElement.d.ts +0 -15
- package/build/components/DatePicker/RangeDatePicker.d.ts +0 -25
- package/build/components/DatePicker/RelativeDateRange.d.ts +0 -51
- package/build/components/DatePicker/UpcomingDatePicker.d.ts +0 -11
- package/build/components/Dot/Dot.d.ts +0 -24
- package/build/components/Dot/DotProgress.d.ts +0 -6
- package/build/components/Drawer.d.ts +0 -28
- package/build/components/Forms/BaseInput.d.ts +0 -20
- package/build/components/Forms/Checkbox.d.ts +0 -10
- package/build/components/Forms/ComboBox.d.ts +0 -8
- package/build/components/Forms/FormGroup.d.ts +0 -5
- package/build/components/Forms/InlineValuePopover.d.ts +0 -17
- package/build/components/Forms/Input.d.ts +0 -6
- package/build/components/Forms/Label.d.ts +0 -7
- package/build/components/Forms/RangeSlider.d.ts +0 -33
- package/build/components/Forms/Select.d.ts +0 -5
- package/build/components/Forms/Switch.d.ts +0 -46
- package/build/components/Forms/Textarea.d.ts +0 -6
- package/build/components/Forms/ValuePopoverText.d.ts +0 -6
- package/build/components/GooglePlacesAutocomplete.d.ts +0 -14
- package/build/components/HeaderToolbar.d.ts +0 -21
- package/build/components/ImageUpload.d.ts +0 -17
- package/build/components/Key.d.ts +0 -6
- package/build/components/Logo.d.ts +0 -19
- package/build/components/Modal.d.ts +0 -52
- package/build/components/Popover/Popover.d.ts +0 -20
- package/build/components/Popover/PopoverList.d.ts +0 -25
- package/build/components/Provider.d.ts +0 -18
- package/build/components/Screens/Login.d.ts +0 -25
- package/build/components/Search.d.ts +0 -16
- package/build/components/Sidebar/Sidebar.Account.d.ts +0 -13
- package/build/components/Sidebar/Sidebar.Button.d.ts +0 -10
- package/build/components/Sidebar/Sidebar.Footer.d.ts +0 -8
- package/build/components/Sidebar/Sidebar.Heading.d.ts +0 -10
- package/build/components/Sidebar/Sidebar.Link.d.ts +0 -24
- package/build/components/Sidebar/Sidebar.Menu.d.ts +0 -13
- package/build/components/Sidebar/Sidebar.d.ts +0 -58
- package/build/components/Sidebar/index.d.ts +0 -8
- package/build/components/Skeleton.d.ts +0 -13
- package/build/components/Spinner.d.ts +0 -26
- package/build/components/Table.d.ts +0 -59
- package/build/components/Tabs/Tabs.Panel.d.ts +0 -9
- package/build/components/Tabs/Tabs.Tab.d.ts +0 -19
- package/build/components/Tabs/Tabs.d.ts +0 -27
- package/build/components/Tabs/index.d.ts +0 -4
- package/build/components/Tag.d.ts +0 -25
- package/build/components/Tooltip.d.ts +0 -8
- package/build/components/Utilities/Currency.d.ts +0 -32
- package/build/components/Utilities/Number.d.ts +0 -8
- package/build/components/Utilities/Phone.d.ts +0 -8
- package/build/full.css +0 -2
- package/build/helpers/avatar.d.ts +0 -1
- package/build/helpers/avatar.js +0 -8
- package/build/helpers/browser.d.ts +0 -2
- package/build/helpers/children.d.ts +0 -3
- package/build/helpers/classnames.d.ts +0 -5
- package/build/helpers/currency.d.ts +0 -2
- package/build/helpers/currency.js +0 -11
- package/build/helpers/date.d.ts +0 -12
- package/build/helpers/flash.d.ts +0 -21
- package/build/helpers/numbers.d.ts +0 -4
- package/build/helpers/numbers.js +0 -23
- package/build/helpers/phone.d.ts +0 -11
- package/build/helpers/phone.js +0 -25
- package/build/hooks/useId.d.ts +0 -1
- package/build/hooks/useId.js +0 -9
- package/build/hooks/useIsClient.d.ts +0 -1
- package/build/hooks/useViewportHeight.d.ts +0 -1
- package/build/icons/src/helpers/classnames.js +0 -8
- package/build/index.d.ts +0 -66
- package/build/theme.d.ts +0 -413
- package/build/types/index.d.ts +0 -22
- package/build/types/migration.d.ts +0 -2
- package/build/ui-kit.css +0 -1
- package/build/utils/avatar.d.ts +0 -1
- package/build/utils/currency.d.ts +0 -2
- package/build/utils/index.d.ts +0 -4
- package/build/utils/numbers.d.ts +0 -4
- package/build/utils/phone.d.ts +0 -2
|
@@ -1,27 +1,31 @@
|
|
|
1
|
-
import
|
|
2
|
-
import l from "
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
1
|
+
import o from "dayjs";
|
|
2
|
+
import l from "prop-types";
|
|
3
|
+
import t from "react";
|
|
4
|
+
import s from "../../helpers/classnames.js";
|
|
5
|
+
const b = ({ value: m, upcomingDates: e, onChange: a, onMonthChange: i }) => /* @__PURE__ */ t.createElement("div", { className: "rounded-l-lg border-r border-gray pt-8" }, /* @__PURE__ */ t.createElement("p", { className: "mb-2 px-6 text-lg font-bold" }, "Upcoming"), (e == null ? void 0 : e.length) > 0 ? /* @__PURE__ */ t.createElement("div", { className: "mt-5" }, e == null ? void 0 : e.map((r) => {
|
|
6
|
+
const n = o(r).isSame(o(m), "day"), d = o(r).format();
|
|
7
|
+
return /* @__PURE__ */ t.createElement(
|
|
8
|
+
"div",
|
|
9
|
+
{
|
|
10
|
+
key: d,
|
|
11
|
+
className: s(
|
|
12
|
+
"mx-6 mt-3 flex min-w-40 cursor-pointer items-center justify-center",
|
|
13
|
+
"rounded border border-gray py-3 hover:border-blue hover:bg-blue hover:text-white",
|
|
14
|
+
{ "border-blue bg-blue text-white": n }
|
|
15
|
+
),
|
|
16
|
+
onClick: (c) => {
|
|
17
|
+
a(r, {}, c), i(r);
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
o(r).format("ddd DD MMMM")
|
|
21
|
+
);
|
|
22
|
+
})) : /* @__PURE__ */ t.createElement("div", { className: "mx-6 mt-7 max-w-40 items-center justify-center rounded bg-yellow-lighter p-3" }, "There is no future availability for this product."));
|
|
23
|
+
b.propTypes = {
|
|
24
|
+
value: l.objectOf(Date),
|
|
25
|
+
upcomingDates: l.arrayOf(Date).isRequired,
|
|
26
|
+
onChange: l.func.isRequired,
|
|
27
|
+
onMonthChange: l.func.isRequired
|
|
28
|
+
};
|
|
25
29
|
export {
|
|
26
|
-
|
|
30
|
+
b as UpcomingDatePicker
|
|
27
31
|
};
|
|
@@ -1,24 +1,29 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
1
|
+
import r from "prop-types";
|
|
2
|
+
import c from "react";
|
|
3
|
+
import t from "../../helpers/classnames.js";
|
|
4
|
+
const e = {
|
|
4
5
|
primary: "bg-primary",
|
|
5
6
|
secondary: "bg-secondary",
|
|
6
7
|
success: "bg-success",
|
|
7
8
|
warning: "bg-warning",
|
|
8
9
|
danger: "bg-danger",
|
|
9
10
|
caution: "bg-caution"
|
|
10
|
-
},
|
|
11
|
+
}, i = {
|
|
11
12
|
small: "h-1 w-1",
|
|
12
13
|
medium: "h-1.5 w-1.5",
|
|
13
14
|
large: "h-2 w-2",
|
|
14
15
|
xlarge: "h-8 w-8"
|
|
15
|
-
},
|
|
16
|
+
}, m = ({ color: o = "primary", size: s = "medium", className: n, ...a }) => /* @__PURE__ */ c.createElement(
|
|
16
17
|
"span",
|
|
17
18
|
{
|
|
18
|
-
className:
|
|
19
|
-
...
|
|
19
|
+
className: t("ui-dot", "inline-block rounded-full text-white", e[o], i[s], n),
|
|
20
|
+
...a
|
|
20
21
|
}
|
|
21
22
|
);
|
|
23
|
+
m.propTypes = {
|
|
24
|
+
className: r.string,
|
|
25
|
+
color: r.oneOf(Object.keys(e))
|
|
26
|
+
};
|
|
22
27
|
export {
|
|
23
|
-
|
|
28
|
+
m as Dot
|
|
24
29
|
};
|
|
@@ -1,10 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { range as i } from "lodash-es";
|
|
2
|
+
import t from "prop-types";
|
|
3
|
+
import m from "react";
|
|
4
|
+
import { Dot as n } from "./Dot.js";
|
|
5
|
+
const a = ({ current: e, total: r }) => r <= 1 ? null : /* @__PURE__ */ m.createElement("div", { className: "w-full space-x-2 text-center" }, i(0, r).map((o) => {
|
|
6
|
+
const s = e <= 0 ? 0 : e >= r ? e - 1 : e, p = o === s ? "primary" : "secondary";
|
|
7
|
+
return /* @__PURE__ */ m.createElement(n, { key: o, color: p, size: "medium" });
|
|
8
|
+
}));
|
|
9
|
+
a.propTypes = {
|
|
10
|
+
total: t.number.isRequired,
|
|
11
|
+
current: t.number.isRequired
|
|
12
|
+
};
|
|
8
13
|
export {
|
|
9
14
|
a as DotProgress
|
|
10
15
|
};
|
|
@@ -1,126 +1,134 @@
|
|
|
1
|
-
import { jsx as e, jsxs as n } from "react/jsx-runtime";
|
|
2
1
|
import { Transition as o, Dialog as s } from "@headlessui/react";
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import
|
|
2
|
+
import t from "prop-types";
|
|
3
|
+
import e, { forwardRef as g, Fragment as m } from "react";
|
|
4
|
+
import { isIosBrowser as v } from "../helpers/browser.js";
|
|
5
|
+
import r from "../helpers/classnames.js";
|
|
6
|
+
import { useViewportHeight as E } from "../hooks/useViewportHeight.js";
|
|
7
7
|
import { Button as b } from "./Buttons/Button.js";
|
|
8
|
-
import { CloseIcon as
|
|
9
|
-
const
|
|
8
|
+
import { CloseIcon as T } from "../icons/src/CloseIcon.js";
|
|
9
|
+
const N = {
|
|
10
10
|
small: "w-72",
|
|
11
11
|
medium: "w-85",
|
|
12
12
|
large: "w-110",
|
|
13
13
|
xl: "w-200",
|
|
14
14
|
"2xl": "w-screen md:max-w-screen-md 2xl:max-w-screen-lg"
|
|
15
15
|
// This was the old size
|
|
16
|
-
},
|
|
16
|
+
}, c = g(
|
|
17
17
|
({
|
|
18
|
-
isOpen:
|
|
19
|
-
title:
|
|
20
|
-
size:
|
|
21
|
-
content:
|
|
22
|
-
sideIndent:
|
|
23
|
-
|
|
24
|
-
classNames:
|
|
25
|
-
|
|
26
|
-
},
|
|
27
|
-
const d =
|
|
28
|
-
return /* @__PURE__ */ e(o.Root, { show:
|
|
18
|
+
isOpen: n = !1,
|
|
19
|
+
title: u,
|
|
20
|
+
size: x = "medium",
|
|
21
|
+
content: p,
|
|
22
|
+
sideIndent: w = 0,
|
|
23
|
+
onClose: i,
|
|
24
|
+
classNames: a = {},
|
|
25
|
+
position: l = "right"
|
|
26
|
+
}, h) => {
|
|
27
|
+
const d = E(), y = v();
|
|
28
|
+
return /* @__PURE__ */ e.createElement(o.Root, { ref: h, show: n, as: m }, /* @__PURE__ */ e.createElement(
|
|
29
29
|
s,
|
|
30
30
|
{
|
|
31
|
-
ref: w,
|
|
32
31
|
as: "div",
|
|
33
|
-
className:
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
32
|
+
className: r("ui-drawer fixed inset-0 z-10 overflow-hidden", a.dialog),
|
|
33
|
+
onClose: i
|
|
34
|
+
},
|
|
35
|
+
/* @__PURE__ */ e.createElement(
|
|
36
|
+
"div",
|
|
37
|
+
{
|
|
38
|
+
className: r(
|
|
39
|
+
"flex",
|
|
40
|
+
y ? `h-[${d}px] max-h-[${d}px] w-full` : "h-screen w-full"
|
|
41
|
+
)
|
|
42
|
+
},
|
|
43
|
+
/* @__PURE__ */ e.createElement(
|
|
44
|
+
o.Child,
|
|
38
45
|
{
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
leaveTo: "opacity-0",
|
|
54
|
-
children: /* @__PURE__ */ e(
|
|
55
|
-
s.Overlay,
|
|
56
|
-
{
|
|
57
|
-
className: l(
|
|
58
|
-
"absolute inset-0 bg-black bg-opacity-80 transition-opacity",
|
|
59
|
-
t.overlay
|
|
60
|
-
)
|
|
61
|
-
}
|
|
62
|
-
)
|
|
63
|
-
}
|
|
64
|
-
),
|
|
65
|
-
/* @__PURE__ */ e(
|
|
66
|
-
"div",
|
|
67
|
-
{
|
|
68
|
-
style: {
|
|
69
|
-
[r === "right" ? "right" : "left"]: `${x ?? 0}px`
|
|
70
|
-
},
|
|
71
|
-
className: l("fixed inset-y-0 flex max-w-full", t.dialogContent),
|
|
72
|
-
children: /* @__PURE__ */ e(
|
|
73
|
-
o.Child,
|
|
74
|
-
{
|
|
75
|
-
as: m,
|
|
76
|
-
enter: "transform transition ease-in-out duration-500 sm:duration-700",
|
|
77
|
-
enterFrom: r === "right" ? "translate-x-full" : "-translate-x-full",
|
|
78
|
-
enterTo: "translate-x-0",
|
|
79
|
-
leave: "transform transition ease-out-in duration-500 sm:duration-700",
|
|
80
|
-
leaveFrom: "translate-x-0",
|
|
81
|
-
leaveTo: r === "right" ? "translate-x-full" : "-translate-x-full",
|
|
82
|
-
children: /* @__PURE__ */ n("div", { className: "flex", children: [
|
|
83
|
-
r === "right" ? /* @__PURE__ */ e(c, { onClose: a }) : null,
|
|
84
|
-
/* @__PURE__ */ n(
|
|
85
|
-
"div",
|
|
86
|
-
{
|
|
87
|
-
className: l(
|
|
88
|
-
"flex h-full w-full flex-col overflow-y-auto bg-white px-4 py-8 shadow-xl sm:px-6",
|
|
89
|
-
T[u],
|
|
90
|
-
t.children
|
|
91
|
-
),
|
|
92
|
-
children: [
|
|
93
|
-
/* @__PURE__ */ e("div", { className: "w-full", children: /* @__PURE__ */ e(s.Title, { children: f }) }),
|
|
94
|
-
/* @__PURE__ */ e("div", { className: l("relative mt-3 flex-1", t.content), children: h })
|
|
95
|
-
]
|
|
96
|
-
}
|
|
97
|
-
),
|
|
98
|
-
r === "left" ? /* @__PURE__ */ e(c, { onClose: a }) : null
|
|
99
|
-
] })
|
|
100
|
-
}
|
|
101
|
-
)
|
|
102
|
-
}
|
|
46
|
+
as: m,
|
|
47
|
+
enter: "ease-out duration-500",
|
|
48
|
+
enterFrom: "opacity-0",
|
|
49
|
+
enterTo: "opacity-100",
|
|
50
|
+
leave: "ease-in duration-200",
|
|
51
|
+
leaveFrom: "opacity-100",
|
|
52
|
+
leaveTo: "opacity-0"
|
|
53
|
+
},
|
|
54
|
+
/* @__PURE__ */ e.createElement(
|
|
55
|
+
s.Overlay,
|
|
56
|
+
{
|
|
57
|
+
className: r(
|
|
58
|
+
"ui-drawer-overlay fixed inset-0 bg-black bg-opacity-80 transition-opacity",
|
|
59
|
+
a.overlay
|
|
103
60
|
)
|
|
104
|
-
|
|
105
|
-
|
|
61
|
+
}
|
|
62
|
+
)
|
|
63
|
+
),
|
|
64
|
+
/* @__PURE__ */ e.createElement(
|
|
65
|
+
"div",
|
|
66
|
+
{
|
|
67
|
+
style: {
|
|
68
|
+
[l === "right" ? "right" : "left"]: `${w ?? 0}px`
|
|
69
|
+
},
|
|
70
|
+
className: r(
|
|
71
|
+
"ui-drawer-container",
|
|
72
|
+
"fixed inset-y-0 flex max-w-full",
|
|
73
|
+
a.dialogContent
|
|
74
|
+
)
|
|
75
|
+
},
|
|
76
|
+
/* @__PURE__ */ e.createElement(
|
|
77
|
+
o.Child,
|
|
78
|
+
{
|
|
79
|
+
as: m,
|
|
80
|
+
enter: "ease-out duration-500",
|
|
81
|
+
enterFrom: l === "right" ? "translate-x-full" : "-translate-x-full",
|
|
82
|
+
enterTo: "translate-x-0",
|
|
83
|
+
leave: "transform transition ease-out-in duration-500",
|
|
84
|
+
leaveFrom: l === "right" ? "-translate-x-full" : "translate-x-full",
|
|
85
|
+
leaveTo: l === "right" ? "translate-x-full" : "-translate-x-full"
|
|
86
|
+
},
|
|
87
|
+
/* @__PURE__ */ e.createElement("div", { className: "flex" }, l === "right" ? /* @__PURE__ */ e.createElement(f, { onClose: i }) : null, /* @__PURE__ */ e.createElement(
|
|
88
|
+
"div",
|
|
89
|
+
{
|
|
90
|
+
className: r(
|
|
91
|
+
"flex h-full w-full flex-col overflow-y-auto bg-white px-4 py-8 shadow-xl sm:px-6",
|
|
92
|
+
N[x],
|
|
93
|
+
a.children
|
|
94
|
+
)
|
|
95
|
+
},
|
|
96
|
+
/* @__PURE__ */ e.createElement("div", { className: "ui-drawer-header w-full" }, /* @__PURE__ */ e.createElement(s.Title, null, u)),
|
|
97
|
+
/* @__PURE__ */ e.createElement("div", { className: r("ui-drawer-body relative mt-3 flex-1", a.content) }, p)
|
|
98
|
+
), l === "left" ? /* @__PURE__ */ e.createElement(f, { onClose: i }) : null)
|
|
99
|
+
)
|
|
106
100
|
)
|
|
107
|
-
|
|
108
|
-
)
|
|
101
|
+
)
|
|
102
|
+
));
|
|
109
103
|
}
|
|
110
|
-
)
|
|
111
|
-
F.displayName = "Drawer";
|
|
112
|
-
const c = ({ onClose: i }) => /* @__PURE__ */ e(
|
|
104
|
+
), f = ({ onClose: n }) => /* @__PURE__ */ e.createElement(
|
|
113
105
|
b,
|
|
114
106
|
{
|
|
115
107
|
size: "small",
|
|
116
108
|
variant: "link",
|
|
117
|
-
className:
|
|
109
|
+
className: r(
|
|
118
110
|
"m-2.5 inline-flex !h-10 !w-10 items-center justify-center !rounded-full bg-white !px-1.5 !text-black"
|
|
119
111
|
),
|
|
120
|
-
onClick:
|
|
121
|
-
|
|
122
|
-
}
|
|
112
|
+
onClick: n
|
|
113
|
+
},
|
|
114
|
+
/* @__PURE__ */ e.createElement(T, { size: "medium" })
|
|
123
115
|
);
|
|
116
|
+
c.displayName = "Drawer";
|
|
117
|
+
c.propTypes = {
|
|
118
|
+
isOpen: t.bool.isRequired,
|
|
119
|
+
title: t.oneOfType([t.arrayOf(t.node), t.node]),
|
|
120
|
+
content: t.oneOfType([t.arrayOf(t.node), t.node]).isRequired,
|
|
121
|
+
onClose: t.func.isRequired,
|
|
122
|
+
classNames: t.object,
|
|
123
|
+
position: t.string,
|
|
124
|
+
sideIndent: t.number
|
|
125
|
+
};
|
|
126
|
+
c.defaultProps = {
|
|
127
|
+
title: "",
|
|
128
|
+
classNames: {},
|
|
129
|
+
position: "right",
|
|
130
|
+
sideIndent: 0
|
|
131
|
+
};
|
|
124
132
|
export {
|
|
125
|
-
|
|
133
|
+
c as Drawer
|
|
126
134
|
};
|
|
@@ -1,41 +1,57 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import
|
|
5
|
-
import { Dot as
|
|
6
|
-
const
|
|
1
|
+
import { isString as l, isEmpty as n } from "lodash-es";
|
|
2
|
+
import e from "prop-types";
|
|
3
|
+
import s, { forwardRef as h } from "react";
|
|
4
|
+
import E from "../../helpers/classnames.js";
|
|
5
|
+
import { Dot as k } from "../Dot/Dot.js";
|
|
6
|
+
const p = {
|
|
7
7
|
small: "px-3 py-1.5 text-sm leading-sm",
|
|
8
|
+
// 30px
|
|
8
9
|
medium: "px-3 py-2.5 text-base leading-base",
|
|
10
|
+
// 40px
|
|
9
11
|
large: "px-5 py-3.5 text-md leading-md"
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
),
|
|
34
|
-
g && b && /* @__PURE__ */ s(h, { className: "absolute right-3", color: "danger" })
|
|
35
|
-
] });
|
|
12
|
+
// 50px
|
|
13
|
+
}, a = h(
|
|
14
|
+
({ as: m, size: d = "medium", isError: g, className: c, isRequired: f, value: r, prefix: i, suffix: o, ...u }, y) => {
|
|
15
|
+
const b = () => {
|
|
16
|
+
if (!l(r)) return;
|
|
17
|
+
let t = r;
|
|
18
|
+
return i && (t = t.replace(new RegExp(`^${i}`), "")), o && (t = t.replace(new RegExp(`${o}$`), "")), t.replaceAll(/[^.\S]+/g, "").replace(/[\p{Sc}]/u, "");
|
|
19
|
+
}, x = l(r) ? n(b()) : n(r == null ? void 0 : r.toString());
|
|
20
|
+
return /* @__PURE__ */ s.createElement("div", { className: "relative flex w-full items-center" }, /* @__PURE__ */ s.createElement(
|
|
21
|
+
m,
|
|
22
|
+
{
|
|
23
|
+
ref: y,
|
|
24
|
+
className: E(
|
|
25
|
+
"w-full rounded text-gray-darker placeholder-gray-dark hover:placeholder-gray-darker disabled:text-gray",
|
|
26
|
+
"border hover:border-black hover:bg-gray-lighter focus:text-black active:text-black disabled:bg-gray-lighter",
|
|
27
|
+
p[d],
|
|
28
|
+
g ? "!focus:border-danger !border-danger focus:ring-0 focus:ring-danger" : "border-gray-light focus:border-primary focus:ring-0 focus:ring-primary",
|
|
29
|
+
c
|
|
30
|
+
),
|
|
31
|
+
value: r,
|
|
32
|
+
...u
|
|
33
|
+
}
|
|
34
|
+
), f && x && /* @__PURE__ */ s.createElement(k, { className: "absolute right-3", color: "danger" }));
|
|
36
35
|
}
|
|
37
36
|
);
|
|
38
|
-
|
|
37
|
+
a.displayName = "BaseInput";
|
|
38
|
+
a.propTypes = {
|
|
39
|
+
as: e.oneOfType([e.string, e.elementType]),
|
|
40
|
+
size: e.oneOf(Object.keys(p)),
|
|
41
|
+
className: e.string,
|
|
42
|
+
isError: e.bool,
|
|
43
|
+
isRequired: e.bool,
|
|
44
|
+
value: e.oneOfType([e.string, e.number]),
|
|
45
|
+
prefix: e.string,
|
|
46
|
+
suffix: e.string
|
|
47
|
+
};
|
|
48
|
+
a.defaultProps = {
|
|
49
|
+
as: "input",
|
|
50
|
+
size: "medium",
|
|
51
|
+
className: "",
|
|
52
|
+
isError: !1,
|
|
53
|
+
isRequired: !1
|
|
54
|
+
};
|
|
39
55
|
export {
|
|
40
|
-
|
|
56
|
+
a as BaseInput
|
|
41
57
|
};
|
|
@@ -1,34 +1,37 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import e from "prop-types";
|
|
2
|
+
import r, { useId as n } from "react";
|
|
3
|
+
import t from "../../helpers/classnames.js";
|
|
4
4
|
import s from "./Checkbox.module.css.js";
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
return /* @__PURE__ */
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
5
|
+
const b = ({ label: o, className: l, classNames: c = {}, ...i }) => {
|
|
6
|
+
const a = n("checkbox");
|
|
7
|
+
return /* @__PURE__ */ r.createElement("div", { className: t("ui-checkbox", l, "flex items-center") }, /* @__PURE__ */ r.createElement(
|
|
8
|
+
"input",
|
|
9
|
+
{
|
|
10
|
+
type: "checkbox",
|
|
11
|
+
className: t(
|
|
12
|
+
"ui-checkbox-input",
|
|
13
|
+
c.checkbox,
|
|
14
|
+
s.checkbox,
|
|
15
|
+
"h-4 w-4 rounded !border-primary text-white transition-colors disabled:border-none disabled:bg-gray-light disabled:text-gray-light"
|
|
16
|
+
),
|
|
17
|
+
...i,
|
|
18
|
+
id: a
|
|
19
|
+
}
|
|
20
|
+
), o ? /* @__PURE__ */ r.createElement(
|
|
21
|
+
"label",
|
|
22
|
+
{
|
|
23
|
+
htmlFor: a,
|
|
24
|
+
className: t("ui-checkbox-label", c.label, "ml-2 leading-none text-gray-darker")
|
|
25
|
+
},
|
|
26
|
+
o
|
|
27
|
+
) : null);
|
|
28
|
+
};
|
|
29
|
+
b.propTypes = {
|
|
30
|
+
label: e.node.isRequired,
|
|
31
|
+
className: e.string,
|
|
32
|
+
classNames: e.shape({ checkbox: e.string, label: e.string }),
|
|
33
|
+
onChange: e.func
|
|
31
34
|
};
|
|
32
35
|
export {
|
|
33
|
-
|
|
36
|
+
b as Checkbox
|
|
34
37
|
};
|
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { Tooltip as
|
|
1
|
+
import n from "prop-types";
|
|
2
|
+
import o, { forwardRef as i, useRef as m, useState as f, useEffect as u } from "react";
|
|
3
|
+
import b, { components as p } from "react-select";
|
|
4
|
+
import d from "react-select/creatable";
|
|
5
|
+
import x from "../../helpers/classnames.js";
|
|
6
|
+
import { Tooltip as E } from "../Tooltip.js";
|
|
7
7
|
/* empty css */
|
|
8
|
-
const
|
|
9
|
-
e ?
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
classNamePrefix: "ui-combo-box",
|
|
13
|
-
components: e ? {
|
|
14
|
-
IndicatorsContainer: () => null,
|
|
15
|
-
Menu: () => null,
|
|
16
|
-
MultiValueLabel: h
|
|
17
|
-
} : void 0,
|
|
18
|
-
...n
|
|
19
|
-
}
|
|
20
|
-
), { MultiValueLabel: p } = u, h = (e) => {
|
|
21
|
-
const t = i(null), [l, n] = c(!0);
|
|
22
|
-
return s(() => {
|
|
23
|
-
var r;
|
|
24
|
-
if ((r = t.current) != null && r.offsetParent) {
|
|
25
|
-
const a = t.current.offsetWidth > t.current.offsetParent.clientWidth;
|
|
26
|
-
n(!a);
|
|
27
|
-
}
|
|
28
|
-
}, [e.data.label]), /* @__PURE__ */ o(p, { ...e, children: /* @__PURE__ */ o(
|
|
29
|
-
b,
|
|
8
|
+
const s = i(({ isCreatable: e = !1, className: t = "", isError: l = !1, ...r }, a) => {
|
|
9
|
+
const c = e ? d : b;
|
|
10
|
+
return /* @__PURE__ */ o.createElement(
|
|
11
|
+
c,
|
|
30
12
|
{
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
13
|
+
ref: a,
|
|
14
|
+
className: x("ui-combo-box", l && "border-danger", t),
|
|
15
|
+
classNamePrefix: "ui-combo-box",
|
|
16
|
+
components: e ? {
|
|
17
|
+
IndicatorsContainer: () => null,
|
|
18
|
+
Menu: () => null,
|
|
19
|
+
MultiValueLabel: y
|
|
20
|
+
} : null,
|
|
21
|
+
...r
|
|
22
|
+
}
|
|
23
|
+
);
|
|
24
|
+
});
|
|
25
|
+
s.displayName = "ComboBox";
|
|
26
|
+
const { MultiValueLabel: T } = p, y = (e) => {
|
|
27
|
+
const t = m(null), [l, r] = f(!0);
|
|
28
|
+
return u(() => {
|
|
29
|
+
if (t.current) {
|
|
30
|
+
const a = t.current.offsetWidth > t.current.offsetParent.offsetWidth;
|
|
31
|
+
r(!a);
|
|
36
32
|
}
|
|
37
|
-
) });
|
|
33
|
+
}, [e.data.label]), /* @__PURE__ */ o.createElement(T, { ...e }, /* @__PURE__ */ o.createElement(E, { disabled: l, maxWidth: "none", content: /* @__PURE__ */ o.createElement("span", null, e.data.label) }, /* @__PURE__ */ o.createElement("span", { ref: t }, e.data.label)));
|
|
34
|
+
};
|
|
35
|
+
s.propTypes = {
|
|
36
|
+
className: n.string,
|
|
37
|
+
isError: n.bool
|
|
38
38
|
};
|
|
39
39
|
export {
|
|
40
|
-
|
|
40
|
+
s as ComboBox
|
|
41
41
|
};
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import m from "prop-types";
|
|
2
|
+
import e from "react";
|
|
2
3
|
import p from "../../helpers/classnames.js";
|
|
3
|
-
const
|
|
4
|
+
const t = ({ className: r, ...o }) => /* @__PURE__ */ e.createElement("div", { className: p("ui-form-group", "mb-4", r), ...o });
|
|
5
|
+
t.propTypes = {
|
|
6
|
+
className: m.string
|
|
7
|
+
};
|
|
4
8
|
export {
|
|
5
|
-
|
|
9
|
+
t as FormGroup
|
|
6
10
|
};
|