@xola/ui-kit 3.5.0 → 3.7.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 (215) hide show
  1. package/README.md +136 -87
  2. package/build/components/Alert.js +18 -13
  3. package/build/components/Animation/FadeIn.js +36 -25
  4. package/build/components/Animation/SlideDown.js +14 -9
  5. package/build/components/Avatar.js +17 -10
  6. package/build/components/Badge.js +33 -24
  7. package/build/components/BottomSheet.js +114 -0
  8. package/build/components/Breadcrumb.js +27 -21
  9. package/build/components/Breakdown.js +66 -74
  10. package/build/components/Buttons/Button.js +53 -47
  11. package/build/components/Buttons/ButtonGroup.js +42 -39
  12. package/build/components/Buttons/SecondaryButton.js +31 -0
  13. package/build/components/Buttons/SubmitButton.js +72 -66
  14. package/build/components/Buttons/ToggleButton.js +15 -16
  15. package/build/components/Counter.js +10 -6
  16. package/build/components/DatePicker/DatePicker.helpers.js +24 -13
  17. package/build/components/DatePicker/DatePicker.js +196 -223
  18. package/build/components/DatePicker/DatePickerPopover.js +75 -66
  19. package/build/components/DatePicker/Day.js +35 -32
  20. package/build/components/DatePicker/LocalizedDayPicker.js +15 -18
  21. package/build/components/DatePicker/MonthGrid.js +35 -48
  22. package/build/components/DatePicker/MonthPicker.js +25 -20
  23. package/build/components/DatePicker/MonthSelector.js +39 -40
  24. package/build/components/DatePicker/MonthYearSelector.js +18 -39
  25. package/build/components/DatePicker/NavbarElement.js +26 -35
  26. package/build/components/DatePicker/RangeDatePicker.js +104 -123
  27. package/build/components/DatePicker/RelativeDateRange.js +153 -143
  28. package/build/components/DatePicker/UpcomingDatePicker.js +29 -25
  29. package/build/components/Dot/Dot.js +13 -8
  30. package/build/components/Dot/DotProgress.js +12 -7
  31. package/build/components/Drawer.js +109 -101
  32. package/build/components/Forms/BaseInput.js +50 -34
  33. package/build/components/Forms/Checkbox.js +33 -30
  34. package/build/components/Forms/ComboBox.js +35 -35
  35. package/build/components/Forms/FormGroup.js +7 -3
  36. package/build/components/Forms/InlineValuePopover.js +33 -39
  37. package/build/components/Forms/Input.js +15 -7
  38. package/build/components/Forms/Label.js +14 -8
  39. package/build/components/Forms/RangeSlider.js +41 -22
  40. package/build/components/Forms/Select.js +5 -6
  41. package/build/components/Forms/Switch.js +46 -38
  42. package/build/components/Forms/Textarea.js +37 -30
  43. package/build/components/Forms/ValuePopoverText.js +5 -8
  44. package/build/components/GooglePlacesAutocomplete.js +112 -0
  45. package/build/components/HeaderToolbar.js +30 -22
  46. package/build/components/ImageUpload.js +76 -79
  47. package/build/components/Key.js +21 -16
  48. package/build/components/Logo.js +12 -5
  49. package/build/components/Modal.js +87 -72
  50. package/build/components/Popover/Popover.js +40 -31
  51. package/build/components/Popover/PopoverList.js +43 -36
  52. package/build/components/Provider.js +7 -8
  53. package/build/components/Screens/Login.js +97 -126
  54. package/build/components/Search.js +114 -144
  55. package/build/components/Sidebar/Sidebar.Account.js +39 -46
  56. package/build/components/Sidebar/Sidebar.Button.js +45 -19
  57. package/build/components/Sidebar/Sidebar.Footer.js +8 -7
  58. package/build/components/Sidebar/Sidebar.Heading.js +11 -8
  59. package/build/components/Sidebar/Sidebar.Link.js +79 -44
  60. package/build/components/Sidebar/Sidebar.Menu.js +52 -28
  61. package/build/components/Sidebar/Sidebar.Notifications.js +107 -0
  62. package/build/components/Sidebar/Sidebar.js +207 -214
  63. package/build/components/Sidebar/SidebarContext.js +15 -0
  64. package/build/components/Sidebar/sidebarWidth.js +41 -0
  65. package/build/components/Sidebar/useSidebarWidthState.js +115 -0
  66. package/build/components/Skeleton.js +19 -20
  67. package/build/components/Spinner.js +18 -10
  68. package/build/components/Table.js +86 -50
  69. package/build/components/Tabs/Tabs.Panel.js +9 -5
  70. package/build/components/Tabs/Tabs.Tab.js +28 -23
  71. package/build/components/Tabs/Tabs.js +23 -23
  72. package/build/components/Tag.js +28 -23
  73. package/build/components/Tooltip.js +19 -5
  74. package/build/components/Utilities/Currency.js +49 -42
  75. package/build/components/Utilities/Number.js +14 -12
  76. package/build/components/Utilities/Phone.js +18 -12
  77. package/build/helpers/environment.js +10 -0
  78. package/build/helpers/flash.js +45 -46
  79. package/build/hooks/useIsMobile.js +8 -0
  80. package/build/hooks/useViewportHeight.js +6 -12
  81. package/build/icons/src/AnnounceIcon.js +3 -4
  82. package/build/icons/src/BellIcon.js +0 -1
  83. package/build/icons/src/CalendarIcon.js +0 -1
  84. package/build/icons/src/CheckIcon.js +0 -1
  85. package/build/icons/src/ChevronDownIcon.js +4 -5
  86. package/build/icons/src/ChevronLeftIcon.js +0 -1
  87. package/build/icons/src/ChevronRightIcon.js +0 -1
  88. package/build/icons/src/CircleNotch.js +0 -1
  89. package/build/icons/src/CloseIcon.js +11 -9
  90. package/build/icons/src/DownArrowIcon.js +0 -1
  91. package/build/icons/src/ImageIcon.js +0 -1
  92. package/build/icons/src/SearchIcon.js +4 -5
  93. package/build/icons/src/TrashIcon.js +0 -1
  94. package/build/icons/src/WarningDiamondIcon.js +0 -1
  95. package/build/icons/src/helpers/icon.js +5 -9
  96. package/build/icons/src/images/XolaLogoSimple.js +2 -3
  97. package/build/index.js +143 -130
  98. package/build/style.css +1 -0
  99. package/build/theme.css +76 -0
  100. package/build/theme.js +2 -0
  101. package/build/utils/currency.js +5 -5
  102. package/build/{helpers → utils}/date.js +17 -20
  103. package/build/utils/numbers.js +12 -12
  104. package/build/utils/phone.js +12 -14
  105. package/build/utils/userLocale.js +6 -0
  106. package/index.css +96 -4
  107. package/index.d.ts +204 -0
  108. package/package.json +87 -77
  109. package/skills/README.md +27 -0
  110. package/skills/migrate-2.6-to-3.7/SKILL.md +110 -0
  111. package/tailwind.config.js +5 -2
  112. package/build/base.css +0 -2
  113. package/build/components/Alert.d.ts +0 -18
  114. package/build/components/Animation/FadeIn.d.ts +0 -13
  115. package/build/components/Animation/SlideDown.d.ts +0 -6
  116. package/build/components/Avatar.d.ts +0 -16
  117. package/build/components/Badge.d.ts +0 -28
  118. package/build/components/Breadcrumb.d.ts +0 -21
  119. package/build/components/Breakdown.d.ts +0 -63
  120. package/build/components/Buttons/Button.d.ts +0 -53
  121. package/build/components/Buttons/ButtonGroup.d.ts +0 -35
  122. package/build/components/Buttons/SubmitButton.d.ts +0 -11
  123. package/build/components/Buttons/ToggleButton.d.ts +0 -21
  124. package/build/components/Charts/BaseChartOptions.d.ts +0 -136
  125. package/build/components/Charts/HistogramOptions.d.ts +0 -192
  126. package/build/components/Charts/PieOptions.d.ts +0 -177
  127. package/build/components/Counter.d.ts +0 -5
  128. package/build/components/DatePicker/DatePicker.d.ts +0 -41
  129. package/build/components/DatePicker/DatePicker.helpers.d.ts +0 -17
  130. package/build/components/DatePicker/DatePickerPopover.d.ts +0 -29
  131. package/build/components/DatePicker/Day.d.ts +0 -13
  132. package/build/components/DatePicker/LocalizedDayPicker.d.ts +0 -6
  133. package/build/components/DatePicker/MonthGrid.d.ts +0 -11
  134. package/build/components/DatePicker/MonthPicker.d.ts +0 -7
  135. package/build/components/DatePicker/MonthSelector.d.ts +0 -8
  136. package/build/components/DatePicker/MonthYearSelector.d.ts +0 -8
  137. package/build/components/DatePicker/NavbarElement.d.ts +0 -15
  138. package/build/components/DatePicker/RangeDatePicker.d.ts +0 -25
  139. package/build/components/DatePicker/RelativeDateRange.d.ts +0 -51
  140. package/build/components/DatePicker/UpcomingDatePicker.d.ts +0 -11
  141. package/build/components/Dot/Dot.d.ts +0 -24
  142. package/build/components/Dot/DotProgress.d.ts +0 -6
  143. package/build/components/Drawer.d.ts +0 -28
  144. package/build/components/Forms/BaseInput.d.ts +0 -20
  145. package/build/components/Forms/Checkbox.d.ts +0 -10
  146. package/build/components/Forms/ComboBox.d.ts +0 -8
  147. package/build/components/Forms/FormGroup.d.ts +0 -5
  148. package/build/components/Forms/InlineValuePopover.d.ts +0 -17
  149. package/build/components/Forms/Input.d.ts +0 -6
  150. package/build/components/Forms/Label.d.ts +0 -7
  151. package/build/components/Forms/RangeSlider.d.ts +0 -33
  152. package/build/components/Forms/Select.d.ts +0 -5
  153. package/build/components/Forms/Switch.d.ts +0 -46
  154. package/build/components/Forms/Textarea.d.ts +0 -6
  155. package/build/components/Forms/ValuePopoverText.d.ts +0 -6
  156. package/build/components/GooglePlacesAutocomplete.d.ts +0 -14
  157. package/build/components/HeaderToolbar.d.ts +0 -21
  158. package/build/components/ImageUpload.d.ts +0 -17
  159. package/build/components/Key.d.ts +0 -6
  160. package/build/components/Logo.d.ts +0 -19
  161. package/build/components/Modal.d.ts +0 -52
  162. package/build/components/Popover/Popover.d.ts +0 -20
  163. package/build/components/Popover/PopoverList.d.ts +0 -25
  164. package/build/components/Provider.d.ts +0 -18
  165. package/build/components/Screens/Login.d.ts +0 -25
  166. package/build/components/Search.d.ts +0 -16
  167. package/build/components/Sidebar/Sidebar.Account.d.ts +0 -13
  168. package/build/components/Sidebar/Sidebar.Button.d.ts +0 -10
  169. package/build/components/Sidebar/Sidebar.Footer.d.ts +0 -8
  170. package/build/components/Sidebar/Sidebar.Heading.d.ts +0 -10
  171. package/build/components/Sidebar/Sidebar.Link.d.ts +0 -24
  172. package/build/components/Sidebar/Sidebar.Menu.d.ts +0 -13
  173. package/build/components/Sidebar/Sidebar.d.ts +0 -58
  174. package/build/components/Sidebar/index.d.ts +0 -8
  175. package/build/components/Skeleton.d.ts +0 -13
  176. package/build/components/Spinner.d.ts +0 -26
  177. package/build/components/Table.d.ts +0 -59
  178. package/build/components/Tabs/Tabs.Panel.d.ts +0 -9
  179. package/build/components/Tabs/Tabs.Tab.d.ts +0 -19
  180. package/build/components/Tabs/Tabs.d.ts +0 -27
  181. package/build/components/Tabs/index.d.ts +0 -4
  182. package/build/components/Tag.d.ts +0 -25
  183. package/build/components/Tooltip.d.ts +0 -8
  184. package/build/components/Utilities/Currency.d.ts +0 -32
  185. package/build/components/Utilities/Number.d.ts +0 -8
  186. package/build/components/Utilities/Phone.d.ts +0 -8
  187. package/build/full.css +0 -2
  188. package/build/helpers/avatar.d.ts +0 -1
  189. package/build/helpers/avatar.js +0 -8
  190. package/build/helpers/browser.d.ts +0 -2
  191. package/build/helpers/children.d.ts +0 -3
  192. package/build/helpers/classnames.d.ts +0 -5
  193. package/build/helpers/currency.d.ts +0 -2
  194. package/build/helpers/currency.js +0 -11
  195. package/build/helpers/date.d.ts +0 -12
  196. package/build/helpers/flash.d.ts +0 -21
  197. package/build/helpers/numbers.d.ts +0 -4
  198. package/build/helpers/numbers.js +0 -23
  199. package/build/helpers/phone.d.ts +0 -11
  200. package/build/helpers/phone.js +0 -25
  201. package/build/hooks/useId.d.ts +0 -1
  202. package/build/hooks/useId.js +0 -9
  203. package/build/hooks/useIsClient.d.ts +0 -1
  204. package/build/hooks/useViewportHeight.d.ts +0 -1
  205. package/build/icons/src/helpers/classnames.js +0 -8
  206. package/build/index.d.ts +0 -66
  207. package/build/theme.d.ts +0 -413
  208. package/build/types/index.d.ts +0 -22
  209. package/build/types/migration.d.ts +0 -2
  210. package/build/ui-kit.css +0 -1
  211. package/build/utils/avatar.d.ts +0 -1
  212. package/build/utils/currency.d.ts +0 -2
  213. package/build/utils/index.d.ts +0 -4
  214. package/build/utils/numbers.d.ts +0 -4
  215. package/build/utils/phone.d.ts +0 -2
