@momentum-design/components 0.102.1 → 0.102.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.
@@ -1502,67 +1502,6 @@
1502
1502
  }
1503
1503
  ]
1504
1504
  },
1505
- {
1506
- "kind": "javascript-module",
1507
- "path": "components/appheader/appheader.component.js",
1508
- "declarations": [
1509
- {
1510
- "kind": "class",
1511
- "description": "The `mdc-appheader` component provides a structured and accessible app header layout.\nIt consists of three primary sections: leading, center, and trailing.\n\n- The **leading section** typically holds a **brand logo**, **brand name** or **menu icon**.\n- The **center section** can contain a **search bar**, **icons** or action controls.\n- The **trailing section** generally includes a **profile avatar**, **additional icons** or **action controls**.",
1512
- "name": "Appheader",
1513
- "cssParts": [
1514
- {
1515
- "description": "The main container for styling the header.",
1516
- "name": "container"
1517
- },
1518
- {
1519
- "description": "The leading section of the header.",
1520
- "name": "leading-section"
1521
- },
1522
- {
1523
- "description": "The center section of the header.",
1524
- "name": "center-section"
1525
- },
1526
- {
1527
- "description": "The trailing section of the header.",
1528
- "name": "trailing-section"
1529
- }
1530
- ],
1531
- "slots": [
1532
- {
1533
- "description": "Slot for the leading section (e.g., brand logo, brand name).",
1534
- "name": "leading"
1535
- },
1536
- {
1537
- "description": "Slot for the center section (e.g., search bar, icons).",
1538
- "name": "center"
1539
- },
1540
- {
1541
- "description": "Slot for the trailing section (e.g., profile avatar, icons).",
1542
- "name": "trailing"
1543
- }
1544
- ],
1545
- "members": [],
1546
- "superclass": {
1547
- "name": "Component",
1548
- "module": "/src/models"
1549
- },
1550
- "tagName": "mdc-appheader",
1551
- "jsDoc": "/**\n * The `mdc-appheader` component provides a structured and accessible app header layout.\n * It consists of three primary sections: leading, center, and trailing.\n *\n * - The **leading section** typically holds a **brand logo**, **brand name** or **menu icon**.\n * - The **center section** can contain a **search bar**, **icons** or action controls.\n * - The **trailing section** generally includes a **profile avatar**, **additional icons** or **action controls**.\n *\n * @tagname mdc-appheader\n *\n * @slot leading - Slot for the leading section (e.g., brand logo, brand name).\n * @slot center - Slot for the center section (e.g., search bar, icons).\n * @slot trailing - Slot for the trailing section (e.g., profile avatar, icons).\n *\n * @csspart container - The main container for styling the header.\n * @csspart leading-section - The leading section of the header.\n * @csspart center-section - The center section of the header.\n * @csspart trailing-section - The trailing section of the header.\n */",
1552
- "customElement": true
1553
- }
1554
- ],
1555
- "exports": [
1556
- {
1557
- "kind": "js",
1558
- "name": "default",
1559
- "declaration": {
1560
- "name": "Appheader",
1561
- "module": "components/appheader/appheader.component.js"
1562
- }
1563
- }
1564
- ]
1565
- },
1566
1505
  {
1567
1506
  "kind": "javascript-module",
1568
1507
  "path": "components/animation/animation.component.js",
@@ -1775,6 +1714,67 @@
1775
1714
  }
1776
1715
  ]
1777
1716
  },
