@spectrum-web-components/menu 1.7.0 → 1.9.0-nightly.20251013134115

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 (69) hide show
  1. package/package.json +12 -12
  2. package/sp-menu-divider.d.ts +11 -0
  3. package/sp-menu-divider.dev.js.map +1 -1
  4. package/sp-menu-divider.js.map +1 -1
  5. package/sp-menu-group.d.ts +11 -0
  6. package/sp-menu-group.dev.js.map +1 -1
  7. package/sp-menu-group.js.map +1 -1
  8. package/sp-menu-item.d.ts +11 -0
  9. package/sp-menu-item.dev.js.map +1 -1
  10. package/sp-menu-item.js.map +1 -1
  11. package/sp-menu.d.ts +11 -0
  12. package/sp-menu.dev.js.map +1 -1
  13. package/sp-menu.js.map +1 -1
  14. package/src/Menu.d.ts +108 -1
  15. package/src/Menu.dev.js +133 -0
  16. package/src/Menu.dev.js.map +2 -2
  17. package/src/Menu.js +2 -2
  18. package/src/Menu.js.map +3 -3
  19. package/src/MenuDivider.d.ts +15 -2
  20. package/src/MenuDivider.dev.js.map +1 -1
  21. package/src/MenuDivider.js.map +1 -1
  22. package/src/MenuGroup.d.ts +11 -0
  23. package/src/MenuGroup.dev.js.map +1 -1
  24. package/src/MenuGroup.js.map +1 -1
  25. package/src/MenuItem.d.ts +11 -0
  26. package/src/MenuItem.dev.js +2 -2
  27. package/src/MenuItem.dev.js.map +1 -1
  28. package/src/MenuItem.js +2 -2
  29. package/src/MenuItem.js.map +1 -1
  30. package/src/checkmark-overrides.css.dev.js.map +1 -1
  31. package/src/checkmark-overrides.css.js.map +1 -1
  32. package/src/chevron-overrides.css.dev.js.map +1 -1
  33. package/src/chevron-overrides.css.js.map +1 -1
  34. package/src/index.d.ts +11 -0
  35. package/src/index.dev.js.map +1 -1
  36. package/src/index.js.map +1 -1
  37. package/src/menu-divider-overrides.css.dev.js.map +1 -1
  38. package/src/menu-divider-overrides.css.js.map +1 -1
  39. package/src/menu-divider.css.dev.js.map +1 -1
  40. package/src/menu-divider.css.js.map +1 -1
  41. package/src/menu-group.css.dev.js.map +1 -1
  42. package/src/menu-group.css.js.map +1 -1
  43. package/src/menu-item-overrides.css.dev.js.map +1 -1
  44. package/src/menu-item-overrides.css.js.map +1 -1
  45. package/src/menu-item.css.dev.js +1 -1
  46. package/src/menu-item.css.dev.js.map +1 -1
  47. package/src/menu-item.css.js +1 -1
  48. package/src/menu-item.css.js.map +1 -1
  49. package/src/menu-overrides.css.dev.js.map +1 -1
  50. package/src/menu-overrides.css.js.map +1 -1
  51. package/src/menu-sectionHeading-overrides.css.dev.js.map +1 -1
  52. package/src/menu-sectionHeading-overrides.css.js.map +1 -1
  53. package/src/menu.css.dev.js.map +1 -1
  54. package/src/menu.css.js.map +1 -1
  55. package/src/spectrum-checkmark.css.dev.js.map +1 -1
  56. package/src/spectrum-checkmark.css.js.map +1 -1
  57. package/src/spectrum-chevron.css.dev.js.map +1 -1
  58. package/src/spectrum-chevron.css.js.map +1 -1
  59. package/src/spectrum-menu-divider.css.dev.js.map +1 -1
  60. package/src/spectrum-menu-divider.css.js.map +1 -1
  61. package/src/spectrum-menu-item.css.dev.js +1 -1
  62. package/src/spectrum-menu-item.css.dev.js.map +1 -1
  63. package/src/spectrum-menu-item.css.js +1 -1
  64. package/src/spectrum-menu-item.css.js.map +1 -1
  65. package/src/spectrum-menu-sectionHeading.css.dev.js.map +1 -1
  66. package/src/spectrum-menu-sectionHeading.css.js.map +1 -1
  67. package/src/spectrum-menu.css.dev.js.map +1 -1
  68. package/src/spectrum-menu.css.js.map +1 -1
  69. package/custom-elements.json +0 -3018
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spectrum-web-components/menu",
3
- "version": "1.7.0",
3
+ "version": "1.9.0-nightly.20251013134115",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -9,7 +9,7 @@
9
9
  "repository": {
10
10
  "type": "git",
11
11
  "url": "https://github.com/adobe/spectrum-web-components.git",
12
- "directory": "packages/menu"
12
+ "directory": "first-gen/packages/menu"
13
13
  },
