@spectrum-web-components/shared 0.33.2 → 0.33.3-overlay.61

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spectrum-web-components/shared",
3
- "version": "0.33.2",
3
+ "version": "0.33.3-overlay.61+af969dcc2",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -89,7 +89,7 @@
89
89
  ],
90
90
  "dependencies": {
91
91
  "@lit-labs/observers": "^2.0.0",
92
- "@spectrum-web-components/base": "^0.33.2",
92
+ "@spectrum-web-components/base": "^0.33.3-overlay.61+af969dcc2",
93
93
  "focus-visible": "^5.1.0"
94
94
  },
95
95
  "types": "./src/index.d.ts",
@@ -97,5 +97,5 @@
97
97
  "sideEffects": [
98
98
  "./**/*.dev.js"
99
99
  ],
100
- "gitHead": "6d5d6b3c31d92a058202a242a283125d25131f81"
100
+ "gitHead": "af969dcc2f8c905648b3e5a5fad982d1f81ee080"
101
101
  }
@@ -1,2 +1,3 @@
1
1
  import type { SpectrumElement } from '@spectrum-web-components/base';
2
2
  export declare const firstFocusableIn: (root: HTMLElement | ShadowRoot) => SpectrumElement | null;
3
+ export declare const firstFocusableSlottedIn: (root: HTMLSlotElement) => SpectrumElement | null;
@@ -6,4 +6,10 @@ export const firstFocusableIn = (root) => {
6
6
  );
7
7
  return firstFocusable;
8
8
  };
9
+ export const firstFocusableSlottedIn = (root) => {
10
+ const firstFocusable = root.assignedElements().find(
11
+ (element) => element.matches(firstFocusableSelector)
12
+ );
13
+ return firstFocusable;
14
+ };
9
15
  //# sourceMappingURL=first-focusable-in.dev.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["first-focusable-in.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*/\n\nimport type { SpectrumElement } from '@spectrum-web-components/base';\n\nconst firstFocusableSelector =\n 'button:not([tabindex=\"-1\"]), [href]:not([tabindex=\"-1\"]), input:not([tabindex=\"-1\"]), select:not([tabindex=\"-1\"]), textarea:not([tabindex=\"-1\"]), [tabindex]:not([tabindex=\"-1\"]), [focusable]:not([tabindex=\"-1\"])';\n\nexport const firstFocusableIn = (\n root: HTMLElement | ShadowRoot\n): SpectrumElement | null => {\n const firstFocusable = root.querySelector(\n firstFocusableSelector\n ) as SpectrumElement;\n return firstFocusable;\n};\n"],
