@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
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { Transition as n, Dialog as h } from "@headlessui/react";
|
|
2
|
+
import s from "clsx";
|
|
3
|
+
import { noop as g } from "lodash-es";
|
|
4
|
+
import t from "prop-types";
|
|
5
|
+
import e, { Fragment as m } from "react";
|
|
6
|
+
import { isIosBrowser as v } from "../helpers/browser.js";
|
|
7
|
+
import { useViewportHeight as N } from "../hooks/useViewportHeight.js";
|
|
8
|
+
import { CloseIcon as E } from "../icons/src/CloseIcon.js";
|
|
9
|
+
const l = ({
|
|
10
|
+
isOpen: a = !1,
|
|
11
|
+
// Configurable: when true, tapping the dark overlay closes the sheet. Default false keeps parity
|
|
12
|
+
// with Modal. Closing is wired to the overlay's own onClick (not the Dialog's built-in
|
|
13
|
+
// outside-click) so interacting with popovers portaled outside the sheet — the DatePicker
|
|
14
|
+
// calendar, the ComboBox menu — is never mistaken for an outside click.
|
|
15
|
+
shouldCloseOnOutsideClick: o = !1,
|
|
16
|
+
onClose: r,
|
|
17
|
+
children: i,
|
|
18
|
+
className: y
|
|
19
|
+
}) => {
|
|
20
|
+
const u = N(), f = v(), x = () => {
|
|
21
|
+
o && r();
|
|
22
|
+
}, b = f && u ? { maxHeight: `${Math.round(u * 0.9)}px` } : void 0;
|
|
23
|
+
return /* @__PURE__ */ e.createElement(n, { appear: !0, show: a, as: m }, /* @__PURE__ */ e.createElement(h, { as: "div", className: "ui-bottom-sheet fixed inset-0 z-30", onClose: g }, /* @__PURE__ */ e.createElement(
|
|
24
|
+
n.Child,
|
|
25
|
+
{
|
|
26
|
+
as: m,
|
|
27
|
+
enter: "ease-out duration-300",
|
|
28
|
+
enterFrom: "opacity-0",
|
|
29
|
+
enterTo: "opacity-100",
|
|
30
|
+
leave: "ease-in duration-200",
|
|
31
|
+
leaveFrom: "opacity-100",
|
|
32
|
+
leaveTo: "opacity-0"
|
|
33
|
+
},
|
|
34
|
+
/* @__PURE__ */ e.createElement(
|
|
35
|
+
"div",
|
|
36
|
+
{
|
|
37
|
+
className: "ui-bottom-sheet-overlay fixed inset-0 bg-black bg-opacity-80 transition-opacity",
|
|
38
|
+
"aria-hidden": "true",
|
|
39
|
+
onClick: x
|
|
40
|
+
}
|
|
41
|
+
)
|
|
42
|
+
), /* @__PURE__ */ e.createElement(
|
|
43
|
+
n.Child,
|
|
44
|
+
{
|
|
45
|
+
as: m,
|
|
46
|
+
enter: "transform transition ease-out duration-300",
|
|
47
|
+
enterFrom: "translate-y-full",
|
|
48
|
+
enterTo: "translate-y-0",
|
|
49
|
+
leave: "transform transition ease-in duration-200",
|
|
50
|
+
leaveFrom: "translate-y-0",
|
|
51
|
+
leaveTo: "translate-y-full"
|
|
52
|
+
},
|
|
53
|
+
/* @__PURE__ */ e.createElement(
|
|
54
|
+
"div",
|
|
55
|
+
{
|
|
56
|
+
style: b,
|
|
57
|
+
className: s(
|
|
58
|
+
y,
|
|
59
|
+
"ui-bottom-sheet-panel fixed inset-x-0 bottom-0 flex max-h-[90dvh] w-full flex-col rounded-t-2xl bg-white px-6 pb-8 pt-6 text-left shadow-xl"
|
|
60
|
+
)
|
|
61
|
+
},
|
|
62
|
+
/* @__PURE__ */ e.createElement(
|
|
63
|
+
"button",
|
|
64
|
+
{
|
|
65
|
+
type: "button",
|
|
66
|
+
"aria-label": "Close",
|
|
67
|
+
className: "absolute right-4 top-4 z-10 p-1 text-black hover:text-gray-darker",
|
|
68
|
+
onClick: () => r()
|
|
69
|
+
},
|
|
70
|
+
/* @__PURE__ */ e.createElement(E, null)
|
|
71
|
+
),
|
|
72
|
+
i
|
|
73
|
+
)
|
|
74
|
+
)));
|
|
75
|
+
};
|
|
76
|
+
l.propTypes = {
|
|
77
|
+
isOpen: t.bool.isRequired,
|
|
78
|
+
shouldCloseOnOutsideClick: t.bool,
|
|
79
|
+
onClose: t.func.isRequired,
|
|
80
|
+
children: t.node.isRequired,
|
|
81
|
+
className: t.string
|
|
82
|
+
};
|
|
83
|
+
const c = ({ children: a, description: o, className: r, ...i }) => /* @__PURE__ */ e.createElement(
|
|
84
|
+
h.Title,
|
|
85
|
+
{
|
|
86
|
+
as: "div",
|
|
87
|
+
className: s(r, "ui-bottom-sheet-header shrink-0 px-8 text-center"),
|
|
88
|
+
...i
|
|
89
|
+
},
|
|
90
|
+
/* @__PURE__ */ e.createElement("h3", { className: "text-2xl font-semibold leading-6 text-black" }, a),
|
|
91
|
+
o ? /* @__PURE__ */ e.createElement("p", { className: "mt-2 text-base font-normal leading-normal text-gray-darker" }, o) : null
|
|
92
|
+
);
|
|
93
|
+
c.propTypes = {
|
|
94
|
+
children: t.node.isRequired,
|
|
95
|
+
description: t.string,
|
|
96
|
+
className: t.string
|
|
97
|
+
};
|
|
98
|
+
c.displayName = "BottomSheet.Header";
|
|
99
|
+
l.Header = c;
|
|
100
|
+
const d = ({ className: a, ...o }) => /* @__PURE__ */ e.createElement("div", { className: s(a, "ui-bottom-sheet-body mt-6 min-h-0 overflow-y-auto"), ...o });
|
|
101
|
+
d.propTypes = {
|
|
102
|
+
className: t.string
|
|
103
|
+
};
|
|
104
|
+
d.displayName = "BottomSheet.Body";
|
|
105
|
+
l.Body = d;
|
|
106
|
+
const p = ({ className: a, ...o }) => /* @__PURE__ */ e.createElement("div", { className: s(a, "ui-bottom-sheet-footer mt-6 flex shrink-0 gap-3 [&>*]:flex-1"), ...o });
|
|
107
|
+
p.propTypes = {
|
|
108
|
+
className: t.string
|
|
109
|
+
};
|
|
110
|
+
p.displayName = "BottomSheet.Footer";
|
|
111
|
+
l.Footer = p;
|
|
112
|
+
export {
|
|
113
|
+
l as BottomSheet
|
|
114
|
+
};
|
|
@@ -1,27 +1,33 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { Children as
|
|
1
|
+
import e from "prop-types";
|
|
2
|
+
import r, { Children as i } from "react";
|
|
3
3
|
import a from "../helpers/classnames.js";
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
return /* @__PURE__ */
|
|
7
|
-
const
|
|
8
|
-
return /* @__PURE__ */
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
4
|
+
const n = ({ className: m, classNames: t = {}, separator: s = "/", children: c, ...l }) => {
|
|
5
|
+
const p = i.count(c) - 1;
|
|
6
|
+
return /* @__PURE__ */ r.createElement("div", { className: a("ui-breadcrumb", "whitespace-nowrap text-2xl font-semibold", m), ...l }, i.map(c, (d, u) => {
|
|
7
|
+
const o = u >= p;
|
|
8
|
+
return /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement("span", { className: a(t.item, o ? "text-black" : "text-gray-dark") }, d), o ? null : /* @__PURE__ */ r.createElement("span", { className: a(t.separator, "mx-2 text-gray-dark") }, s));
|
|
9
|
+
}));
|
|
10
|
+
};
|
|
11
|
+
n.propTypes = {
|
|
12
|
+
className: e.string,
|
|
13
|
+
classNames: e.object,
|
|
14
|
+
separator: e.string,
|
|
15
|
+
children: e.oneOfType([e.arrayOf(e.node), e.node])
|
|
16
|
+
};
|
|
17
|
+
n.Item = ({ className: m, onClick: t, children: s }) => /* @__PURE__ */ r.createElement(
|
|
14
18
|
"div",
|
|
15
19
|
{
|
|
16
|
-
className: a("ui-breadcrumb-item inline",
|
|
17
|
-
onClick:
|
|
18
|
-
|
|
19
|
-
|
|
20
|
+
className: a("ui-breadcrumb-item inline", t && "cursor-pointer hover:underline", m),
|
|
21
|
+
onClick: t
|
|
22
|
+
},
|
|
23
|
+
s
|
|
20
24
|
);
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
+
n.Item.displayName = "Breadcrumb.Item";
|
|
26
|
+
n.Item.propTypes = {
|
|
27
|
+
className: e.string,
|
|
28
|
+
onClick: e.func,
|
|
29
|
+
children: e.node.isRequired
|
|
30
|
+
};
|
|
25
31
|
export {
|
|
26
|
-
|
|
32
|
+
n as Breadcrumb
|
|
27
33
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import { useMemo as
|
|
4
|
-
import
|
|
5
|
-
import { Currency as
|
|
6
|
-
const
|
|
1
|
+
import { isNumber as N } from "lodash-es";
|
|
2
|
+
import t from "prop-types";
|
|
3
|
+
import e, { useMemo as x, createContext as S, useContext as y } from "react";
|
|
4
|
+
import a from "../helpers/classnames.js";
|
|
5
|
+
import { Currency as w } from "./Utilities/Currency.js";
|
|
6
|
+
const p = {
|
|
7
7
|
default: "text-gray-darker",
|
|
8
8
|
black: "text-black",
|
|
9
9
|
primary: "text-primary",
|
|
@@ -12,78 +12,70 @@ const w = {
|
|
|
12
12
|
success: "text-success",
|
|
13
13
|
danger: "text-danger",
|
|
14
14
|
caution: "text-caution"
|
|
15
|
-
},
|
|
16
|
-
const
|
|
17
|
-
return /* @__PURE__ */ e(
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
15
|
+
}, b = S(), s = ({ children: r, className: o, currency: l, locale: n, ...c }) => {
|
|
16
|
+
const d = x(() => ({ currency: l, locale: n }), [l, n]);
|
|
17
|
+
return /* @__PURE__ */ e.createElement(b.Provider, { value: d }, /* @__PURE__ */ e.createElement("table", { className: a("ui-breakdown", "w-full", o), ...c }, /* @__PURE__ */ e.createElement("tbody", null, r)));
|
|
18
|
+
};
|
|
19
|
+
s.propTypes = {
|
|
20
|
+
children: t.node,
|
|
21
|
+
className: t.string,
|
|
22
|
+
currency: t.string.isRequired,
|
|
23
|
+
locale: t.string
|
|
24
|
+
};
|
|
25
|
+
const k = ({
|
|
26
|
+
info: r,
|
|
27
|
+
methodIcon: o,
|
|
28
|
+
secondary: l,
|
|
29
|
+
value: n,
|
|
30
|
+
color: c = "default",
|
|
31
|
+
className: d,
|
|
32
|
+
classNames: m = { key: "", children: "", info: "", value: "" },
|
|
24
33
|
children: i,
|
|
25
|
-
|
|
26
|
-
className: o,
|
|
27
|
-
...p
|
|
34
|
+
...u
|
|
28
35
|
}) => {
|
|
29
|
-
const
|
|
30
|
-
return /* @__PURE__ */
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
{
|
|
42
|
-
shouldRemoveTrailingZeroes: !1,
|
|
43
|
-
currency: g,
|
|
44
|
-
locale: x,
|
|
45
|
-
compact: void 0,
|
|
46
|
-
isNarrowSymbolForm: void 0,
|
|
47
|
-
children: c
|
|
48
|
-
}
|
|
49
|
-
) : /* @__PURE__ */ e("span", { children: c }) })
|
|
50
|
-
] });
|
|
36
|
+
const { currency: h, locale: E } = y(b) ?? {};
|
|
37
|
+
return /* @__PURE__ */ e.createElement("tr", { className: a("ui-breakdown-item", p[c], d), ...u }, /* @__PURE__ */ e.createElement("td", { colSpan: 2, className: a("break-words text-left leading-none", m.key) }, /* @__PURE__ */ e.createElement("span", { className: "mr-0.5" }, o), /* @__PURE__ */ e.createElement("span", { className: a("mr-1 break-normal md:break-all", m.children) }, i ?? ""), /* @__PURE__ */ e.createElement("span", { className: a("text-sm", m.info) }, r && /* @__PURE__ */ e.createElement("span", { className: "mr-2 rounded bg-white p-1 uppercase text-black empty:hidden" }, r), l && /* @__PURE__ */ e.createElement("span", { className: "empty:hidden" }, l))), /* @__PURE__ */ e.createElement("td", { className: a("w-[1%] whitespace-nowrap pl-4 text-right", m.value) }, N(n) ? /* @__PURE__ */ e.createElement(w, { shouldRemoveTrailingZeroes: !1, currency: h, locale: E }, n) : /* @__PURE__ */ e.createElement("span", null, n)));
|
|
38
|
+
};
|
|
39
|
+
k.propTypes = {
|
|
40
|
+
children: t.node,
|
|
41
|
+
info: t.node,
|
|
42
|
+
methodIcon: t.node,
|
|
43
|
+
secondary: t.node,
|
|
44
|
+
value: t.node,
|
|
45
|
+
className: t.string,
|
|
46
|
+
classNames: t.object,
|
|
47
|
+
color: t.oneOf(Object.keys(p))
|
|
51
48
|
};
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
49
|
+
s.Item = k;
|
|
50
|
+
s.Item.displayName = "Breakdown.Item";
|
|
51
|
+
const f = ({
|
|
52
|
+
info: r,
|
|
53
|
+
value: o,
|
|
54
|
+
color: l = "black",
|
|
55
|
+
className: n,
|
|
56
|
+
classNames: c = { children: "", info: "", value: "" },
|
|
57
|
+
children: d,
|
|
58
|
+
...m
|
|
61
59
|
}) => {
|
|
62
|
-
const
|
|
63
|
-
return /* @__PURE__ */
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
60
|
+
const { currency: i, locale: u } = y(b) ?? {};
|
|
61
|
+
return /* @__PURE__ */ e.createElement("tr", { className: a("ui-breakdown-subtotal-item", "font-bold", p[l], n), ...m }, /* @__PURE__ */ e.createElement("td", { className: a("pt-1 pb-4 text-left", c.children) }, d), /* @__PURE__ */ e.createElement("td", { className: a("whitespace-nowrap pt-1 pb-4 text-right", c.info) }, r), /* @__PURE__ */ e.createElement("td", { className: a("w-[1%] whitespace-nowrap pt-1 pb-4 pl-4 text-right", c.value) }, /* @__PURE__ */ e.createElement(w, { shouldRemoveTrailingZeroes: !1, currency: i, locale: u }, o)));
|
|
62
|
+
};
|
|
63
|
+
f.propTypes = {
|
|
64
|
+
children: t.node,
|
|
65
|
+
info: t.node,
|
|
66
|
+
value: t.node,
|
|
67
|
+
className: t.string,
|
|
68
|
+
classNames: t.object,
|
|
69
|
+
color: t.oneOf(Object.keys(p))
|
|
70
|
+
};
|
|
71
|
+
s.SubtotalItem = f;
|
|
72
|
+
s.SubtotalItem.displayName = "Breakdown.SubtotalItem";
|
|
73
|
+
const g = ({ className: r, ...o }) => /* @__PURE__ */ e.createElement("tr", { className: a("ui-breakdown-separator", r), ...o }, /* @__PURE__ */ e.createElement("td", { colSpan: 3, className: "border-b border-gray-light pb-1" }));
|
|
74
|
+
g.propTypes = {
|
|
75
|
+
className: t.string
|
|
78
76
|
};
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
N.displayName = "Breakdown.Separator";
|
|
82
|
-
const T = Object.assign(B, {
|
|
83
|
-
Item: k,
|
|
84
|
-
SubtotalItem: y,
|
|
85
|
-
Separator: N
|
|
86
|
-
});
|
|
77
|
+
s.Separator = g;
|
|
78
|
+
s.Separator.displayName = "Breakdown.Separator";
|
|
87
79
|
export {
|
|
88
|
-
|
|
80
|
+
s as Breakdown
|
|
89
81
|
};
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
1
|
+
import e from "prop-types";
|
|
2
|
+
import i from "react";
|
|
3
|
+
import m from "../../helpers/classnames.js";
|
|
4
|
+
const n = {
|
|
4
5
|
standard: {
|
|
5
6
|
common: "border-transparent text-white",
|
|
6
7
|
// Common classes for each style
|
|
7
|
-
primary: "bg-primary hover:bg-primary-darker
|
|
8
|
-
secondary: "bg-secondary text-white hover:bg-secondary-dark
|
|
9
|
-
success: "bg-success hover:bg-success-dark
|
|
10
|
-
warning: "bg-warning hover:bg-warning-dark
|
|
11
|
-
caution: "bg-caution hover:bg-caution-dark
|
|
12
|
-
danger: "bg-danger hover:bg-danger-dark
|
|
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"
|
|
13
14
|
},
|
|
14
15
|
outline: {
|
|
15
16
|
common: "bg-white border hover:bg-white active:text-white",
|
|
@@ -31,7 +32,7 @@ const m = {
|
|
|
31
32
|
caution: "text-caution",
|
|
32
33
|
danger: "text-danger"
|
|
33
34
|
}
|
|
34
|
-
},
|
|
35
|
+
}, c = {
|
|
35
36
|
tiny: "px-2 py-0.5 text-xs leading-xs",
|
|
36
37
|
// 20px
|
|
37
38
|
small: "px-3 py-2 h-7.5 text-sm leading-sm",
|
|
@@ -40,44 +41,49 @@ const m = {
|
|
|
40
41
|
// 40px
|
|
41
42
|
large: "px-6 py-4 h-[50px] text-md leading-md"
|
|
42
43
|
// 50px
|
|
43
|
-
},
|
|
44
|
-
as:
|
|
45
|
-
variant:
|
|
46
|
-
color:
|
|
44
|
+
}, u = ({
|
|
45
|
+
as: r = "button",
|
|
46
|
+
variant: t = "standard",
|
|
47
|
+
color: s = "primary",
|
|
47
48
|
size: d = "medium",
|
|
48
|
-
icon:
|
|
49
|
-
iconPlacement:
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
...
|
|
53
|
-
}) =>
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
)
|
|
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
|
|
79
85
|
};
|
|
80
86
|
export {
|
|
81
|
-
|
|
82
|
-
|
|
87
|
+
u as Button,
|
|
88
|
+
n as colors
|
|
83
89
|
};
|
|
@@ -1,55 +1,58 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
const
|
|
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
5
|
small: "px-2 py-1.5 text-sm",
|
|
6
6
|
medium: "py-3 px-2.5 text-base",
|
|
7
7
|
large: "px-4 py-3.5 text-lg"
|
|
8
|
-
},
|
|
9
|
-
size:
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
as:
|
|
23
|
-
isActive:
|
|
24
|
-
shouldShowText:
|
|
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
25
|
/* eslint-disable-next-line @typescript-eslint/no-unused-vars */
|
|
26
|
-
isHidden:
|
|
26
|
+
isHidden: d = !1,
|
|
27
27
|
size: u = "medium",
|
|
28
28
|
icon: t,
|
|
29
29
|
iconPlacement: n = "left",
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
className: i,
|
|
31
|
+
children: s,
|
|
32
32
|
...o
|
|
33
33
|
}) => {
|
|
34
|
-
const
|
|
35
|
-
delete l.isActive, delete l.shouldShowText, delete l.isHidden;
|
|
36
|
-
const b = m(
|
|
34
|
+
const g = f(
|
|
37
35
|
"ui-button-group-button",
|
|
38
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",
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
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
|
|
42
40
|
);
|
|
43
|
-
return /* @__PURE__ */
|
|
44
|
-
t && n === "left" ? /* @__PURE__ */ d("span", { className: "mr-2 flex-shrink-0", children: t }) : null,
|
|
45
|
-
a ? r : t ? null : r,
|
|
46
|
-
t && n === "right" ? /* @__PURE__ */ d("span", { className: "ml-2 flex-shrink-0", children: t }) : null
|
|
47
|
-
] });
|
|
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);
|
|
48
42
|
};
|
|
49
43
|
c.displayName = "ButtonGroup.Button";
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
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;
|
|
53
56
|
export {
|
|
54
|
-
|
|
57
|
+
b as ButtonGroup
|
|
55
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
|
+
};
|