@spectrum-web-components/shared 0.35.1-rc.41 → 0.36.0

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.35.1-rc.41+6ac4e82f0",
3
+ "version": "0.36.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -33,10 +33,6 @@
33
33
  "development": "./src/focus-visible.dev.js",
34
34
  "default": "./src/focus-visible.js"
35
35
  },
36
- "./src/focusable-selectors.js": {
37
- "development": "./src/focusable-selectors.dev.js",
38
- "default": "./src/focusable-selectors.js"
39
- },
40
36
  "./src/focusable.js": {
41
37
  "development": "./src/focusable.dev.js",
42
38
  "default": "./src/focusable.js"
@@ -97,7 +93,7 @@
97
93
  ],
98
94
  "dependencies": {
99
95
  "@lit-labs/observers": "^2.0.0",
100
- "@spectrum-web-components/base": "^0.35.1-rc.41+6ac4e82f0",
96
+ "@spectrum-web-components/base": "^0.36.0",
101
97
  "focus-visible": "^5.1.0"
102
98
  },
103
99
  "types": "./src/index.d.ts",
@@ -105,5 +101,5 @@
105
101
  "sideEffects": [
106
102
  "./**/*.dev.js"
107
103
  ],
108
- "gitHead": "6ac4e82f0a4a68eb50b5dd4b96a562060162ac6f"
104
+ "gitHead": "a532ff8a410abeefb54d9638a2316ae82570566e"
109
105
  }
@@ -1,3 +1,2 @@
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;
@@ -1,14 +1,8 @@
1
1
  "use strict";
2
- import { userFocusableSelector } from "./focusable-selectors.dev.js";
2
+ const firstFocusableSelector = '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"])';
3
3
  export const firstFocusableIn = (root) => {
4
4
  const firstFocusable = root.querySelector(
5
- userFocusableSelector
6
- );
7
- return firstFocusable;
8
- };
9
- export const firstFocusableSlottedIn = (root) => {
10
- const firstFocusable = root.assignedElements().find(
11
- (element) => element.matches(userFocusableSelector)
5
+ firstFocusableSelector
12
6
  );
13
7
  return firstFocusable;
14
8
  };
@@ -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';\nimport { userFocusableSelector } from './focusable-selectors.dev.js'\n\nexport const firstFocusableIn = (\n root: HTMLElement | ShadowRoot\n): SpectrumElement | null => {\n const firstFocusable = root.querySelector(\n userFocusableSelector\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(userFocusableSelector)\n ) as SpectrumElement;\n return firstFocusable;\n};\n"],
5
- "mappings": ";AAaA,SAAS,6BAA6B;AAE/B,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,qBAAqB;AAAA,EACzC;AACJ,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"],
5
+ "mappings": ";AAcA,MAAM,yBACF;AAEG,aAAM,mBAAmB,CAC5B,SACyB;AACzB,QAAM,iBAAiB,KAAK;AAAA,IACxB;AAAA,EACJ;AACA,SAAO;AACX;",
6
6
  "names": []
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";import{userFocusableSelector as t}from"./focusable-selectors.js";export const firstFocusableIn=e=>e.querySelector(t),firstFocusableSlottedIn=e=>e.assignedElements().find(o=>o.matches(t));
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);
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';\nimport { userFocusableSelector } from './focusable-selectors.js';\n\nexport const firstFocusableIn = (\n root: HTMLElement | ShadowRoot\n): SpectrumElement | null => {\n const firstFocusable = root.querySelector(\n userFocusableSelector\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(userFocusableSelector)\n ) as SpectrumElement;\n return firstFocusable;\n};\n"],
5
- "mappings": "aAaA,OAAS,yBAAAA,MAA6B,2BAE/B,aAAM,iBACTC,GAEuBA,EAAK,cACxBD,CACJ,EAIS,wBACTC,GAEuBA,EAClB,iBAAiB,EACjB,KAAMC,GACHA,EAAQ,QAAQF,CAAqB,CACzC",
6
- "names": ["userFocusableSelector", "root", "element"]
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"]
7
7
  }
package/src/index.d.ts CHANGED
@@ -1,7 +1,6 @@
1
1
  export * from './first-focusable-in.js';
2
2
  export * from './focus-visible.js';
3
3
  export * from './focusable.js';
4
- export * from './focusable-selectors.js';
5
4
  export * from './get-active-element.js';
6
5
  export * from './like-anchor.js';
7
6
  export * from './observe-slot-presence.js';
package/src/index.dev.js CHANGED
@@ -2,7 +2,6 @@
2
2
  export * from "./first-focusable-in.dev.js";
3
3
  export * from "./focus-visible.dev.js";
4
4
  export * from "./focusable.dev.js";
5
- export * from "./focusable-selectors.dev.js";
6
5
  export * from "./get-active-element.dev.js";
7
6
  export * from "./like-anchor.dev.js";
8
7
  export * from "./observe-slot-presence.dev.js";
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["index.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\nexport * from './first-focusable-in.dev.js'\nexport * from './focus-visible.dev.js'\nexport * from './focusable.dev.js'\nexport * from './focusable-selectors.dev.js'\nexport * from './get-active-element.dev.js'\nexport * from './like-anchor.dev.js'\nexport * from './observe-slot-presence.dev.js'\nexport * from './observe-slot-text.dev.js'\nexport * from './platform.dev.js'\nexport * from './reparent-children.dev.js'\nexport * from './get-label-from-slot.dev.js'\n"],
5
- "mappings": ";AAYA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;",
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\nexport * from './first-focusable-in.dev.js'\nexport * from './focus-visible.dev.js'\nexport * from './focusable.dev.js'\nexport * from './get-active-element.dev.js'\nexport * from './like-anchor.dev.js'\nexport * from './observe-slot-presence.dev.js'\nexport * from './observe-slot-text.dev.js'\nexport * from './platform.dev.js'\nexport * from './reparent-children.dev.js'\nexport * from './get-label-from-slot.dev.js'\n"],
5
+ "mappings": ";AAYA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;",
6
6
  "names": []