5
- "mappings": ";AAcA,MAAM,yBACF;AAEG,aAAM,mBAAmB,CAC5B,SACyB;AACzB,QAAM,iBAAiB,KAAK;AAAA,IACxB;AAAA,EACJ;AACA,SAAO;AACX;",
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*/\n\nimport type { SpectrumElement } from '@spectrum-web-components/base';\n\nconst firstFocusableSelector =\n 'button:not([tabindex=\"-1\"]), [href]:not([tabindex=\"-1\"]), input:not([tabindex=\"-1\"]), select:not([tabindex=\"-1\"]), textarea:not([tabindex=\"-1\"]), [tabindex]:not([tabindex=\"-1\"]), [focusable]:not([tabindex=\"-1\"])';\n\nexport const firstFocusableIn = (\n root: HTMLElement | ShadowRoot\n): SpectrumElement | null => {\n const firstFocusable = root.querySelector(\n firstFocusableSelector\n ) as SpectrumElement;\n return firstFocusable;\n};\n\nexport const firstFocusableSlottedIn = (\n root: HTMLSlotElement\n): SpectrumElement | null => {\n const firstFocusable = root\n .assignedElements()\n .find((element) =>\n element.matches(firstFocusableSelector)\n ) as SpectrumElement;\n return firstFocusable;\n};\n"],
5
+ "mappings": ";AAcA,MAAM,yBACF;AAEG,aAAM,mBAAmB,CAC5B,SACyB;AACzB,QAAM,iBAAiB,KAAK;AAAA,IACxB;AAAA,EACJ;AACA,SAAO;AACX;AAEO,aAAM,0BAA0B,CACnC,SACyB;AACzB,QAAM,iBAAiB,KAClB,iBAAiB,EACjB;AAAA,IAAK,CAAC,YACH,QAAQ,QAAQ,sBAAsB;AAAA,EAC1C;AACJ,SAAO;AACX;",
6
6
  "names": []
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";const e='button:not([tabindex="-1"]), [href]:not([tabindex="-1"]), input:not([tabindex="-1"]), select:not([tabindex="-1"]), textarea:not([tabindex="-1"]), [tabindex]:not([tabindex="-1"]), [focusable]:not([tabindex="-1"])';export const firstFocusableIn=t=>t.querySelector(e);
1
+ "use strict";const e='button:not([tabindex="-1"]), [href]:not([tabindex="-1"]), input:not([tabindex="-1"]), select:not([tabindex="-1"]), textarea:not([tabindex="-1"]), [tabindex]:not([tabindex="-1"]), [focusable]:not([tabindex="-1"])';export const firstFocusableIn=t=>t.querySelector(e),firstFocusableSlottedIn=t=>t.assignedElements().find(o=>o.matches(e));
2
2
  //# sourceMappingURL=first-focusable-in.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["first-focusable-in.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*/\n\nimport type { SpectrumElement } from '@spectrum-web-components/base';\n\nconst firstFocusableSelector =\n 'button:not([tabindex=\"-1\"]), [href]:not([tabindex=\"-1\"]), input:not([tabindex=\"-1\"]), select:not([tabindex=\"-1\"]), textarea:not([tabindex=\"-1\"]), [tabindex]:not([tabindex=\"-1\"]), [focusable]:not([tabindex=\"-1\"])';\n\nexport const firstFocusableIn = (\n root: HTMLElement | ShadowRoot\n): SpectrumElement | null => {\n const firstFocusable = root.querySelector(\n firstFocusableSelector\n ) as SpectrumElement;\n return firstFocusable;\n};\n"],
5
- "mappings": "aAcA,MAAMA,EACF,sNAEG,aAAM,iBACTC,GAEuBA,EAAK,cACxBD,CACJ",
6
- "names": ["firstFocusableSelector", "root"]
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*/\n\nimport type { SpectrumElement } from '@spectrum-web-components/base';\n\nconst firstFocusableSelector =\n 'button:not([tabindex=\"-1\"]), [href]:not([tabindex=\"-1\"]), input:not([tabindex=\"-1\"]), select:not([tabindex=\"-1\"]), textarea:not([tabindex=\"-1\"]), [tabindex]:not([tabindex=\"-1\"]), [focusable]:not([tabindex=\"-1\"])';\n\nexport const firstFocusableIn = (\n root: HTMLElement | ShadowRoot\n): SpectrumElement | null => {\n const firstFocusable = root.querySelector(\n firstFocusableSelector\n ) as SpectrumElement;\n return firstFocusable;\n};\n\nexport const firstFocusableSlottedIn = (\n root: HTMLSlotElement\n): SpectrumElement | null => {\n const firstFocusable = root\n .assignedElements()\n .find((element) =>\n element.matches(firstFocusableSelector)\n ) as SpectrumElement;\n return firstFocusable;\n};\n"],
5
+ "mappings": "aAcA,MAAMA,EACF,sNAEG,aAAM,iBACTC,GAEuBA,EAAK,cACxBD,CACJ,EAIS,wBACTC,GAEuBA,EAClB,iBAAiB,EACjB,KAAMC,GACHA,EAAQ,QAAQF,CAAsB,CAC1C",
6
+ "names": ["firstFocusableSelector", "root", "element"]
7
7
  }