1717
+ {
1718
+ "kind": "javascript-module",
1719
+ "path": "components/appheader/appheader.component.js",
1720
+ "declarations": [
1721
+ {
1722
+ "kind": "class",
1723
+ "description": "The `mdc-appheader` component provides a structured and accessible app header layout.\nIt consists of three primary sections: leading, center, and trailing.\n\n- The **leading section** typically holds a **brand logo**, **brand name** or **menu icon**.\n- The **center section** can contain a **search bar**, **icons** or action controls.\n- The **trailing section** generally includes a **profile avatar**, **additional icons** or **action controls**.",
1724
+ "name": "Appheader",
1725
+ "cssParts": [
1726
+ {
1727
+ "description": "The main container for styling the header.",
1728
+ "name": "container"
1729
+ },
1730
+ {
1731
+ "description": "The leading section of the header.",
1732
+ "name": "leading-section"
1733
+ },
1734
+ {
1735
+ "description": "The center section of the header.",
1736
+ "name": "center-section"
1737
+ },
1738
+ {
1739
+ "description": "The trailing section of the header.",
1740
+ "name": "trailing-section"
1741
+ }
1742
+ ],
1743
+ "slots": [
1744
+ {
1745
+ "description": "Slot for the leading section (e.g., brand logo, brand name).",
1746
+ "name": "leading"
1747
+ },
1748
+ {
1749
+ "description": "Slot for the center section (e.g., search bar, icons).",
1750
+ "name": "center"
1751
+ },
1752
+ {
1753
+ "description": "Slot for the trailing section (e.g., profile avatar, icons).",
1754
+ "name": "trailing"
1755
+ }
1756
+ ],
1757
+ "members": [],
1758
+ "superclass": {
1759
+ "name": "Component",
1760
+ "module": "/src/models"
1761
+ },
1762
+ "tagName": "mdc-appheader",
1763
+ "jsDoc": "/**\n * The `mdc-appheader` component provides a structured and accessible app header layout.\n * It consists of three primary sections: leading, center, and trailing.\n *\n * - The **leading section** typically holds a **brand logo**, **brand name** or **menu icon**.\n * - The **center section** can contain a **search bar**, **icons** or action controls.\n * - The **trailing section** generally includes a **profile avatar**, **additional icons** or **action controls**.\n *\n * @tagname mdc-appheader\n *\n * @slot leading - Slot for the leading section (e.g., brand logo, brand name).\n * @slot center - Slot for the center section (e.g., search bar, icons).\n * @slot trailing - Slot for the trailing section (e.g., profile avatar, icons).\n *\n * @csspart container - The main container for styling the header.\n * @csspart leading-section - The leading section of the header.\n * @csspart center-section - The center section of the header.\n * @csspart trailing-section - The trailing section of the header.\n */",
1764
+ "customElement": true
1765
+ }
1766
+ ],
1767
+ "exports": [
1768
+ {
1769
+ "kind": "js",
1770
+ "name": "default",
1771
+ "declaration": {
1772
+ "name": "Appheader",
1773
+ "module": "components/appheader/appheader.component.js"
1774
+ }
1775
+ }
1776
+ ]
1777
+ },
1778
1778
  {
1779
1779
  "kind": "javascript-module",
1780
1780
  "path": "components/avatar/avatar.component.js",
@@ -20655,6 +20655,147 @@
20655
20655
  }
20656
20656
  ]
20657
20657
  },
