@xola/ui-kit 3.0.8 → 3.4.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.
Files changed (217) hide show
  1. package/README.md +61 -12
  2. package/build/components/Alert.d.ts +18 -0
  3. package/build/components/Alert.js +28 -0
  4. package/build/components/Animation/FadeIn.d.ts +13 -0
  5. package/build/components/Animation/FadeIn.js +29 -0
  6. package/build/components/Animation/SlideDown.d.ts +6 -0
  7. package/build/components/Animation/SlideDown.js +20 -0
  8. package/build/components/Avatar.d.ts +16 -0
  9. package/build/components/Avatar.js +21 -0
  10. package/build/components/Badge.d.ts +27 -0
  11. package/build/components/Badge.js +40 -0
  12. package/build/components/Breadcrumb.d.ts +21 -0
  13. package/build/components/Breadcrumb.js +27 -0
  14. package/build/components/Breakdown.d.ts +63 -0
  15. package/build/components/Breakdown.js +89 -0
  16. package/build/components/Buttons/Button.d.ts +53 -0
  17. package/build/components/Buttons/Button.js +83 -0
  18. package/build/components/Buttons/ButtonGroup.d.ts +35 -0
  19. package/build/components/Buttons/ButtonGroup.js +55 -0
  20. package/build/components/Buttons/SubmitButton.d.ts +11 -0
  21. package/build/components/Buttons/SubmitButton.js +83 -0
  22. package/build/components/Buttons/ToggleButton.d.ts +21 -0
  23. package/build/components/Buttons/ToggleButton.js +34 -0
  24. package/build/components/Charts/BaseChartOptions.d.ts +136 -0
  25. package/build/components/Charts/BaseChartOptions.js +95 -0
  26. package/build/components/Charts/HistogramOptions.d.ts +192 -0
  27. package/build/components/Charts/HistogramOptions.js +69 -0
  28. package/build/components/Charts/PieOptions.d.ts +177 -0
  29. package/build/components/Charts/PieOptions.js +55 -0
  30. package/build/components/Counter.d.ts +5 -0
  31. package/build/components/Counter.js +16 -0
  32. package/build/components/DatePicker/DatePicker.d.ts +41 -0
  33. package/build/components/DatePicker/DatePicker.helpers.d.ts +17 -0
  34. package/build/components/DatePicker/DatePicker.helpers.js +22 -0
  35. package/build/components/DatePicker/DatePicker.js +241 -0
  36. package/build/components/DatePicker/DatePickerPopover.d.ts +29 -0
  37. package/build/components/DatePicker/DatePickerPopover.js +81 -0
  38. package/build/components/DatePicker/Day.d.ts +13 -0
  39. package/build/components/DatePicker/Day.js +40 -0
  40. package/build/components/DatePicker/LocalizedDayPicker.d.ts +6 -0
  41. package/build/components/DatePicker/LocalizedDayPicker.js +20 -0
  42. package/build/components/DatePicker/MonthGrid.d.ts +11 -0
  43. package/build/components/DatePicker/MonthGrid.js +52 -0
  44. package/build/components/DatePicker/MonthPicker.d.ts +7 -0
  45. package/build/components/DatePicker/MonthPicker.js +28 -0
  46. package/build/components/DatePicker/MonthSelector.d.ts +8 -0
  47. package/build/components/DatePicker/MonthSelector.js +47 -0
  48. package/build/components/DatePicker/MonthYearSelector.d.ts +8 -0
  49. package/build/components/DatePicker/MonthYearSelector.js +44 -0
  50. package/build/components/DatePicker/NavbarElement.d.ts +15 -0
  51. package/build/components/DatePicker/NavbarElement.js +43 -0
  52. package/build/components/DatePicker/RangeDatePicker.d.ts +25 -0
  53. package/build/components/DatePicker/RangeDatePicker.js +134 -0
  54. package/build/components/DatePicker/RelativeDateRange.d.ts +51 -0
  55. package/build/components/DatePicker/RelativeDateRange.js +280 -0
  56. package/build/components/DatePicker/UpcomingDatePicker.d.ts +11 -0
  57. package/build/components/DatePicker/UpcomingDatePicker.js +27 -0
  58. package/build/components/Dot/Dot.d.ts +24 -0
  59. package/build/components/Dot/Dot.js +24 -0
  60. package/build/components/Dot/DotProgress.d.ts +6 -0
  61. package/build/components/Dot/DotProgress.js +10 -0
  62. package/build/components/Drawer.d.ts +28 -0
  63. package/build/components/Drawer.js +126 -0
  64. package/build/components/Forms/BaseInput.d.ts +20 -0
  65. package/build/components/Forms/BaseInput.js +41 -0
  66. package/build/components/Forms/Checkbox.d.ts +10 -0
  67. package/build/components/Forms/Checkbox.js +34 -0
  68. package/build/components/Forms/Checkbox.module.css.js +7 -0
  69. package/build/components/Forms/ComboBox.d.ts +8 -0
  70. package/build/components/Forms/ComboBox.js +41 -0
  71. package/build/components/Forms/FormGroup.d.ts +5 -0
  72. package/build/components/Forms/FormGroup.js +6 -0
  73. package/build/components/Forms/InlineValuePopover.d.ts +17 -0
  74. package/build/components/Forms/InlineValuePopover.js +47 -0
  75. package/build/components/Forms/Input.d.ts +6 -0
  76. package/build/components/Forms/Input.js +9 -0
  77. package/build/components/Forms/Label.d.ts +7 -0
  78. package/build/components/Forms/Label.js +17 -0
  79. package/build/components/Forms/RangeSlider.d.ts +33 -0
  80. package/build/components/Forms/RangeSlider.js +39 -0
  81. package/build/components/Forms/Select.d.ts +5 -0
  82. package/build/components/Forms/Select.js +8 -0
  83. package/build/components/Forms/Switch.d.ts +46 -0
  84. package/build/components/Forms/Switch.js +62 -0
  85. package/build/components/Forms/Textarea.d.ts +6 -0
  86. package/build/components/Forms/Textarea.js +35 -0
  87. package/build/components/Forms/ValuePopoverText.d.ts +6 -0
  88. package/build/components/Forms/ValuePopoverText.js +10 -0
  89. package/build/components/GooglePlacesAutocomplete.d.ts +14 -0
  90. package/build/components/HeaderToolbar.d.ts +21 -0
  91. package/build/components/HeaderToolbar.js +33 -0
  92. package/build/components/ImageUpload.d.ts +17 -0
  93. package/build/components/ImageUpload.js +86 -0
  94. package/build/components/Key.d.ts +6 -0
  95. package/build/components/Key.js +28 -0
  96. package/build/components/Logo.d.ts +19 -0
  97. package/build/components/Logo.js +10 -0
  98. package/build/components/Modal.d.ts +52 -0
  99. package/build/components/Modal.js +126 -0
  100. package/build/components/Popover/Popover.d.ts +20 -0
  101. package/build/components/Popover/Popover.js +50 -0
  102. package/build/components/Popover/Popover.module.css.js +7 -0
  103. package/build/components/Popover/PopoverList.d.ts +25 -0
  104. package/build/components/Popover/PopoverList.js +59 -0
  105. package/build/components/Popover/PopoverScroll.module.css.js +4 -0
  106. package/build/components/Provider.d.ts +18 -0
  107. package/build/components/Provider.js +17 -0
  108. package/build/components/Screens/Login.d.ts +25 -0
  109. package/build/components/Screens/Login.js +144 -0
  110. package/build/components/Search.d.ts +16 -0
  111. package/build/components/Search.js +174 -0
  112. package/build/components/Sidebar/Sidebar.Account.d.ts +13 -0
  113. package/build/components/Sidebar/Sidebar.Account.js +56 -0
  114. package/build/components/Sidebar/Sidebar.Button.d.ts +10 -0
  115. package/build/components/Sidebar/Sidebar.Button.js +21 -0
  116. package/build/components/Sidebar/Sidebar.Footer.d.ts +8 -0
  117. package/build/components/Sidebar/Sidebar.Footer.js +9 -0
  118. package/build/components/Sidebar/Sidebar.Heading.d.ts +10 -0
  119. package/build/components/Sidebar/Sidebar.Heading.js +10 -0
  120. package/build/components/Sidebar/Sidebar.Link.d.ts +24 -0
  121. package/build/components/Sidebar/Sidebar.Link.js +56 -0
  122. package/build/components/Sidebar/Sidebar.Menu.d.ts +10 -0
  123. package/build/components/Sidebar/Sidebar.Menu.js +28 -0
  124. package/build/components/Sidebar/Sidebar.Menu.module.css.js +7 -0
  125. package/build/components/Sidebar/Sidebar.d.ts +58 -0
  126. package/build/components/Sidebar/Sidebar.js +218 -0
  127. package/build/components/Sidebar/SidebarScroll.module.css.js +4 -0
  128. package/build/components/Sidebar/index.d.ts +8 -0
  129. package/build/components/Skeleton.d.ts +13 -0
  130. package/build/components/Skeleton.js +29 -0
  131. package/build/components/Skeleton.module.css.js +7 -0
  132. package/build/components/Spinner.d.ts +26 -0
  133. package/build/components/Spinner.js +27 -0
  134. package/build/components/Table.d.ts +59 -0
  135. package/build/components/Table.js +71 -0
  136. package/build/components/Tabs/Tabs.Panel.d.ts +9 -0
  137. package/build/components/Tabs/Tabs.Panel.js +7 -0
  138. package/build/components/Tabs/Tabs.Tab.d.ts +19 -0
  139. package/build/components/Tabs/Tabs.Tab.js +37 -0
  140. package/build/components/Tabs/Tabs.d.ts +27 -0
  141. package/build/components/Tabs/Tabs.js +28 -0
  142. package/build/components/Tabs/index.d.ts +4 -0
  143. package/build/components/Tag.d.ts +25 -0
  144. package/build/components/Tag.js +36 -0
  145. package/build/components/Tooltip.d.ts +8 -0
  146. package/build/components/Tooltip.js +8 -0
  147. package/build/components/Utilities/Currency.d.ts +32 -0
  148. package/build/components/Utilities/Currency.js +49 -0
  149. package/build/components/Utilities/Number.d.ts +8 -0
  150. package/build/components/Utilities/Number.js +15 -0
  151. package/build/components/Utilities/Phone.d.ts +8 -0
  152. package/build/components/Utilities/Phone.js +19 -0
  153. package/build/helpers/avatar.d.ts +1 -0
  154. package/build/helpers/avatar.js +8 -0
  155. package/build/helpers/browser.d.ts +2 -0
  156. package/build/helpers/browser.js +9 -0
  157. package/build/helpers/children.d.ts +3 -0
  158. package/build/helpers/children.js +6 -0
  159. package/build/helpers/classnames.d.ts +5 -0
  160. package/build/helpers/currency.d.ts +2 -0
  161. package/build/helpers/currency.js +11 -0
  162. package/build/helpers/date.d.ts +12 -0
  163. package/build/helpers/date.js +44 -0
  164. package/build/helpers/flash.d.ts +21 -0
  165. package/build/helpers/flash.js +87 -0
  166. package/build/helpers/numbers.d.ts +4 -0
  167. package/build/helpers/numbers.js +23 -0
  168. package/build/helpers/phone.d.ts +11 -0
  169. package/build/helpers/phone.js +25 -0
  170. package/build/hooks/useId.d.ts +1 -0
  171. package/build/hooks/useId.js +9 -0
  172. package/build/hooks/useIsClient.d.ts +1 -0
  173. package/build/hooks/useIsClient.js +10 -0
  174. package/build/hooks/useViewportHeight.d.ts +1 -0
  175. package/build/hooks/useViewportHeight.js +15 -0
  176. package/build/icons/build/AnnounceIcon.js +6 -0
  177. package/build/icons/build/BellIcon.js +23 -0
  178. package/build/icons/build/CalendarIcon.js +15 -0
  179. package/build/icons/build/CheckIcon.js +7 -0
  180. package/build/icons/build/ChevronDownIcon.js +7 -0
  181. package/build/icons/build/ChevronLeftIcon.js +7 -0
  182. package/build/icons/build/ChevronRightIcon.js +7 -0
  183. package/build/icons/build/CircleNotch.js +5 -0
  184. package/build/icons/build/CloseIcon.js +7 -0
  185. package/build/icons/build/DownArrowIcon.js +15 -0
  186. package/build/icons/build/ImageIcon.js +23 -0
  187. package/build/icons/build/SearchIcon.js +15 -0
  188. package/build/icons/build/TrashIcon.js +16 -0
  189. package/build/icons/build/WarningDiamondIcon.js +23 -0
  190. package/build/icons/build/helpers/classnames.js +8 -0
  191. package/build/icons/build/helpers/icon.js +10 -0
  192. package/build/icons/build/helpers/iconSizes.js +13 -0
  193. package/build/icons/build/images/XolaLogoSimple.js +13 -0
  194. package/build/index.d.ts +66 -0
  195. package/build/index.js +142 -0
  196. package/build/theme.d.ts +413 -0
  197. package/build/theme.js +372 -0
  198. package/build/types/index.d.ts +22 -0
  199. package/build/types/migration.d.ts +2 -0
  200. package/build/ui-kit.css +1 -0
  201. package/build/utils/avatar.d.ts +1 -0
  202. package/build/utils/avatar.js +8 -0
  203. package/build/utils/currency.d.ts +2 -0
  204. package/build/utils/currency.js +11 -0
  205. package/build/utils/date.d.ts +12 -0
  206. package/build/utils/date.js +23 -0
  207. package/build/utils/index.d.ts +5 -0
  208. package/build/utils/numbers.d.ts +4 -0
  209. package/build/utils/numbers.js +19 -0
  210. package/build/utils/phone.d.ts +2 -0
  211. package/build/utils/phone.js +17 -0
  212. package/package.json +76 -49
  213. package/postcss.config.js +1 -1
  214. package/tailwind.config.js +28 -8
  215. package/build/style.css +0 -1
  216. package/build/ui-kit.es.js +0 -12173
  217. package/index.d.ts +0 -72
