@xola/ui-kit 3.4.6 → 3.5.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/build/components/Alert.js +4 -8
- package/build/components/Avatar.js +4 -4
- package/build/components/Badge.d.ts +2 -2
- package/build/components/Badge.js +19 -19
- package/build/components/Breadcrumb.js +1 -1
- package/build/components/Breakdown.js +20 -20
- package/build/components/Buttons/Button.js +1 -1
- package/build/components/Buttons/ButtonGroup.js +8 -8
- package/build/components/Buttons/SubmitButton.js +13 -13
- package/build/components/Buttons/ToggleButton.js +1 -1
- package/build/components/Counter.js +1 -1
- package/build/components/DatePicker/DatePicker.js +19 -19
- package/build/components/DatePicker/DatePickerPopover.js +7 -7
- package/build/components/DatePicker/Day.js +1 -1
- package/build/components/DatePicker/LocalizedDayPicker.js +14 -14
- package/build/components/DatePicker/MonthGrid.js +4 -4
- package/build/components/DatePicker/NavbarElement.js +3 -3
- package/build/components/DatePicker/RangeDatePicker.js +3 -7
- package/build/components/DatePicker/UpcomingDatePicker.js +14 -14
- package/build/components/Dot/Dot.js +4 -4
- package/build/components/Drawer.js +5 -5
- package/build/components/Forms/BaseInput.js +4 -4
- package/build/components/Forms/Checkbox.js +5 -5
- package/build/components/Forms/ComboBox.js +10 -10
- package/build/components/Forms/FormGroup.js +3 -3
- package/build/components/Forms/InlineValuePopover.js +9 -9
- package/build/components/Forms/Input.js +5 -5
- package/build/components/Forms/Label.js +3 -3
- package/build/components/Forms/RangeSlider.js +14 -14
- package/build/components/Forms/Switch.js +15 -15
- package/build/components/Forms/Textarea.js +4 -4
- package/build/components/HeaderToolbar.js +1 -1
- package/build/components/ImageUpload.js +1 -1
- package/build/components/Key.js +6 -6
- package/build/components/Logo.js +4 -4
- package/build/components/Modal.js +1 -1
- package/build/components/Popover/Popover.js +6 -12
- package/build/components/Popover/PopoverList.js +9 -18
- package/build/components/Search.js +7 -7
- package/build/components/Sidebar/Sidebar.Account.js +5 -5
- package/build/components/Sidebar/Sidebar.Button.js +4 -4
- package/build/components/Sidebar/Sidebar.Heading.js +4 -4
- package/build/components/Sidebar/Sidebar.Link.js +21 -20
- package/build/components/Sidebar/Sidebar.Menu.d.ts +3 -0
- package/build/components/Sidebar/Sidebar.Menu.js +15 -13
- package/build/components/Sidebar/Sidebar.js +1 -1
- package/build/components/Skeleton.js +7 -7
- package/build/components/Spinner.js +1 -1
- package/build/components/Table.js +1 -1
- package/build/components/Tabs/Tabs.Panel.js +5 -5
- package/build/components/Tabs/Tabs.Tab.js +7 -7
- package/build/components/Tabs/Tabs.js +7 -7
- package/build/components/Tag.js +9 -9
- package/build/components/Utilities/Phone.js +3 -3
- package/build/full.css +1 -1
- package/build/helpers/classnames.js +8 -0
- package/build/helpers/flash.js +4 -4
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as l, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import m from "
|
|
3
|
-
import
|
|
2
|
+
import { useRef as w, useState as m, useEffect as N } from "react";
|
|
3
|
+
import d from "../../helpers/classnames.js";
|
|
4
4
|
import { Avatar as g } from "../Avatar.js";
|
|
5
5
|
import { ChevronRightIcon as S } from "../../icons/src/ChevronRightIcon.js";
|
|
6
6
|
const j = ({
|
|
@@ -12,7 +12,7 @@ const j = ({
|
|
|
12
12
|
className: b,
|
|
13
13
|
...y
|
|
14
14
|
}) => {
|
|
15
|
-
const t = w(null), [s, a] =
|
|
15
|
+
const t = w(null), [s, a] = m(!r), [p, u] = m(!r), v = h ?? /* @__PURE__ */ e(g, { size: "tiny", name: n });
|
|
16
16
|
return N(() => {
|
|
17
17
|
if (!r) {
|
|
18
18
|
a(!0), u(!0);
|
|
@@ -31,7 +31,7 @@ const j = ({
|
|
|
31
31
|
{
|
|
32
32
|
ref: t,
|
|
33
33
|
type: "button",
|
|
34
|
-
className:
|
|
34
|
+
className: d(
|
|
35
35
|
"ui-sidebar-account",
|
|
36
36
|
"flex h-12 w-full cursor-pointer items-center justify-center rounded px-4 py-3 hover:bg-gray-darker",
|
|
37
37
|
"xl:justify-start",
|
|
@@ -40,7 +40,7 @@ const j = ({
|
|
|
40
40
|
),
|
|
41
41
|
...y,
|
|
42
42
|
children: [
|
|
43
|
-
p && /* @__PURE__ */ e("div", { className:
|
|
43
|
+
p && /* @__PURE__ */ e("div", { className: d(r && "m-auto", "flex-shrink-0"), children: v }),
|
|
44
44
|
s && /* @__PURE__ */ l("div", { className: "ml-2 min-w-0 text-left", children: [
|
|
45
45
|
/* @__PURE__ */ e("div", { className: "truncate text-base", children: n }),
|
|
46
46
|
o && /* @__PURE__ */ e("div", { className: "truncate text-sm text-gray-dark", children: o })
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
const i = ({ icon: r, label: t, className: s, ...a }) => /* @__PURE__ */
|
|
1
|
+
import { jsxs as n, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import o from "../../helpers/classnames.js";
|
|
3
|
+
const i = ({ icon: r, label: t, className: s, ...a }) => /* @__PURE__ */ n(
|
|
4
4
|
"button",
|
|
5
5
|
{
|
|
6
6
|
type: "button",
|
|
7
|
-
className:
|
|
7
|
+
className: o(
|
|
8
8
|
"ui-sidebar-button flex w-full cursor-pointer items-center rounded px-4 py-2 hover:bg-gray-darker",
|
|
9
9
|
s
|
|
10
10
|
),
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsxs as t, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import i from "
|
|
3
|
-
const m = ({ icon:
|
|
4
|
-
/* @__PURE__ */ e(
|
|
5
|
-
/* @__PURE__ */ e("span", { className: "text-md font-bold", children:
|
|
2
|
+
import i from "../../helpers/classnames.js";
|
|
3
|
+
const m = ({ icon: a, label: r, className: s }) => /* @__PURE__ */ t("p", { className: i("ml-4 flex items-center text-white", s), children: [
|
|
4
|
+
/* @__PURE__ */ e(a, { className: "mr-3 h-5 w-5" }),
|
|
5
|
+
/* @__PURE__ */ e("span", { className: "text-md font-bold", children: r })
|
|
6
6
|
] });
|
|
7
7
|
m.displayName = "Sidebar.Heading";
|
|
8
8
|
export {
|
|
@@ -1,28 +1,29 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { Dot as
|
|
5
|
-
import {
|
|
6
|
-
|
|
1
|
+
import { jsxs as b, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as g, useState as h, useEffect as w } from "react";
|
|
3
|
+
import n from "../../helpers/classnames.js";
|
|
4
|
+
import { Dot as k } from "../Dot/Dot.js";
|
|
5
|
+
import { useSidebarMenu as j } from "./Sidebar.Menu.js";
|
|
6
|
+
import { ChevronRightIcon as N } from "../../icons/src/ChevronRightIcon.js";
|
|
7
|
+
const S = ({
|
|
7
8
|
isActive: t = !1,
|
|
8
9
|
icon: i,
|
|
9
10
|
isSubMenuItem: r,
|
|
10
|
-
align:
|
|
11
|
+
align: l,
|
|
11
12
|
children: d,
|
|
12
13
|
classNames: s,
|
|
13
|
-
...
|
|
14
|
+
...m
|
|
14
15
|
}) => {
|
|
15
|
-
const e = g(null), [a,
|
|
16
|
+
const e = g(null), [a, p] = h(!0), [u, x] = h(!0), { hasSubmenu: y } = j();
|
|
16
17
|
return w(() => {
|
|
17
18
|
const c = () => {
|
|
18
|
-
e.current && (
|
|
19
|
+
e.current && (p(e.current.offsetWidth >= 140), x(e.current.offsetWidth >= 140 || e.current.offsetWidth < 100));
|
|
19
20
|
};
|
|
20
21
|
c();
|
|
21
22
|
const f = new ResizeObserver(c);
|
|
22
23
|
return e.current && f.observe(e.current), () => {
|
|
23
24
|
f.disconnect();
|
|
24
25
|
};
|
|
25
|
-
}, []), /* @__PURE__ */
|
|
26
|
+
}, []), /* @__PURE__ */ b(
|
|
26
27
|
"button",
|
|
27
28
|
{
|
|
28
29
|
ref: e,
|
|
@@ -38,19 +39,19 @@ const j = ({
|
|
|
38
39
|
"justify-center px-6 py-3": !r
|
|
39
40
|
}
|
|
40
41
|
),
|
|
41
|
-
...
|
|
42
|
+
...m,
|
|
42
43
|
children: [
|
|
43
|
-
r ? /* @__PURE__ */ o(
|
|
44
|
-
(a
|
|
45
|
-
!r && a && /* @__PURE__ */ o(
|
|
44
|
+
r ? /* @__PURE__ */ o(k, { className: n("mr-3 shrink-0", { "bg-white": t, "bg-gray": !t }) }) : u && i && /* @__PURE__ */ o("div", { className: n(!a && "flex w-full justify-center"), children: /* @__PURE__ */ o(i, { className: n("h-5 w-5 shrink-0", a && "mr-3") }) }),
|
|
45
|
+
(a || r) && /* @__PURE__ */ o("span", { className: n("px-1", { "text-left": r ?? l === "left" }, s == null ? void 0 : s.text), children: d }),
|
|
46
|
+
!r && a && y && /* @__PURE__ */ o(N, { className: "ml-auto h-3 w-3" })
|
|
46
47
|
]
|
|
47
48
|
}
|
|
48
49
|
);
|
|
49
50
|
};
|
|
50
|
-
|
|
51
|
-
const
|
|
52
|
-
|
|
51
|
+
S.displayName = "Sidebar.Link";
|
|
52
|
+
const v = ({ className: t }) => /* @__PURE__ */ o("hr", { className: n("mx-3 my-4 border-gray-lighter/20", t) });
|
|
53
|
+
v.displayName = "Sidebar.Separator";
|
|
53
54
|
export {
|
|
54
|
-
|
|
55
|
-
|
|
55
|
+
S as SidebarLink,
|
|
56
|
+
v as SidebarSeparator
|
|
56
57
|
};
|
|
@@ -1,28 +1,30 @@
|
|
|
1
1
|
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
import i from "@tippyjs/react";
|
|
3
|
+
import { useContext as a, createContext as s } from "react";
|
|
4
|
+
import d from "../../helpers/classnames.js";
|
|
5
|
+
import m from "./Sidebar.Menu.module.css.js";
|
|
6
|
+
const u = typeof window > "u" ? void 0 : window.document.body, r = s({ hasSubmenu: !1 }), h = () => a(r), c = ({ content: o, children: n, ...t }) => /* @__PURE__ */ e(r.Provider, { value: { hasSubmenu: !0 }, children: /* @__PURE__ */ e(
|
|
7
|
+
i,
|
|
7
8
|
{
|
|
8
9
|
interactive: !0,
|
|
9
10
|
trigger: "mouseenter",
|
|
10
11
|
hideOnClick: "toggle",
|
|
11
|
-
appendTo:
|
|
12
|
+
appendTo: u,
|
|
12
13
|
placement: "right",
|
|
13
14
|
offset: [0, 4],
|
|
14
15
|
arrow: !1,
|
|
15
|
-
className:
|
|
16
|
+
className: d(
|
|
16
17
|
"ui-sidebar-menu",
|
|
17
|
-
|
|
18
|
+
m.main,
|
|
18
19
|
"!rounded-none bg-black bg-opacity-90 p-2 backdrop-blur-sm backdrop-filter"
|
|
19
20
|
),
|
|
20
21
|
content: o,
|
|
21
|
-
...
|
|
22
|
-
children: /* @__PURE__ */ e("span", { className: "block", children:
|
|
22
|
+
...t,
|
|
23
|
+
children: /* @__PURE__ */ e("span", { className: "block", children: n })
|
|
23
24
|
}
|
|
24
|
-
);
|
|
25
|
-
|
|
25
|
+
) });
|
|
26
|
+
c.displayName = "Sidebar.Menu";
|
|
26
27
|
export {
|
|
27
|
-
|
|
28
|
+
c as SidebarMenu,
|
|
29
|
+
h as useSidebarMenu
|
|
28
30
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as d, jsx as i } from "react/jsx-runtime";
|
|
2
|
-
import s from "clsx";
|
|
3
2
|
import $, { useState as x, useRef as K, useEffect as b } from "react";
|
|
3
|
+
import s from "../../helpers/classnames.js";
|
|
4
4
|
import { Counter as I } from "../Counter.js";
|
|
5
5
|
import { Drawer as k } from "../Drawer.js";
|
|
6
6
|
import { SidebarAccount as P } from "./Sidebar.Account.js";
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import r from "
|
|
1
|
+
import { jsxs as m, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import r from "../helpers/classnames.js";
|
|
3
3
|
import d from "./Skeleton.module.css.js";
|
|
4
4
|
const c = ({
|
|
5
5
|
style: l,
|
|
6
6
|
height: i = 300,
|
|
7
7
|
shouldAnimate: o = !0,
|
|
8
|
-
children:
|
|
8
|
+
children: n,
|
|
9
9
|
classNames: e = {},
|
|
10
|
-
...
|
|
11
|
-
}) => /* @__PURE__ */
|
|
10
|
+
...s
|
|
11
|
+
}) => /* @__PURE__ */ m(
|
|
12
12
|
"div",
|
|
13
13
|
{
|
|
14
14
|
className: r(
|
|
@@ -17,10 +17,10 @@ const c = ({
|
|
|
17
17
|
e.container
|
|
18
18
|
),
|
|
19
19
|
style: { height: i, ...l },
|
|
20
|
-
...
|
|
20
|
+
...s,
|
|
21
21
|
children: [
|
|
22
22
|
o ? /* @__PURE__ */ t("div", { className: r(d.shimmer, "absolute h-full w-full", e.shimmer) }) : null,
|
|
23
|
-
/* @__PURE__ */ t("div", { className: r("text-gray", e.text), children:
|
|
23
|
+
/* @__PURE__ */ t("div", { className: r("text-gray", e.text), children: n })
|
|
24
24
|
]
|
|
25
25
|
}
|
|
26
26
|
);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
-
import s from "clsx";
|
|
3
2
|
import T, { Children as k, cloneElement as B, useState as u, useRef as h, useEffect as A } from "react";
|
|
3
|
+
import s from "../helpers/classnames.js";
|
|
4
4
|
const n = ({ className: e, ...l }) => /* @__PURE__ */ a("div", { className: "ui-table flex flex-col", children: /* @__PURE__ */ a("div", { className: "-my-2 overflow-x-auto", children: /* @__PURE__ */ a("div", { className: "inline-block min-w-full py-2 align-middle", children: /* @__PURE__ */ a("div", { className: "overflow-hidden border-b border-gray-lighter sm:rounded-lg", children: /* @__PURE__ */ a("table", { className: s(e, "min-w-full divide-y border border-gray-lighter"), ...l }) }) }) }) }), g = ({ className: e, ...l }) => /* @__PURE__ */ a("thead", { className: s("ui-table-head", "bg-gray-lighter", e), ...l });
|
|
5
5
|
g.displayName = "Table.Head";
|
|
6
6
|
const f = ({ className: e, ...l }) => /* @__PURE__ */ a("th", { className: s("ui-table-header", "px-4 py-2 text-left text-base font-bold", e), ...l });
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
const
|
|
4
|
-
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import s from "../../helpers/classnames.js";
|
|
3
|
+
const m = ({ className: a, ...e }) => /* @__PURE__ */ r("div", { className: s("ui-tabs-panel", a), ...e });
|
|
4
|
+
m.displayName = "Tabs.Panel";
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
m as Panel
|
|
7
7
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import t from "
|
|
1
|
+
import { jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import t from "../../helpers/classnames.js";
|
|
3
3
|
const n = {
|
|
4
4
|
default: (r) => t(
|
|
5
5
|
"border-b border-gray-light",
|
|
@@ -15,11 +15,11 @@ const n = {
|
|
|
15
15
|
isActive: a = !1,
|
|
16
16
|
isHidden: o = !1,
|
|
17
17
|
className: s,
|
|
18
|
-
...
|
|
18
|
+
...b
|
|
19
19
|
}) => {
|
|
20
|
-
const
|
|
21
|
-
return o ? null : /* @__PURE__ */
|
|
22
|
-
|
|
20
|
+
const i = e ?? "button";
|
|
21
|
+
return o ? null : /* @__PURE__ */ l(
|
|
22
|
+
i,
|
|
23
23
|
{
|
|
24
24
|
className: t(
|
|
25
25
|
"ui-tabs-tab",
|
|
@@ -27,7 +27,7 @@ const n = {
|
|
|
27
27
|
"cursor-pointer whitespace-nowrap px-8 py-4 text-center font-semibold focus-visible:ring",
|
|
28
28
|
n[r](a)
|
|
29
29
|
),
|
|
30
|
-
...
|
|
30
|
+
...b
|
|
31
31
|
}
|
|
32
32
|
);
|
|
33
33
|
};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { jsxs as a, Fragment as y, jsx as n } from "react/jsx-runtime";
|
|
2
|
-
import h from "
|
|
3
|
-
import
|
|
4
|
-
import { Panel as
|
|
2
|
+
import i, { Children as h, cloneElement as x } from "react";
|
|
3
|
+
import w from "../../helpers/classnames.js";
|
|
4
|
+
import { Panel as s } from "./Tabs.Panel.js";
|
|
5
5
|
import { Tab as m } from "./Tabs.Tab.js";
|
|
6
6
|
const A = {
|
|
7
7
|
default: "border-t border-gray-light",
|
|
8
8
|
simple: "bg-gray-lighter"
|
|
9
9
|
}, d = ({ variant: e = "default", value: t, children: f, className: b, onChange: c, ...g }) => {
|
|
10
|
-
const l =
|
|
10
|
+
const l = h.toArray(f), p = l.filter((r) => i.isValidElement(r) && r.type === m), u = l.filter((r) => i.isValidElement(r) && r.type === s);
|
|
11
11
|
return /* @__PURE__ */ a(y, { children: [
|
|
12
|
-
/* @__PURE__ */ a("nav", { className:
|
|
12
|
+
/* @__PURE__ */ a("nav", { className: w("ui-tabs", "flex overflow-x-auto", A[e], b), ...g, children: [
|
|
13
13
|
e === "default" ? /* @__PURE__ */ n("div", { className: "min-w-10 flex-shrink-0 border-b border-gray-light" }) : null,
|
|
14
|
-
p.map((r, o) =>
|
|
14
|
+
p.map((r, o) => x(r, {
|
|
15
15
|
variant: e,
|
|
16
16
|
isActive: o === t,
|
|
17
17
|
onClick: () => c(o)
|
|
@@ -22,7 +22,7 @@ const A = {
|
|
|
22
22
|
] });
|
|
23
23
|
};
|
|
24
24
|
d.Tab = m;
|
|
25
|
-
d.Panel =
|
|
25
|
+
d.Panel = s;
|
|
26
26
|
export {
|
|
27
27
|
d as Tabs
|
|
28
28
|
};
|
package/build/components/Tag.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import a from "
|
|
1
|
+
import { jsxs as c, jsx as g } from "react/jsx-runtime";
|
|
2
|
+
import a from "../helpers/classnames.js";
|
|
3
3
|
import { CloseIcon as d } from "../icons/src/CloseIcon.js";
|
|
4
4
|
const b = {
|
|
5
5
|
primary: "bg-primary-lighter text-black border border-primary",
|
|
@@ -12,13 +12,13 @@ const b = {
|
|
|
12
12
|
small: "px-1 py-0.75 text-sm leading-3.5",
|
|
13
13
|
medium: "px-2 py-1 text-base leading-3.5",
|
|
14
14
|
large: "px-2 py-1.5 text-base leading-4"
|
|
15
|
-
}, y = ({ color: t = "primary", size: e = "small", children:
|
|
16
|
-
const
|
|
17
|
-
|
|
15
|
+
}, y = ({ color: t = "primary", size: e = "small", children: i, className: o, onClose: r, ...s }) => {
|
|
16
|
+
const l = (n) => {
|
|
17
|
+
n.stopPropagation(), r == null || r();
|
|
18
18
|
};
|
|
19
|
-
return /* @__PURE__ */
|
|
20
|
-
|
|
21
|
-
r ? /* @__PURE__ */
|
|
19
|
+
return /* @__PURE__ */ c("span", { className: a("ui-tag", "inline-flex rounded", b[t], m[e], o), ...s, children: [
|
|
20
|
+
i,
|
|
21
|
+
r ? /* @__PURE__ */ g(
|
|
22
22
|
d,
|
|
23
23
|
{
|
|
24
24
|
size: "small",
|
|
@@ -26,7 +26,7 @@ const b = {
|
|
|
26
26
|
"ui-tag-close ml-2 cursor-pointer leading-4 hover:text-gray-darker",
|
|
27
27
|
e === "large" ? "mt-0.5" : "mt-0.25"
|
|
28
28
|
),
|
|
29
|
-
onClick:
|
|
29
|
+
onClick: l
|
|
30
30
|
}
|
|
31
31
|
) : null
|
|
32
32
|
] });
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
-
import a from "
|
|
3
|
-
import { formatPhoneNumber as
|
|
2
|
+
import a from "../../helpers/classnames.js";
|
|
3
|
+
import { formatPhoneNumber as c, getRegionCode as s } from "../../helpers/phone.js";
|
|
4
4
|
const g = ({ countryCode: o = "US", children: t, className: r }) => {
|
|
5
|
-
const e = t.toString(), n =
|
|
5
|
+
const e = t.toString(), n = c(e, o), m = s(e, o);
|
|
6
6
|
return /* @__PURE__ */ i(
|
|
7
7
|
"span",
|
|
8
8
|
{
|