@mantine/core 7.0.0-beta.4 → 7.0.0-beta.5
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/cjs/components/AppShell/AppShellFooter/AppShellFooter.js +9 -1
- package/cjs/components/AppShell/AppShellFooter/AppShellFooter.js.map +1 -1
- package/cjs/components/AppShell/AppShellHeader/AppShellHeader.js +9 -1
- package/cjs/components/AppShell/AppShellHeader/AppShellHeader.js.map +1 -1
- package/cjs/components/Container/Container.js +3 -1
- package/cjs/components/Container/Container.js.map +1 -1
- package/cjs/components/Input/InputWrapper/InputWrapper.js +1 -1
- package/cjs/components/Input/InputWrapper/InputWrapper.js.map +1 -1
- package/cjs/components/PasswordInput/PasswordInput.js +2 -1
- package/cjs/components/PasswordInput/PasswordInput.js.map +1 -1
- package/cjs/core/Box/style-props/resolvers/color-resolver/color-resolver.js +3 -0
- package/cjs/core/Box/style-props/resolvers/color-resolver/color-resolver.js.map +1 -1
- package/cjs/core/MantineProvider/MantineCssVariables/default-css-variables-resolver.js +5 -3
- package/cjs/core/MantineProvider/MantineCssVariables/default-css-variables-resolver.js.map +1 -1
- package/cjs/index.css +63 -51
- package/esm/components/AppShell/AppShellFooter/AppShellFooter.js +8 -1
- package/esm/components/AppShell/AppShellFooter/AppShellFooter.js.map +1 -1
- package/esm/components/AppShell/AppShellHeader/AppShellHeader.js +8 -1
- package/esm/components/AppShell/AppShellHeader/AppShellHeader.js.map +1 -1
- package/esm/components/Container/Container.js +3 -1
- package/esm/components/Container/Container.js.map +1 -1
- package/esm/components/Input/InputWrapper/InputWrapper.js +1 -1
- package/esm/components/Input/InputWrapper/InputWrapper.js.map +1 -1
- package/esm/components/PasswordInput/PasswordInput.js +2 -1
- package/esm/components/PasswordInput/PasswordInput.js.map +1 -1
- package/esm/core/Box/style-props/resolvers/color-resolver/color-resolver.js +3 -0
- package/esm/core/Box/style-props/resolvers/color-resolver/color-resolver.js.map +1 -1
- package/esm/core/MantineProvider/MantineCssVariables/default-css-variables-resolver.js +5 -3
- package/esm/core/MantineProvider/MantineCssVariables/default-css-variables-resolver.js.map +1 -1
- package/esm/index.css +63 -51
- package/esm/styles/Badge.css +1 -1
- package/esm/styles/Checkbox.css +1 -1
- package/esm/styles/Image.css +1 -1
- package/esm/styles/Input.css +1 -1
- package/esm/styles/PasswordInput.css +1 -1
- package/esm/styles/Radio.css +1 -1
- package/esm/styles/Rating.css +1 -1
- package/esm/styles/global.css +1 -1
- package/lib/components/Input/use-input-props.d.ts +3 -3
- package/lib/components/Paper/Paper.d.ts +1 -1
- package/lib/core/MantineProvider/use-mantine-color-scheme/use-computed-color-scheme.d.ts +1 -1
- package/package.json +2 -2
package/cjs/index.css
CHANGED
|
@@ -81,11 +81,6 @@ body {
|
|
|
81
81
|
--mantine-moz-font-smoothing: grayscale;
|
|
82
82
|
--mantine-color-white: #fff;
|
|
83
83
|
--mantine-color-black: #000;
|
|
84
|
-
--mantine-primary-color-filled: var(--mantine-color-blue-filled);
|
|
85
|
-
--mantine-primary-color-filled-hover: var(--mantine-color-blue-filled-hover);
|
|
86
|
-
--mantine-primary-color-light: var(--mantine-color-blue-light);
|
|
87
|
-
--mantine-primary-color-light-hover: var(--mantine-color-blue-light-hover);
|
|
88
|
-
--mantine-primary-color-light-color: var(--mantine-color-blue-light-color);
|
|
89
84
|
--mantine-line-height: 1.55;
|
|
90
85
|
--mantine-font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial,
|
|
91
86
|
sans-serif, Apple Color Emoji, Segoe UI Emoji;
|
|
@@ -95,6 +90,11 @@ body {
|
|
|
95
90
|
Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji;
|
|
96
91
|
--mantine-heading-font-weight: 700;
|
|
97
92
|
--mantine-radius-default: calc(0.25rem * var(--mantine-scale));
|
|
93
|
+
--mantine-primary-color-filled: var(--mantine-color-blue-filled);
|
|
94
|
+
--mantine-primary-color-filled-hover: var(--mantine-color-blue-filled-hover);
|
|
95
|
+
--mantine-primary-color-light: var(--mantine-color-blue-light);
|
|
96
|
+
--mantine-primary-color-light-hover: var(--mantine-color-blue-light-hover);
|
|
97
|
+
--mantine-primary-color-light-color: var(--mantine-color-blue-light-color);
|
|
98
98
|
--mantine-breakpoint-xs: 36em;
|
|
99
99
|
--mantine-breakpoint-sm: 48em;
|
|
100
100
|
--mantine-breakpoint-md: 62em;
|
|
@@ -310,6 +310,7 @@ body {
|
|
|
310
310
|
|
|
311
311
|
:root[data-mantine-color-scheme='dark'] {
|
|
312
312
|
--mantine-color-scheme: dark;
|
|
313
|
+
--mantine-color-bright: var(--mantine-color-white);
|
|
313
314
|
--mantine-color-text: var(--mantine-color-dark-0);
|
|
314
315
|
--mantine-color-body: #1a1b1e;
|
|
315
316
|
--mantine-color-error: #c92a2a;
|
|
@@ -322,106 +323,107 @@ body {
|
|
|
322
323
|
--mantine-color-dimmed: var(--mantine-color-dark-2);
|
|
323
324
|
--mantine-color-dark-filled: #141517;
|
|
324
325
|
--mantine-color-dark-filled-hover: #101113;
|
|
325
|
-
--mantine-color-dark-light: rgba(37, 38, 43, 0.
|
|
326
|
-
--mantine-color-dark-light-hover: rgba(37, 38, 43, 0.
|
|
327
|
-
--mantine-color-dark-light-color: #
|
|
326
|
+
--mantine-color-dark-light: rgba(37, 38, 43, 0.15);
|
|
327
|
+
--mantine-color-dark-light-hover: rgba(37, 38, 43, 0.2);
|
|
328
|
+
--mantine-color-dark-light-color: #5c5f66;
|
|
328
329
|
--mantine-color-dark-outline: #373a40;
|
|
329
330
|
--mantine-color-dark-outline-hover: rgba(55, 58, 64, 0.05);
|
|
330
331
|
--mantine-color-gray-filled: #343a40;
|
|
331
332
|
--mantine-color-gray-filled-hover: #212529;
|
|
332
|
-
--mantine-color-gray-light: rgba(134, 142, 150, 0.
|
|
333
|
-
--mantine-color-gray-light-hover: rgba(134, 142, 150, 0.
|
|
334
|
-
--mantine-color-gray-light-color: #
|
|
333
|
+
--mantine-color-gray-light: rgba(134, 142, 150, 0.15);
|
|
334
|
+
--mantine-color-gray-light-hover: rgba(134, 142, 150, 0.2);
|
|
335
|
+
--mantine-color-gray-light-color: #dee2e6;
|
|
335
336
|
--mantine-color-gray-outline: #ced4da;
|
|
336
337
|
--mantine-color-gray-outline-hover: rgba(206, 212, 218, 0.05);
|
|
337
338
|
--mantine-color-red-filled: #e03131;
|
|
338
339
|
--mantine-color-red-filled-hover: #c92a2a;
|
|
339
|
-
--mantine-color-red-light: rgba(250, 82, 82, 0.
|
|
340
|
-
--mantine-color-red-light-hover: rgba(250, 82, 82, 0.
|
|
341
|
-
--mantine-color-red-light-color: #
|
|
340
|
+
--mantine-color-red-light: rgba(250, 82, 82, 0.15);
|
|
341
|
+
--mantine-color-red-light-hover: rgba(250, 82, 82, 0.2);
|
|
342
|
+
--mantine-color-red-light-color: #ffa8a8;
|
|
342
343
|
--mantine-color-red-outline: #ff8787;
|
|
343
344
|
--mantine-color-red-outline-hover: rgba(255, 135, 135, 0.05);
|
|
344
345
|
--mantine-color-pink-filled: #c2255c;
|
|
345
346
|
--mantine-color-pink-filled-hover: #a61e4d;
|
|
346
|
-
--mantine-color-pink-light: rgba(230, 73, 128, 0.
|
|
347
|
-
--mantine-color-pink-light-hover: rgba(230, 73, 128, 0.
|
|
348
|
-
--mantine-color-pink-light-color: #
|
|
347
|
+
--mantine-color-pink-light: rgba(230, 73, 128, 0.15);
|
|
348
|
+
--mantine-color-pink-light-hover: rgba(230, 73, 128, 0.2);
|
|
349
|
+
--mantine-color-pink-light-color: #faa2c1;
|
|
349
350
|
--mantine-color-pink-outline: #f783ac;
|
|
350
351
|
--mantine-color-pink-outline-hover: rgba(247, 131, 172, 0.05);
|
|
351
352
|
--mantine-color-grape-filled: #9c36b5;
|
|
352
353
|
--mantine-color-grape-filled-hover: #862e9c;
|
|
353
|
-
--mantine-color-grape-light: rgba(190, 75, 219, 0.
|
|
354
|
-
--mantine-color-grape-light-hover: rgba(190, 75, 219, 0.
|
|
355
|
-
--mantine-color-grape-light-color: #
|
|
354
|
+
--mantine-color-grape-light: rgba(190, 75, 219, 0.15);
|
|
355
|
+
--mantine-color-grape-light-hover: rgba(190, 75, 219, 0.2);
|
|
356
|
+
--mantine-color-grape-light-color: #e599f7;
|
|
356
357
|
--mantine-color-grape-outline: #da77f2;
|
|
357
358
|
--mantine-color-grape-outline-hover: rgba(218, 119, 242, 0.05);
|
|
358
359
|
--mantine-color-violet-filled: #6741d9;
|
|
359
360
|
--mantine-color-violet-filled-hover: #5f3dc4;
|
|
360
|
-
--mantine-color-violet-light: rgba(121, 80, 242, 0.
|
|
361
|
-
--mantine-color-violet-light-hover: rgba(121, 80, 242, 0.
|
|
362
|
-
--mantine-color-violet-light-color: #
|
|
361
|
+
--mantine-color-violet-light: rgba(121, 80, 242, 0.15);
|
|
362
|
+
--mantine-color-violet-light-hover: rgba(121, 80, 242, 0.2);
|
|
363
|
+
--mantine-color-violet-light-color: #b197fc;
|
|
363
364
|
--mantine-color-violet-outline: #9775fa;
|
|
364
365
|
--mantine-color-violet-outline-hover: rgba(151, 117, 250, 0.05);
|
|
365
366
|
--mantine-color-indigo-filled: #3b5bdb;
|
|
366
367
|
--mantine-color-indigo-filled-hover: #364fc7;
|
|
367
|
-
--mantine-color-indigo-light: rgba(76, 110, 245, 0.
|
|
368
|
-
--mantine-color-indigo-light-hover: rgba(76, 110, 245, 0.
|
|
369
|
-
--mantine-color-indigo-light-color: #
|
|
368
|
+
--mantine-color-indigo-light: rgba(76, 110, 245, 0.15);
|
|
369
|
+
--mantine-color-indigo-light-hover: rgba(76, 110, 245, 0.2);
|
|
370
|
+
--mantine-color-indigo-light-color: #91a7ff;
|
|
370
371
|
--mantine-color-indigo-outline: #748ffc;
|
|
371
372
|
--mantine-color-indigo-outline-hover: rgba(116, 143, 252, 0.05);
|
|
372
373
|
--mantine-color-blue-filled: #1971c2;
|
|
373
374
|
--mantine-color-blue-filled-hover: #1864ab;
|
|
374
|
-
--mantine-color-blue-light: rgba(34, 139, 230, 0.
|
|
375
|
-
--mantine-color-blue-light-hover: rgba(34, 139, 230, 0.
|
|
376
|
-
--mantine-color-blue-light-color: #
|
|
375
|
+
--mantine-color-blue-light: rgba(34, 139, 230, 0.15);
|
|
376
|
+
--mantine-color-blue-light-hover: rgba(34, 139, 230, 0.2);
|
|
377
|
+
--mantine-color-blue-light-color: #74c0fc;
|
|
377
378
|
--mantine-color-blue-outline: #4dabf7;
|
|
378
379
|
--mantine-color-blue-outline-hover: rgba(77, 171, 247, 0.05);
|
|
379
380
|
--mantine-color-cyan-filled: #0c8599;
|
|
380
381
|
--mantine-color-cyan-filled-hover: #0b7285;
|
|
381
|
-
--mantine-color-cyan-light: rgba(21, 170, 191, 0.
|
|
382
|
-
--mantine-color-cyan-light-hover: rgba(21, 170, 191, 0.
|
|
383
|
-
--mantine-color-cyan-light-color: #
|
|
382
|
+
--mantine-color-cyan-light: rgba(21, 170, 191, 0.15);
|
|
383
|
+
--mantine-color-cyan-light-hover: rgba(21, 170, 191, 0.2);
|
|
384
|
+
--mantine-color-cyan-light-color: #66d9e8;
|
|
384
385
|
--mantine-color-cyan-outline: #3bc9db;
|
|
385
386
|
--mantine-color-cyan-outline-hover: rgba(59, 201, 219, 0.05);
|
|
386
387
|
--mantine-color-teal-filled: #099268;
|
|
387
388
|
--mantine-color-teal-filled-hover: #087f5b;
|
|
388
|
-
--mantine-color-teal-light: rgba(18, 184, 134, 0.
|
|
389
|
-
--mantine-color-teal-light-hover: rgba(18, 184, 134, 0.
|
|
390
|
-
--mantine-color-teal-light-color: #
|
|
389
|
+
--mantine-color-teal-light: rgba(18, 184, 134, 0.15);
|
|
390
|
+
--mantine-color-teal-light-hover: rgba(18, 184, 134, 0.2);
|
|
391
|
+
--mantine-color-teal-light-color: #63e6be;
|
|
391
392
|
--mantine-color-teal-outline: #38d9a9;
|
|
392
393
|
--mantine-color-teal-outline-hover: rgba(56, 217, 169, 0.05);
|
|
393
394
|
--mantine-color-green-filled: #2f9e44;
|
|
394
395
|
--mantine-color-green-filled-hover: #2b8a3e;
|
|
395
|
-
--mantine-color-green-light: rgba(64, 192, 87, 0.
|
|
396
|
-
--mantine-color-green-light-hover: rgba(64, 192, 87, 0.
|
|
397
|
-
--mantine-color-green-light-color: #
|
|
396
|
+
--mantine-color-green-light: rgba(64, 192, 87, 0.15);
|
|
397
|
+
--mantine-color-green-light-hover: rgba(64, 192, 87, 0.2);
|
|
398
|
+
--mantine-color-green-light-color: #8ce99a;
|
|
398
399
|
--mantine-color-green-outline: #69db7c;
|
|
399
400
|
--mantine-color-green-outline-hover: rgba(105, 219, 124, 0.05);
|
|
400
401
|
--mantine-color-lime-filled: #66a80f;
|
|
401
402
|
--mantine-color-lime-filled-hover: #5c940d;
|
|
402
|
-
--mantine-color-lime-light: rgba(130, 201, 30, 0.
|
|
403
|
-
--mantine-color-lime-light-hover: rgba(130, 201, 30, 0.
|
|
404
|
-
--mantine-color-lime-light-color: #
|
|
403
|
+
--mantine-color-lime-light: rgba(130, 201, 30, 0.15);
|
|
404
|
+
--mantine-color-lime-light-hover: rgba(130, 201, 30, 0.2);
|
|
405
|
+
--mantine-color-lime-light-color: #c0eb75;
|
|
405
406
|
--mantine-color-lime-outline: #a9e34b;
|
|
406
407
|
--mantine-color-lime-outline-hover: rgba(169, 227, 75, 0.05);
|
|
407
408
|
--mantine-color-yellow-filled: #f08c00;
|
|
408
409
|
--mantine-color-yellow-filled-hover: #e67700;
|
|
409
|
-
--mantine-color-yellow-light: rgba(250, 176, 5, 0.
|
|
410
|
-
--mantine-color-yellow-light-hover: rgba(250, 176, 5, 0.
|
|
411
|
-
--mantine-color-yellow-light-color: #
|
|
410
|
+
--mantine-color-yellow-light: rgba(250, 176, 5, 0.15);
|
|
411
|
+
--mantine-color-yellow-light-hover: rgba(250, 176, 5, 0.2);
|
|
412
|
+
--mantine-color-yellow-light-color: #ffe066;
|
|
412
413
|
--mantine-color-yellow-outline: #ffd43b;
|
|
413
414
|
--mantine-color-yellow-outline-hover: rgba(255, 212, 59, 0.05);
|
|
414
415
|
--mantine-color-orange-filled: #e8590c;
|
|
415
416
|
--mantine-color-orange-filled-hover: #d9480f;
|
|
416
|
-
--mantine-color-orange-light: rgba(253, 126, 20, 0.
|
|
417
|
-
--mantine-color-orange-light-hover: rgba(253, 126, 20, 0.
|
|
418
|
-
--mantine-color-orange-light-color: #
|
|
417
|
+
--mantine-color-orange-light: rgba(253, 126, 20, 0.15);
|
|
418
|
+
--mantine-color-orange-light-hover: rgba(253, 126, 20, 0.2);
|
|
419
|
+
--mantine-color-orange-light-color: #ffc078;
|
|
419
420
|
--mantine-color-orange-outline: #ffa94d;
|
|
420
421
|
--mantine-color-orange-outline-hover: rgba(255, 169, 77, 0.05);
|
|
421
422
|
}
|
|
422
423
|
|
|
423
424
|
:root[data-mantine-color-scheme='light'] {
|
|
424
425
|
--mantine-color-scheme: light;
|
|
426
|
+
--mantine-color-bright: var(--mantine-color-black);
|
|
425
427
|
--mantine-color-text: #000;
|
|
426
428
|
--mantine-color-body: #fff;
|
|
427
429
|
--mantine-color-error: #fa5252;
|
|
@@ -1161,7 +1163,7 @@ body {
|
|
|
1161
1163
|
--_input-padding-left: var(--_input-padding);
|
|
1162
1164
|
--_input-padding-right: var(--_input-padding);
|
|
1163
1165
|
--_input-placeholder-color: var(--mantine-color-placeholder);
|
|
1164
|
-
--_input-color:
|
|
1166
|
+
--_input-color: var(--mantine-color-text);
|
|
1165
1167
|
--_input-left-section-size: var(--input-left-section-width, calc(var(--input-height) - calc(0.125rem * var(--mantine-scale))));
|
|
1166
1168
|
--_input-right-section-size: var(
|
|
1167
1169
|
--input-right-section-width,
|
|
@@ -2345,8 +2347,11 @@ body {
|
|
|
2345
2347
|
padding: 0;
|
|
2346
2348
|
display: block;
|
|
2347
2349
|
margin: 0;
|
|
2348
|
-
transition:
|
|
2350
|
+
transition:
|
|
2351
|
+
border-color 100ms ease,
|
|
2352
|
+
background-color 100ms ease;
|
|
2349
2353
|
cursor: var(--_checkbox-cursor, var(--mantine-cursor-type));
|
|
2354
|
+
-webkit-tap-highlight-color: transparent;
|
|
2350
2355
|
}
|
|
2351
2356
|
|
|
2352
2357
|
[data-mantine-color-scheme='light'] .m-26063560 {
|
|
@@ -2407,7 +2412,9 @@ body {
|
|
|
2407
2412
|
pointer-events: none;
|
|
2408
2413
|
transform: var(--_checkbox-icon-transform, translateY(calc(0.3125rem * var(--mantine-scale))) scale(0.5));
|
|
2409
2414
|
opacity: var(--_checkbox-icon-opacity, 0);
|
|
2410
|
-
transition:
|
|
2415
|
+
transition:
|
|
2416
|
+
transform 100ms ease,
|
|
2417
|
+
opacity 100ms ease;
|
|
2411
2418
|
}
|
|
2412
2419
|
|
|
2413
2420
|
.m-f85678b6 {
|
|
@@ -2521,7 +2528,7 @@ body {
|
|
|
2521
2528
|
display: var(--_badge-display, inline-flex);
|
|
2522
2529
|
align-items: center;
|
|
2523
2530
|
justify-content: center;
|
|
2524
|
-
width: var(--_badge-width,
|
|
2531
|
+
width: var(--_badge-width, fit-content);
|
|
2525
2532
|
text-transform: uppercase;
|
|
2526
2533
|
font-weight: 700;
|
|
2527
2534
|
letter-spacing: calc(0.015625rem * var(--mantine-scale));
|
|
@@ -3721,6 +3728,7 @@ body {
|
|
|
3721
3728
|
|
|
3722
3729
|
.m-9e117634 {
|
|
3723
3730
|
display: block;
|
|
3731
|
+
flex: 0 1;
|
|
3724
3732
|
object-fit: var(--image-object-fit, cover);
|
|
3725
3733
|
width: 100%;
|
|
3726
3734
|
border-radius: var(--image-radius, 0);
|
|
@@ -4712,6 +4720,7 @@ body {
|
|
|
4712
4720
|
inset: 0;
|
|
4713
4721
|
outline: 0;
|
|
4714
4722
|
font-size: inherit;
|
|
4723
|
+
color: inherit;
|
|
4715
4724
|
}
|
|
4716
4725
|
|
|
4717
4726
|
[data-disabled] .m-f2d85dd2,
|
|
@@ -4888,6 +4897,7 @@ body {
|
|
|
4888
4897
|
transition-timing-function: ease;
|
|
4889
4898
|
transition-duration: 100ms;
|
|
4890
4899
|
cursor: var(--_cursor, var(--mantine-cursor-type));
|
|
4900
|
+
-webkit-tap-highlight-color: transparent;
|
|
4891
4901
|
}
|
|
4892
4902
|
|
|
4893
4903
|
[data-mantine-color-scheme='light'] .m-8a3dbb89 {
|
|
@@ -4991,6 +5001,7 @@ body {
|
|
|
4991
5001
|
overflow: hidden;
|
|
4992
5002
|
white-space: nowrap;
|
|
4993
5003
|
opacity: 0;
|
|
5004
|
+
-webkit-tap-highlight-color: transparent;
|
|
4994
5005
|
}
|
|
4995
5006
|
|
|
4996
5007
|
.m-211007ba:focus-visible + label {
|
|
@@ -5005,6 +5016,7 @@ body {
|
|
|
5005
5016
|
top: 0;
|
|
5006
5017
|
left: 0;
|
|
5007
5018
|
z-index: var(--rating-item-z-index, 0);
|
|
5019
|
+
-webkit-tap-highlight-color: transparent;
|
|
5008
5020
|
}
|
|
5009
5021
|
|
|
5010
5022
|
.m-21342ee4[data-read-only] {
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import cx from 'clsx';
|
|
1
2
|
import React from 'react';
|
|
3
|
+
import { RemoveScroll } from 'react-remove-scroll';
|
|
2
4
|
import classes from '../AppShell.module.css.js';
|
|
3
5
|
import { useAppShellContext } from '../AppShell.context.js';
|
|
4
6
|
import { factory } from '../../../core/factory/factory.js';
|
|
@@ -51,7 +53,12 @@ const AppShellFooter = factory((_props, ref) => {
|
|
|
51
53
|
component: "footer",
|
|
52
54
|
ref,
|
|
53
55
|
mod: { "with-border": withBorder != null ? withBorder : ctx.withBorder }
|
|
54
|
-
}, ctx.getStyles("footer", {
|
|
56
|
+
}, ctx.getStyles("footer", {
|
|
57
|
+
className: cx(RemoveScroll.classNames.zeroRight, className),
|
|
58
|
+
classNames,
|
|
59
|
+
styles,
|
|
60
|
+
style
|
|
61
|
+
})), others), {
|
|
55
62
|
__vars: { "--app-shell-footer-z-index": (_b = zIndex != null ? zIndex : ctx.zIndex) == null ? void 0 : _b.toString() }
|
|
56
63
|
})
|
|
57
64
|
);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppShellFooter.js","sources":["../../../../src/components/AppShell/AppShellFooter/AppShellFooter.tsx"],"sourcesContent":["import React from 'react';\nimport {\n Box,\n BoxProps,\n StylesApiProps,\n factory,\n ElementProps,\n useProps,\n Factory,\n} from '../../../core';\nimport classes from '../AppShell.module.css';\nimport { useAppShellContext } from '../AppShell.context';\n\nexport type AppShellFooterStylesNames = 'footer';\nexport type AppShellFooterVariant = string;\nexport type AppShellFooterCssVariables = {\n root: '--test';\n};\n\nexport interface AppShellFooterProps\n extends BoxProps,\n StylesApiProps<AppShellFooterFactory>,\n ElementProps<'footer'> {\n /** Determines whether component should have a border, overrides `withBorder` prop on `AppShell` component */\n withBorder?: boolean;\n\n /** Component `z-index`, by default inherited from the `AppShell` */\n zIndex?: string | number;\n}\n\nexport type AppShellFooterFactory = Factory<{\n props: AppShellFooterProps;\n ref: HTMLElement;\n stylesNames: AppShellFooterStylesNames;\n vars: AppShellFooterCssVariables;\n variant: AppShellFooterVariant;\n}>;\n\nconst defaultProps: Partial<AppShellFooterProps> = {};\n\nexport const AppShellFooter = factory<AppShellFooterFactory>((_props, ref) => {\n const props = useProps('AppShellFooter', defaultProps, _props);\n const { classNames, className, style, styles, unstyled, vars, withBorder, zIndex, ...others } =\n props;\n const ctx = useAppShellContext();\n\n if (ctx.disabled) {\n return null;\n }\n\n return (\n <Box\n component=\"footer\"\n ref={ref}\n mod={{ 'with-border': withBorder ?? ctx.withBorder }}\n {...ctx.getStyles('footer', {
|
|
1
|
+
{"version":3,"file":"AppShellFooter.js","sources":["../../../../src/components/AppShell/AppShellFooter/AppShellFooter.tsx"],"sourcesContent":["import cx from 'clsx';\nimport React from 'react';\nimport { RemoveScroll } from 'react-remove-scroll';\nimport {\n Box,\n BoxProps,\n StylesApiProps,\n factory,\n ElementProps,\n useProps,\n Factory,\n} from '../../../core';\nimport classes from '../AppShell.module.css';\nimport { useAppShellContext } from '../AppShell.context';\n\nexport type AppShellFooterStylesNames = 'footer';\nexport type AppShellFooterVariant = string;\nexport type AppShellFooterCssVariables = {\n root: '--test';\n};\n\nexport interface AppShellFooterProps\n extends BoxProps,\n StylesApiProps<AppShellFooterFactory>,\n ElementProps<'footer'> {\n /** Determines whether component should have a border, overrides `withBorder` prop on `AppShell` component */\n withBorder?: boolean;\n\n /** Component `z-index`, by default inherited from the `AppShell` */\n zIndex?: string | number;\n}\n\nexport type AppShellFooterFactory = Factory<{\n props: AppShellFooterProps;\n ref: HTMLElement;\n stylesNames: AppShellFooterStylesNames;\n vars: AppShellFooterCssVariables;\n variant: AppShellFooterVariant;\n}>;\n\nconst defaultProps: Partial<AppShellFooterProps> = {};\n\nexport const AppShellFooter = factory<AppShellFooterFactory>((_props, ref) => {\n const props = useProps('AppShellFooter', defaultProps, _props);\n const { classNames, className, style, styles, unstyled, vars, withBorder, zIndex, ...others } =\n props;\n const ctx = useAppShellContext();\n\n if (ctx.disabled) {\n return null;\n }\n\n return (\n <Box\n component=\"footer\"\n ref={ref}\n mod={{ 'with-border': withBorder ?? ctx.withBorder }}\n {...ctx.getStyles('footer', {\n className: cx(RemoveScroll.classNames.zeroRight, className),\n classNames,\n styles,\n style,\n })}\n {...others}\n __vars={{ '--app-shell-footer-z-index': (zIndex ?? ctx.zIndex)?.toString() }}\n />\n );\n});\n\nAppShellFooter.classes = classes;\nAppShellFooter.displayName = '@mantine/core/AppShellFooter';\n"],"names":[],"mappings":";;;;;;;;;AAAA,IAAI,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC;AACtC,IAAI,UAAU,GAAG,MAAM,CAAC,gBAAgB,CAAC;AACzC,IAAI,iBAAiB,GAAG,MAAM,CAAC,yBAAyB,CAAC;AACzD,IAAI,mBAAmB,GAAG,MAAM,CAAC,qBAAqB,CAAC;AACvD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC;AACnD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,oBAAo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D,MAAM,SAAS,EAAE,QAAQ;AACzB,MAAM,GAAG;AACT,MAAM,GAAG,EAAE,EAAE,aAAa,EAAE,UAAU,IAAI,IAAI,GAAG,UAAU,GAAG,GAAG,CAAC,UAAU,EAAE;AAC9E,KAAK,EAAE,GAAG,CAAC,SAAS,CAAC,QAAQ,EAAE;AAC/B,MAAM,SAAS,EAAE,EAAE,CAAC,YAAY,CAAC,UAAU,CAAC,SAAS,EAAE,SAAS,CAAC;AACjE,MAAM,UAAU;AAChB,MAAM,MAAM;AACZ,MAAM,KAAK;AACX,KAAK,CAAC,CAAC,EAAE,MAAM,CAAC,EAAE;AAClB,MAAM,MAAM,EAAE,EAAE,4BAA4B,EAAE,CAAC,EAAE,GAAG,MAAM,IAAI,IAAI,GAAG,MAAM,GAAG,GAAG,CAAC,MAAM,KAAK,IAAI,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,EAAE;AAC5H,KAAK,CAAC;AACN,GAAG,CAAC;AACJ,CAAC,EAAE;AACH,cAAc,CAAC,OAAO,GAAG,OAAO,CAAC;AACjC,cAAc,CAAC,WAAW,GAAG,8BAA8B;;;;"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import cx from 'clsx';
|
|
1
2
|
import React from 'react';
|
|
3
|
+
import { RemoveScroll } from 'react-remove-scroll';
|
|
2
4
|
import classes from '../AppShell.module.css.js';
|
|
3
5
|
import { useAppShellContext } from '../AppShell.context.js';
|
|
4
6
|
import { factory } from '../../../core/factory/factory.js';
|
|
@@ -51,7 +53,12 @@ const AppShellHeader = factory((_props, ref) => {
|
|
|
51
53
|
component: "header",
|
|
52
54
|
ref,
|
|
53
55
|
mod: { "with-border": withBorder != null ? withBorder : ctx.withBorder }
|
|
54
|
-
}, ctx.getStyles("header", {
|
|
56
|
+
}, ctx.getStyles("header", {
|
|
57
|
+
className: cx(RemoveScroll.classNames.zeroRight, className),
|
|
58
|
+
classNames,
|
|
59
|
+
styles,
|
|
60
|
+
style
|
|
61
|
+
})), others), {
|
|
55
62
|
__vars: { "--app-shell-header-z-index": (_b = zIndex != null ? zIndex : ctx.zIndex) == null ? void 0 : _b.toString() }
|
|
56
63
|
})
|
|
57
64
|
);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppShellHeader.js","sources":["../../../../src/components/AppShell/AppShellHeader/AppShellHeader.tsx"],"sourcesContent":["import React from 'react';\nimport {\n Box,\n BoxProps,\n StylesApiProps,\n factory,\n ElementProps,\n useProps,\n Factory,\n} from '../../../core';\nimport classes from '../AppShell.module.css';\nimport { useAppShellContext } from '../AppShell.context';\n\nexport type AppShellHeaderStylesNames = 'header';\nexport type AppShellHeaderVariant = string;\nexport type AppShellHeaderCssVariables = {\n root: '--test';\n};\n\nexport interface AppShellHeaderProps\n extends BoxProps,\n StylesApiProps<AppShellHeaderFactory>,\n ElementProps<'header'> {\n /** Determines whether component should have a border, overrides `withBorder` prop on `AppShell` component */\n withBorder?: boolean;\n\n /** Component `z-index`, by default inherited from the `AppShell` */\n zIndex?: string | number;\n}\n\nexport type AppShellHeaderFactory = Factory<{\n props: AppShellHeaderProps;\n ref: HTMLElement;\n stylesNames: AppShellHeaderStylesNames;\n vars: AppShellHeaderCssVariables;\n variant: AppShellHeaderVariant;\n}>;\n\nconst defaultProps: Partial<AppShellHeaderProps> = {};\n\nexport const AppShellHeader = factory<AppShellHeaderFactory>((_props, ref) => {\n const props = useProps('AppShellHeader', defaultProps, _props);\n const { classNames, className, style, styles, unstyled, vars, withBorder, zIndex, ...others } =\n props;\n const ctx = useAppShellContext();\n\n if (ctx.disabled) {\n return null;\n }\n\n return (\n <Box\n component=\"header\"\n ref={ref}\n mod={{ 'with-border': withBorder ?? ctx.withBorder }}\n {...ctx.getStyles('header', {
|
|
1
|
+
{"version":3,"file":"AppShellHeader.js","sources":["../../../../src/components/AppShell/AppShellHeader/AppShellHeader.tsx"],"sourcesContent":["import cx from 'clsx';\nimport React from 'react';\nimport { RemoveScroll } from 'react-remove-scroll';\nimport {\n Box,\n BoxProps,\n StylesApiProps,\n factory,\n ElementProps,\n useProps,\n Factory,\n} from '../../../core';\nimport classes from '../AppShell.module.css';\nimport { useAppShellContext } from '../AppShell.context';\n\nexport type AppShellHeaderStylesNames = 'header';\nexport type AppShellHeaderVariant = string;\nexport type AppShellHeaderCssVariables = {\n root: '--test';\n};\n\nexport interface AppShellHeaderProps\n extends BoxProps,\n StylesApiProps<AppShellHeaderFactory>,\n ElementProps<'header'> {\n /** Determines whether component should have a border, overrides `withBorder` prop on `AppShell` component */\n withBorder?: boolean;\n\n /** Component `z-index`, by default inherited from the `AppShell` */\n zIndex?: string | number;\n}\n\nexport type AppShellHeaderFactory = Factory<{\n props: AppShellHeaderProps;\n ref: HTMLElement;\n stylesNames: AppShellHeaderStylesNames;\n vars: AppShellHeaderCssVariables;\n variant: AppShellHeaderVariant;\n}>;\n\nconst defaultProps: Partial<AppShellHeaderProps> = {};\n\nexport const AppShellHeader = factory<AppShellHeaderFactory>((_props, ref) => {\n const props = useProps('AppShellHeader', defaultProps, _props);\n const { classNames, className, style, styles, unstyled, vars, withBorder, zIndex, ...others } =\n props;\n const ctx = useAppShellContext();\n\n if (ctx.disabled) {\n return null;\n }\n\n return (\n <Box\n component=\"header\"\n ref={ref}\n mod={{ 'with-border': withBorder ?? ctx.withBorder }}\n {...ctx.getStyles('header', {\n className: cx(RemoveScroll.classNames.zeroRight, className),\n classNames,\n styles,\n style,\n })}\n {...others}\n __vars={{ '--app-shell-header-z-index': (zIndex ?? ctx.zIndex)?.toString() }}\n />\n );\n});\n\nAppShellHeader.classes = classes;\nAppShellHeader.displayName = '@mantine/core/AppShellHeader';\n"],"names":[],"mappings":";;;;;;;;;AAAA,IAAI,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC;AACtC,IAAI,UAAU,GAAG,MAAM,CAAC,gBAAgB,CAAC;AACzC,IAAI,iBAAiB,GAAG,MAAM,CAAC,yBAAyB,CAAC;AACzD,IAAI,mBAAmB,GA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,IAAI,OAAO,IAAI,CAAC;AAChB,GAAG;AACH,EAAE,uBAAuB,KAAK,CAAC,aAAa;AAC5C,IAAI,GAAG;AACP,IAAI,aAAa,CAAC,cAAc,CAAC,cAAc,CAAC;AAChD,MAAM,SAAS,EAAE,QAAQ;AACzB,MAAM,GAAG;AACT,MAAM,GAAG,EAAE,EAAE,aAAa,EAAE,UAAU,IAAI,IAAI,GAAG,UAAU,GAAG,GAAG,CAAC,UAAU,EAAE;AAC9E,KAAK,EAAE,GAAG,CAAC,SAAS,CAAC,QAAQ,EAAE;AAC/B,MAAM,SAAS,EAAE,EAAE,CAAC,YAAY,CAAC,UAAU,CAAC,SAAS,EAAE,SAAS,CAAC;AACjE,MAAM,UAAU;AAChB,MAAM,MAAM;AACZ,MAAM,KAAK;AACX,KAAK,CAAC,CAAC,EAAE,MAAM,CAAC,EAAE;AAClB,MAAM,MAAM,EAAE,EAAE,4BAA4B,EAAE,CAAC,EAAE,GAAG,MAAM,IAAI,IAAI,GAAG,MAAM,GAAG,GAAG,CAAC,MAAM,KAAK,IAAI,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,EAAE;AAC5H,KAAK,CAAC;AACN,GAAG,CAAC;AACJ,CAAC,EAAE;AACH,cAAc,CAAC,OAAO,GAAG,OAAO,CAAC;AACjC,cAAc,CAAC,WAAW,GAAG,8BAA8B;;;;"}
|
|
@@ -35,7 +35,9 @@ var __objRest = (source, exclude) => {
|
|
|
35
35
|
}
|
|
36
36
|
return target;
|
|
37
37
|
};
|
|
38
|
-
const defaultProps = {
|
|
38
|
+
const defaultProps = {
|
|
39
|
+
size: "md"
|
|
40
|
+
};
|
|
39
41
|
const varsResolver = createVarsResolver((_, { size, fluid }) => ({
|
|
40
42
|
root: {
|
|
41
43
|
"--container-size": fluid ? "100%" : getSize(size, "container-size")
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Container.js","sources":["../../../src/components/Container/Container.tsx"],"sourcesContent":["import React from 'react';\nimport {\n Box,\n BoxProps,\n StylesApiProps,\n factory,\n ElementProps,\n useProps,\n useStyles,\n createVarsResolver,\n getSize,\n MantineSize,\n Factory,\n} from '../../core';\nimport classes from './Container.module.css';\n\nexport type ContainerStylesNames = 'root';\nexport type ContainerCssVariables = {\n root: '--container-size';\n};\n\nexport interface ContainerProps\n extends BoxProps,\n StylesApiProps<ContainerFactory>,\n ElementProps<'div'> {\n /** Sets `max-width` of the container, value is not responsive – it is the same for all screen sizes. Numbers are converted to rem. Ignored when `fluid` prop is set. `'md'` by default */\n size?: MantineSize | (string & {}) | number;\n\n /** Determines whether the container should take 100% of its parent width. If set, `size` prop is ignored. `false` by default. */\n fluid?: boolean;\n}\n\nexport type ContainerFactory = Factory<{\n props: ContainerProps;\n ref: HTMLDivElement;\n stylesNames: ContainerStylesNames;\n vars: ContainerCssVariables;\n}>;\n\nconst defaultProps: Partial<ContainerProps> = {};\n\nconst varsResolver = createVarsResolver<ContainerFactory>((_, { size, fluid }) => ({\n root: {\n '--container-size': fluid ? '100%' : getSize(size, 'container-size'),\n },\n}));\n\nexport const Container = factory<ContainerFactory>((_props, ref) => {\n const props = useProps('Container', defaultProps, _props);\n const { classNames, className, style, styles, unstyled, vars, ...others } = props;\n\n const getStyles = useStyles<ContainerFactory>({\n name: 'Container',\n classes,\n props,\n className,\n style,\n classNames,\n styles,\n unstyled,\n vars,\n varsResolver,\n });\n\n return <Box ref={ref} {...getStyles('root')} {...others} />;\n});\n\nContainer.classes = classes;\nContainer.displayName = '@mantine/core/Container';\n"],"names":[],"mappings":";;;;;;;;;AAAA,IAAI,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC;AACtC,IAAI,mBAAmB,GAAG,MAAM,CAAC,qBAAqB,CAAC;AACvD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC;AACnD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,oBAAoB,CAAC;AACzD,IAAI,eAAe,GAAG,CAA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I,IAAI,IAAI,mBAAmB,CAAC,MAAM,CAAC,EAAE;AAClD,MAAM,IAAI,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,YAAY,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC;AACtE,QAAQ,MAAM,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;AACpC,KAAK;AACL,EAAE,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AAWF,MAAM,YAAY,GAAG,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"Container.js","sources":["../../../src/components/Container/Container.tsx"],"sourcesContent":["import React from 'react';\nimport {\n Box,\n BoxProps,\n StylesApiProps,\n factory,\n ElementProps,\n useProps,\n useStyles,\n createVarsResolver,\n getSize,\n MantineSize,\n Factory,\n} from '../../core';\nimport classes from './Container.module.css';\n\nexport type ContainerStylesNames = 'root';\nexport type ContainerCssVariables = {\n root: '--container-size';\n};\n\nexport interface ContainerProps\n extends BoxProps,\n StylesApiProps<ContainerFactory>,\n ElementProps<'div'> {\n /** Sets `max-width` of the container, value is not responsive – it is the same for all screen sizes. Numbers are converted to rem. Ignored when `fluid` prop is set. `'md'` by default */\n size?: MantineSize | (string & {}) | number;\n\n /** Determines whether the container should take 100% of its parent width. If set, `size` prop is ignored. `false` by default. */\n fluid?: boolean;\n}\n\nexport type ContainerFactory = Factory<{\n props: ContainerProps;\n ref: HTMLDivElement;\n stylesNames: ContainerStylesNames;\n vars: ContainerCssVariables;\n}>;\n\nconst defaultProps: Partial<ContainerProps> = {\n size: 'md',\n};\n\nconst varsResolver = createVarsResolver<ContainerFactory>((_, { size, fluid }) => ({\n root: {\n '--container-size': fluid ? '100%' : getSize(size, 'container-size'),\n },\n}));\n\nexport const Container = factory<ContainerFactory>((_props, ref) => {\n const props = useProps('Container', defaultProps, _props);\n const { classNames, className, style, styles, unstyled, vars, ...others } = props;\n\n const getStyles = useStyles<ContainerFactory>({\n name: 'Container',\n classes,\n props,\n className,\n style,\n classNames,\n styles,\n unstyled,\n vars,\n varsResolver,\n });\n\n return <Box ref={ref} {...getStyles('root')} {...others} />;\n});\n\nContainer.classes = classes;\nContainer.displayName = '@mantine/core/Container';\n"],"names":[],"mappings":";;;;;;;;;AAAA,IAAI,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC;AACtC,IAAI,mBAAmB,GAAG,MAAM,CAAC,qBAAqB,CAAC;AACvD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC;AACnD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,oBAAoB,CAAC;AACzD,IAAI,eAAe,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,KAAK,GAAG,IAAI,GAAG,GAAG,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AAChK,IAAI,cAAc,GAAG,CAAC,CAAC,EAAE,CAAC,KAAK;AAC/B,EAAE,KAAK,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC;AAChC,IAAI,IAAI,YAAY,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC;AAClC,MAAM,eAAe,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;AACxC,EAAE,IAAI,mBAAmB;AACzB,IAAI,KAAK,IAAI,IAAI,IAAI,mBAAmB,CAAC,CAAC,CAAC,EAAE;AAC7C,MAAM,IAAI,YAAY,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC;AACpC,QAAQ,eAAe,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;AAC1C,KAAK;AACL,EAAE,OAAO,CAAC,CAAC;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AAE,UAAU,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE,MAAM,GAAG,SAAS,CAAC,EAAE,EAAE,CAAC,YAAY,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC,CAAC;AAC9K,EAAE,MAAM,SAAS,GAAG,SAAS,CAAC;AAC9B,IAAI,IAAI,EAAE,WAAW;AACrB,IAAI,OAAO;AACX,IAAI,KAAK;AACT,IAAI,SAAS;AACb,IAAI,KAAK;AACT,IAAI,UAAU;AACd,IAAI,MAAM;AACV,IAAI,QAAQ;AACZ,IAAI,IAAI;AACR,IAAI,YAAY;AAChB,GAAG,CAAC,CAAC;AACL,EAAE,uBAAuB,KAAK,CAAC,aAAa,CAAC,GAAG,EAAE,cAAc,CAAC,cAAc,CAAC,EAAE,GAAG,EAAE,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;AACtH,CAAC,EAAE;AACH,SAAS,CAAC,OAAO,GAAG,OAAO,CAAC;AAC5B,SAAS,CAAC,WAAW,GAAG,yBAAyB;;;;"}
|
|
@@ -135,7 +135,7 @@ const InputWrapper = factory((_props, ref) => {
|
|
|
135
135
|
const isRequired = typeof withAsterisk === "boolean" ? withAsterisk : required;
|
|
136
136
|
const errorId = (errorProps == null ? void 0 : errorProps.id) || `${idBase}-error`;
|
|
137
137
|
const descriptionId = (descriptionProps == null ? void 0 : descriptionProps.id) || `${idBase}-description`;
|
|
138
|
-
const inputId =
|
|
138
|
+
const inputId = idBase;
|
|
139
139
|
const hasError = !!error && typeof error !== "boolean";
|
|
140
140
|
const hasDescription = !!description;
|
|
141
141
|
const _describedBy = `${hasError ? errorId : ""} ${hasDescription ? descriptionId : ""}`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InputWrapper.js","sources":["../../../../src/components/Input/InputWrapper/InputWrapper.tsx"],"sourcesContent":["import React from 'react';\nimport { useId } from '@mantine/hooks';\nimport {\n Box,\n BoxProps,\n StylesApiProps,\n factory,\n ElementProps,\n useProps,\n useStyles,\n MantineSize,\n Factory,\n createVarsResolver,\n getFontSize,\n rem,\n} from '../../../core';\nimport {\n InputLabel,\n InputLabelStylesNames,\n InputLabelCssVariables,\n} from '../InputLabel/InputLabel';\nimport {\n InputDescription,\n InputDescriptionStylesNames,\n InputDescriptionCssVariables,\n} from '../InputDescription/InputDescription';\nimport {\n InputError,\n InputErrorStylesNames,\n InputErrorCssVariables,\n} from '../InputError/InputError';\nimport { InputWrapperProvider } from '../InputWrapper.context';\nimport { getInputOffsets } from './get-input-offsets/get-input-offsets';\nimport classes from '../Input.module.css';\n\nexport type InputWrapperCssVariables = InputLabelCssVariables &\n InputErrorCssVariables &\n InputDescriptionCssVariables;\n\nexport type InputWrapperStylesNames =\n | 'root'\n | InputLabelStylesNames\n | InputDescriptionStylesNames\n | InputErrorStylesNames;\n\nexport interface __InputWrapperProps {\n /** Contents of `Input.Label` component, if not set, label is not rendered. */\n label?: React.ReactNode;\n\n /** Contents of `Input.Description` component, if not set, description is not rendered. */\n description?: React.ReactNode;\n\n /** Contents of `Input.Error` component, if not set, error is not rendered. */\n error?: React.ReactNode;\n\n /** Adds required attribute to the input and a red asterisk on the right side of label, `false` by default */\n required?: boolean;\n\n /** Determines whether required asterisk should be rendered, overrides required prop, does not add required attribute to the input, `false` by default */\n withAsterisk?: boolean;\n\n /** Props passed down to the `Input.Label` component */\n labelProps?: Record<string, any>;\n\n /** Props passed down to the `Input.Description` component */\n descriptionProps?: Record<string, any>;\n\n /** Props passed down to the `InputError` component */\n errorProps?: Record<string, any>;\n\n /** Input container component, defaults to `React.Fragment` */\n inputContainer?(children: React.ReactNode): React.ReactNode;\n\n /** Controls order of the elements, `['label', 'description', 'input', 'error']` by default */\n inputWrapperOrder?: ('label' | 'input' | 'description' | 'error')[];\n}\n\nexport interface InputWrapperProps\n extends __InputWrapperProps,\n BoxProps,\n StylesApiProps<InputWrapperFactory>,\n ElementProps<'div'> {\n __staticSelector?: string;\n\n /** Props passed to Styles API context, replaces Input.Wrapper props */\n __stylesApiProps?: Record<string, any>;\n\n /** Static id used as base to generate `aria-` attributes, by default generates random id */\n id?: string;\n\n /** Controls size of `Input.Label`, `Input.Description` and `Input.Error` components */\n size?: MantineSize | (string & {});\n\n /** `Input.Label` root element, `'label'` by default */\n labelElement?: 'label' | 'div';\n}\n\nexport type InputWrapperFactory = Factory<{\n props: InputWrapperProps;\n ref: HTMLDivElement;\n stylesNames: InputWrapperStylesNames;\n vars: InputWrapperCssVariables;\n}>;\n\nconst defaultProps: Partial<InputWrapperProps> = {\n labelElement: 'label',\n size: 'sm',\n inputContainer: (children) => children,\n inputWrapperOrder: ['label', 'description', 'input', 'error'],\n};\n\nconst varsResolver = createVarsResolver<InputWrapperFactory>((_, { size }) => ({\n label: {\n '--input-label-size': getFontSize(size),\n '--input-asterisk-color': 'var(--mantine-color-red-filled)',\n },\n\n error: {\n '--input-error-size': `calc(${getFontSize(size)} - ${rem(2)})`,\n },\n\n description: {\n '--input-description-size': `calc(${getFontSize(size)} - ${rem(2)})`,\n },\n}));\n\nexport const InputWrapper = factory<InputWrapperFactory>((_props, ref) => {\n const props = useProps('InputWrapper', defaultProps, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n vars,\n size,\n variant,\n __staticSelector,\n inputContainer,\n inputWrapperOrder,\n label,\n error,\n description,\n labelProps,\n descriptionProps,\n errorProps,\n labelElement,\n children,\n withAsterisk,\n id,\n required,\n __stylesApiProps,\n ...others\n } = props;\n\n const getStyles = useStyles<InputWrapperFactory>({\n name: ['InputWrapper', __staticSelector],\n props: __stylesApiProps || props,\n classes,\n className,\n style,\n classNames,\n styles,\n unstyled,\n vars,\n varsResolver,\n });\n\n const sharedProps = {\n size,\n variant,\n __staticSelector,\n };\n\n const idBase = useId(id);\n const isRequired = typeof withAsterisk === 'boolean' ? withAsterisk : required;\n const errorId = errorProps?.id || `${idBase}-error`;\n const descriptionId = descriptionProps?.id || `${idBase}-description`;\n const inputId = `${idBase}-input`;\n const hasError = !!error && typeof error !== 'boolean';\n const hasDescription = !!description;\n const _describedBy = `${hasError ? errorId : ''} ${hasDescription ? descriptionId : ''}`;\n const describedBy = _describedBy.trim().length > 0 ? _describedBy.trim() : undefined;\n\n const _label = label && (\n <InputLabel\n key=\"label\"\n labelElement={labelElement}\n id={`${idBase}-label`}\n htmlFor={inputId}\n required={isRequired}\n {...sharedProps}\n {...labelProps}\n >\n {label}\n </InputLabel>\n );\n\n const _description = hasDescription && (\n <InputDescription\n key=\"description\"\n {...descriptionProps}\n {...sharedProps}\n size={descriptionProps?.size || sharedProps.size}\n id={descriptionProps?.id || descriptionId}\n >\n {description}\n </InputDescription>\n );\n\n const _input = <React.Fragment key=\"input\">{inputContainer!(children)}</React.Fragment>;\n\n const _error = hasError && (\n <InputError\n {...errorProps}\n {...sharedProps}\n size={errorProps?.size || sharedProps.size}\n key=\"error\"\n id={errorProps?.id || errorId}\n >\n {error}\n </InputError>\n );\n\n const content = inputWrapperOrder!.map((part) => {\n switch (part) {\n case 'label':\n return _label;\n case 'input':\n return _input;\n case 'description':\n return _description;\n case 'error':\n return _error;\n default:\n return null;\n }\n });\n\n return (\n <InputWrapperProvider\n value={{\n getStyles,\n describedBy,\n inputId,\n ...getInputOffsets(inputWrapperOrder!, { hasDescription, hasError }),\n }}\n >\n <Box ref={ref} variant={variant} size={size} {...getStyles('root')} {...others}>\n {content}\n </Box>\n </InputWrapperProvider>\n );\n});\n\nInputWrapper.classes = classes;\nInputWrapper.displayName = '@mantine/core/InputWrapper';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,IAAI,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC;AACtC,IAAI,UAAU,GAAG,MAAM,CAAC,gBAAgB,CAAC;AACzC,IAAI,iBAAiB,GAAG,MAAM,CAAC,yBAAyB,CAAC;AACzD,IAAI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C,CAAC,EAAE,MAAM,CAAC,EAAE,OAAO,CAAC;AACxI,GAAG,CAAC;AACJ,CAAC,EAAE;AACH,YAAY,CAAC,OAAO,GAAG,OAAO,CAAC;AAC/B,YAAY,CAAC,WAAW,GAAG,4BAA4B;;;;"}
|
|
1
|
+
{"version":3,"file":"InputWrapper.js","sources":["../../../../src/components/Input/InputWrapper/InputWrapper.tsx"],"sourcesContent":["import React from 'react';\nimport { useId } from '@mantine/hooks';\nimport {\n Box,\n BoxProps,\n StylesApiProps,\n factory,\n ElementProps,\n useProps,\n useStyles,\n MantineSize,\n Factory,\n createVarsResolver,\n getFontSize,\n rem,\n} from '../../../core';\nimport {\n InputLabel,\n InputLabelStylesNames,\n InputLabelCssVariables,\n} from '../InputLabel/InputLabel';\nimport {\n InputDescription,\n InputDescriptionStylesNames,\n InputDescriptionCssVariables,\n} from '../InputDescription/InputDescription';\nimport {\n InputError,\n InputErrorStylesNames,\n InputErrorCssVariables,\n} from '../InputError/InputError';\nimport { InputWrapperProvider } from '../InputWrapper.context';\nimport { getInputOffsets } from './get-input-offsets/get-input-offsets';\nimport classes from '../Input.module.css';\n\nexport type InputWrapperCssVariables = InputLabelCssVariables &\n InputErrorCssVariables &\n InputDescriptionCssVariables;\n\nexport type InputWrapperStylesNames =\n | 'root'\n | InputLabelStylesNames\n | InputDescriptionStylesNames\n | InputErrorStylesNames;\n\nexport interface __InputWrapperProps {\n /** Contents of `Input.Label` component, if not set, label is not rendered. */\n label?: React.ReactNode;\n\n /** Contents of `Input.Description` component, if not set, description is not rendered. */\n description?: React.ReactNode;\n\n /** Contents of `Input.Error` component, if not set, error is not rendered. */\n error?: React.ReactNode;\n\n /** Adds required attribute to the input and a red asterisk on the right side of label, `false` by default */\n required?: boolean;\n\n /** Determines whether required asterisk should be rendered, overrides required prop, does not add required attribute to the input, `false` by default */\n withAsterisk?: boolean;\n\n /** Props passed down to the `Input.Label` component */\n labelProps?: Record<string, any>;\n\n /** Props passed down to the `Input.Description` component */\n descriptionProps?: Record<string, any>;\n\n /** Props passed down to the `InputError` component */\n errorProps?: Record<string, any>;\n\n /** Input container component, defaults to `React.Fragment` */\n inputContainer?(children: React.ReactNode): React.ReactNode;\n\n /** Controls order of the elements, `['label', 'description', 'input', 'error']` by default */\n inputWrapperOrder?: ('label' | 'input' | 'description' | 'error')[];\n}\n\nexport interface InputWrapperProps\n extends __InputWrapperProps,\n BoxProps,\n StylesApiProps<InputWrapperFactory>,\n ElementProps<'div'> {\n __staticSelector?: string;\n\n /** Props passed to Styles API context, replaces Input.Wrapper props */\n __stylesApiProps?: Record<string, any>;\n\n /** Static id used as base to generate `aria-` attributes, by default generates random id */\n id?: string;\n\n /** Controls size of `Input.Label`, `Input.Description` and `Input.Error` components */\n size?: MantineSize | (string & {});\n\n /** `Input.Label` root element, `'label'` by default */\n labelElement?: 'label' | 'div';\n}\n\nexport type InputWrapperFactory = Factory<{\n props: InputWrapperProps;\n ref: HTMLDivElement;\n stylesNames: InputWrapperStylesNames;\n vars: InputWrapperCssVariables;\n}>;\n\nconst defaultProps: Partial<InputWrapperProps> = {\n labelElement: 'label',\n size: 'sm',\n inputContainer: (children) => children,\n inputWrapperOrder: ['label', 'description', 'input', 'error'],\n};\n\nconst varsResolver = createVarsResolver<InputWrapperFactory>((_, { size }) => ({\n label: {\n '--input-label-size': getFontSize(size),\n '--input-asterisk-color': 'var(--mantine-color-red-filled)',\n },\n\n error: {\n '--input-error-size': `calc(${getFontSize(size)} - ${rem(2)})`,\n },\n\n description: {\n '--input-description-size': `calc(${getFontSize(size)} - ${rem(2)})`,\n },\n}));\n\nexport const InputWrapper = factory<InputWrapperFactory>((_props, ref) => {\n const props = useProps('InputWrapper', defaultProps, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n vars,\n size,\n variant,\n __staticSelector,\n inputContainer,\n inputWrapperOrder,\n label,\n error,\n description,\n labelProps,\n descriptionProps,\n errorProps,\n labelElement,\n children,\n withAsterisk,\n id,\n required,\n __stylesApiProps,\n ...others\n } = props;\n\n const getStyles = useStyles<InputWrapperFactory>({\n name: ['InputWrapper', __staticSelector],\n props: __stylesApiProps || props,\n classes,\n className,\n style,\n classNames,\n styles,\n unstyled,\n vars,\n varsResolver,\n });\n\n const sharedProps = {\n size,\n variant,\n __staticSelector,\n };\n\n const idBase = useId(id);\n const isRequired = typeof withAsterisk === 'boolean' ? withAsterisk : required;\n const errorId = errorProps?.id || `${idBase}-error`;\n const descriptionId = descriptionProps?.id || `${idBase}-description`;\n const inputId = idBase;\n const hasError = !!error && typeof error !== 'boolean';\n const hasDescription = !!description;\n const _describedBy = `${hasError ? errorId : ''} ${hasDescription ? descriptionId : ''}`;\n const describedBy = _describedBy.trim().length > 0 ? _describedBy.trim() : undefined;\n\n const _label = label && (\n <InputLabel\n key=\"label\"\n labelElement={labelElement}\n id={`${idBase}-label`}\n htmlFor={inputId}\n required={isRequired}\n {...sharedProps}\n {...labelProps}\n >\n {label}\n </InputLabel>\n );\n\n const _description = hasDescription && (\n <InputDescription\n key=\"description\"\n {...descriptionProps}\n {...sharedProps}\n size={descriptionProps?.size || sharedProps.size}\n id={descriptionProps?.id || descriptionId}\n >\n {description}\n </InputDescription>\n );\n\n const _input = <React.Fragment key=\"input\">{inputContainer!(children)}</React.Fragment>;\n\n const _error = hasError && (\n <InputError\n {...errorProps}\n {...sharedProps}\n size={errorProps?.size || sharedProps.size}\n key=\"error\"\n id={errorProps?.id || errorId}\n >\n {error}\n </InputError>\n );\n\n const content = inputWrapperOrder!.map((part) => {\n switch (part) {\n case 'label':\n return _label;\n case 'input':\n return _input;\n case 'description':\n return _description;\n case 'error':\n return _error;\n default:\n return null;\n }\n });\n\n return (\n <InputWrapperProvider\n value={{\n getStyles,\n describedBy,\n inputId,\n ...getInputOffsets(inputWrapperOrder!, { hasDescription, hasError }),\n }}\n >\n <Box ref={ref} variant={variant} size={size} {...getStyles('root')} {...others}>\n {content}\n </Box>\n </InputWrapperProvider>\n );\n});\n\nInputWrapper.classes = classes;\n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EAAE,cAAc,EAAE,QAAQ,EAAE,CAAC,CAAC;AAC1E,KAAK;AACL,oBAAoB,KAAK,CAAC,aAAa,CAAC,GAAG,EAAE,cAAc,CAAC,cAAc,CAAC,EAAE,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,EAAE,OAAO,CAAC;AACxI,GAAG,CAAC;AACJ,CAAC,EAAE;AACH,YAAY,CAAC,OAAO,GAAG,OAAO,CAAC;AAC/B,YAAY,CAAC,WAAW,GAAG,4BAA4B;;;;"}
|
|
@@ -221,7 +221,8 @@ const PasswordInput = factory((_props, ref) => {
|
|
|
221
221
|
rightSectionPointerEvents: "all",
|
|
222
222
|
rightSectionProps,
|
|
223
223
|
leftSectionProps,
|
|
224
|
-
leftSectionPointerEvents
|
|
224
|
+
leftSectionPointerEvents,
|
|
225
|
+
withAria: false
|
|
225
226
|
},
|
|
226
227
|
/* @__PURE__ */ React.createElement(
|
|
227
228
|
"input",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PasswordInput.js","sources":["../../../src/components/PasswordInput/PasswordInput.tsx"],"sourcesContent":["import React from 'react';\nimport cx from 'clsx';\nimport { useId, useUncontrolled } from '@mantine/hooks';\nimport {\n StylesApiProps,\n factory,\n ElementProps,\n useProps,\n useStyles,\n createVarsResolver,\n Factory,\n extractStyleProps,\n useResolvedStylesApi,\n getSize,\n} from '../../core';\nimport { InputBase, InputBaseProps } from '../InputBase';\nimport { Input, InputVariant, __InputStylesNames } from '../Input';\nimport { ActionIcon } from '../ActionIcon';\nimport { PasswordToggleIcon } from './PasswordToggleIcon';\nimport classes from './PasswordInput.module.css';\n\nexport type PasswordInputStylesNames =\n | 'root'\n | 'visibilityToggle'\n | 'innerInput'\n | __InputStylesNames;\nexport type PasswordInputCssVariables = {\n root: '--psi-icon-size' | '--psi-button-size';\n};\n\nexport interface PasswordInputProps\n extends Omit<InputBaseProps, 'classNames' | 'styles' | 'vars'>,\n StylesApiProps<PasswordInputFactory>,\n ElementProps<'input', 'size'> {\n /** Custom visibility toggle icon */\n visibilityToggleIcon?: React.FC<{ reveal: boolean }>;\n\n /** Props passed down to the visibility toggle button */\n visibilityToggleButtonProps?: Record<string, any>;\n\n /** Determines whether input content should be visible (controlled) */\n visible?: boolean;\n\n /** Determines whether input content should be visible (uncontrolled) */\n defaultVisible?: boolean;\n\n /** Called when visibility changes */\n onVisibilityChange?(visible: boolean): void;\n}\n\nexport type PasswordInputFactory = Factory<{\n props: PasswordInputProps;\n ref: HTMLInputElement;\n stylesNames: PasswordInputStylesNames;\n vars: PasswordInputCssVariables;\n variant: InputVariant;\n}>;\n\nconst defaultProps: Partial<PasswordInputProps> = {\n __staticSelector: 'PasswordInput',\n visibilityToggleIcon: PasswordToggleIcon,\n size: 'sm',\n};\n\nconst varsResolver = createVarsResolver<PasswordInputFactory>((_, { size }) => ({\n root: {\n '--psi-icon-size': getSize(size, 'psi-icon-size'),\n '--psi-button-size': getSize(size, 'psi-button-size'),\n },\n}));\n\nexport const PasswordInput = factory<PasswordInputFactory>((_props, ref) => {\n const props = useProps('PasswordInput', defaultProps, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n vars,\n required,\n error,\n leftSection,\n disabled,\n id,\n variant,\n inputContainer,\n description,\n label,\n size,\n __staticSelector,\n errorProps,\n descriptionProps,\n labelProps,\n withAsterisk,\n inputWrapperOrder,\n wrapperProps,\n radius,\n rightSection,\n rightSectionWidth,\n leftSectionWidth,\n visible,\n defaultVisible,\n onVisibilityChange,\n visibilityToggleIcon,\n visibilityToggleButtonProps,\n rightSectionProps,\n leftSectionProps,\n leftSectionPointerEvents,\n ...others\n } = props;\n\n const uuid = useId(id);\n\n const [_visible, setVisibility] = useUncontrolled({\n value: visible,\n defaultValue: defaultVisible,\n finalValue: false,\n onChange: onVisibilityChange,\n });\n\n const toggleVisibility = () => setVisibility(!_visible);\n\n const getStyles = useStyles<PasswordInputFactory>({\n name: 'PasswordInput',\n classes,\n props,\n className,\n style,\n classNames,\n styles,\n unstyled,\n vars,\n varsResolver,\n });\n\n const { resolvedClassNames, resolvedStyles } = useResolvedStylesApi<PasswordInputFactory>({\n classNames,\n styles,\n props,\n });\n\n const { styleProps, rest } = extractStyleProps(others);\n const VisibilityToggleIcon = visibilityToggleIcon!;\n\n const visibilityToggleButton = (\n <ActionIcon<'button'>\n {...getStyles('visibilityToggle')}\n radius={radius}\n aria-hidden={!visibilityToggleButtonProps}\n {...visibilityToggleButtonProps}\n variant=\"subtle\"\n color=\"gray\"\n unstyled={unstyled}\n onMouseDown={(event) => {\n event.preventDefault();\n toggleVisibility();\n }}\n onKeyDown={(event) => {\n if (event.key === ' ') {\n event.preventDefault();\n toggleVisibility();\n }\n }}\n >\n <VisibilityToggleIcon reveal={_visible} />\n </ActionIcon>\n );\n\n return (\n <Input.Wrapper\n required={required}\n id={uuid}\n label={label}\n error={error}\n description={description}\n size={size}\n classNames={resolvedClassNames}\n styles={resolvedStyles}\n __staticSelector={__staticSelector}\n errorProps={errorProps}\n descriptionProps={descriptionProps}\n unstyled={unstyled}\n withAsterisk={withAsterisk}\n inputWrapperOrder={inputWrapperOrder}\n inputContainer={inputContainer}\n variant={variant}\n labelProps={{ ...labelProps, htmlFor: uuid }}\n {...getStyles('root')}\n {...styleProps}\n {...wrapperProps}\n >\n <Input<'div'>\n component=\"div\"\n error={error}\n leftSection={leftSection}\n size={size}\n classNames={{ ...resolvedClassNames, input: cx(classes.input, resolvedClassNames.input) }}\n styles={resolvedStyles}\n radius={radius}\n disabled={disabled}\n __staticSelector={__staticSelector}\n rightSectionWidth={rightSectionWidth}\n rightSection={rightSection ?? visibilityToggleButton}\n variant={variant}\n unstyled={unstyled}\n leftSectionWidth={leftSectionWidth}\n rightSectionPointerEvents=\"all\"\n rightSectionProps={rightSectionProps}\n leftSectionProps={leftSectionProps}\n leftSectionPointerEvents={leftSectionPointerEvents}\n >\n <input\n required={required}\n data-invalid={!!error || undefined}\n data-with-left-section={!!leftSection || undefined}\n {...getStyles('innerInput')}\n disabled={disabled}\n id={uuid}\n ref={ref}\n {...rest}\n autoComplete={rest.autoComplete || 'off'}\n type={_visible ? 'text' : 'password'}\n />\n </Input>\n </Input.Wrapper>\n );\n});\n\nPasswordInput.classes = { ...InputBase.classes, ...classes };\nPasswordInput.displayName = '@mantine/core/PasswordInput';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,IAAI,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC;AACtC,IAAI,UAAU,GAAG,MAAM,CAAC,gBAAgB,CAAC;AACzC,IAAI,iBAAiB,GAAG,MAAM,CAAC,yBAAyB,CAAC;AACzD,IAAI,mBAAmB,GAAG,MAAM,CAAC,qBAAqB,CAAC;AACvD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC;AACnD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,oBAAoB,CAAC;AACzD,IAAI,eAAe,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,KAAK,GAAG,IAAI,GAAG,GAAG,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AAChK,IAAI,cAAc,GAAG,CAAC,CAAC,EAAE,CAAC,KAAK;AAC/B,EAAE,KAAK,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC;AAChC,IAAI,IAAI,YAAY,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC;AAClC,MAAM,eAAe,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;AACxC,EAAE,IAAI,mBAAmB;AACzB,IAAI,KAAK,IAAI,IAAI,IAAI,mBAAmB,CAAC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AAC,cAAc,CAAC;AAClE,UAAU,QAAQ;AAClB,UAAU,cAAc,EAAE,CAAC,CAAC,KAAK,IAAI,KAAK,CAAC;AAC3C,UAAU,wBAAwB,EAAE,CAAC,CAAC,WAAW,IAAI,KAAK,CAAC;AAC3D,SAAS,EAAE,SAAS,CAAC,YAAY,CAAC,CAAC,EAAE;AACrC,UAAU,QAAQ;AAClB,UAAU,EAAE,EAAE,IAAI;AAClB,UAAU,GAAG;AACb,SAAS,CAAC,EAAE,IAAI,CAAC,EAAE;AACnB,UAAU,YAAY,EAAE,IAAI,CAAC,YAAY,IAAI,KAAK;AAClD,UAAU,IAAI,EAAE,QAAQ,GAAG,MAAM,GAAG,UAAU;AAC9C,SAAS,CAAC;AACV,OAAO;AACP,KAAK;AACL,GAAG,CAAC;AACJ,CAAC,EAAE;AACH,aAAa,CAAC,OAAO,GAAG,cAAc,CAAC,cAAc,CAAC,EAAE,EAAE,SAAS,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,CAAC;AACvF,aAAa,CAAC,WAAW,GAAG,6BAA6B;;;;"}
|
|
1
|
+
{"version":3,"file":"PasswordInput.js","sources":["../../../src/components/PasswordInput/PasswordInput.tsx"],"sourcesContent":["import React from 'react';\nimport cx from 'clsx';\nimport { useId, useUncontrolled } from '@mantine/hooks';\nimport {\n StylesApiProps,\n factory,\n ElementProps,\n useProps,\n useStyles,\n createVarsResolver,\n Factory,\n extractStyleProps,\n useResolvedStylesApi,\n getSize,\n} from '../../core';\nimport { InputBase, InputBaseProps } from '../InputBase';\nimport { Input, InputVariant, __InputStylesNames } from '../Input';\nimport { ActionIcon } from '../ActionIcon';\nimport { PasswordToggleIcon } from './PasswordToggleIcon';\nimport classes from './PasswordInput.module.css';\n\nexport type PasswordInputStylesNames =\n | 'root'\n | 'visibilityToggle'\n | 'innerInput'\n | __InputStylesNames;\nexport type PasswordInputCssVariables = {\n root: '--psi-icon-size' | '--psi-button-size';\n};\n\nexport interface PasswordInputProps\n extends Omit<InputBaseProps, 'classNames' | 'styles' | 'vars'>,\n StylesApiProps<PasswordInputFactory>,\n ElementProps<'input', 'size'> {\n /** Custom visibility toggle icon */\n visibilityToggleIcon?: React.FC<{ reveal: boolean }>;\n\n /** Props passed down to the visibility toggle button */\n visibilityToggleButtonProps?: Record<string, any>;\n\n /** Determines whether input content should be visible (controlled) */\n visible?: boolean;\n\n /** Determines whether input content should be visible (uncontrolled) */\n defaultVisible?: boolean;\n\n /** Called when visibility changes */\n onVisibilityChange?(visible: boolean): void;\n}\n\nexport type PasswordInputFactory = Factory<{\n props: PasswordInputProps;\n ref: HTMLInputElement;\n stylesNames: PasswordInputStylesNames;\n vars: PasswordInputCssVariables;\n variant: InputVariant;\n}>;\n\nconst defaultProps: Partial<PasswordInputProps> = {\n __staticSelector: 'PasswordInput',\n visibilityToggleIcon: PasswordToggleIcon,\n size: 'sm',\n};\n\nconst varsResolver = createVarsResolver<PasswordInputFactory>((_, { size }) => ({\n root: {\n '--psi-icon-size': getSize(size, 'psi-icon-size'),\n '--psi-button-size': getSize(size, 'psi-button-size'),\n },\n}));\n\nexport const PasswordInput = factory<PasswordInputFactory>((_props, ref) => {\n const props = useProps('PasswordInput', defaultProps, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n vars,\n required,\n error,\n leftSection,\n disabled,\n id,\n variant,\n inputContainer,\n description,\n label,\n size,\n __staticSelector,\n errorProps,\n descriptionProps,\n labelProps,\n withAsterisk,\n inputWrapperOrder,\n wrapperProps,\n radius,\n rightSection,\n rightSectionWidth,\n leftSectionWidth,\n visible,\n defaultVisible,\n onVisibilityChange,\n visibilityToggleIcon,\n visibilityToggleButtonProps,\n rightSectionProps,\n leftSectionProps,\n leftSectionPointerEvents,\n ...others\n } = props;\n\n const uuid = useId(id);\n\n const [_visible, setVisibility] = useUncontrolled({\n value: visible,\n defaultValue: defaultVisible,\n finalValue: false,\n onChange: onVisibilityChange,\n });\n\n const toggleVisibility = () => setVisibility(!_visible);\n\n const getStyles = useStyles<PasswordInputFactory>({\n name: 'PasswordInput',\n classes,\n props,\n className,\n style,\n classNames,\n styles,\n unstyled,\n vars,\n varsResolver,\n });\n\n const { resolvedClassNames, resolvedStyles } = useResolvedStylesApi<PasswordInputFactory>({\n classNames,\n styles,\n props,\n });\n\n const { styleProps, rest } = extractStyleProps(others);\n const VisibilityToggleIcon = visibilityToggleIcon!;\n\n const visibilityToggleButton = (\n <ActionIcon<'button'>\n {...getStyles('visibilityToggle')}\n radius={radius}\n aria-hidden={!visibilityToggleButtonProps}\n {...visibilityToggleButtonProps}\n variant=\"subtle\"\n color=\"gray\"\n unstyled={unstyled}\n onMouseDown={(event) => {\n event.preventDefault();\n toggleVisibility();\n }}\n onKeyDown={(event) => {\n if (event.key === ' ') {\n event.preventDefault();\n toggleVisibility();\n }\n }}\n >\n <VisibilityToggleIcon reveal={_visible} />\n </ActionIcon>\n );\n\n return (\n <Input.Wrapper\n required={required}\n id={uuid}\n label={label}\n error={error}\n description={description}\n size={size}\n classNames={resolvedClassNames}\n styles={resolvedStyles}\n __staticSelector={__staticSelector}\n errorProps={errorProps}\n descriptionProps={descriptionProps}\n unstyled={unstyled}\n withAsterisk={withAsterisk}\n inputWrapperOrder={inputWrapperOrder}\n inputContainer={inputContainer}\n variant={variant}\n labelProps={{ ...labelProps, htmlFor: uuid }}\n {...getStyles('root')}\n {...styleProps}\n {...wrapperProps}\n >\n <Input<'div'>\n component=\"div\"\n error={error}\n leftSection={leftSection}\n size={size}\n classNames={{ ...resolvedClassNames, input: cx(classes.input, resolvedClassNames.input) }}\n styles={resolvedStyles}\n radius={radius}\n disabled={disabled}\n __staticSelector={__staticSelector}\n rightSectionWidth={rightSectionWidth}\n rightSection={rightSection ?? visibilityToggleButton}\n variant={variant}\n unstyled={unstyled}\n leftSectionWidth={leftSectionWidth}\n rightSectionPointerEvents=\"all\"\n rightSectionProps={rightSectionProps}\n leftSectionProps={leftSectionProps}\n leftSectionPointerEvents={leftSectionPointerEvents}\n withAria={false}\n >\n <input\n required={required}\n data-invalid={!!error || undefined}\n data-with-left-section={!!leftSection || undefined}\n {...getStyles('innerInput')}\n disabled={disabled}\n id={uuid}\n ref={ref}\n {...rest}\n autoComplete={rest.autoComplete || 'off'}\n type={_visible ? 'text' : 'password'}\n />\n </Input>\n </Input.Wrapper>\n );\n});\n\nPasswordInput.classes = { ...InputBase.classes, ...classes };\nPasswordInput.displayName = '@mantine/core/PasswordInput';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,IAAI,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC;AACtC,IAAI,UAAU,GAAG,MAAM,CAAC,gBAAgB,CAAC;AACzC,IAAI,iBAAiB,GAAG,MAAM,CAAC,yBAAyB,CAAC;AACzD,IAAI,mBAAmB,GAAG,MAAM,CAAC,qBAAqB,CAAC;AACvD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC;AACnD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,oBAAoB,CAAC;AACzD,IAAI,eAAe,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,KAAK,GAAG,IAAI,GAAG,GAAG,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AAChK,IAAI,cAAc,GAAG,CAAC,CAAC,EAAE,CAAC,KAAK;AAC/B,EAAE,KAAK,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC;AAChC,IAAI,IAAI,YAAY,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC;AAClC,MAAM,eAAe,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;AACxC,EAAE,IAAI,mBAAmB;AACzB,IAAI,KAAK,IAAI,IAA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AQ,OAAO;AACf,QAAQ,aAAa,CAAC,cAAc,CAAC,aAAa,CAAC,cAAc,CAAC;AAClE,UAAU,QAAQ;AAClB,UAAU,cAAc,EAAE,CAAC,CAAC,KAAK,IAAI,KAAK,CAAC;AAC3C,UAAU,wBAAwB,EAAE,CAAC,CAAC,WAAW,IAAI,KAAK,CAAC;AAC3D,SAAS,EAAE,SAAS,CAAC,YAAY,CAAC,CAAC,EAAE;AACrC,UAAU,QAAQ;AAClB,UAAU,EAAE,EAAE,IAAI;AAClB,UAAU,GAAG;AACb,SAAS,CAAC,EAAE,IAAI,CAAC,EAAE;AACnB,UAAU,YAAY,EAAE,IAAI,CAAC,YAAY,IAAI,KAAK;AAClD,UAAU,IAAI,EAAE,QAAQ,GAAG,MAAM,GAAG,UAAU;AAC9C,SAAS,CAAC;AACV,OAAO;AACP,KAAK;AACL,GAAG,CAAC;AACJ,CAAC,EAAE;AACH,aAAa,CAAC,OAAO,GAAG,cAAc,CAAC,cAAc,CAAC,EAAE,EAAE,SAAS,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,CAAC;AACvF,aAAa,CAAC,WAAW,GAAG,6BAA6B;;;;"}
|
|
@@ -5,6 +5,9 @@ function colorResolver(color, theme) {
|
|
|
5
5
|
if (parsedColor.color === "dimmed") {
|
|
6
6
|
return "var(--mantine-color-dimmed)";
|
|
7
7
|
}
|
|
8
|
+
if (parsedColor.color === "bright") {
|
|
9
|
+
return "var(--mantine-color-bright)";
|
|
10
|
+
}
|
|
8
11
|
return parsedColor.variable ? `var(${parsedColor.variable})` : parsedColor.color;
|
|
9
12
|
}
|
|
10
13
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"color-resolver.js","sources":["../../../../../../src/core/Box/style-props/resolvers/color-resolver/color-resolver.ts"],"sourcesContent":["import { MantineTheme, parseThemeColor } from '../../../../MantineProvider';\n\nexport function colorResolver(color: unknown, theme: MantineTheme) {\n const parsedColor = parseThemeColor({ color, theme });\n\n if (parsedColor.color === 'dimmed') {\n return 'var(--mantine-color-dimmed)';\n }\n\n return parsedColor.variable ? `var(${parsedColor.variable})` : parsedColor.color;\n}\n"],"names":[],"mappings":";;AACO,SAAS,aAAa,CAAC,KAAK,EAAE,KAAK,EAAE;AAC5C,EAAE,MAAM,WAAW,GAAG,eAAe,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;AACxD,EAAE,IAAI,WAAW,CAAC,KAAK,KAAK,QAAQ,EAAE;AACtC,IAAI,OAAO,6BAA6B,CAAC;AACzC,GAAG;AACH,EAAE,OAAO,WAAW,CAAC,QAAQ,GAAG,CAAC,IAAI,EAAE,WAAW,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,WAAW,CAAC,KAAK,CAAC;AACnF;;;;"}
|
|
1
|
+
{"version":3,"file":"color-resolver.js","sources":["../../../../../../src/core/Box/style-props/resolvers/color-resolver/color-resolver.ts"],"sourcesContent":["import { MantineTheme, parseThemeColor } from '../../../../MantineProvider';\n\nexport function colorResolver(color: unknown, theme: MantineTheme) {\n const parsedColor = parseThemeColor({ color, theme });\n\n if (parsedColor.color === 'dimmed') {\n return 'var(--mantine-color-dimmed)';\n }\n\n if (parsedColor.color === 'bright') {\n return 'var(--mantine-color-bright)';\n }\n\n return parsedColor.variable ? `var(${parsedColor.variable})` : parsedColor.color;\n}\n"],"names":[],"mappings":";;AACO,SAAS,aAAa,CAAC,KAAK,EAAE,KAAK,EAAE;AAC5C,EAAE,MAAM,WAAW,GAAG,eAAe,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;AACxD,EAAE,IAAI,WAAW,CAAC,KAAK,KAAK,QAAQ,EAAE;AACtC,IAAI,OAAO,6BAA6B,CAAC;AACzC,GAAG;AACH,EAAE,IAAI,WAAW,CAAC,KAAK,KAAK,QAAQ,EAAE;AACtC,IAAI,OAAO,6BAA6B,CAAC;AACzC,GAAG;AACH,EAAE,OAAO,WAAW,CAAC,QAAQ,GAAG,CAAC,IAAI,EAAE,WAAW,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,WAAW,CAAC,KAAK,CAAC;AACnF;;;;"}
|
|
@@ -35,6 +35,7 @@ const defaultCssVariablesResolver = (theme) => {
|
|
|
35
35
|
"--mantine-primary-color-light-color": `var(--mantine-color-${theme.primaryColor}-light-color)`
|
|
36
36
|
},
|
|
37
37
|
light: {
|
|
38
|
+
"--mantine-color-bright": "var(--mantine-color-black)",
|
|
38
39
|
"--mantine-color-text": theme.black,
|
|
39
40
|
"--mantine-color-body": theme.white,
|
|
40
41
|
"--mantine-color-error": theme.colors.red[6],
|
|
@@ -46,6 +47,7 @@ const defaultCssVariablesResolver = (theme) => {
|
|
|
46
47
|
"--mantine-color-default-border": theme.colors.gray[4]
|
|
47
48
|
},
|
|
48
49
|
dark: {
|
|
50
|
+
"--mantine-color-bright": "var(--mantine-color-white)",
|
|
49
51
|
"--mantine-color-text": "var(--mantine-color-dark-0)",
|
|
50
52
|
"--mantine-color-body": theme.colors.dark[7],
|
|
51
53
|
"--mantine-color-error": theme.colors.red[9],
|
|
@@ -91,13 +93,13 @@ const defaultCssVariablesResolver = (theme) => {
|
|
|
91
93
|
result.dark[`--mantine-color-${color}-filled-hover`] = darkFilledHover;
|
|
92
94
|
result.dark[`--mantine-color-${color}-light`] = rgba(
|
|
93
95
|
theme.colors[color][Math.max(0, darkPrimaryShade - 2)],
|
|
94
|
-
0.
|
|
96
|
+
0.15
|
|
95
97
|
);
|
|
96
98
|
result.dark[`--mantine-color-${color}-light-hover`] = rgba(
|
|
97
99
|
theme.colors[color][Math.max(0, darkPrimaryShade - 2)],
|
|
98
|
-
0.
|
|
100
|
+
0.2
|
|
99
101
|
);
|
|
100
|
-
result.dark[`--mantine-color-${color}-light-color`] = theme.colors[color][Math.max(darkPrimaryShade -
|
|
102
|
+
result.dark[`--mantine-color-${color}-light-color`] = theme.colors[color][Math.max(darkPrimaryShade - 5, 0)];
|
|
101
103
|
result.dark[`--mantine-color-${color}-outline`] = theme.colors[color][Math.max(darkPrimaryShade - 4, 0)];
|
|
102
104
|
result.dark[`--mantine-color-${color}-outline-hover`] = rgba(
|
|
103
105
|
theme.colors[color][Math.max(darkPrimaryShade - 4, 0)],
|