@moderneinc/design-system-components 6.0.1-next.4a88f2 → 6.0.1-next.d93b1a
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 +8 -971
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +49 -1012
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.esm.js
CHANGED
|
@@ -7,8 +7,9 @@ import MuiAvatar from '@mui/material/Avatar';
|
|
|
7
7
|
import SvgIcon from '@mui/material/SvgIcon';
|
|
8
8
|
import Alert, { alertClasses } from '@mui/material/Alert';
|
|
9
9
|
import ButtonBase, { buttonBaseClasses } from '@mui/material/ButtonBase';
|
|
10
|
-
import
|
|
10
|
+
import { BadgeInfo, WifiOff, TriangleAlert, CircleAlert, CircleCheckBig, X, ChevronRight, Square, SquareCheck, SquareMinus, Search, ChevronDown, Plus, Trash2, ArrowUp, ArrowDown, ChevronsUpDown, Columns3, ListFilter, HelpCircle, CalendarDays, Minus, ChevronLeft, AlertCircle, ChevronUp } from 'lucide-react';
|
|
11
11
|
import IconButton, { iconButtonClasses } from '@mui/material/IconButton';
|
|
12
|
+
import React, { useState, useRef, useCallback, useMemo, useEffect, createContext, useContext, useLayoutEffect, Children, isValidElement, cloneElement, forwardRef } from 'react';
|
|
12
13
|
import Breadcrumbs, { breadcrumbsClasses } from '@mui/material/Breadcrumbs';
|
|
13
14
|
import Link from '@mui/material/Link';
|
|
14
15
|
import CircularProgress from '@mui/material/CircularProgress';
|
|
@@ -36,6 +37,7 @@ import { pickersCalendarHeaderClasses } from '@mui/x-date-pickers/PickersCalenda
|
|
|
36
37
|
import { PickersShortcuts } from '@mui/x-date-pickers/PickersShortcuts';
|
|
37
38
|
import { DateRangePicker } from '@mui/x-date-pickers-pro/DateRangePicker';
|
|
38
39
|
import { dateRangePickerDayClasses } from '@mui/x-date-pickers-pro/DateRangePickerDay';
|
|
40
|
+
import { startOfDay, endOfDay, subDays, startOfMonth, subMonths, endOfMonth, startOfYear } from 'date-fns';
|
|
39
41
|
import LinearProgress, { linearProgressClasses } from '@mui/material/LinearProgress';
|
|
40
42
|
import Paper, { paperClasses } from '@mui/material/Paper';
|
|
41
43
|
import Stack from '@mui/material/Stack';
|
|
@@ -455,499 +457,6 @@ const ModActivityIndicatorCell = ({ event = 'commit-job', secondaryEvent, scene
|
|
|
455
457
|
};
|
|
456
458
|
ModActivityIndicatorCell.displayName = 'ModActivityIndicatorCell';
|
|
457
459
|
|
|
458
|
-
/**
|
|
459
|
-
* @license lucide-react v1.28.0 - ISC
|
|
460
|
-
*
|
|
461
|
-
* This source code is licensed under the ISC license.
|
|
462
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
463
|
-
*/
|
|
464
|
-
|
|
465
|
-
const mergeClasses = (...classes) => classes.filter((className, index, array) => {
|
|
466
|
-
return Boolean(className) && className.trim() !== "" && array.indexOf(className) === index;
|
|
467
|
-
}).join(" ").trim();
|
|
468
|
-
|
|
469
|
-
/**
|
|
470
|
-
* @license lucide-react v1.28.0 - ISC
|
|
471
|
-
*
|
|
472
|
-
* This source code is licensed under the ISC license.
|
|
473
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
474
|
-
*/
|
|
475
|
-
|
|
476
|
-
const toKebabCase = (string) => string.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
|
477
|
-
|
|
478
|
-
/**
|
|
479
|
-
* @license lucide-react v1.28.0 - ISC
|
|
480
|
-
*
|
|
481
|
-
* This source code is licensed under the ISC license.
|
|
482
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
483
|
-
*/
|
|
484
|
-
|
|
485
|
-
const toCamelCase = (string) => string.replace(
|
|
486
|
-
/^([A-Z])|[\s-_]+(\w)/g,
|
|
487
|
-
(match, p1, p2) => p2 ? p2.toUpperCase() : p1.toLowerCase()
|
|
488
|
-
);
|
|
489
|
-
|
|
490
|
-
/**
|
|
491
|
-
* @license lucide-react v1.28.0 - ISC
|
|
492
|
-
*
|
|
493
|
-
* This source code is licensed under the ISC license.
|
|
494
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
495
|
-
*/
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
const toPascalCase = (string) => {
|
|
499
|
-
const camelCase = toCamelCase(string);
|
|
500
|
-
return camelCase.charAt(0).toUpperCase() + camelCase.slice(1);
|
|
501
|
-
};
|
|
502
|
-
|
|
503
|
-
/**
|
|
504
|
-
* @license lucide-react v1.28.0 - ISC
|
|
505
|
-
*
|
|
506
|
-
* This source code is licensed under the ISC license.
|
|
507
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
508
|
-
*/
|
|
509
|
-
|
|
510
|
-
var defaultAttributes = {
|
|
511
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
512
|
-
width: 24,
|
|
513
|
-
height: 24,
|
|
514
|
-
viewBox: "0 0 24 24",
|
|
515
|
-
fill: "none",
|
|
516
|
-
stroke: "currentColor",
|
|
517
|
-
strokeWidth: 2,
|
|
518
|
-
strokeLinecap: "round",
|
|
519
|
-
strokeLinejoin: "round"
|
|
520
|
-
};
|
|
521
|
-
|
|
522
|
-
/**
|
|
523
|
-
* @license lucide-react v1.28.0 - ISC
|
|
524
|
-
*
|
|
525
|
-
* This source code is licensed under the ISC license.
|
|
526
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
527
|
-
*/
|
|
528
|
-
|
|
529
|
-
const hasA11yProp = (props) => {
|
|
530
|
-
for (const prop in props) {
|
|
531
|
-
if (prop.startsWith("aria-") || prop === "role" || prop === "title") {
|
|
532
|
-
return true;
|
|
533
|
-
}
|
|
534
|
-
}
|
|
535
|
-
return false;
|
|
536
|
-
};
|
|
537
|
-
|
|
538
|
-
const LucideContext = createContext({});
|
|
539
|
-
const useLucideContext = () => useContext(LucideContext);
|
|
540
|
-
|
|
541
|
-
const Icon = forwardRef(
|
|
542
|
-
({ color, size, strokeWidth, absoluteStrokeWidth, className = "", children, iconNode, ...rest }, ref) => {
|
|
543
|
-
const {
|
|
544
|
-
size: contextSize = 24,
|
|
545
|
-
strokeWidth: contextStrokeWidth = 2,
|
|
546
|
-
absoluteStrokeWidth: contextAbsoluteStrokeWidth = false,
|
|
547
|
-
color: contextColor = "currentColor",
|
|
548
|
-
className: contextClass = ""
|
|
549
|
-
} = useLucideContext() ?? {};
|
|
550
|
-
const calculatedStrokeWidth = absoluteStrokeWidth ?? contextAbsoluteStrokeWidth ? Number(strokeWidth ?? contextStrokeWidth) * 24 / Number(size ?? contextSize) : strokeWidth ?? contextStrokeWidth;
|
|
551
|
-
return createElement(
|
|
552
|
-
"svg",
|
|
553
|
-
{
|
|
554
|
-
ref,
|
|
555
|
-
...defaultAttributes,
|
|
556
|
-
width: size ?? contextSize ?? defaultAttributes.width,
|
|
557
|
-
height: size ?? contextSize ?? defaultAttributes.height,
|
|
558
|
-
stroke: color ?? contextColor,
|
|
559
|
-
strokeWidth: calculatedStrokeWidth,
|
|
560
|
-
className: mergeClasses("lucide", contextClass, className),
|
|
561
|
-
...!children && !hasA11yProp(rest) && { "aria-hidden": "true" },
|
|
562
|
-
...rest
|
|
563
|
-
},
|
|
564
|
-
[
|
|
565
|
-
...iconNode.map(([tag, attrs]) => createElement(tag, attrs)),
|
|
566
|
-
...Array.isArray(children) ? children : [children]
|
|
567
|
-
]
|
|
568
|
-
);
|
|
569
|
-
}
|
|
570
|
-
);
|
|
571
|
-
|
|
572
|
-
/**
|
|
573
|
-
* @license lucide-react v1.28.0 - ISC
|
|
574
|
-
*
|
|
575
|
-
* This source code is licensed under the ISC license.
|
|
576
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
577
|
-
*/
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
const createLucideIcon = (iconName, iconNode) => {
|
|
581
|
-
const Component = forwardRef(
|
|
582
|
-
({ className, ...props }, ref) => createElement(Icon, {
|
|
583
|
-
ref,
|
|
584
|
-
iconNode,
|
|
585
|
-
className: mergeClasses(
|
|
586
|
-
`lucide-${toKebabCase(toPascalCase(iconName))}`,
|
|
587
|
-
`lucide-${iconName}`,
|
|
588
|
-
className
|
|
589
|
-
),
|
|
590
|
-
...props
|
|
591
|
-
})
|
|
592
|
-
);
|
|
593
|
-
Component.displayName = toPascalCase(iconName);
|
|
594
|
-
return Component;
|
|
595
|
-
};
|
|
596
|
-
|
|
597
|
-
/**
|
|
598
|
-
* @license lucide-react v1.28.0 - ISC
|
|
599
|
-
*
|
|
600
|
-
* This source code is licensed under the ISC license.
|
|
601
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
602
|
-
*/
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
const __iconNode$n = [
|
|
606
|
-
["path", { d: "M12 5v14", key: "s699le" }],
|
|
607
|
-
["path", { d: "m19 12-7 7-7-7", key: "1idqje" }]
|
|
608
|
-
];
|
|
609
|
-
const ArrowDown = createLucideIcon("arrow-down", __iconNode$n);
|
|
610
|
-
|
|
611
|
-
/**
|
|
612
|
-
* @license lucide-react v1.28.0 - ISC
|
|
613
|
-
*
|
|
614
|
-
* This source code is licensed under the ISC license.
|
|
615
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
616
|
-
*/
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
const __iconNode$m = [
|
|
620
|
-
["path", { d: "m5 12 7-7 7 7", key: "hav0vg" }],
|
|
621
|
-
["path", { d: "M12 19V5", key: "x0mq9r" }]
|
|
622
|
-
];
|
|
623
|
-
const ArrowUp = createLucideIcon("arrow-up", __iconNode$m);
|
|
624
|
-
|
|
625
|
-
/**
|
|
626
|
-
* @license lucide-react v1.28.0 - ISC
|
|
627
|
-
*
|
|
628
|
-
* This source code is licensed under the ISC license.
|
|
629
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
630
|
-
*/
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
const __iconNode$l = [
|
|
634
|
-
[
|
|
635
|
-
"path",
|
|
636
|
-
{
|
|
637
|
-
d: "M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z",
|
|
638
|
-
key: "3c2336"
|
|
639
|
-
}
|
|
640
|
-
],
|
|
641
|
-
["line", { x1: "12", x2: "12", y1: "16", y2: "12", key: "1y1yb1" }],
|
|
642
|
-
["line", { x1: "12", x2: "12.01", y1: "8", y2: "8", key: "110wyk" }]
|
|
643
|
-
];
|
|
644
|
-
const BadgeInfo = createLucideIcon("badge-info", __iconNode$l);
|
|
645
|
-
|
|
646
|
-
/**
|
|
647
|
-
* @license lucide-react v1.28.0 - ISC
|
|
648
|
-
*
|
|
649
|
-
* This source code is licensed under the ISC license.
|
|
650
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
651
|
-
*/
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
const __iconNode$k = [
|
|
655
|
-
["path", { d: "M8 2v3", key: "1ioesn" }],
|
|
656
|
-
["path", { d: "M16 2v3", key: "otl347" }],
|
|
657
|
-
["rect", { x: "3", y: "3", width: "18", height: "18", rx: "2", key: "h1oib" }],
|
|
658
|
-
["path", { d: "M3 9h18", key: "1pudct" }],
|
|
659
|
-
["path", { d: "M8 13h.01", key: "1sbv64" }],
|
|
660
|
-
["path", { d: "M12 13h.01", key: "y0uutt" }],
|
|
661
|
-
["path", { d: "M16 13h.01", key: "wip0gl" }],
|
|
662
|
-
["path", { d: "M8 17h.01", key: "p3bg7i" }],
|
|
663
|
-
["path", { d: "M12 17h.01", key: "p32p05" }],
|
|
664
|
-
["path", { d: "M16 17h.01", key: "ql8jdd" }]
|
|
665
|
-
];
|
|
666
|
-
const CalendarDays = createLucideIcon("calendar-days", __iconNode$k);
|
|
667
|
-
|
|
668
|
-
/**
|
|
669
|
-
* @license lucide-react v1.28.0 - ISC
|
|
670
|
-
*
|
|
671
|
-
* This source code is licensed under the ISC license.
|
|
672
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
673
|
-
*/
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
const __iconNode$j = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]];
|
|
677
|
-
const ChevronDown = createLucideIcon("chevron-down", __iconNode$j);
|
|
678
|
-
|
|
679
|
-
/**
|
|
680
|
-
* @license lucide-react v1.28.0 - ISC
|
|
681
|
-
*
|
|
682
|
-
* This source code is licensed under the ISC license.
|
|
683
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
684
|
-
*/
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
const __iconNode$i = [["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]];
|
|
688
|
-
const ChevronLeft = createLucideIcon("chevron-left", __iconNode$i);
|
|
689
|
-
|
|
690
|
-
/**
|
|
691
|
-
* @license lucide-react v1.28.0 - ISC
|
|
692
|
-
*
|
|
693
|
-
* This source code is licensed under the ISC license.
|
|
694
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
695
|
-
*/
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
const __iconNode$h = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]];
|
|
699
|
-
const ChevronRight = createLucideIcon("chevron-right", __iconNode$h);
|
|
700
|
-
|
|
701
|
-
/**
|
|
702
|
-
* @license lucide-react v1.28.0 - ISC
|
|
703
|
-
*
|
|
704
|
-
* This source code is licensed under the ISC license.
|
|
705
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
706
|
-
*/
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
const __iconNode$g = [["path", { d: "m18 15-6-6-6 6", key: "153udz" }]];
|
|
710
|
-
const ChevronUp = createLucideIcon("chevron-up", __iconNode$g);
|
|
711
|
-
|
|
712
|
-
/**
|
|
713
|
-
* @license lucide-react v1.28.0 - ISC
|
|
714
|
-
*
|
|
715
|
-
* This source code is licensed under the ISC license.
|
|
716
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
717
|
-
*/
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
const __iconNode$f = [
|
|
721
|
-
["path", { d: "m7 15 5 5 5-5", key: "1hf1tw" }],
|
|
722
|
-
["path", { d: "m7 9 5-5 5 5", key: "sgt6xg" }]
|
|
723
|
-
];
|
|
724
|
-
const ChevronsUpDown = createLucideIcon("chevrons-up-down", __iconNode$f);
|
|
725
|
-
|
|
726
|
-
/**
|
|
727
|
-
* @license lucide-react v1.28.0 - ISC
|
|
728
|
-
*
|
|
729
|
-
* This source code is licensed under the ISC license.
|
|
730
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
731
|
-
*/
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
const __iconNode$e = [
|
|
735
|
-
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
736
|
-
["line", { x1: "12", x2: "12", y1: "8", y2: "12", key: "1pkeuh" }],
|
|
737
|
-
["line", { x1: "12", x2: "12.01", y1: "16", y2: "16", key: "4dfq90" }]
|
|
738
|
-
];
|
|
739
|
-
const CircleAlert = createLucideIcon("circle-alert", __iconNode$e);
|
|
740
|
-
|
|
741
|
-
/**
|
|
742
|
-
* @license lucide-react v1.28.0 - ISC
|
|
743
|
-
*
|
|
744
|
-
* This source code is licensed under the ISC license.
|
|
745
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
746
|
-
*/
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
const __iconNode$d = [
|
|
750
|
-
["path", { d: "M21.801 10A10 10 0 1 1 17 3.335", key: "yps3ct" }],
|
|
751
|
-
["path", { d: "m9 11 3 3L22 4", key: "1pflzl" }]
|
|
752
|
-
];
|
|
753
|
-
const CircleCheckBig = createLucideIcon("circle-check-big", __iconNode$d);
|
|
754
|
-
|
|
755
|
-
/**
|
|
756
|
-
* @license lucide-react v1.28.0 - ISC
|
|
757
|
-
*
|
|
758
|
-
* This source code is licensed under the ISC license.
|
|
759
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
760
|
-
*/
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
const __iconNode$c = [
|
|
764
|
-
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
765
|
-
["path", { d: "M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3", key: "1u773s" }],
|
|
766
|
-
["path", { d: "M12 17h.01", key: "p32p05" }]
|
|
767
|
-
];
|
|
768
|
-
const CircleQuestionMark = createLucideIcon("circle-question-mark", __iconNode$c);
|
|
769
|
-
|
|
770
|
-
/**
|
|
771
|
-
* @license lucide-react v1.28.0 - ISC
|
|
772
|
-
*
|
|
773
|
-
* This source code is licensed under the ISC license.
|
|
774
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
775
|
-
*/
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
const __iconNode$b = [
|
|
779
|
-
["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
|
|
780
|
-
["path", { d: "M9 3v18", key: "fh3hqa" }],
|
|
781
|
-
["path", { d: "M15 3v18", key: "14nvp0" }]
|
|
782
|
-
];
|
|
783
|
-
const Columns3 = createLucideIcon("columns-3", __iconNode$b);
|
|
784
|
-
|
|
785
|
-
/**
|
|
786
|
-
* @license lucide-react v1.28.0 - ISC
|
|
787
|
-
*
|
|
788
|
-
* This source code is licensed under the ISC license.
|
|
789
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
790
|
-
*/
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
const __iconNode$a = [
|
|
794
|
-
["path", { d: "M2 5h20", key: "1fs1ex" }],
|
|
795
|
-
["path", { d: "M6 12h12", key: "8npq4p" }],
|
|
796
|
-
["path", { d: "M9 19h6", key: "456am0" }]
|
|
797
|
-
];
|
|
798
|
-
const ListFilter = createLucideIcon("list-filter", __iconNode$a);
|
|
799
|
-
|
|
800
|
-
/**
|
|
801
|
-
* @license lucide-react v1.28.0 - ISC
|
|
802
|
-
*
|
|
803
|
-
* This source code is licensed under the ISC license.
|
|
804
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
805
|
-
*/
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
const __iconNode$9 = [["path", { d: "M5 12h14", key: "1ays0h" }]];
|
|
809
|
-
const Minus = createLucideIcon("minus", __iconNode$9);
|
|
810
|
-
|
|
811
|
-
/**
|
|
812
|
-
* @license lucide-react v1.28.0 - ISC
|
|
813
|
-
*
|
|
814
|
-
* This source code is licensed under the ISC license.
|
|
815
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
816
|
-
*/
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
const __iconNode$8 = [
|
|
820
|
-
["path", { d: "M5 12h14", key: "1ays0h" }],
|
|
821
|
-
["path", { d: "M12 5v14", key: "s699le" }]
|
|
822
|
-
];
|
|
823
|
-
const Plus = createLucideIcon("plus", __iconNode$8);
|
|
824
|
-
|
|
825
|
-
/**
|
|
826
|
-
* @license lucide-react v1.28.0 - ISC
|
|
827
|
-
*
|
|
828
|
-
* This source code is licensed under the ISC license.
|
|
829
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
830
|
-
*/
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
const __iconNode$7 = [
|
|
834
|
-
["path", { d: "m21 21-4.34-4.34", key: "14j7rj" }],
|
|
835
|
-
["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }]
|
|
836
|
-
];
|
|
837
|
-
const Search = createLucideIcon("search", __iconNode$7);
|
|
838
|
-
|
|
839
|
-
/**
|
|
840
|
-
* @license lucide-react v1.28.0 - ISC
|
|
841
|
-
*
|
|
842
|
-
* This source code is licensed under the ISC license.
|
|
843
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
844
|
-
*/
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
const __iconNode$6 = [
|
|
848
|
-
["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
|
|
849
|
-
["path", { d: "m9 12 2 2 4-4", key: "dzmm74" }]
|
|
850
|
-
];
|
|
851
|
-
const SquareCheck = createLucideIcon("square-check", __iconNode$6);
|
|
852
|
-
|
|
853
|
-
/**
|
|
854
|
-
* @license lucide-react v1.28.0 - ISC
|
|
855
|
-
*
|
|
856
|
-
* This source code is licensed under the ISC license.
|
|
857
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
858
|
-
*/
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
const __iconNode$5 = [
|
|
862
|
-
["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
|
|
863
|
-
["path", { d: "M8 12h8", key: "1wcyev" }]
|
|
864
|
-
];
|
|
865
|
-
const SquareMinus = createLucideIcon("square-minus", __iconNode$5);
|
|
866
|
-
|
|
867
|
-
/**
|
|
868
|
-
* @license lucide-react v1.28.0 - ISC
|
|
869
|
-
*
|
|
870
|
-
* This source code is licensed under the ISC license.
|
|
871
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
872
|
-
*/
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
const __iconNode$4 = [
|
|
876
|
-
["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }]
|
|
877
|
-
];
|
|
878
|
-
const Square = createLucideIcon("square", __iconNode$4);
|
|
879
|
-
|
|
880
|
-
/**
|
|
881
|
-
* @license lucide-react v1.28.0 - ISC
|
|
882
|
-
*
|
|
883
|
-
* This source code is licensed under the ISC license.
|
|
884
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
885
|
-
*/
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
const __iconNode$3 = [
|
|
889
|
-
["path", { d: "M10 11v6", key: "nco0om" }],
|
|
890
|
-
["path", { d: "M14 11v6", key: "outv1u" }],
|
|
891
|
-
["path", { d: "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6", key: "miytrc" }],
|
|
892
|
-
["path", { d: "M3 6h18", key: "d0wm0j" }],
|
|
893
|
-
["path", { d: "M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2", key: "e791ji" }]
|
|
894
|
-
];
|
|
895
|
-
const Trash2 = createLucideIcon("trash-2", __iconNode$3);
|
|
896
|
-
|
|
897
|
-
/**
|
|
898
|
-
* @license lucide-react v1.28.0 - ISC
|
|
899
|
-
*
|
|
900
|
-
* This source code is licensed under the ISC license.
|
|
901
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
902
|
-
*/
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
const __iconNode$2 = [
|
|
906
|
-
[
|
|
907
|
-
"path",
|
|
908
|
-
{
|
|
909
|
-
d: "m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",
|
|
910
|
-
key: "wmoenq"
|
|
911
|
-
}
|
|
912
|
-
],
|
|
913
|
-
["path", { d: "M12 9v4", key: "juzpu7" }],
|
|
914
|
-
["path", { d: "M12 17h.01", key: "p32p05" }]
|
|
915
|
-
];
|
|
916
|
-
const TriangleAlert = createLucideIcon("triangle-alert", __iconNode$2);
|
|
917
|
-
|
|
918
|
-
/**
|
|
919
|
-
* @license lucide-react v1.28.0 - ISC
|
|
920
|
-
*
|
|
921
|
-
* This source code is licensed under the ISC license.
|
|
922
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
923
|
-
*/
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
const __iconNode$1 = [
|
|
927
|
-
["path", { d: "M12 20h.01", key: "zekei9" }],
|
|
928
|
-
["path", { d: "M8.5 16.429a5 5 0 0 1 7 0", key: "1bycff" }],
|
|
929
|
-
["path", { d: "M5 12.859a10 10 0 0 1 5.17-2.69", key: "1dl1wf" }],
|
|
930
|
-
["path", { d: "M19 12.859a10 10 0 0 0-2.007-1.523", key: "4k23kn" }],
|
|
931
|
-
["path", { d: "M2 8.82a15 15 0 0 1 4.177-2.643", key: "1grhjp" }],
|
|
932
|
-
["path", { d: "M22 8.82a15 15 0 0 0-11.288-3.764", key: "z3jwby" }],
|
|
933
|
-
["path", { d: "m2 2 20 20", key: "1ooewy" }]
|
|
934
|
-
];
|
|
935
|
-
const WifiOff = createLucideIcon("wifi-off", __iconNode$1);
|
|
936
|
-
|
|
937
|
-
/**
|
|
938
|
-
* @license lucide-react v1.28.0 - ISC
|
|
939
|
-
*
|
|
940
|
-
* This source code is licensed under the ISC license.
|
|
941
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
942
|
-
*/
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
const __iconNode = [
|
|
946
|
-
["path", { d: "M18 6 6 18", key: "1bl5f8" }],
|
|
947
|
-
["path", { d: "m6 6 12 12", key: "d8bk6v" }]
|
|
948
|
-
];
|
|
949
|
-
const X = createLucideIcon("x", __iconNode);
|
|
950
|
-
|
|
951
460
|
const neutralSmallShadow = `${shadows.neutral.small.x}px ${shadows.neutral.small.y}px ${shadows.neutral.small.blur}px ${shadows.neutral.small.spread}px ${shadows.neutral.small.shadow}`;
|
|
952
461
|
const intentColors$1 = {
|
|
953
462
|
success: semanticColors.status.success,
|
|
@@ -1860,14 +1369,7 @@ const StyledCheckbox = styled(Checkbox, {
|
|
|
1860
1369
|
*/
|
|
1861
1370
|
const ModCheckbox = ({ size = 'medium', label, helperText, disabled, icon, checkedIcon, indeterminateIcon, className, ...props }) => {
|
|
1862
1371
|
// Identifies ModCheckbox instances to consumer stylesheets.
|
|
1863
|
-
|
|
1864
|
-
// `neo-checkbox` ships alongside for one major. Consumers select on these
|
|
1865
|
-
// names from their own CSS, where nothing type-checks the string — moderne-ui
|
|
1866
|
-
// has `'&:not(.neo-checkbox)'`, which on a bare rename would stop excluding
|
|
1867
|
-
// anything and silently start overriding every checkbox. Remove the legacy
|
|
1868
|
-
// name once consumers have migrated.
|
|
1869
|
-
const ownClassNames = 'mod-checkbox neo-checkbox';
|
|
1870
|
-
const combinedClassName = className ? `${ownClassNames} ${className}` : ownClassNames;
|
|
1372
|
+
const combinedClassName = className ? `mod-checkbox ${className}` : 'mod-checkbox';
|
|
1871
1373
|
// Default icons (sized via CSS on the SVG); overridable per instance
|
|
1872
1374
|
const defaultIcon = icon || jsx(Square, {});
|
|
1873
1375
|
const defaultCheckedIcon = checkedIcon || jsx(SquareCheck, {});
|
|
@@ -3009,472 +2511,7 @@ const IconWrapper = styled('div')({
|
|
|
3009
2511
|
},
|
|
3010
2512
|
});
|
|
3011
2513
|
function ModDataGridHeaderLabel({ children, helpTooltip, className, }) {
|
|
3012
|
-
return (jsxs(LabelContainer$2, { className: className, "data-mod-header-label": true, children: [children && jsx(LabelText$1, { children: children }), helpTooltip && (jsx(Tooltip, { title: helpTooltip, placement: "top", children: jsx(IconWrapper, { children: jsx(
|
|
3013
|
-
}
|
|
3014
|
-
|
|
3015
|
-
/**
|
|
3016
|
-
* @module constants
|
|
3017
|
-
* @summary Useful constants
|
|
3018
|
-
* @description
|
|
3019
|
-
* Collection of useful date constants.
|
|
3020
|
-
*
|
|
3021
|
-
* The constants could be imported from `date-fns/constants`:
|
|
3022
|
-
*
|
|
3023
|
-
* ```ts
|
|
3024
|
-
* import { maxTime, minTime } from "./constants/date-fns/constants";
|
|
3025
|
-
*
|
|
3026
|
-
* function isAllowedTime(time) {
|
|
3027
|
-
* return time <= maxTime && time >= minTime;
|
|
3028
|
-
* }
|
|
3029
|
-
* ```
|
|
3030
|
-
*/
|
|
3031
|
-
|
|
3032
|
-
|
|
3033
|
-
/**
|
|
3034
|
-
* @constant
|
|
3035
|
-
* @name constructFromSymbol
|
|
3036
|
-
* @summary Symbol enabling Date extensions to inherit properties from the reference date.
|
|
3037
|
-
*
|
|
3038
|
-
* The symbol is used to enable the `constructFrom` function to construct a date
|
|
3039
|
-
* using a reference date and a value. It allows to transfer extra properties
|
|
3040
|
-
* from the reference date to the new date. It's useful for extensions like
|
|
3041
|
-
* [`TZDate`](https://github.com/date-fns/tz) that accept a time zone as
|
|
3042
|
-
* a constructor argument.
|
|
3043
|
-
*/
|
|
3044
|
-
const constructFromSymbol = Symbol.for("constructDateFrom");
|
|
3045
|
-
|
|
3046
|
-
/**
|
|
3047
|
-
* @name constructFrom
|
|
3048
|
-
* @category Generic Helpers
|
|
3049
|
-
* @summary Constructs a date using the reference date and the value
|
|
3050
|
-
*
|
|
3051
|
-
* @description
|
|
3052
|
-
* The function constructs a new date using the constructor from the reference
|
|
3053
|
-
* date and the given value. It helps to build generic functions that accept
|
|
3054
|
-
* date extensions.
|
|
3055
|
-
*
|
|
3056
|
-
* It defaults to `Date` if the passed reference date is a number or a string.
|
|
3057
|
-
*
|
|
3058
|
-
* Starting from v3.7.0, it allows to construct a date using `[Symbol.for("constructDateFrom")]`
|
|
3059
|
-
* enabling to transfer extra properties from the reference date to the new date.
|
|
3060
|
-
* It's useful for extensions like [`TZDate`](https://github.com/date-fns/tz)
|
|
3061
|
-
* that accept a time zone as a constructor argument.
|
|
3062
|
-
*
|
|
3063
|
-
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
|
|
3064
|
-
*
|
|
3065
|
-
* @param date - The reference date to take constructor from
|
|
3066
|
-
* @param value - The value to create the date
|
|
3067
|
-
*
|
|
3068
|
-
* @returns Date initialized using the given date and value
|
|
3069
|
-
*
|
|
3070
|
-
* @example
|
|
3071
|
-
* import { constructFrom } from "./constructFrom/date-fns";
|
|
3072
|
-
*
|
|
3073
|
-
* // A function that clones a date preserving the original type
|
|
3074
|
-
* function cloneDate<DateType extends Date>(date: DateType): DateType {
|
|
3075
|
-
* return constructFrom(
|
|
3076
|
-
* date, // Use constructor from the given date
|
|
3077
|
-
* date.getTime() // Use the date value to create a new date
|
|
3078
|
-
* );
|
|
3079
|
-
* }
|
|
3080
|
-
*/
|
|
3081
|
-
function constructFrom(date, value) {
|
|
3082
|
-
if (typeof date === "function") return date(value);
|
|
3083
|
-
|
|
3084
|
-
if (date && typeof date === "object" && constructFromSymbol in date)
|
|
3085
|
-
return date[constructFromSymbol](value);
|
|
3086
|
-
|
|
3087
|
-
if (date instanceof Date) return new date.constructor(value);
|
|
3088
|
-
|
|
3089
|
-
return new Date(value);
|
|
3090
|
-
}
|
|
3091
|
-
|
|
3092
|
-
/**
|
|
3093
|
-
* @name toDate
|
|
3094
|
-
* @category Common Helpers
|
|
3095
|
-
* @summary Convert the given argument to an instance of Date.
|
|
3096
|
-
*
|
|
3097
|
-
* @description
|
|
3098
|
-
* Convert the given argument to an instance of Date.
|
|
3099
|
-
*
|
|
3100
|
-
* If the argument is an instance of Date, the function returns its clone.
|
|
3101
|
-
*
|
|
3102
|
-
* If the argument is a number, it is treated as a timestamp.
|
|
3103
|
-
*
|
|
3104
|
-
* If the argument is none of the above, the function returns Invalid Date.
|
|
3105
|
-
*
|
|
3106
|
-
* Starting from v3.7.0, it clones a date using `[Symbol.for("constructDateFrom")]`
|
|
3107
|
-
* enabling to transfer extra properties from the reference date to the new date.
|
|
3108
|
-
* It's useful for extensions like [`TZDate`](https://github.com/date-fns/tz)
|
|
3109
|
-
* that accept a time zone as a constructor argument.
|
|
3110
|
-
*
|
|
3111
|
-
* **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.
|
|
3112
|
-
*
|
|
3113
|
-
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
|
|
3114
|
-
* @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
|
|
3115
|
-
*
|
|
3116
|
-
* @param argument - The value to convert
|
|
3117
|
-
*
|
|
3118
|
-
* @returns The parsed date in the local time zone
|
|
3119
|
-
*
|
|
3120
|
-
* @example
|
|
3121
|
-
* // Clone the date:
|
|
3122
|
-
* const result = toDate(new Date(2014, 1, 11, 11, 30, 30))
|
|
3123
|
-
* //=> Tue Feb 11 2014 11:30:30
|
|
3124
|
-
*
|
|
3125
|
-
* @example
|
|
3126
|
-
* // Convert the timestamp to date:
|
|
3127
|
-
* const result = toDate(1392098430000)
|
|
3128
|
-
* //=> Tue Feb 11 2014 11:30:30
|
|
3129
|
-
*/
|
|
3130
|
-
function toDate(argument, context) {
|
|
3131
|
-
// [TODO] Get rid of `toDate` or `constructFrom`?
|
|
3132
|
-
return constructFrom(argument, argument);
|
|
3133
|
-
}
|
|
3134
|
-
|
|
3135
|
-
/**
|
|
3136
|
-
* The {@link addDays} function options.
|
|
3137
|
-
*/
|
|
3138
|
-
|
|
3139
|
-
/**
|
|
3140
|
-
* @name addDays
|
|
3141
|
-
* @category Day Helpers
|
|
3142
|
-
* @summary Add the specified number of days to the given date.
|
|
3143
|
-
*
|
|
3144
|
-
* @description
|
|
3145
|
-
* Add the specified number of days to the given date.
|
|
3146
|
-
*
|
|
3147
|
-
* **You don't need date-fns\***:
|
|
3148
|
-
*
|
|
3149
|
-
* Temporal has a built-in `add` method on all its classes:
|
|
3150
|
-
*
|
|
3151
|
-
* - [`Temporal.Instant.prototype.add()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Temporal/Instant/add)
|
|
3152
|
-
* - [`Temporal.PlainDate.prototype.add()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Temporal/PlainDate/add)
|
|
3153
|
-
* - [`Temporal.PlainDateTime.prototype.add()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Temporal/PlainDateTime/add)
|
|
3154
|
-
* - [`Temporal.PlainTime.prototype.add()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Temporal/PlainTime/add)
|
|
3155
|
-
* - [`Temporal.PlainYearMonth.prototype.add()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Temporal/PlainYearMonth/add)
|
|
3156
|
-
* - [`Temporal.ZonedDateTime.prototype.add()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Temporal/ZonedDateTime/add)
|
|
3157
|
-
*
|
|
3158
|
-
* \* **Not really**, see: https://date-fns.org/you-dont-need-date-fns
|
|
3159
|
-
*
|
|
3160
|
-
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
|
|
3161
|
-
* @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
|
|
3162
|
-
*
|
|
3163
|
-
* @param date - The date to be changed
|
|
3164
|
-
* @param amount - The amount of days to be added.
|
|
3165
|
-
* @param options - An object with options
|
|
3166
|
-
*
|
|
3167
|
-
* @returns The new date with the days added
|
|
3168
|
-
*
|
|
3169
|
-
* @example
|
|
3170
|
-
* // Add 10 days to 1 September 2014:
|
|
3171
|
-
* const result = addDays(new Date(2014, 8, 1), 10)
|
|
3172
|
-
* //=> Thu Sep 11 2014 00:00:00
|
|
3173
|
-
*
|
|
3174
|
-
* @example
|
|
3175
|
-
* // Using Temporal:
|
|
3176
|
-
* // Add 10 days to 1 September 2014:
|
|
3177
|
-
* Temporal.PlainDate.from("2014-09-01").add({ days: 10 }).toString();
|
|
3178
|
-
* //=> "2014-09-11"
|
|
3179
|
-
*/
|
|
3180
|
-
function addDays(date, amount, options) {
|
|
3181
|
-
const _date = toDate(date);
|
|
3182
|
-
if (isNaN(amount)) return constructFrom(date, NaN);
|
|
3183
|
-
|
|
3184
|
-
// If 0 days, no-op to avoid changing times in the hour before end of DST
|
|
3185
|
-
if (!amount) return _date;
|
|
3186
|
-
|
|
3187
|
-
_date.setDate(_date.getDate() + amount);
|
|
3188
|
-
return _date;
|
|
3189
|
-
}
|
|
3190
|
-
|
|
3191
|
-
/**
|
|
3192
|
-
* The {@link addMonths} function options.
|
|
3193
|
-
*/
|
|
3194
|
-
|
|
3195
|
-
/**
|
|
3196
|
-
* @name addMonths
|
|
3197
|
-
* @category Month Helpers
|
|
3198
|
-
* @summary Add the specified number of months to the given date.
|
|
3199
|
-
*
|
|
3200
|
-
* @description
|
|
3201
|
-
* Add the specified number of months to the given date.
|
|
3202
|
-
*
|
|
3203
|
-
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
|
|
3204
|
-
* @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
|
|
3205
|
-
*
|
|
3206
|
-
* @param date - The date to be changed
|
|
3207
|
-
* @param amount - The amount of months to be added.
|
|
3208
|
-
* @param options - The options object
|
|
3209
|
-
*
|
|
3210
|
-
* @returns The new date with the months added
|
|
3211
|
-
*
|
|
3212
|
-
* @example
|
|
3213
|
-
* // Add 5 months to 1 September 2014:
|
|
3214
|
-
* const result = addMonths(new Date(2014, 8, 1), 5)
|
|
3215
|
-
* //=> Sun Feb 01 2015 00:00:00
|
|
3216
|
-
*
|
|
3217
|
-
* // Add one month to 30 January 2023:
|
|
3218
|
-
* const result = addMonths(new Date(2023, 0, 30), 1)
|
|
3219
|
-
* //=> Tue Feb 28 2023 00:00:00
|
|
3220
|
-
*/
|
|
3221
|
-
function addMonths(date, amount, options) {
|
|
3222
|
-
const _date = toDate(date);
|
|
3223
|
-
if (isNaN(amount)) return constructFrom(date, NaN);
|
|
3224
|
-
const dayOfMonth = _date.getDate();
|
|
3225
|
-
|
|
3226
|
-
// The JS Date object supports date math by accepting out-of-bounds values for
|
|
3227
|
-
// month, day, etc. For example, new Date(2020, 0, 0) returns 31 Dec 2019 and
|
|
3228
|
-
// new Date(2020, 13, 1) returns 1 Feb 2021. This is *almost* the behavior we
|
|
3229
|
-
// want except that dates will wrap around the end of a month, meaning that
|
|
3230
|
-
// new Date(2020, 13, 31) will return 3 Mar 2021 not 28 Feb 2021 as desired. So
|
|
3231
|
-
// we'll default to the end of the desired month by adding 1 to the desired
|
|
3232
|
-
// month and using a date of 0 to back up one day to the end of the desired
|
|
3233
|
-
// month.
|
|
3234
|
-
const endOfDesiredMonth = constructFrom(date, _date.getTime());
|
|
3235
|
-
endOfDesiredMonth.setMonth(_date.getMonth() + amount + 1, 0);
|
|
3236
|
-
const daysInMonth = endOfDesiredMonth.getDate();
|
|
3237
|
-
if (dayOfMonth >= daysInMonth) {
|
|
3238
|
-
// If we're already at the end of the month, then this is the correct date
|
|
3239
|
-
// and we're done.
|
|
3240
|
-
return endOfDesiredMonth;
|
|
3241
|
-
} else {
|
|
3242
|
-
// Otherwise, we now know that setting the original day-of-month value won't
|
|
3243
|
-
// cause an overflow, so set the desired day-of-month. Note that we can't
|
|
3244
|
-
// just set the date of `endOfDesiredMonth` because that object may have had
|
|
3245
|
-
// its time changed in the unusual case where where a DST transition was on
|
|
3246
|
-
// the last day of the month and its local time was in the hour skipped or
|
|
3247
|
-
// repeated next to a DST transition. So we use `date` instead which is
|
|
3248
|
-
// guaranteed to still have the original time.
|
|
3249
|
-
_date.setFullYear(
|
|
3250
|
-
endOfDesiredMonth.getFullYear(),
|
|
3251
|
-
endOfDesiredMonth.getMonth(),
|
|
3252
|
-
dayOfMonth,
|
|
3253
|
-
);
|
|
3254
|
-
return _date;
|
|
3255
|
-
}
|
|
3256
|
-
}
|
|
3257
|
-
|
|
3258
|
-
/**
|
|
3259
|
-
* The {@link startOfDay} function options.
|
|
3260
|
-
*/
|
|
3261
|
-
|
|
3262
|
-
/**
|
|
3263
|
-
* @name startOfDay
|
|
3264
|
-
* @category Day Helpers
|
|
3265
|
-
* @summary Return the start of a day for the given date.
|
|
3266
|
-
*
|
|
3267
|
-
* @description
|
|
3268
|
-
* Return the start of a day for the given date.
|
|
3269
|
-
* The result will be in the local timezone.
|
|
3270
|
-
*
|
|
3271
|
-
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
|
|
3272
|
-
* @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
|
|
3273
|
-
*
|
|
3274
|
-
* @param date - The original date
|
|
3275
|
-
* @param options - The options
|
|
3276
|
-
*
|
|
3277
|
-
* @returns The start of a day
|
|
3278
|
-
*
|
|
3279
|
-
* @example
|
|
3280
|
-
* // The start of a day for 2 September 2014 11:55:00:
|
|
3281
|
-
* const result = startOfDay(new Date(2014, 8, 2, 11, 55, 0))
|
|
3282
|
-
* //=> Tue Sep 02 2014 00:00:00
|
|
3283
|
-
*/
|
|
3284
|
-
function startOfDay(date, options) {
|
|
3285
|
-
const _date = toDate(date);
|
|
3286
|
-
_date.setHours(0, 0, 0, 0);
|
|
3287
|
-
return _date;
|
|
3288
|
-
}
|
|
3289
|
-
|
|
3290
|
-
/**
|
|
3291
|
-
* The {@link endOfDay} function options.
|
|
3292
|
-
*/
|
|
3293
|
-
|
|
3294
|
-
/**
|
|
3295
|
-
* @name endOfDay
|
|
3296
|
-
* @category Day Helpers
|
|
3297
|
-
* @summary Return the end of a day for the given date.
|
|
3298
|
-
*
|
|
3299
|
-
* @description
|
|
3300
|
-
* Return the end of a day for the given date.
|
|
3301
|
-
* The result will be in the local timezone.
|
|
3302
|
-
*
|
|
3303
|
-
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
|
|
3304
|
-
* @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
|
|
3305
|
-
*
|
|
3306
|
-
* @param date - The original date
|
|
3307
|
-
* @param options - An object with options
|
|
3308
|
-
*
|
|
3309
|
-
* @returns The end of a day
|
|
3310
|
-
*
|
|
3311
|
-
* @example
|
|
3312
|
-
* // The end of a day for 2 September 2014 11:55:00:
|
|
3313
|
-
* const result = endOfDay(new Date(2014, 8, 2, 11, 55, 0))
|
|
3314
|
-
* //=> Tue Sep 02 2014 23:59:59.999
|
|
3315
|
-
*/
|
|
3316
|
-
function endOfDay(date, options) {
|
|
3317
|
-
const _date = toDate(date);
|
|
3318
|
-
_date.setHours(23, 59, 59, 999);
|
|
3319
|
-
return _date;
|
|
3320
|
-
}
|
|
3321
|
-
|
|
3322
|
-
/**
|
|
3323
|
-
* The {@link endOfMonth} function options.
|
|
3324
|
-
*/
|
|
3325
|
-
|
|
3326
|
-
/**
|
|
3327
|
-
* @name endOfMonth
|
|
3328
|
-
* @category Month Helpers
|
|
3329
|
-
* @summary Return the end of a month for the given date.
|
|
3330
|
-
*
|
|
3331
|
-
* @description
|
|
3332
|
-
* Return the end of a month for the given date.
|
|
3333
|
-
* The result will be in the local timezone.
|
|
3334
|
-
*
|
|
3335
|
-
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
|
|
3336
|
-
* @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
|
|
3337
|
-
*
|
|
3338
|
-
* @param date - The original date
|
|
3339
|
-
* @param options - An object with options
|
|
3340
|
-
*
|
|
3341
|
-
* @returns The end of a month
|
|
3342
|
-
*
|
|
3343
|
-
* @example
|
|
3344
|
-
* // The end of a month for 2 September 2014 11:55:00:
|
|
3345
|
-
* const result = endOfMonth(new Date(2014, 8, 2, 11, 55, 0))
|
|
3346
|
-
* //=> Tue Sep 30 2014 23:59:59.999
|
|
3347
|
-
*/
|
|
3348
|
-
function endOfMonth(date, options) {
|
|
3349
|
-
const _date = toDate(date);
|
|
3350
|
-
const month = _date.getMonth();
|
|
3351
|
-
_date.setFullYear(_date.getFullYear(), month + 1, 0);
|
|
3352
|
-
_date.setHours(23, 59, 59, 999);
|
|
3353
|
-
return _date;
|
|
3354
|
-
}
|
|
3355
|
-
|
|
3356
|
-
/**
|
|
3357
|
-
* The {@link startOfMonth} function options.
|
|
3358
|
-
*/
|
|
3359
|
-
|
|
3360
|
-
/**
|
|
3361
|
-
* @name startOfMonth
|
|
3362
|
-
* @category Month Helpers
|
|
3363
|
-
* @summary Return the start of a month for the given date.
|
|
3364
|
-
*
|
|
3365
|
-
* @description
|
|
3366
|
-
* Return the start of a month for the given date. The result will be in the local timezone.
|
|
3367
|
-
*
|
|
3368
|
-
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments.
|
|
3369
|
-
* Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
|
|
3370
|
-
* @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed,
|
|
3371
|
-
* or inferred from the arguments.
|
|
3372
|
-
*
|
|
3373
|
-
* @param date - The original date
|
|
3374
|
-
* @param options - An object with options
|
|
3375
|
-
*
|
|
3376
|
-
* @returns The start of a month
|
|
3377
|
-
*
|
|
3378
|
-
* @example
|
|
3379
|
-
* // The start of a month for 2 September 2014 11:55:00:
|
|
3380
|
-
* const result = startOfMonth(new Date(2014, 8, 2, 11, 55, 0))
|
|
3381
|
-
* //=> Mon Sep 01 2014 00:00:00
|
|
3382
|
-
*/
|
|
3383
|
-
function startOfMonth(date, options) {
|
|
3384
|
-
const _date = toDate(date);
|
|
3385
|
-
_date.setDate(1);
|
|
3386
|
-
_date.setHours(0, 0, 0, 0);
|
|
3387
|
-
return _date;
|
|
3388
|
-
}
|
|
3389
|
-
|
|
3390
|
-
/**
|
|
3391
|
-
* The {@link startOfYear} function options.
|
|
3392
|
-
*/
|
|
3393
|
-
|
|
3394
|
-
/**
|
|
3395
|
-
* @name startOfYear
|
|
3396
|
-
* @category Year Helpers
|
|
3397
|
-
* @summary Return the start of a year for the given date.
|
|
3398
|
-
*
|
|
3399
|
-
* @description
|
|
3400
|
-
* Return the start of a year for the given date.
|
|
3401
|
-
* The result will be in the local timezone.
|
|
3402
|
-
*
|
|
3403
|
-
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
|
|
3404
|
-
* @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
|
|
3405
|
-
*
|
|
3406
|
-
* @param date - The original date
|
|
3407
|
-
* @param options - The options
|
|
3408
|
-
*
|
|
3409
|
-
* @returns The start of a year
|
|
3410
|
-
*
|
|
3411
|
-
* @example
|
|
3412
|
-
* // The start of a year for 2 September 2014 11:55:00:
|
|
3413
|
-
* const result = startOfYear(new Date(2014, 8, 2, 11, 55, 00))
|
|
3414
|
-
* //=> Wed Jan 01 2014 00:00:00
|
|
3415
|
-
*/
|
|
3416
|
-
function startOfYear(date, options) {
|
|
3417
|
-
const date_ = toDate(date);
|
|
3418
|
-
date_.setFullYear(date_.getFullYear(), 0, 1);
|
|
3419
|
-
date_.setHours(0, 0, 0, 0);
|
|
3420
|
-
return date_;
|
|
3421
|
-
}
|
|
3422
|
-
|
|
3423
|
-
/**
|
|
3424
|
-
* The {@link subDays} function options.
|
|
3425
|
-
*/
|
|
3426
|
-
|
|
3427
|
-
/**
|
|
3428
|
-
* @name subDays
|
|
3429
|
-
* @category Day Helpers
|
|
3430
|
-
* @summary Subtract the specified number of days from the given date.
|
|
3431
|
-
*
|
|
3432
|
-
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
|
|
3433
|
-
* @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
|
|
3434
|
-
*
|
|
3435
|
-
* @param date - The date to be changed
|
|
3436
|
-
* @param amount - The amount of days to be subtracted.
|
|
3437
|
-
* @param options - An object with options
|
|
3438
|
-
*
|
|
3439
|
-
* @returns The new date with the days subtracted
|
|
3440
|
-
*
|
|
3441
|
-
* @example
|
|
3442
|
-
* // Subtract 10 days from 1 September 2014:
|
|
3443
|
-
* const result = subDays(new Date(2014, 8, 1), 10)
|
|
3444
|
-
* //=> Fri Aug 22 2014 00:00:00
|
|
3445
|
-
*/
|
|
3446
|
-
function subDays(date, amount, options) {
|
|
3447
|
-
return addDays(date, -amount);
|
|
3448
|
-
}
|
|
3449
|
-
|
|
3450
|
-
/**
|
|
3451
|
-
* The subMonths function options.
|
|
3452
|
-
*/
|
|
3453
|
-
|
|
3454
|
-
/**
|
|
3455
|
-
* @name subMonths
|
|
3456
|
-
* @category Month Helpers
|
|
3457
|
-
* @summary Subtract the specified number of months from the given date.
|
|
3458
|
-
*
|
|
3459
|
-
* @description
|
|
3460
|
-
* Subtract the specified number of months from the given date.
|
|
3461
|
-
*
|
|
3462
|
-
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
|
|
3463
|
-
* @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
|
|
3464
|
-
*
|
|
3465
|
-
* @param date - The date to be changed
|
|
3466
|
-
* @param amount - The amount of months to be subtracted.
|
|
3467
|
-
* @param options - An object with options
|
|
3468
|
-
*
|
|
3469
|
-
* @returns The new date with the months subtracted
|
|
3470
|
-
*
|
|
3471
|
-
* @example
|
|
3472
|
-
* // Subtract 5 months from 1 February 2015:
|
|
3473
|
-
* const result = subMonths(new Date(2015, 1, 1), 5)
|
|
3474
|
-
* //=> Mon Sep 01 2014 00:00:00
|
|
3475
|
-
*/
|
|
3476
|
-
function subMonths(date, amount, options) {
|
|
3477
|
-
return addMonths(date, -1);
|
|
2514
|
+
return (jsxs(LabelContainer$2, { className: className, "data-mod-header-label": true, children: [children && jsx(LabelText$1, { children: children }), helpTooltip && (jsx(Tooltip, { title: helpTooltip, placement: "top", children: jsx(IconWrapper, { children: jsx(HelpCircle, {}) }) }))] }));
|
|
3478
2515
|
}
|
|
3479
2516
|
|
|
3480
2517
|
// Cast ModButton to a simpler type for styled() compatibility (avoids generic inference issues)
|
|
@@ -3602,7 +2639,7 @@ const defaultRangeShortcuts = [
|
|
|
3602
2639
|
label: 'Last month',
|
|
3603
2640
|
getValue: () => {
|
|
3604
2641
|
const today = new Date();
|
|
3605
|
-
const lastMonth = subMonths(today);
|
|
2642
|
+
const lastMonth = subMonths(today, 1);
|
|
3606
2643
|
return [startOfMonth(lastMonth), endOfMonth(lastMonth)];
|
|
3607
2644
|
},
|
|
3608
2645
|
},
|
|
@@ -4609,7 +3646,7 @@ const StyledFormHelperText = styled(FormHelperText, {
|
|
|
4609
3646
|
const ModInputField = ({ size = 'medium', destructive = false, label, required = false, infoIcon, helperText, errorMessage, startIcon, endIcon, disabled, id, ...props }) => {
|
|
4610
3647
|
const inputId = id || `mod-input-${Math.random().toString(36).substring(7)}`;
|
|
4611
3648
|
const helperTextId = helperText || errorMessage ? `${inputId}-helper-text` : undefined;
|
|
4612
|
-
return (jsxs(StyledFormControl, { size: size, error: destructive, disabled: disabled, children: [label && (jsxs(StyledInputLabel, { htmlFor: inputId, size: size, infoIcon: !!infoIcon, disabled: disabled, error: destructive, shrink: true, children: [label, required && jsx("span", { "aria-hidden": "true", children: "*" }), infoIcon && jsx(InfoIconWrapper, { children: infoIcon })] })), jsx(StyledInputBase, { id: inputId, size: size, destructive: destructive, disabled: disabled, error: destructive, "aria-describedby": helperTextId, startAdornment: startIcon ? (jsx(InputAdornment, { position: "start", style: { paddingLeft: size === 'small' ? spacing.spacing_1_1_2 : spacing.spacing_2 }, children: startIcon })) : undefined, endAdornment: destructive ? (jsx(InputAdornment, { position: "end", style: { paddingRight: spacing.spacing_1_1_2 }, children: jsx(
|
|
3649
|
+
return (jsxs(StyledFormControl, { size: size, error: destructive, disabled: disabled, children: [label && (jsxs(StyledInputLabel, { htmlFor: inputId, size: size, infoIcon: !!infoIcon, disabled: disabled, error: destructive, shrink: true, children: [label, required && jsx("span", { "aria-hidden": "true", children: "*" }), infoIcon && jsx(InfoIconWrapper, { children: infoIcon })] })), jsx(StyledInputBase, { id: inputId, size: size, destructive: destructive, disabled: disabled, error: destructive, "aria-describedby": helperTextId, startAdornment: startIcon ? (jsx(InputAdornment, { position: "start", style: { paddingLeft: size === 'small' ? spacing.spacing_1_1_2 : spacing.spacing_2 }, children: startIcon })) : undefined, endAdornment: destructive ? (jsx(InputAdornment, { position: "end", style: { paddingRight: spacing.spacing_1_1_2 }, children: jsx(AlertCircle, { size: 20 }) })) : endIcon ? (jsx(InputAdornment, { position: "end", style: { paddingRight: spacing.spacing_1_1_2 }, children: endIcon })) : undefined, ...props }), (helperText || errorMessage) && (jsx(StyledFormHelperText, { id: helperTextId, error: destructive, disabled: disabled, children: destructive ? errorMessage : helperText }))] }));
|
|
4613
3650
|
};
|
|
4614
3651
|
ModInputField.displayName = 'ModInputField';
|
|
4615
3652
|
|
|
@@ -5711,7 +4748,7 @@ function ModNavigationItem({ icon, label, selected = false, tag, tooltip, slotPr
|
|
|
5711
4748
|
// When collapsed the label is hidden, so fall back to it for the tooltip and
|
|
5712
4749
|
// accessible name — otherwise an icon-only button has no name (WCAG 4.1.2).
|
|
5713
4750
|
const collapsedTooltip = tooltip ?? label;
|
|
5714
|
-
const item = (jsxs(StyledRoot, { selected: selected, "aria-label": collapsed && typeof label === 'string' ? label : undefined, disableRipple: true, ...props, children: [jsx(IconPadding, { className: "mod-nav-icon-padding
|
|
4751
|
+
const item = (jsxs(StyledRoot, { selected: selected, "aria-label": collapsed && typeof label === 'string' ? label : undefined, disableRipple: true, ...props, children: [jsx(IconPadding, { className: "mod-nav-icon-padding", children: icon }), !collapsed && label && jsx(Label$2, { className: "mod-nav-label", children: label }), !collapsed && tag && (jsx(ModTag, { size: "medium", variant: "filled", intent: "beta", shape: "rounded", label: tag, ...slotProps?.badge })), children] }));
|
|
5715
4752
|
if (collapsed && collapsedTooltip) {
|
|
5716
4753
|
return (jsx(ModTooltip, { title: collapsedTooltip, placement: "right", arrow: true, children: item }));
|
|
5717
4754
|
}
|