@carto/meridian-ds 2.9.0 → 2.9.1-alpha-lists.3

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.
Files changed (62) hide show
  1. package/CHANGELOG.md +8 -1
  2. package/dist/{Alert-C4W0H_uN.cjs → Alert-BDpjbOOk.cjs} +1 -1
  3. package/dist/{Alert-BZPM5zpX.js → Alert-BWe4a9zW.js} +1 -1
  4. package/dist/{MenuItem-DoBJsRR_.cjs → MenuItem-DrvPgr-r.cjs} +1 -1
  5. package/dist/{MenuItem-Cx5lTXXm.js → MenuItem-zaH11xyj.js} +1 -1
  6. package/dist/components/index.cjs +92 -7
  7. package/dist/components/index.js +95 -10
  8. package/dist/{css-utils-CjUBRJVK.js → css-utils-BzztxQJk.js} +8 -4
  9. package/dist/{css-utils-CH7es90t.cjs → css-utils-Do3X_yIr.cjs} +4 -0
  10. package/dist/custom-icons/index.cjs +666 -538
  11. package/dist/custom-icons/index.js +666 -538
  12. package/dist/theme/index.cjs +251 -26
  13. package/dist/theme/index.js +253 -28
  14. package/dist/types/components/Avatar/Avatar.stories.d.ts.map +1 -1
  15. package/dist/types/components/List/List.d.ts +9 -0
  16. package/dist/types/components/List/List.d.ts.map +1 -0
  17. package/dist/types/components/List/List.stories.d.ts +80 -0
  18. package/dist/types/components/List/List.stories.d.ts.map +1 -0
  19. package/dist/types/components/List/List.test.d.ts +2 -0
  20. package/dist/types/components/List/List.test.d.ts.map +1 -0
  21. package/dist/types/components/List/ListSubheader/ListSubheader.d.ts +9 -0
  22. package/dist/types/components/List/ListSubheader/ListSubheader.d.ts.map +1 -0
  23. package/dist/types/components/List/ListSubheader/ListSubheader.test.d.ts +2 -0
  24. package/dist/types/components/List/ListSubheader/ListSubheader.test.d.ts.map +1 -0
  25. package/dist/types/components/List/index.d.ts +5 -0
  26. package/dist/types/components/List/index.d.ts.map +1 -0
  27. package/dist/types/components/ListItem/ListItem.d.ts +9 -0
  28. package/dist/types/components/ListItem/ListItem.d.ts.map +1 -0
  29. package/dist/types/components/ListItem/ListItem.stories.d.ts +235 -0
  30. package/dist/types/components/ListItem/ListItem.stories.d.ts.map +1 -0
  31. package/dist/types/components/ListItem/ListItem.test.d.ts +2 -0
  32. package/dist/types/components/ListItem/ListItem.test.d.ts.map +1 -0
  33. package/dist/types/components/ListItem/ListItemRightContent/ListItemRightContent.d.ts +14 -0
  34. package/dist/types/components/ListItem/ListItemRightContent/ListItemRightContent.d.ts.map +1 -0
  35. package/dist/types/components/ListItem/ListItemRightContent/ListItemRightContent.test.d.ts +2 -0
  36. package/dist/types/components/ListItem/ListItemRightContent/ListItemRightContent.test.d.ts.map +1 -0
  37. package/dist/types/components/ListItem/index.d.ts +5 -0
  38. package/dist/types/components/ListItem/index.d.ts.map +1 -0
  39. package/dist/types/components/Menu/Menu/Menu.stories.d.ts.map +1 -1
  40. package/dist/types/components/index.d.ts +4 -0
  41. package/dist/types/components/index.d.ts.map +1 -1
  42. package/dist/types/custom-icons/GroupOff.d.ts +4 -0
  43. package/dist/types/custom-icons/GroupOff.d.ts.map +1 -0
  44. package/dist/types/custom-icons/RunReuse.d.ts +4 -0
  45. package/dist/types/custom-icons/RunReuse.d.ts.map +1 -0
  46. package/dist/types/custom-icons/SearchMap.d.ts +4 -0
  47. package/dist/types/custom-icons/SearchMap.d.ts.map +1 -0
  48. package/dist/types/custom-icons/SwitchAccessShortcut.d.ts +4 -0
  49. package/dist/types/custom-icons/SwitchAccessShortcut.d.ts.map +1 -0
  50. package/dist/types/custom-icons/index.d.ts +4 -0
  51. package/dist/types/custom-icons/index.d.ts.map +1 -1
  52. package/dist/types/theme/components/data-display.d.ts.map +1 -1
  53. package/dist/types/theme/components/navigation.d.ts.map +1 -1
  54. package/dist/types/theme/types.d.ts +90 -0
  55. package/dist/types/theme/types.d.ts.map +1 -1
  56. package/dist/types/utils/theme-constants.d.ts +2 -0
  57. package/dist/types/utils/theme-constants.d.ts.map +1 -1
  58. package/dist/widgets/index.cjs +2 -2
  59. package/dist/widgets/index.js +2 -2
  60. package/package.json +1 -1
  61. package/dist/types/theme/components/stories/List.stories.d.ts +0 -62
  62. package/dist/types/theme/components/stories/List.stories.d.ts.map +0 -1
