@carto/meridian-ds 2.9.1-alpha-lists.2 → 2.9.1

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 (49) hide show
  1. package/dist/{Alert-BWe4a9zW.js → Alert-BZPM5zpX.js} +1 -1
  2. package/dist/{Alert-BDpjbOOk.cjs → Alert-C4W0H_uN.cjs} +1 -1
  3. package/dist/{MenuItem-zaH11xyj.js → MenuItem-Cx5lTXXm.js} +1 -1
  4. package/dist/{MenuItem-DrvPgr-r.cjs → MenuItem-DoBJsRR_.cjs} +1 -1
  5. package/dist/components/index.cjs +7 -92
  6. package/dist/components/index.js +10 -95
  7. package/dist/{css-utils-Do3X_yIr.cjs → css-utils-CH7es90t.cjs} +0 -4
  8. package/dist/{css-utils-BzztxQJk.js → css-utils-CjUBRJVK.js} +4 -8
  9. package/dist/theme/index.cjs +26 -251
  10. package/dist/theme/index.js +28 -253
  11. package/dist/types/components/Avatar/Avatar.stories.d.ts.map +1 -1
  12. package/dist/types/components/Menu/Menu/Menu.stories.d.ts.map +1 -1
  13. package/dist/types/components/index.d.ts +0 -4
  14. package/dist/types/components/index.d.ts.map +1 -1
  15. package/dist/types/theme/components/data-display.d.ts.map +1 -1
  16. package/dist/types/theme/components/navigation.d.ts.map +1 -1
  17. package/dist/types/theme/components/stories/List.stories.d.ts +62 -0
  18. package/dist/types/theme/components/stories/List.stories.d.ts.map +1 -0
  19. package/dist/types/theme/types.d.ts +0 -86
  20. package/dist/types/theme/types.d.ts.map +1 -1
  21. package/dist/types/utils/theme-constants.d.ts +0 -2
  22. package/dist/types/utils/theme-constants.d.ts.map +1 -1
  23. package/dist/widgets/index.cjs +2 -2
  24. package/dist/widgets/index.js +2 -2
  25. package/package.json +1 -1
  26. package/dist/types/components/List/List.d.ts +0 -18
  27. package/dist/types/components/List/List.d.ts.map +0 -1
  28. package/dist/types/components/List/List.stories.d.ts +0 -80
  29. package/dist/types/components/List/List.stories.d.ts.map +0 -1
  30. package/dist/types/components/List/List.test.d.ts +0 -2
  31. package/dist/types/components/List/List.test.d.ts.map +0 -1
  32. package/dist/types/components/List/ListSubheader/ListSubheader.d.ts +0 -14
  33. package/dist/types/components/List/ListSubheader/ListSubheader.d.ts.map +0 -1
  34. package/dist/types/components/List/ListSubheader/ListSubheader.test.d.ts +0 -2
  35. package/dist/types/components/List/ListSubheader/ListSubheader.test.d.ts.map +0 -1
  36. package/dist/types/components/List/index.d.ts +0 -5
  37. package/dist/types/components/List/index.d.ts.map +0 -1
  38. package/dist/types/components/ListItem/ListItem.d.ts +0 -33
  39. package/dist/types/components/ListItem/ListItem.d.ts.map +0 -1
  40. package/dist/types/components/ListItem/ListItem.stories.d.ts +0 -235
  41. package/dist/types/components/ListItem/ListItem.stories.d.ts.map +0 -1
  42. package/dist/types/components/ListItem/ListItem.test.d.ts +0 -2
  43. package/dist/types/components/ListItem/ListItem.test.d.ts.map +0 -1
  44. package/dist/types/components/ListItem/ListItemRightContent/ListItemRightContent.d.ts +0 -14
  45. package/dist/types/components/ListItem/ListItemRightContent/ListItemRightContent.d.ts.map +0 -1
  46. package/dist/types/components/ListItem/ListItemRightContent/ListItemRightContent.test.d.ts +0 -2
  47. package/dist/types/components/ListItem/ListItemRightContent/ListItemRightContent.test.d.ts.map +0 -1
  48. package/dist/types/components/ListItem/index.d.ts +0 -5
  49. package/dist/types/components/ListItem/index.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-DrvPgr-r.cjs");
6
+ const MenuItem = require("../MenuItem-DoBJsRR_.cjs");
7
7
  const jsxRuntime = require("react/jsx-runtime");
8
- const cssUtils = require("../css-utils-Do3X_yIr.cjs");
8
+ const cssUtils = require("../css-utils-CH7es90t.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,19 +655,8 @@ const dataDisplayOverrides = {
655
655
  styleOverrides: {
656
656
  root: ({ theme: theme2, ownerState }) => ({
657
657
  overflow: "initial",
658
- position: "relative",
659
658
  color: theme2.palette.secondary.contrastText,
660
659
  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
- },
671
660
  // Default fallback image override
672
661
  // https://github.com/mui/material-ui/issues/33229
673
662
  "& .MuiAvatar-fallback": {
@@ -703,27 +692,13 @@ const dataDisplayOverrides = {
703
692
  }
704
693
  },
705
694
  // Disabled styles
706
- ...ownerState.disabled && {
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
- }
720
- }
721
- }),
722
- img: ({ ownerState }) => ({
723
695
  ...ownerState.disabled && {
724
696
  opacity: 0.6
725
697
  }
726
698
  }),