14
14
  "author": "Adobe",
15
15
  "homepage": "https://opensource.adobe.com/spectrum-web-components/components/menu",
@@ -95,16 +95,16 @@
95
95
  "css"
96
96
  ],
97
97
  "dependencies": {
98
- "@lit-labs/observers": "^2.0.2",
99
- "@spectrum-web-components/action-button": "1.7.0",
100
- "@spectrum-web-components/base": "1.7.0",
101
- "@spectrum-web-components/divider": "1.7.0",
102
- "@spectrum-web-components/icon": "1.7.0",
103
- "@spectrum-web-components/icons-ui": "1.7.0",
104
- "@spectrum-web-components/overlay": "1.7.0",
105
- "@spectrum-web-components/popover": "1.7.0",
106
- "@spectrum-web-components/reactive-controllers": "1.7.0",
107
- "@spectrum-web-components/shared": "1.7.0"
98
+ "@lit-labs/observers": "2.0.2",
99
+ "@spectrum-web-components/action-button": "1.9.0-nightly.20251013134115",
100
+ "@spectrum-web-components/base": "1.9.0-nightly.20251013134115",
101
+ "@spectrum-web-components/divider": "1.9.0-nightly.20251013134115",
102
+ "@spectrum-web-components/icon": "1.9.0-nightly.20251013134115",
103
+ "@spectrum-web-components/icons-ui": "1.9.0-nightly.20251013134115",
104
+ "@spectrum-web-components/overlay": "1.9.0-nightly.20251013134115",
105
+ "@spectrum-web-components/popover": "1.9.0-nightly.20251013134115",
106
+ "@spectrum-web-components/reactive-controllers": "1.9.0-nightly.20251013134115",
107
+ "@spectrum-web-components/shared": "1.9.0-nightly.20251013134115"
108
108
  },
109
109
  "types": "./src/index.d.ts",
110
110
  "customElements": "custom-elements.json",
