@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,10 @@
|
|
|
1
|
+
import { jsxs as t, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { Tooltip as e } from "../Tooltip.js";
|
|
3
|
+
import { WarningDiamondIcon as a } from "../../icons/build/WarningDiamondIcon.js";
|
|
4
|
+
const l = ({ value: r, error: o }) => /* @__PURE__ */ t("span", { children: [
|
|
5
|
+
o ? /* @__PURE__ */ n(e, { content: o, className: "", children: /* @__PURE__ */ n("span", { children: /* @__PURE__ */ n(a, { className: "mr-1 text-danger" }) }) }) : null,
|
|
6
|
+
r
|
|
7
|
+
] });
|
|
8
|
+
export {
|
|
9
|
+
l as ValuePopoverText
|
|
10
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface GooglePlaceSuggestion {
|
|
3
|
+
place_id: string;
|
|
4
|
+
description?: string;
|
|
5
|
+
name?: string;
|
|
6
|
+
formatted_address?: string;
|
|
7
|
+
types?: string[];
|
|
8
|
+
}
|
|
9
|
+
export interface GooglePlacesAutocompleteProps {
|
|
10
|
+
initialValue?: string;
|
|
11
|
+
onSelect?: (suggestion: GooglePlaceSuggestion) => void;
|
|
12
|
+
apiBaseUrl: string;
|
|
13
|
+
}
|
|
14
|
+
export declare const GooglePlacesAutocomplete: ({ initialValue, onSelect, apiBaseUrl, }: GooglePlacesAutocompleteProps) => React.JSX.Element;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface HeaderToolbarProps {
|
|
3
|
+
classNames?: string;
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
}
|
|
6
|
+
export declare const HeaderToolbar: {
|
|
7
|
+
({ classNames, children }: HeaderToolbarProps): React.JSX.Element;
|
|
8
|
+
Breadcrumb: {
|
|
9
|
+
({ children, className }: HeaderToolbarBreadcrumbProps): React.JSX.Element;
|
|
10
|
+
displayName: string;
|
|
11
|
+
};
|
|
12
|
+
Search: {
|
|
13
|
+
(props: any): React.JSX.Element;
|
|
14
|
+
displayName: string;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
interface HeaderToolbarBreadcrumbProps {
|
|
18
|
+
children: React.ReactNode;
|
|
19
|
+
className?: string;
|
|
20
|
+
}
|
|
21
|
+
export type { HeaderToolbarBreadcrumbProps };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import o from "clsx";
|
|
3
|
+
import { Search as c } from "./Search.js";
|
|
4
|
+
import { Breadcrumb as d } from "./Breadcrumb.js";
|
|
5
|
+
const l = ({ classNames: r, children: e }) => /* @__PURE__ */ a(
|
|
6
|
+
"div",
|
|
7
|
+
{
|
|
8
|
+
className: o(
|
|
9
|
+
"ui-header-toolbar",
|
|
10
|
+
"flex w-full items-center space-x-2 border-b border-gray-light px-5 py-3 pr-3 xl:space-x-6 xl:px-10 xl:py-5",
|
|
11
|
+
r
|
|
12
|
+
),
|
|
13
|
+
children: e
|
|
14
|
+
}
|
|
15
|
+
), m = ({ children: r, className: e }) => /* @__PURE__ */ a(
|
|
16
|
+
d,
|
|
17
|
+
{
|
|
18
|
+
className: o(
|
|
19
|
+
"ui-header-toolbar-breadcrumb",
|
|
20
|
+
"border-r border-gray-light text-xl md:pr-4 xl:pr-6",
|
|
21
|
+
e
|
|
22
|
+
),
|
|
23
|
+
children: r
|
|
24
|
+
}
|
|
25
|
+
);
|
|
26
|
+
m.displayName = "HeaderToolbar.Breadcrumb";
|
|
27
|
+
const t = (r) => /* @__PURE__ */ a(c, { className: "ui-header-toolbar-search w-full flex-grow pr-1", ...r });
|
|
28
|
+
t.displayName = "HeaderToolbar.Search";
|
|
29
|
+
l.Breadcrumb = m;
|
|
30
|
+
l.Search = t;
|
|
31
|
+
export {
|
|
32
|
+
l as HeaderToolbar
|
|
33
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
type LogoSize = "small" | "medium" | "large";
|
|
3
|
+
export interface ImageUploadProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "onChange" | "size" | "onError"> {
|
|
4
|
+
src?: string;
|
|
5
|
+
size?: LogoSize;
|
|
6
|
+
isLoading?: boolean;
|
|
7
|
+
maxSize?: number;
|
|
8
|
+
hasDelete?: boolean;
|
|
9
|
+
requirements?: React.ReactNode | string | null;
|
|
10
|
+
caption?: string | null;
|
|
11
|
+
csvAcceptFormats?: string;
|
|
12
|
+
onChange: (file: File) => void;
|
|
13
|
+
onDelete: () => void;
|
|
14
|
+
onError: (message: string) => void;
|
|
15
|
+
}
|
|
16
|
+
export declare const ImageUpload: ({ src, size, isLoading, maxSize, hasDelete, requirements, caption, csvAcceptFormats, onChange, onDelete, onError, ...props }: ImageUploadProps) => React.JSX.Element;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { jsxs as a, jsx as e, Fragment as B } from "react/jsx-runtime";
|
|
2
|
+
import g from "clsx";
|
|
3
|
+
import { useRef as R, useState as U } from "react";
|
|
4
|
+
import { Button as w } from "./Buttons/Button.js";
|
|
5
|
+
import { SubmitButton as u } from "./Buttons/SubmitButton.js";
|
|
6
|
+
import { Logo as x } from "./Logo.js";
|
|
7
|
+
import { ImageIcon as G } from "../icons/build/ImageIcon.js";
|
|
8
|
+
import { TrashIcon as K } from "../icons/build/TrashIcon.js";
|
|
9
|
+
const H = ({
|
|
10
|
+
src: c,
|
|
11
|
+
size: s = "large",
|
|
12
|
+
isLoading: l = !1,
|
|
13
|
+
maxSize: o = 5,
|
|
14
|
+
hasDelete: d = !0,
|
|
15
|
+
requirements: t = null,
|
|
16
|
+
caption: r = null,
|
|
17
|
+
csvAcceptFormats: y = "image/png,image/jpeg",
|
|
18
|
+
onChange: N,
|
|
19
|
+
onDelete: v,
|
|
20
|
+
onError: C,
|
|
21
|
+
...b
|
|
22
|
+
}) => {
|
|
23
|
+
const h = R(null), [m, k] = U(0), p = () => {
|
|
24
|
+
var n;
|
|
25
|
+
(n = h.current) == null || n.click();
|
|
26
|
+
}, I = (n) => {
|
|
27
|
+
const [i] = n.target.files ?? [];
|
|
28
|
+
if (i) {
|
|
29
|
+
if (o && 1048576 * o < i.size) {
|
|
30
|
+
C(`Image size shouldn't exceed ${o}MB`);
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
N(i);
|
|
34
|
+
}
|
|
35
|
+
}, P = () => {
|
|
36
|
+
k(m + 1), v();
|
|
37
|
+
}, j = typeof t == "string" ? (t == null ? void 0 : t.trim().length) > 0 : !!t, f = r ? r.trim().length > 0 : !1;
|
|
38
|
+
return /* @__PURE__ */ a("div", { className: g("flex items-center rounded bg-gray-lighter p-4", d ? "space-x-2" : "space-x-3"), children: [
|
|
39
|
+
/* @__PURE__ */ e("div", { children: c ? /* @__PURE__ */ e(x, { src: c, size: s }) : /* @__PURE__ */ e(
|
|
40
|
+
"div",
|
|
41
|
+
{
|
|
42
|
+
className: g(
|
|
43
|
+
x.sizes[s],
|
|
44
|
+
"flex items-center justify-center rounded border border-gray-light"
|
|
45
|
+
),
|
|
46
|
+
children: /* @__PURE__ */ e(G, { size: "large", className: "text-gray" })
|
|
47
|
+
}
|
|
48
|
+
) }),
|
|
49
|
+
/* @__PURE__ */ a("div", { className: "flex flex-col space-y-2", children: [
|
|
50
|
+
/* @__PURE__ */ e("div", { className: "space-x-2", children: d ? /* @__PURE__ */ a(B, { children: [
|
|
51
|
+
/* @__PURE__ */ e(
|
|
52
|
+
w,
|
|
53
|
+
{
|
|
54
|
+
variant: "outline",
|
|
55
|
+
color: "secondary",
|
|
56
|
+
icon: /* @__PURE__ */ e(K, {}),
|
|
57
|
+
disabled: l,
|
|
58
|
+
onClick: P,
|
|
59
|
+
children: "Delete"
|
|
60
|
+
}
|
|
61
|
+
),
|
|
62
|
+
/* @__PURE__ */ e(u, { disabled: l, isLoading: l, onClick: p, children: f ? r.trim() : "Upload New Photo" })
|
|
63
|
+
] }) : /* @__PURE__ */ e(u, { disabled: l, isLoading: l, onClick: p, children: f ? r.trim() : c ? "Replace Photo" : "Upload New Photo" }) }),
|
|
64
|
+
/* @__PURE__ */ e(
|
|
65
|
+
"input",
|
|
66
|
+
{
|
|
67
|
+
ref: h,
|
|
68
|
+
className: "hidden",
|
|
69
|
+
type: "file",
|
|
70
|
+
multiple: !1,
|
|
71
|
+
accept: y,
|
|
72
|
+
onChange: I,
|
|
73
|
+
...b
|
|
74
|
+
},
|
|
75
|
+
m
|
|
76
|
+
),
|
|
77
|
+
/* @__PURE__ */ e("div", { className: "text-xs text-gray-darker", children: j ? t : /* @__PURE__ */ a("div", { children: [
|
|
78
|
+
"Check that the image is in PNG or JPG format",
|
|
79
|
+
o ? ` and does not exceed ${o}MB` : ""
|
|
80
|
+
] }) })
|
|
81
|
+
] })
|
|
82
|
+
] });
|
|
83
|
+
};
|
|
84
|
+
export {
|
|
85
|
+
H as ImageUpload
|
|
86
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import l from "clsx";
|
|
3
|
+
import { isOSX as t } from "../helpers/browser.js";
|
|
4
|
+
const s = {
|
|
5
|
+
cmd: t ? "⌘" : "ctrl",
|
|
6
|
+
option: t ? "⌥" : "win",
|
|
7
|
+
ctrl: "ctrl",
|
|
8
|
+
up: "↑",
|
|
9
|
+
down: "↓"
|
|
10
|
+
}, x = ({ char: e, className: n, ...o }) => {
|
|
11
|
+
const r = s[e] ?? e;
|
|
12
|
+
return /* @__PURE__ */ i(
|
|
13
|
+
"div",
|
|
14
|
+
{
|
|
15
|
+
className: l(
|
|
16
|
+
"ui-key",
|
|
17
|
+
"no-translate inline-flex h-5 items-center justify-center rounded bg-gray-lighter px-2 py-1 text-xs font-semibold text-gray",
|
|
18
|
+
r.length === 1 && "w-5",
|
|
19
|
+
n
|
|
20
|
+
),
|
|
21
|
+
...o,
|
|
22
|
+
children: r
|
|
23
|
+
}
|
|
24
|
+
);
|
|
25
|
+
};
|
|
26
|
+
export {
|
|
27
|
+
x as Key
|
|
28
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
declare const sizes: {
|
|
3
|
+
readonly small: "w-10 h-10";
|
|
4
|
+
readonly medium: "w-16 h-16";
|
|
5
|
+
readonly large: "w-20 h-20";
|
|
6
|
+
};
|
|
7
|
+
type LogoSize = keyof typeof sizes;
|
|
8
|
+
export interface LogoProps extends React.ImgHTMLAttributes<HTMLImageElement> {
|
|
9
|
+
size?: LogoSize;
|
|
10
|
+
className?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare const Logo: (({ size, className, ...rest }: LogoProps) => React.JSX.Element) & {
|
|
13
|
+
sizes: {
|
|
14
|
+
readonly small: "w-10 h-10";
|
|
15
|
+
readonly medium: "w-16 h-16";
|
|
16
|
+
readonly large: "w-20 h-20";
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import n from "clsx";
|
|
3
|
+
const o = {
|
|
4
|
+
small: "w-10 h-10",
|
|
5
|
+
medium: "w-16 h-16",
|
|
6
|
+
large: "w-20 h-20"
|
|
7
|
+
}, r = ({ size: s = "small", className: e, ...m }) => /* @__PURE__ */ l("img", { className: n("ui-logo", e, "inline-block rounded object-cover", o[s]), ...m }), i = Object.assign(r, { sizes: o });
|
|
8
|
+
export {
|
|
9
|
+
i as Logo
|
|
10
|
+
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
declare const sizes: {
|
|
3
|
+
readonly small: "max-w-100";
|
|
4
|
+
readonly medium: "max-w-125";
|
|
5
|
+
readonly large: "max-w-150";
|
|
6
|
+
readonly huge: "max-w-200";
|
|
7
|
+
};
|
|
8
|
+
declare const positions: {
|
|
9
|
+
readonly center: "inline-block";
|
|
10
|
+
readonly topLeft: "absolute m-4 top-0 left-0";
|
|
11
|
+
readonly topRight: "absolute m-4 top-0 right-0";
|
|
12
|
+
readonly bottomLeft: "absolute m-4 bottom-0 left-0";
|
|
13
|
+
readonly bottomRight: "absolute m-4 bottom-0 right-0";
|
|
14
|
+
};
|
|
15
|
+
type ModalSize = keyof typeof sizes;
|
|
16
|
+
type ModalPosition = keyof typeof positions;
|
|
17
|
+
export interface ModalProps {
|
|
18
|
+
size?: ModalSize;
|
|
19
|
+
position?: ModalPosition;
|
|
20
|
+
isOpen: boolean;
|
|
21
|
+
shouldCloseOnOutsideClick?: boolean;
|
|
22
|
+
children: React.ReactNode;
|
|
23
|
+
className?: string;
|
|
24
|
+
onClose: () => void;
|
|
25
|
+
}
|
|
26
|
+
export declare const Modal: {
|
|
27
|
+
({ size, position, isOpen, shouldCloseOnOutsideClick, children, className, onClose, }: ModalProps): React.JSX.Element;
|
|
28
|
+
Header: {
|
|
29
|
+
({ description, children, className, ...rest }: ModalHeaderProps): React.JSX.Element;
|
|
30
|
+
displayName: string;
|
|
31
|
+
};
|
|
32
|
+
Body: {
|
|
33
|
+
({ className, ...rest }: ModalBodyProps): React.JSX.Element;
|
|
34
|
+
displayName: string;
|
|
35
|
+
};
|
|
36
|
+
Footer: {
|
|
37
|
+
({ className, ...rest }: ModalFooterProps): React.JSX.Element;
|
|
38
|
+
displayName: string;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
export interface ModalHeaderProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
42
|
+
description?: string;
|
|
43
|
+
children: React.ReactNode;
|
|
44
|
+
className?: string;
|
|
45
|
+
}
|
|
46
|
+
export interface ModalBodyProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
47
|
+
className?: string;
|
|
48
|
+
}
|
|
49
|
+
export interface ModalFooterProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
50
|
+
className?: string;
|
|
51
|
+
}
|
|
52
|
+
export {};
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { jsx as t, jsxs as c } from "react/jsx-runtime";
|
|
2
|
+
import { Transition as s, Dialog as d } from "@headlessui/react";
|
|
3
|
+
import o from "clsx";
|
|
4
|
+
import { Fragment as m } from "react";
|
|
5
|
+
import { CloseIcon as v } from "../icons/build/CloseIcon.js";
|
|
6
|
+
const y = {
|
|
7
|
+
small: "max-w-100",
|
|
8
|
+
// 400px
|
|
9
|
+
medium: "max-w-125",
|
|
10
|
+
// 500px
|
|
11
|
+
large: "max-w-150",
|
|
12
|
+
// 600px
|
|
13
|
+
huge: "max-w-200"
|
|
14
|
+
// 800px
|
|
15
|
+
}, x = {
|
|
16
|
+
center: "inline-block",
|
|
17
|
+
topLeft: "absolute m-4 top-0 left-0",
|
|
18
|
+
topRight: "absolute m-4 top-0 right-0",
|
|
19
|
+
bottomLeft: "absolute m-4 bottom-0 left-0",
|
|
20
|
+
bottomRight: "absolute m-4 bottom-0 right-0"
|
|
21
|
+
}, l = {
|
|
22
|
+
center: {
|
|
23
|
+
enterFrom: "translate-y-4 sm:translate-y-0 sm:scale-95",
|
|
24
|
+
enterTo: "translate-y-0 sm:scale-100",
|
|
25
|
+
leaveFrom: "translate-y-0 sm:scale-100",
|
|
26
|
+
leaveTo: "translate-y-4 sm:translate-y-0 sm:scale-95"
|
|
27
|
+
},
|
|
28
|
+
topLeft: {
|
|
29
|
+
enterFrom: "scale-0 origin-top-left",
|
|
30
|
+
enterTo: "scale-100 origin-top-left",
|
|
31
|
+
leaveFrom: "scale-100 origin-top-left",
|
|
32
|
+
leaveTo: "scale-0 origin-top-left"
|
|
33
|
+
},
|
|
34
|
+
topRight: {
|
|
35
|
+
enterFrom: "scale-0 origin-top-right",
|
|
36
|
+
enterTo: "scale-100 origin-top-right",
|
|
37
|
+
leaveFrom: "scale-100 origin-top-right",
|
|
38
|
+
leaveTo: "scale-0 origin-top-right"
|
|
39
|
+
},
|
|
40
|
+
bottomLeft: {
|
|
41
|
+
enterFrom: "scale-0 origin-bottom-left",
|
|
42
|
+
enterTo: "scale-100 origin-bottom-left",
|
|
43
|
+
leaveFrom: "scale-100 origin-bottom-left",
|
|
44
|
+
leaveTo: "scale-0 origin-bottom-left"
|
|
45
|
+
},
|
|
46
|
+
bottomRight: {
|
|
47
|
+
enterFrom: "scale-0 origin-bottom-right",
|
|
48
|
+
enterTo: "scale-100 origin-bottom-right",
|
|
49
|
+
leaveFrom: "scale-100 origin-bottom-right",
|
|
50
|
+
leaveTo: "scale-0 origin-bottom-right"
|
|
51
|
+
}
|
|
52
|
+
}, g = ({
|
|
53
|
+
size: a = "medium",
|
|
54
|
+
position: e = "center",
|
|
55
|
+
isOpen: r = !1,
|
|
56
|
+
shouldCloseOnOutsideClick: i = !1,
|
|
57
|
+
children: b,
|
|
58
|
+
className: f,
|
|
59
|
+
onClose: n
|
|
60
|
+
}) => /* @__PURE__ */ t(s, { appear: !0, show: r, as: m, children: /* @__PURE__ */ t(d, { as: "div", className: "ui-modal fixed inset-0 z-30 overflow-y-auto", onClose: () => {
|
|
61
|
+
i && n();
|
|
62
|
+
}, children: /* @__PURE__ */ c("div", { className: "min-h-screen px-4 text-center", children: [
|
|
63
|
+
/* @__PURE__ */ t(
|
|
64
|
+
s.Child,
|
|
65
|
+
{
|
|
66
|
+
as: m,
|
|
67
|
+
enter: "ease-out duration-300",
|
|
68
|
+
enterFrom: "opacity-0",
|
|
69
|
+
enterTo: "opacity-100",
|
|
70
|
+
leave: "ease-in duration-200",
|
|
71
|
+
leaveFrom: "opacity-100",
|
|
72
|
+
leaveTo: "opacity-0",
|
|
73
|
+
children: /* @__PURE__ */ t(d.Overlay, { className: "ui-modal-overlay fixed inset-0 bg-black bg-opacity-80 transition-opacity" })
|
|
74
|
+
}
|
|
75
|
+
),
|
|
76
|
+
e === "center" && /* @__PURE__ */ t("span", { className: "inline-block h-screen align-middle", "aria-hidden": "true", children: "" }),
|
|
77
|
+
/* @__PURE__ */ t(
|
|
78
|
+
s.Child,
|
|
79
|
+
{
|
|
80
|
+
as: m,
|
|
81
|
+
enter: o("ease-out duration-300"),
|
|
82
|
+
enterFrom: o("opacity-0", l[e].enterFrom),
|
|
83
|
+
enterTo: o("opacity-100", l[e].enterTo),
|
|
84
|
+
leave: o("ease-in duration-300"),
|
|
85
|
+
leaveFrom: o("opacity-100", l[e].leaveFrom),
|
|
86
|
+
leaveTo: o("opacity-0", l[e].leaveTo),
|
|
87
|
+
children: /* @__PURE__ */ c(
|
|
88
|
+
"div",
|
|
89
|
+
{
|
|
90
|
+
className: o(
|
|
91
|
+
f,
|
|
92
|
+
y[a],
|
|
93
|
+
x[e],
|
|
94
|
+
"w-full transform overflow-hidden rounded-lg bg-white p-10 text-left align-middle shadow-xl transition-all"
|
|
95
|
+
),
|
|
96
|
+
children: [
|
|
97
|
+
n ? /* @__PURE__ */ t(
|
|
98
|
+
"button",
|
|
99
|
+
{
|
|
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: () => n(),
|
|
103
|
+
children: /* @__PURE__ */ t(v, {})
|
|
104
|
+
}
|
|
105
|
+
) : null,
|
|
106
|
+
b
|
|
107
|
+
]
|
|
108
|
+
}
|
|
109
|
+
)
|
|
110
|
+
}
|
|
111
|
+
)
|
|
112
|
+
] }) }) }), h = ({ description: a, children: e, className: r, ...i }) => /* @__PURE__ */ c(d.Title, { as: "div", className: o(r, "ui-modal-header text-center"), ...i, children: [
|
|
113
|
+
/* @__PURE__ */ t("h3", { className: "text-2xl font-semibold leading-6 text-black", children: e }),
|
|
114
|
+
a ? /* @__PURE__ */ t("p", { className: "mt-2 text-base font-normal leading-normal text-gray-darker", children: a }) : null
|
|
115
|
+
] });
|
|
116
|
+
h.displayName = "Modal.Header";
|
|
117
|
+
const p = ({ className: a, ...e }) => /* @__PURE__ */ t("div", { className: o(a, "ui-modal-body mt-10"), ...e });
|
|
118
|
+
p.displayName = "Modal.Body";
|
|
119
|
+
const u = ({ className: a, ...e }) => /* @__PURE__ */ t("div", { className: o(a, "ui-modal-footer mt-10 space-x-4 text-right"), ...e });
|
|
120
|
+
u.displayName = "Modal.Footer";
|
|
121
|
+
g.Header = h;
|
|
122
|
+
g.Body = p;
|
|
123
|
+
g.Footer = u;
|
|
124
|
+
export {
|
|
125
|
+
g as Modal
|
|
126
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { TippyProps } from '@tippyjs/react';
|
|
2
|
+
import { default as React } from 'react';
|
|
3
|
+
export interface PopoverProps extends Omit<Partial<TippyProps>, "children" | "className"> {
|
|
4
|
+
isLazy?: boolean;
|
|
5
|
+
skidding?: number;
|
|
6
|
+
distance?: number;
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
className?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare const Popover: {
|
|
11
|
+
({ isLazy, skidding, distance, children, className, ...rest }: PopoverProps): React.JSX.Element;
|
|
12
|
+
Content: {
|
|
13
|
+
({ children, className }: PopoverContentProps): React.JSX.Element;
|
|
14
|
+
displayName: string;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
export interface PopoverContentProps {
|
|
18
|
+
children: React.ReactNode;
|
|
19
|
+
className?: string;
|
|
20
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { jsx as m } from "react/jsx-runtime";
|
|
2
|
+
import d from "@tippyjs/react";
|
|
3
|
+
import u from "clsx";
|
|
4
|
+
import { Children as y, forwardRef as g, useState as C } from "react";
|
|
5
|
+
import { followCursor as v } from "tippy.js";
|
|
6
|
+
import "tippy.js/dist/border.css";
|
|
7
|
+
import "tippy.js/dist/tippy.css";
|
|
8
|
+
import { getChildrenByType as x } from "../../helpers/children.js";
|
|
9
|
+
import T from "./Popover.module.css.js";
|
|
10
|
+
import h from "./PopoverScroll.module.css.js";
|
|
11
|
+
const z = ({ isLazy: t = !0, skidding: o = 0, distance: r = 10, children: n, className: s, ...e }) => {
|
|
12
|
+
const p = x(n, l), a = y.toArray(n).filter((i) => i.type !== l);
|
|
13
|
+
return /* @__PURE__ */ m(
|
|
14
|
+
t ? f : d,
|
|
15
|
+
{
|
|
16
|
+
interactive: !0,
|
|
17
|
+
zIndex: 50,
|
|
18
|
+
content: p,
|
|
19
|
+
className: u(
|
|
20
|
+
"ui-popover",
|
|
21
|
+
h,
|
|
22
|
+
T.main,
|
|
23
|
+
"!rounded-lg !border-gray-light shadow-xl",
|
|
24
|
+
s
|
|
25
|
+
),
|
|
26
|
+
plugins: [v],
|
|
27
|
+
offset: [o ?? 0, r ?? 10],
|
|
28
|
+
...e,
|
|
29
|
+
children: /* @__PURE__ */ m("span", { children: a })
|
|
30
|
+
}
|
|
31
|
+
);
|
|
32
|
+
}, l = ({ children: t, className: o }) => /* @__PURE__ */ m("div", { className: u("ui-popover-content", o), children: t });
|
|
33
|
+
l.displayName = "Popover.Content";
|
|
34
|
+
z.Content = l;
|
|
35
|
+
const f = g((t, o) => {
|
|
36
|
+
const [r, n] = C(!1), s = {
|
|
37
|
+
fn: () => ({
|
|
38
|
+
onMount: () => n(!0),
|
|
39
|
+
onHidden: () => n(!1)
|
|
40
|
+
})
|
|
41
|
+
}, e = { ...t };
|
|
42
|
+
return e.plugins = [s, ...t.plugins ?? []], t.render ? e.render = (p, a, c) => {
|
|
43
|
+
var i;
|
|
44
|
+
return r ? (i = t.render) == null ? void 0 : i.call(t, p, a, c) : "";
|
|
45
|
+
} : e.content = r ? t.content : "", /* @__PURE__ */ m(d, { ...e, ref: o });
|
|
46
|
+
});
|
|
47
|
+
f.displayName = "LazyTippy";
|
|
48
|
+
export {
|
|
49
|
+
z as Popover
|
|
50
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { TippyProps } from '@tippyjs/react';
|
|
2
|
+
import { default as React } from 'react';
|
|
3
|
+
import { PopoverProps } from './Popover';
|
|
4
|
+
export interface PopoverListProps extends Omit<Partial<PopoverProps>, "placement" | "children" | "className"> {
|
|
5
|
+
placement?: TippyProps["placement"];
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
className?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const PopoverList: {
|
|
10
|
+
({ placement, children, className, ...rest }: PopoverListProps): React.JSX.Element;
|
|
11
|
+
Item: {
|
|
12
|
+
({ name, isActive, id, position, total, children, className, onClickItem, ...rest }: PopoverListItemProps): React.JSX.Element;
|
|
13
|
+
displayName: string;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
export interface PopoverListItemProps {
|
|
17
|
+
name: string;
|
|
18
|
+
isActive?: boolean;
|
|
19
|
+
id?: string | null;
|
|
20
|
+
position?: number;
|
|
21
|
+
total?: number;
|
|
22
|
+
children: React.ReactNode;
|
|
23
|
+
className?: string;
|
|
24
|
+
onClickItem: (event: React.MouseEvent<HTMLDivElement>, name: string, id: string | null) => void;
|
|
25
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { jsx as d } from "react/jsx-runtime";
|
|
2
|
+
import g from "clsx";
|
|
3
|
+
import v, { Children as h } from "react";
|
|
4
|
+
import { Popover as u } from "./Popover.js";
|
|
5
|
+
import f from "./PopoverScroll.module.css.js";
|
|
6
|
+
const y = ({ placement: n = "bottom", children: i, className: s, ...o }) => {
|
|
7
|
+
const e = h.toArray(i), r = e.filter((t) => t.type !== l), m = e.length - r.length, p = e.map((t, a) => t.type === l ? v.cloneElement(t, { position: a, total: m }) : null), c = /* @__PURE__ */ d(
|
|
8
|
+
u.Content,
|
|
9
|
+
{
|
|
10
|
+
className: g(f, "ui-popover-list-content divide-y divide-solid divide-gray-lighter p-0 "),
|
|
11
|
+
children: p
|
|
12
|
+
}
|
|
13
|
+
);
|
|
14
|
+
return /* @__PURE__ */ d(
|
|
15
|
+
u,
|
|
16
|
+
{
|
|
17
|
+
content: c,
|
|
18
|
+
placement: n,
|
|
19
|
+
className: g("ui-popover-list", "w-40", s),
|
|
20
|
+
...o,
|
|
21
|
+
children: r
|
|
22
|
+
}
|
|
23
|
+
);
|
|
24
|
+
}, l = ({
|
|
25
|
+
name: n,
|
|
26
|
+
isActive: i = !1,
|
|
27
|
+
id: s = null,
|
|
28
|
+
position: o,
|
|
29
|
+
total: e,
|
|
30
|
+
children: r,
|
|
31
|
+
className: m,
|
|
32
|
+
onClickItem: p,
|
|
33
|
+
...c
|
|
34
|
+
}) => {
|
|
35
|
+
const t = (a) => p(a, n, s);
|
|
36
|
+
return /* @__PURE__ */ d(
|
|
37
|
+
"div",
|
|
38
|
+
{
|
|
39
|
+
className: g(
|
|
40
|
+
"ui-popover-list-item",
|
|
41
|
+
"flex cursor-pointer space-x-2.5 p-4 align-text-top font-semibold leading-4 tracking-tightest hover:bg-gray-lighter",
|
|
42
|
+
i ? "bg-gray-lighter" : null,
|
|
43
|
+
o === 1 ? "rounded-t-lg" : null,
|
|
44
|
+
// Round the top left & right corners if it's the first one
|
|
45
|
+
o === e ? "rounded-b-lg" : null,
|
|
46
|
+
// Round bottom left & right if it's the last one
|
|
47
|
+
m
|
|
48
|
+
),
|
|
49
|
+
onClick: t,
|
|
50
|
+
...c,
|
|
51
|
+
children: r
|
|
52
|
+
}
|
|
53
|
+
);
|
|
54
|
+
};
|
|
55
|
+
l.displayName = "PopoverList.Item";
|
|
56
|
+
y.Item = l;
|
|
57
|
+
export {
|
|
58
|
+
y as PopoverList
|
|
59
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface ContextValue {
|
|
3
|
+
generateId: () => number;
|
|
4
|
+
localize: boolean;
|
|
5
|
+
locale: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const Context: React.Context<ContextValue>;
|
|
8
|
+
export interface ProviderProps {
|
|
9
|
+
children: React.ReactNode;
|
|
10
|
+
localize?: boolean;
|
|
11
|
+
locale?: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* UI Kit's default provider.
|
|
15
|
+
* Must be used from now on in order to generate correct component IDs.
|
|
16
|
+
* Also a good place to implement any global state required for the UI Kit in the future.
|
|
17
|
+
*/
|
|
18
|
+
export declare const Provider: ({ children, localize, locale }: ProviderProps) => React.JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as u } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as s, useRef as i, useCallback as c, useMemo as l } from "react";
|
|
3
|
+
let p = 1;
|
|
4
|
+
const m = s({
|
|
5
|
+
generateId: () => (console.warn(
|
|
6
|
+
"Please wrap your app with `<Provider />` component from `@xola/ui-kit`. Otherwise your app will not work with SSR frameworks."
|
|
7
|
+
), p++),
|
|
8
|
+
localize: !0,
|
|
9
|
+
locale: "en_US"
|
|
10
|
+
}), f = ({ children: n, localize: e = !0, locale: r = "en_US" }) => {
|
|
11
|
+
const t = i(1), o = c(() => t.current++, [t]), a = l(() => ({ generateId: o, localize: e, locale: r }), [o, e, r]);
|
|
12
|
+
return /* @__PURE__ */ u(m.Provider, { value: a, children: n });
|
|
13
|
+
};
|
|
14
|
+
export {
|
|
15
|
+
m as Context,
|
|
16
|
+
f as Provider
|
|
17
|
+
};
|