@xola/ui-kit 3.4.6 → 3.6.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 +48 -78
- package/build/style.css +1 -0
- package/build/theme.css +76 -0
- package/build/ui-kit.es.js +16771 -0
- package/index.css +96 -4
- package/index.d.ts +151 -0
- package/package.json +68 -89
- package/postcss.config.js +1 -1
- package/tailwind.config.js +10 -11
- package/build/base.css +0 -2
- package/build/components/Alert.d.ts +0 -18
- package/build/components/Alert.js +0 -28
- package/build/components/Animation/FadeIn.d.ts +0 -13
- package/build/components/Animation/FadeIn.js +0 -29
- package/build/components/Animation/SlideDown.d.ts +0 -6
- package/build/components/Animation/SlideDown.js +0 -20
- package/build/components/Avatar.d.ts +0 -16
- package/build/components/Avatar.js +0 -21
- package/build/components/Badge.d.ts +0 -28
- package/build/components/Badge.js +0 -42
- package/build/components/Breadcrumb.d.ts +0 -21
- package/build/components/Breadcrumb.js +0 -27
- package/build/components/Breakdown.d.ts +0 -63
- package/build/components/Breakdown.js +0 -89
- package/build/components/Buttons/Button.d.ts +0 -53
- package/build/components/Buttons/Button.js +0 -83
- package/build/components/Buttons/ButtonGroup.d.ts +0 -35
- package/build/components/Buttons/ButtonGroup.js +0 -55
- package/build/components/Buttons/SubmitButton.d.ts +0 -11
- package/build/components/Buttons/SubmitButton.js +0 -83
- package/build/components/Buttons/ToggleButton.d.ts +0 -21
- package/build/components/Buttons/ToggleButton.js +0 -34
- package/build/components/Charts/BaseChartOptions.d.ts +0 -136
- package/build/components/Charts/BaseChartOptions.js +0 -95
- package/build/components/Charts/HistogramOptions.d.ts +0 -192
- package/build/components/Charts/HistogramOptions.js +0 -69
- package/build/components/Charts/PieOptions.d.ts +0 -177
- package/build/components/Charts/PieOptions.js +0 -55
- package/build/components/Counter.d.ts +0 -5
- package/build/components/Counter.js +0 -16
- package/build/components/DatePicker/DatePicker.d.ts +0 -41
- package/build/components/DatePicker/DatePicker.helpers.d.ts +0 -17
- package/build/components/DatePicker/DatePicker.helpers.js +0 -22
- package/build/components/DatePicker/DatePicker.js +0 -241
- package/build/components/DatePicker/DatePickerPopover.d.ts +0 -29
- package/build/components/DatePicker/DatePickerPopover.js +0 -81
- package/build/components/DatePicker/Day.d.ts +0 -13
- package/build/components/DatePicker/Day.js +0 -40
- package/build/components/DatePicker/LocalizedDayPicker.d.ts +0 -6
- package/build/components/DatePicker/LocalizedDayPicker.js +0 -20
- package/build/components/DatePicker/MonthGrid.d.ts +0 -11
- package/build/components/DatePicker/MonthGrid.js +0 -52
- package/build/components/DatePicker/MonthPicker.d.ts +0 -7
- package/build/components/DatePicker/MonthPicker.js +0 -28
- package/build/components/DatePicker/MonthSelector.d.ts +0 -8
- package/build/components/DatePicker/MonthSelector.js +0 -47
- package/build/components/DatePicker/MonthYearSelector.d.ts +0 -8
- package/build/components/DatePicker/MonthYearSelector.js +0 -44
- package/build/components/DatePicker/NavbarElement.d.ts +0 -15
- package/build/components/DatePicker/NavbarElement.js +0 -43
- package/build/components/DatePicker/RangeDatePicker.d.ts +0 -25
- package/build/components/DatePicker/RangeDatePicker.js +0 -134
- package/build/components/DatePicker/RelativeDateRange.d.ts +0 -51
- package/build/components/DatePicker/RelativeDateRange.js +0 -280
- package/build/components/DatePicker/UpcomingDatePicker.d.ts +0 -11
- package/build/components/DatePicker/UpcomingDatePicker.js +0 -27
- package/build/components/Dot/Dot.d.ts +0 -24
- package/build/components/Dot/Dot.js +0 -24
- package/build/components/Dot/DotProgress.d.ts +0 -6
- package/build/components/Dot/DotProgress.js +0 -10
- package/build/components/Drawer.d.ts +0 -28
- package/build/components/Drawer.js +0 -126
- package/build/components/Forms/BaseInput.d.ts +0 -20
- package/build/components/Forms/BaseInput.js +0 -41
- package/build/components/Forms/Checkbox.d.ts +0 -10
- package/build/components/Forms/Checkbox.js +0 -34
- package/build/components/Forms/Checkbox.module.css.js +0 -7
- package/build/components/Forms/ComboBox.d.ts +0 -8
- package/build/components/Forms/ComboBox.js +0 -41
- package/build/components/Forms/FormGroup.d.ts +0 -5
- package/build/components/Forms/FormGroup.js +0 -6
- package/build/components/Forms/InlineValuePopover.d.ts +0 -17
- package/build/components/Forms/InlineValuePopover.js +0 -47
- package/build/components/Forms/Input.d.ts +0 -6
- package/build/components/Forms/Input.js +0 -9
- package/build/components/Forms/Label.d.ts +0 -7
- package/build/components/Forms/Label.js +0 -17
- package/build/components/Forms/RangeSlider.d.ts +0 -33
- package/build/components/Forms/RangeSlider.js +0 -39
- package/build/components/Forms/Select.d.ts +0 -5
- package/build/components/Forms/Select.js +0 -8
- package/build/components/Forms/Switch.d.ts +0 -46
- package/build/components/Forms/Switch.js +0 -62
- package/build/components/Forms/Textarea.d.ts +0 -6
- package/build/components/Forms/Textarea.js +0 -35
- package/build/components/Forms/ValuePopoverText.d.ts +0 -6
- package/build/components/Forms/ValuePopoverText.js +0 -10
- package/build/components/GooglePlacesAutocomplete.d.ts +0 -14
- package/build/components/HeaderToolbar.d.ts +0 -21
- package/build/components/HeaderToolbar.js +0 -33
- package/build/components/ImageUpload.d.ts +0 -17
- package/build/components/ImageUpload.js +0 -86
- package/build/components/Key.d.ts +0 -6
- package/build/components/Key.js +0 -28
- package/build/components/Logo.d.ts +0 -19
- package/build/components/Logo.js +0 -10
- package/build/components/Modal.d.ts +0 -52
- package/build/components/Modal.js +0 -126
- package/build/components/Popover/Popover.d.ts +0 -20
- package/build/components/Popover/Popover.js +0 -50
- package/build/components/Popover/Popover.module.css.js +0 -7
- package/build/components/Popover/PopoverList.d.ts +0 -25
- package/build/components/Popover/PopoverList.js +0 -59
- package/build/components/Popover/PopoverScroll.module.css.js +0 -4
- package/build/components/Provider.d.ts +0 -18
- package/build/components/Provider.js +0 -17
- package/build/components/Screens/Login.d.ts +0 -25
- package/build/components/Screens/Login.js +0 -144
- package/build/components/Search.d.ts +0 -16
- package/build/components/Search.js +0 -174
- package/build/components/Sidebar/Sidebar.Account.d.ts +0 -13
- package/build/components/Sidebar/Sidebar.Account.js +0 -56
- package/build/components/Sidebar/Sidebar.Button.d.ts +0 -10
- package/build/components/Sidebar/Sidebar.Button.js +0 -21
- package/build/components/Sidebar/Sidebar.Footer.d.ts +0 -8
- package/build/components/Sidebar/Sidebar.Footer.js +0 -9
- package/build/components/Sidebar/Sidebar.Heading.d.ts +0 -10
- package/build/components/Sidebar/Sidebar.Heading.js +0 -10
- package/build/components/Sidebar/Sidebar.Link.d.ts +0 -24
- package/build/components/Sidebar/Sidebar.Link.js +0 -56
- package/build/components/Sidebar/Sidebar.Menu.d.ts +0 -10
- package/build/components/Sidebar/Sidebar.Menu.js +0 -28
- package/build/components/Sidebar/Sidebar.Menu.module.css.js +0 -7
- package/build/components/Sidebar/Sidebar.d.ts +0 -58
- package/build/components/Sidebar/Sidebar.js +0 -219
- package/build/components/Sidebar/SidebarScroll.module.css.js +0 -4
- package/build/components/Sidebar/index.d.ts +0 -8
- package/build/components/Skeleton.d.ts +0 -13
- package/build/components/Skeleton.js +0 -29
- package/build/components/Skeleton.module.css.js +0 -7
- package/build/components/Spinner.d.ts +0 -26
- package/build/components/Spinner.js +0 -27
- package/build/components/Table.d.ts +0 -59
- package/build/components/Table.js +0 -71
- package/build/components/Tabs/Tabs.Panel.d.ts +0 -9
- package/build/components/Tabs/Tabs.Panel.js +0 -7
- package/build/components/Tabs/Tabs.Tab.d.ts +0 -19
- package/build/components/Tabs/Tabs.Tab.js +0 -37
- package/build/components/Tabs/Tabs.d.ts +0 -27
- package/build/components/Tabs/Tabs.js +0 -28
- package/build/components/Tabs/index.d.ts +0 -4
- package/build/components/Tag.d.ts +0 -25
- package/build/components/Tag.js +0 -36
- package/build/components/Tooltip.d.ts +0 -8
- package/build/components/Tooltip.js +0 -8
- package/build/components/Utilities/Currency.d.ts +0 -32
- package/build/components/Utilities/Currency.js +0 -49
- package/build/components/Utilities/Number.d.ts +0 -8
- package/build/components/Utilities/Number.js +0 -15
- package/build/components/Utilities/Phone.d.ts +0 -8
- package/build/components/Utilities/Phone.js +0 -19
- package/build/full.css +0 -2
- package/build/helpers/avatar.d.ts +0 -1
- package/build/helpers/avatar.js +0 -8
- package/build/helpers/browser.d.ts +0 -2
- package/build/helpers/browser.js +0 -9
- package/build/helpers/children.d.ts +0 -3
- package/build/helpers/children.js +0 -6
- package/build/helpers/classnames.d.ts +0 -5
- package/build/helpers/currency.d.ts +0 -2
- package/build/helpers/currency.js +0 -11
- package/build/helpers/date.d.ts +0 -12
- package/build/helpers/date.js +0 -49
- package/build/helpers/flash.d.ts +0 -21
- package/build/helpers/flash.js +0 -87
- package/build/helpers/numbers.d.ts +0 -4
- package/build/helpers/numbers.js +0 -23
- package/build/helpers/phone.d.ts +0 -11
- package/build/helpers/phone.js +0 -25
- package/build/hooks/useId.d.ts +0 -1
- package/build/hooks/useId.js +0 -9
- package/build/hooks/useIsClient.d.ts +0 -1
- package/build/hooks/useIsClient.js +0 -10
- package/build/hooks/useViewportHeight.d.ts +0 -1
- package/build/hooks/useViewportHeight.js +0 -15
- package/build/icons/src/AnnounceIcon.js +0 -13
- package/build/icons/src/BellIcon.js +0 -27
- package/build/icons/src/CalendarIcon.js +0 -16
- package/build/icons/src/CheckIcon.js +0 -8
- package/build/icons/src/ChevronDownIcon.js +0 -8
- package/build/icons/src/ChevronLeftIcon.js +0 -8
- package/build/icons/src/ChevronRightIcon.js +0 -8
- package/build/icons/src/CircleNotch.js +0 -6
- package/build/icons/src/CloseIcon.js +0 -11
- package/build/icons/src/DownArrowIcon.js +0 -16
- package/build/icons/src/ImageIcon.js +0 -27
- package/build/icons/src/SearchIcon.js +0 -16
- package/build/icons/src/TrashIcon.js +0 -20
- package/build/icons/src/WarningDiamondIcon.js +0 -27
- package/build/icons/src/helpers/classnames.js +0 -8
- package/build/icons/src/helpers/icon.js +0 -11
- package/build/icons/src/helpers/iconSizes.js +0 -13
- package/build/icons/src/images/XolaLogoSimple.js +0 -14
- package/build/index.d.ts +0 -66
- package/build/index.js +0 -142
- package/build/theme.d.ts +0 -413
- package/build/theme.js +0 -372
- package/build/types/index.d.ts +0 -22
- package/build/types/migration.d.ts +0 -2
- package/build/ui-kit.css +0 -1
- package/build/utils/avatar.d.ts +0 -1
- package/build/utils/avatar.js +0 -8
- package/build/utils/currency.d.ts +0 -2
- package/build/utils/currency.js +0 -11
- package/build/utils/index.d.ts +0 -4
- package/build/utils/numbers.d.ts +0 -4
- package/build/utils/numbers.js +0 -19
- package/build/utils/phone.d.ts +0 -2
- package/build/utils/phone.js +0 -17
|
@@ -1,174 +0,0 @@
|
|
|
1
|
-
import { jsxs as l, jsx as t, Fragment as re } from "react/jsx-runtime";
|
|
2
|
-
import I from "clsx";
|
|
3
|
-
import { useCombobox as w } from "downshift";
|
|
4
|
-
import { debounce as le } from "lodash-es";
|
|
5
|
-
import { useState as u, useRef as E, useEffect as K } from "react";
|
|
6
|
-
import { useHotkeys as O } from "react-hotkeys-hook";
|
|
7
|
-
import { isOSX as ae } from "../helpers/browser.js";
|
|
8
|
-
import { useId as R } from "../hooks/useId.js";
|
|
9
|
-
import { useIsClient as ne } from "../hooks/useIsClient.js";
|
|
10
|
-
import { Key as n } from "./Key.js";
|
|
11
|
-
import { Spinner as ce } from "./Spinner.js";
|
|
12
|
-
import { SearchIcon as oe } from "../icons/src/SearchIcon.js";
|
|
13
|
-
const ie = le((m, h) => m(h), 500), Ie = ({
|
|
14
|
-
className: m,
|
|
15
|
-
items: h = [],
|
|
16
|
-
defaultValue: D,
|
|
17
|
-
onChange: o,
|
|
18
|
-
onSubmit: d,
|
|
19
|
-
onSelect: p,
|
|
20
|
-
children: f,
|
|
21
|
-
isLoading: C = !1,
|
|
22
|
-
shouldStayOpen: M = !1,
|
|
23
|
-
shouldDestroyOnClose: $ = !0,
|
|
24
|
-
shouldHideMenu: T = !1,
|
|
25
|
-
minChars: g = 0,
|
|
26
|
-
...j
|
|
27
|
-
}) => {
|
|
28
|
-
const [z, k] = u(!0), [r, x] = u(D ?? ""), [B, P] = u(!1), a = E(null), U = R("search-input"), H = R("search-menu"), X = ne(), q = E(null), [A, v] = u(!0);
|
|
29
|
-
K(() => {
|
|
30
|
-
r.length > 0 ? P(!0) : P(!1);
|
|
31
|
-
}, [r]);
|
|
32
|
-
const i = { value: r }, c = r ? [i, ...h] : [], G = ({ selectedItem: e, type: s }) => {
|
|
33
|
-
var F, S;
|
|
34
|
-
s !== w.stateChangeTypes.InputBlur && s !== w.stateChangeTypes.FunctionCloseMenu && (e === i ? (d == null || d(r), (F = a.current) == null || F.blur()) : e && (p == null || p(e), (S = a.current) == null || S.blur()), _());
|
|
35
|
-
}, J = ({ inputValue: e }) => {
|
|
36
|
-
const s = e ?? "";
|
|
37
|
-
x(s), o && ie(o, s);
|
|
38
|
-
}, {
|
|
39
|
-
isOpen: b,
|
|
40
|
-
openMenu: L,
|
|
41
|
-
getMenuProps: Q,
|
|
42
|
-
getInputProps: W,
|
|
43
|
-
getComboboxProps: Y,
|
|
44
|
-
highlightedIndex: V,
|
|
45
|
-
getItemProps: Z,
|
|
46
|
-
closeMenu: _
|
|
47
|
-
} = w({
|
|
48
|
-
items: c,
|
|
49
|
-
inputValue: r,
|
|
50
|
-
onInputValueChange: J,
|
|
51
|
-
itemToString: () => r,
|
|
52
|
-
// We will not change the search input after an item is selected.
|
|
53
|
-
defaultHighlightedIndex: 0,
|
|
54
|
-
onSelectedItemChange: G
|
|
55
|
-
});
|
|
56
|
-
K(() => {
|
|
57
|
-
b ? v(!1) : setTimeout(() => v(!0), 1);
|
|
58
|
-
}, [b, v]);
|
|
59
|
-
const ee = () => {
|
|
60
|
-
k(!1), L();
|
|
61
|
-
}, te = () => {
|
|
62
|
-
var e;
|
|
63
|
-
x(""), o && o(""), (e = a.current) == null || e.focus();
|
|
64
|
-
};
|
|
65
|
-
O(
|
|
66
|
-
ae ? "cmd+k" : "ctrl+k",
|
|
67
|
-
(e) => {
|
|
68
|
-
var s;
|
|
69
|
-
e.preventDefault(), (s = a.current) == null || s.focus();
|
|
70
|
-
},
|
|
71
|
-
{ enableOnTags: ["INPUT"] }
|
|
72
|
-
), O(
|
|
73
|
-
"esc",
|
|
74
|
-
(e) => {
|
|
75
|
-
var s;
|
|
76
|
-
(document == null ? void 0 : document.activeElement) === a.current && (e.preventDefault(), r.length > 0 ? te() : (s = a.current) == null || s.blur());
|
|
77
|
-
},
|
|
78
|
-
{ enableOnTags: ["INPUT"] }
|
|
79
|
-
);
|
|
80
|
-
const N = (b || !A || M) && c.length > 0 && !T, se = N && !C && c.length <= 1 && r.length >= g, y = N || !$;
|
|
81
|
-
return /* @__PURE__ */ l("div", { className: "ui-search relative w-full", children: [
|
|
82
|
-
/* @__PURE__ */ l("div", { ...Y({ className: "w-full relative rounded-md" }), children: [
|
|
83
|
-
/* @__PURE__ */ t("div", { className: "pointer-events-none absolute inset-y-0 -top-0.5 left-0 hidden items-center md:flex", children: /* @__PURE__ */ t(oe, { className: "h-4 w-4 text-gray-darker" }) }),
|
|
84
|
-
/* @__PURE__ */ t(
|
|
85
|
-
"input",
|
|
86
|
-
{
|
|
87
|
-
...W({
|
|
88
|
-
id: U,
|
|
89
|
-
type: "text",
|
|
90
|
-
className: I(
|
|
91
|
-
"ui-search-input",
|
|
92
|
-
"block w-full border-none pl-0 md:pl-7 text-base md:text-md text-gray-darker leading-p2 focus:ring-0",
|
|
93
|
-
m
|
|
94
|
-
),
|
|
95
|
-
ref: a,
|
|
96
|
-
onFocus: ee,
|
|
97
|
-
onBlur: () => k(!0),
|
|
98
|
-
onChange: (e) => x(e.target.value),
|
|
99
|
-
...j
|
|
100
|
-
})
|
|
101
|
-
}
|
|
102
|
-
),
|
|
103
|
-
/* @__PURE__ */ t("div", { className: "pointer-events-none absolute inset-y-0 right-0 hidden items-center space-x-1 pr-3 lg:flex", children: X && z ? /* @__PURE__ */ l(re, { children: [
|
|
104
|
-
/* @__PURE__ */ t(n, { char: "cmd" }),
|
|
105
|
-
" ",
|
|
106
|
-
/* @__PURE__ */ t(n, { char: "K" })
|
|
107
|
-
] }) : null })
|
|
108
|
-
] }),
|
|
109
|
-
/* @__PURE__ */ t("div", { className: "relative", children: T && /* @__PURE__ */ t(
|
|
110
|
-
"div",
|
|
111
|
-
{
|
|
112
|
-
ref: q,
|
|
113
|
-
className: `text-gray-500 absolute left-0 top-full transform
|
|
114
|
-
text-xs transition-all duration-200
|
|
115
|
-
ease-in-out ${B ? "translate-y-0 opacity-100" : "-translate-y-2 opacity-0"}`,
|
|
116
|
-
children: /* @__PURE__ */ l("span", { className: "inline-flex items-center gap-1", children: [
|
|
117
|
-
/* @__PURE__ */ t(n, { char: "Esc" }),
|
|
118
|
-
/* @__PURE__ */ t("span", { children: "Clear search" })
|
|
119
|
-
] })
|
|
120
|
-
}
|
|
121
|
-
) }),
|
|
122
|
-
/* @__PURE__ */ l(
|
|
123
|
-
"ul",
|
|
124
|
-
{
|
|
125
|
-
...Q({
|
|
126
|
-
id: H,
|
|
127
|
-
className: I(
|
|
128
|
-
"ui-search-menu",
|
|
129
|
-
"absolute top-10 divide-y divide-gray-light w-full xl:w-[590px] max-h-[75vh] border border-secondary-lighter shadow-xl mt-1 rounded overflow-auto z-20 bg-white",
|
|
130
|
-
{ hidden: !N }
|
|
131
|
-
)
|
|
132
|
-
}),
|
|
133
|
-
children: [
|
|
134
|
-
y ? c.map((e, s) => /* @__PURE__ */ t(
|
|
135
|
-
"li",
|
|
136
|
-
{
|
|
137
|
-
...Z({ key: s, item: e, index: s, className: "ui-search-item" }),
|
|
138
|
-
children: e === i ? C ? /* @__PURE__ */ t("div", { className: "p-3 text-center", children: /* @__PURE__ */ t(ce, { size: "small" }) }) : r.length < g ? /* @__PURE__ */ t(
|
|
139
|
-
"div",
|
|
140
|
-
{
|
|
141
|
-
className: I(
|
|
142
|
-
"cursor-pointer p-2",
|
|
143
|
-
V === s ? "bg-blue-light text-white" : ""
|
|
144
|
-
),
|
|
145
|
-
children: `Enter at least ${g} characters to begin search`
|
|
146
|
-
}
|
|
147
|
-
) : null : f == null ? void 0 : f(e, V === s)
|
|
148
|
-
},
|
|
149
|
-
e === i ? "submit-value" : `search-item-${s}`
|
|
150
|
-
)) : null,
|
|
151
|
-
y && se ? /* @__PURE__ */ t("li", { className: "cursor-not-allowed p-2", children: "No results found" }) : null,
|
|
152
|
-
y && c.length < 5 ? /* @__PURE__ */ l("li", { className: "search-footer pointer-events sticky bottom-0 flex space-x-5 p-2 text-sm text-gray-dark", children: [
|
|
153
|
-
/* @__PURE__ */ l("span", { className: "flex items-center", children: [
|
|
154
|
-
/* @__PURE__ */ t(n, { char: "up", className: "mr-0.5" }),
|
|
155
|
-
/* @__PURE__ */ t(n, { char: "down", className: "mr-2" }),
|
|
156
|
-
" navigate results"
|
|
157
|
-
] }),
|
|
158
|
-
/* @__PURE__ */ l("span", { className: "flex items-center", children: [
|
|
159
|
-
/* @__PURE__ */ t(n, { char: "enter", className: "mr-2" }),
|
|
160
|
-
" submit"
|
|
161
|
-
] }),
|
|
162
|
-
/* @__PURE__ */ l("span", { className: "flex items-center", children: [
|
|
163
|
-
/* @__PURE__ */ t(n, { char: "esc", className: "mr-2" }),
|
|
164
|
-
" close search"
|
|
165
|
-
] })
|
|
166
|
-
] }) : null
|
|
167
|
-
]
|
|
168
|
-
}
|
|
169
|
-
)
|
|
170
|
-
] });
|
|
171
|
-
};
|
|
172
|
-
export {
|
|
173
|
-
Ie as Search
|
|
174
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
|
-
export interface SidebarAccountProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
3
|
-
name: string;
|
|
4
|
-
description?: string;
|
|
5
|
-
image?: React.ReactElement;
|
|
6
|
-
icon?: React.ReactElement;
|
|
7
|
-
isResponsive?: boolean;
|
|
8
|
-
className?: string;
|
|
9
|
-
}
|
|
10
|
-
export declare const SidebarAccount: {
|
|
11
|
-
({ name, description, image, icon, isResponsive, className, ...rest }: SidebarAccountProps): React.JSX.Element;
|
|
12
|
-
displayName: string;
|
|
13
|
-
};
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { jsxs as l, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import m from "clsx";
|
|
3
|
-
import { useRef as w, useState as d, useEffect as N } from "react";
|
|
4
|
-
import { Avatar as g } from "../Avatar.js";
|
|
5
|
-
import { ChevronRightIcon as S } from "../../icons/src/ChevronRightIcon.js";
|
|
6
|
-
const j = ({
|
|
7
|
-
name: n,
|
|
8
|
-
description: o,
|
|
9
|
-
image: h,
|
|
10
|
-
icon: x = /* @__PURE__ */ e(S, {}),
|
|
11
|
-
isResponsive: r = !1,
|
|
12
|
-
className: b,
|
|
13
|
-
...y
|
|
14
|
-
}) => {
|
|
15
|
-
const t = w(null), [s, a] = d(!r), [p, u] = d(!r), v = h ?? /* @__PURE__ */ e(g, { size: "tiny", name: n });
|
|
16
|
-
return N(() => {
|
|
17
|
-
if (!r) {
|
|
18
|
-
a(!0), u(!0);
|
|
19
|
-
return;
|
|
20
|
-
}
|
|
21
|
-
const i = () => {
|
|
22
|
-
t.current && (a(t.current.offsetWidth > 135), u(t.current.offsetWidth > 175 || t.current.offsetWidth < 135));
|
|
23
|
-
};
|
|
24
|
-
i();
|
|
25
|
-
const f = new ResizeObserver(i), c = t.current;
|
|
26
|
-
return c && f.observe(c), () => {
|
|
27
|
-
c && f.unobserve(c);
|
|
28
|
-
};
|
|
29
|
-
}, [r]), /* @__PURE__ */ l(
|
|
30
|
-
"button",
|
|
31
|
-
{
|
|
32
|
-
ref: t,
|
|
33
|
-
type: "button",
|
|
34
|
-
className: m(
|
|
35
|
-
"ui-sidebar-account",
|
|
36
|
-
"flex h-12 w-full cursor-pointer items-center justify-center rounded px-4 py-3 hover:bg-gray-darker",
|
|
37
|
-
"xl:justify-start",
|
|
38
|
-
// Full layout on xl screens
|
|
39
|
-
b
|
|
40
|
-
),
|
|
41
|
-
...y,
|
|
42
|
-
children: [
|
|
43
|
-
p && /* @__PURE__ */ e("div", { className: m(r && "m-auto", "flex-shrink-0"), children: v }),
|
|
44
|
-
s && /* @__PURE__ */ l("div", { className: "ml-2 min-w-0 text-left", children: [
|
|
45
|
-
/* @__PURE__ */ e("div", { className: "truncate text-base", children: n }),
|
|
46
|
-
o && /* @__PURE__ */ e("div", { className: "truncate text-sm text-gray-dark", children: o })
|
|
47
|
-
] }),
|
|
48
|
-
s && /* @__PURE__ */ e("span", { className: "ml-auto", children: x })
|
|
49
|
-
]
|
|
50
|
-
}
|
|
51
|
-
);
|
|
52
|
-
};
|
|
53
|
-
j.displayName = "Sidebar.Account";
|
|
54
|
-
export {
|
|
55
|
-
j as SidebarAccount
|
|
56
|
-
};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { default as React, ComponentType } from 'react';
|
|
2
|
-
export interface SidebarButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
3
|
-
icon: ComponentType<React.SVGProps<SVGSVGElement>>;
|
|
4
|
-
label: string;
|
|
5
|
-
className?: string;
|
|
6
|
-
}
|
|
7
|
-
export declare const SidebarButton: {
|
|
8
|
-
({ icon: Icon, label, className, ...rest }: SidebarButtonProps): React.JSX.Element;
|
|
9
|
-
displayName: string;
|
|
10
|
-
};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { jsxs as o, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import n from "clsx";
|
|
3
|
-
const i = ({ icon: r, label: t, className: s, ...a }) => /* @__PURE__ */ o(
|
|
4
|
-
"button",
|
|
5
|
-
{
|
|
6
|
-
type: "button",
|
|
7
|
-
className: n(
|
|
8
|
-
"ui-sidebar-button flex w-full cursor-pointer items-center rounded px-4 py-2 hover:bg-gray-darker",
|
|
9
|
-
s
|
|
10
|
-
),
|
|
11
|
-
...a,
|
|
12
|
-
children: [
|
|
13
|
-
/* @__PURE__ */ e("div", { className: "p-1.5", children: /* @__PURE__ */ e(r, { className: "h-4 w-4" }) }),
|
|
14
|
-
/* @__PURE__ */ e("span", { className: "ml-2", children: t })
|
|
15
|
-
]
|
|
16
|
-
}
|
|
17
|
-
);
|
|
18
|
-
i.displayName = "Sidebar.Button";
|
|
19
|
-
export {
|
|
20
|
-
i as SidebarButton
|
|
21
|
-
};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
|
-
export interface SidebarFooterProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
|
-
children: React.ReactNode;
|
|
4
|
-
}
|
|
5
|
-
export declare const SidebarFooter: {
|
|
6
|
-
({ children, ...rest }: SidebarFooterProps): React.JSX.Element;
|
|
7
|
-
displayName: string;
|
|
8
|
-
};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { jsxs as o, jsx as a } from "react/jsx-runtime";
|
|
2
|
-
const d = ({ children: r, ...e }) => /* @__PURE__ */ o("div", { className: "ui-sidebar-footer py-3", ...e, children: [
|
|
3
|
-
/* @__PURE__ */ a("div", { className: "mx-4 border-t border-secondary-darker pb-2" }),
|
|
4
|
-
r
|
|
5
|
-
] });
|
|
6
|
-
d.displayName = "Sidebar.Footer";
|
|
7
|
-
export {
|
|
8
|
-
d as SidebarFooter
|
|
9
|
-
};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { default as React, ComponentType } from 'react';
|
|
2
|
-
export interface SidebarHeadingProps {
|
|
3
|
-
icon: ComponentType<React.SVGProps<SVGSVGElement>>;
|
|
4
|
-
label: string;
|
|
5
|
-
className?: string;
|
|
6
|
-
}
|
|
7
|
-
export declare const SidebarHeading: {
|
|
8
|
-
({ icon: Icon, label, className }: SidebarHeadingProps): React.JSX.Element;
|
|
9
|
-
displayName: string;
|
|
10
|
-
};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { jsxs as t, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import i from "clsx";
|
|
3
|
-
const m = ({ icon: s, label: a, className: r }) => /* @__PURE__ */ t("p", { className: i("ml-4 flex items-center text-white", r), children: [
|
|
4
|
-
/* @__PURE__ */ e(s, { className: "mr-3 h-5 w-5" }),
|
|
5
|
-
/* @__PURE__ */ e("span", { className: "text-md font-bold", children: a })
|
|
6
|
-
] });
|
|
7
|
-
m.displayName = "Sidebar.Heading";
|
|
8
|
-
export {
|
|
9
|
-
m as SidebarHeading
|
|
10
|
-
};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { default as React, ComponentType } from 'react';
|
|
2
|
-
type SidebarLinkAlign = "center" | "left" | "right";
|
|
3
|
-
export interface SidebarLinkProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
4
|
-
isActive?: boolean;
|
|
5
|
-
icon?: ComponentType<React.SVGProps<SVGSVGElement>>;
|
|
6
|
-
isSubMenuItem?: boolean;
|
|
7
|
-
align?: SidebarLinkAlign;
|
|
8
|
-
children: React.ReactNode;
|
|
9
|
-
classNames?: {
|
|
10
|
-
text?: string;
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
|
-
export declare const SidebarLink: {
|
|
14
|
-
({ isActive, icon: Icon, isSubMenuItem, align, children, classNames, ...rest }: SidebarLinkProps): React.JSX.Element;
|
|
15
|
-
displayName: string;
|
|
16
|
-
};
|
|
17
|
-
export interface SidebarSeparatorProps {
|
|
18
|
-
className?: string;
|
|
19
|
-
}
|
|
20
|
-
export declare const SidebarSeparator: {
|
|
21
|
-
({ className }: SidebarSeparatorProps): React.JSX.Element;
|
|
22
|
-
displayName: string;
|
|
23
|
-
};
|
|
24
|
-
export {};
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { jsxs as u, jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import n from "clsx";
|
|
3
|
-
import { useRef as g, useState as l, useEffect as w } from "react";
|
|
4
|
-
import { Dot as b } from "../Dot/Dot.js";
|
|
5
|
-
import { ChevronRightIcon as k } from "../../icons/src/ChevronRightIcon.js";
|
|
6
|
-
const j = ({
|
|
7
|
-
isActive: t = !1,
|
|
8
|
-
icon: i,
|
|
9
|
-
isSubMenuItem: r,
|
|
10
|
-
align: h,
|
|
11
|
-
children: d,
|
|
12
|
-
classNames: s,
|
|
13
|
-
...p
|
|
14
|
-
}) => {
|
|
15
|
-
const e = g(null), [a, m] = l(!0), [x, y] = l(!0);
|
|
16
|
-
return w(() => {
|
|
17
|
-
const c = () => {
|
|
18
|
-
e.current && (m(e.current.offsetWidth >= 140), y(e.current.offsetWidth >= 140 || e.current.offsetWidth < 100));
|
|
19
|
-
};
|
|
20
|
-
c();
|
|
21
|
-
const f = new ResizeObserver(c);
|
|
22
|
-
return e.current && f.observe(e.current), () => {
|
|
23
|
-
f.disconnect();
|
|
24
|
-
};
|
|
25
|
-
}, []), /* @__PURE__ */ u(
|
|
26
|
-
"button",
|
|
27
|
-
{
|
|
28
|
-
ref: e,
|
|
29
|
-
type: "button",
|
|
30
|
-
className: n(
|
|
31
|
-
"ui-sidebar-link",
|
|
32
|
-
"flex w-full items-center rounded leading-none transition-colors xl:justify-start",
|
|
33
|
-
!r && "h-11",
|
|
34
|
-
{
|
|
35
|
-
"bg-primary text-white hover:bg-primary-dark": t,
|
|
36
|
-
"text-gray hover:bg-gray-darker": !t,
|
|
37
|
-
"justify-start px-6 py-2": r,
|
|
38
|
-
"justify-center px-6 py-3": !r
|
|
39
|
-
}
|
|
40
|
-
),
|
|
41
|
-
...p,
|
|
42
|
-
children: [
|
|
43
|
-
r ? /* @__PURE__ */ o(b, { className: n("mr-3 shrink-0", { "bg-white": t, "bg-gray": !t }) }) : x && i && /* @__PURE__ */ o("div", { className: n(!a && "flex w-full justify-center"), children: /* @__PURE__ */ o(i, { className: n("h-5 w-5 shrink-0", a && "mr-3") }) }),
|
|
44
|
-
(a ?? r) && /* @__PURE__ */ o("span", { className: n("px-1", { "text-left": r ?? h === "left" }, s == null ? void 0 : s.text), children: d }),
|
|
45
|
-
!r && a && /* @__PURE__ */ o(k, { className: "ml-auto h-3 w-3" })
|
|
46
|
-
]
|
|
47
|
-
}
|
|
48
|
-
);
|
|
49
|
-
};
|
|
50
|
-
j.displayName = "Sidebar.Link";
|
|
51
|
-
const N = ({ className: t }) => /* @__PURE__ */ o("hr", { className: n("mx-3 my-4 border-gray-lighter/20", t) });
|
|
52
|
-
N.displayName = "Sidebar.Separator";
|
|
53
|
-
export {
|
|
54
|
-
j as SidebarLink,
|
|
55
|
-
N as SidebarSeparator
|
|
56
|
-
};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
|
-
export interface SidebarMenuProps {
|
|
3
|
-
[key: string]: any;
|
|
4
|
-
content: React.ReactNode;
|
|
5
|
-
children: React.ReactNode;
|
|
6
|
-
}
|
|
7
|
-
export declare const SidebarMenu: {
|
|
8
|
-
({ content, children, ...rest }: SidebarMenuProps): React.JSX.Element;
|
|
9
|
-
displayName: string;
|
|
10
|
-
};
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import n from "@tippyjs/react";
|
|
3
|
-
import t from "clsx";
|
|
4
|
-
import a from "./Sidebar.Menu.module.css.js";
|
|
5
|
-
const d = typeof window > "u" ? void 0 : window.document.body, m = ({ content: o, children: r, ...i }) => /* @__PURE__ */ e(
|
|
6
|
-
n,
|
|
7
|
-
{
|
|
8
|
-
interactive: !0,
|
|
9
|
-
trigger: "mouseenter",
|
|
10
|
-
hideOnClick: "toggle",
|
|
11
|
-
appendTo: d,
|
|
12
|
-
placement: "right",
|
|
13
|
-
offset: [0, 4],
|
|
14
|
-
arrow: !1,
|
|
15
|
-
className: t(
|
|
16
|
-
"ui-sidebar-menu",
|
|
17
|
-
a.main,
|
|
18
|
-
"!rounded-none bg-black bg-opacity-90 p-2 backdrop-blur-sm backdrop-filter"
|
|
19
|
-
),
|
|
20
|
-
content: o,
|
|
21
|
-
...i,
|
|
22
|
-
children: /* @__PURE__ */ e("span", { className: "block", children: r })
|
|
23
|
-
}
|
|
24
|
-
);
|
|
25
|
-
m.displayName = "Sidebar.Menu";
|
|
26
|
-
export {
|
|
27
|
-
m as SidebarMenu
|
|
28
|
-
};
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
|
-
interface NotificationDrawer {
|
|
3
|
-
count: number;
|
|
4
|
-
content: React.ReactNode;
|
|
5
|
-
title: string;
|
|
6
|
-
hide?: boolean;
|
|
7
|
-
onClose?: () => void;
|
|
8
|
-
}
|
|
9
|
-
export interface SidebarProps {
|
|
10
|
-
logo?: React.ReactElement;
|
|
11
|
-
footer: React.ReactElement;
|
|
12
|
-
notifications?: {
|
|
13
|
-
announcements?: NotificationDrawer;
|
|
14
|
-
notices?: NotificationDrawer;
|
|
15
|
-
};
|
|
16
|
-
isFixed?: boolean;
|
|
17
|
-
isStickyHeader?: boolean;
|
|
18
|
-
isStickyFooter?: boolean;
|
|
19
|
-
isLeftDrawerOpen?: boolean;
|
|
20
|
-
isRightDrawerOpen?: boolean;
|
|
21
|
-
children: React.ReactNode;
|
|
22
|
-
className?: string;
|
|
23
|
-
onLogoClick: () => void;
|
|
24
|
-
handleDrawerStateChange?: (drawer: "left" | "right") => void;
|
|
25
|
-
onSidebarResize?: (width: number) => void;
|
|
26
|
-
}
|
|
27
|
-
export declare const Sidebar: {
|
|
28
|
-
({ logo, footer, notifications, isFixed, isStickyHeader, isStickyFooter, isLeftDrawerOpen, isRightDrawerOpen, children, className, onLogoClick, handleDrawerStateChange, onSidebarResize, }: SidebarProps): React.JSX.Element;
|
|
29
|
-
Account: {
|
|
30
|
-
({ name, description, image, icon, isResponsive, className, ...rest }: import('./Sidebar.Account').SidebarAccountProps): React.JSX.Element;
|
|
31
|
-
displayName: string;
|
|
32
|
-
};
|
|
33
|
-
Button: {
|
|
34
|
-
({ icon: Icon, label, className, ...rest }: import('./Sidebar.Button').SidebarButtonProps): React.JSX.Element;
|
|
35
|
-
displayName: string;
|
|
36
|
-
};
|
|
37
|
-
Footer: {
|
|
38
|
-
({ children, ...rest }: import('./Sidebar.Footer').SidebarFooterProps): React.JSX.Element;
|
|
39
|
-
displayName: string;
|
|
40
|
-
};
|
|
41
|
-
Link: {
|
|
42
|
-
({ isActive, icon: Icon, isSubMenuItem, align, children, classNames, ...rest }: import('./Sidebar.Link').SidebarLinkProps): React.JSX.Element;
|
|
43
|
-
displayName: string;
|
|
44
|
-
};
|
|
45
|
-
Separator: {
|
|
46
|
-
({ className }: import('./Sidebar.Link').SidebarSeparatorProps): React.JSX.Element;
|
|
47
|
-
displayName: string;
|
|
48
|
-
};
|
|
49
|
-
Menu: {
|
|
50
|
-
({ content, children, ...rest }: import('./Sidebar.Menu').SidebarMenuProps): React.JSX.Element;
|
|
51
|
-
displayName: string;
|
|
52
|
-
};
|
|
53
|
-
Heading: {
|
|
54
|
-
({ icon: Icon, label, className }: import('./Sidebar.Heading').SidebarHeadingProps): React.JSX.Element;
|
|
55
|
-
displayName: string;
|
|
56
|
-
};
|
|
57
|
-
};
|
|
58
|
-
export {};
|