@@ -0,0 +1,25 @@
1
+ import { default as React } from 'react';
2
+ declare const backgrounds: {
3
+ readonly default: "https://files.xola.com/x2/images/login/old-photo-1554629947-334ff61d85dc.jpeg";
4
+ readonly x2: "https://files.xola.com/x2/images/login/x2-34fc260271ca80160c61777846784611.jpeg";
5
+ readonly admin: "https://files.xola.com/x2/images/login/admin-42e40b1836193f064f0fe0fafce1d2af.png";
6
+ readonly scaffold: "https://files.xola.com/x2/images/login/scaffold-f3bd19169b6976f1c75da53e7b61d0a7.jpeg";
7
+ };
8
+ type BackgroundType = keyof typeof backgrounds;
9
+ export interface LoginValues {
10
+ email: string;
11
+ password: string;
12
+ shouldRemember: boolean;
13
+ }
14
+ export interface LoginProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "onSubmit"> {
15
+ defaultValues?: Partial<LoginValues>;
16
+ isLoading?: boolean;
17
+ error?: string | null;
18
+ onSubmit?: (values: LoginValues) => void;
19
+ passwordResetUrl?: string;
20
+ label?: React.ReactNode;
21
+ backgroundImage?: string | null;
22
+ backgroundType?: BackgroundType;
23
+ }
24
+ export declare const Login: ({ defaultValues, isLoading, error, onSubmit, passwordResetUrl, label, backgroundImage, backgroundType, ...rest }: LoginProps) => React.JSX.Element;
25
+ export {};
@@ -0,0 +1,144 @@
1
+ import { jsxs as a, jsx as e } from "react/jsx-runtime";
2
+ import { useState as C } from "react";
3
+ import { XolaLogoSimple as j } from "../../icons/build/images/XolaLogoSimple.js";
4
+ import { Alert as I } from "../Alert.js";
5
+ import { Button as R } from "../Buttons/Button.js";
6
+ import { Checkbox as F } from "../Forms/Checkbox.js";
7
+ import { FormGroup as u } from "../Forms/FormGroup.js";
8
+ import { Input as f } from "../Forms/Input.js";
9
+ import { Label as p } from "../Forms/Label.js";
10
+ import { Spinner as B } from "../Spinner.js";
11
+ const g = {
12
+ default: "https://files.xola.com/x2/images/login/old-photo-1554629947-334ff61d85dc.jpeg",
13
+ x2: "https://files.xola.com/x2/images/login/x2-34fc260271ca80160c61777846784611.jpeg",
14
+ admin: "https://files.xola.com/x2/images/login/admin-42e40b1836193f064f0fe0fafce1d2af.png",
15
+ scaffold: "https://files.xola.com/x2/images/login/scaffold-f3bd19169b6976f1c75da53e7b61d0a7.jpeg"
16
+ }, G = ({
17
+ defaultValues: h,
18
+ isLoading: c = !1,
19
+ error: t = null,
20
+ onSubmit: o,
21
+ passwordResetUrl: x,
22
+ label: m,
23
+ backgroundImage: b = null,
24
+ backgroundType: y = "default",
25
+ ...w
26
+ }) => {
27
+ const [r, d] = C({
28
+ email: "",
29
+ password: "",
30
+ shouldRemember: !1,
31
+ ...h
32
+ }), i = (l) => {
33
+ const { name: n, value: s } = l.target;
34
+ d({ ...r, [n]: s });
35
+ }, v = (l) => {
36
+ const { name: n, checked: s } = l.target;
37
+ d({ ...r, [n]: s });
38
+ }, k = (l) => {
39
+ l.preventDefault(), o == null || o(r);
40
+ }, N = {
41
+ backgroundImage: `url("${b ?? g[y] ?? g.default}")`,
42
+ backgroundRepeat: "no-repeat",
43
+ backgroundPosition: "center",
44
+ backgroundSize: "cover"
45
+ };
46
+ return /* @__PURE__ */ a(
47
+ "div",
48
+ {
49
+ className: "ui-login h-screen overflow-hidden bg-white bg-opacity-100 bg-blend-overlay md:bg-opacity-0",
50
+ style: N,
51
+ ...w,
52
+ children: [
53
+ /* @__PURE__ */ e("div", { className: "md:full flex h-[88%] w-full flex-col items-center justify-center space-y-8", children: /* @__PURE__ */ a("div", { className: "w-85 rounded-lg px-9 py-0 md:bg-white md:py-10", children: [
54
+ /* @__PURE__ */ a("div", { className: "mb-12 space-y-4 md:mb-20", children: [
55
+ /* @__PURE__ */ e(j, { className: "mx-auto h-10 w-auto md:h-12" }),
56
+ m && /* @__PURE__ */ e("div", { className: "flex items-center justify-center", children: m })
57
+ ] }),
58
+ /* @__PURE__ */ e("form", { onSubmit: k, children: /* @__PURE__ */ a("fieldset", { className: "space-y-6", disabled: c, children: [
59
+ /* @__PURE__ */ a("div", { className: "-space-y-px rounded-md bg-white", children: [
60
+ /* @__PURE__ */ a(u, { className: "md:mb-7", children: [
61
+ /* @__PURE__ */ e(p, { children: "Email" }),
62
+ /* @__PURE__ */ e(
63
+ f,
64
+ {
65
+ required: !0,
66
+ name: "email",
67
+ type: "email",
68
+ autoComplete: "email",
69
+ value: r.email,
70
+ isError: !!t,
71
+ onChange: i
72
+ }
73
+ )
74
+ ] }),
75
+ /* @__PURE__ */ a(u, { children: [
76
+ /* @__PURE__ */ e(p, { children: "Password" }),
77
+ /* @__PURE__ */ e(
78
+ f,
79
+ {
80
+ required: !0,
81
+ name: "password",
82
+ type: "password",
83
+ autoComplete: "current-password",
84
+ value: r.password,
85
+ isError: !!t,
86
+ onChange: i
87
+ }
88
+ )
89
+ ] })
90
+ ] }),
91
+ /* @__PURE__ */ e(
92
+ F,
93
+ {
94
+ name: "shouldRemember",
95
+ label: "Remember me",
96
+ checked: r.shouldRemember,
97
+ onChange: v
98
+ }
99
+ ),
100
+ t ? /* @__PURE__ */ e(I, { color: "danger", children: t }) : null,
101
+ /* @__PURE__ */ a(R, { type: "submit", className: "w-full", color: "primary", children: [
102
+ c ? /* @__PURE__ */ e(B, { size: "current", color: "current", className: "mr-2" }) : null,
103
+ "Login"
104
+ ] }),
105
+ /* @__PURE__ */ e("div", { className: "mt-5 text-center text-sm", children: /* @__PURE__ */ e(
106
+ "a",
107
+ {
108
+ href: x,
109
+ className: "font-semibold text-gray-darker underline hover:text-black",
110
+ target: "_blank",
111
+ rel: "noreferrer",
112
+ children: "Forgot your password?"
113
+ }
114
+ ) })
115
+ ] }) })
116
+ ] }) }),
117
+ /* @__PURE__ */ e("footer", { children: /* @__PURE__ */ e("div", { className: "flex w-full flex-col items-center justify-center overflow-hidden px-4 py-1 sm:px-6 lg:px-8", children: /* @__PURE__ */ a("div", { className: "m-5 w-85 rounded-lg px-4 text-center text-xs opacity-80 md:text-sm", children: [
118
+ /* @__PURE__ */ a(
119
+ "a",
120
+ {
121
+ href: "https://www.xola.com/team",
122
+ target: "_blank",
123
+ className: "text-gray md:text-gray-dark",
124
+ rel: "noreferrer",
125
+ children: [
126
+ "Designed in San Francisco & Rouen, France",
127
+ /* @__PURE__ */ e("br", {}),
128
+ "Built in Houston, Belgrade, Ukraine & Bengaluru"
129
+ ]
130
+ }
131
+ ),
132
+ /* @__PURE__ */ a("div", { className: "text-center text-gray md:text-gray-dark", children: [
133
+ "© ",
134
+ (/* @__PURE__ */ new Date()).getFullYear(),
135
+ " Xola, Inc."
136
+ ] })
137
+ ] }) }) })
138
+ ]
139
+ }
140
+ );
141
+ };
142
+ export {
143
+ G as Login
144
+ };
@@ -0,0 +1,16 @@
1
+ import { default as React } from 'react';
2
+ export interface SearchProps<T = any> extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "onChange" | "onSelect" | "onSubmit" | "children"> {
3
+ className?: string;
4
+ items?: T[];
5
+ defaultValue?: string;
6
+ onChange?: (value: string) => void;
7
+ onSubmit?: (value: string) => void;
8
+ onSelect?: (item: T) => void;
9
+ children?: (item: T, isHighlighted: boolean) => React.ReactNode;
10
+ isLoading?: boolean;
11
+ shouldStayOpen?: boolean;
12
+ shouldDestroyOnClose?: boolean;
13
+ shouldHideMenu?: boolean;
14
+ minChars?: number;
15
+ }
16
+ export declare const Search: <T = any>({ className, items, defaultValue, onChange, onSubmit, onSelect, children, isLoading, shouldStayOpen, shouldDestroyOnClose, shouldHideMenu, minChars, ...rest }: SearchProps<T>) => React.JSX.Element;
@@ -0,0 +1,174 @@
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 le from "lodash-es/debounce";
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 { SearchIcon as ce } from "../icons/build/SearchIcon.js";
11
+ import { Key as n } from "./Key.js";
12
+ import { Spinner as oe } from "./Spinner.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(ce, { 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(oe, { 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
+ };
@@ -0,0 +1,13 @@
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
+ };
@@ -0,0 +1,56 @@
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 { ChevronRightIcon as g } from "../../icons/build/ChevronRightIcon.js";
5
+ import { Avatar as S } from "../Avatar.js";
6
+ const j = ({
7
+ name: n,
8
+ description: o,
9
+ image: h,
10
+ icon: x = /* @__PURE__ */ e(g, {}),
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(S, { 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
+ };
@@ -0,0 +1,10 @@
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
+ };
@@ -0,0 +1,21 @@
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
+ };
@@ -0,0 +1,8 @@
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
+ };
@@ -0,0 +1,9 @@
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
+ };
@@ -0,0 +1,10 @@
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
+ };
@@ -0,0 +1,10 @@
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
+ };
@@ -0,0 +1,24 @@
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 {};
@@ -0,0 +1,56 @@
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 { ChevronRightIcon as b } from "../../icons/build/ChevronRightIcon.js";
5
+ import { Dot as k } from "../Dot/Dot.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 > 174 || e.current.offsetWidth < 140));
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-10",
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(k, { 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(b, { 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
+ };
@@ -0,0 +1,10 @@
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
+ };
@@ -0,0 +1,28 @@
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
+ };
@@ -0,0 +1,7 @@
1
+ const a = "_main_1bcuo_1", n = {
2
+ main: a
3
+ };
4
+ export {
5
+ n as default,
6
+ a as main
7
+ };