@moderneinc/neo-styled-components 5.0.0 → 5.1.0-next.0868e6

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.js CHANGED
@@ -602,11 +602,11 @@ const createLucideIcon = (iconName, iconNode) => {
602
602
  */
603
603
 
604
604
 
605
- const __iconNode$p = [
605
+ const __iconNode$n = [
606
606
  ["path", { d: "M12 5v14", key: "s699le" }],
607
607
  ["path", { d: "m19 12-7 7-7-7", key: "1idqje" }]
608
608
  ];
609
- const ArrowDown = createLucideIcon("arrow-down", __iconNode$p);
609
+ const ArrowDown = createLucideIcon("arrow-down", __iconNode$n);
610
610
 
611
611
  /**
612
612
  * @license lucide-react v1.16.0 - ISC
@@ -616,11 +616,11 @@ const ArrowDown = createLucideIcon("arrow-down", __iconNode$p);
616
616
  */
617
617
 
618
618
 
619
- const __iconNode$o = [
619
+ const __iconNode$m = [
620
620
  ["path", { d: "m5 12 7-7 7 7", key: "hav0vg" }],
621
621
  ["path", { d: "M12 19V5", key: "x0mq9r" }]
622
622
  ];
623
- const ArrowUp = createLucideIcon("arrow-up", __iconNode$o);
623
+ const ArrowUp = createLucideIcon("arrow-up", __iconNode$m);
624
624
 
625
625
  /**
626
626
  * @license lucide-react v1.16.0 - ISC
@@ -630,7 +630,7 @@ const ArrowUp = createLucideIcon("arrow-up", __iconNode$o);
630
630
  */
631
631
 
632
632
 
633
- const __iconNode$n = [
633
+ const __iconNode$l = [
634
634
  [
635
635
  "path",
636
636
  {
@@ -641,7 +641,7 @@ const __iconNode$n = [
641
641
  ["line", { x1: "12", x2: "12", y1: "16", y2: "12", key: "1y1yb1" }],
642
642
  ["line", { x1: "12", x2: "12.01", y1: "8", y2: "8", key: "110wyk" }]
643
643
  ];
644
- const BadgeInfo = createLucideIcon("badge-info", __iconNode$n);
644
+ const BadgeInfo = createLucideIcon("badge-info", __iconNode$l);
645
645
 
646
646
  /**
647
647
  * @license lucide-react v1.16.0 - ISC
@@ -651,7 +651,7 @@ const BadgeInfo = createLucideIcon("badge-info", __iconNode$n);
651
651
  */
652
652
 
653
653
 
654
- const __iconNode$m = [
654
+ const __iconNode$k = [
655
655
  ["path", { d: "M8 2v4", key: "1cmpym" }],
656
656
  ["path", { d: "M16 2v4", key: "4m81vk" }],
657
657
  ["rect", { width: "18", height: "18", x: "3", y: "4", rx: "2", key: "1hopcy" }],
@@ -663,7 +663,7 @@ const __iconNode$m = [
663
663
  ["path", { d: "M12 18h.01", key: "mhygvu" }],
664
664
  ["path", { d: "M16 18h.01", key: "kzsmim" }]
665
665
  ];
666
- const CalendarDays = createLucideIcon("calendar-days", __iconNode$m);
666
+ const CalendarDays = createLucideIcon("calendar-days", __iconNode$k);
667
667
 
668
668
  /**
669
669
  * @license lucide-react v1.16.0 - ISC
@@ -673,8 +673,8 @@ const CalendarDays = createLucideIcon("calendar-days", __iconNode$m);
673
673
  */
674
674
 
675
675
 
676
- const __iconNode$l = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]];
677
- const ChevronDown = createLucideIcon("chevron-down", __iconNode$l);
676
+ const __iconNode$j = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]];
677
+ const ChevronDown = createLucideIcon("chevron-down", __iconNode$j);
678
678
 
679
679
  /**
680
680
  * @license lucide-react v1.16.0 - ISC
@@ -684,8 +684,8 @@ const ChevronDown = createLucideIcon("chevron-down", __iconNode$l);
684
684
  */
685
685
 
686
686
 
687
- const __iconNode$k = [["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]];
688
- const ChevronLeft = createLucideIcon("chevron-left", __iconNode$k);
687
+ const __iconNode$i = [["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]];
688
+ const ChevronLeft = createLucideIcon("chevron-left", __iconNode$i);
689
689
 
690
690
  /**
691
691
  * @license lucide-react v1.16.0 - ISC
@@ -695,8 +695,8 @@ const ChevronLeft = createLucideIcon("chevron-left", __iconNode$k);
695
695
  */
696
696
 
697
697
 
698
- const __iconNode$j = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]];
699
- const ChevronRight = createLucideIcon("chevron-right", __iconNode$j);
698
+ const __iconNode$h = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]];
699
+ const ChevronRight = createLucideIcon("chevron-right", __iconNode$h);
700
700
 
701
701
  /**
702
702
  * @license lucide-react v1.16.0 - ISC
@@ -706,8 +706,8 @@ const ChevronRight = createLucideIcon("chevron-right", __iconNode$j);
706
706
  */
707
707
 
708
708
 
709
- const __iconNode$i = [["path", { d: "m18 15-6-6-6 6", key: "153udz" }]];
710
- const ChevronUp = createLucideIcon("chevron-up", __iconNode$i);
709
+ const __iconNode$g = [["path", { d: "m18 15-6-6-6 6", key: "153udz" }]];
710
+ const ChevronUp = createLucideIcon("chevron-up", __iconNode$g);
711
711
 
712
712
  /**
713
713
  * @license lucide-react v1.16.0 - ISC
@@ -717,11 +717,11 @@ const ChevronUp = createLucideIcon("chevron-up", __iconNode$i);
717
717
  */
718
718
 
719
719
 
720
- const __iconNode$h = [
720
+ const __iconNode$f = [
721
721
  ["path", { d: "m7 15 5 5 5-5", key: "1hf1tw" }],
722
722
  ["path", { d: "m7 9 5-5 5 5", key: "sgt6xg" }]
723
723
  ];
724
- const ChevronsUpDown = createLucideIcon("chevrons-up-down", __iconNode$h);
724
+ const ChevronsUpDown = createLucideIcon("chevrons-up-down", __iconNode$f);
725
725
 
726
726
  /**
727
727
  * @license lucide-react v1.16.0 - ISC
@@ -731,12 +731,12 @@ const ChevronsUpDown = createLucideIcon("chevrons-up-down", __iconNode$h);
731
731
  */
732
732
 
733
733
 
734
- const __iconNode$g = [
734
+ const __iconNode$e = [
735
735
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
736
736
  ["line", { x1: "12", x2: "12", y1: "8", y2: "12", key: "1pkeuh" }],
737
737
  ["line", { x1: "12", x2: "12.01", y1: "16", y2: "16", key: "4dfq90" }]
738
738
  ];
739
- const CircleAlert = createLucideIcon("circle-alert", __iconNode$g);
739
+ const CircleAlert = createLucideIcon("circle-alert", __iconNode$e);
740
740
 
741
741
  /**
742
742
  * @license lucide-react v1.16.0 - ISC
@@ -746,11 +746,11 @@ const CircleAlert = createLucideIcon("circle-alert", __iconNode$g);
746
746
  */
747
747
 
748
748
 
749
- const __iconNode$f = [
749
+ const __iconNode$d = [
750
750
  ["path", { d: "M21.801 10A10 10 0 1 1 17 3.335", key: "yps3ct" }],
751
751
  ["path", { d: "m9 11 3 3L22 4", key: "1pflzl" }]
752
752
  ];
753
- const CircleCheckBig = createLucideIcon("circle-check-big", __iconNode$f);
753
+ const CircleCheckBig = createLucideIcon("circle-check-big", __iconNode$d);
754
754
 
755
755
  /**
756
756
  * @license lucide-react v1.16.0 - ISC
@@ -760,12 +760,12 @@ const CircleCheckBig = createLucideIcon("circle-check-big", __iconNode$f);
760
760
  */
761
761
 
762
762
 
763
- const __iconNode$e = [
763
+ const __iconNode$c = [
764
764
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
765
765
  ["path", { d: "M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3", key: "1u773s" }],
766
766
  ["path", { d: "M12 17h.01", key: "p32p05" }]
767
767
  ];
768
- const CircleQuestionMark = createLucideIcon("circle-question-mark", __iconNode$e);
768
+ const CircleQuestionMark = createLucideIcon("circle-question-mark", __iconNode$c);
769
769
 
770
770
  /**
771
771
  * @license lucide-react v1.16.0 - ISC
@@ -775,12 +775,12 @@ const CircleQuestionMark = createLucideIcon("circle-question-mark", __iconNode$e
775
775
  */
776
776
 
777
777
 
778
- const __iconNode$d = [
778
+ const __iconNode$b = [
779
779
  ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
780
780
  ["path", { d: "M9 3v18", key: "fh3hqa" }],
781
781
  ["path", { d: "M15 3v18", key: "14nvp0" }]
782
782
  ];
783
- const Columns3 = createLucideIcon("columns-3", __iconNode$d);
783
+ const Columns3 = createLucideIcon("columns-3", __iconNode$b);
784
784
 
785
785
  /**
786
786
  * @license lucide-react v1.16.0 - ISC
@@ -790,38 +790,12 @@ const Columns3 = createLucideIcon("columns-3", __iconNode$d);
790
790
  */
791
791
 
792
792
 
793
- const __iconNode$c = [
793
+ const __iconNode$a = [
794
794
  ["path", { d: "M2 5h20", key: "1fs1ex" }],
795
795
  ["path", { d: "M6 12h12", key: "8npq4p" }],
796
796
  ["path", { d: "M9 19h6", key: "456am0" }]
797
797
  ];
798
- const ListFilter = createLucideIcon("list-filter", __iconNode$c);
799
-
800
- /**
801
- * @license lucide-react v1.16.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$b = [["path", { d: "M5 12h14", key: "1ays0h" }]];
809
- const Minus = createLucideIcon("minus", __iconNode$b);
810
-
811
- /**
812
- * @license lucide-react v1.16.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$a = [
820
- ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
821
- ["path", { d: "M9 3v18", key: "fh3hqa" }],
822
- ["path", { d: "m16 15-3-3 3-3", key: "14y99z" }]
823
- ];
824
- const PanelLeftClose = createLucideIcon("panel-left-close", __iconNode$a);
798
+ const ListFilter = createLucideIcon("list-filter", __iconNode$a);
825
799
 
826
800
  /**
827
801
  * @license lucide-react v1.16.0 - ISC
@@ -831,12 +805,8 @@ const PanelLeftClose = createLucideIcon("panel-left-close", __iconNode$a);
831
805
  */
832
806
 
833
807
 
834
- const __iconNode$9 = [
835
- ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
836
- ["path", { d: "M9 3v18", key: "fh3hqa" }],
837
- ["path", { d: "m14 9 3 3-3 3", key: "8010ee" }]
838
- ];
839
- const PanelLeftOpen = createLucideIcon("panel-left-open", __iconNode$9);
808
+ const __iconNode$9 = [["path", { d: "M5 12h14", key: "1ays0h" }]];
809
+ const Minus = createLucideIcon("minus", __iconNode$9);
840
810
 
841
811
  /**
842
812
  * @license lucide-react v1.16.0 - ISC
@@ -2783,15 +2753,18 @@ function NeoDataGrid({ autoHeight = false, toolbar, slots, sx, density = 'standa
2783
2753
  ...getDataGridHeaderStyles(),
2784
2754
  ...getDataGridRowStyles(),
2785
2755
  border: `1px solid ${neoDesign.semanticColors.border.secondary}`,
2786
- // Style row selection checkboxes to match header (16px, proper spacing).
2787
- // Target `& svg` (not `.MuiSvgIcon-root`) so the rule also matches the
2788
- // lucide `<svg>` icons NeoCheckbox renders, mirroring the header rule.
2756
+ // Target `& svg` (not `.MuiSvgIcon-root`) to match the lucide icons
2757
+ // NeoCheckbox renders, mirroring the header rule below.
2758
+ // flexShrink: 0 stops the icon collapsing to 0 width when the checkbox
2759
+ // column is narrower than the 32px box (16px icon + 16px padding) —
2760
+ // without it the checkbox becomes invisible but stays clickable.
2789
2761
  [`& .${xDataGrid.gridClasses.cellCheckbox}`]: {
2790
2762
  [`& .${Checkbox.checkboxClasses.root}`]: {
2791
2763
  padding: `${neoDesign.spacing.spacing_1}px`,
2792
2764
  '& svg': {
2793
2765
  width: 16,
2794
2766
  height: 16,
2767
+ flexShrink: 0,
2795
2768
  },
2796
2769
  },
2797
2770
  },
@@ -6419,7 +6392,7 @@ const NeoSelectField = ({ size = 'medium', destructive = false, label, required
6419
6392
  NeoSelectField.displayName = 'NeoSelectField';
6420
6393
 
6421
6394
  const EXPANDED_WIDTH = 98;
6422
- const COLLAPSED_WIDTH = 56;
6395
+ const COLLAPSED_WIDTH = 68;
6423
6396
  // The fade overlay must end on the same color as the rail to blend cleanly.
6424
6397
  const RAIL_BACKGROUND = neoDesign.colors.grey[100];
6425
6398
  /**
@@ -6429,8 +6402,28 @@ const RAIL_BACKGROUND = neoDesign.colors.grey[100];
6429
6402
  * scrolling content area. Controlled via `collapsed` + `onCollapsedChange`;
6430
6403
  * broadcasts collapsed state to descendant `NeoNavigationItem`s through context.
6431
6404
  *
6405
+ * A chevron handle on the rail's trailing edge (beside the tenant-logo row)
6406
+ * toggles the controlled state. Consumers that want the rail to auto-collapse
6407
+ * on viewport changes compute `collapsed` themselves (e.g. via `useMediaQuery`)
6408
+ * and pass it in — see the `AutoCollapseOnResize` Storybook story for the
6409
+ * pattern.
6410
+ *
6432
6411
  * @figma https://www.figma.com/design/fQTkGSFbYyE7LiHuQJsENC?node-id=4065-3425
6433
6412
  */
6413
+ // Unclipped positioning context so the edge handle can straddle the rail's
6414
+ // trailing edge (Root itself clips its overflow during the width transition).
6415
+ const Frame = styles.styled('div', {
6416
+ shouldForwardProp: prop => prop !== 'collapsed',
6417
+ })(({ collapsed, theme }) => ({
6418
+ position: 'relative',
6419
+ display: 'flex',
6420
+ height: '100%',
6421
+ width: collapsed ? COLLAPSED_WIDTH : EXPANDED_WIDTH,
6422
+ minWidth: collapsed ? COLLAPSED_WIDTH : EXPANDED_WIDTH,
6423
+ transition: theme.transitions.create(['width', 'min-width'], {
6424
+ duration: theme.transitions.duration.shorter,
6425
+ }),
6426
+ }));
6434
6427
  const Root = styles.styled('nav', {
6435
6428
  shouldForwardProp: prop => prop !== 'collapsed',
6436
6429
  })(({ collapsed, theme }) => ({
@@ -6456,6 +6449,10 @@ const Scroll = styles.styled('div')({
6456
6449
  minHeight: 0,
6457
6450
  overflowY: 'auto',
6458
6451
  overflowX: 'hidden',
6452
+ // Reserve the scrollbar gutter symmetrically on both edges at all times, so
6453
+ // the centered nav items stay aligned with the header/footer icons and don't
6454
+ // jump when the scrollbar shows or hides.
6455
+ scrollbarGutter: 'stable both-edges',
6459
6456
  display: 'flex',
6460
6457
  flexDirection: 'column',
6461
6458
  alignItems: 'center',
@@ -6463,7 +6460,7 @@ const Scroll = styles.styled('div')({
6463
6460
  paddingInline: neoDesign.spacing.spacing_1,
6464
6461
  '&::-webkit-scrollbar': { width: neoDesign.spacing.spacing_1_2 },
6465
6462
  '&::-webkit-scrollbar-thumb': {
6466
- backgroundColor: neoDesign.semanticColors.border.primary,
6463
+ backgroundColor: neoDesign.semanticColors.border.secondary,
6467
6464
  borderRadius: neoDesign.borderRadius.xXS,
6468
6465
  },
6469
6466
  });
@@ -6487,29 +6484,34 @@ const Fade = styles.styled('div')({
6487
6484
  pointerEvents: 'none',
6488
6485
  background: `linear-gradient(to bottom, transparent, ${RAIL_BACKGROUND})`,
6489
6486
  });
6490
- const Toggle = styles.styled(ButtonBase)(({ theme }) => ({
6487
+ // A small rectangular tab that straddles the rail's trailing edge, pinned down
6488
+ // beside the tenant-logo row (not floating at the rail's vertical center) so
6489
+ // it reads as attached to the panel.
6490
+ const Handle = styles.styled(ButtonBase)(({ theme }) => ({
6491
+ position: 'absolute',
6492
+ right: 0,
6493
+ bottom: neoDesign.spacing.spacing_1,
6494
+ transform: 'translateX(50%)',
6495
+ zIndex: 1,
6491
6496
  display: 'flex',
6492
6497
  alignItems: 'center',
6493
6498
  justifyContent: 'center',
6494
- flexDirection: 'column',
6495
- gap: neoDesign.spacing.spacing_1_2,
6496
- width: '100%',
6497
- paddingBlock: neoDesign.spacing.spacing_1,
6499
+ width: neoDesign.spacing.spacing_1_1_2,
6500
+ height: neoDesign.spacing.spacing_5,
6498
6501
  borderRadius: neoDesign.borderRadius.s,
6502
+ backgroundColor: RAIL_BACKGROUND,
6499
6503
  border: `1px solid ${neoDesign.semanticColors.border.secondary}`,
6500
6504
  color: neoDesign.semanticColors.typography.bodySecondary,
6501
- fontFamily: neoDesign.typography.fontFamily.body,
6502
- fontSize: theme.typography.pxToRem(11),
6503
- lineHeight: 1,
6505
+ transition: theme.transitions.create(['color', 'border-color']),
6504
6506
  '&:hover': {
6505
6507
  color: neoDesign.semanticColors.typography.body,
6506
6508
  borderColor: neoDesign.semanticColors.border.primary,
6507
6509
  },
6508
6510
  }));
6509
- function NeoSideNav({ collapsed, onCollapsedChange, header, footer, children, collapseLabel = 'Less', ...rest }) {
6510
- const ToggleIcon = collapsed ? PanelLeftOpen : PanelLeftClose;
6511
+ function NeoSideNav({ collapsed, onCollapsedChange, header, footer, children, className, id, 'aria-label': ariaLabel, }) {
6511
6512
  const contextValue = React.useMemo(() => ({ collapsed }), [collapsed]);
6512
- return (jsxRuntime.jsx(NeoSideNavContext.Provider, { value: contextValue, children: jsxRuntime.jsxs(Root, { collapsed: collapsed, ...rest, children: [header && jsxRuntime.jsx(Header, { children: header }), jsxRuntime.jsx(Scroll, { children: children }), jsxRuntime.jsxs(FooterRegion, { children: [jsxRuntime.jsx(Fade, {}), footer, jsxRuntime.jsxs(Toggle, { "data-testid": "neo-side-nav-toggle", "aria-label": collapsed ? 'Expand navigation' : 'Collapse navigation', disableRipple: true, onClick: () => onCollapsedChange(!collapsed), children: [jsxRuntime.jsx(ToggleIcon, { size: 18 }), !collapsed && jsxRuntime.jsx("span", { children: collapseLabel })] })] })] }) }));
6513
+ const HandleIcon = collapsed ? ChevronRight : ChevronLeft;
6514
+ return (jsxRuntime.jsx(NeoSideNavContext.Provider, { value: contextValue, children: jsxRuntime.jsxs(Frame, { collapsed: collapsed, children: [jsxRuntime.jsxs(Root, { collapsed: collapsed, "aria-label": ariaLabel, className: className, id: id, children: [header && jsxRuntime.jsx(Header, { children: header }), jsxRuntime.jsx(Scroll, { children: children }), jsxRuntime.jsxs(FooterRegion, { children: [jsxRuntime.jsx(Fade, {}), footer] })] }), jsxRuntime.jsx(Handle, { "data-testid": "neo-side-nav-handle", "aria-label": collapsed ? 'Expand navigation' : 'Collapse navigation', disableRipple: true, onClick: () => onCollapsedChange(!collapsed), children: jsxRuntime.jsx(HandleIcon, { size: 14 }) })] }) }));
6513
6515
  }
6514
6516
  NeoSideNav.displayName = 'NeoSideNav';
6515
6517