@@ -1,3 +1,14 @@
1
+ /**
2
+ * Copyright 2025 Adobe. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
1
12
  import { MenuDivider } from './src/MenuDivider.js';
2
13
  declare global {
3
14
  interface HTMLElementTagNameMap {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["sp-menu-divider.ts"],
4
- "sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nimport { MenuDivider } from './src/MenuDivider.dev.js'\nimport { defineElement } from '@spectrum-web-components/base/src/define-element.js';\n\ndefineElement('sp-menu-divider', MenuDivider);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sp-menu-divider': MenuDivider;\n }\n}\n"],
4
+ "sourcesContent": ["/**\n * Copyright 2025 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\nimport { MenuDivider } from './src/MenuDivider.dev.js'\nimport { defineElement } from '@spectrum-web-components/base/src/define-element.js';\n\ndefineElement('sp-menu-divider', MenuDivider);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sp-menu-divider': MenuDivider;\n }\n}\n"],
5
5
  "mappings": ";AAWA,SAAS,mBAAmB;AAC5B,SAAS,qBAAqB;AAE9B,cAAc,mBAAmB,WAAW;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["sp-menu-divider.ts"],
4
- "sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nimport { MenuDivider } from './src/MenuDivider.js';\nimport { defineElement } from '@spectrum-web-components/base/src/define-element.js';\n\ndefineElement('sp-menu-divider', MenuDivider);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sp-menu-divider': MenuDivider;\n }\n}\n"],
4
+ "sourcesContent": ["/**\n * Copyright 2025 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\nimport { MenuDivider } from './src/MenuDivider.js';\nimport { defineElement } from '@spectrum-web-components/base/src/define-element.js';\n\ndefineElement('sp-menu-divider', MenuDivider);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sp-menu-divider': MenuDivider;\n }\n}\n"],
5
5
  "mappings": "aAWA,OAAS,eAAAA,MAAmB,uBAC5B,OAAS,iBAAAC,MAAqB,sDAE9BA,EAAc,kBAAmBD,CAAW",
6
6
  "names": ["MenuDivider", "defineElement"]
7
7
  }
@@ -1,3 +1,14 @@
1
+ /**
2
+ * Copyright 2025 Adobe. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
1
12
  import { MenuGroup } from './src/MenuGroup.js';
2
13
  declare global {
3
14
  interface HTMLElementTagNameMap {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["sp-menu-group.ts"],
4
- "sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nimport { MenuGroup } from './src/MenuGroup.dev.js'\nimport { defineElement } from '@spectrum-web-components/base/src/define-element.js';\n\ndefineElement('sp-menu-group', MenuGroup);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sp-menu-group': MenuGroup;\n }\n}\n"],
4
+ "sourcesContent": ["/**\n * Copyright 2025 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\nimport { MenuGroup } from './src/MenuGroup.dev.js'\nimport { defineElement } from '@spectrum-web-components/base/src/define-element.js';\n\ndefineElement('sp-menu-group', MenuGroup);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sp-menu-group': MenuGroup;\n }\n}\n"],
5
5
  "mappings": ";AAWA,SAAS,iBAAiB;AAC1B,SAAS,qBAAqB;AAE9B,cAAc,iBAAiB,SAAS;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["sp-menu-group.ts"],
4
- "sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nimport { MenuGroup } from './src/MenuGroup.js';\nimport { defineElement } from '@spectrum-web-components/base/src/define-element.js';\n\ndefineElement('sp-menu-group', MenuGroup);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sp-menu-group': MenuGroup;\n }\n}\n"],
4
+ "sourcesContent": ["/**\n * Copyright 2025 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\nimport { MenuGroup } from './src/MenuGroup.js';\nimport { defineElement } from '@spectrum-web-components/base/src/define-element.js';\n\ndefineElement('sp-menu-group', MenuGroup);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sp-menu-group': MenuGroup;\n }\n}\n"],
5
5
  "mappings": "aAWA,OAAS,aAAAA,MAAiB,qBAC1B,OAAS,iBAAAC,MAAqB,sDAE9BA,EAAc,gBAAiBD,CAAS",
6
6
  "names": ["MenuGroup", "defineElement"]
7
7
  }
package/sp-menu-item.d.ts CHANGED
@@ -1,3 +1,14 @@
1
+ /**
2
+ * Copyright 2025 Adobe. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
1
12
  import { MenuItem } from './src/MenuItem.js';
2
13
  declare global {
3
14
  interface HTMLElementTagNameMap {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["sp-menu-item.ts"],
4
- "sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nimport { MenuItem } from './src/MenuItem.dev.js'\nimport { defineElement } from '@spectrum-web-components/base/src/define-element.js';\n\ndefineElement('sp-menu-item', MenuItem);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sp-menu-item': MenuItem;\n }\n}\n"],
4
+ "sourcesContent": ["/**\n * Copyright 2025 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\nimport { MenuItem } from './src/MenuItem.dev.js'\nimport { defineElement } from '@spectrum-web-components/base/src/define-element.js';\n\ndefineElement('sp-menu-item', MenuItem);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sp-menu-item': MenuItem;\n }\n}\n"],
5
5
  "mappings": ";AAWA,SAAS,gBAAgB;AACzB,SAAS,qBAAqB;AAE9B,cAAc,gBAAgB,QAAQ;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["sp-menu-item.ts"],
4
- "sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nimport { MenuItem } from './src/MenuItem.js';\nimport { defineElement } from '@spectrum-web-components/base/src/define-element.js';\n\ndefineElement('sp-menu-item', MenuItem);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sp-menu-item': MenuItem;\n }\n}\n"],
4
+ "sourcesContent": ["/**\n * Copyright 2025 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\nimport { MenuItem } from './src/MenuItem.js';\nimport { defineElement } from '@spectrum-web-components/base/src/define-element.js';\n\ndefineElement('sp-menu-item', MenuItem);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sp-menu-item': MenuItem;\n }\n}\n"],
5
5
  "mappings": "aAWA,OAAS,YAAAA,MAAgB,oBACzB,OAAS,iBAAAC,MAAqB,sDAE9BA,EAAc,eAAgBD,CAAQ",
6
6
  "names": ["MenuItem", "defineElement"]
7
7
  }
package/sp-menu.d.ts CHANGED
@@ -1,3 +1,14 @@
1
+ /**
2
+ * Copyright 2025 Adobe. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
1
12
  import { Menu } from './src/Menu.js';
2
13
  declare global {
3
14
  interface HTMLElementTagNameMap {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["sp-menu.ts"],
4
- "sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nimport { Menu } from './src/Menu.dev.js'\nimport { defineElement } from '@spectrum-web-components/base/src/define-element.js';\n\ndefineElement('sp-menu', Menu);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sp-menu': Menu;\n }\n}\n"],
4
+ "sourcesContent": ["/**\n * Copyright 2025 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\nimport { Menu } from './src/Menu.dev.js'\nimport { defineElement } from '@spectrum-web-components/base/src/define-element.js';\n\ndefineElement('sp-menu', Menu);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sp-menu': Menu;\n }\n}\n"],
5
5
  "mappings": ";AAWA,SAAS,YAAY;AACrB,SAAS,qBAAqB;AAE9B,cAAc,WAAW,IAAI;",
6
6
  "names": []
7
7
  }
package/sp-menu.js.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["sp-menu.ts"],
4
- "sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nimport { Menu } from './src/Menu.js';\nimport { defineElement } from '@spectrum-web-components/base/src/define-element.js';\n\ndefineElement('sp-menu', Menu);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sp-menu': Menu;\n }\n}\n"],
4
+ "sourcesContent": ["/**\n * Copyright 2025 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\nimport { Menu } from './src/Menu.js';\nimport { defineElement } from '@spectrum-web-components/base/src/define-element.js';\n\ndefineElement('sp-menu', Menu);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sp-menu': Menu;\n }\n}\n"],
5
5
  "mappings": "aAWA,OAAS,QAAAA,MAAY,gBACrB,OAAS,iBAAAC,MAAqB,sDAE9BA,EAAc,UAAWD,CAAI",
6
6
  "names": ["Menu", "defineElement"]
7
7
  }
package/src/Menu.d.ts CHANGED
@@ -1,3 +1,14 @@
1
+ /**
2
+ * Copyright 2025 Adobe. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
1
12
  import { CSSResultArray, PropertyValues, SpectrumElement, TemplateResult } from '@spectrum-web-components/base';
2
13
  import { MenuItem } from './MenuItem.js';
3
14
  import type { MenuItemKeydownEvent } from './MenuItem.js';
@@ -12,7 +23,7 @@ export interface MenuChildItem {
12
23
  declare const Menu_base: typeof SpectrumElement & {
13
24
  new (...args: any[]): import("@spectrum-web-components/base").SizedElementInterface;
14
25
  prototype: import("@spectrum-web-components/base").SizedElementInterface;
15
- };
26
+ } & import("@spectrum-web-components/base").SizedElementConstructor;
16
27
  /**
17
28
  * Spectrum Menu Component
18
29
  * @element sp-menu
@@ -35,6 +46,69 @@ export declare class Menu extends Menu_base {
35
46
  };
36
47
  private get isSubmenu();
37
48
  protected rovingTabindexController?: RovingTabindexController<MenuItem>;
49
+ /**
50
+ * iPad scroll detection properties
51
+ *
52
+ * This feature prevents menu item selection during iPad scrolling to avoid
53
+ * accidental selections when users are trying to scroll through a long menu.
54
+ *
55
+ * How it works:
56
+ * 1. On touchstart: Record initial Y position and timestamp
57
+ * 2. On touchmove: Calculate vertical movement and time elapsed
58
+ * 3. If movement > threshold AND time < threshold: Mark as scrolling
59
+ * 4. On touchend: Reset scrolling state after a delay
60
+ * 5. During selection: Prevent selection if scrolling is detected
61
+ *
62
+ * This prevents the common iPad issue where users accidentally select menu
63
+ * items while trying to scroll through the menu content.
64
+ *
65
+ * Threshold Values:
66
+ * - Movement threshold: 10px (consistent with Card component click vs. drag detection)
67
+ * - Time threshold: 300ms (consistent with longpress duration across the design system)
68
+ * - Reset delay: 100ms (allows final touch events to be processed)
69
+ *
70
+ * These values are carefully chosen to balance preventing accidental triggers
71
+ * while allowing intentional scroll gestures. They represent a common UX pattern
72
+ * in mobile interfaces and are consistent with other components in the design system.
73
+ */
74
+ private touchStartY;
75
+ private touchStartTime;
76
+ private isCurrentlyScrolling;
77
+ /**
78
+ * Minimum vertical movement (in pixels) required to trigger scrolling detection.
79
+ *
80
+ * This threshold is consistent with other components in the design system:
81
+ * - Card component uses 10px for click vs. drag detection
82
+ * - Menu component uses 10px for scroll vs. selection detection
83
+ *
84
+ * The 10px threshold is carefully chosen to:
85
+ * - Allow for natural finger tremor and accidental touches
86
+ * - Distinguish between intentional scroll gestures and taps
87
+ * - Provide consistent behavior across the platform
88
+ *
89
+ * @see {@link packages/card/src/Card.ts} for similar threshold usage
90
+ */
91
+ private scrollThreshold;
92
+ /**
93
+ * Maximum time (in milliseconds) for a movement to be considered scrolling.
94
+ *
95
+ * This threshold is consistent with other timing values in the design system:
96
+ * - Longpress duration: 300ms (ActionButton, LongpressController)
97
+ * - Scroll detection: 300ms (Menu component)
98
+ *
99
+ * Quick movements within this timeframe are likely intentional scrolls,
100
+ * while slower movements are more likely taps or selections.
101
+ *
102
+ * @see {@link packages/action-button/src/ActionButton.ts} for longpress duration
103
+ * @see {@link packages/overlay/src/LongpressController.ts} for longpress duration
104
+ */
105
+ private scrollTimeThreshold;
106
+ /**
107
+ * Public getter for scrolling state
108
+ * Returns true if the component is currently in a scrolling state
109
+ */
110
+ get isScrolling(): boolean;
111
+ set isScrolling(value: boolean);
38
112
  /**
39
113
  * label of the menu
40
114
  */