7
7
  }
package/src/index.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";export*from"./first-focusable-in.js";export*from"./focus-visible.js";export*from"./focusable.js";export*from"./focusable-selectors.js";export*from"./get-active-element.js";export*from"./like-anchor.js";export*from"./observe-slot-presence.js";export*from"./observe-slot-text.js";export*from"./platform.js";export*from"./reparent-children.js";export*from"./get-label-from-slot.js";
1
+ "use strict";export*from"./first-focusable-in.js";export*from"./focus-visible.js";export*from"./focusable.js";export*from"./get-active-element.js";export*from"./like-anchor.js";export*from"./observe-slot-presence.js";export*from"./observe-slot-text.js";export*from"./platform.js";export*from"./reparent-children.js";export*from"./get-label-from-slot.js";
2
2
  //# sourceMappingURL=index.js.map
package/src/index.js.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["index.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\nexport * from './first-focusable-in.js';\nexport * from './focus-visible.js';\nexport * from './focusable.js';\nexport * from './focusable-selectors.js';\nexport * from './get-active-element.js';\nexport * from './like-anchor.js';\nexport * from './observe-slot-presence.js';\nexport * from './observe-slot-text.js';\nexport * from './platform.js';\nexport * from './reparent-children.js';\nexport * from './get-label-from-slot.js';\n"],
5
- "mappings": "aAYA,WAAc,0BACd,WAAc,qBACd,WAAc,iBACd,WAAc,2BACd,WAAc,0BACd,WAAc,mBACd,WAAc,6BACd,WAAc,yBACd,WAAc,gBACd,WAAc,yBACd,WAAc",
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\nexport * from './first-focusable-in.js';\nexport * from './focus-visible.js';\nexport * from './focusable.js';\nexport * from './get-active-element.js';\nexport * from './like-anchor.js';\nexport * from './observe-slot-presence.js';\nexport * from './observe-slot-text.js';\nexport * from './platform.js';\nexport * from './reparent-children.js';\nexport * from './get-label-from-slot.js';\n"],
5
+ "mappings": "aAYA,WAAc,0BACd,WAAc,qBACd,WAAc,iBACd,WAAc,0BACd,WAAc,mBACd,WAAc,6BACd,WAAc,yBACd,WAAc,gBACd,WAAc,yBACd,WAAc",
6
6
  "names": []
7
7
  }
@@ -1,2 +0,0 @@
1
- export declare const userFocusableSelector: string;
2
- export declare const focusableSelector: string;
@@ -1,15 +0,0 @@
1
- "use strict";
2
- const focusables = [
3
- "button",
4
- "[focusable]",
5
- "[href]",
6
- "input",
7
- "label",
8
- "select",
9
- "textarea",
10
- "[tabindex]"
11
- ];
12
- const userFocuable = ':not([tabindex="-1"])';
13
- export const userFocusableSelector = focusables.join(`${userFocuable}, `) + userFocuable;
14
- export const focusableSelector = focusables.join(", ");
15
- //# sourceMappingURL=focusable-selectors.dev.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["focusable-selectors.ts"],
4
- "sourcesContent": ["/*\nCopyright 2023 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\nconst focusables = [\n 'button',\n '[focusable]',\n '[href]',\n 'input',\n 'label',\n 'select',\n 'textarea',\n '[tabindex]',\n];\n\nconst userFocuable = ':not([tabindex=\"-1\"])';\n\nexport const userFocusableSelector =\n focusables.join(`${userFocuable}, `) + userFocuable;\n\nexport const focusableSelector = focusables.join(', ');\n"],
5
- "mappings": ";AAYA,MAAM,aAAa;AAAA,EACf;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACJ;AAEA,MAAM,eAAe;AAEd,aAAM,wBACT,WAAW,KAAK,GAAG,YAAY,IAAI,IAAI;AAEpC,aAAM,oBAAoB,WAAW,KAAK,IAAI;",
6
- "names": []
7
- }
@@ -1,2 +0,0 @@
1
- "use strict";const e=["button","[focusable]","[href]","input","label","select","textarea","[tabindex]"],o=':not([tabindex="-1"])';export const userFocusableSelector=e.join(`${o}, `)+o,focusableSelector=e.join(", ");
2
- //# sourceMappingURL=focusable-selectors.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["focusable-selectors.ts"],
4
- "sourcesContent": ["/*\nCopyright 2023 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\nconst focusables = [\n 'button',\n '[focusable]',\n '[href]',\n 'input',\n 'label',\n 'select',\n 'textarea',\n '[tabindex]',\n];\n\nconst userFocuable = ':not([tabindex=\"-1\"])';\n\nexport const userFocusableSelector =\n focusables.join(`${userFocuable}, `) + userFocuable;\n\nexport const focusableSelector = focusables.join(', ');\n"],
5
- "mappings": "aAYA,MAAMA,EAAa,CACf,SACA,cACA,SACA,QACA,QACA,SACA,WACA,YACJ,EAEMC,EAAe,wBAEd,aAAM,sBACTD,EAAW,KAAK,GAAGC,CAAY,IAAI,EAAIA,EAE9B,kBAAoBD,EAAW,KAAK,IAAI",
6
- "names": ["focusables", "userFocuable"]
7
- }