20658
+ {
20659
+ "kind": "javascript-module",
20660
+ "path": "components/menusection/menusection.component.js",
20661
+ "declarations": [
20662
+ {
20663
+ "kind": "class",
20664
+ "description": "`mdc-menusection` is a container element used to group a set of menu items.\n\nThis component supports a mix of `menuitem`, `menuitemcheckbox`, and `menuitemradio` components.\n\n- If multiple `menuitemradio` components are slotted into the section, the group enforces a single-selection rule:\n only one radio item can be selected at a time.\n- If `menuitemcheckbox` components are included, their checked state can be toggled independently.",
20665
+ "name": "MenuSection",
20666
+ "slots": [
20667
+ {
20668
+ "description": "Default slot for inserting `menuitem`, `menuitemcheckbox`, or `menuitemradio`",
20669
+ "name": ""
20670
+ }
20671
+ ],
20672
+ "members": [
20673
+ {
20674
+ "kind": "field",
20675
+ "name": "ariaLabel",
20676
+ "type": {
20677
+ "text": "string | null"
20678
+ },
20679
+ "default": "null",
20680
+ "description": "The aria-label for the section.\nThis is used for accessibility purposes to describe the section.\nIf not provided, it defaults to the `headerText`.",
20681
+ "attribute": "aria-label",
20682
+ "reflects": true
20683
+ },
20684
+ {
20685
+ "kind": "field",
20686
+ "name": "headerText",
20687
+ "type": {
20688
+ "text": "string | null"
20689
+ },
20690
+ "default": "null",
20691
+ "description": "The primary headerText of the list item.\nThis appears on the leading side of the list item.",
20692
+ "attribute": "header-text",
20693
+ "reflects": true
20694
+ },
20695
+ {
20696
+ "kind": "field",
20697
+ "name": "prefixIcon",
20698
+ "type": {
20699
+ "text": "IconNames | undefined"
20700
+ },
20701
+ "description": "Name of the icon rendered before the text\n\nIf not provided, no icon will be rendered and text will be aligned to the start.",
20702
+ "attribute": "prefix-icon"
20703
+ },
20704
+ {
20705
+ "kind": "field",
20706
+ "name": "showDivider",
20707
+ "type": {
20708
+ "text": "boolean"
20709
+ },
20710
+ "default": "false",
20711
+ "description": "Whether to show a divider below the section header.\nThis is useful for visually separating sections in the menu.",
20712
+ "attribute": "show-divider",
20713
+ "reflects": true
20714
+ },
20715
+ {
20716
+ "kind": "field",
20717
+ "name": "dividerVariant",
20718
+ "description": "The variant of the divider.\nCan be set to 'solid' or 'gradient'.\n\nKeep 'solid' if used in MenuPopovers, as it is the default style.",
20719
+ "default": "'solid'",
20720
+ "attribute": "divider-variant",
20721
+ "reflects": true
20722
+ },
20723
+ {
20724
+ "kind": "method",
20725
+ "name": "renderHeader",
20726
+ "privacy": "private"
20727
+ }
20728
+ ],
20729
+ "events": [
20730
+ {
20731
+ "description": "(React: onChange) This event is dispatched when a `menuitemcheckbox`, or `menuitemradio` changes.",
20732
+ "name": "change",
20733
+ "reactName": "onChange"
20734
+ }
20735
+ ],
20736
+ "attributes": [
20737
+ {
20738
+ "name": "aria-label",
20739
+ "type": {
20740
+ "text": "string | null"
20741
+ },
20742
+ "default": "null",
20743
+ "description": "The aria-label for the section.\nThis is used for accessibility purposes to describe the section.\nIf not provided, it defaults to the `headerText`.",
20744
+ "fieldName": "ariaLabel"
20745
+ },
20746
+ {
20747
+ "name": "header-text",
20748
+ "type": {
20749
+ "text": "string | null"
20750
+ },
20751
+ "default": "null",
20752
+ "description": "The primary headerText of the list item.\nThis appears on the leading side of the list item.",
20753
+ "fieldName": "headerText"
20754
+ },
20755
+ {
20756
+ "name": "prefix-icon",
20757
+ "type": {
20758
+ "text": "IconNames | undefined"
20759
+ },
20760
+ "description": "Name of the icon rendered before the text\n\nIf not provided, no icon will be rendered and text will be aligned to the start.",
20761
+ "fieldName": "prefixIcon"
20762
+ },
20763
+ {
20764
+ "name": "show-divider",
20765
+ "type": {
20766
+ "text": "boolean"
20767
+ },
20768
+ "default": "false",
20769
+ "description": "Whether to show a divider below the section header.\nThis is useful for visually separating sections in the menu.",
20770
+ "fieldName": "showDivider"
20771
+ },
20772
+ {
20773
+ "name": "divider-variant",
20774
+ "description": "The variant of the divider.\nCan be set to 'solid' or 'gradient'.\n\nKeep 'solid' if used in MenuPopovers, as it is the default style.",
20775
+ "default": "'solid'",
20776
+ "fieldName": "dividerVariant"
20777
+ }
20778
+ ],
20779
+ "superclass": {
20780
+ "name": "Component",
20781
+ "module": "/src/models"
20782
+ },
20783
+ "tagName": "mdc-menusection",
20784
+ "jsDoc": "/**\n * `mdc-menusection` is a container element used to group a set of menu items.\n *\n * This component supports a mix of `menuitem`, `menuitemcheckbox`, and `menuitemradio` components.\n *\n * - If multiple `menuitemradio` components are slotted into the section, the group enforces a single-selection rule:\n * only one radio item can be selected at a time.\n * - If `menuitemcheckbox` components are included, their checked state can be toggled independently.\n *\n * @tagname mdc-menusection\n *\n * @slot - Default slot for inserting `menuitem`, `menuitemcheckbox`, or `menuitemradio`\n *\n * @event change - (React: onChange) This event is dispatched when a `menuitemcheckbox`, or `menuitemradio` changes.\n */",
20785
+ "customElement": true
20786
+ }
20787
+ ],
20788
+ "exports": [
20789
+ {
20790
+ "kind": "js",
20791
+ "name": "default",
20792
+ "declaration": {
20793
+ "name": "MenuSection",
20794
+ "module": "components/menusection/menusection.component.js"
20795
+ }
20796
+ }
20797
+ ]
20798
+ },
20658
20799
  {
20659
20800
  "kind": "javascript-module",
20660
20801
  "path": "components/menupopover/menupopover.component.js",
@@ -22799,147 +22940,6 @@
22799
22940
  }
22800
22941
  ]
22801
22942
  },