@@ -127,6 +201,39 @@ export declare class Menu extends Menu_base {
127
201
  */
128
202
  focusOnFirstSelectedItem({ preventScroll, }?: FocusOptions): void;
129
203
  focus({ preventScroll }?: FocusOptions): void;
204
+ /**
205
+ * Handles touchstart events for iPad scroll detection.
206
+ *
207
+ * Records the initial touch position and timestamp to establish a baseline
208
+ * for detecting scroll gestures. Only processes single-touch events to
209
+ * avoid interference with multi-touch gestures.
210
+ *
211
+ * @param event - The TouchEvent from the touchstart event
212
+ */
213
+ private handleTouchStart;
214
+ /**
215
+ * Handles touchmove events for iPad scroll detection.
216
+ *
217
+ * Calculates the vertical movement distance and time elapsed since touchstart.
218
+ * If the movement exceeds the threshold (10px) and happens within the time
219
+ * threshold (300ms), it marks the interaction as scrolling. This helps
220
+ * distinguish between intentional scroll gestures and accidental touches.
221
+ *
222
+ * @param event - The TouchEvent from the touchmove event
223
+ */
224
+ private handleTouchMove;
225
+ /**
226
+ * Handles touchend events for iPad scroll detection.
227
+ *
228
+ * Resets the scrolling state after a short delay (100ms) to allow for
229
+ * any final touch events to be processed. This delay prevents immediate
230
+ * state changes that could interfere with the selection logic.
231
+ *
232
+ * The 100ms delay is consistent with the design system's approach to
233
+ * touch event handling and ensures that any final touch events or
234
+ * gesture recognition can complete before the scrolling state is reset.
235
+ */
236
+ private handleTouchEnd;
130
237
  private pointerUpTarget;
131
238
  private handleFocusout;
132
239
  private handleClick;
package/src/Menu.dev.js CHANGED
@@ -23,6 +23,64 @@ import { RovingTabindexController } from "@spectrum-web-components/reactive-cont
23
23
  export class Menu extends SizedMixin(SpectrumElement, { noDefaultSize: true }) {
24
24
  constructor() {
25
25
  super();
26
+ /**
27
+ * iPad scroll detection properties
28
+ *
29
+ * This feature prevents menu item selection during iPad scrolling to avoid
30
+ * accidental selections when users are trying to scroll through a long menu.
31
+ *
32
+ * How it works:
33
+ * 1. On touchstart: Record initial Y position and timestamp
34
+ * 2. On touchmove: Calculate vertical movement and time elapsed
35
+ * 3. If movement > threshold AND time < threshold: Mark as scrolling
36
+ * 4. On touchend: Reset scrolling state after a delay
37
+ * 5. During selection: Prevent selection if scrolling is detected
38
+ *
39
+ * This prevents the common iPad issue where users accidentally select menu
40
+ * items while trying to scroll through the menu content.
41
+ *
42
+ * Threshold Values:
43
+ * - Movement threshold: 10px (consistent with Card component click vs. drag detection)
44
+ * - Time threshold: 300ms (consistent with longpress duration across the design system)
45
+ * - Reset delay: 100ms (allows final touch events to be processed)
46
+ *
47
+ * These values are carefully chosen to balance preventing accidental triggers
48
+ * while allowing intentional scroll gestures. They represent a common UX pattern
49
+ * in mobile interfaces and are consistent with other components in the design system.
50
+ */
51
+ this.touchStartY = void 0;
52
+ this.touchStartTime = void 0;
53
+ this.isCurrentlyScrolling = false;
54
+ /**
55
+ * Minimum vertical movement (in pixels) required to trigger scrolling detection.
56
+ *
57
+ * This threshold is consistent with other components in the design system:
58
+ * - Card component uses 10px for click vs. drag detection
59
+ * - Menu component uses 10px for scroll vs. selection detection
60
+ *
61
+ * The 10px threshold is carefully chosen to:
62
+ * - Allow for natural finger tremor and accidental touches
63
+ * - Distinguish between intentional scroll gestures and taps
64
+ * - Provide consistent behavior across the platform
65
+ *
66
+ * @see {@link packages/card/src/Card.ts} for similar threshold usage
67
+ */
68
+ this.scrollThreshold = 10;
69
+ // pixels
70
+ /**
71
+ * Maximum time (in milliseconds) for a movement to be considered scrolling.
72
+ *
73
+ * This threshold is consistent with other timing values in the design system:
74
+ * - Longpress duration: 300ms (ActionButton, LongpressController)
75
+ * - Scroll detection: 300ms (Menu component)
76
+ *
77
+ * Quick movements within this timeframe are likely intentional scrolls,
78
+ * while slower movements are more likely taps or selections.
79
+ *
80
+ * @see {@link packages/action-button/src/ActionButton.ts} for longpress duration
81
+ * @see {@link packages/overlay/src/LongpressController.ts} for longpress duration
82
+ */
83
+ this.scrollTimeThreshold = 300;
26
84
  this.label = "";
27
85
  this.ignore = false;
28
86
  this.value = "";
@@ -111,6 +169,12 @@ export class Menu extends SizedMixin(SpectrumElement, { noDefaultSize: true }) {
111
169
  this.addEventListener("pointerup", this.handlePointerup);
112
170
  this.addEventListener("sp-opened", this.handleSubmenuOpened);
113
171
  this.addEventListener("sp-closed", this.handleSubmenuClosed);
172
+ this.addEventListener("touchstart", this.handleTouchStart, {
173
+ passive: true
174
+ });
175
+ this.addEventListener("touchmove", this.handleTouchMove, {
176
+ passive: true
177
+ });
114
178
  }
115
179
  static get styles() {
116
180
  return [menuStyles];
@@ -118,6 +182,17 @@ export class Menu extends SizedMixin(SpectrumElement, { noDefaultSize: true }) {
118
182
  get isSubmenu() {
119
183
  return this.slot === "submenu";
120
184
  }
185
+ // milliseconds
186
+ /**
187
+ * Public getter for scrolling state
188
+ * Returns true if the component is currently in a scrolling state
189
+ */
190
+ get isScrolling() {
191
+ return this.isCurrentlyScrolling;
192
+ }
193
+ set isScrolling(value) {
194
+ this.isCurrentlyScrolling = value;
195
+ }
121
196
  get selected() {
122
197
  return !this.selects ? [] : this._selected;
123
198
  }
@@ -313,6 +388,60 @@ export class Menu extends SizedMixin(SpectrumElement, { noDefaultSize: true }) {
313
388
  this.rovingTabindexController.focus({ preventScroll });
314
389
  }
315
390
  }
391
+ /**
392
+ * Handles touchstart events for iPad scroll detection.
393
+ *
394
+ * Records the initial touch position and timestamp to establish a baseline
395
+ * for detecting scroll gestures. Only processes single-touch events to
396
+ * avoid interference with multi-touch gestures.
397
+ *
398
+ * @param event - The TouchEvent from the touchstart event
399
+ */
400
+ handleTouchStart(event) {
401
+ if (event.touches.length === 1) {
402
+ this.touchStartY = event.touches[0].clientY;
403
+ this.touchStartTime = Date.now();
404
+ this.isCurrentlyScrolling = false;
405
+ }
406
+ }
407
+ /**
408
+ * Handles touchmove events for iPad scroll detection.
409
+ *
410
+ * Calculates the vertical movement distance and time elapsed since touchstart.
411
+ * If the movement exceeds the threshold (10px) and happens within the time
412
+ * threshold (300ms), it marks the interaction as scrolling. This helps
413
+ * distinguish between intentional scroll gestures and accidental touches.
414
+ *
415
+ * @param event - The TouchEvent from the touchmove event
416
+ */
417
+ handleTouchMove(event) {
418
+ if (event.touches.length === 1 && this.touchStartY !== void 0 && this.touchStartTime !== void 0) {
419
+ const currentY = event.touches[0].clientY;
420
+ const deltaY = Math.abs(currentY - this.touchStartY);
421
+ const deltaTime = Date.now() - this.touchStartTime;
422
+ if (deltaY > this.scrollThreshold && deltaTime < this.scrollTimeThreshold) {
423
+ this.isCurrentlyScrolling = true;
424
+ }
425
+ }
426
+ }
427
+ /**
428
+ * Handles touchend events for iPad scroll detection.
429
+ *
430
+ * Resets the scrolling state after a short delay (100ms) to allow for
431
+ * any final touch events to be processed. This delay prevents immediate
432
+ * state changes that could interfere with the selection logic.
433
+ *
434
+ * The 100ms delay is consistent with the design system's approach to
435
+ * touch event handling and ensures that any final touch events or
436
+ * gesture recognition can complete before the scrolling state is reset.
437
+ */
438
+ handleTouchEnd() {
439
+ setTimeout(() => {
440
+ this.isCurrentlyScrolling = false;
441
+ this.touchStartY = void 0;
442
+ this.touchStartTime = void 0;
443
+ }, 100);
444
+ }
316
445
  handleFocusout() {
317
446
  var _a;
318
447
  if (!this.matches(":focus-within"))
@@ -326,6 +455,7 @@ export class Menu extends SizedMixin(SpectrumElement, { noDefaultSize: true }) {
326
455
  this.handlePointerBasedSelection(event);
327
456
  }
328
457
  handlePointerup(event) {
458
+ this.handleTouchEnd();
329
459
  if (!this.shouldSupportDragAndSelect) {
330
460
  return;
331
461
  }
@@ -337,6 +467,9 @@ export class Menu extends SizedMixin(SpectrumElement, { noDefaultSize: true }) {
337
467
  if (event instanceof MouseEvent && event.button !== 0) {
338
468
  return;
339
469
  }
470
+ if (this.isScrolling) {
471
+ return;
472
+ }
340
473
  const path = event.composedPath();
341
474
  const target = path.find((el) => {
342
475
  if (!(el instanceof Element)) {