@@ -3,9 +3,9 @@ var _a, _b, _c, _d, _e, _f, _g, _h;
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
4
4
  const material = require("@mui/material");
5
5
  const paletteUtils = require("../palette-utils-B9ybmwiI.cjs");
6
- const MenuItem = require("../MenuItem-DoBJsRR_.cjs");
6
+ const MenuItem = require("../MenuItem-DrvPgr-r.cjs");
7
7
  const jsxRuntime = require("react/jsx-runtime");
8
- const cssUtils = require("../css-utils-CH7es90t.cjs");
8
+ const cssUtils = require("../css-utils-Do3X_yIr.cjs");
9
9
  const iconsMaterial = require("@mui/icons-material");
10
10
  const ArrowDown = require("../ArrowDown-DJ0vhbsw.cjs");
11
11
  const xDatePickers = require("@mui/x-date-pickers");
@@ -655,8 +655,19 @@ const dataDisplayOverrides = {
655
655
  styleOverrides: {
656
656
  root: ({ theme: theme2, ownerState }) => ({
657
657
  overflow: "initial",
658
+ position: "relative",
658
659
  color: theme2.palette.secondary.contrastText,
659
660
  backgroundColor: theme2.palette.secondary.main,
661
+ // Overlay border on top of all content using ::after pseudo-element
662
+ "&::after": {
663
+ content: '""',
664
+ position: "absolute",
665
+ inset: 0,
666
+ boxShadow: `inset 0 0 0 1px ${theme2.palette.default.outlinedBorder}`,
667
+ pointerEvents: "none",
668
+ borderRadius: "inherit",
669
+ zIndex: 1
670
+ },
660
671
  // Default fallback image override
661
672
  // https://github.com/mui/material-ui/issues/33229
662
673
  "& .MuiAvatar-fallback": {
@@ -693,11 +704,25 @@ const dataDisplayOverrides = {
693
704
  },
694
705
  // Disabled styles
695
706
  ...ownerState.disabled && {
696
- opacity: 0.6
707
+ opacity: 1,
708
+ color: theme2.palette.text.disabled,
709
+ backgroundColor: theme2.palette.action.disabledBackground,
710
+ // Overlay border on top of all content using ::after pseudo-element
711
+ "&::after": {
712
+ content: '""',
713
+ position: "absolute",
714
+ inset: 0,
715
+ boxShadow: `inset 0 0 0 1px ${theme2.palette.divider}`,
716
+ pointerEvents: "none",
717
+ borderRadius: "inherit",
718
+ zIndex: 1
719
+ }
697
720
  }
698
721
  }),
699
- img: ({ theme: theme2 }) => ({
700
- boxShadow: `0 0 0 1px ${theme2.palette.default.outlinedBorder}`
722
+ img: ({ ownerState }) => ({
723
+ ...ownerState.disabled && {
724
+ opacity: 0.6
725
+ }
701
726
  }),
702
727
  circular: () => ({
703
728
  borderRadius: avatarCircularRadius,
@@ -2320,6 +2345,72 @@ const formsOverrides = {
2320
2345
  }
2321
2346
  }
2322
2347
  };
2348
+ const getListItemAdornmentStyles = (theme2) => ({
2349
+ display: "flex",
2350
+ alignItems: "center",
2351
+ justifyContent: "center",
2352
+ gap: theme2.spacing(1.5),
2353
+ minHeight: cssUtils.MENU_ITEM_SIZE_DEFAULT,
2354
+ minWidth: cssUtils.MENU_ITEM_SIZE_DEFAULT
2355
+ });
2356
+ const getListItemStyles = (ownerState, theme2) => ({
2357
+ gap: theme2.spacing(1.5),
2358
+ minHeight: cssUtils.MENU_ITEM_SIZE_DEFAULT,
2359
+ padding: theme2.spacing(1, 2),
2360
+ // Checkbox and radio button styles
2361
+ "& .MuiCheckbox-root, & .MuiRadio-root": {
2362
+ ...getListItemAdornmentStyles(theme2),
2363
+ // Override the default icon size coming from MUI definition
2364
+ "& .MuiSvgIcon-fontSizeMedium": {
2365
+ fontSize: cssUtils.ICON_SIZE_LARGE,
2366
+ width: cssUtils.ICON_SIZE_LARGE,
2367
+ minWidth: cssUtils.ICON_SIZE_LARGE,
2368
+ height: cssUtils.ICON_SIZE_LARGE
2369
+ }
2370
+ },
2371
+ // Height: fixedHeight true (or undefined, which defaults to true) + dense true: 52px, dense false: 68px
2372
+ // fixedHeight false: adapts to content
2373
+ // Use data attribute selector since fixedHeight is not passed to MUI component to avoid DOM warning
2374
+ height: ownerState.dense ? cssUtils.LIST_ITEM_SIZE_DENSE : cssUtils.LIST_ITEM_SIZE_DEFAULT,
2375
+ '&[data-fixed-height="false"]': {
2376
+ height: "auto"
2377
+ },
2378
+ // Outlined variant styles
2379
+ ...ownerState.variant === "outlined" && {
2380
+ backgroundColor: theme2.palette.background.paper,
2381
+ boxShadow: `inset 0 0 0 1px ${theme2.palette.divider}`,
2382
+ borderRadius: theme2.spacing(1),
2383
+ "&.MuiListItemButton-root:hover": {
2384
+ backgroundColor: theme2.palette.background.paper,
2385
+ boxShadow: `inset 0 0 0 1px ${theme2.palette.text.hint}`
2386
+ }
2387
+ },
2388
+ // Disable gutters styles
2389
+ ...ownerState.disableGutters && {
2390
+ paddingLeft: 0,
2391
+ paddingRight: 0
2392
+ },
2393
+ // Disable padding styles
2394
+ ...ownerState.disablePadding && {
2395
+ padding: 0
2396
+ },
2397
+ // Disabled styles
2398
+ ...ownerState.disabled && {
2399
+ opacity: "1 !important",
2400
+ color: theme2.palette.text.disabled,
2401
+ backgroundColor: ownerState.variant === "outlined" ? theme2.palette.background.paper : "transparent",
2402
+ borderColor: ownerState.variant === "outlined" ? theme2.palette.divider : "transparent",
2403
+ ".MuiTypography-root": {
2404
+ color: theme2.palette.text.disabled
2405
+ },
2406
+ svg: {
2407
+ color: theme2.palette.text.disabled,
2408
+ path: {
2409
+ fill: theme2.palette.text.disabled
2410
+ }
2411
+ }
2412
+ }
2413
+ });
2323
2414
  const navigationOverrides = {
2324
2415
  // Menu
2325
2416
  MuiMenu: {
@@ -2439,9 +2530,15 @@ const navigationOverrides = {
2439
2530
  },
2440
2531
  // List
2441
2532
  MuiList: {
2533
+ defaultProps: {
2534
+ variant: "standard"
2535
+ },
2442
2536
  styleOverrides: {
2443
- root: ({ theme: theme2 }) => ({
2444
- paddingTop: 0,
2537
+ root: ({ theme: theme2, ownerState }) => ({
2538
+ display: "flex",
2539
+ flexDirection: "column",
2540
+ gap: theme2.spacing(ownerState.spacing ?? 0),
2541
+ padding: 0,
2445
2542
  ".MuiPopover-root &, .MuiPopper-root &, .base-Popper-root &": {
2446
2543
  minWidth: theme2.spacing(8),
2447
2544
  // 64px, defined by design
@@ -2456,13 +2553,30 @@ const navigationOverrides = {
2456
2553
  ".MuiDivider-root": {
2457
2554
  margin: theme2.spacing(1, 0)
2458
2555
  },
2556
+ ".MuiListSubheader-root": {
2557
+ // We need to offset the margin to avoid double spacing between subheaders and regular list items when using spacing prop.
2558
+ marginBottom: theme2.spacing(-(ownerState.spacing ?? 0))
2559
+ },
2560
+ // Outlined-list variant: border on the list container and in the list items
2561
+ ...ownerState.variant === "outlined-list" && {
2562
+ "& .MuiListItem-root, & .MuiListItemButton-root": {
2563
+ border: `1px solid ${theme2.palette.divider}`
2564
+ },
2565
+ // First list item has rounded top corners
2566
+ "& .MuiListItem-root:first-of-type, & .MuiListItemButton-root:first-of-type": {
2567
+ borderRadius: theme2.spacing(1, 1, 0, 0)
2568
+ },
2569
+ // Last list item has rounded bottom corners
2570
+ "& .MuiListItem-root:last-of-type, & .MuiListItemButton-root:last-of-type": {
2571
+ borderRadius: theme2.spacing(0, 0, 1, 1)
2572
+ },
2573
+ "& .MuiListItem-root + .MuiListItem-root, & .MuiListItemButton-root + .MuiListItemButton-root": {
2574
+ borderTop: "none"
2575
+ }
2576
+ },
2577
+ // TODO: old code, to be reviewed once we support sublevels in Figma specs.
2459
2578
  // Indent sublevels, ugly but needed to avoid issues with hover
2460
2579
  "& .MuiList-root": {
2461
- paddingTop: 0,
2462
- paddingBottom: 0,
2463
- "& .MuiListItem-root": {
2464
- paddingLeft: theme2.spacing(4)
2465
- },
2466
2580
  "& .MuiList-root": {
2467
2581
  "& .MuiListItem-root": {
2468
2582
  paddingLeft: theme2.spacing(6)
@@ -2488,32 +2602,105 @@ const navigationOverrides = {
2488
2602
  }
2489
2603
  },
2490
2604
  // List Item
2605
+ MuiListItem: {
2606
+ defaultProps: {
2607
+ dense: true,
2608
+ variant: "standard",
2609
+ disablePadding: false
2610
+ },
2611
+ styleOverrides: {
2612
+ root: ({ theme: theme2, ownerState }) => ({
2613
+ ...getListItemStyles(ownerState, theme2),
2614
+ // Add padding right when contains SecondaryAction to simulate spacing between the action and the content
2615
+ "&:has(.MuiListItemSecondaryAction-root)": {
2616
+ paddingRight: theme2.spacing(7.5)
2617
+ },
2618
+ // Reset padding when contains ListItemButton
2619
+ "&:has(.MuiListItemButton-root)": {
2620
+ padding: 0,
2621
+ '&.MuiListItem-root[data-variant="outlined"]': {
2622
+ boxShadow: "none",
2623
+ "&:hover": {
2624
+ backgroundColor: theme2.palette.background.paper,
2625
+ boxShadow: "none"
2626
+ }
2627
+ }
2628
+ }
2629
+ })
2630
+ }
2631
+ },
2632
+ // List Item Button
2633
+ MuiListItemButton: {
2634
+ defaultProps: {
2635
+ dense: true,
2636
+ variant: "standard",
2637
+ component: "button"
2638
+ },
2639
+ styleOverrides: {
2640
+ root: ({ theme: theme2, ownerState }) => ({
2641
+ ...getListItemStyles(ownerState, theme2),
2642
+ // Add padding right when contains SecondaryAction to simulate spacing between the action and the content
2643
+ "&:has(.MuiListItemSecondaryAction-root)": {
2644
+ paddingRight: theme2.spacing(7.5)
2645
+ },
2646
+ // Reset padding when inside ListItem, but keep padding left
2647
+ ".MuiListItem-root > &.MuiListItemButton-root": {
2648
+ padding: 0,
2649
+ paddingLeft: theme2.spacing(2),
2650
+ "&:hover": {
2651
+ backgroundColor: theme2.palette.action.hover
2652
+ }
2653
+ },
2654
+ // Outlined variant hover when inside ListItem
2655
+ '.MuiListItem-root[data-variant="outlined"] > &.MuiListItemButton-root': {
2656
+ boxShadow: `inset 0 0 0 1px ${theme2.palette.divider}`,
2657
+ borderRadius: theme2.spacing(1),
2658
+ "&:hover": {
2659
+ backgroundColor: theme2.palette.background.paper,
2660
+ boxShadow: `inset 0 0 0 1px ${theme2.palette.text.hint}`
2661
+ }
2662
+ },
2663
+ // Add padding right when inside ListItem that has SecondaryAction to simulate spacing between the action and the content
2664
+ ".MuiListItem-root:has(.MuiListItemSecondaryAction-root) > &.MuiListItemButton-root": {
2665
+ paddingRight: theme2.spacing(7.5)
2666
+ }
2667
+ })
2668
+ }
2669
+ },
2491
2670
  MuiListItemText: {
2492
2671
  defaultProps: {
2493
2672
  primaryTypographyProps: {
2494
- variant: "body2",
2673
+ variant: "button",
2495
2674
  noWrap: true,
2496
2675
  component: "span"
2497
2676
  },
2498
- secondaryTypographyProps: { variant: "caption" }
2677
+ secondaryTypographyProps: {
2678
+ variant: "caption",
2679
+ color: "text.secondary"
2680
+ }
2499
2681
  },
2500
2682
  styleOverrides: {
2501
- root: ({ theme: theme2 }) => ({
2502
- paddingRight: theme2.spacing(2),
2503
- "& + .MuiBox-root": {
2504
- marginRight: theme2.spacing(1)
2505
- }
2683
+ root: () => ({
2684
+ display: "flex",
2685
+ flexDirection: "column",
2686
+ justifyContent: "center",
2687
+ flex: 1,
2688
+ minHeight: cssUtils.MENU_ITEM_SIZE_DEFAULT,
2689
+ margin: 0
2506
2690
  })
2507
2691
  }
2508
2692
  },
2509
2693
  MuiListItemIcon: {
2510
2694
  styleOverrides: {
2511
2695
  root: ({ theme: theme2 }) => ({
2512
- display: "flex",
2513
- alignItems: "center",
2514
- gap: theme2.spacing(2),
2515
- "& .MuiSvgIcon-root": {
2516
- fontSize: cssUtils.ICON_SIZE_LARGE
2696
+ ...getListItemAdornmentStyles(theme2),
2697
+ // Apply styles to SVGs, but exclude those inside Radio or Checkbox components
2698
+ "&:not(:has(.MuiRadio-root)):not(:has(.MuiCheckbox-root)) svg": {
2699
+ color: theme2.palette.text.secondary,
2700
+ fontSize: cssUtils.ICON_SIZE_LARGE,
2701
+ width: cssUtils.ICON_SIZE_LARGE,
2702
+ minWidth: cssUtils.ICON_SIZE_LARGE,
2703
+ height: cssUtils.ICON_SIZE_LARGE
2517
2704
  },
2518
2705
  ".MuiMenuItem-root.MuiButtonBase-root &": {
2519
2706
  minWidth: cssUtils.ICON_SIZE_MEDIUM
@@ -2524,9 +2711,10 @@ const navigationOverrides = {
2524
2711
  MuiListItemAvatar: {
2525
2712
  styleOverrides: {
2526
2713
  root: ({ theme: theme2 }) => ({
2714
+ ...getListItemAdornmentStyles(theme2),
2527
2715
  "& .MuiAvatar-root": {
2528
- height: theme2.spacing(4),
2529
- width: theme2.spacing(4)
2716
+ height: cssUtils.MENU_ITEM_SIZE_DEFAULT,
2717
+ width: cssUtils.MENU_ITEM_SIZE_DEFAULT
2530
2718
  },
2531
2719
  "& .MuiSvgIcon-root": {
2532
2720
  fontSize: cssUtils.ICON_SIZE_MEDIUM
@@ -2534,6 +2722,41 @@ const navigationOverrides = {
2534
2722
  })
2535
2723
  }
2536
2724
  },
2725
+ MuiListItemSecondaryAction: {
2726
+ styleOverrides: {
2727
+ root: ({ theme: theme2 }) => ({
2728
+ ...getListItemAdornmentStyles(theme2)
2729
+ })
2730
+ }
2731
+ },
2732
+ MuiListSubheader: {
2733
+ defaultProps: {
2734
+ disableGutters: true,
2735
+ color: "default",
2736
+ component: "div"
2737
+ },
2738
+ styleOverrides: {
2739
+ root: ({ theme: theme2 }) => ({
2740
+ display: "flex",
2741
+ alignItems: "center",
2742
+ justifyContent: "flex-start",
2743
+ height: theme2.spacing(3),
2744
+ ...theme2.typography.caption,
2745
+ // Use data attribute selector since backgroundColor is not passed to MUI component to avoid DOM warning
2746
+ backgroundColor: theme2.palette.background.default,
2747
+ '&[data-background-color="paper"]': {
2748
+ backgroundColor: theme2.palette.background.paper
2749
+ },
2750
+ '&[data-background-color="inherit"]': {
2751
+ backgroundColor: "inherit"
2752
+ },
2753
+ // Padding for ListSubHeader when List is variant="standard"
2754
+ '[data-variant="standard"] &': {
2755
+ padding: theme2.spacing(0, 2)
2756
+ }
2757
+ })
2758
+ }
2759
+ },
2537
2760
  // Tabs
2538
2761
  MuiTabs: {
2539
2762
  styleOverrides: {
@@ -3263,6 +3486,8 @@ exports.BREAKPOINTS = cssUtils.BREAKPOINTS;
3263
3486
  exports.ICON_SIZE_LARGE = cssUtils.ICON_SIZE_LARGE;
3264
3487
  exports.ICON_SIZE_MEDIUM = cssUtils.ICON_SIZE_MEDIUM;
3265
3488
  exports.ICON_SIZE_SMALL = cssUtils.ICON_SIZE_SMALL;
3489
+ exports.LIST_ITEM_SIZE_DEFAULT = cssUtils.LIST_ITEM_SIZE_DEFAULT;
3490
+ exports.LIST_ITEM_SIZE_DENSE = cssUtils.LIST_ITEM_SIZE_DENSE;
3266
3491
  exports.MENU_ITEM_SIZE_DEFAULT = cssUtils.MENU_ITEM_SIZE_DEFAULT;
3267
3492
  exports.MENU_ITEM_SIZE_DENSE = cssUtils.MENU_ITEM_SIZE_DENSE;
3268
3493
  exports.MENU_ITEM_SIZE_EXTENDED = cssUtils.MENU_ITEM_SIZE_EXTENDED;