@momentum-design/components 0.102.2 → 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.
@@ -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",
@@ -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';
@@ -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.2",
4
+ "version": "0.102.3",
5
5
  "engines": {
6
6
  "node": ">=20.0.0",
7
7
  "npm": ">=8.0.0"