@xola/ui-kit 3.0.8 → 3.4.1
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 +61 -12
- package/build/components/Alert.d.ts +18 -0
- package/build/components/Alert.js +28 -0
- package/build/components/Animation/FadeIn.d.ts +13 -0
- package/build/components/Animation/FadeIn.js +29 -0
- package/build/components/Animation/SlideDown.d.ts +6 -0
- package/build/components/Animation/SlideDown.js +20 -0
- package/build/components/Avatar.d.ts +16 -0
- package/build/components/Avatar.js +21 -0
- package/build/components/Badge.d.ts +27 -0
- package/build/components/Badge.js +40 -0
- package/build/components/Breadcrumb.d.ts +21 -0
- package/build/components/Breadcrumb.js +27 -0
- package/build/components/Breakdown.d.ts +63 -0
- package/build/components/Breakdown.js +89 -0
- package/build/components/Buttons/Button.d.ts +53 -0
- package/build/components/Buttons/Button.js +83 -0
- package/build/components/Buttons/ButtonGroup.d.ts +35 -0
- package/build/components/Buttons/ButtonGroup.js +55 -0
- package/build/components/Buttons/SubmitButton.d.ts +11 -0
- package/build/components/Buttons/SubmitButton.js +83 -0
- package/build/components/Buttons/ToggleButton.d.ts +21 -0
- package/build/components/Buttons/ToggleButton.js +34 -0
- package/build/components/Charts/BaseChartOptions.d.ts +136 -0
- package/build/components/Charts/BaseChartOptions.js +95 -0
- package/build/components/Charts/HistogramOptions.d.ts +192 -0
- package/build/components/Charts/HistogramOptions.js +69 -0
- package/build/components/Charts/PieOptions.d.ts +177 -0
- package/build/components/Charts/PieOptions.js +55 -0
- package/build/components/Counter.d.ts +5 -0
- package/build/components/Counter.js +16 -0
- package/build/components/DatePicker/DatePicker.d.ts +41 -0
- package/build/components/DatePicker/DatePicker.helpers.d.ts +17 -0
- package/build/components/DatePicker/DatePicker.helpers.js +22 -0
- package/build/components/DatePicker/DatePicker.js +241 -0
- package/build/components/DatePicker/DatePickerPopover.d.ts +29 -0
- package/build/components/DatePicker/DatePickerPopover.js +81 -0
- package/build/components/DatePicker/Day.d.ts +13 -0
- package/build/components/DatePicker/Day.js +40 -0
- package/build/components/DatePicker/LocalizedDayPicker.d.ts +6 -0
- package/build/components/DatePicker/LocalizedDayPicker.js +20 -0
- package/build/components/DatePicker/MonthGrid.d.ts +11 -0
- package/build/components/DatePicker/MonthGrid.js +52 -0
- package/build/components/DatePicker/MonthPicker.d.ts +7 -0
- package/build/components/DatePicker/MonthPicker.js +28 -0
- package/build/components/DatePicker/MonthSelector.d.ts +8 -0
- package/build/components/DatePicker/MonthSelector.js +47 -0
- package/build/components/DatePicker/MonthYearSelector.d.ts +8 -0
- package/build/components/DatePicker/MonthYearSelector.js +44 -0
- package/build/components/DatePicker/NavbarElement.d.ts +15 -0
- package/build/components/DatePicker/NavbarElement.js +43 -0
- package/build/components/DatePicker/RangeDatePicker.d.ts +25 -0
- package/build/components/DatePicker/RangeDatePicker.js +134 -0
- package/build/components/DatePicker/RelativeDateRange.d.ts +51 -0
- package/build/components/DatePicker/RelativeDateRange.js +280 -0
- package/build/components/DatePicker/UpcomingDatePicker.d.ts +11 -0
- package/build/components/DatePicker/UpcomingDatePicker.js +27 -0
- package/build/components/Dot/Dot.d.ts +24 -0
- package/build/components/Dot/Dot.js +24 -0
- package/build/components/Dot/DotProgress.d.ts +6 -0
- package/build/components/Dot/DotProgress.js +10 -0
- package/build/components/Drawer.d.ts +28 -0
- package/build/components/Drawer.js +126 -0
- package/build/components/Forms/BaseInput.d.ts +20 -0
- package/build/components/Forms/BaseInput.js +41 -0
- package/build/components/Forms/Checkbox.d.ts +10 -0
- package/build/components/Forms/Checkbox.js +34 -0
- package/build/components/Forms/Checkbox.module.css.js +7 -0
- package/build/components/Forms/ComboBox.d.ts +8 -0
- package/build/components/Forms/ComboBox.js +41 -0
- package/build/components/Forms/FormGroup.d.ts +5 -0
- package/build/components/Forms/FormGroup.js +6 -0
- package/build/components/Forms/InlineValuePopover.d.ts +17 -0
- package/build/components/Forms/InlineValuePopover.js +47 -0
- package/build/components/Forms/Input.d.ts +6 -0
- package/build/components/Forms/Input.js +9 -0
- package/build/components/Forms/Label.d.ts +7 -0
- package/build/components/Forms/Label.js +17 -0
- package/build/components/Forms/RangeSlider.d.ts +33 -0
- package/build/components/Forms/RangeSlider.js +39 -0
- package/build/components/Forms/Select.d.ts +5 -0
- package/build/components/Forms/Select.js +8 -0
- package/build/components/Forms/Switch.d.ts +46 -0
- package/build/components/Forms/Switch.js +62 -0
- package/build/components/Forms/Textarea.d.ts +6 -0
- package/build/components/Forms/Textarea.js +35 -0
- package/build/components/Forms/ValuePopoverText.d.ts +6 -0
- package/build/components/Forms/ValuePopoverText.js +10 -0
- package/build/components/GooglePlacesAutocomplete.d.ts +14 -0
- package/build/components/HeaderToolbar.d.ts +21 -0
- package/build/components/HeaderToolbar.js +33 -0
- package/build/components/ImageUpload.d.ts +17 -0
- package/build/components/ImageUpload.js +86 -0
- package/build/components/Key.d.ts +6 -0
- package/build/components/Key.js +28 -0
- package/build/components/Logo.d.ts +19 -0
- package/build/components/Logo.js +10 -0
- package/build/components/Modal.d.ts +52 -0
- package/build/components/Modal.js +126 -0
- package/build/components/Popover/Popover.d.ts +20 -0
- package/build/components/Popover/Popover.js +50 -0
- package/build/components/Popover/Popover.module.css.js +7 -0
- package/build/components/Popover/PopoverList.d.ts +25 -0
- package/build/components/Popover/PopoverList.js +59 -0
- package/build/components/Popover/PopoverScroll.module.css.js +4 -0
- package/build/components/Provider.d.ts +18 -0
- package/build/components/Provider.js +17 -0
- package/build/components/Screens/Login.d.ts +25 -0
- package/build/components/Screens/Login.js +144 -0
- package/build/components/Search.d.ts +16 -0
- package/build/components/Search.js +174 -0
- package/build/components/Sidebar/Sidebar.Account.d.ts +13 -0
- package/build/components/Sidebar/Sidebar.Account.js +56 -0
- package/build/components/Sidebar/Sidebar.Button.d.ts +10 -0
- package/build/components/Sidebar/Sidebar.Button.js +21 -0
- package/build/components/Sidebar/Sidebar.Footer.d.ts +8 -0
- package/build/components/Sidebar/Sidebar.Footer.js +9 -0
- package/build/components/Sidebar/Sidebar.Heading.d.ts +10 -0
- package/build/components/Sidebar/Sidebar.Heading.js +10 -0
- package/build/components/Sidebar/Sidebar.Link.d.ts +24 -0
- package/build/components/Sidebar/Sidebar.Link.js +56 -0
- package/build/components/Sidebar/Sidebar.Menu.d.ts +10 -0
- package/build/components/Sidebar/Sidebar.Menu.js +28 -0
- package/build/components/Sidebar/Sidebar.Menu.module.css.js +7 -0
- package/build/components/Sidebar/Sidebar.d.ts +58 -0
- package/build/components/Sidebar/Sidebar.js +218 -0
- package/build/components/Sidebar/SidebarScroll.module.css.js +4 -0
- package/build/components/Sidebar/index.d.ts +8 -0
- package/build/components/Skeleton.d.ts +13 -0
- package/build/components/Skeleton.js +29 -0
- package/build/components/Skeleton.module.css.js +7 -0
- package/build/components/Spinner.d.ts +26 -0
- package/build/components/Spinner.js +27 -0
- package/build/components/Table.d.ts +59 -0
- package/build/components/Table.js +71 -0
- package/build/components/Tabs/Tabs.Panel.d.ts +9 -0
- package/build/components/Tabs/Tabs.Panel.js +7 -0
- package/build/components/Tabs/Tabs.Tab.d.ts +19 -0
- package/build/components/Tabs/Tabs.Tab.js +37 -0
- package/build/components/Tabs/Tabs.d.ts +27 -0
- package/build/components/Tabs/Tabs.js +28 -0
- package/build/components/Tabs/index.d.ts +4 -0
- package/build/components/Tag.d.ts +25 -0
- package/build/components/Tag.js +36 -0
- package/build/components/Tooltip.d.ts +8 -0
- package/build/components/Tooltip.js +8 -0
- package/build/components/Utilities/Currency.d.ts +32 -0
- package/build/components/Utilities/Currency.js +49 -0
- package/build/components/Utilities/Number.d.ts +8 -0
- package/build/components/Utilities/Number.js +15 -0
- package/build/components/Utilities/Phone.d.ts +8 -0
- package/build/components/Utilities/Phone.js +19 -0
- package/build/helpers/avatar.d.ts +1 -0
- package/build/helpers/avatar.js +8 -0
- package/build/helpers/browser.d.ts +2 -0
- package/build/helpers/browser.js +9 -0
- package/build/helpers/children.d.ts +3 -0
- package/build/helpers/children.js +6 -0
- package/build/helpers/classnames.d.ts +5 -0
- package/build/helpers/currency.d.ts +2 -0
- package/build/helpers/currency.js +11 -0
- package/build/helpers/date.d.ts +12 -0
- package/build/helpers/date.js +44 -0
- package/build/helpers/flash.d.ts +21 -0
- package/build/helpers/flash.js +87 -0
- package/build/helpers/numbers.d.ts +4 -0
- package/build/helpers/numbers.js +23 -0
- package/build/helpers/phone.d.ts +11 -0
- package/build/helpers/phone.js +25 -0
- package/build/hooks/useId.d.ts +1 -0
- package/build/hooks/useId.js +9 -0
- package/build/hooks/useIsClient.d.ts +1 -0
- package/build/hooks/useIsClient.js +10 -0
- package/build/hooks/useViewportHeight.d.ts +1 -0
- package/build/hooks/useViewportHeight.js +15 -0
- package/build/icons/build/AnnounceIcon.js +6 -0
- package/build/icons/build/BellIcon.js +23 -0
- package/build/icons/build/CalendarIcon.js +15 -0
- package/build/icons/build/CheckIcon.js +7 -0
- package/build/icons/build/ChevronDownIcon.js +7 -0
- package/build/icons/build/ChevronLeftIcon.js +7 -0
- package/build/icons/build/ChevronRightIcon.js +7 -0
- package/build/icons/build/CircleNotch.js +5 -0
- package/build/icons/build/CloseIcon.js +7 -0
- package/build/icons/build/DownArrowIcon.js +15 -0
- package/build/icons/build/ImageIcon.js +23 -0
- package/build/icons/build/SearchIcon.js +15 -0
- package/build/icons/build/TrashIcon.js +16 -0
- package/build/icons/build/WarningDiamondIcon.js +23 -0
- package/build/icons/build/helpers/classnames.js +8 -0
- package/build/icons/build/helpers/icon.js +10 -0
- package/build/icons/build/helpers/iconSizes.js +13 -0
- package/build/icons/build/images/XolaLogoSimple.js +13 -0
- package/build/index.d.ts +66 -0
- package/build/index.js +142 -0
- package/build/theme.d.ts +413 -0
- package/build/theme.js +372 -0
- package/build/types/index.d.ts +22 -0
- package/build/types/migration.d.ts +2 -0
- package/build/ui-kit.css +1 -0
- package/build/utils/avatar.d.ts +1 -0
- package/build/utils/avatar.js +8 -0
- package/build/utils/currency.d.ts +2 -0
- package/build/utils/currency.js +11 -0
- package/build/utils/date.d.ts +12 -0
- package/build/utils/date.js +23 -0
- package/build/utils/index.d.ts +5 -0
- package/build/utils/numbers.d.ts +4 -0
- package/build/utils/numbers.js +19 -0
- package/build/utils/phone.d.ts +2 -0
- package/build/utils/phone.js +17 -0
- package/package.json +76 -49
- package/postcss.config.js +1 -1
- package/tailwind.config.js +28 -8
- package/build/style.css +0 -1
- package/build/ui-kit.es.js +0 -12173
- package/index.d.ts +0 -72
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { jsx as e, jsxs as n } from "react/jsx-runtime";
|
|
2
|
+
import { Transition as o, Dialog as s } from "@headlessui/react";
|
|
3
|
+
import l from "clsx";
|
|
4
|
+
import { forwardRef as v, Fragment as m } from "react";
|
|
5
|
+
import { isIosBrowser as g } from "../helpers/browser.js";
|
|
6
|
+
import { useViewportHeight as y } from "../hooks/useViewportHeight.js";
|
|
7
|
+
import { CloseIcon as b } from "../icons/build/CloseIcon.js";
|
|
8
|
+
import { Button as N } from "./Buttons/Button.js";
|
|
9
|
+
const T = {
|
|
10
|
+
small: "w-72",
|
|
11
|
+
medium: "w-85",
|
|
12
|
+
large: "w-110",
|
|
13
|
+
xl: "w-200",
|
|
14
|
+
"2xl": "w-screen md:max-w-screen-md 2xl:max-w-screen-lg"
|
|
15
|
+
// This was the old size
|
|
16
|
+
}, F = v(
|
|
17
|
+
({
|
|
18
|
+
isOpen: i = !1,
|
|
19
|
+
title: f,
|
|
20
|
+
size: u = "medium",
|
|
21
|
+
content: x,
|
|
22
|
+
sideIndent: h = 0,
|
|
23
|
+
position: r = "right",
|
|
24
|
+
classNames: t = {},
|
|
25
|
+
onClose: a
|
|
26
|
+
}, w) => {
|
|
27
|
+
const d = y(), p = g();
|
|
28
|
+
return /* @__PURE__ */ e(o.Root, { show: i, as: m, children: /* @__PURE__ */ e(
|
|
29
|
+
s,
|
|
30
|
+
{
|
|
31
|
+
ref: w,
|
|
32
|
+
as: "div",
|
|
33
|
+
className: l("ui-drawer fixed inset-0 z-10 overflow-hidden", t.dialog),
|
|
34
|
+
open: i,
|
|
35
|
+
onClose: a,
|
|
36
|
+
children: /* @__PURE__ */ n(
|
|
37
|
+
"div",
|
|
38
|
+
{
|
|
39
|
+
className: l(
|
|
40
|
+
"flex",
|
|
41
|
+
p ? `h-[${d}px] max-h-[${d}px] w-full` : "h-screen w-full"
|
|
42
|
+
),
|
|
43
|
+
children: [
|
|
44
|
+
/* @__PURE__ */ e(
|
|
45
|
+
o.Child,
|
|
46
|
+
{
|
|
47
|
+
as: m,
|
|
48
|
+
enter: "ease-in-out duration-500",
|
|
49
|
+
enterFrom: "opacity-0",
|
|
50
|
+
enterTo: "opacity-100",
|
|
51
|
+
leave: "ease-in-out duration-500",
|
|
52
|
+
leaveFrom: "opacity-100",
|
|
53
|
+
leaveTo: "opacity-0",
|
|
54
|
+
children: /* @__PURE__ */ e(
|
|
55
|
+
s.Overlay,
|
|
56
|
+
{
|
|
57
|
+
className: l(
|
|
58
|
+
"absolute inset-0 bg-black bg-opacity-80 transition-opacity",
|
|
59
|
+
t.overlay
|
|
60
|
+
)
|
|
61
|
+
}
|
|
62
|
+
)
|
|
63
|
+
}
|
|
64
|
+
),
|
|
65
|
+
/* @__PURE__ */ e(
|
|
66
|
+
"div",
|
|
67
|
+
{
|
|
68
|
+
style: {
|
|
69
|
+
[r === "right" ? "right" : "left"]: `${h ?? 0}px`
|
|
70
|
+
},
|
|
71
|
+
className: l("fixed inset-y-0 flex max-w-full", t.dialogContent),
|
|
72
|
+
children: /* @__PURE__ */ e(
|
|
73
|
+
o.Child,
|
|
74
|
+
{
|
|
75
|
+
as: m,
|
|
76
|
+
enter: "transform transition ease-in-out duration-500 sm:duration-700",
|
|
77
|
+
enterFrom: r === "right" ? "translate-x-full" : "-translate-x-full",
|
|
78
|
+
enterTo: "translate-x-0",
|
|
79
|
+
leave: "transform transition ease-out-in duration-500 sm:duration-700",
|
|
80
|
+
leaveFrom: "translate-x-0",
|
|
81
|
+
leaveTo: r === "right" ? "translate-x-full" : "-translate-x-full",
|
|
82
|
+
children: /* @__PURE__ */ n("div", { className: "flex", children: [
|
|
83
|
+
r === "right" ? /* @__PURE__ */ e(c, { onClose: a }) : null,
|
|
84
|
+
/* @__PURE__ */ n(
|
|
85
|
+
"div",
|
|
86
|
+
{
|
|
87
|
+
className: l(
|
|
88
|
+
"flex h-full w-full flex-col overflow-y-auto bg-white px-4 py-8 shadow-xl sm:px-6",
|
|
89
|
+
T[u],
|
|
90
|
+
t.children
|
|
91
|
+
),
|
|
92
|
+
children: [
|
|
93
|
+
/* @__PURE__ */ e("div", { className: "w-full", children: /* @__PURE__ */ e(s.Title, { children: f }) }),
|
|
94
|
+
/* @__PURE__ */ e("div", { className: l("relative mt-3 flex-1", t.content), children: x })
|
|
95
|
+
]
|
|
96
|
+
}
|
|
97
|
+
),
|
|
98
|
+
r === "left" ? /* @__PURE__ */ e(c, { onClose: a }) : null
|
|
99
|
+
] })
|
|
100
|
+
}
|
|
101
|
+
)
|
|
102
|
+
}
|
|
103
|
+
)
|
|
104
|
+
]
|
|
105
|
+
}
|
|
106
|
+
)
|
|
107
|
+
}
|
|
108
|
+
) });
|
|
109
|
+
}
|
|
110
|
+
);
|
|
111
|
+
F.displayName = "Drawer";
|
|
112
|
+
const c = ({ onClose: i }) => /* @__PURE__ */ e(
|
|
113
|
+
N,
|
|
114
|
+
{
|
|
115
|
+
size: "small",
|
|
116
|
+
variant: "link",
|
|
117
|
+
className: l(
|
|
118
|
+
"m-2.5 inline-flex !h-10 !w-10 items-center justify-center !rounded-full bg-white !px-1.5 !text-black"
|
|
119
|
+
),
|
|
120
|
+
onClick: () => i(!1),
|
|
121
|
+
children: /* @__PURE__ */ e(b, { size: "medium" })
|
|
122
|
+
}
|
|
123
|
+
);
|
|
124
|
+
export {
|
|
125
|
+
F as Drawer
|
|
126
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { default as React, ElementType } from 'react';
|
|
2
|
+
declare const sizes: {
|
|
3
|
+
readonly small: "px-3 py-1.5 text-sm leading-sm";
|
|
4
|
+
readonly medium: "px-3 py-2.5 text-base leading-base";
|
|
5
|
+
readonly large: "px-5 py-3.5 text-md leading-md";
|
|
6
|
+
};
|
|
7
|
+
type BaseInputSize = keyof typeof sizes;
|
|
8
|
+
export interface BaseInputProps {
|
|
9
|
+
[key: string]: any;
|
|
10
|
+
as?: ElementType;
|
|
11
|
+
size?: BaseInputSize;
|
|
12
|
+
isError?: boolean;
|
|
13
|
+
isRequired?: boolean;
|
|
14
|
+
value?: string | number;
|
|
15
|
+
prefix?: string;
|
|
16
|
+
suffix?: string;
|
|
17
|
+
className?: string;
|
|
18
|
+
}
|
|
19
|
+
export declare const BaseInput: React.ForwardRefExoticComponent<Omit<BaseInputProps & Record<string, any>, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { jsxs as x, jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import y from "clsx";
|
|
3
|
+
import { isString as i, isEmpty as l } from "lodash-es";
|
|
4
|
+
import { forwardRef as u } from "react";
|
|
5
|
+
import { Dot as h } from "../Dot/Dot.js";
|
|
6
|
+
const k = {
|
|
7
|
+
small: "px-3 py-1.5 text-sm leading-sm",
|
|
8
|
+
medium: "px-3 py-2.5 text-base leading-base",
|
|
9
|
+
large: "px-5 py-3.5 text-md leading-md"
|
|
10
|
+
}, w = u(
|
|
11
|
+
({ as: t = "input", size: d = "medium", isError: n, isRequired: c, value: r, prefix: a, suffix: o, className: g, ...p }, m) => {
|
|
12
|
+
const b = () => {
|
|
13
|
+
if (!i(r)) return;
|
|
14
|
+
let e = r;
|
|
15
|
+
return a && (e = e.replace(new RegExp(`^${a}`), "")), o && (e = e.replace(new RegExp(`${o}$`), "")), e.replaceAll(/[^.\S]+/g, "").replace(/[\p{Sc}]/u, "");
|
|
16
|
+
}, f = i(r) ? l(b()) : l(r == null ? void 0 : r.toString());
|
|
17
|
+
return /* @__PURE__ */ x("div", { className: "relative flex w-full items-center", children: [
|
|
18
|
+
/* @__PURE__ */ s(
|
|
19
|
+
t,
|
|
20
|
+
{
|
|
21
|
+
ref: m,
|
|
22
|
+
className: y(
|
|
23
|
+
"w-full rounded text-gray-darker placeholder-gray-dark hover:placeholder-gray-darker disabled:text-gray",
|
|
24
|
+
"border border-transparent hover:border-black hover:bg-gray-lighter focus:text-black active:text-black disabled:bg-gray-lighter",
|
|
25
|
+
k[d],
|
|
26
|
+
t === "select" && "pr-8",
|
|
27
|
+
n ? "!focus:border-danger !border-danger focus:ring-0 focus:ring-danger" : "border-gray-light focus:border-primary focus:ring-0 focus:ring-primary",
|
|
28
|
+
g
|
|
29
|
+
),
|
|
30
|
+
value: r,
|
|
31
|
+
...p
|
|
32
|
+
}
|
|
33
|
+
),
|
|
34
|
+
c && f && /* @__PURE__ */ s(h, { className: "absolute right-3", color: "danger" })
|
|
35
|
+
] });
|
|
36
|
+
}
|
|
37
|
+
);
|
|
38
|
+
w.displayName = "BaseInput";
|
|
39
|
+
export {
|
|
40
|
+
w as BaseInput
|
|
41
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface CheckboxProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
3
|
+
label: React.ReactNode;
|
|
4
|
+
classNames?: {
|
|
5
|
+
checkbox?: string;
|
|
6
|
+
label?: string;
|
|
7
|
+
};
|
|
8
|
+
className?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare const Checkbox: ({ label, classNames, className, ...rest }: CheckboxProps) => React.JSX.Element;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsxs as s, jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import e from "clsx";
|
|
3
|
+
import { useId as d } from "../../hooks/useId.js";
|
|
4
|
+
import n from "./Checkbox.module.css.js";
|
|
5
|
+
const m = ({ label: r, classNames: o = {}, className: i, ...l }) => {
|
|
6
|
+
const t = d("checkbox");
|
|
7
|
+
return /* @__PURE__ */ s("div", { className: e("ui-checkbox", i, "flex items-center"), children: [
|
|
8
|
+
/* @__PURE__ */ c(
|
|
9
|
+
"input",
|
|
10
|
+
{
|
|
11
|
+
type: "checkbox",
|
|
12
|
+
className: e(
|
|
13
|
+
"ui-checkbox-input",
|
|
14
|
+
o.checkbox,
|
|
15
|
+
n.checkbox,
|
|
16
|
+
"h-4 w-4 rounded !border-primary text-white transition-colors disabled:border-none disabled:bg-gray-light disabled:text-gray-light"
|
|
17
|
+
),
|
|
18
|
+
...l,
|
|
19
|
+
id: t
|
|
20
|
+
}
|
|
21
|
+
),
|
|
22
|
+
r ? /* @__PURE__ */ c(
|
|
23
|
+
"label",
|
|
24
|
+
{
|
|
25
|
+
htmlFor: t,
|
|
26
|
+
className: e("ui-checkbox-label", o.label, "ml-2 leading-none text-gray-darker"),
|
|
27
|
+
children: r
|
|
28
|
+
}
|
|
29
|
+
) : null
|
|
30
|
+
] });
|
|
31
|
+
};
|
|
32
|
+
export {
|
|
33
|
+
m as Checkbox
|
|
34
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { Props as SelectProps } from 'react-select';
|
|
3
|
+
export interface ComboBoxProps extends SelectProps {
|
|
4
|
+
isCreatable?: boolean;
|
|
5
|
+
isError?: boolean;
|
|
6
|
+
className?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare const ComboBox: ({ isCreatable, isError, className, ...rest }: ComboBoxProps) => React.JSX.Element;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import i from "clsx";
|
|
3
|
+
import { useRef as c, useState as s, useEffect as m } from "react";
|
|
4
|
+
import u, { components as f } from "react-select";
|
|
5
|
+
import d from "react-select/creatable";
|
|
6
|
+
import { Tooltip as b } from "../Tooltip.js";
|
|
7
|
+
/* empty css */
|
|
8
|
+
const R = ({ isCreatable: e = !1, isError: t, className: l, ...n }) => /* @__PURE__ */ o(
|
|
9
|
+
e ? d : u,
|
|
10
|
+
{
|
|
11
|
+
className: i("ui-combo-box", t && "border-danger", l),
|
|
12
|
+
classNamePrefix: "ui-combo-box",
|
|
13
|
+
components: e ? {
|
|
14
|
+
IndicatorsContainer: () => null,
|
|
15
|
+
Menu: () => null,
|
|
16
|
+
MultiValueLabel: x
|
|
17
|
+
} : void 0,
|
|
18
|
+
...n
|
|
19
|
+
}
|
|
20
|
+
), { MultiValueLabel: p } = f, x = (e) => {
|
|
21
|
+
const t = c(null), [l, n] = s(!0);
|
|
22
|
+
return m(() => {
|
|
23
|
+
var r;
|
|
24
|
+
if ((r = t.current) != null && r.offsetParent) {
|
|
25
|
+
const a = t.current.offsetWidth > t.current.offsetParent.clientWidth;
|
|
26
|
+
n(!a);
|
|
27
|
+
}
|
|
28
|
+
}, [e.data.label]), /* @__PURE__ */ o(p, { ...e, children: /* @__PURE__ */ o(
|
|
29
|
+
b,
|
|
30
|
+
{
|
|
31
|
+
disabled: l,
|
|
32
|
+
maxWidth: "none",
|
|
33
|
+
content: /* @__PURE__ */ o("span", { children: e.data.label }),
|
|
34
|
+
className: "",
|
|
35
|
+
children: /* @__PURE__ */ o("span", { ref: t, children: e.data.label })
|
|
36
|
+
}
|
|
37
|
+
) });
|
|
38
|
+
};
|
|
39
|
+
export {
|
|
40
|
+
R as ComboBox
|
|
41
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface InlineValuePopoverProps {
|
|
3
|
+
text?: React.ReactNode;
|
|
4
|
+
isOpen?: boolean;
|
|
5
|
+
showArrow?: boolean;
|
|
6
|
+
autoSelectOnClick?: boolean;
|
|
7
|
+
children?: React.ReactNode;
|
|
8
|
+
error?: React.ReactNode | null;
|
|
9
|
+
classNames?: {
|
|
10
|
+
text?: string;
|
|
11
|
+
textField?: string;
|
|
12
|
+
children?: string;
|
|
13
|
+
};
|
|
14
|
+
onClick?: (e: React.MouseEvent) => void;
|
|
15
|
+
onClickOutside?: () => void;
|
|
16
|
+
}
|
|
17
|
+
export declare const InlineValuePopover: ({ text, isOpen, showArrow, autoSelectOnClick, children, error, classNames, onClick, onClickOutside, ...rest }: InlineValuePopoverProps) => React.JSX.Element;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { jsxs as d, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import i from "clsx";
|
|
3
|
+
import { useRef as P } from "react";
|
|
4
|
+
import { DownArrowIcon as g } from "../../icons/build/DownArrowIcon.js";
|
|
5
|
+
import { Popover as l } from "../Popover/Popover.js";
|
|
6
|
+
import { ValuePopoverText as j } from "./ValuePopoverText.js";
|
|
7
|
+
const D = ({
|
|
8
|
+
text: f,
|
|
9
|
+
isOpen: x = !1,
|
|
10
|
+
showArrow: b = !0,
|
|
11
|
+
autoSelectOnClick: c = !1,
|
|
12
|
+
children: h,
|
|
13
|
+
error: p = null,
|
|
14
|
+
classNames: r,
|
|
15
|
+
onClick: o,
|
|
16
|
+
onClickOutside: v,
|
|
17
|
+
...m
|
|
18
|
+
}) => {
|
|
19
|
+
const t = P(null), w = (I) => {
|
|
20
|
+
setTimeout(() => {
|
|
21
|
+
var u;
|
|
22
|
+
const n = (u = t == null ? void 0 : t.current) == null ? void 0 : u.querySelector("select,textarea,input");
|
|
23
|
+
n && (n.focus(), c && n.select());
|
|
24
|
+
}, 0), o == null || o(I);
|
|
25
|
+
};
|
|
26
|
+
return /* @__PURE__ */ d(l, { visible: x, className: "", onClickOutside: v, ...m, children: [
|
|
27
|
+
/* @__PURE__ */ d(
|
|
28
|
+
"span",
|
|
29
|
+
{
|
|
30
|
+
className: i(
|
|
31
|
+
"cursor-pointer whitespace-nowrap",
|
|
32
|
+
p && "!border-danger !text-danger",
|
|
33
|
+
r == null ? void 0 : r.text
|
|
34
|
+
),
|
|
35
|
+
onClick: w,
|
|
36
|
+
children: [
|
|
37
|
+
/* @__PURE__ */ e("span", { className: i("border-b border-b-black font-bold text-black", r == null ? void 0 : r.textField), children: /* @__PURE__ */ e(j, { value: f, error: p }) }),
|
|
38
|
+
b && /* @__PURE__ */ e(g, { size: "medium" })
|
|
39
|
+
]
|
|
40
|
+
}
|
|
41
|
+
),
|
|
42
|
+
/* @__PURE__ */ e(l.Content, { children: /* @__PURE__ */ e("div", { ref: t, className: i("p-2", r == null ? void 0 : r.children), children: h }) })
|
|
43
|
+
] });
|
|
44
|
+
};
|
|
45
|
+
export {
|
|
46
|
+
D as InlineValuePopover
|
|
47
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { BaseInputProps } from './BaseInput';
|
|
3
|
+
export interface InputProps extends BaseInputProps, Omit<React.InputHTMLAttributes<HTMLInputElement>, keyof BaseInputProps> {
|
|
4
|
+
type?: string;
|
|
5
|
+
}
|
|
6
|
+
export declare const Input: React.ForwardRefExoticComponent<Omit<InputProps, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import s from "clsx";
|
|
3
|
+
import { forwardRef as a } from "react";
|
|
4
|
+
import { BaseInput as e } from "./BaseInput.js";
|
|
5
|
+
const n = a(({ className: t, type: r = "text", value: o, ...p }, m) => /* @__PURE__ */ i(e, { ref: m, as: "input", className: s("ui-input", t), type: r, value: o, ...p }));
|
|
6
|
+
n.displayName = "Input";
|
|
7
|
+
export {
|
|
8
|
+
n as Input
|
|
9
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface LabelProps extends React.LabelHTMLAttributes<HTMLLabelElement> {
|
|
3
|
+
isDisabled?: boolean;
|
|
4
|
+
isError?: boolean;
|
|
5
|
+
className?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const Label: ({ isDisabled, isError, className, ...rest }: LabelProps) => React.JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import r from "clsx";
|
|
3
|
+
const m = ({ isDisabled: t = !1, isError: e = !1, className: l, ...a }) => /* @__PURE__ */ o(
|
|
4
|
+
"label",
|
|
5
|
+
{
|
|
6
|
+
className: r(
|
|
7
|
+
"ui-label",
|
|
8
|
+
l,
|
|
9
|
+
"mb-1 block text-sm font-bold",
|
|
10
|
+
e ? "text-danger" : t ? "text-gray" : "text-black"
|
|
11
|
+
),
|
|
12
|
+
...a
|
|
13
|
+
}
|
|
14
|
+
);
|
|
15
|
+
export {
|
|
16
|
+
m as Label
|
|
17
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
interface TooltipFormatter {
|
|
3
|
+
from: (value: number) => number;
|
|
4
|
+
to: (value: number) => string;
|
|
5
|
+
}
|
|
6
|
+
export interface RangeSliderProps {
|
|
7
|
+
values: number[];
|
|
8
|
+
min: number;
|
|
9
|
+
max: number;
|
|
10
|
+
isDisabled?: boolean;
|
|
11
|
+
shouldConnectHandles?: boolean;
|
|
12
|
+
step?: number;
|
|
13
|
+
isTooltipEnabled?: boolean;
|
|
14
|
+
tooltipCustomFormatter?: TooltipFormatter[] | null;
|
|
15
|
+
tooltipSuffix?: string;
|
|
16
|
+
className?: string;
|
|
17
|
+
onChange?: (values: number[], handle: number) => void;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* @param {string?} props.className Class name to apply to the Range slider input.
|
|
21
|
+
* @param {number[]} props.values Initial values to be display on the slider input.
|
|
22
|
+
* @param {number} props.min Slider Minimum value.
|
|
23
|
+
* @param {number} props.max Slider Maximum value.
|
|
24
|
+
* @param {boolean?} props.isDisabled To disabled the range slider.
|
|
25
|
+
* @param {boolean?} props.shouldConnectHandles To Display colored bars between handles.
|
|
26
|
+
* @param {number?} props.step Increament / decrement slider input by this Step count.
|
|
27
|
+
* @param {boolean?} props.isTooltipEnabled Show tooltip on slider.
|
|
28
|
+
* @param {object[]?} props.tooltipCustomFormatter Custom tooltip formatter.
|
|
29
|
+
* @param {string?} props.tooltipSuffix Suffix to be added to the tooltip.
|
|
30
|
+
* @param {Function?} props.onChange Debounced callback when range slider is changed.
|
|
31
|
+
*/
|
|
32
|
+
export declare const RangeSlider: ({ values, min, max, isDisabled, shouldConnectHandles, step, isTooltipEnabled, tooltipCustomFormatter, tooltipSuffix, className, onChange, }: RangeSliderProps) => React.JSX.Element;
|
|
33
|
+
export {};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { jsx as d } from "react/jsx-runtime";
|
|
2
|
+
import u from "clsx";
|
|
3
|
+
import g from "nouislider-react";
|
|
4
|
+
/* empty css */
|
|
5
|
+
/* empty css */
|
|
6
|
+
const j = ({
|
|
7
|
+
values: t,
|
|
8
|
+
min: o,
|
|
9
|
+
max: e,
|
|
10
|
+
isDisabled: i = !1,
|
|
11
|
+
shouldConnectHandles: s = !1,
|
|
12
|
+
step: a = 1,
|
|
13
|
+
isTooltipEnabled: l = !0,
|
|
14
|
+
tooltipCustomFormatter: m = null,
|
|
15
|
+
tooltipSuffix: n,
|
|
16
|
+
className: p,
|
|
17
|
+
onChange: f
|
|
18
|
+
}) => {
|
|
19
|
+
const c = m ?? t.map(() => ({
|
|
20
|
+
from: (r) => r,
|
|
21
|
+
to: (r) => `${Math.round(r)}${n ?? ""}`
|
|
22
|
+
}));
|
|
23
|
+
return /* @__PURE__ */ d(
|
|
24
|
+
g,
|
|
25
|
+
{
|
|
26
|
+
className: u("ui-range-slider", p),
|
|
27
|
+
connect: s,
|
|
28
|
+
disabled: i,
|
|
29
|
+
start: t,
|
|
30
|
+
range: { min: o, max: e },
|
|
31
|
+
step: a,
|
|
32
|
+
tooltips: l ? c : !1,
|
|
33
|
+
onChange: f
|
|
34
|
+
}
|
|
35
|
+
);
|
|
36
|
+
};
|
|
37
|
+
export {
|
|
38
|
+
j as RangeSlider
|
|
39
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { BaseInputProps } from './BaseInput';
|
|
3
|
+
export interface SelectProps extends BaseInputProps, Omit<React.SelectHTMLAttributes<HTMLSelectElement>, keyof BaseInputProps> {
|
|
4
|
+
}
|
|
5
|
+
export declare const Select: React.ForwardRefExoticComponent<Omit<SelectProps, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as o } from "react";
|
|
3
|
+
import { BaseInput as m } from "./BaseInput.js";
|
|
4
|
+
const p = o((e, r) => /* @__PURE__ */ t(m, { ref: r, as: "select", ...e }));
|
|
5
|
+
p.displayName = "Select";
|
|
6
|
+
export {
|
|
7
|
+
p as Select
|
|
8
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
declare const sizes: {
|
|
3
|
+
readonly large: {
|
|
4
|
+
readonly parent: "h-6 w-11";
|
|
5
|
+
readonly inner: "h-5 w-5";
|
|
6
|
+
readonly translate: "translate-x-5";
|
|
7
|
+
};
|
|
8
|
+
readonly medium: {
|
|
9
|
+
readonly parent: "h-5 w-8";
|
|
10
|
+
readonly inner: "h-4 w-4";
|
|
11
|
+
readonly translate: "translate-x-3";
|
|
12
|
+
};
|
|
13
|
+
readonly small: {
|
|
14
|
+
readonly parent: "h-3 w-5";
|
|
15
|
+
readonly inner: "h-2 w-2";
|
|
16
|
+
readonly translate: "translate-x-2";
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
type SwitchSize = keyof typeof sizes;
|
|
20
|
+
export interface SwitchProps {
|
|
21
|
+
isChecked?: boolean;
|
|
22
|
+
size?: SwitchSize;
|
|
23
|
+
disabled?: boolean;
|
|
24
|
+
className?: string;
|
|
25
|
+
onChange?: (checked: boolean) => void;
|
|
26
|
+
}
|
|
27
|
+
export interface SwitchGroupProps {
|
|
28
|
+
className?: string;
|
|
29
|
+
children: React.ReactNode;
|
|
30
|
+
}
|
|
31
|
+
export interface SwitchLabelProps {
|
|
32
|
+
direction?: "left" | "right";
|
|
33
|
+
className?: string;
|
|
34
|
+
children: React.ReactNode;
|
|
35
|
+
}
|
|
36
|
+
export declare const Switch: (({ isChecked, size, disabled, className, onChange }: SwitchProps) => React.JSX.Element) & {
|
|
37
|
+
Group: {
|
|
38
|
+
({ children, className }: SwitchGroupProps): React.JSX.Element;
|
|
39
|
+
displayName: string;
|
|
40
|
+
};
|
|
41
|
+
Label: {
|
|
42
|
+
({ direction, children, className }: SwitchLabelProps): React.JSX.Element;
|
|
43
|
+
displayName: string;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
export {};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { Switch as s } from "@headlessui/react";
|
|
3
|
+
import n from "clsx";
|
|
4
|
+
import { noop as m } from "lodash-es";
|
|
5
|
+
const i = {
|
|
6
|
+
large: {
|
|
7
|
+
parent: "h-6 w-11",
|
|
8
|
+
inner: "h-5 w-5",
|
|
9
|
+
translate: "translate-x-5"
|
|
10
|
+
},
|
|
11
|
+
medium: {
|
|
12
|
+
parent: "h-5 w-8",
|
|
13
|
+
inner: "h-4 w-4",
|
|
14
|
+
translate: "translate-x-3"
|
|
15
|
+
},
|
|
16
|
+
small: {
|
|
17
|
+
parent: "h-3 w-5",
|
|
18
|
+
inner: "h-2 w-2",
|
|
19
|
+
translate: "translate-x-2"
|
|
20
|
+
}
|
|
21
|
+
}, p = ({ isChecked: r = !1, size: t = "medium", disabled: a, className: c, onChange: u }) => /* @__PURE__ */ e(
|
|
22
|
+
s,
|
|
23
|
+
{
|
|
24
|
+
checked: r,
|
|
25
|
+
disabled: a,
|
|
26
|
+
className: n(
|
|
27
|
+
"ui-switch",
|
|
28
|
+
r ? "bg-primary disabled:bg-gray-light" : "bg-gray disabled:bg-gray-light",
|
|
29
|
+
"relative inline-flex flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none",
|
|
30
|
+
i[t].parent,
|
|
31
|
+
c
|
|
32
|
+
),
|
|
33
|
+
onChange: u ?? m,
|
|
34
|
+
children: /* @__PURE__ */ e(
|
|
35
|
+
"span",
|
|
36
|
+
{
|
|
37
|
+
className: n(
|
|
38
|
+
r ? i[t].translate : "translate-x-0",
|
|
39
|
+
"ui-switch-inner pointer-events-none inline-block transform rounded-full bg-white shadow ring-0 transition duration-200 ease-in-out",
|
|
40
|
+
i[t].inner
|
|
41
|
+
)
|
|
42
|
+
}
|
|
43
|
+
)
|
|
44
|
+
}
|
|
45
|
+
), o = ({ children: r, className: t }) => /* @__PURE__ */ e(s.Group, { as: "div", className: n("ui-switch-group", "inline-flex items-center", t), children: r });
|
|
46
|
+
o.displayName = "Switch.Group";
|
|
47
|
+
const l = ({ direction: r = "left", children: t, className: a }) => /* @__PURE__ */ e(
|
|
48
|
+
s.Label,
|
|
49
|
+
{
|
|
50
|
+
as: "span",
|
|
51
|
+
className: n("ui-switch-label", "cursor-pointer", r === "left" ? "mr-2" : "ml-2", a),
|
|
52
|
+
children: t
|
|
53
|
+
}
|
|
54
|
+
);
|
|
55
|
+
l.displayName = "Switch.Label";
|
|
56
|
+
const g = Object.assign(p, {
|
|
57
|
+
Group: o,
|
|
58
|
+
Label: l
|
|
59
|
+
});
|
|
60
|
+
export {
|
|
61
|
+
g as Switch
|
|
62
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { BaseInputProps } from './BaseInput';
|
|
3
|
+
export interface TextareaProps extends BaseInputProps, Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, keyof BaseInputProps> {
|
|
4
|
+
shouldAutoSize?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare const Textarea: React.ForwardRefExoticComponent<Omit<TextareaProps, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { jsx as m } from "react/jsx-runtime";
|
|
2
|
+
import i from "clsx";
|
|
3
|
+
import { forwardRef as p } from "react";
|
|
4
|
+
import f from "react-textarea-autosize";
|
|
5
|
+
import { BaseInput as s } from "./BaseInput.js";
|
|
6
|
+
const n = p(
|
|
7
|
+
({ className: a, value: r, shouldAutoSize: x = !1, rows: t = 2, ...e }, o) => x ? (
|
|
8
|
+
// TextareaAutosize has a few special props like minRows and maxRows instead of rows field so using rows field to feed the minRows prop. See full list here https://github.com/Andarist/react-textarea-autosize?tab=readme-ov-file#props
|
|
9
|
+
/* @__PURE__ */ m(
|
|
10
|
+
s,
|
|
11
|
+
{
|
|
12
|
+
ref: o,
|
|
13
|
+
as: f,
|
|
14
|
+
value: r,
|
|
15
|
+
minRows: t,
|
|
16
|
+
className: i("ui-textarea", a),
|
|
17
|
+
...e
|
|
18
|
+
}
|
|
19
|
+
)
|
|
20
|
+
) : /* @__PURE__ */ m(
|
|
21
|
+
s,
|
|
22
|
+
{
|
|
23
|
+
ref: o,
|
|
24
|
+
as: "textarea",
|
|
25
|
+
value: r,
|
|
26
|
+
rows: t,
|
|
27
|
+
className: i("ui-textarea", a),
|
|
28
|
+
...e
|
|
29
|
+
}
|
|
30
|
+
)
|
|
31
|
+
);
|
|
32
|
+
n.displayName = "Textarea";
|
|
33
|
+
export {
|
|
34
|
+
n as Textarea
|
|
35
|
+
};
|