@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.
- package/README.md +136 -87
- package/build/components/Alert.js +18 -13
- package/build/components/Animation/FadeIn.js +36 -25
- package/build/components/Animation/SlideDown.js +14 -9
- package/build/components/Avatar.js +17 -10
- package/build/components/Badge.js +33 -24
- package/build/components/BottomSheet.js +114 -0
- package/build/components/Breadcrumb.js +27 -21
- package/build/components/Breakdown.js +66 -74
- package/build/components/Buttons/Button.js +53 -47
- package/build/components/Buttons/ButtonGroup.js +42 -39
- package/build/components/Buttons/SecondaryButton.js +31 -0
- package/build/components/Buttons/SubmitButton.js +72 -66
- package/build/components/Buttons/ToggleButton.js +15 -16
- package/build/components/Counter.js +10 -6
- package/build/components/DatePicker/DatePicker.helpers.js +24 -13
- package/build/components/DatePicker/DatePicker.js +196 -223
- package/build/components/DatePicker/DatePickerPopover.js +75 -66
- package/build/components/DatePicker/Day.js +35 -32
- package/build/components/DatePicker/LocalizedDayPicker.js +15 -18
- package/build/components/DatePicker/MonthGrid.js +35 -48
- package/build/components/DatePicker/MonthPicker.js +25 -20
- package/build/components/DatePicker/MonthSelector.js +39 -40
- package/build/components/DatePicker/MonthYearSelector.js +18 -39
- package/build/components/DatePicker/NavbarElement.js +26 -35
- package/build/components/DatePicker/RangeDatePicker.js +104 -123
- package/build/components/DatePicker/RelativeDateRange.js +153 -143
- package/build/components/DatePicker/UpcomingDatePicker.js +29 -25
- package/build/components/Dot/Dot.js +13 -8
- package/build/components/Dot/DotProgress.js +12 -7
- package/build/components/Drawer.js +109 -101
- package/build/components/Forms/BaseInput.js +50 -34
- package/build/components/Forms/Checkbox.js +33 -30
- package/build/components/Forms/ComboBox.js +35 -35
- package/build/components/Forms/FormGroup.js +7 -3
- package/build/components/Forms/InlineValuePopover.js +33 -39
- package/build/components/Forms/Input.js +15 -7
- package/build/components/Forms/Label.js +14 -8
- package/build/components/Forms/RangeSlider.js +41 -22
- package/build/components/Forms/Select.js +5 -6
- package/build/components/Forms/Switch.js +46 -38
- package/build/components/Forms/Textarea.js +37 -30
- package/build/components/Forms/ValuePopoverText.js +5 -8
- package/build/components/GooglePlacesAutocomplete.js +112 -0
- package/build/components/HeaderToolbar.js +30 -22
- package/build/components/ImageUpload.js +76 -79
- package/build/components/Key.js +21 -16
- package/build/components/Logo.js +12 -5
- package/build/components/Modal.js +87 -72
- package/build/components/Popover/Popover.js +40 -31
- package/build/components/Popover/PopoverList.js +43 -36
- package/build/components/Provider.js +7 -8
- package/build/components/Screens/Login.js +97 -126
- package/build/components/Search.js +114 -144
- package/build/components/Sidebar/Sidebar.Account.js +39 -46
- package/build/components/Sidebar/Sidebar.Button.js +45 -19
- package/build/components/Sidebar/Sidebar.Footer.js +8 -7
- package/build/components/Sidebar/Sidebar.Heading.js +11 -8
- package/build/components/Sidebar/Sidebar.Link.js +79 -44
- package/build/components/Sidebar/Sidebar.Menu.js +52 -28
- package/build/components/Sidebar/Sidebar.Notifications.js +107 -0
- package/build/components/Sidebar/Sidebar.js +207 -214
- package/build/components/Sidebar/SidebarContext.js +15 -0
- package/build/components/Sidebar/sidebarWidth.js +41 -0
- package/build/components/Sidebar/useSidebarWidthState.js +115 -0
- package/build/components/Skeleton.js +19 -20
- package/build/components/Spinner.js +18 -10
- package/build/components/Table.js +86 -50
- package/build/components/Tabs/Tabs.Panel.js +9 -5
- package/build/components/Tabs/Tabs.Tab.js +28 -23
- package/build/components/Tabs/Tabs.js +23 -23
- package/build/components/Tag.js +28 -23
- package/build/components/Tooltip.js +19 -5
- package/build/components/Utilities/Currency.js +49 -42
- package/build/components/Utilities/Number.js +14 -12
- package/build/components/Utilities/Phone.js +18 -12
- package/build/helpers/environment.js +10 -0
- package/build/helpers/flash.js +45 -46
- package/build/hooks/useIsMobile.js +8 -0
- package/build/hooks/useViewportHeight.js +6 -12
- package/build/icons/src/AnnounceIcon.js +3 -4
- package/build/icons/src/BellIcon.js +0 -1
- package/build/icons/src/CalendarIcon.js +0 -1
- package/build/icons/src/CheckIcon.js +0 -1
- package/build/icons/src/ChevronDownIcon.js +4 -5
- package/build/icons/src/ChevronLeftIcon.js +0 -1
- package/build/icons/src/ChevronRightIcon.js +0 -1
- package/build/icons/src/CircleNotch.js +0 -1
- package/build/icons/src/CloseIcon.js +11 -9
- package/build/icons/src/DownArrowIcon.js +0 -1
- package/build/icons/src/ImageIcon.js +0 -1
- package/build/icons/src/SearchIcon.js +4 -5
- package/build/icons/src/TrashIcon.js +0 -1
- package/build/icons/src/WarningDiamondIcon.js +0 -1
- package/build/icons/src/helpers/icon.js +5 -9
- package/build/icons/src/images/XolaLogoSimple.js +2 -3
- package/build/index.js +143 -130
- package/build/style.css +1 -0
- package/build/theme.css +76 -0
- package/build/theme.js +2 -0
- package/build/utils/currency.js +5 -5
- package/build/{helpers → utils}/date.js +17 -20
- package/build/utils/numbers.js +12 -12
- package/build/utils/phone.js +12 -14
- package/build/utils/userLocale.js +6 -0
- package/index.css +96 -4
- package/index.d.ts +204 -0
- package/package.json +87 -77
- package/skills/README.md +27 -0
- package/skills/migrate-2.6-to-3.7/SKILL.md +110 -0
- package/tailwind.config.js +5 -2
- package/build/base.css +0 -2
- package/build/components/Alert.d.ts +0 -18
- package/build/components/Animation/FadeIn.d.ts +0 -13
- package/build/components/Animation/SlideDown.d.ts +0 -6
- package/build/components/Avatar.d.ts +0 -16
- package/build/components/Badge.d.ts +0 -28
- package/build/components/Breadcrumb.d.ts +0 -21
- package/build/components/Breakdown.d.ts +0 -63
- package/build/components/Buttons/Button.d.ts +0 -53
- package/build/components/Buttons/ButtonGroup.d.ts +0 -35
- package/build/components/Buttons/SubmitButton.d.ts +0 -11
- package/build/components/Buttons/ToggleButton.d.ts +0 -21
- package/build/components/Charts/BaseChartOptions.d.ts +0 -136
- package/build/components/Charts/HistogramOptions.d.ts +0 -192
- package/build/components/Charts/PieOptions.d.ts +0 -177
- package/build/components/Counter.d.ts +0 -5
- package/build/components/DatePicker/DatePicker.d.ts +0 -41
- package/build/components/DatePicker/DatePicker.helpers.d.ts +0 -17
- package/build/components/DatePicker/DatePickerPopover.d.ts +0 -29
- package/build/components/DatePicker/Day.d.ts +0 -13
- package/build/components/DatePicker/LocalizedDayPicker.d.ts +0 -6
- package/build/components/DatePicker/MonthGrid.d.ts +0 -11
- package/build/components/DatePicker/MonthPicker.d.ts +0 -7
- package/build/components/DatePicker/MonthSelector.d.ts +0 -8
- package/build/components/DatePicker/MonthYearSelector.d.ts +0 -8
- package/build/components/DatePicker/NavbarElement.d.ts +0 -15
- package/build/components/DatePicker/RangeDatePicker.d.ts +0 -25
- package/build/components/DatePicker/RelativeDateRange.d.ts +0 -51
- package/build/components/DatePicker/UpcomingDatePicker.d.ts +0 -11
- package/build/components/Dot/Dot.d.ts +0 -24
- package/build/components/Dot/DotProgress.d.ts +0 -6
- package/build/components/Drawer.d.ts +0 -28
- package/build/components/Forms/BaseInput.d.ts +0 -20
- package/build/components/Forms/Checkbox.d.ts +0 -10
- package/build/components/Forms/ComboBox.d.ts +0 -8
- package/build/components/Forms/FormGroup.d.ts +0 -5
- package/build/components/Forms/InlineValuePopover.d.ts +0 -17
- package/build/components/Forms/Input.d.ts +0 -6
- package/build/components/Forms/Label.d.ts +0 -7
- package/build/components/Forms/RangeSlider.d.ts +0 -33
- package/build/components/Forms/Select.d.ts +0 -5
- package/build/components/Forms/Switch.d.ts +0 -46
- package/build/components/Forms/Textarea.d.ts +0 -6
- package/build/components/Forms/ValuePopoverText.d.ts +0 -6
- package/build/components/GooglePlacesAutocomplete.d.ts +0 -14
- package/build/components/HeaderToolbar.d.ts +0 -21
- package/build/components/ImageUpload.d.ts +0 -17
- package/build/components/Key.d.ts +0 -6
- package/build/components/Logo.d.ts +0 -19
- package/build/components/Modal.d.ts +0 -52
- package/build/components/Popover/Popover.d.ts +0 -20
- package/build/components/Popover/PopoverList.d.ts +0 -25
- package/build/components/Provider.d.ts +0 -18
- package/build/components/Screens/Login.d.ts +0 -25
- package/build/components/Search.d.ts +0 -16
- package/build/components/Sidebar/Sidebar.Account.d.ts +0 -13
- package/build/components/Sidebar/Sidebar.Button.d.ts +0 -10
- package/build/components/Sidebar/Sidebar.Footer.d.ts +0 -8
- package/build/components/Sidebar/Sidebar.Heading.d.ts +0 -10
- package/build/components/Sidebar/Sidebar.Link.d.ts +0 -24
- package/build/components/Sidebar/Sidebar.Menu.d.ts +0 -13
- package/build/components/Sidebar/Sidebar.d.ts +0 -58
- package/build/components/Sidebar/index.d.ts +0 -8
- package/build/components/Skeleton.d.ts +0 -13
- package/build/components/Spinner.d.ts +0 -26
- package/build/components/Table.d.ts +0 -59
- package/build/components/Tabs/Tabs.Panel.d.ts +0 -9
- package/build/components/Tabs/Tabs.Tab.d.ts +0 -19
- package/build/components/Tabs/Tabs.d.ts +0 -27
- package/build/components/Tabs/index.d.ts +0 -4
- package/build/components/Tag.d.ts +0 -25
- package/build/components/Tooltip.d.ts +0 -8
- package/build/components/Utilities/Currency.d.ts +0 -32
- package/build/components/Utilities/Number.d.ts +0 -8
- package/build/components/Utilities/Phone.d.ts +0 -8
- 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/children.d.ts +0 -3
- 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/flash.d.ts +0 -21
- 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/useViewportHeight.d.ts +0 -1
- package/build/icons/src/helpers/classnames.js +0 -8
- package/build/index.d.ts +0 -66
- package/build/theme.d.ts +0 -413
- 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/currency.d.ts +0 -2
- package/build/utils/index.d.ts +0 -4
- package/build/utils/numbers.d.ts +0 -4
- package/build/utils/phone.d.ts +0 -2
|
@@ -1,144 +1,115 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { useState as
|
|
3
|
-
import { Alert as
|
|
4
|
-
import { Button as
|
|
5
|
-
import { Checkbox as
|
|
6
|
-
import { FormGroup as
|
|
7
|
-
import { Input as
|
|
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
|
|
10
|
-
import { XolaLogoSimple as
|
|
11
|
-
const
|
|
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
|
-
},
|
|
17
|
-
defaultValues:
|
|
18
|
-
isLoading:
|
|
19
|
-
error:
|
|
20
|
-
onSubmit:
|
|
16
|
+
}, F = ({
|
|
17
|
+
defaultValues: g,
|
|
18
|
+
isLoading: n = !1,
|
|
19
|
+
error: l = null,
|
|
20
|
+
onSubmit: b,
|
|
21
21
|
passwordResetUrl: x,
|
|
22
|
-
label:
|
|
23
|
-
backgroundImage:
|
|
24
|
-
backgroundType:
|
|
25
|
-
...
|
|
22
|
+
label: s,
|
|
23
|
+
backgroundImage: h = null,
|
|
24
|
+
backgroundType: E = "default",
|
|
25
|
+
...y
|
|
26
26
|
}) => {
|
|
27
|
-
const [
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
},
|
|
36
|
-
|
|
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__ */
|
|
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:
|
|
51
|
-
...
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
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
|
-
|
|
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
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import
|
|
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
|
|
11
|
-
import { Spinner as
|
|
12
|
-
import { SearchIcon as
|
|
13
|
-
const
|
|
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:
|
|
16
|
-
defaultValue:
|
|
14
|
+
items: i = [],
|
|
15
|
+
defaultValue: H,
|
|
17
16
|
onChange: o,
|
|
18
|
-
onSubmit:
|
|
19
|
-
onSelect:
|
|
20
|
-
children:
|
|
21
|
-
isLoading:
|
|
22
|
-
shouldStayOpen:
|
|
23
|
-
shouldDestroyOnClose:
|
|
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
|
-
...
|
|
25
|
+
...z
|
|
27
26
|
}) => {
|
|
28
|
-
const [
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}, [
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
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:
|
|
40
|
-
openMenu:
|
|
41
|
-
getMenuProps:
|
|
42
|
-
getInputProps:
|
|
36
|
+
isOpen: x,
|
|
37
|
+
openMenu: J,
|
|
38
|
+
getMenuProps: L,
|
|
39
|
+
getInputProps: Q,
|
|
43
40
|
getComboboxProps: Y,
|
|
44
|
-
highlightedIndex:
|
|
41
|
+
highlightedIndex: S,
|
|
45
42
|
getItemProps: Z,
|
|
46
43
|
closeMenu: _
|
|
47
44
|
} = I({
|
|
48
45
|
items: c,
|
|
49
|
-
inputValue:
|
|
50
|
-
onInputValueChange:
|
|
51
|
-
itemToString: () =>
|
|
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:
|
|
51
|
+
onSelectedItemChange: A
|
|
55
52
|
});
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}, [
|
|
53
|
+
R(() => {
|
|
54
|
+
x ? y(!1) : setTimeout(() => y(!0), 1);
|
|
55
|
+
}, [x, y]);
|
|
59
56
|
const ee = () => {
|
|
60
|
-
k(!1),
|
|
57
|
+
k(!1), J();
|
|
61
58
|
}, te = () => {
|
|
62
|
-
|
|
63
|
-
x(""), o && o(""), (e = a.current) == null || e.focus();
|
|
59
|
+
E(""), o && o(""), r.current.focus();
|
|
64
60
|
};
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
(
|
|
68
|
-
|
|
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
|
-
),
|
|
67
|
+
), V(
|
|
73
68
|
"esc",
|
|
74
|
-
(
|
|
75
|
-
|
|
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 = (
|
|
81
|
-
return /* @__PURE__ */
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
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 ${
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
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
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
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
|
-
|
|
143
|
+
oe as Search
|
|
174
144
|
};
|
|
@@ -1,56 +1,49 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { useRef as
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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
|
|
16
|
-
return
|
|
17
|
-
|
|
18
|
-
|
|
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:
|
|
24
|
+
className: f(
|
|
35
25
|
"ui-sidebar-account",
|
|
36
|
-
"flex h-12 w-full cursor-pointer items-center
|
|
37
|
-
"
|
|
38
|
-
|
|
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
|
-
...
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
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
|
-
|
|
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
|
-
|
|
48
|
+
o as SidebarAccount
|
|
56
49
|
};
|