@riligar/auth-react 1.11.0 → 1.12.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/index.esm.js +184 -55
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +183 -54
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -942,8 +942,68 @@ function AuthCard({
|
|
|
942
942
|
logo,
|
|
943
943
|
logoHeight = 28,
|
|
944
944
|
width = 350,
|
|
945
|
+
// Variant props
|
|
946
|
+
variant = 'card',
|
|
947
|
+
opened,
|
|
948
|
+
onClose,
|
|
949
|
+
modalProps = {},
|
|
945
950
|
...props
|
|
946
951
|
}) {
|
|
952
|
+
// Conteúdo interno compartilhado entre Card e Modal
|
|
953
|
+
const content = /*#__PURE__*/jsxRuntime.jsxs(core.Stack, {
|
|
954
|
+
gap: "sm",
|
|
955
|
+
children: [(logo || title || subtitle) && /*#__PURE__*/jsxRuntime.jsxs(core.Stack, {
|
|
956
|
+
gap: "xs",
|
|
957
|
+
children: [logo && /*#__PURE__*/jsxRuntime.jsx(core.Image, {
|
|
958
|
+
src: logo,
|
|
959
|
+
alt: "Auth",
|
|
960
|
+
h: logoHeight,
|
|
961
|
+
fit: "contain"
|
|
962
|
+
}), title && /*#__PURE__*/jsxRuntime.jsx(core.Title, {
|
|
963
|
+
order: 3,
|
|
964
|
+
children: title
|
|
965
|
+
}), subtitle && /*#__PURE__*/jsxRuntime.jsx(core.Text, {
|
|
966
|
+
size: "sm",
|
|
967
|
+
c: "dimmed",
|
|
968
|
+
children: subtitle
|
|
969
|
+
})]
|
|
970
|
+
}), children]
|
|
971
|
+
});
|
|
972
|
+
|
|
973
|
+
// Renderizar como Modal
|
|
974
|
+
if (variant === 'modal') {
|
|
975
|
+
return /*#__PURE__*/jsxRuntime.jsx(core.Modal, {
|
|
976
|
+
opened: opened,
|
|
977
|
+
onClose: onClose,
|
|
978
|
+
size: width + 50,
|
|
979
|
+
withCloseButton: true,
|
|
980
|
+
radius: "md",
|
|
981
|
+
overlayProps: {
|
|
982
|
+
backgroundOpacity: 0.55,
|
|
983
|
+
blur: 3
|
|
984
|
+
},
|
|
985
|
+
title: logo ? /*#__PURE__*/jsxRuntime.jsx(core.Image, {
|
|
986
|
+
src: logo,
|
|
987
|
+
alt: "Auth",
|
|
988
|
+
h: logoHeight,
|
|
989
|
+
fit: "contain"
|
|
990
|
+
}) : title ? /*#__PURE__*/jsxRuntime.jsx(core.Title, {
|
|
991
|
+
order: 4,
|
|
992
|
+
children: title
|
|
993
|
+
}) : null,
|
|
994
|
+
...modalProps,
|
|
995
|
+
children: /*#__PURE__*/jsxRuntime.jsxs(core.Stack, {
|
|
996
|
+
gap: "sm",
|
|
997
|
+
children: [subtitle && /*#__PURE__*/jsxRuntime.jsx(core.Text, {
|
|
998
|
+
size: "sm",
|
|
999
|
+
c: "dimmed",
|
|
1000
|
+
children: subtitle
|
|
1001
|
+
}), children]
|
|
1002
|
+
})
|
|
1003
|
+
});
|
|
1004
|
+
}
|
|
1005
|
+
|
|
1006
|
+
// Renderizar como Card (default)
|
|
947
1007
|
return /*#__PURE__*/jsxRuntime.jsx(core.Paper, {
|
|
948
1008
|
withBorder: true,
|
|
949
1009
|
shadow: "md",
|
|
@@ -951,25 +1011,7 @@ function AuthCard({
|
|
|
951
1011
|
w: width,
|
|
952
1012
|
radius: "md",
|
|
953
1013
|
...props,
|
|
954
|
-
children:
|
|
955
|
-
gap: "sm",
|
|
956
|
-
children: [(logo || title || subtitle) && /*#__PURE__*/jsxRuntime.jsxs(core.Stack, {
|
|
957
|
-
gap: "xs",
|
|
958
|
-
children: [logo && /*#__PURE__*/jsxRuntime.jsx(core.Image, {
|
|
959
|
-
src: logo,
|
|
960
|
-
alt: "Auth",
|
|
961
|
-
h: logoHeight,
|
|
962
|
-
fit: "contain"
|
|
963
|
-
}), title && /*#__PURE__*/jsxRuntime.jsx(core.Title, {
|
|
964
|
-
order: 3,
|
|
965
|
-
children: title
|
|
966
|
-
}), subtitle && /*#__PURE__*/jsxRuntime.jsx(core.Text, {
|
|
967
|
-
size: "sm",
|
|
968
|
-
c: "dimmed",
|
|
969
|
-
children: subtitle
|
|
970
|
-
})]
|
|
971
|
-
}), children]
|
|
972
|
-
})
|
|
1014
|
+
children: content
|
|
973
1015
|
});
|
|
974
1016
|
}
|
|
975
1017
|
|
|
@@ -981,6 +1023,11 @@ function SignIn({
|
|
|
981
1023
|
// Removido default, será calculado abaixo
|
|
982
1024
|
title = 'Entrar',
|
|
983
1025
|
subtitle = 'Acesse sua conta para continuar',
|
|
1026
|
+
// Variant
|
|
1027
|
+
variant = 'card',
|
|
1028
|
+
opened,
|
|
1029
|
+
onClose,
|
|
1030
|
+
modalProps = {},
|
|
984
1031
|
// Features
|
|
985
1032
|
showMagicLink = true,
|
|
986
1033
|
showForgotPassword = true,
|
|
@@ -1055,6 +1102,10 @@ function SignIn({
|
|
|
1055
1102
|
logo: finalLogo,
|
|
1056
1103
|
title: title,
|
|
1057
1104
|
subtitle: subtitle,
|
|
1105
|
+
variant: variant,
|
|
1106
|
+
opened: opened,
|
|
1107
|
+
onClose: onClose,
|
|
1108
|
+
modalProps: modalProps,
|
|
1058
1109
|
...cardProps,
|
|
1059
1110
|
children: [/*#__PURE__*/jsxRuntime.jsx("form", {
|
|
1060
1111
|
onSubmit: form$1.onSubmit(handleSubmit),
|
|
@@ -1148,6 +1199,11 @@ function SignUp({
|
|
|
1148
1199
|
logo,
|
|
1149
1200
|
title = 'Criar Conta',
|
|
1150
1201
|
subtitle = 'Preencha os dados para se cadastrar',
|
|
1202
|
+
// Variant
|
|
1203
|
+
variant = 'card',
|
|
1204
|
+
opened,
|
|
1205
|
+
onClose,
|
|
1206
|
+
modalProps = {},
|
|
1151
1207
|
// Features
|
|
1152
1208
|
requireName = true,
|
|
1153
1209
|
showSignInLink = true,
|
|
@@ -1194,6 +1250,10 @@ function SignUp({
|
|
|
1194
1250
|
logo: finalLogo,
|
|
1195
1251
|
title: title,
|
|
1196
1252
|
subtitle: subtitle,
|
|
1253
|
+
variant: variant,
|
|
1254
|
+
opened: opened,
|
|
1255
|
+
onClose: onClose,
|
|
1256
|
+
modalProps: modalProps,
|
|
1197
1257
|
...cardProps,
|
|
1198
1258
|
children: [/*#__PURE__*/jsxRuntime.jsx("form", {
|
|
1199
1259
|
onSubmit: form$1.onSubmit(handleSubmit),
|
|
@@ -1282,6 +1342,11 @@ function MagicLink({
|
|
|
1282
1342
|
logo,
|
|
1283
1343
|
title = 'Login sem Senha',
|
|
1284
1344
|
subtitle = 'Receba um link de acesso no seu email',
|
|
1345
|
+
// Variant
|
|
1346
|
+
variant = 'card',
|
|
1347
|
+
opened,
|
|
1348
|
+
onClose,
|
|
1349
|
+
modalProps = {},
|
|
1285
1350
|
// Features
|
|
1286
1351
|
showSignInLink = true,
|
|
1287
1352
|
// Links
|
|
@@ -1319,6 +1384,10 @@ function MagicLink({
|
|
|
1319
1384
|
logo: finalLogo,
|
|
1320
1385
|
title: title,
|
|
1321
1386
|
subtitle: subtitle,
|
|
1387
|
+
variant: variant,
|
|
1388
|
+
opened: opened,
|
|
1389
|
+
onClose: onClose,
|
|
1390
|
+
modalProps: modalProps,
|
|
1322
1391
|
...cardProps,
|
|
1323
1392
|
children: [/*#__PURE__*/jsxRuntime.jsx("form", {
|
|
1324
1393
|
onSubmit: form$1.onSubmit(handleSubmit),
|
|
@@ -1470,6 +1539,11 @@ function ForgotPassword({
|
|
|
1470
1539
|
logo,
|
|
1471
1540
|
title = 'Recuperar Senha',
|
|
1472
1541
|
subtitle = 'Enviaremos um link para redefinir sua senha',
|
|
1542
|
+
// Variant
|
|
1543
|
+
variant = 'card',
|
|
1544
|
+
opened,
|
|
1545
|
+
onClose,
|
|
1546
|
+
modalProps = {},
|
|
1473
1547
|
// Features
|
|
1474
1548
|
showSignInLink = true,
|
|
1475
1549
|
// Links
|
|
@@ -1507,6 +1581,10 @@ function ForgotPassword({
|
|
|
1507
1581
|
logo: finalLogo,
|
|
1508
1582
|
title: title,
|
|
1509
1583
|
subtitle: subtitle,
|
|
1584
|
+
variant: variant,
|
|
1585
|
+
opened: opened,
|
|
1586
|
+
onClose: onClose,
|
|
1587
|
+
modalProps: modalProps,
|
|
1510
1588
|
...cardProps,
|
|
1511
1589
|
children: [/*#__PURE__*/jsxRuntime.jsx("form", {
|
|
1512
1590
|
onSubmit: form$1.onSubmit(handleSubmit),
|
|
@@ -1847,7 +1925,8 @@ function VerifyEmail({
|
|
|
1847
1925
|
}
|
|
1848
1926
|
|
|
1849
1927
|
function UserProfile({
|
|
1850
|
-
//
|
|
1928
|
+
// Variant
|
|
1929
|
+
variant = 'modal',
|
|
1851
1930
|
opened,
|
|
1852
1931
|
onClose,
|
|
1853
1932
|
// Callbacks
|
|
@@ -1864,11 +1943,14 @@ function UserProfile({
|
|
|
1864
1943
|
labels = {},
|
|
1865
1944
|
title = 'Account',
|
|
1866
1945
|
subtitle = 'Manage your account info.',
|
|
1946
|
+
logo,
|
|
1947
|
+
logoHeight = 28,
|
|
1948
|
+
width = 500,
|
|
1867
1949
|
// Avatar config
|
|
1868
1950
|
maxAvatarSize = 500 * 1024,
|
|
1869
1951
|
// 500KB
|
|
1870
1952
|
|
|
1871
|
-
...
|
|
1953
|
+
...containerProps
|
|
1872
1954
|
}) {
|
|
1873
1955
|
// Local state - which section is expanded
|
|
1874
1956
|
const [editingSection, setEditingSection] = react.useState(null); // 'password' | 'email' | 'name' | 'avatar' | null
|
|
@@ -2182,39 +2264,10 @@ function UserProfile({
|
|
|
2182
2264
|
})]
|
|
2183
2265
|
})
|
|
2184
2266
|
});
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
withCloseButton: true,
|
|
2190
|
-
radius: "lg",
|
|
2191
|
-
overlayProps: {
|
|
2192
|
-
backgroundOpacity: 0.55,
|
|
2193
|
-
blur: 3
|
|
2194
|
-
},
|
|
2195
|
-
title: /*#__PURE__*/jsxRuntime.jsxs(core.Group, {
|
|
2196
|
-
gap: "md",
|
|
2197
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(core.ThemeIcon, {
|
|
2198
|
-
size: 44,
|
|
2199
|
-
variant: "light",
|
|
2200
|
-
children: /*#__PURE__*/jsxRuntime.jsx(iconsReact.IconUserCircle, {
|
|
2201
|
-
size: 24
|
|
2202
|
-
})
|
|
2203
|
-
}), /*#__PURE__*/jsxRuntime.jsxs(core.Box, {
|
|
2204
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(core.Title, {
|
|
2205
|
-
order: 4,
|
|
2206
|
-
children: title
|
|
2207
|
-
}), /*#__PURE__*/jsxRuntime.jsx(core.Text, {
|
|
2208
|
-
size: "sm",
|
|
2209
|
-
c: "dimmed",
|
|
2210
|
-
children: subtitle
|
|
2211
|
-
})]
|
|
2212
|
-
})]
|
|
2213
|
-
}),
|
|
2214
|
-
...modalProps,
|
|
2215
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(core.Divider, {
|
|
2216
|
-
mb: "md"
|
|
2217
|
-
}), (showAvatar || showName || showEmail) && /*#__PURE__*/jsxRuntime.jsxs(core.Box, {
|
|
2267
|
+
|
|
2268
|
+
// Conteúdo interno compartilhado
|
|
2269
|
+
const profileContent = /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
2270
|
+
children: [(showAvatar || showName || showEmail) && /*#__PURE__*/jsxRuntime.jsxs(core.Box, {
|
|
2218
2271
|
mb: "xl",
|
|
2219
2272
|
children: [/*#__PURE__*/jsxRuntime.jsx(SectionHeader, {
|
|
2220
2273
|
icon: iconsReact.IconUser,
|
|
@@ -2519,6 +2572,82 @@ function UserProfile({
|
|
|
2519
2572
|
})]
|
|
2520
2573
|
})]
|
|
2521
2574
|
});
|
|
2575
|
+
|
|
2576
|
+
// Renderizar como Modal
|
|
2577
|
+
if (variant === 'modal') {
|
|
2578
|
+
return /*#__PURE__*/jsxRuntime.jsxs(core.Modal, {
|
|
2579
|
+
opened: opened,
|
|
2580
|
+
onClose: onClose,
|
|
2581
|
+
size: width + 50,
|
|
2582
|
+
withCloseButton: true,
|
|
2583
|
+
radius: "md",
|
|
2584
|
+
overlayProps: {
|
|
2585
|
+
backgroundOpacity: 0.55,
|
|
2586
|
+
blur: 3
|
|
2587
|
+
},
|
|
2588
|
+
title: /*#__PURE__*/jsxRuntime.jsxs(core.Group, {
|
|
2589
|
+
gap: "md",
|
|
2590
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(core.ThemeIcon, {
|
|
2591
|
+
size: 44,
|
|
2592
|
+
variant: "light",
|
|
2593
|
+
children: /*#__PURE__*/jsxRuntime.jsx(iconsReact.IconUserCircle, {
|
|
2594
|
+
size: 24
|
|
2595
|
+
})
|
|
2596
|
+
}), /*#__PURE__*/jsxRuntime.jsxs(core.Box, {
|
|
2597
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(core.Title, {
|
|
2598
|
+
order: 4,
|
|
2599
|
+
children: title
|
|
2600
|
+
}), /*#__PURE__*/jsxRuntime.jsx(core.Text, {
|
|
2601
|
+
size: "sm",
|
|
2602
|
+
c: "dimmed",
|
|
2603
|
+
children: subtitle
|
|
2604
|
+
})]
|
|
2605
|
+
})]
|
|
2606
|
+
}),
|
|
2607
|
+
...containerProps,
|
|
2608
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(core.Divider, {
|
|
2609
|
+
mb: "md"
|
|
2610
|
+
}), profileContent]
|
|
2611
|
+
});
|
|
2612
|
+
}
|
|
2613
|
+
|
|
2614
|
+
// Renderizar como Card
|
|
2615
|
+
return /*#__PURE__*/jsxRuntime.jsx(core.Paper, {
|
|
2616
|
+
withBorder: true
|
|
2617
|
+
// shadow="md"
|
|
2618
|
+
,
|
|
2619
|
+
p: "md",
|
|
2620
|
+
w: width,
|
|
2621
|
+
radius: "md",
|
|
2622
|
+
...containerProps,
|
|
2623
|
+
children: /*#__PURE__*/jsxRuntime.jsxs(core.Stack, {
|
|
2624
|
+
gap: "sm",
|
|
2625
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs(core.Group, {
|
|
2626
|
+
gap: "md",
|
|
2627
|
+
children: [logo ? /*#__PURE__*/jsxRuntime.jsx(core.Image, {
|
|
2628
|
+
src: logo,
|
|
2629
|
+
alt: "Auth",
|
|
2630
|
+
h: logoHeight,
|
|
2631
|
+
fit: "contain"
|
|
2632
|
+
}) : /*#__PURE__*/jsxRuntime.jsx(core.ThemeIcon, {
|
|
2633
|
+
size: 44,
|
|
2634
|
+
variant: "light",
|
|
2635
|
+
children: /*#__PURE__*/jsxRuntime.jsx(iconsReact.IconUserCircle, {
|
|
2636
|
+
size: 24
|
|
2637
|
+
})
|
|
2638
|
+
}), /*#__PURE__*/jsxRuntime.jsxs(core.Box, {
|
|
2639
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(core.Title, {
|
|
2640
|
+
order: 4,
|
|
2641
|
+
children: title
|
|
2642
|
+
}), /*#__PURE__*/jsxRuntime.jsx(core.Text, {
|
|
2643
|
+
size: "sm",
|
|
2644
|
+
c: "dimmed",
|
|
2645
|
+
children: subtitle
|
|
2646
|
+
})]
|
|
2647
|
+
})]
|
|
2648
|
+
}), /*#__PURE__*/jsxRuntime.jsx(core.Divider, {}), profileContent]
|
|
2649
|
+
})
|
|
2650
|
+
});
|
|
2522
2651
|
}
|
|
2523
2652
|
|
|
2524
2653
|
/**
|