@@ -1,144 +1,115 @@
1
- import { jsxs as a, jsx as e } from "react/jsx-runtime";
2
- import { useState as C } from "react";
3
- import { Alert as j } from "../Alert.js";
4
- import { Button as I } from "../Buttons/Button.js";
5
- import { Checkbox as R } from "../Forms/Checkbox.js";
6
- import { FormGroup as u } from "../Forms/FormGroup.js";
7
- import { Input as f } from "../Forms/Input.js";
1
+ import t from "prop-types";
2
+ import e, { useState as N } from "react";
3
+ import { Alert as C } from "../Alert.js";
4
+ import { Button as R } from "../Buttons/Button.js";
5
+ import { Checkbox as S } from "../Forms/Checkbox.js";
6
+ import { FormGroup as d } from "../Forms/FormGroup.js";
7
+ import { Input as u } from "../Forms/Input.js";
8
8
  import { Label as p } from "../Forms/Label.js";
9
- import { Spinner as F } from "../Spinner.js";
10
- import { XolaLogoSimple as B } from "../../icons/src/images/XolaLogoSimple.js";
11
- const g = {
9
+ import { Spinner as j } from "../Spinner.js";
10
+ import { XolaLogoSimple as I } from "../../icons/src/images/XolaLogoSimple.js";
11
+ const f = {
12
12
  default: "https://files.xola.com/x2/images/login/old-photo-1554629947-334ff61d85dc.jpeg",
13
13
  x2: "https://files.xola.com/x2/images/login/x2-34fc260271ca80160c61777846784611.jpeg",
14
14
  admin: "https://files.xola.com/x2/images/login/admin-42e40b1836193f064f0fe0fafce1d2af.png",
15
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,
16
+ }, F = ({
17
+ defaultValues: g,
18
+ isLoading: n = !1,
19
+ error: l = null,
20
+ onSubmit: b,
21
21
  passwordResetUrl: x,
22
- label: m,
23
- backgroundImage: b = null,
24
- backgroundType: y = "default",
25
- ...w
22
+ label: s,
23
+ backgroundImage: h = null,
24
+ backgroundType: E = "default",
25
+ ...y
26
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}")`,
27
+ const [a, c] = N({ email: "", password: "", shouldRemember: !1, ...g }), i = (r) => {
28
+ const { name: m, value: o } = r.target;
29
+ c({ ...a, [m]: o });
30
+ }, w = (r) => {
31
+ const { name: m, checked: o } = r.target;
32
+ c({ ...a, [m]: o });
33
+ }, v = (r) => {
34
+ r.preventDefault(), b(a);
35
+ }, k = {
36
+ backgroundImage: `url("${h ?? f[E] ?? f.default}")`,
42
37
  backgroundRepeat: "no-repeat",
43
38
  backgroundPosition: "center",
44
39
  backgroundSize: "cover"
45
40
  };
46
- return /* @__PURE__ */ a(
41
+ return /* @__PURE__ */ e.createElement(
47
42
  "div",
48
43
  {
49
44
  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(B, { 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
- R,
93
- {
94
- name: "shouldRemember",
95
- label: "Remember me",
96
- checked: r.shouldRemember,
97
- onChange: v
98
- }
99
- ),
100
- t ? /* @__PURE__ */ e(j, { color: "danger", children: t }) : null,
101
- /* @__PURE__ */ a(I, { type: "submit", className: "w-full", color: "primary", children: [
102
- c ? /* @__PURE__ */ e(F, { 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
- }
45
+ style: k,
46
+ ...y
47
+ },
48
+ /* @__PURE__ */ e.createElement("div", { className: "md:full flex h-[88%] w-full flex-col items-center justify-center space-y-8" }, /* @__PURE__ */ e.createElement("div", { className: "w-85 rounded-lg px-9 py-0 md:bg-white md:py-10" }, /* @__PURE__ */ e.createElement("div", { className: "mb-12 space-y-4 md:mb-20" }, /* @__PURE__ */ e.createElement(I, { className: "mx-auto h-10 w-auto md:h-12" }), s && /* @__PURE__ */ e.createElement("div", { className: "flex items-center justify-center" }, s)), /* @__PURE__ */ e.createElement("form", { onSubmit: v }, /* @__PURE__ */ e.createElement("fieldset", { className: "space-y-6", disabled: n }, /* @__PURE__ */ e.createElement("div", { className: "-space-y-px rounded-md bg-white" }, /* @__PURE__ */ e.createElement(d, { className: "md:mb-7" }, /* @__PURE__ */ e.createElement(p, null, "Email"), /* @__PURE__ */ e.createElement(
49
+ u,
50
+ {
51
+ required: !0,
52
+ name: "email",
53
+ type: "email",
54
+ autoComplete: "email",
55
+ value: a.email,
56
+ isError: !!l,
57
+ onChange: i
58
+ }
59
+ )), /* @__PURE__ */ e.createElement(d, null, /* @__PURE__ */ e.createElement(p, null, "Password"), /* @__PURE__ */ e.createElement(
60
+ u,
61
+ {
62
+ required: !0,
63
+ name: "password",
64
+ type: "password",
65
+ autoComplete: "current-password",
66
+ value: a.password,
67
+ isError: !!l,
68
+ onChange: i
69
+ }
70
+ ))), /* @__PURE__ */ e.createElement(
71
+ S,
72
+ {
73
+ name: "shouldRemember",
74
+ label: "Remember me",
75
+ checked: a.shouldRemember,
76
+ onChange: w
77
+ }
78
+ ), l ? /* @__PURE__ */ e.createElement(C, { color: "danger" }, l) : null, /* @__PURE__ */ e.createElement(R, { type: "submit", className: "w-full", color: "primary" }, n ? /* @__PURE__ */ e.createElement(j, { size: "current", color: "current", className: "mr-2" }) : null, "Login"), /* @__PURE__ */ e.createElement("div", { className: "mt-5 text-center text-sm" }, /* @__PURE__ */ e.createElement(
79
+ "a",
80
+ {
81
+ href: x,
82
+ className: "font-semibold text-gray-darker underline hover:text-black",
83
+ target: "_blank",
84
+ rel: "noreferrer"
85
+ },
86
+ "Forgot your password?"
87
+ )))))),
88
+ /* @__PURE__ */ e.createElement("footer", null, /* @__PURE__ */ e.createElement("div", { className: "flex w-full flex-col items-center justify-center overflow-hidden px-4 py-1 sm:px-6 lg:px-8" }, /* @__PURE__ */ e.createElement("div", { className: "m-5 w-85 rounded-lg px-4 text-center text-xs opacity-80 md:text-sm" }, /* @__PURE__ */ e.createElement(
89
+ "a",
90
+ {
91
+ href: "https://www.xola.com/team",
92
+ target: "_blank",
93
+ className: "text-gray md:text-gray-dark",
94
+ rel: "noreferrer"
95
+ },
96
+ "Designed in San Francisco & Rouen, France",
97
+ /* @__PURE__ */ e.createElement("br", null),
98
+ "Built in Houston, Belgrade, Ukraine & Bengaluru"
99
+ ), /* @__PURE__ */ e.createElement("div", { className: "text-center text-gray md:text-gray-dark" }, "© ", (/* @__PURE__ */ new Date()).getFullYear(), " Xola, Inc."))))
140
100
  );
141
101
  };
102
+ F.propTypes = {
103
+ defaultValues: t.shape({
104
+ email: t.string,
105
+ password: t.string,
106
+ shouldRemember: t.bool
107
+ }),
108
+ isLoading: t.bool,
109
+ error: t.string,
110
+ onSubmit: t.func,
111
+ passwordResetUrl: t.string
112
+ };
142
113
  export {
143
- G as Login
114
+ F as Login
144
115
  };
@@ -1,174 +1,144 @@
1
- import { jsxs as l, jsx as t, Fragment as re } from "react/jsx-runtime";
2
1
  import { useCombobox as I } from "downshift";
3
- import { debounce as le } from "lodash-es";
4
- import { useState as u, useRef as E, useEffect as K } from "react";
5
- import { useHotkeys as O } from "react-hotkeys-hook";
6
- import { isOSX as ae } from "../helpers/browser.js";
7
- import w from "../helpers/classnames.js";
8
- import { useId as R } from "../hooks/useId.js";
2
+ import { debounce as se } from "lodash-es";
3
+ import a from "prop-types";
4
+ import e, { useState as u, useRef as P, useId as F, useEffect as R } from "react";
5
+ import { useHotkeys as V } from "react-hotkeys-hook";
6
+ import { isOSX as re } from "../helpers/browser.js";
7
+ import C from "../helpers/classnames.js";
9
8
  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 = ({
9
+ import { Key as l } from "./Key.js";
10
+ import { Spinner as D } from "./Spinner.js";
11
+ import { SearchIcon as le } from "../icons/src/SearchIcon.js";
12
+ const ce = se((m, i) => m(i), 500), oe = ({
14
13
  className: m,
15
- items: h = [],
16
- defaultValue: D,
14
+ items: i = [],
15
+ defaultValue: H,
17
16
  onChange: o,
18
- onSubmit: d,
19
- onSelect: p,
20
- children: f,
21
- isLoading: C = !1,
22
- shouldStayOpen: M = !1,
23
- shouldDestroyOnClose: $ = !0,
17
+ onSubmit: p,
18
+ onSelect: f,
19
+ children: d,
20
+ isLoading: h = !1,
21
+ shouldStayOpen: K = !1,
22
+ shouldDestroyOnClose: M = !0,
24
23
  shouldHideMenu: T = !1,
25
24
  minChars: g = 0,
26
- ...j
25
+ ...z
27
26
  }) => {
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 !== I.stateChangeTypes.InputBlur && s !== I.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);
27
+ const [B, k] = u(!0), [s, E] = u(H ?? ""), [U, O] = u(!1), r = P(), W = F("search-input"), $ = F("search-menu"), X = ne(), j = P(), [q, y] = u(!0);
28
+ R(() => {
29
+ s.length > 0 ? O(!0) : O(!1);
30
+ }, [s]);
31
+ const b = { value: s }, c = s ? [b, ...i] : [], A = ({ selectedItem: t, type: n }) => {
32
+ n !== I.stateChangeTypes.InputBlur && n !== I.stateChangeTypes.FunctionCloseMenu && (t === b ? (p == null || p(s), r.current.blur()) : t && (f == null || f(t), r.current.blur()), _());
33
+ }, G = ({ inputValue: t }) => {
34
+ E(t), o && ce(o, t);
38
35
  }, {
39
- isOpen: b,
40
- openMenu: L,
41
- getMenuProps: Q,
42
- getInputProps: W,
36
+ isOpen: x,
37
+ openMenu: J,
38
+ getMenuProps: L,
39
+ getInputProps: Q,
43
40
  getComboboxProps: Y,
44
- highlightedIndex: V,
41
+ highlightedIndex: S,
45
42
  getItemProps: Z,
46
43
  closeMenu: _
47
44
  } = I({
48
45
  items: c,
49
- inputValue: r,
50
- onInputValueChange: J,
51
- itemToString: () => r,
46
+ inputValue: s,
47
+ onInputValueChange: G,
48
+ itemToString: () => s,
52
49
  // We will not change the search input after an item is selected.
53
50
  defaultHighlightedIndex: 0,
54
- onSelectedItemChange: G
51
+ onSelectedItemChange: A
55
52
  });
56
- K(() => {
57
- b ? v(!1) : setTimeout(() => v(!0), 1);
58
- }, [b, v]);
53
+ R(() => {
54
+ x ? y(!1) : setTimeout(() => y(!0), 1);
55
+ }, [x, y]);
59
56
  const ee = () => {
60
- k(!1), L();
57
+ k(!1), J();
61
58
  }, te = () => {
62
- var e;
63
- x(""), o && o(""), (e = a.current) == null || e.focus();
59
+ E(""), o && o(""), r.current.focus();
64
60
  };
65
- O(
66
- ae ? "cmd+k" : "ctrl+k",
67
- (e) => {
68
- var s;
69
- e.preventDefault(), (s = a.current) == null || s.focus();
61
+ V(
62
+ re ? "cmd+k" : "ctrl+k",
63
+ (t) => {
64
+ t.preventDefault(), r.current.focus();
70
65
  },
71
66
  { enableOnTags: ["INPUT"] }
72
- ), O(
67
+ ), V(
73
68
  "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());
69
+ (t) => {
70
+ (document == null ? void 0 : document.activeElement) === r.current && (t.preventDefault(), s.length > 0 ? te() : r.current.blur());
77
71
  },
78
72
  { enableOnTags: ["INPUT"] }
79
73
  );
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: w(
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
74
+ const N = (x || !q || K) && c.length > 0 && !T, ae = N && !h && c.length <= 1 && s.length >= g, v = N || !M, w = c.some((t) => !!t.id);
75
+ return /* @__PURE__ */ e.createElement("div", { suppressHydrationWarning: !0, className: "ui-search relative w-full" }, /* @__PURE__ */ e.createElement("div", { ...Y({ className: "w-full relative rounded-md" }) }, /* @__PURE__ */ e.createElement("div", { className: "pointer-events-none absolute inset-y-0 -top-0.5 left-0 hidden items-center md:flex" }, /* @__PURE__ */ e.createElement(le, { className: "h-4 w-4 text-gray-darker" })), /* @__PURE__ */ e.createElement(
76
+ "input",
77
+ {
78
+ suppressHydrationWarning: !0,
79
+ ...Q({
80
+ id: W,
81
+ type: "text",
82
+ className: C(
83
+ "ui-search-input",
84
+ "block w-full border-none pl-0 md:pl-7 text-base md:text-md text-gray-darker leading-p2 focus:ring-0",
85
+ m
86
+ ),
87
+ ref: r,
88
+ onFocus: ee,
89
+ onBlur: () => k(!0),
90
+ onChange: (t) => E(t.target.value),
91
+ ...z
92
+ })
93
+ }
94
+ ), /* @__PURE__ */ e.createElement("div", { className: "pointer-events-none absolute inset-y-0 right-0 hidden items-center space-x-1 pr-3 lg:flex" }, X && B ? /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement(l, { char: "cmd" }), " ", /* @__PURE__ */ e.createElement(l, { char: "K" })) : null)), /* @__PURE__ */ e.createElement("div", { className: "relative" }, T && /* @__PURE__ */ e.createElement(
95
+ "div",
96
+ {
97
+ ref: j,
98
+ className: `text-gray-500 absolute left-0 top-full transform
114
99
  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",
100
+ ease-in-out ${U ? "translate-y-0 opacity-100" : "-translate-y-2 opacity-0"}`
101
+ },
102
+ /* @__PURE__ */ e.createElement("span", { className: "inline-flex items-center gap-1" }, /* @__PURE__ */ e.createElement(l, { char: "Esc" }), /* @__PURE__ */ e.createElement("span", null, "Clear search"))
103
+ )), /* @__PURE__ */ e.createElement(
104
+ "ul",
105
+ {
106
+ ...L({
107
+ id: $,
108
+ className: C(
109
+ "ui-search-menu",
110
+ "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",
111
+ { hidden: !N }
112
+ )
113
+ })
114
+ },
115
+ v ? c.map((t, n) => /* @__PURE__ */ e.createElement("li", { key: (t == null ? void 0 : t.id) ?? n, ...Z({ item: t, index: n, className: "ui-search-item" }) }, t === b ? h && !w ? /* @__PURE__ */ e.createElement("div", { className: "p-3 text-center" }, /* @__PURE__ */ e.createElement(D, { size: "small" })) : s.length < g ? /* @__PURE__ */ e.createElement(
116
+ "div",
124
117
  {
125
- ...Q({
126
- id: H,
127
- className: w(
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: w(
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
- ] });
118
+ className: C(
119
+ "cursor-pointer p-2",
120
+ S === n ? "bg-blue-light text-white" : ""
121
+ )
122
+ },
123
+ `Enter at least ${g} characters to begin search`
124
+ ) : null : d == null ? void 0 : d(t, S === n))) : null,
125
+ v && ae ? /* @__PURE__ */ e.createElement("li", { className: "cursor-not-allowed p-2" }, "No results found") : null,
126
+ v && w && /* @__PURE__ */ e.createElement("li", { className: "bg-white search-footer pointer-events sticky bottom-0 items-center flex space-x-5 p-2 text-sm text-gray-dark" }, /* @__PURE__ */ e.createElement("span", { className: "flex items-center" }, /* @__PURE__ */ e.createElement(l, { char: "up", className: "mr-0.5" }), /* @__PURE__ */ e.createElement(l, { char: "down", className: "mr-2" }), " navigate results"), /* @__PURE__ */ e.createElement("span", { className: "flex items-center" }, /* @__PURE__ */ e.createElement(l, { char: "enter", className: "mr-2" }), " submit"), /* @__PURE__ */ e.createElement("span", { className: "flex items-center" }, /* @__PURE__ */ e.createElement(l, { char: "esc", className: "mr-2" }), " close search"), h && /* @__PURE__ */ e.createElement("span", null, /* @__PURE__ */ e.createElement(D, { size: "tiny", className: "mr-1" }), " Fetching ", w ? "more data" : "data"))
127
+ ));
128
+ };
129
+ oe.propTypes = {
130
+ className: a.string,
131
+ items: a.arrayOf(a.any),
132
+ defaultValue: a.string,
133
+ onChange: a.func,
134
+ onSubmit: a.func,
135
+ onSelect: a.func,
136
+ children: a.oneOfType([a.arrayOf(a.node), a.node, a.func]),
137
+ isLoading: a.bool,
138
+ shouldStayOpen: a.bool,
139
+ shouldDestroyOnClose: a.bool,
140
+ shouldHideMenu: a.bool
171
141
  };
172
142
  export {
173
- Ie as Search
143
+ oe as Search
174
144
  };
@@ -1,56 +1,49 @@
1
- import { jsxs as l, jsx as e } from "react/jsx-runtime";
2
- import { useRef as w, useState as m, useEffect as N } from "react";
3
- import d from "../../helpers/classnames.js";
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
1
+ import t from "prop-types";
2
+ import e, { useRef as d } from "react";
3
+ import f from "../../helpers/classnames.js";
4
+ import { isDevelopment as v } from "../../helpers/environment.js";
5
+ import { Avatar as b } from "../Avatar.js";
6
+ import { useSidebar as g } from "./SidebarContext.js";
7
+ import { ChevronRightIcon as h } from "../../icons/src/ChevronRightIcon.js";
8
+ const o = ({
9
+ name: s,
10
+ description: a,
11
+ image: i,
12
+ icon: c = /* @__PURE__ */ e.createElement(h, null),
13
+ isResponsive: m,
14
+ className: l,
15
+ ...p
14
16
  }) => {
15
- const t = w(null), [s, a] = m(!r), [p, u] = m(!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(
17
+ const { showText: r } = g(), u = i ?? /* @__PURE__ */ e.createElement(b, { size: "tiny", name: s }), n = d(!1);
18
+ return v && m !== void 0 && !n.current && (n.current = !0, console.warn(
19
+ "UI Kit: Sidebar.Account no longer needs `isResponsive`; the sidebar's variant drives this. Remove the prop."
20
+ )), /* @__PURE__ */ e.createElement(
30
21
  "button",
31
22
  {
32
- ref: t,
33
23
  type: "button",
34
- className: d(
24
+ className: f(
35
25
  "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
26
+ "flex h-12 w-full cursor-pointer items-center rounded px-4 py-3 hover:bg-gray-darker",
27
+ r ? "justify-start" : "justify-center",
28
+ l
40
29
  ),
41
- ...y,
42
- children: [
43
- p && /* @__PURE__ */ e("div", { className: d(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
- }
30
+ ...p
31
+ },
32
+ /* @__PURE__ */ e.createElement("div", { className: "shrink-0" }, u),
33
+ r && /* @__PURE__ */ e.createElement("div", { className: "ml-2 min-w-0 text-left" }, /* @__PURE__ */ e.createElement("div", { className: "truncate text-base" }, s), a && /* @__PURE__ */ e.createElement("div", { className: "truncate text-sm text-gray-dark" }, a)),
34
+ r && /* @__PURE__ */ e.createElement("span", { className: "ml-auto" }, c)
51
35
  );
52
36
  };
53
- j.displayName = "Sidebar.Account";
37
+ o.displayName = "Sidebar.Account";
38
+ o.propTypes = {
39
+ name: t.string.isRequired,
40
+ description: t.string,
41
+ image: t.node,
42
+ icon: t.node,
43
+ // Deprecated no-op, retained so existing consumers keep compiling. Warns in development.
44
+ isResponsive: t.bool,
45
+ className: t.string
46
+ };
54
47
  export {
55
- j as SidebarAccount
48
+ o as SidebarAccount
56
49
  };