22802
- {
22803
- "kind": "javascript-module",
22804
- "path": "components/menusection/menusection.component.js",
22805
- "declarations": [
22806
- {
22807
- "kind": "class",
22808
- "description": "`mdc-menusection` is a container element used to group a set of menu items.\n\nThis component supports a mix of `menuitem`, `menuitemcheckbox`, and `menuitemradio` components.\n\n- If multiple `menuitemradio` components are slotted into the section, the group enforces a single-selection rule:\n only one radio item can be selected at a time.\n- If `menuitemcheckbox` components are included, their checked state can be toggled independently.",
22809
- "name": "MenuSection",
22810
- "slots": [
22811
- {
22812
- "description": "Default slot for inserting `menuitem`, `menuitemcheckbox`, or `menuitemradio`",
22813
- "name": ""
22814
- }
22815
- ],
22816
- "members": [
22817
- {
22818
- "kind": "field",
22819
- "name": "ariaLabel",
22820
- "type": {
22821
- "text": "string | null"
22822
- },
22823
- "default": "null",
22824
- "description": "The aria-label for the section.\nThis is used for accessibility purposes to describe the section.\nIf not provided, it defaults to the `headerText`.",
22825
- "attribute": "aria-label",
22826
- "reflects": true
22827
- },
22828
- {
22829
- "kind": "field",
22830
- "name": "headerText",
22831
- "type": {
22832
- "text": "string | null"
22833
- },
22834
- "default": "null",
22835
- "description": "The primary headerText of the list item.\nThis appears on the leading side of the list item.",
22836
- "attribute": "header-text",
22837
- "reflects": true
22838
- },
22839
- {
22840
- "kind": "field",
22841
- "name": "prefixIcon",
22842
- "type": {
22843
- "text": "IconNames | undefined"
22844
- },
22845
- "description": "Name of the icon rendered before the text\n\nIf not provided, no icon will be rendered and text will be aligned to the start.",
22846
- "attribute": "prefix-icon"
22847
- },
22848
- {
22849
- "kind": "field",
22850
- "name": "showDivider",
22851
- "type": {
22852
- "text": "boolean"
22853
- },
22854
- "default": "false",
22855
- "description": "Whether to show a divider below the section header.\nThis is useful for visually separating sections in the menu.",
22856
- "attribute": "show-divider",
22857
- "reflects": true
22858
- },
22859
- {
22860
- "kind": "field",
22861
- "name": "dividerVariant",
22862
- "description": "The variant of the divider.\nCan be set to 'solid' or 'gradient'.\n\nKeep 'solid' if used in MenuPopovers, as it is the default style.",
22863
- "default": "'solid'",
22864
- "attribute": "divider-variant",
22865
- "reflects": true
22866
- },
22867
- {
22868
- "kind": "method",
22869
- "name": "renderHeader",
22870
- "privacy": "private"
22871
- }
22872
- ],
22873
- "events": [
22874
- {
22875
- "description": "(React: onChange) This event is dispatched when a `menuitemcheckbox`, or `menuitemradio` changes.",
22876
- "name": "change",
22877
- "reactName": "onChange"
22878
- }
22879
- ],
22880
- "attributes": [
22881
- {
22882
- "name": "aria-label",
22883
- "type": {
22884
- "text": "string | null"
22885
- },
22886
- "default": "null",
22887
- "description": "The aria-label for the section.\nThis is used for accessibility purposes to describe the section.\nIf not provided, it defaults to the `headerText`.",
22888
- "fieldName": "ariaLabel"
22889
- },
22890
- {
22891
- "name": "header-text",
22892
- "type": {
22893
- "text": "string | null"
22894
- },
22895
- "default": "null",
22896
- "description": "The primary headerText of the list item.\nThis appears on the leading side of the list item.",
22897
- "fieldName": "headerText"
22898
- },
22899
- {
22900
- "name": "prefix-icon",
22901
- "type": {
22902
- "text": "IconNames | undefined"
22903
- },
22904
- "description": "Name of the icon rendered before the text\n\nIf not provided, no icon will be rendered and text will be aligned to the start.",
22905
- "fieldName": "prefixIcon"
22906
- },
22907
- {
22908
- "name": "show-divider",
22909
- "type": {
22910
- "text": "boolean"
22911
- },
22912
- "default": "false",
22913
- "description": "Whether to show a divider below the section header.\nThis is useful for visually separating sections in the menu.",
22914
- "fieldName": "showDivider"
22915
- },
22916
- {
22917
- "name": "divider-variant",
22918
- "description": "The variant of the divider.\nCan be set to 'solid' or 'gradient'.\n\nKeep 'solid' if used in MenuPopovers, as it is the default style.",
22919
- "default": "'solid'",
22920
- "fieldName": "dividerVariant"
22921
- }
22922
- ],
22923
- "superclass": {
22924
- "name": "Component",
22925
- "module": "/src/models"
22926
- },
22927
- "tagName": "mdc-menusection",
22928
- "jsDoc": "/**\n * `mdc-menusection` is a container element used to group a set of menu items.\n *\n * This component supports a mix of `menuitem`, `menuitemcheckbox`, and `menuitemradio` components.\n *\n * - If multiple `menuitemradio` components are slotted into the section, the group enforces a single-selection rule:\n * only one radio item can be selected at a time.\n * - If `menuitemcheckbox` components are included, their checked state can be toggled independently.\n *\n * @tagname mdc-menusection\n *\n * @slot - Default slot for inserting `menuitem`, `menuitemcheckbox`, or `menuitemradio`\n *\n * @event change - (React: onChange) This event is dispatched when a `menuitemcheckbox`, or `menuitemradio` changes.\n */",
22929
- "customElement": true
22930
- }
22931
- ],
22932
- "exports": [
22933
- {
22934
- "kind": "js",
22935
- "name": "default",
22936
- "declaration": {
22937
- "name": "MenuSection",
22938
- "module": "components/menusection/menusection.component.js"
22939
- }
22940
- }
22941
- ]
22942
- },
22943
22943
  {
22944
22944
  "kind": "javascript-module",
22945
22945
  "path": "components/navmenuitem/navmenuitem.component.js",
@@ -2,8 +2,8 @@ export { default as Accordion } from './accordion';
2
2
  export { default as AccordionButton } from './accordionbutton';
3
3
  export { default as AccordionGroup } from './accordiongroup';
4
4
  export { default as AlertChip } from './alertchip';
5
- export { default as Appheader } from './appheader';
6
5
  export { default as Animation } from './animation';
6
+ export { default as Appheader } from './appheader';
7
7
  export { default as Avatar } from './avatar';
8
8
  export { default as AvatarButton } from './avatarbutton';
9
9
  export { default as Badge } from './badge';
@@ -40,8 +40,8 @@ export { default as MenuBar } from './menubar';
40
40
  export { default as MenuItem } from './menuitem';
41
41
  export { default as MenuItemCheckbox } from './menuitemcheckbox';
42
42
  export { default as MenuItemRadio } from './menuitemradio';
43
- export { default as MenuPopover } from './menupopover';
44
43
  export { default as MenuSection } from './menusection';
44
+ export { default as MenuPopover } from './menupopover';
45
45
  export { default as NavMenuItem } from './navmenuitem';
46
46
  export { default as OptGroup } from './optgroup';
47
47
  export { default as Option } from './option';
@@ -2,8 +2,8 @@ export { default as Accordion } from './accordion';
2
2
  export { default as AccordionButton } from './accordionbutton';
3
3
  export { default as AccordionGroup } from './accordiongroup';
4
4
  export { default as AlertChip } from './alertchip';
5
- export { default as Appheader } from './appheader';
6
5
  export { default as Animation } from './animation';
6
+ export { default as Appheader } from './appheader';
7
7
  export { default as Avatar } from './avatar';
8
8
  export { default as AvatarButton } from './avatarbutton';
9
9
  export { default as Badge } from './badge';
@@ -40,8 +40,8 @@ export { default as MenuBar } from './menubar';
40
40
  export { default as MenuItem } from './menuitem';
41
41
  export { default as MenuItemCheckbox } from './menuitemcheckbox';
42
42
  export { default as MenuItemRadio } from './menuitemradio';
43
- export { default as MenuPopover } from './menupopover';
44
43
  export { default as MenuSection } from './menusection';
44
+ export { default as MenuPopover } from './menupopover';
45
45
  export { default as NavMenuItem } from './navmenuitem';
46
46
  export { default as OptGroup } from './optgroup';
47
47
  export { default as Option } from './option';
@@ -248,7 +248,13 @@ export const FocusTrapMixin = (superClass) => {
248
248
  if (root instanceof HTMLElement && this.isFocusable(root)) {
249
249
  matches.add(root);
250
250
  }
251
- const children = Array.from(root.children);
251
+ let children = [];
252
+ if (root.children.length) {
253
+ children = Array.from(root.children);
254
+ }
255
+ else if (root instanceof HTMLElement && root.shadowRoot) {
256
+ children = Array.from(root.shadowRoot.children);
257
+ }
252
258
  children.forEach((child) => {
253
259
  const element = child;
254
260
  if (this.isFocusable(element)) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@momentum-design/components",
3
3
  "packageManager": "yarn@3.2.4",
4
- "version": "0.102.1",
4
+ "version": "0.102.3",
5
5
  "engines": {
6
6
  "node": ">=20.0.0",
7
7
  "npm": ">=8.0.0"