@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,86 +1,83 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { useRef as
|
|
1
|
+
import t from "prop-types";
|
|
2
|
+
import e, { useRef as I, useState as B } from "react";
|
|
3
3
|
import g from "../helpers/classnames.js";
|
|
4
|
-
import { Button as
|
|
4
|
+
import { Button as T } from "./Buttons/Button.js";
|
|
5
5
|
import { SubmitButton as u } from "./Buttons/SubmitButton.js";
|
|
6
|
-
import { Logo as
|
|
7
|
-
import { ImageIcon as
|
|
8
|
-
import { TrashIcon as
|
|
9
|
-
const
|
|
10
|
-
src:
|
|
11
|
-
size:
|
|
12
|
-
isLoading:
|
|
13
|
-
maxSize:
|
|
14
|
-
hasDelete:
|
|
15
|
-
requirements:
|
|
16
|
-
caption:
|
|
17
|
-
csvAcceptFormats:
|
|
18
|
-
onChange:
|
|
19
|
-
onDelete:
|
|
20
|
-
onError:
|
|
21
|
-
...
|
|
6
|
+
import { Logo as h } from "./Logo.js";
|
|
7
|
+
import { ImageIcon as U } from "../icons/src/ImageIcon.js";
|
|
8
|
+
import { TrashIcon as w } from "../icons/src/TrashIcon.js";
|
|
9
|
+
const D = ({
|
|
10
|
+
src: o,
|
|
11
|
+
size: c = "large",
|
|
12
|
+
isLoading: n = !1,
|
|
13
|
+
maxSize: r = 5,
|
|
14
|
+
hasDelete: s = !0,
|
|
15
|
+
requirements: l = null,
|
|
16
|
+
caption: a = null,
|
|
17
|
+
csvAcceptFormats: E = "image/png,image/jpeg,image/webp",
|
|
18
|
+
onChange: y,
|
|
19
|
+
onDelete: b,
|
|
20
|
+
onError: x,
|
|
21
|
+
...N
|
|
22
22
|
}) => {
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
C(`Image size shouldn't exceed ${o}MB`);
|
|
31
|
-
return;
|
|
32
|
-
}
|
|
33
|
-
N(i);
|
|
23
|
+
const i = I(), [m, v] = B(0), d = () => {
|
|
24
|
+
i.current.click();
|
|
25
|
+
}, C = (P) => {
|
|
26
|
+
const [f] = P.target.files;
|
|
27
|
+
if (r && 1048576 * r < f.size) {
|
|
28
|
+
x(`Image size shouldn't exceed ${r}MB`);
|
|
29
|
+
return;
|
|
34
30
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
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
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
31
|
+
y(f);
|
|
32
|
+
}, k = () => {
|
|
33
|
+
v(m + 1), b();
|
|
34
|
+
}, R = typeof l == "string" ? (l == null ? void 0 : l.trim().length) > 0 : !!l, p = a ? a.trim().length > 0 : !1;
|
|
35
|
+
return /* @__PURE__ */ e.createElement("div", { className: g("flex items-center rounded bg-gray-lighter p-4", s ? "space-x-2" : "space-x-3") }, /* @__PURE__ */ e.createElement("div", null, o ? /* @__PURE__ */ e.createElement(h, { src: o, size: c }) : /* @__PURE__ */ e.createElement(
|
|
36
|
+
"div",
|
|
37
|
+
{
|
|
38
|
+
className: g(
|
|
39
|
+
h.sizes[c],
|
|
40
|
+
"flex items-center justify-center rounded border border-gray-light"
|
|
41
|
+
)
|
|
42
|
+
},
|
|
43
|
+
/* @__PURE__ */ e.createElement(U, { size: "large", className: "text-gray" })
|
|
44
|
+
)), /* @__PURE__ */ e.createElement("div", { className: "flex flex-col space-y-2" }, /* @__PURE__ */ e.createElement("div", { className: "space-x-2" }, s ? /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement(
|
|
45
|
+
T,
|
|
46
|
+
{
|
|
47
|
+
variant: "outline",
|
|
48
|
+
color: "secondary",
|
|
49
|
+
icon: /* @__PURE__ */ e.createElement(w, null),
|
|
50
|
+
disabled: n,
|
|
51
|
+
onClick: k
|
|
52
|
+
},
|
|
53
|
+
"Delete"
|
|
54
|
+
), /* @__PURE__ */ e.createElement(u, { disabled: n, isLoading: n, onClick: d }, p ? a.trim() : "Upload New Photo")) : /* @__PURE__ */ e.createElement(u, { disabled: n, isLoading: n, onClick: d }, p ? a.trim() : o ? "Replace Photo" : "Upload New Photo")), /* @__PURE__ */ e.createElement(
|
|
55
|
+
"input",
|
|
56
|
+
{
|
|
57
|
+
key: m,
|
|
58
|
+
ref: i,
|
|
59
|
+
className: "hidden",
|
|
60
|
+
type: "file",
|
|
61
|
+
multiple: !1,
|
|
62
|
+
accept: E,
|
|
63
|
+
onChange: C,
|
|
64
|
+
...N
|
|
65
|
+
}
|
|
66
|
+
), /* @__PURE__ */ e.createElement("div", { className: "text-xs text-gray-darker" }, R ? l : /* @__PURE__ */ e.createElement("div", null, "Check that the image is in PNG, JPG or WebP format", r ? ` and does not exceed ${r}MB` : ""))));
|
|
67
|
+
};
|
|
68
|
+
D.propTypes = {
|
|
69
|
+
src: t.string,
|
|
70
|
+
size: t.oneOf(["small", "medium", "large"]),
|
|
71
|
+
isLoading: t.bool,
|
|
72
|
+
maxSize: t.number,
|
|
73
|
+
hasDelete: t.bool,
|
|
74
|
+
caption: t.string,
|
|
75
|
+
requirements: t.oneOfType([t.node, t.string]),
|
|
76
|
+
csvAcceptFormats: t.string,
|
|
77
|
+
onChange: t.func.isRequired,
|
|
78
|
+
onDelete: t.func.isRequired,
|
|
79
|
+
onError: t.func.isRequired
|
|
83
80
|
};
|
|
84
81
|
export {
|
|
85
|
-
|
|
82
|
+
D as ImageUpload
|
|
86
83
|
};
|
package/build/components/Key.js
CHANGED
|
@@ -1,28 +1,33 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import o from "prop-types";
|
|
2
|
+
import s from "react";
|
|
3
3
|
import c from "../helpers/classnames.js";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
up: "↑",
|
|
9
|
-
down: "↓"
|
|
10
|
-
}, y = ({ char: e, className: n, ...o }) => {
|
|
11
|
-
const r = l[e] ?? e;
|
|
12
|
-
return /* @__PURE__ */ i(
|
|
4
|
+
import { isOSX as t } from "../helpers/browser.js";
|
|
5
|
+
const p = ({ char: e, className: n, ...i }) => {
|
|
6
|
+
const r = m[e] ?? e;
|
|
7
|
+
return /* @__PURE__ */ s.createElement(
|
|
13
8
|
"div",
|
|
14
9
|
{
|
|
15
10
|
className: c(
|
|
16
11
|
"ui-key",
|
|
17
|
-
"no-translate inline-flex h-5 items-center justify-center rounded bg-gray-lighter px-2
|
|
12
|
+
"no-translate inline-flex h-5 items-center justify-center rounded bg-gray-lighter py-1 px-2 text-xs font-semibold text-gray",
|
|
18
13
|
r.length === 1 && "w-5",
|
|
19
14
|
n
|
|
20
15
|
),
|
|
21
|
-
...
|
|
22
|
-
|
|
23
|
-
|
|
16
|
+
...i
|
|
17
|
+
},
|
|
18
|
+
r
|
|
24
19
|
);
|
|
20
|
+
}, m = {
|
|
21
|
+
cmd: t ? "⌘" : "ctrl",
|
|
22
|
+
option: t ? "⌥" : "win",
|
|
23
|
+
ctrl: "ctrl",
|
|
24
|
+
up: "↑",
|
|
25
|
+
down: "↓"
|
|
26
|
+
};
|
|
27
|
+
p.propTypes = {
|
|
28
|
+
char: o.string.isRequired,
|
|
29
|
+
className: o.string
|
|
25
30
|
};
|
|
26
31
|
export {
|
|
27
|
-
|
|
32
|
+
p as Key
|
|
28
33
|
};
|
package/build/components/Logo.js
CHANGED
|
@@ -1,10 +1,17 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
1
|
+
import e from "prop-types";
|
|
2
|
+
import t from "react";
|
|
3
|
+
import c from "../helpers/classnames.js";
|
|
4
|
+
const r = {
|
|
4
5
|
small: "w-10 h-10",
|
|
5
6
|
medium: "w-16 h-16",
|
|
6
7
|
large: "w-20 h-20"
|
|
7
|
-
},
|
|
8
|
+
}, s = ({ className: o, size: i = "small", ...m }) => /* @__PURE__ */ t.createElement("img", { className: c("ui-logo", o, "inline-block rounded object-cover", r[i]), ...m });
|
|
9
|
+
s.sizes = r;
|
|
10
|
+
s.propTypes = {
|
|
11
|
+
className: e.string,
|
|
12
|
+
src: e.string.isRequired,
|
|
13
|
+
size: e.string
|
|
14
|
+
};
|
|
8
15
|
export {
|
|
9
|
-
|
|
16
|
+
s as Logo
|
|
10
17
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import { Fragment as
|
|
4
|
-
import
|
|
5
|
-
import { CloseIcon as
|
|
1
|
+
import { Transition as c, Dialog as p } from "@headlessui/react";
|
|
2
|
+
import o from "prop-types";
|
|
3
|
+
import e, { Fragment as d } from "react";
|
|
4
|
+
import a from "../helpers/classnames.js";
|
|
5
|
+
import { CloseIcon as x } from "../icons/src/CloseIcon.js";
|
|
6
6
|
const y = {
|
|
7
7
|
small: "max-w-100",
|
|
8
8
|
// 400px
|
|
@@ -12,13 +12,13 @@ const y = {
|
|
|
12
12
|
// 600px
|
|
13
13
|
huge: "max-w-200"
|
|
14
14
|
// 800px
|
|
15
|
-
},
|
|
15
|
+
}, f = {
|
|
16
16
|
center: "inline-block",
|
|
17
17
|
topLeft: "absolute m-4 top-0 left-0",
|
|
18
18
|
topRight: "absolute m-4 top-0 right-0",
|
|
19
19
|
bottomLeft: "absolute m-4 bottom-0 left-0",
|
|
20
20
|
bottomRight: "absolute m-4 bottom-0 right-0"
|
|
21
|
-
},
|
|
21
|
+
}, l = {
|
|
22
22
|
center: {
|
|
23
23
|
enterFrom: "translate-y-4 sm:translate-y-0 sm:scale-95",
|
|
24
24
|
enterTo: "translate-y-0 sm:scale-100",
|
|
@@ -49,78 +49,93 @@ const y = {
|
|
|
49
49
|
leaveFrom: "scale-100 origin-bottom-right",
|
|
50
50
|
leaveTo: "scale-0 origin-bottom-right"
|
|
51
51
|
}
|
|
52
|
-
},
|
|
53
|
-
size:
|
|
54
|
-
position:
|
|
55
|
-
isOpen:
|
|
56
|
-
shouldCloseOnOutsideClick:
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}) =>
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
52
|
+
}, i = ({
|
|
53
|
+
size: r = "medium",
|
|
54
|
+
position: t = "center",
|
|
55
|
+
isOpen: n = !1,
|
|
56
|
+
shouldCloseOnOutsideClick: s = !1,
|
|
57
|
+
onClose: m,
|
|
58
|
+
children: h,
|
|
59
|
+
className: v
|
|
60
|
+
}) => {
|
|
61
|
+
const T = () => {
|
|
62
|
+
s && m();
|
|
63
|
+
};
|
|
64
|
+
return /* @__PURE__ */ e.createElement(c, { appear: !0, show: n, as: d }, /* @__PURE__ */ e.createElement(p, { as: "div", className: "ui-modal fixed inset-0 z-30 overflow-y-auto", onClose: T }, /* @__PURE__ */ e.createElement("div", { className: "min-h-screen px-4 text-center" }, /* @__PURE__ */ e.createElement(
|
|
65
|
+
c.Child,
|
|
65
66
|
{
|
|
66
|
-
as:
|
|
67
|
+
as: d,
|
|
67
68
|
enter: "ease-out duration-300",
|
|
68
69
|
enterFrom: "opacity-0",
|
|
69
70
|
enterTo: "opacity-100",
|
|
70
71
|
leave: "ease-in duration-200",
|
|
71
72
|
leaveFrom: "opacity-100",
|
|
72
|
-
leaveTo: "opacity-0"
|
|
73
|
-
|
|
74
|
-
}
|
|
75
|
-
),
|
|
76
|
-
|
|
77
|
-
/* @__PURE__ */ t(
|
|
78
|
-
s.Child,
|
|
73
|
+
leaveTo: "opacity-0"
|
|
74
|
+
},
|
|
75
|
+
/* @__PURE__ */ e.createElement(p.Overlay, { className: "ui-modal-overlay fixed inset-0 bg-black bg-opacity-80 transition-opacity" })
|
|
76
|
+
), t === "center" && /* @__PURE__ */ e.createElement("span", { className: "inline-block h-screen align-middle", "aria-hidden": "true" }, ""), /* @__PURE__ */ e.createElement(
|
|
77
|
+
c.Child,
|
|
79
78
|
{
|
|
80
|
-
as:
|
|
81
|
-
enter:
|
|
82
|
-
enterFrom:
|
|
83
|
-
enterTo:
|
|
84
|
-
leave:
|
|
85
|
-
leaveFrom:
|
|
86
|
-
leaveTo:
|
|
87
|
-
|
|
88
|
-
|
|
79
|
+
as: d,
|
|
80
|
+
enter: a("ease-out duration-300"),
|
|
81
|
+
enterFrom: a("opacity-0", l[t].enterFrom),
|
|
82
|
+
enterTo: a("opacity-100", l[t].enterTo),
|
|
83
|
+
leave: a("ease-in duration-300"),
|
|
84
|
+
leaveFrom: a("opacity-100", l[t].leaveFrom),
|
|
85
|
+
leaveTo: a("opacity-0", l[t].leaveTo)
|
|
86
|
+
},
|
|
87
|
+
/* @__PURE__ */ e.createElement(
|
|
88
|
+
"div",
|
|
89
|
+
{
|
|
90
|
+
className: a(
|
|
91
|
+
v,
|
|
92
|
+
y[r],
|
|
93
|
+
f[t],
|
|
94
|
+
"w-full transform overflow-hidden rounded-lg bg-white p-10 text-left align-middle shadow-xl transition-all"
|
|
95
|
+
)
|
|
96
|
+
},
|
|
97
|
+
m ? /* @__PURE__ */ e.createElement(
|
|
98
|
+
"button",
|
|
89
99
|
{
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
const
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
100
|
+
type: "button",
|
|
101
|
+
className: "absolute right-0 top-0 m-4 hidden p-2 text-black hover:text-gray-darker sm:block",
|
|
102
|
+
onClick: () => m()
|
|
103
|
+
},
|
|
104
|
+
/* @__PURE__ */ e.createElement(x, null)
|
|
105
|
+
) : null,
|
|
106
|
+
h
|
|
107
|
+
)
|
|
108
|
+
))));
|
|
109
|
+
};
|
|
110
|
+
i.propTypes = {
|
|
111
|
+
size: o.oneOf(Object.keys(y)),
|
|
112
|
+
position: o.oneOf(Object.keys(f)),
|
|
113
|
+
isOpen: o.bool.isRequired,
|
|
114
|
+
shouldCloseOnOutsideClick: o.bool,
|
|
115
|
+
onClose: o.func.isRequired,
|
|
116
|
+
children: o.node.isRequired,
|
|
117
|
+
className: o.string
|
|
118
|
+
};
|
|
119
|
+
const g = ({ children: r, description: t, className: n, ...s }) => /* @__PURE__ */ e.createElement(p.Title, { as: "div", className: a(n, "ui-modal-header text-center"), ...s }, /* @__PURE__ */ e.createElement("h3", { className: "text-2xl font-semibold leading-6 text-black" }, r), t ? /* @__PURE__ */ e.createElement("p", { className: "mt-2 text-base font-normal leading-normal text-gray-darker" }, t) : null);
|
|
120
|
+
g.propTypes = {
|
|
121
|
+
children: o.node.isRequired,
|
|
122
|
+
description: o.string,
|
|
123
|
+
className: o.string
|
|
124
|
+
};
|
|
125
|
+
g.displayName = "Modal.Header";
|
|
126
|
+
i.Header = g;
|
|
127
|
+
const u = ({ className: r, ...t }) => /* @__PURE__ */ e.createElement("div", { className: a(r, "ui-modal-body mt-10"), ...t });
|
|
128
|
+
u.propTypes = {
|
|
129
|
+
className: o.string
|
|
130
|
+
};
|
|
131
|
+
u.displayName = "Modal.Body";
|
|
132
|
+
i.Body = u;
|
|
133
|
+
const b = ({ className: r, ...t }) => /* @__PURE__ */ e.createElement("div", { className: a(r, "ui-modal-footer mt-10 space-x-4 text-right"), ...t });
|
|
134
|
+
b.propTypes = {
|
|
135
|
+
className: o.string
|
|
136
|
+
};
|
|
137
|
+
b.displayName = "Modal.Footer";
|
|
138
|
+
i.Footer = b;
|
|
124
139
|
export {
|
|
125
|
-
|
|
140
|
+
i as Modal
|
|
126
141
|
};
|
|
@@ -1,44 +1,53 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import { Children as
|
|
4
|
-
import u from "../../helpers/classnames.js";
|
|
1
|
+
import c from "@tippyjs/react";
|
|
2
|
+
import t from "prop-types";
|
|
3
|
+
import r, { Children as C, useState as T } from "react";
|
|
5
4
|
import { followCursor as v } from "tippy.js";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
import { getChildrenByType as
|
|
5
|
+
/* empty css */
|
|
6
|
+
/* empty css */
|
|
7
|
+
import { getChildrenByType as N } from "../../helpers/children.js";
|
|
8
|
+
import d from "../../helpers/classnames.js";
|
|
9
9
|
import h from "./Popover.module.css.js";
|
|
10
|
-
import
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
return /* @__PURE__ */
|
|
14
|
-
|
|
10
|
+
import z from "./PopoverScroll.module.css.js";
|
|
11
|
+
const m = ({ isLazy: e = !0, skidding: o = 0, distance: i = 10, className: s, children: p, ...n }) => {
|
|
12
|
+
const a = N(p, m.Content), y = C.toArray(p).filter((g) => g.type !== m.Content), f = e ? u : c;
|
|
13
|
+
return /* @__PURE__ */ r.createElement(
|
|
14
|
+
f,
|
|
15
15
|
{
|
|
16
16
|
interactive: !0,
|
|
17
17
|
zIndex: 50,
|
|
18
|
-
content:
|
|
19
|
-
className:
|
|
18
|
+
content: a,
|
|
19
|
+
className: d("ui-popover", z, h.main, "!rounded-lg !border-gray-light shadow-xl", s),
|
|
20
20
|
plugins: [v],
|
|
21
|
-
offset: [o ?? 0,
|
|
22
|
-
...
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
offset: [o ?? 0, i ?? 10],
|
|
22
|
+
...n
|
|
23
|
+
},
|
|
24
|
+
/* @__PURE__ */ r.createElement("span", null, y)
|
|
25
25
|
);
|
|
26
|
-
}
|
|
26
|
+
};
|
|
27
|
+
m.propTypes = {
|
|
28
|
+
isLazy: t.bool,
|
|
29
|
+
className: t.string,
|
|
30
|
+
skidding: t.number,
|
|
31
|
+
distance: t.number,
|
|
32
|
+
children: t.node.isRequired
|
|
33
|
+
};
|
|
34
|
+
const l = ({ className: e, children: o }) => /* @__PURE__ */ r.createElement("div", { className: d("ui-popover-content", e) }, o);
|
|
27
35
|
l.displayName = "Popover.Content";
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
36
|
+
l.propTypes = {
|
|
37
|
+
className: t.string,
|
|
38
|
+
children: t.node.isRequired
|
|
39
|
+
};
|
|
40
|
+
m.Content = l;
|
|
41
|
+
const u = r.forwardRef((e, o) => {
|
|
42
|
+
const [i, s] = T(!1), p = {
|
|
31
43
|
fn: () => ({
|
|
32
|
-
onMount: () =>
|
|
33
|
-
onHidden: () =>
|
|
44
|
+
onMount: () => s(!0),
|
|
45
|
+
onHidden: () => s(!1)
|
|
34
46
|
})
|
|
35
|
-
},
|
|
36
|
-
return
|
|
37
|
-
var i;
|
|
38
|
-
return r ? (i = t.render) == null ? void 0 : i.call(t, p, a, c) : "";
|
|
39
|
-
} : e.content = r ? t.content : "", /* @__PURE__ */ m(d, { ...e, ref: o });
|
|
47
|
+
}, n = { ...e };
|
|
48
|
+
return n.plugins = [p, ...e.plugins || []], e.render ? n.render = (...a) => i ? e.render(...a) : "" : n.content = i ? e.content : "", /* @__PURE__ */ r.createElement(c, { ...n, ref: o });
|
|
40
49
|
});
|
|
41
|
-
|
|
50
|
+
u.displayName = "LazyTippy";
|
|
42
51
|
export {
|
|
43
|
-
|
|
52
|
+
m as Popover
|
|
44
53
|
};
|
|
@@ -1,50 +1,57 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { Popover as
|
|
5
|
-
import
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
|
|
1
|
+
import e from "prop-types";
|
|
2
|
+
import l, { Children as f } from "react";
|
|
3
|
+
import u from "../../helpers/classnames.js";
|
|
4
|
+
import { Popover as y } from "./Popover.js";
|
|
5
|
+
import h from "./PopoverScroll.module.css.js";
|
|
6
|
+
const s = ({ placement: o = "bottom", className: m, children: p, ...n }) => {
|
|
7
|
+
const r = f.toArray(p), i = r.filter((t) => t.type !== s.Item), c = r.length - i.length, a = r.map((t, g) => t.type === s.Item ? l.cloneElement(t, { position: g, total: c }) : null), d = /* @__PURE__ */ l.createElement(
|
|
8
|
+
y.Content,
|
|
9
9
|
{
|
|
10
|
-
className:
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
className: u(h, "ui-popover-list-content divide-y divide-solid divide-gray-lighter p-0 ")
|
|
11
|
+
},
|
|
12
|
+
a
|
|
13
13
|
);
|
|
14
|
-
return /* @__PURE__ */
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
...p
|
|
25
|
-
}) => {
|
|
26
|
-
const t = (a) => c(a, l, s);
|
|
27
|
-
return /* @__PURE__ */ d(
|
|
14
|
+
return /* @__PURE__ */ l.createElement(y, { content: d, placement: o, className: u("ui-popover-list", "w-40", m), ...n }, i);
|
|
15
|
+
};
|
|
16
|
+
s.propTypes = {
|
|
17
|
+
placement: e.string,
|
|
18
|
+
className: e.string,
|
|
19
|
+
children: e.node.isRequired
|
|
20
|
+
};
|
|
21
|
+
const v = ({ name: o, isActive: m = !1, id: p = null, position: n, total: r, children: i, className: c, onClickItem: a, ...d }) => {
|
|
22
|
+
const t = (g) => a(g, o, p);
|
|
23
|
+
return /* @__PURE__ */ l.createElement(
|
|
28
24
|
"div",
|
|
29
25
|
{
|
|
30
|
-
|
|
26
|
+
name: o,
|
|
27
|
+
className: u(
|
|
31
28
|
"ui-popover-list-item",
|
|
32
29
|
"flex cursor-pointer space-x-2.5 p-4 align-text-top font-semibold leading-4 tracking-tightest hover:bg-gray-lighter",
|
|
33
|
-
|
|
34
|
-
|
|
30
|
+
m ? "bg-gray-lighter" : null,
|
|
31
|
+
n === 1 ? "rounded-t-lg" : null,
|
|
35
32
|
// Round the top left & right corners if it's the first one
|
|
36
|
-
|
|
33
|
+
n === r ? "rounded-b-lg" : null,
|
|
37
34
|
// Round bottom left & right if it's the last one
|
|
38
|
-
|
|
35
|
+
c
|
|
39
36
|
),
|
|
40
37
|
onClick: t,
|
|
41
|
-
...
|
|
42
|
-
|
|
43
|
-
|
|
38
|
+
...d
|
|
39
|
+
},
|
|
40
|
+
i
|
|
44
41
|
);
|
|
45
42
|
};
|
|
46
|
-
|
|
47
|
-
|
|
43
|
+
v.displayName = "PopoverList.Item";
|
|
44
|
+
v.propTypes = {
|
|
45
|
+
position: e.number,
|
|
46
|
+
total: e.number,
|
|
47
|
+
name: e.string.isRequired,
|
|
48
|
+
isActive: e.bool,
|
|
49
|
+
id: e.string,
|
|
50
|
+
children: e.node.isRequired,
|
|
51
|
+
className: e.string,
|
|
52
|
+
onClickItem: e.func.isRequired
|
|
53
|
+
};
|
|
54
|
+
s.Item = v;
|
|
48
55
|
export {
|
|
49
|
-
|
|
56
|
+
s as PopoverList
|
|
50
57
|
};
|
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { createContext as s, useRef as i, useCallback as c, useMemo as l } from "react";
|
|
1
|
+
import u, { useRef as c, useCallback as l, useMemo as s, createContext as i } from "react";
|
|
3
2
|
let p = 1;
|
|
4
|
-
const
|
|
3
|
+
const w = i({
|
|
5
4
|
generateId: () => (console.warn(
|
|
6
5
|
"Please wrap your app with `<Provider />` component from `@xola/ui-kit`. Otherwise your app will not work with SSR frameworks."
|
|
7
6
|
), p++),
|
|
8
7
|
localize: !0,
|
|
9
8
|
locale: "en_US"
|
|
10
|
-
}),
|
|
11
|
-
const t =
|
|
12
|
-
return /* @__PURE__ */ u(
|
|
9
|
+
}), m = ({ children: n, localize: e = !0, locale: r = "en_US" }) => {
|
|
10
|
+
const t = c(1), o = l(() => t.current++, [t]), a = s(() => ({ generateId: o, localize: e, locale: r }), [o, e, r]);
|
|
11
|
+
return /* @__PURE__ */ u.createElement(w.Provider, { value: a }, n);
|
|
13
12
|
};
|
|
14
13
|
export {
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
w as Context,
|
|
15
|
+
m as Provider
|
|
17
16
|
};
|