699
+ img: ({ theme: theme2 }) => ({
700
+ boxShadow: `0 0 0 1px ${theme2.palette.default.outlinedBorder}`
701
+ }),
727
702
  circular: () => ({
728
703
  borderRadius: avatarCircularRadius,
729
704
  "& img": {
@@ -2345,72 +2320,6 @@ const formsOverrides = {
2345
2320
  }
2346
2321
  }
2347
2322
  };
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
- });
2414
2323
  const navigationOverrides = {
2415
2324
  // Menu
2416
2325
  MuiMenu: {
@@ -2530,15 +2439,9 @@ const navigationOverrides = {
2530
2439
  },
2531
2440
  // List
2532
2441
  MuiList: {
2533
- defaultProps: {
2534
- variant: "standard"
2535
- },
2536
2442
  styleOverrides: {
2537
- root: ({ theme: theme2, ownerState }) => ({
2538
- display: "flex",
2539
- flexDirection: "column",
2540
- gap: theme2.spacing(ownerState.spacing ?? 0),
2541
- padding: 0,
2443
+ root: ({ theme: theme2 }) => ({
2444
+ paddingTop: 0,
2542
2445
  ".MuiPopover-root &, .MuiPopper-root &, .base-Popper-root &": {
2543
2446
  minWidth: theme2.spacing(8),
2544
2447
  // 64px, defined by design
@@ -2553,30 +2456,13 @@ const navigationOverrides = {
2553
2456
  ".MuiDivider-root": {
2554
2457
  margin: theme2.spacing(1, 0)
2555
2458
  },
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.
2578
2459
  // Indent sublevels, ugly but needed to avoid issues with hover
2579
2460
  "& .MuiList-root": {
2461
+ paddingTop: 0,
2462
+ paddingBottom: 0,
2463
+ "& .MuiListItem-root": {
2464
+ paddingLeft: theme2.spacing(4)
2465
+ },
2580
2466
  "& .MuiList-root": {
2581
2467
  "& .MuiListItem-root": {
2582
2468
  paddingLeft: theme2.spacing(6)
@@ -2602,105 +2488,32 @@ const navigationOverrides = {
2602
2488
  }
2603
2489
  },
2604
2490
  // 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
- },
2670
2491
  MuiListItemText: {
2671
2492
  defaultProps: {
2672
2493
  primaryTypographyProps: {
2673
- variant: "button",
2494
+ variant: "body2",
2674
2495
  noWrap: true,
2675
2496
  component: "span"
2676
2497
  },
2677
- secondaryTypographyProps: {
2678
- variant: "caption",
2679
- color: "text.secondary"
2680
- }
2498
+ secondaryTypographyProps: { variant: "caption" }
2681
2499
  },
2682
2500
  styleOverrides: {
2683
- root: () => ({
2684
- display: "flex",
2685
- flexDirection: "column",
2686
- justifyContent: "center",
2687
- flex: 1,
2688
- minHeight: cssUtils.MENU_ITEM_SIZE_DEFAULT,
2689
- margin: 0
2501
+ root: ({ theme: theme2 }) => ({
2502
+ paddingRight: theme2.spacing(2),
2503
+ "& + .MuiBox-root": {
2504
+ marginRight: theme2.spacing(1)
2505
+ }
2690
2506
  })
2691
2507
  }
2692
2508
  },
2693
2509
  MuiListItemIcon: {
2694
2510
  styleOverrides: {
2695
2511
  root: ({ theme: theme2 }) => ({
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
2512
+ display: "flex",
2513
+ alignItems: "center",
2514
+ gap: theme2.spacing(2),
2515
+ "& .MuiSvgIcon-root": {
2516
+ fontSize: cssUtils.ICON_SIZE_LARGE
2704
2517
  },
2705
2518
  ".MuiMenuItem-root.MuiButtonBase-root &": {
2706
2519
  minWidth: cssUtils.ICON_SIZE_MEDIUM
@@ -2711,10 +2524,9 @@ const navigationOverrides = {
2711
2524
  MuiListItemAvatar: {
2712
2525
  styleOverrides: {
2713
2526
  root: ({ theme: theme2 }) => ({
2714
- ...getListItemAdornmentStyles(theme2),
2715
2527
  "& .MuiAvatar-root": {
2716
- height: cssUtils.MENU_ITEM_SIZE_DEFAULT,
2717
- width: cssUtils.MENU_ITEM_SIZE_DEFAULT
2528
+ height: theme2.spacing(4),
2529
+ width: theme2.spacing(4)
2718
2530
  },
2719
2531
  "& .MuiSvgIcon-root": {
2720
2532
  fontSize: cssUtils.ICON_SIZE_MEDIUM
@@ -2722,41 +2534,6 @@ const navigationOverrides = {
2722
2534
  })
2723
2535
  }
2724
2536
  },
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
- },
2760
2537
  // Tabs
2761
2538
  MuiTabs: {
2762
2539
  styleOverrides: {
@@ -3486,8 +3263,6 @@ exports.BREAKPOINTS = cssUtils.BREAKPOINTS;
3486
3263
  exports.ICON_SIZE_LARGE = cssUtils.ICON_SIZE_LARGE;
3487
3264
  exports.ICON_SIZE_MEDIUM = cssUtils.ICON_SIZE_MEDIUM;
3488
3265
  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;
3491
3266
  exports.MENU_ITEM_SIZE_DEFAULT = cssUtils.MENU_ITEM_SIZE_DEFAULT;
3492
3267
  exports.MENU_ITEM_SIZE_DENSE = cssUtils.MENU_ITEM_SIZE_DENSE;
3493
3268
  exports.MENU_ITEM_SIZE_EXTENDED = cssUtils.MENU_ITEM_SIZE_EXTENDED;