@noxickon/onyx 1.0.5 → 1.1.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/dist/animations.css +25 -72
- package/dist/chunks/{hooks-B6Ov6Z0O.js → hooks-CUNBk2tZ.js} +2719 -2417
- package/dist/chunks/hooks-UiKjBucd.js +47 -0
- package/dist/chunks/ui-DGkJW_Fa.js +20745 -0
- package/dist/chunks/ui-DRRDAnVI.js +20 -0
- package/dist/contexts/contexts.cjs.js +2 -2
- package/dist/contexts/contexts.es.js +172 -140
- package/dist/hooks/hooks.cjs.js +1 -1
- package/dist/hooks/hooks.es.js +2 -2
- package/dist/index.d.ts +248 -210
- package/dist/layouts/layouts.cjs.js +1 -1
- package/dist/layouts/layouts.es.js +749 -673
- package/dist/layouts.d.ts +46 -36
- package/dist/onyx.cjs.js +1 -1
- package/dist/onyx.es.js +36 -34
- package/dist/pages/pages.cjs.js +2 -2
- package/dist/pages/pages.es.js +120 -94
- package/dist/pages.d.ts +2 -2
- package/dist/routes/routes.cjs.js +1 -1
- package/dist/routes/routes.es.js +36 -27
- package/dist/shared.css +15 -10
- package/dist/ui.css +1 -1
- package/dist/utils/utils.cjs.js +1 -1
- package/dist/utils/utils.es.js +1 -1
- package/package.json +4 -3
- package/dist/chunks/hooks-BGvU5VHk.js +0 -27
- package/dist/chunks/ui-CZGrB58H.js +0 -20
- package/dist/chunks/ui-Dmzl3_Y3.js +0 -20368
package/dist/layouts.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { HTMLAttributes } from 'react';
|
|
1
|
+
import { ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
import { ComponentPropsWithRef } from 'react';
|
|
4
3
|
import { IconProps } from '@mdi/react/dist/IconProps';
|
|
5
4
|
import { JSX } from 'react/jsx-runtime';
|
|
6
5
|
import { ReactNode } from 'react';
|
|
@@ -138,11 +137,11 @@ declare type ColorStyleName = keyof typeof COLOR_STYLES;
|
|
|
138
137
|
|
|
139
138
|
export declare const OxAppLayout: ({ children, className, ...domProps }: OxAppLayoutProps) => JSX.Element;
|
|
140
139
|
|
|
141
|
-
export declare interface OxAppLayoutProps extends
|
|
140
|
+
export declare interface OxAppLayoutProps extends ComponentPropsWithRef<'div'> {
|
|
142
141
|
children: ReactNode;
|
|
143
142
|
}
|
|
144
143
|
|
|
145
|
-
declare interface OxHeaderProps extends
|
|
144
|
+
declare interface OxHeaderProps extends ComponentPropsWithRef<'header'> {
|
|
146
145
|
brand?: ReactNode;
|
|
147
146
|
children: ReactNode;
|
|
148
147
|
hasSidebar?: boolean;
|
|
@@ -175,19 +174,19 @@ export declare const OxMainContent: (({ children, className, ...domProps }: OxMa
|
|
|
175
174
|
Body: ({ children, className, ...domProps }: OxMainContentBodyProps) => JSX.Element;
|
|
176
175
|
};
|
|
177
176
|
|
|
178
|
-
export declare interface OxMainContentBodyProps extends
|
|
177
|
+
export declare interface OxMainContentBodyProps extends ComponentPropsWithRef<'div'> {
|
|
179
178
|
children: ReactNode;
|
|
180
179
|
}
|
|
181
180
|
|
|
182
|
-
export declare interface OxMainContentHeaderProps extends
|
|
181
|
+
export declare interface OxMainContentHeaderProps extends ComponentPropsWithRef<'div'> {
|
|
183
182
|
children: ReactNode;
|
|
184
183
|
}
|
|
185
184
|
|
|
186
|
-
export declare interface OxMainContentProps extends
|
|
185
|
+
export declare interface OxMainContentProps extends ComponentPropsWithRef<'main'> {
|
|
187
186
|
children: ReactNode;
|
|
188
187
|
}
|
|
189
188
|
|
|
190
|
-
declare interface OxMainContentProps_2 extends
|
|
189
|
+
declare interface OxMainContentProps_2 extends ComponentPropsWithRef<'main'> {
|
|
191
190
|
children: ReactNode;
|
|
192
191
|
color?: ColorStyleName;
|
|
193
192
|
icon?: string;
|
|
@@ -209,13 +208,13 @@ declare const OxSidebar_3: ({ children, className, ...domProps }: OxSidebarProps
|
|
|
209
208
|
|
|
210
209
|
declare const OxSidebarBody: ({ children, className, ...domProps }: OxSidebarBodyProps) => JSX.Element;
|
|
211
210
|
|
|
212
|
-
declare interface OxSidebarBodyProps extends
|
|
211
|
+
declare interface OxSidebarBodyProps extends ComponentPropsWithRef<'div'> {
|
|
213
212
|
children: ReactNode;
|
|
214
213
|
}
|
|
215
214
|
|
|
216
215
|
declare const OxSidebarButton: ({ active, children, className, disabled, ...domProps }: OxSidebarButtonProps) => JSX.Element;
|
|
217
216
|
|
|
218
|
-
declare interface OxSidebarButtonProps extends
|
|
217
|
+
declare interface OxSidebarButtonProps extends ComponentPropsWithRef<'button'> {
|
|
219
218
|
active?: boolean;
|
|
220
219
|
children: ReactNode;
|
|
221
220
|
onClick: () => void;
|
|
@@ -223,7 +222,7 @@ declare interface OxSidebarButtonProps extends Omit<ButtonHTMLAttributes<HTMLBut
|
|
|
223
222
|
|
|
224
223
|
declare const OxSidebarContent: ({ children, className, ...domProps }: OxSidebarContentProps) => JSX.Element;
|
|
225
224
|
|
|
226
|
-
export declare interface OxSidebarContentProps extends
|
|
225
|
+
export declare interface OxSidebarContentProps extends ComponentPropsWithRef<'div'> {
|
|
227
226
|
children: ReactNode;
|
|
228
227
|
}
|
|
229
228
|
|
|
@@ -239,11 +238,11 @@ declare const OxSidebarFooter: ({ children, className, ...domProps }: OxSidebarF
|
|
|
239
238
|
|
|
240
239
|
declare const OxSidebarFooter_2: ({ children, className, ...domProps }: OxSidebarFooterProps) => JSX.Element;
|
|
241
240
|
|
|
242
|
-
export declare interface OxSidebarFooterProps extends
|
|
241
|
+
export declare interface OxSidebarFooterProps extends ComponentPropsWithRef<'div'> {
|
|
243
242
|
children: ReactNode;
|
|
244
243
|
}
|
|
245
244
|
|
|
246
|
-
declare interface OxSidebarFooterProps_2 extends
|
|
245
|
+
declare interface OxSidebarFooterProps_2 extends ComponentPropsWithRef<'div'> {
|
|
247
246
|
children: ReactNode;
|
|
248
247
|
}
|
|
249
248
|
|
|
@@ -259,27 +258,27 @@ declare const OxSidebarGroup_3: ({ children, className, ...domProps }: OxSidebar
|
|
|
259
258
|
|
|
260
259
|
declare const OxSidebarGroupAction: ({ children, className, ...domProps }: OxSidebarGroupActionProps) => JSX.Element;
|
|
261
260
|
|
|
262
|
-
export declare interface OxSidebarGroupActionProps extends
|
|
261
|
+
export declare interface OxSidebarGroupActionProps extends ComponentPropsWithRef<'button'> {
|
|
263
262
|
children: ReactNode;
|
|
264
263
|
}
|
|
265
264
|
|
|
266
265
|
declare const OxSidebarGroupContent: ({ children, className, ...domProps }: OxSidebarGroupContentProps) => JSX.Element;
|
|
267
266
|
|
|
268
|
-
export declare interface OxSidebarGroupContentProps extends
|
|
267
|
+
export declare interface OxSidebarGroupContentProps extends ComponentPropsWithRef<'div'> {
|
|
269
268
|
children: ReactNode;
|
|
270
269
|
}
|
|
271
270
|
|
|
272
271
|
declare const OxSidebarGroupLabel: ({ children, className, ...domProps }: OxSidebarGroupLabelProps) => JSX.Element;
|
|
273
272
|
|
|
274
|
-
export declare interface OxSidebarGroupLabelProps extends
|
|
273
|
+
export declare interface OxSidebarGroupLabelProps extends ComponentPropsWithRef<'div'> {
|
|
275
274
|
children: ReactNode;
|
|
276
275
|
}
|
|
277
276
|
|
|
278
|
-
export declare interface OxSidebarGroupProps extends
|
|
277
|
+
export declare interface OxSidebarGroupProps extends ComponentPropsWithRef<'div'> {
|
|
279
278
|
children: ReactNode;
|
|
280
279
|
}
|
|
281
280
|
|
|
282
|
-
declare interface OxSidebarGroupProps_2 extends
|
|
281
|
+
declare interface OxSidebarGroupProps_2 extends ComponentPropsWithRef<'div'> {
|
|
283
282
|
children: ReactNode;
|
|
284
283
|
headline: string;
|
|
285
284
|
}
|
|
@@ -288,11 +287,11 @@ declare const OxSidebarHeader: ({ children, className, ...domProps }: OxSidebarH
|
|
|
288
287
|
|
|
289
288
|
declare const OxSidebarHeader_2: ({ children, className, ...domProps }: OxSidebarHeaderProps) => JSX.Element;
|
|
290
289
|
|
|
291
|
-
export declare interface OxSidebarHeaderProps extends
|
|
290
|
+
export declare interface OxSidebarHeaderProps extends ComponentPropsWithRef<'div'> {
|
|
292
291
|
children: ReactNode;
|
|
293
292
|
}
|
|
294
293
|
|
|
295
|
-
declare interface OxSidebarHeaderProps_2 extends
|
|
294
|
+
declare interface OxSidebarHeaderProps_2 extends ComponentPropsWithRef<'div'> {
|
|
296
295
|
children: ReactNode;
|
|
297
296
|
}
|
|
298
297
|
|
|
@@ -302,13 +301,13 @@ declare type OxSidebarIconProps = OxIconProps;
|
|
|
302
301
|
|
|
303
302
|
declare const OxSidebarLabel: ({ children, className, ...domProps }: OxSidebarLabelProps) => JSX.Element;
|
|
304
303
|
|
|
305
|
-
declare interface OxSidebarLabelProps extends
|
|
304
|
+
declare interface OxSidebarLabelProps extends ComponentPropsWithRef<'span'> {
|
|
306
305
|
children: ReactNode;
|
|
307
306
|
}
|
|
308
307
|
|
|
309
308
|
declare const OxSidebarLink: ({ active, children, className, disabled, href, ...domProps }: OxSidebarLinkProps) => JSX.Element;
|
|
310
309
|
|
|
311
|
-
declare interface OxSidebarLinkProps extends
|
|
310
|
+
declare interface OxSidebarLinkProps extends ComponentPropsWithRef<'a'> {
|
|
312
311
|
active?: boolean;
|
|
313
312
|
children: ReactNode;
|
|
314
313
|
disabled?: boolean;
|
|
@@ -331,7 +330,7 @@ declare const OxSidebarMenu_2: ({ children, className, ...domProps }: OxSidebarM
|
|
|
331
330
|
|
|
332
331
|
declare const OxSidebarMenuAction: ({ children, className, ...domProps }: OxSidebarMenuActionProps) => JSX.Element;
|
|
333
332
|
|
|
334
|
-
export declare interface OxSidebarMenuActionProps extends
|
|
333
|
+
export declare interface OxSidebarMenuActionProps extends ComponentPropsWithRef<'button'> {
|
|
335
334
|
children: ReactNode;
|
|
336
335
|
}
|
|
337
336
|
|
|
@@ -342,12 +341,19 @@ export declare interface OxSidebarMenuBadgeProps {
|
|
|
342
341
|
className?: string;
|
|
343
342
|
}
|
|
344
343
|
|
|
345
|
-
declare const OxSidebarMenuButton: (
|
|
344
|
+
declare const OxSidebarMenuButton: (props: OxSidebarMenuButtonProps) => JSX.Element;
|
|
346
345
|
|
|
347
|
-
export declare
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
}
|
|
346
|
+
export declare type OxSidebarMenuButtonButtonProps = SidebarMenuButtonBaseProps & Omit<ComponentPropsWithRef<'button'>, keyof SidebarMenuButtonBaseProps | 'type'> & {
|
|
347
|
+
href?: never;
|
|
348
|
+
type?: 'button';
|
|
349
|
+
};
|
|
350
|
+
|
|
351
|
+
export declare type OxSidebarMenuButtonLinkProps = SidebarMenuButtonBaseProps & Omit<ComponentPropsWithRef<'a'>, keyof SidebarMenuButtonBaseProps | 'href'> & {
|
|
352
|
+
disabled?: boolean;
|
|
353
|
+
href: string;
|
|
354
|
+
};
|
|
355
|
+
|
|
356
|
+
export declare type OxSidebarMenuButtonProps = OxSidebarMenuButtonLinkProps | OxSidebarMenuButtonButtonProps;
|
|
351
357
|
|
|
352
358
|
declare const OxSidebarMenuIcon: ({ className, path, placeholder }: OxSidebarMenuIconProps) => JSX.Element;
|
|
353
359
|
|
|
@@ -359,13 +365,13 @@ export declare interface OxSidebarMenuIconProps {
|
|
|
359
365
|
|
|
360
366
|
declare const OxSidebarMenuItem: ({ children, className, defaultOpen, hasSub, ...domProps }: OxSidebarMenuItemProps) => JSX.Element;
|
|
361
367
|
|
|
362
|
-
export declare interface OxSidebarMenuItemProps extends
|
|
368
|
+
export declare interface OxSidebarMenuItemProps extends ComponentPropsWithRef<'li'> {
|
|
363
369
|
children: ReactNode;
|
|
364
370
|
defaultOpen?: boolean;
|
|
365
371
|
hasSub?: boolean;
|
|
366
372
|
}
|
|
367
373
|
|
|
368
|
-
export declare interface OxSidebarMenuProps extends
|
|
374
|
+
export declare interface OxSidebarMenuProps extends ComponentPropsWithRef<'ul'> {
|
|
369
375
|
children: ReactNode;
|
|
370
376
|
}
|
|
371
377
|
|
|
@@ -379,26 +385,26 @@ declare const OxSidebarMenuSub: ({ children, className, ...domProps }: OxSidebar
|
|
|
379
385
|
|
|
380
386
|
declare const OxSidebarMenuSubButton: ({ children, className, href, ...domProps }: OxSidebarMenuSubButtonProps) => JSX.Element;
|
|
381
387
|
|
|
382
|
-
export declare interface OxSidebarMenuSubButtonProps extends
|
|
388
|
+
export declare interface OxSidebarMenuSubButtonProps extends ComponentPropsWithRef<'button'> {
|
|
383
389
|
children: ReactNode;
|
|
384
390
|
href?: string;
|
|
385
391
|
}
|
|
386
392
|
|
|
387
393
|
declare const OxSidebarMenuSubItem: ({ children, className, ...domProps }: OxSidebarMenuSubItemProps) => JSX.Element;
|
|
388
394
|
|
|
389
|
-
export declare interface OxSidebarMenuSubItemProps extends
|
|
395
|
+
export declare interface OxSidebarMenuSubItemProps extends ComponentPropsWithRef<'li'> {
|
|
390
396
|
children: ReactNode;
|
|
391
397
|
}
|
|
392
398
|
|
|
393
|
-
export declare interface OxSidebarMenuSubProps extends
|
|
399
|
+
export declare interface OxSidebarMenuSubProps extends ComponentPropsWithRef<'ul'> {
|
|
394
400
|
children: ReactNode;
|
|
395
401
|
}
|
|
396
402
|
|
|
397
|
-
export declare interface OxSidebarProps extends
|
|
403
|
+
export declare interface OxSidebarProps extends ComponentPropsWithoutRef<'aside'> {
|
|
398
404
|
children: ReactNode;
|
|
399
405
|
}
|
|
400
406
|
|
|
401
|
-
declare interface OxSidebarProps_2 extends
|
|
407
|
+
declare interface OxSidebarProps_2 extends ComponentPropsWithRef<'nav'> {
|
|
402
408
|
children: ReactNode;
|
|
403
409
|
desktopCollapsed?: boolean;
|
|
404
410
|
hasHeader?: boolean;
|
|
@@ -425,6 +431,10 @@ export declare interface OxSidebarTriggerProps {
|
|
|
425
431
|
onClick?: () => void;
|
|
426
432
|
}
|
|
427
433
|
|
|
434
|
+
declare type SidebarMenuButtonBaseProps = {
|
|
435
|
+
children: ReactNode;
|
|
436
|
+
};
|
|
437
|
+
|
|
428
438
|
export declare function useOxSidebar(): OxSidebarContextType;
|
|
429
439
|
|
|
430
440
|
export { }
|
package/dist/onyx.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const x=require("./chunks/ui-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const x=require("./chunks/ui-DRRDAnVI.js");exports.OxAccordion=x.OxAccordion;exports.OxAlert=x.OxAlert;exports.OxAvatar=x.OxAvatar;exports.OxBadge=x.OxBadge;exports.OxBreadcrumb=x.OxBreadcrumb;exports.OxButton=x.OxButton;exports.OxCalendar=x.OxCalendar;exports.OxCard=x.OxCard;exports.OxCheckbox=x.OxCheckbox;exports.OxDateInput=x.OxDateInput;exports.OxDescription=x.OxDescription;exports.OxDescriptionList=x.OxDescriptionList;exports.OxDialog=x.OxDialog;exports.OxDrawer=x.OxDrawer;exports.OxDropdown=x.OxDropdown;exports.OxError=x.OxError;exports.OxFileUpload=x.OxFileUpload;exports.OxFloating=x.OxFloating;exports.OxFloatingContext=x.OxFloatingContext;exports.OxForm=x.OxForm;exports.OxHeading=x.OxHeading;exports.OxIcon=x.OxIcon;exports.OxJsonField=x.OxJsonField;exports.OxLabel=x.OxLabel;exports.OxLegend=x.OxLegend;exports.OxLink=x.OxLink;exports.OxNotifications=x.OxNotifications;exports.OxNumberInput=x.OxNumberInput;exports.OxOtpInput=x.OxOtpInput;exports.OxPagination=x.OxPagination;exports.OxPopover=x.OxPopover;exports.OxProgress=x.OxProgress;exports.OxRadio=x.OxRadio;exports.OxSelect=x.OxSelect;exports.OxSeparator=x.OxSeparator;exports.OxSkeleton=x.OxSkeleton;exports.OxSkeletonText=x.OxSkeletonText;exports.OxSlider=x.OxSlider;exports.OxSpinner=x.OxSpinner;exports.OxStatusDisplay=x.OxStatusDisplay;exports.OxStepper=x.OxStepper;exports.OxSwitch=x.OxSwitch;exports.OxTable=x.OxTable;exports.OxTabs=x.OxTabs;exports.OxTextInput=x.OxTextInput;exports.OxTextarea=x.OxTextarea;exports.OxTimeInput=x.OxTimeInput;exports.OxTimeline=x.OxTimeline;exports.OxToast=x.OxToast;exports.OxToastProvider=x.OxToastProvider;exports.OxToggle=x.OxToggle;exports.OxTooltip=x.OxTooltip;exports.useOxFloatingContext=x.useOxFloatingContext;exports.useOxToast=x.useOxToast;
|
package/dist/onyx.es.js
CHANGED
|
@@ -1,55 +1,57 @@
|
|
|
1
|
-
import { O as x, a as O, b as e, c as
|
|
1
|
+
import { O as x, a as O, b as e, c as t, d as o, e as r, f as i, g as n, K as l, N as p, X as d, h as T, p as g, i as u, j as c, Y as S, L as D, k as b, l as m, M as F, Z as I, m as C, n as k, _ as L, $ as P, o as v, q as w, P as A, Q as B, r as f, s as h, t as N, T as y, U as E, v as H, w as J, x as R, y as U, z as j, A as q, B as z, V as G, C as K, D as M, R as Q, W as V, S as W, E as X, H as Y, F as Z, I as _, J as $, u as aa, G as sa } from "./chunks/ui-DGkJW_Fa.js";
|
|
2
2
|
export {
|
|
3
3
|
x as OxAccordion,
|
|
4
4
|
O as OxAlert,
|
|
5
5
|
e as OxAvatar,
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
t as OxBadge,
|
|
7
|
+
o as OxBreadcrumb,
|
|
8
8
|
r as OxButton,
|
|
9
9
|
i as OxCalendar,
|
|
10
10
|
n as OxCard,
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
l as OxCheckbox,
|
|
12
|
+
p as OxDateInput,
|
|
13
13
|
d as OxDescription,
|
|
14
14
|
T as OxDescriptionList,
|
|
15
|
-
|
|
15
|
+
g as OxDialog,
|
|
16
16
|
u as OxDrawer,
|
|
17
|
-
|
|
17
|
+
c as OxDropdown,
|
|
18
18
|
S as OxError,
|
|
19
19
|
D as OxFileUpload,
|
|
20
20
|
b as OxFloating,
|
|
21
|
-
m as
|
|
21
|
+
m as OxFloatingContext,
|
|
22
|
+
F as OxForm,
|
|
22
23
|
I as OxHeading,
|
|
23
|
-
|
|
24
|
-
|
|
24
|
+
C as OxIcon,
|
|
25
|
+
k as OxJsonField,
|
|
25
26
|
L as OxLabel,
|
|
26
27
|
P as OxLegend,
|
|
27
28
|
v as OxLink,
|
|
28
29
|
w as OxNotifications,
|
|
29
30
|
A as OxNumberInput,
|
|
30
31
|
B as OxOtpInput,
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
32
|
+
f as OxPagination,
|
|
33
|
+
h as OxPopover,
|
|
34
|
+
N as OxProgress,
|
|
35
|
+
y as OxRadio,
|
|
36
|
+
E as OxSelect,
|
|
37
|
+
H as OxSeparator,
|
|
38
|
+
J as OxSkeleton,
|
|
39
|
+
R as OxSkeletonText,
|
|
40
|
+
U as OxSlider,
|
|
41
|
+
j as OxSpinner,
|
|
42
|
+
q as OxStatusDisplay,
|
|
43
|
+
z as OxStepper,
|
|
44
|
+
G as OxSwitch,
|
|
45
|
+
K as OxTable,
|
|
46
|
+
M as OxTabs,
|
|
47
|
+
Q as OxTextInput,
|
|
48
|
+
V as OxTextarea,
|
|
49
|
+
W as OxTimeInput,
|
|
50
|
+
X as OxTimeline,
|
|
51
|
+
Y as OxToast,
|
|
52
|
+
Z as OxToastProvider,
|
|
53
|
+
_ as OxToggle,
|
|
54
|
+
$ as OxTooltip,
|
|
55
|
+
aa as useOxFloatingContext,
|
|
56
|
+
sa as useOxToast
|
|
55
57
|
};
|
package/dist/pages/pages.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("../chunks/ui-DRRDAnVI.js"),s=require("react/jsx-runtime"),H=require("../chunks/hooks-UiKjBucd.js"),X=require("@apollo/client");require("react");const Y=require("../chunks/query-CIsrxNi-.js"),Z=X.gql`
|
|
2
2
|
mutation Login($input: LoginInput!) {
|
|
3
3
|
login(input: $input) {
|
|
4
4
|
success
|
|
@@ -10,4 +10,4 @@
|
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
|
-
`,
|
|
13
|
+
`,ee=$=>{const e=H.compilerRuntimeExports.c(70);let l,o,a,E,v,I,S;e[0]!==$?({cacheQuery:E,className:l,mutation:v,onSubmit:o,subtitle:I,title:S,...a}=$,e[0]=$,e[1]=l,e[2]=o,e[3]=a,e[4]=E,e[5]=v,e[6]=I,e[7]=S):(l=e[1],o=e[2],a=e[3],E=e[4],v=e[5],I=e[6],S=e[7]);const B=E===void 0?Y.DEFAULT_GET_CURRENT_USER:E,M=v===void 0?Z:v,_=I===void 0?"":I,z=S===void 0?"noxickon":S;let q,T;e[8]===Symbol.for("react.memo_cache_sentinel")?(q={username:"",password:""},T={username:["required"],password:["required"]},e[8]=q,e[9]=T):(q=e[8],T=e[9]);let c;e[10]!==B?(c={update:(r,n)=>{const{data:W}=n;W?.login.success&&r.writeQuery({query:B,data:{me:W.login.me}})}},e[10]=B,e[11]=c):c=e[11];let N;e[12]!==M||e[13]!==c?(N={initialData:q,validationRules:T,operation:M,options:c},e[12]=M,e[13]=c,e[14]=N):N=e[14];const t=H.useForm(N);let C;e[15]!==t||e[16]!==o?(C=async r=>{r.preventDefault(),t.submit({onError:n=>{i.handleGraphQLFormErrors(n,t)},onSuccess:n=>{n.data&&n.data.login.success?o?.(n):console.error("Login failed: Invalid credentials")}})},e[15]=t,e[16]=o,e[17]=C):C=e[17];const P=C;let d;e[18]!==l?(d=i.cn("w-80",l),e[18]=l,e[19]=d):d=e[19];let u;e[20]!==z?(u=s.jsx("h1",{className:"px-2 font-mono text-2xl text-gray-1200",children:z}),e[20]=z,e[21]=u):u=e[21];let m;e[22]!==_?(m=_?s.jsx("p",{className:"px-2 py-1 font-mono text-xs",children:_}):null,e[22]=_,e[23]=m):m=e[23];let x;e[24]!==u||e[25]!==m?(x=s.jsxs("div",{className:"mb-4 text-center",children:[u,m]}),e[24]=u,e[25]=m,e[26]=x):x=e[26];let F;e[27]===Symbol.for("react.memo_cache_sentinel")?(F=s.jsx(i.OxLabel,{children:"username"}),e[27]=F):F=e[27];const J=t.isLoading;let p;e[28]!==t?(p=t.hasError("username"),e[28]=t,e[29]=p):p=e[29];let f;e[30]!==t?(f=r=>t.setData("username",r),e[30]=t,e[31]=f):f=e[31];let R,D;e[32]===Symbol.for("react.memo_cache_sentinel")?(R=s.jsx(i.OxTextInput.Icon,{path:"mdiAccount"}),D=s.jsx(i.OxTextInput,{autoComplete:"off",name:"username",placeholder:"Enter your username"}),e[32]=R,e[33]=D):(R=e[32],D=e[33]);let h;e[34]!==t.data.username||e[35]!==t.isLoading||e[36]!==p||e[37]!==f?(h=s.jsxs(i.OxForm.Field,{children:[F,s.jsxs(i.OxTextInput.Container,{disabled:J,error:p,required:!0,value:t.data.username,onChange:f,children:[R,D]})]}),e[34]=t.data.username,e[35]=t.isLoading,e[36]=p,e[37]=f,e[38]=h):h=e[38];let A;e[39]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsx(i.OxLabel,{children:"password"}),e[39]=A):A=e[39];const K=t.isLoading;let g;e[40]!==t?(g=t.hasError("password"),e[40]=t,e[41]=g):g=e[41];let y;e[42]!==t?(y=r=>t.setData("password",r),e[42]=t,e[43]=y):y=e[43];let Q,U,k;e[44]===Symbol.for("react.memo_cache_sentinel")?(Q=s.jsx(i.OxTextInput.Icon,{path:"mdiLockOutline"}),U=s.jsx(i.OxTextInput,{autoComplete:"off",name:"password",placeholder:"Enter your password"}),k=s.jsx(i.OxTextInput.VisibilityButton,{}),e[44]=Q,e[45]=U,e[46]=k):(Q=e[44],U=e[45],k=e[46]);let b;e[47]!==t.data.password||e[48]!==t.isLoading||e[49]!==g||e[50]!==y?(b=s.jsxs(i.OxForm.Field,{children:[A,s.jsxs(i.OxTextInput.Container,{disabled:K,error:g,required:!0,type:"password",value:t.data.password,onChange:y,children:[Q,U,k]})]}),e[47]=t.data.password,e[48]=t.isLoading,e[49]=g,e[50]=y,e[51]=b):b=e[51];let L;e[52]!==t.hasErrors?(L=t.hasErrors?s.jsx(i.OxError,{icon:"mdiAlertCircleOutline",children:"username or password is wrong"}):null,e[52]=t.hasErrors,e[53]=L):L=e[53];const V=t.isLoading?"Signing in...":"Sign In";let j;e[54]!==t.isLoading||e[55]!==V?(j=s.jsx(i.OxButton,{disabled:t.isLoading,fullWidth:!0,isLoading:t.isLoading,size:"sm",type:"submit",variant:"primary",children:V}),e[54]=t.isLoading,e[55]=V,e[56]=j):j=e[56];let O;e[57]!==P||e[58]!==h||e[59]!==b||e[60]!==L||e[61]!==j?(O=s.jsxs(i.OxForm,{className:"space-y-6",onSubmit:P,children:[h,b,L,j]}),e[57]=P,e[58]=h,e[59]=b,e[60]=L,e[61]=j,e[62]=O):O=e[62];let w;e[63]!==x||e[64]!==O?(w=s.jsxs("div",{className:"ox-gray-border rounded-lg bg-gray-50 p-6",children:[x,O]}),e[63]=x,e[64]=O,e[65]=w):w=e[65];let G;return e[66]!==a||e[67]!==d||e[68]!==w?(G=s.jsx("div",{className:d,...a,children:w}),e[66]=a,e[67]=d,e[68]=w,e[69]=G):G=e[69],G};exports.OxLogin=ee;
|
package/dist/pages/pages.es.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { jsx as
|
|
3
|
-
import {
|
|
1
|
+
import { a0 as Z, R as r, M as H, Y as ee, e as te, a1 as se, _ as K } from "../chunks/ui-DGkJW_Fa.js";
|
|
2
|
+
import { jsx as s, jsxs as o } from "react/jsx-runtime";
|
|
3
|
+
import { d as ie, q as ae } from "../chunks/hooks-CUNBk2tZ.js";
|
|
4
|
+
import { gql as re } from "@apollo/client";
|
|
4
5
|
import "react";
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
const O = w`
|
|
6
|
+
import { D as oe } from "../chunks/query-D2S9cFBP.js";
|
|
7
|
+
const le = re`
|
|
8
8
|
mutation Login($input: LoginInput!) {
|
|
9
9
|
login(input: $input) {
|
|
10
10
|
success
|
|
@@ -16,101 +16,127 @@ const O = w`
|
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
|
-
`,
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
19
|
+
`, pe = (B) => {
|
|
20
|
+
const e = ie.c(70);
|
|
21
|
+
let l, n, d, S, N, O, C;
|
|
22
|
+
e[0] !== B ? ({
|
|
23
|
+
cacheQuery: S,
|
|
24
|
+
className: l,
|
|
25
|
+
mutation: N,
|
|
26
|
+
onSubmit: n,
|
|
27
|
+
subtitle: O,
|
|
28
|
+
title: C,
|
|
29
|
+
...d
|
|
30
|
+
} = B, e[0] = B, e[1] = l, e[2] = n, e[3] = d, e[4] = S, e[5] = N, e[6] = O, e[7] = C) : (l = e[1], n = e[2], d = e[3], S = e[4], N = e[5], O = e[6], C = e[7]);
|
|
31
|
+
const M = S === void 0 ? oe : S, z = N === void 0 ? le : N, I = O === void 0 ? "" : O, V = C === void 0 ? "noxickon" : C;
|
|
32
|
+
let q, D;
|
|
33
|
+
e[8] === Symbol.for("react.memo_cache_sentinel") ? (q = {
|
|
34
|
+
username: "",
|
|
35
|
+
password: ""
|
|
36
|
+
}, D = {
|
|
37
|
+
username: ["required"],
|
|
38
|
+
password: ["required"]
|
|
39
|
+
}, e[8] = q, e[9] = D) : (q = e[8], D = e[9]);
|
|
40
|
+
let c;
|
|
41
|
+
e[10] !== M ? (c = {
|
|
42
|
+
update: (i, a) => {
|
|
43
|
+
const {
|
|
44
|
+
data: J
|
|
45
|
+
} = a;
|
|
46
|
+
J?.login.success && i.writeQuery({
|
|
47
|
+
query: M,
|
|
48
|
+
data: {
|
|
49
|
+
me: J.login.me
|
|
50
|
+
}
|
|
51
|
+
});
|
|
45
52
|
}
|
|
46
|
-
}
|
|
47
|
-
|
|
53
|
+
}, e[10] = M, e[11] = c) : c = e[11];
|
|
54
|
+
let F;
|
|
55
|
+
e[12] !== z || e[13] !== c ? (F = {
|
|
56
|
+
initialData: q,
|
|
57
|
+
validationRules: D,
|
|
58
|
+
operation: z,
|
|
59
|
+
options: c
|
|
60
|
+
}, e[12] = z, e[13] = c, e[14] = F) : F = e[14];
|
|
61
|
+
const t = ae(F);
|
|
62
|
+
let R;
|
|
63
|
+
e[15] !== t || e[16] !== n ? (R = async (i) => {
|
|
64
|
+
i.preventDefault(), t.submit({
|
|
48
65
|
onError: (a) => {
|
|
49
|
-
|
|
66
|
+
se(a, t);
|
|
50
67
|
},
|
|
51
68
|
onSuccess: (a) => {
|
|
52
|
-
a.data && a.data.login.success ?
|
|
69
|
+
a.data && a.data.login.success ? n?.(a) : console.error("Login failed: Invalid credentials");
|
|
53
70
|
}
|
|
54
71
|
});
|
|
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
|
-
disabled: e.isLoading,
|
|
103
|
-
fullWidth: !0,
|
|
104
|
-
isLoading: e.isLoading,
|
|
105
|
-
size: "sm",
|
|
106
|
-
type: "submit",
|
|
107
|
-
variant: "primary",
|
|
108
|
-
children: e.isLoading ? "Signing in..." : "Sign In"
|
|
109
|
-
}
|
|
110
|
-
)
|
|
72
|
+
}, e[15] = t, e[16] = n, e[17] = R) : R = e[17];
|
|
73
|
+
const W = R;
|
|
74
|
+
let m;
|
|
75
|
+
e[18] !== l ? (m = Z("w-80", l), e[18] = l, e[19] = m) : m = e[19];
|
|
76
|
+
let u;
|
|
77
|
+
e[20] !== V ? (u = /* @__PURE__ */ s("h1", { className: "px-2 font-mono text-2xl text-gray-1200", children: V }), e[20] = V, e[21] = u) : u = e[21];
|
|
78
|
+
let f;
|
|
79
|
+
e[22] !== I ? (f = I ? /* @__PURE__ */ s("p", { className: "px-2 py-1 font-mono text-xs", children: I }) : null, e[22] = I, e[23] = f) : f = e[23];
|
|
80
|
+
let p;
|
|
81
|
+
e[24] !== u || e[25] !== f ? (p = /* @__PURE__ */ o("div", { className: "mb-4 text-center", children: [
|
|
82
|
+
u,
|
|
83
|
+
f
|
|
84
|
+
] }), e[24] = u, e[25] = f, e[26] = p) : p = e[26];
|
|
85
|
+
let T;
|
|
86
|
+
e[27] === Symbol.for("react.memo_cache_sentinel") ? (T = /* @__PURE__ */ s(K, { children: "username" }), e[27] = T) : T = e[27];
|
|
87
|
+
const P = t.isLoading;
|
|
88
|
+
let h;
|
|
89
|
+
e[28] !== t ? (h = t.hasError("username"), e[28] = t, e[29] = h) : h = e[29];
|
|
90
|
+
let g;
|
|
91
|
+
e[30] !== t ? (g = (i) => t.setData("username", i), e[30] = t, e[31] = g) : g = e[31];
|
|
92
|
+
let A, Q;
|
|
93
|
+
e[32] === Symbol.for("react.memo_cache_sentinel") ? (A = /* @__PURE__ */ s(r.Icon, { path: "mdiAccount" }), Q = /* @__PURE__ */ s(r, { autoComplete: "off", name: "username", placeholder: "Enter your username" }), e[32] = A, e[33] = Q) : (A = e[32], Q = e[33]);
|
|
94
|
+
let x;
|
|
95
|
+
e[34] !== t.data.username || e[35] !== t.isLoading || e[36] !== h || e[37] !== g ? (x = /* @__PURE__ */ o(H.Field, { children: [
|
|
96
|
+
T,
|
|
97
|
+
/* @__PURE__ */ o(r.Container, { disabled: P, error: h, required: !0, value: t.data.username, onChange: g, children: [
|
|
98
|
+
A,
|
|
99
|
+
Q
|
|
100
|
+
] })
|
|
101
|
+
] }), e[34] = t.data.username, e[35] = t.isLoading, e[36] = h, e[37] = g, e[38] = x) : x = e[38];
|
|
102
|
+
let U;
|
|
103
|
+
e[39] === Symbol.for("react.memo_cache_sentinel") ? (U = /* @__PURE__ */ s(K, { children: "password" }), e[39] = U) : U = e[39];
|
|
104
|
+
const X = t.isLoading;
|
|
105
|
+
let y;
|
|
106
|
+
e[40] !== t ? (y = t.hasError("password"), e[40] = t, e[41] = y) : y = e[41];
|
|
107
|
+
let L;
|
|
108
|
+
e[42] !== t ? (L = (i) => t.setData("password", i), e[42] = t, e[43] = L) : L = e[43];
|
|
109
|
+
let G, $, j;
|
|
110
|
+
e[44] === Symbol.for("react.memo_cache_sentinel") ? (G = /* @__PURE__ */ s(r.Icon, { path: "mdiLockOutline" }), $ = /* @__PURE__ */ s(r, { autoComplete: "off", name: "password", placeholder: "Enter your password" }), j = /* @__PURE__ */ s(r.VisibilityButton, {}), e[44] = G, e[45] = $, e[46] = j) : (G = e[44], $ = e[45], j = e[46]);
|
|
111
|
+
let b;
|
|
112
|
+
e[47] !== t.data.password || e[48] !== t.isLoading || e[49] !== y || e[50] !== L ? (b = /* @__PURE__ */ o(H.Field, { children: [
|
|
113
|
+
U,
|
|
114
|
+
/* @__PURE__ */ o(r.Container, { disabled: X, error: y, required: !0, type: "password", value: t.data.password, onChange: L, children: [
|
|
115
|
+
G,
|
|
116
|
+
$,
|
|
117
|
+
j
|
|
111
118
|
] })
|
|
112
|
-
] })
|
|
119
|
+
] }), e[47] = t.data.password, e[48] = t.isLoading, e[49] = y, e[50] = L, e[51] = b) : b = e[51];
|
|
120
|
+
let w;
|
|
121
|
+
e[52] !== t.hasErrors ? (w = t.hasErrors ? /* @__PURE__ */ s(ee, { icon: "mdiAlertCircleOutline", children: "username or password is wrong" }) : null, e[52] = t.hasErrors, e[53] = w) : w = e[53];
|
|
122
|
+
const Y = t.isLoading ? "Signing in..." : "Sign In";
|
|
123
|
+
let E;
|
|
124
|
+
e[54] !== t.isLoading || e[55] !== Y ? (E = /* @__PURE__ */ s(te, { disabled: t.isLoading, fullWidth: !0, isLoading: t.isLoading, size: "sm", type: "submit", variant: "primary", children: Y }), e[54] = t.isLoading, e[55] = Y, e[56] = E) : E = e[56];
|
|
125
|
+
let _;
|
|
126
|
+
e[57] !== W || e[58] !== x || e[59] !== b || e[60] !== w || e[61] !== E ? (_ = /* @__PURE__ */ o(H, { className: "space-y-6", onSubmit: W, children: [
|
|
127
|
+
x,
|
|
128
|
+
b,
|
|
129
|
+
w,
|
|
130
|
+
E
|
|
131
|
+
] }), e[57] = W, e[58] = x, e[59] = b, e[60] = w, e[61] = E, e[62] = _) : _ = e[62];
|
|
132
|
+
let v;
|
|
133
|
+
e[63] !== p || e[64] !== _ ? (v = /* @__PURE__ */ o("div", { className: "ox-gray-border rounded-lg bg-gray-50 p-6", children: [
|
|
134
|
+
p,
|
|
135
|
+
_
|
|
136
|
+
] }), e[63] = p, e[64] = _, e[65] = v) : v = e[65];
|
|
137
|
+
let k;
|
|
138
|
+
return e[66] !== d || e[67] !== m || e[68] !== v ? (k = /* @__PURE__ */ s("div", { className: m, ...d, children: v }), e[66] = d, e[67] = m, e[68] = v, e[69] = k) : k = e[69], k;
|
|
113
139
|
};
|
|
114
140
|
export {
|
|
115
|
-
|
|
141
|
+
pe as OxLogin
|
|
116
142
|
};
|
package/dist/pages.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import { ComponentPropsWithRef } from 'react';
|
|
1
2
|
import { DocumentNode } from 'graphql';
|
|
2
|
-
import { HTMLAttributes } from 'react';
|
|
3
3
|
import { JSX } from 'react/jsx-runtime';
|
|
4
4
|
|
|
5
5
|
export declare const OxLogin: ({ cacheQuery, className, mutation, onSubmit, subtitle, title, ...props }: OxLoginProps) => JSX.Element;
|
|
6
6
|
|
|
7
|
-
export declare interface OxLoginProps extends
|
|
7
|
+
export declare interface OxLoginProps extends ComponentPropsWithRef<'div'> {
|
|
8
8
|
cacheQuery?: DocumentNode;
|
|
9
9
|
mutation?: DocumentNode;
|
|
10
10
|
onSubmit: (response: unknown) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../chunks/ui-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../chunks/ui-DRRDAnVI.js");const d=require("../chunks/useAuth-DxoDe3YA.js"),a=require("../chunks/hooks-UiKjBucd.js"),g=u=>{const{children:i,onAuthenticated:n,onLoading:t}=u,o=n===void 0?null:n,r=t===void 0?null:t,{isLoggedIn:s,loading:e}=d.useOxAuth();return e?r:s?o:i},h=u=>{const{children:i,onLoading:n,onUnauthenticated:t}=u,o=n===void 0?null:n,r=t===void 0?null:t,{isLoggedIn:s,loading:e}=d.useOxAuth();return e?o:s?i:r},O=u=>{const{children:i,onLoading:n,onUnauthorized:t,roles:o}=u,r=n===void 0?null:n,s=t===void 0?null:t,e=o===void 0?["admin"]:o,{loading:l,user:c}=d.useOxAuth();return l?r:!c||a.isEmpty(e)||!e.includes(c.role)?s:i};exports.OxGuestRoute=g;exports.OxProtectedRoute=h;exports.OxRoleRoute=O;
|