@xola/ui-kit 3.4.5 → 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/README.md +27 -2
- package/build/components/Alert.js +6 -10
- package/build/components/Avatar.js +4 -4
- package/build/components/Badge.d.ts +2 -1
- package/build/components/Badge.js +18 -16
- 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 +18 -18
- package/build/components/Buttons/SubmitButton.js +12 -12
- 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 +18 -18
- package/build/components/DatePicker/Day.js +1 -1
- package/build/components/DatePicker/LocalizedDayPicker.js +14 -14
- package/build/components/DatePicker/MonthGrid.js +20 -20
- package/build/components/DatePicker/MonthSelector.js +13 -13
- package/build/components/DatePicker/NavbarElement.js +9 -9
- 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 +9 -9
- 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 +11 -11
- 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/Forms/ValuePopoverText.js +5 -5
- package/build/components/HeaderToolbar.js +1 -1
- package/build/components/ImageUpload.js +11 -11
- package/build/components/Key.js +6 -6
- package/build/components/Logo.js +4 -4
- package/build/components/Modal.js +10 -10
- package/build/components/Popover/Popover.js +6 -12
- package/build/components/Popover/PopoverList.js +13 -22
- package/build/components/Screens/Login.js +10 -10
- package/build/components/Search.js +11 -11
- package/build/components/Sidebar/Sidebar.Account.js +8 -8
- 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 +26 -26
- package/build/components/Skeleton.js +7 -7
- package/build/components/Spinner.js +2 -2
- package/build/components/Table.js +5 -5
- 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 +10 -10
- package/build/components/Utilities/Phone.js +3 -3
- package/build/full.css +1 -1
- package/build/{icons/build/helpers → helpers}/classnames.js +2 -2
- package/build/helpers/flash.js +5 -5
- package/build/icons/src/AnnounceIcon.js +13 -0
- package/build/icons/src/BellIcon.js +27 -0
- package/build/icons/{build → src}/CalendarIcon.js +6 -5
- package/build/icons/src/CheckIcon.js +8 -0
- package/build/icons/src/ChevronDownIcon.js +8 -0
- package/build/icons/src/ChevronLeftIcon.js +8 -0
- package/build/icons/src/ChevronRightIcon.js +8 -0
- package/build/icons/src/CircleNotch.js +6 -0
- package/build/icons/src/CloseIcon.js +11 -0
- package/build/icons/src/DownArrowIcon.js +16 -0
- package/build/icons/src/ImageIcon.js +27 -0
- package/build/icons/src/SearchIcon.js +16 -0
- package/build/icons/src/TrashIcon.js +20 -0
- package/build/icons/src/WarningDiamondIcon.js +27 -0
- package/build/icons/src/helpers/classnames.js +8 -0
- package/build/icons/src/helpers/icon.js +11 -0
- package/build/icons/{build → src}/images/XolaLogoSimple.js +5 -4
- package/package.json +1 -1
- package/build/icons/build/AnnounceIcon.js +0 -6
- package/build/icons/build/BellIcon.js +0 -23
- package/build/icons/build/CheckIcon.js +0 -7
- package/build/icons/build/ChevronDownIcon.js +0 -7
- package/build/icons/build/ChevronLeftIcon.js +0 -7
- package/build/icons/build/ChevronRightIcon.js +0 -7
- package/build/icons/build/CircleNotch.js +0 -5
- package/build/icons/build/CloseIcon.js +0 -7
- package/build/icons/build/DownArrowIcon.js +0 -15
- package/build/icons/build/ImageIcon.js +0 -23
- package/build/icons/build/SearchIcon.js +0 -15
- package/build/icons/build/TrashIcon.js +0 -16
- package/build/icons/build/WarningDiamondIcon.js +0 -23
- package/build/icons/build/helpers/icon.js +0 -10
- /package/build/icons/{build → src}/helpers/iconSizes.js +0 -0
package/README.md
CHANGED
|
@@ -72,13 +72,18 @@ export { default } from "@xola/ui-kit/postcss.config.js";
|
|
|
72
72
|
|
|
73
73
|
#### Import Styles and Components
|
|
74
74
|
|
|
75
|
-
Import
|
|
75
|
+
Import CSS files in your project's entry point (e.g., `main.tsx` or `App.tsx`):
|
|
76
76
|
|
|
77
77
|
```js
|
|
78
|
+
// Full Tailwind setup with base styles, fonts, and CSS reset
|
|
78
79
|
import "@xola/ui-kit/index.css";
|
|
80
|
+
|
|
81
|
+
// Component-specific styles (Popover, Checkbox, RangeSlider, Sidebar, Skeleton, etc.)
|
|
79
82
|
import "@xola/ui-kit/build/ui-kit.css";
|
|
80
83
|
```
|
|
81
84
|
|
|
85
|
+
**Both imports are required** for components to render correctly. The first provides Tailwind base styles and fonts, while the second includes all component CSS modules.
|
|
86
|
+
|
|
82
87
|
UI kit expects you already have a working React 18+ dev environment with PostCSS support.
|
|
83
88
|
|
|
84
89
|
Import and use the components (with full TypeScript support):
|
|
@@ -164,7 +169,27 @@ $ rm -rf node_modules/@xola
|
|
|
164
169
|
|
|
165
170
|
### Troubleshooting
|
|
166
171
|
|
|
167
|
-
|
|
172
|
+
#### Missing Component Styles
|
|
173
|
+
|
|
174
|
+
If components are rendering without styles (e.g., Popover, Checkbox, RangeSlider), ensure both CSS imports are present:
|
|
175
|
+
|
|
176
|
+
```js
|
|
177
|
+
import "@xola/ui-kit/index.css"; // Tailwind base + fonts
|
|
178
|
+
import "tippy.js/dist/tippy.css";
|
|
179
|
+
import "@xola/ui-kit/build/ui-kit.css"; // Component CSS modules
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
All component-specific styles are bundled in `ui-kit.css`, including:
|
|
183
|
+
- Popover (`.main` with arrow styles)
|
|
184
|
+
- PopoverScroll (scrollbar customization)
|
|
185
|
+
- Checkbox (custom checkmark)
|
|
186
|
+
- RangeSlider (noUiSlider styling)
|
|
187
|
+
- Sidebar (menu and scroll styles)
|
|
188
|
+
- Skeleton (shimmer animation)
|
|
189
|
+
|
|
190
|
+
#### Package Installation Issues
|
|
191
|
+
|
|
192
|
+
If you encounter package related issues, try removing the following directories and running the install command again:
|
|
168
193
|
|
|
169
194
|
```bash
|
|
170
195
|
$ cd workspace
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import { CloseIcon as
|
|
1
|
+
import { jsxs as i, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import n from "../helpers/classnames.js";
|
|
3
|
+
import { CloseIcon as s } from "../icons/src/CloseIcon.js";
|
|
4
4
|
const o = {
|
|
5
5
|
primary: "bg-primary-lighter text-black",
|
|
6
6
|
secondary: "bg-secondary-lighter text-black",
|
|
@@ -8,18 +8,14 @@ const o = {
|
|
|
8
8
|
warning: "bg-warning-lighter text-black",
|
|
9
9
|
danger: "bg-danger-lighter text-black",
|
|
10
10
|
caution: "bg-caution-lighter text-black"
|
|
11
|
-
}, u = ({ color: r = "primary", children: a, className: l, onClose: e, ...c }) => /* @__PURE__ */
|
|
11
|
+
}, u = ({ color: r = "primary", children: a, className: l, onClose: e, ...c }) => /* @__PURE__ */ i(
|
|
12
12
|
"div",
|
|
13
13
|
{
|
|
14
|
-
className:
|
|
15
|
-
"ui-alert flex items-start rounded px-3 py-3 text-base leading-4",
|
|
16
|
-
o[r],
|
|
17
|
-
l
|
|
18
|
-
),
|
|
14
|
+
className: n("ui-alert flex items-start rounded px-3 py-3 text-base leading-4", o[r], l),
|
|
19
15
|
...c,
|
|
20
16
|
children: [
|
|
21
17
|
/* @__PURE__ */ t("span", { className: "ui-alert-content w-full leading-p1", children: a }),
|
|
22
|
-
e ? /* @__PURE__ */ t("button", { type: "button", className: "ui-alert-close ml-3 cursor-pointer hover:text-gray-dark", children: /* @__PURE__ */ t(
|
|
18
|
+
e ? /* @__PURE__ */ t("button", { type: "button", className: "ui-alert-close ml-3 cursor-pointer hover:text-gray-dark", children: /* @__PURE__ */ t(s, { onClick: e }) }) : null
|
|
23
19
|
]
|
|
24
20
|
}
|
|
25
21
|
);
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
-
import n from "
|
|
3
|
-
import
|
|
2
|
+
import { getInitials as n } from "../helpers/avatar.js";
|
|
3
|
+
import m from "../helpers/classnames.js";
|
|
4
4
|
const o = {
|
|
5
5
|
tiny: "h-7 w-7 text-base",
|
|
6
6
|
small: "h-10 w-10 text-base",
|
|
7
7
|
medium: "h-12 w-12 text-md",
|
|
8
8
|
large: "h-15 w-15 text-xl"
|
|
9
9
|
}, f = ({ name: t, color: e = "bg-primary-lighter", size: r = "large", className: i, ...l }) => {
|
|
10
|
-
const s =
|
|
10
|
+
const s = m(
|
|
11
11
|
"ui-avatar",
|
|
12
12
|
"inline-flex items-center justify-center rounded-full text-black leading-none",
|
|
13
13
|
o[r],
|
|
14
14
|
e,
|
|
15
15
|
i
|
|
16
16
|
);
|
|
17
|
-
return /* @__PURE__ */ a("div", { title: t, className: s, ...l, children:
|
|
17
|
+
return /* @__PURE__ */ a("div", { title: t, className: s, ...l, children: n(t) });
|
|
18
18
|
};
|
|
19
19
|
export {
|
|
20
20
|
f as Avatar
|
|
@@ -10,9 +10,10 @@ declare const colors: {
|
|
|
10
10
|
readonly critical: "bg-danger text-white";
|
|
11
11
|
};
|
|
12
12
|
declare const sizes: {
|
|
13
|
+
readonly tiny: "px-2 py-0.5 h-4 text-xs";
|
|
13
14
|
readonly small: "px-2 py-0.75 h-5 text-sm leading-sm";
|
|
14
15
|
readonly medium: "px-3 py-1.5 h-7.5 text-base leading-base";
|
|
15
|
-
readonly large: "px-3.5 py-0.75 h-
|
|
16
|
+
readonly large: "px-3.5 py-0.75 h-8 text-md leading-md";
|
|
16
17
|
};
|
|
17
18
|
type BadgeColor = keyof typeof colors;
|
|
18
19
|
type BadgeSize = keyof typeof sizes;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import t from "clsx";
|
|
1
|
+
import { jsxs as l } from "react/jsx-runtime";
|
|
3
2
|
import { cloneElement as g } from "react";
|
|
4
|
-
|
|
3
|
+
import r from "../helpers/classnames.js";
|
|
4
|
+
const m = {
|
|
5
5
|
primary: "bg-primary-lighter text-primary-dark",
|
|
6
6
|
secondary: "bg-secondary-lighter text-black",
|
|
7
7
|
success: "bg-success-lightish text-success-darker",
|
|
@@ -10,27 +10,29 @@ const c = {
|
|
|
10
10
|
danger: "bg-danger-lightish text-danger-dark",
|
|
11
11
|
problem: "bg-warning text-white",
|
|
12
12
|
critical: "bg-danger text-white"
|
|
13
|
-
},
|
|
13
|
+
}, c = {
|
|
14
|
+
tiny: "px-2 py-0.5 h-4 text-xs",
|
|
14
15
|
small: "px-2 py-0.75 h-5 text-sm leading-sm",
|
|
15
16
|
medium: "px-3 py-1.5 h-7.5 text-base leading-base",
|
|
16
|
-
large: "px-3.5 py-0.75 h-
|
|
17
|
-
},
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
large: "px-3.5 py-0.75 h-8 text-md leading-md"
|
|
18
|
+
}, d = {
|
|
19
|
+
tiny: "!w-2.5 !h-2.5",
|
|
20
|
+
small: "!w-3 !h-3",
|
|
21
|
+
medium: "!w-4 !h-4",
|
|
22
|
+
large: "!w-4.5 !h-4.5 mr-1"
|
|
23
|
+
}, x = ({ color: a = "primary", size: e = "small", icon: t, children: i, className: n, ...s }) => /* @__PURE__ */ l(
|
|
22
24
|
"span",
|
|
23
25
|
{
|
|
24
|
-
className:
|
|
26
|
+
className: r(
|
|
25
27
|
"ui-badge",
|
|
26
28
|
"inline-flex items-center whitespace-nowrap rounded-full",
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
29
|
+
m[a],
|
|
30
|
+
c[e],
|
|
31
|
+
n
|
|
30
32
|
),
|
|
31
|
-
...
|
|
33
|
+
...s,
|
|
32
34
|
children: [
|
|
33
|
-
|
|
35
|
+
t ? g(t, { className: r("mr-1", d[e]) }) : null,
|
|
34
36
|
i
|
|
35
37
|
]
|
|
36
38
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as t, jsxs as p, Fragment as b } from "react/jsx-runtime";
|
|
2
|
-
import a from "clsx";
|
|
3
2
|
import { Children as s } from "react";
|
|
3
|
+
import a from "../helpers/classnames.js";
|
|
4
4
|
const x = ({ separator: n = "/", children: r, classNames: e = {}, className: o, ...i }) => {
|
|
5
5
|
const d = s.count(r) - 1;
|
|
6
6
|
return /* @__PURE__ */ t("div", { className: a("ui-breadcrumb", "whitespace-nowrap text-2xl font-semibold", o), ...i, children: s.map(r, (u, l) => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as e, jsxs as m } from "react/jsx-runtime";
|
|
2
|
-
import r from "clsx";
|
|
3
2
|
import { isNumber as f } from "lodash-es";
|
|
4
3
|
import { useMemo as S, createContext as v, useContext as h } from "react";
|
|
4
|
+
import r from "../helpers/classnames.js";
|
|
5
5
|
import { Currency as b } from "./Utilities/Currency.js";
|
|
6
6
|
const w = {
|
|
7
7
|
default: "text-gray-darker",
|
|
@@ -12,22 +12,22 @@ const w = {
|
|
|
12
12
|
success: "text-success",
|
|
13
13
|
danger: "text-danger",
|
|
14
14
|
caution: "text-caution"
|
|
15
|
-
}, u = v(void 0), B = ({ currency: a, locale: t, children: s, className:
|
|
15
|
+
}, u = v(void 0), B = ({ currency: a, locale: t, children: s, className: c, ...l }) => {
|
|
16
16
|
const i = S(() => ({ currency: a, locale: t }), [a, t]);
|
|
17
|
-
return /* @__PURE__ */ e(u.Provider, { value: i, children: /* @__PURE__ */ e("table", { className: r("ui-breakdown", "w-full",
|
|
17
|
+
return /* @__PURE__ */ e(u.Provider, { value: i, children: /* @__PURE__ */ e("table", { className: r("ui-breakdown", "w-full", c), ...l, children: /* @__PURE__ */ e("tbody", { children: s }) }) });
|
|
18
18
|
}, k = ({
|
|
19
19
|
info: a,
|
|
20
20
|
methodIcon: t,
|
|
21
21
|
secondary: s,
|
|
22
|
-
value:
|
|
23
|
-
color:
|
|
22
|
+
value: c,
|
|
23
|
+
color: l = "default",
|
|
24
24
|
children: i,
|
|
25
25
|
classNames: d = {},
|
|
26
26
|
className: o,
|
|
27
27
|
...p
|
|
28
28
|
}) => {
|
|
29
|
-
const n = h(u),
|
|
30
|
-
return /* @__PURE__ */ m("tr", { className: r("ui-breakdown-item", w[
|
|
29
|
+
const n = h(u), g = n == null ? void 0 : n.currency, x = n == null ? void 0 : n.locale;
|
|
30
|
+
return /* @__PURE__ */ m("tr", { className: r("ui-breakdown-item", w[l], o), ...p, children: [
|
|
31
31
|
/* @__PURE__ */ m("td", { colSpan: 2, className: r("break-words text-left leading-none", d.key), children: [
|
|
32
32
|
/* @__PURE__ */ e("span", { className: "mr-0.5", children: t }),
|
|
33
33
|
/* @__PURE__ */ e("span", { className: r("mr-1 break-normal md:break-all", d.children), children: i ?? "" }),
|
|
@@ -36,17 +36,17 @@ const w = {
|
|
|
36
36
|
s && /* @__PURE__ */ e("span", { className: "empty:hidden", children: s })
|
|
37
37
|
] })
|
|
38
38
|
] }),
|
|
39
|
-
/* @__PURE__ */ e("td", { className: r("w-[1%] whitespace-nowrap pl-4 text-right", d.value), children: f(
|
|
39
|
+
/* @__PURE__ */ e("td", { className: r("w-[1%] whitespace-nowrap pl-4 text-right", d.value), children: f(c) ? /* @__PURE__ */ e(
|
|
40
40
|
b,
|
|
41
41
|
{
|
|
42
42
|
shouldRemoveTrailingZeroes: !1,
|
|
43
|
-
currency:
|
|
44
|
-
locale:
|
|
43
|
+
currency: g,
|
|
44
|
+
locale: x,
|
|
45
45
|
compact: void 0,
|
|
46
46
|
isNarrowSymbolForm: void 0,
|
|
47
|
-
children:
|
|
47
|
+
children: c
|
|
48
48
|
}
|
|
49
|
-
) : /* @__PURE__ */ e("span", { children:
|
|
49
|
+
) : /* @__PURE__ */ e("span", { children: c }) })
|
|
50
50
|
] });
|
|
51
51
|
};
|
|
52
52
|
k.displayName = "Breakdown.Item";
|
|
@@ -54,16 +54,16 @@ const y = ({
|
|
|
54
54
|
info: a,
|
|
55
55
|
value: t,
|
|
56
56
|
color: s = "black",
|
|
57
|
-
children:
|
|
58
|
-
classNames:
|
|
57
|
+
children: c,
|
|
58
|
+
classNames: l = {},
|
|
59
59
|
className: i,
|
|
60
60
|
...d
|
|
61
61
|
}) => {
|
|
62
62
|
const o = h(u), p = o == null ? void 0 : o.currency, n = o == null ? void 0 : o.locale;
|
|
63
63
|
return /* @__PURE__ */ m("tr", { className: r("ui-breakdown-subtotal-item", "font-bold", w[s], i), ...d, children: [
|
|
64
|
-
/* @__PURE__ */ e("td", { className: r("pb-4 pt-1 text-left",
|
|
65
|
-
/* @__PURE__ */ e("td", { className: r("whitespace-nowrap pb-4 pt-1 text-right",
|
|
66
|
-
/* @__PURE__ */ e("td", { className: r("w-[1%] whitespace-nowrap pb-4 pl-4 pt-1 text-right",
|
|
64
|
+
/* @__PURE__ */ e("td", { className: r("pb-4 pt-1 text-left", l.children), children: c }),
|
|
65
|
+
/* @__PURE__ */ e("td", { className: r("whitespace-nowrap pb-4 pt-1 text-right", l.info), children: a }),
|
|
66
|
+
/* @__PURE__ */ e("td", { className: r("w-[1%] whitespace-nowrap pb-4 pl-4 pt-1 text-right", l.value), children: /* @__PURE__ */ e(
|
|
67
67
|
b,
|
|
68
68
|
{
|
|
69
69
|
shouldRemoveTrailingZeroes: !1,
|
|
@@ -77,12 +77,12 @@ const y = ({
|
|
|
77
77
|
] });
|
|
78
78
|
};
|
|
79
79
|
y.displayName = "Breakdown.SubtotalItem";
|
|
80
|
-
const
|
|
81
|
-
|
|
80
|
+
const N = ({ className: a, ...t }) => /* @__PURE__ */ e("tr", { className: r("ui-breakdown-separator", a), ...t, children: /* @__PURE__ */ e("td", { colSpan: 3, className: "border-b border-gray-light pb-1" }) });
|
|
81
|
+
N.displayName = "Breakdown.Separator";
|
|
82
82
|
const T = Object.assign(B, {
|
|
83
83
|
Item: k,
|
|
84
84
|
SubtotalItem: y,
|
|
85
|
-
Separator:
|
|
85
|
+
Separator: N
|
|
86
86
|
});
|
|
87
87
|
export {
|
|
88
88
|
T as Breakdown
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as d, jsxs as g } from "react/jsx-runtime";
|
|
2
|
-
import m from "clsx";
|
|
3
2
|
import x, { Children as h, cloneElement as y } from "react";
|
|
3
|
+
import m from "../../helpers/classnames.js";
|
|
4
4
|
const B = {
|
|
5
5
|
small: "px-2 py-1.5 text-sm",
|
|
6
6
|
medium: "py-3 px-2.5 text-base",
|
|
@@ -8,47 +8,47 @@ const B = {
|
|
|
8
8
|
}, k = ({
|
|
9
9
|
size: i,
|
|
10
10
|
value: e,
|
|
11
|
-
isCollapsed:
|
|
11
|
+
isCollapsed: a = !1,
|
|
12
12
|
children: p,
|
|
13
|
-
className:
|
|
13
|
+
className: u,
|
|
14
14
|
onChange: t,
|
|
15
15
|
...n
|
|
16
|
-
}) => /* @__PURE__ */ d("span", { className: m("ui-button-group", "inline-flex whitespace-nowrap",
|
|
16
|
+
}) => /* @__PURE__ */ d("span", { className: m("ui-button-group", "inline-flex whitespace-nowrap", u), ...n, children: h.map(p, (r, s) => {
|
|
17
17
|
if (!x.isValidElement(r) || r.props.isHidden)
|
|
18
18
|
return null;
|
|
19
|
-
const
|
|
20
|
-
return e !== void 0 && (
|
|
21
|
-
}) }),
|
|
19
|
+
const o = { size: i };
|
|
20
|
+
return e !== void 0 && (o.isActive = e === s), a && e >= 0 && e !== s && (o.shouldShowText = !1), t && (o.onClick = () => t(s)), y(r, o);
|
|
21
|
+
}) }), c = ({
|
|
22
22
|
as: i,
|
|
23
23
|
isActive: e,
|
|
24
|
-
shouldShowText:
|
|
24
|
+
shouldShowText: a = !0,
|
|
25
25
|
/* eslint-disable-next-line @typescript-eslint/no-unused-vars */
|
|
26
26
|
isHidden: p = !1,
|
|
27
|
-
size:
|
|
27
|
+
size: u = "medium",
|
|
28
28
|
icon: t,
|
|
29
29
|
iconPlacement: n = "left",
|
|
30
30
|
children: r,
|
|
31
|
-
className:
|
|
32
|
-
...
|
|
31
|
+
className: s,
|
|
32
|
+
...o
|
|
33
33
|
}) => {
|
|
34
|
-
const
|
|
34
|
+
const f = i ?? "button", l = { ...o };
|
|
35
35
|
delete l.isActive, delete l.shouldShowText, delete l.isHidden;
|
|
36
36
|
const b = m(
|
|
37
37
|
"ui-button-group-button",
|
|
38
38
|
"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
|
-
B[
|
|
39
|
+
B[u],
|
|
40
40
|
e ? "bg-primary border-primary text-white hover:bg-primary-dark" : "border-gray-light hover:bg-gray-lighter text-gray-darker",
|
|
41
|
-
|
|
41
|
+
s
|
|
42
42
|
);
|
|
43
|
-
return /* @__PURE__ */ g(
|
|
43
|
+
return /* @__PURE__ */ g(f, { className: b, ...l, children: [
|
|
44
44
|
t && n === "left" ? /* @__PURE__ */ d("span", { className: "mr-2 flex-shrink-0", children: t }) : null,
|
|
45
|
-
|
|
45
|
+
a ? r : t ? null : r,
|
|
46
46
|
t && n === "right" ? /* @__PURE__ */ d("span", { className: "ml-2 flex-shrink-0", children: t }) : null
|
|
47
47
|
] });
|
|
48
48
|
};
|
|
49
|
-
|
|
49
|
+
c.displayName = "ButtonGroup.Button";
|
|
50
50
|
const j = Object.assign(k, {
|
|
51
|
-
Button:
|
|
51
|
+
Button: c
|
|
52
52
|
});
|
|
53
53
|
export {
|
|
54
54
|
j as ButtonGroup
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { jsxs as l, jsx as
|
|
1
|
+
import { jsxs as l, jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import { Transition as g } from "@headlessui/react";
|
|
3
|
-
import o from "clsx";
|
|
4
3
|
import { useState as y, useEffect as b } from "react";
|
|
5
|
-
import
|
|
6
|
-
import { Spinner as
|
|
4
|
+
import s from "../../helpers/classnames.js";
|
|
5
|
+
import { Spinner as d } from "../Spinner.js";
|
|
7
6
|
import { Button as w } from "./Button.js";
|
|
7
|
+
import { CheckIcon as x } from "../../icons/src/CheckIcon.js";
|
|
8
8
|
const N = {
|
|
9
9
|
primary: "!bg-primary-light",
|
|
10
10
|
secondary: "!bg-secondary-light",
|
|
@@ -38,13 +38,13 @@ const N = {
|
|
|
38
38
|
color: i,
|
|
39
39
|
variant: n,
|
|
40
40
|
disabled: t || m,
|
|
41
|
-
className:
|
|
41
|
+
className: s(u, "relative", t && N[i]),
|
|
42
42
|
...f,
|
|
43
43
|
children: [
|
|
44
|
-
/* @__PURE__ */
|
|
44
|
+
/* @__PURE__ */ o(
|
|
45
45
|
"span",
|
|
46
46
|
{
|
|
47
|
-
className:
|
|
47
|
+
className: s(
|
|
48
48
|
"absolute inset-0 flex items-center justify-center",
|
|
49
49
|
t ? "opacity-100" : "opacity-0"
|
|
50
50
|
),
|
|
@@ -58,22 +58,22 @@ const N = {
|
|
|
58
58
|
enterFrom: "opacity-0",
|
|
59
59
|
enterTo: "opacity-100",
|
|
60
60
|
children: [
|
|
61
|
-
r && /* @__PURE__ */
|
|
62
|
-
|
|
61
|
+
r && /* @__PURE__ */ o(
|
|
62
|
+
x,
|
|
63
63
|
{
|
|
64
64
|
size: "medium",
|
|
65
|
-
className:
|
|
65
|
+
className: s("relative -top-0.25 text-white", {
|
|
66
66
|
"text-black": n === "outline"
|
|
67
67
|
})
|
|
68
68
|
}
|
|
69
69
|
),
|
|
70
|
-
e && !r && /* @__PURE__ */
|
|
70
|
+
e && !r && /* @__PURE__ */ o(d, { size: "current", color: "current", className: "relative -top-0.25 text-white" })
|
|
71
71
|
]
|
|
72
72
|
}
|
|
73
73
|
)
|
|
74
74
|
}
|
|
75
75
|
),
|
|
76
|
-
/* @__PURE__ */
|
|
76
|
+
/* @__PURE__ */ o("span", { className: s(t ? "flex-shrink flex-grow opacity-0" : "opacity-100"), children: p })
|
|
77
77
|
]
|
|
78
78
|
}
|
|
79
79
|
);
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { jsx as s, jsxs as X, Fragment as kt } from "react/jsx-runtime";
|
|
2
|
-
import Dt from "clsx";
|
|
3
2
|
import Y from "dayjs";
|
|
4
3
|
import { isArray as h, isFunction as M } from "lodash-es";
|
|
5
|
-
import { useContext as
|
|
6
|
-
import { isBefore as C, startOfDay as b, endOfDay as v, isAfter as tt, isSameDay as
|
|
7
|
-
import { Tooltip as
|
|
8
|
-
import { RelativeDateRange as
|
|
9
|
-
import { MonthSelector as
|
|
10
|
-
import { UpcomingDatePicker as
|
|
11
|
-
import { now as f, isSame as L, isValidTimeZoneName as
|
|
12
|
-
import { Context as
|
|
4
|
+
import { useContext as Dt, useState as N, useEffect as yt, useCallback as V, useMemo as jt } from "react";
|
|
5
|
+
import { isBefore as C, startOfDay as b, endOfDay as v, isAfter as tt, isSameDay as Rt } from "date-fns";
|
|
6
|
+
import { Tooltip as Nt } from "../Tooltip.js";
|
|
7
|
+
import { RelativeDateRange as Vt } from "./RelativeDateRange.js";
|
|
8
|
+
import { MonthSelector as Lt } from "./MonthSelector.js";
|
|
9
|
+
import { UpcomingDatePicker as Ot } from "./UpcomingDatePicker.js";
|
|
10
|
+
import { now as f, isSame as L, isValidTimeZoneName as St, toDate as l } from "../../helpers/date.js";
|
|
11
|
+
import { Context as Et } from "../Provider.js";
|
|
12
|
+
import Ft from "../../helpers/classnames.js";
|
|
13
13
|
import { Day as rt } from "./Day.js";
|
|
14
14
|
import { LocalizedDayPicker as _t } from "./LocalizedDayPicker.js";
|
|
15
15
|
import { MonthYearSelector as Tt } from "./MonthYearSelector.js";
|
|
@@ -44,9 +44,9 @@ const P = {
|
|
|
44
44
|
...H
|
|
45
45
|
}) => {
|
|
46
46
|
var K, Q;
|
|
47
|
-
const { locale: j } =
|
|
48
|
-
|
|
49
|
-
u && !
|
|
47
|
+
const { locale: j } = Dt(Et), o = u ?? void 0, st = r ? U === P.single ? r : r.from : null, [d, _] = N(it ?? st ?? f(void 0, o).toDate()), [mt, Z] = N(() => !r || typeof r != "object" || !("from" in r) || !r.from ? /* @__PURE__ */ new Date() : r.from), [lt, $] = N(() => !r || typeof r != "object" || !("from" in r) || !("to" in r) || !r.to || !r.from ? f(void 0, o).add(1, "month").toDate() : L(f(r.to, o), f(r.from, o), "month") ? f(r.from, o).add(1, "month").toDate() : r.to), [ct, at] = N(""), p = U === P.range, R = r && typeof r == "object" && "from" in r && "to" in r && r.from && r.to, dt = c && typeof c == "object" && "from" in c && "to" in c && c.from && c.to;
|
|
48
|
+
yt(() => {
|
|
49
|
+
u && !St(u) && (console.log(`${u} is not a valid timezone. Using default timezone now`), Y.tz.setDefault());
|
|
50
50
|
}, [u]);
|
|
51
51
|
const q = (t, e, m) => {
|
|
52
52
|
if (p)
|
|
@@ -91,7 +91,7 @@ const P = {
|
|
|
91
91
|
} else if (n.from && C(b(n.from), b(l(f(t, o))))) {
|
|
92
92
|
const w = n.from, B = v(l(f(t, o), !1));
|
|
93
93
|
a({ from: w, to: B }, e, m);
|
|
94
|
-
} else if (n.from && (tt(b(n.from), b(l(f(t, o)))) ||
|
|
94
|
+
} else if (n.from && (tt(b(n.from), b(l(f(t, o)))) || Rt(n.from, l(f(t, o)))))
|
|
95
95
|
a(
|
|
96
96
|
{
|
|
97
97
|
from: l(f(t, o)),
|
|
@@ -109,8 +109,8 @@ const P = {
|
|
|
109
109
|
},
|
|
110
110
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
111
111
|
[p, R, a, o, r]
|
|
112
|
-
), I =
|
|
113
|
-
|
|
112
|
+
), I = jt(() => (O || S) && d ? (t) => S ? /* @__PURE__ */ s(
|
|
113
|
+
Lt,
|
|
114
114
|
{
|
|
115
115
|
date: t.date || d,
|
|
116
116
|
currentMonth: d,
|
|
@@ -127,7 +127,7 @@ const P = {
|
|
|
127
127
|
}
|
|
128
128
|
) : void 0, [O, S, d, g, D, j]), xt = (t) => {
|
|
129
129
|
const e = y == null ? void 0 : y(t), m = T(t), n = bt(t);
|
|
130
|
-
return e ? /* @__PURE__ */ s(
|
|
130
|
+
return e ? /* @__PURE__ */ s(Nt, { placement: "top", content: e, children: /* @__PURE__ */ s(
|
|
131
131
|
rt,
|
|
132
132
|
{
|
|
133
133
|
disabled: m,
|
|
@@ -152,7 +152,7 @@ const P = {
|
|
|
152
152
|
return /* @__PURE__ */ X(kt, { children: [
|
|
153
153
|
/* @__PURE__ */ X("div", { className: "flex", children: [
|
|
154
154
|
W ? /* @__PURE__ */ s(
|
|
155
|
-
|
|
155
|
+
Ot,
|
|
156
156
|
{
|
|
157
157
|
upcomingDates: W,
|
|
158
158
|
value: r,
|
|
@@ -184,7 +184,7 @@ const P = {
|
|
|
184
184
|
) : /* @__PURE__ */ s(
|
|
185
185
|
_t,
|
|
186
186
|
{
|
|
187
|
-
className:
|
|
187
|
+
className: Ft("pt-6 tracking-tightest rounded-lg ring-0 focus:outline-none focus:ring-0"),
|
|
188
188
|
mode: "single",
|
|
189
189
|
selected: r,
|
|
190
190
|
month: d,
|
|
@@ -224,7 +224,7 @@ const P = {
|
|
|
224
224
|
] }),
|
|
225
225
|
z.Footer ? /* @__PURE__ */ s(z.Footer, {}) : null,
|
|
226
226
|
et && /* @__PURE__ */ s("div", { className: "max-w-200 ", children: /* @__PURE__ */ s("div", { className: "ml-auto w-5/12", children: /* @__PURE__ */ s(
|
|
227
|
-
|
|
227
|
+
Vt,
|
|
228
228
|
{
|
|
229
229
|
value: ct,
|
|
230
230
|
ranges: nt,
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import y from "clsx";
|
|
1
|
+
import { jsxs as x, jsx as e } from "react/jsx-runtime";
|
|
3
2
|
import { useState as m, useEffect as E, cloneElement as L, forwardRef as A } from "react";
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
3
|
+
import { formatDate as M } from "../../helpers/date.js";
|
|
4
|
+
import y from "../../helpers/classnames.js";
|
|
5
|
+
import { Input as W } from "../Forms/Input.js";
|
|
6
|
+
import { Popover as D } from "../Popover/Popover.js";
|
|
7
|
+
import { DatePicker as q } from "./DatePicker.js";
|
|
8
|
+
import { MonthPicker as B } from "./MonthPicker.js";
|
|
9
|
+
import { CalendarIcon as F } from "../../icons/src/CalendarIcon.js";
|
|
10
|
+
import { DownArrowIcon as G } from "../../icons/src/DownArrowIcon.js";
|
|
11
11
|
const $ = ({
|
|
12
12
|
value: t,
|
|
13
13
|
variant: r = "single",
|
|
@@ -33,8 +33,8 @@ const $ = ({
|
|
|
33
33
|
};
|
|
34
34
|
return E(() => {
|
|
35
35
|
f(t);
|
|
36
|
-
}, [t]), /* @__PURE__ */
|
|
37
|
-
|
|
36
|
+
}, [t]), /* @__PURE__ */ x(
|
|
37
|
+
D,
|
|
38
38
|
{
|
|
39
39
|
visible: c,
|
|
40
40
|
maxWidth: 900,
|
|
@@ -49,14 +49,14 @@ const $ = ({
|
|
|
49
49
|
{
|
|
50
50
|
readOnly: !0,
|
|
51
51
|
size: "medium",
|
|
52
|
-
value: t ?
|
|
52
|
+
value: t ? M(t, l) : "",
|
|
53
53
|
placeholder: V,
|
|
54
54
|
className: o == null ? void 0 : o.input,
|
|
55
55
|
onClick: s
|
|
56
56
|
}
|
|
57
57
|
),
|
|
58
|
-
/* @__PURE__ */ e(
|
|
59
|
-
|
|
58
|
+
/* @__PURE__ */ e(D.Content, { className: "pr-1", children: c && (N === "month" ? /* @__PURE__ */ e(B, { value: t, onChange: a, ...p }) : /* @__PURE__ */ e(
|
|
59
|
+
q,
|
|
60
60
|
{
|
|
61
61
|
variant: r,
|
|
62
62
|
getDayContent: S,
|
|
@@ -70,10 +70,10 @@ const $ = ({
|
|
|
70
70
|
]
|
|
71
71
|
}
|
|
72
72
|
);
|
|
73
|
-
}, I = A(({ className: t, ...r }, l) => /* @__PURE__ */
|
|
74
|
-
/* @__PURE__ */ e("div", { className: "pointer-events-none absolute inset-0 flex items-center pl-3", children: /* @__PURE__ */ e(
|
|
75
|
-
/* @__PURE__ */ e(
|
|
76
|
-
/* @__PURE__ */ e("div", { className: "pointer-events-none absolute inset-y-0 right-0 flex items-center pr-3", children: /* @__PURE__ */ e(
|
|
73
|
+
}, I = A(({ className: t, ...r }, l) => /* @__PURE__ */ x("div", { ref: l, className: "relative flex bg-gray-lighter", children: [
|
|
74
|
+
/* @__PURE__ */ e("div", { className: "pointer-events-none absolute inset-0 flex items-center pl-3", children: /* @__PURE__ */ e(F, { className: "z-10 inline-block" }) }),
|
|
75
|
+
/* @__PURE__ */ e(W, { className: y("no-translate cursor-pointer px-8", t), ...r }),
|
|
76
|
+
/* @__PURE__ */ e("div", { className: "pointer-events-none absolute inset-y-0 right-0 flex items-center pr-3", children: /* @__PURE__ */ e(G, { className: "inline-block" }) })
|
|
77
77
|
] }));
|
|
78
78
|
I.displayName = "DefaultInput";
|
|
79
79
|
export {
|