@spectrum-web-components/sidenav 0.13.0 → 0.13.1
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 +3 -3
- package/sp-sidenav-heading.dev.js +1 -0
- package/sp-sidenav-heading.dev.js.map +1 -1
- package/sp-sidenav-heading.js +1 -1
- package/sp-sidenav-heading.js.map +2 -2
- package/sp-sidenav-item.dev.js +1 -0
- package/sp-sidenav-item.dev.js.map +1 -1
- package/sp-sidenav-item.js +1 -1
- package/sp-sidenav-item.js.map +2 -2
- package/sp-sidenav.dev.js +1 -0
- package/sp-sidenav.dev.js.map +1 -1
- package/sp-sidenav.js +1 -1
- package/sp-sidenav.js.map +2 -2
- package/src/Sidenav.dev.js +11 -6
- package/src/Sidenav.dev.js.map +1 -1
- package/src/Sidenav.js +1 -1
- package/src/Sidenav.js.map +2 -2
- package/src/SidenavHeading.dev.js +1 -0
- package/src/SidenavHeading.dev.js.map +1 -1
- package/src/SidenavHeading.js +1 -1
- package/src/SidenavHeading.js.map +2 -2
- package/src/SidenavItem.dev.js +4 -1
- package/src/SidenavItem.dev.js.map +1 -1
- package/src/SidenavItem.js +1 -1
- package/src/SidenavItem.js.map +2 -2
- package/src/index.dev.js +1 -0
- package/src/index.dev.js.map +1 -1
- package/src/index.js +1 -1
- package/src/index.js.map +1 -1
- package/src/sidenav-heading.css.dev.js +1 -0
- package/src/sidenav-heading.css.dev.js.map +1 -1
- package/src/sidenav-heading.css.js +1 -1
- package/src/sidenav-heading.css.js.map +2 -2
- package/src/sidenav-item.css.dev.js +1 -0
- package/src/sidenav-item.css.dev.js.map +1 -1
- package/src/sidenav-item.css.js +1 -1
- package/src/sidenav-item.css.js.map +2 -2
- package/src/sidenav.css.dev.js +1 -0
- package/src/sidenav.css.dev.js.map +1 -1
- package/src/sidenav.css.js +1 -1
- package/src/sidenav.css.js.map +2 -2
- package/src/spectrum-sidenav-heading.css.dev.js +1 -0
- package/src/spectrum-sidenav-heading.css.dev.js.map +1 -1
- package/src/spectrum-sidenav-heading.css.js +1 -1
- package/src/spectrum-sidenav-heading.css.js.map +2 -2
- package/src/spectrum-sidenav-item.css.dev.js +1 -0
- package/src/spectrum-sidenav-item.css.dev.js.map +1 -1
- package/src/spectrum-sidenav-item.css.js +1 -1
- package/src/spectrum-sidenav-item.css.js.map +2 -2
- package/src/spectrum-sidenav.css.dev.js +1 -0
- package/src/spectrum-sidenav.css.dev.js.map +1 -1
- package/src/spectrum-sidenav.css.js +1 -1
- package/src/spectrum-sidenav.css.js.map +2 -2
- package/stories/sidenav.stories.js +41 -8
- package/stories/sidenav.stories.js.map +1 -1
- package/test/benchmark/test-basic.js +7 -1
- package/test/benchmark/test-basic.js.map +1 -1
- package/test/sidenav-item.test.js +68 -5
- package/test/sidenav-item.test.js.map +1 -1
- package/test/sidenav.test-vrt.js +4 -1
- package/test/sidenav.test-vrt.js.map +1 -1
- package/test/sidenav.test.js +319 -13
- package/test/sidenav.test.js.map +1 -1
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["spectrum-sidenav-heading.css.ts"],
|
|
4
4
|
"sourcesContent": ["/*\nCopyright 2022 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 { css } from '@spectrum-web-components/base';\nconst styles = css`\n#list{--spectrum-sidenav-item-padding-y:var(\n--spectrum-global-dimension-size-65\n);list-style-type:none;margin:0;padding:0}:host([dir=ltr]) #heading{margin-right:0}:host([dir=rtl]) #heading{margin-left:0}:host([dir=ltr]) #heading{margin-left:0}:host([dir=rtl]) #heading{margin-right:0}#heading{border-radius:var(\n--spectrum-sidenav-heading-border-radius,var(--spectrum-alias-border-radius-regular)\n);color:var(\n--spectrum-sidenav-heading-text-color,var(--spectrum-global-color-gray-700)\n);font-size:var(\n--spectrum-sidenav-heading-text-size,var(--spectrum-global-dimension-font-size-50)\n);font-style:normal;font-weight:var(\n--spectrum-sidenav-heading-text-font-weight,var(--spectrum-global-font-weight-medium)\n);height:var(\n--spectrum-sidenav-heading-height,var(--spectrum-alias-single-line-height)\n);letter-spacing:var(\n--spectrum-sidenav-heading-text-letter-spacing,var(--spectrum-global-font-letter-spacing-medium)\n);line-height:var(\n--spectrum-sidenav-heading-height,var(--spectrum-alias-single-line-height)\n);margin-bottom:var(\n--spectrum-sidenav-heading-gap-bottom,var(--spectrum-global-dimension-size-50)\n);margin-top:var(\n--spectrum-sidenav-heading-gap-top,var(--spectrum-global-dimension-size-200)\n);padding-bottom:0;padding-left:var(\n--spectrum-sidenav-heading-padding-x,var(--spectrum-global-dimension-size-150)\n);padding-right:var(\n--spectrum-sidenav-heading-padding-x,var(--spectrum-global-dimension-size-150)\n);padding-top:0;text-transform:uppercase}\n`;\nexport default styles;"],
|
|
5
|
-
"mappings": "AAWA;
|
|
5
|
+
"mappings": ";AAWA,SAAS,WAAW;AACpB,MAAM,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA2Bf,eAAe;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{css as e}from"@spectrum-web-components/base";const i=e`
|
|
1
|
+
"use strict";import{css as e}from"@spectrum-web-components/base";const i=e`
|
|
2
2
|
#list{--spectrum-sidenav-item-padding-y:var(
|
|
3
3
|
--spectrum-global-dimension-size-65
|
|
4
4
|
);list-style-type:none;margin:0;padding:0}:host([dir=ltr]) #heading{margin-right:0}:host([dir=rtl]) #heading{margin-left:0}:host([dir=ltr]) #heading{margin-left:0}:host([dir=rtl]) #heading{margin-right:0}#heading{border-radius:var(
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["spectrum-sidenav-heading.css.ts"],
|
|
4
4
|
"sourcesContent": ["/*\nCopyright 2022 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 { css } from '@spectrum-web-components/base';\nconst styles = css`\n#list{--spectrum-sidenav-item-padding-y:var(\n--spectrum-global-dimension-size-65\n);list-style-type:none;margin:0;padding:0}:host([dir=ltr]) #heading{margin-right:0}:host([dir=rtl]) #heading{margin-left:0}:host([dir=ltr]) #heading{margin-left:0}:host([dir=rtl]) #heading{margin-right:0}#heading{border-radius:var(\n--spectrum-sidenav-heading-border-radius,var(--spectrum-alias-border-radius-regular)\n);color:var(\n--spectrum-sidenav-heading-text-color,var(--spectrum-global-color-gray-700)\n);font-size:var(\n--spectrum-sidenav-heading-text-size,var(--spectrum-global-dimension-font-size-50)\n);font-style:normal;font-weight:var(\n--spectrum-sidenav-heading-text-font-weight,var(--spectrum-global-font-weight-medium)\n);height:var(\n--spectrum-sidenav-heading-height,var(--spectrum-alias-single-line-height)\n);letter-spacing:var(\n--spectrum-sidenav-heading-text-letter-spacing,var(--spectrum-global-font-letter-spacing-medium)\n);line-height:var(\n--spectrum-sidenav-heading-height,var(--spectrum-alias-single-line-height)\n);margin-bottom:var(\n--spectrum-sidenav-heading-gap-bottom,var(--spectrum-global-dimension-size-50)\n);margin-top:var(\n--spectrum-sidenav-heading-gap-top,var(--spectrum-global-dimension-size-200)\n);padding-bottom:0;padding-left:var(\n--spectrum-sidenav-heading-padding-x,var(--spectrum-global-dimension-size-150)\n);padding-right:var(\n--spectrum-sidenav-heading-padding-x,var(--spectrum-global-dimension-size-150)\n);padding-top:0;text-transform:uppercase}\n`;\nexport default styles;"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": []
|
|
5
|
+
"mappings": "aAWA,OAAS,OAAAA,MAAW,gCACpB,MAAMC,EAASD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EA2Bf,eAAeC",
|
|
6
|
+
"names": ["css", "styles"]
|
|
7
7
|
}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["spectrum-sidenav-item.css.ts"],
|
|
4
4
|
"sourcesContent": ["/*\nCopyright 2022 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 { css } from '@spectrum-web-components/base';\nconst styles = css`\n#list{--spectrum-sidenav-item-padding-y:var(\n--spectrum-global-dimension-size-65\n);list-style-type:none;margin:0;padding:0}:host{list-style-type:none;margin-bottom:var(\n--spectrum-sidenav-item-gap,var(--spectrum-global-dimension-size-50)\n);margin-left:0;margin-right:0;margin-top:var(\n--spectrum-sidenav-item-gap,var(--spectrum-global-dimension-size-50)\n)}#item-link{align-items:center;border-radius:var(\n--spectrum-sidenav-item-border-radius,var(--spectrum-alias-border-radius-regular)\n);box-sizing:border-box;cursor:pointer;display:inline-flex;font-size:var(\n--spectrum-sidenav-item-text-size,var(--spectrum-alias-font-size-default)\n);font-style:normal;font-weight:var(\n--spectrum-sidenav-item-text-font-weight,var(--spectrum-global-font-weight-regular)\n);-webkit-hyphens:auto;hyphens:auto;justify-content:left;min-height:var(\n--spectrum-sidenav-item-height,var(--spectrum-alias-single-line-height)\n);padding:var(--spectrum-sidenav-item-padding-y) var(\n--spectrum-sidenav-item-padding-x,var(--spectrum-global-dimension-size-150)\n);position:relative;text-decoration:none;transition:background-color var(--spectrum-global-animation-duration-100,.13s) ease-out,color var(--spectrum-global-animation-duration-100,.13s) ease-out;width:100%;word-break:break-word}#item-link:focus{outline:none}#item-link:before{border:var(\n--spectrum-alias-focus-ring-size,var(--spectrum-global-dimension-static-size-25)\n) solid transparent;border-radius:var(\n--spectrum-sidenav-item-border-radius,var(--spectrum-alias-border-radius-regular)\n);bottom:0;content:\"\";left:0;pointer-events:none;position:absolute;right:0;top:0;transition:border var(--spectrum-global-animation-duration-100,.13s) ease-out}:host([dir=ltr]) #item-link ::slotted([slot=icon]){margin-right:var(\n--spectrum-sidenav-icon-gap,var(--spectrum-global-dimension-size-100)\n)}:host([dir=rtl]) #item-link ::slotted([slot=icon]){margin-left:var(\n--spectrum-sidenav-icon-gap,var(--spectrum-global-dimension-size-100)\n)}#item-link ::slotted([slot=icon]){flex-shrink:0}:host([dir=ltr]) .spectrum-SideNav-heading{margin-right:0}:host([dir=rtl]) .spectrum-SideNav-heading{margin-left:0}:host([dir=ltr]) .spectrum-SideNav-heading{margin-left:0}:host([dir=rtl]) .spectrum-SideNav-heading{margin-right:0}:host([dir=ltr]) .spectrum-SideNav--multiLevel #list #item-link{padding-left:calc(var(\n--spectrum-sidenav-multilevel-item-margin-left,\nvar(--spectrum-global-dimension-size-150)\n) + var(\n--spectrum-sidenav-item-padding-x,\nvar(--spectrum-global-dimension-size-150)\n))}:host([dir=rtl]) .spectrum-SideNav--multiLevel #list #item-link{padding-right:calc(var(\n--spectrum-sidenav-multilevel-item-margin-left,\nvar(--spectrum-global-dimension-size-150)\n) + var(\n--spectrum-sidenav-item-padding-x,\nvar(--spectrum-global-dimension-size-150)\n))}:host([dir=ltr]) .spectrum-SideNav--multiLevel #list #list #item-link{padding-left:calc(var(\n--spectrum-sidenav-multilevel-item-margin-left,\nvar(--spectrum-global-dimension-size-150)\n) + var(\n--spectrum-sidenav-item-padding-x,\nvar(--spectrum-global-dimension-size-150)\n))}:host([dir=rtl]) .spectrum-SideNav--multiLevel #list #list #item-link{padding-right:calc(var(\n--spectrum-sidenav-multilevel-item-margin-left,\nvar(--spectrum-global-dimension-size-150)\n) + var(\n--spectrum-sidenav-item-padding-x,\nvar(--spectrum-global-dimension-size-150)\n))}:host([selected])>#item-link{background-color:var(\n--spectrum-sidenav-item-background-color-selected,var(--spectrum-alias-highlight-hover)\n);color:var(\n--spectrum-sidenav-item-text-color-selected,var(--spectrum-alias-text-color-hover)\n)}.is-active>#item-link{background-color:var(\n--spectrum-sidenav-item-background-color-down,var(--spectrum-alias-highlight-hover)\n)}:host([disabled]) #item-link{background-color:var(\n--spectrum-sidenav-item-background-color-disabled,var(--spectrum-alias-background-color-transparent)\n);color:var(\n--spectrum-sidenav-item-text-color-disabled,var(--spectrum-alias-text-color-disabled)\n);cursor:default;pointer-events:none}#item-link{background-color:var(\n--spectrum-sidenav-item-background-color,var(--spectrum-alias-background-color-transparent)\n);color:var(\n--spectrum-sidenav-item-text-color,var(--spectrum-alias-text-color)\n)}#item-link:hover{background-color:var(\n--spectrum-sidenav-item-background-color-hover,var(--spectrum-alias-highlight-hover)\n);color:var(\n--spectrum-sidenav-item-text-color-hover,var(--spectrum-alias-text-color-hover)\n)}#item-link:active{background-color:var(\n--spectrum-sidenav-item-background-color-down,var(--spectrum-alias-highlight-hover)\n)}#item-link.focus-visible{background-color:var(\n--spectrum-sidenav-item-background-color-key-focus,var(--spectrum-alias-highlight-hover)\n);color:var(\n--spectrum-sidenav-item-text-color-key-focus,var(--spectrum-alias-text-color-hover)\n)}#item-link:focus-visible{background-color:var(\n--spectrum-sidenav-item-background-color-key-focus,var(--spectrum-alias-highlight-hover)\n);color:var(\n--spectrum-sidenav-item-text-color-key-focus,var(--spectrum-alias-text-color-hover)\n)}#item-link.focus-visible:before{border-color:var(\n--spectrum-sidenav-item-border-color-key-focus,var(--spectrum-alias-border-color-key-focus)\n)}#item-link:focus-visible:before{border-color:var(\n--spectrum-sidenav-item-border-color-key-focus,var(--spectrum-alias-border-color-key-focus)\n)}@media (forced-colors:active){:host{--spectrum-sidenav-item-text-color-selected:HighlightText;--spectrum-sidenav-item-background-color-selected:Highlight;--spectrum-sidenav-item-background-color-disabled:ButtonFace;--spectrum-sidenav-item-text-color-disabled:GrayText;--spectrum-sidenav-item-background-color:ButtonFace;--spectrum-sidenav-item-text-color:ButtonText;--spectrum-sidenav-item-background-color-hover:ButtonFace;--spectrum-sidenav-item-text-color-hover:ButtonText;--spectrum-sidenav-item-background-color-down:ButtonFace;--spectrum-sidenav-item-background-color-key-focus:ButtonFace;--spectrum-sidenav-item-text-color-key-focus:ButtonText;--spectrum-sidenav-item-border-color-key-focus:ButtonText;forced-color-adjust:none}}\n`;\nexport default styles;"],
|
|
5
|
-
"mappings": "AAWA;
|
|
5
|
+
"mappings": ";AAWA,SAAS,WAAW;AACpB,MAAM,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAmFf,eAAe;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{css as e}from"@spectrum-web-components/base";const r=e`
|
|
1
|
+
"use strict";import{css as e}from"@spectrum-web-components/base";const r=e`
|
|
2
2
|
#list{--spectrum-sidenav-item-padding-y:var(
|
|
3
3
|
--spectrum-global-dimension-size-65
|
|
4
4
|
);list-style-type:none;margin:0;padding:0}:host{list-style-type:none;margin-bottom:var(
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["spectrum-sidenav-item.css.ts"],
|
|
4
4
|
"sourcesContent": ["/*\nCopyright 2022 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 { css } from '@spectrum-web-components/base';\nconst styles = css`\n#list{--spectrum-sidenav-item-padding-y:var(\n--spectrum-global-dimension-size-65\n);list-style-type:none;margin:0;padding:0}:host{list-style-type:none;margin-bottom:var(\n--spectrum-sidenav-item-gap,var(--spectrum-global-dimension-size-50)\n);margin-left:0;margin-right:0;margin-top:var(\n--spectrum-sidenav-item-gap,var(--spectrum-global-dimension-size-50)\n)}#item-link{align-items:center;border-radius:var(\n--spectrum-sidenav-item-border-radius,var(--spectrum-alias-border-radius-regular)\n);box-sizing:border-box;cursor:pointer;display:inline-flex;font-size:var(\n--spectrum-sidenav-item-text-size,var(--spectrum-alias-font-size-default)\n);font-style:normal;font-weight:var(\n--spectrum-sidenav-item-text-font-weight,var(--spectrum-global-font-weight-regular)\n);-webkit-hyphens:auto;hyphens:auto;justify-content:left;min-height:var(\n--spectrum-sidenav-item-height,var(--spectrum-alias-single-line-height)\n);padding:var(--spectrum-sidenav-item-padding-y) var(\n--spectrum-sidenav-item-padding-x,var(--spectrum-global-dimension-size-150)\n);position:relative;text-decoration:none;transition:background-color var(--spectrum-global-animation-duration-100,.13s) ease-out,color var(--spectrum-global-animation-duration-100,.13s) ease-out;width:100%;word-break:break-word}#item-link:focus{outline:none}#item-link:before{border:var(\n--spectrum-alias-focus-ring-size,var(--spectrum-global-dimension-static-size-25)\n) solid transparent;border-radius:var(\n--spectrum-sidenav-item-border-radius,var(--spectrum-alias-border-radius-regular)\n);bottom:0;content:\"\";left:0;pointer-events:none;position:absolute;right:0;top:0;transition:border var(--spectrum-global-animation-duration-100,.13s) ease-out}:host([dir=ltr]) #item-link ::slotted([slot=icon]){margin-right:var(\n--spectrum-sidenav-icon-gap,var(--spectrum-global-dimension-size-100)\n)}:host([dir=rtl]) #item-link ::slotted([slot=icon]){margin-left:var(\n--spectrum-sidenav-icon-gap,var(--spectrum-global-dimension-size-100)\n)}#item-link ::slotted([slot=icon]){flex-shrink:0}:host([dir=ltr]) .spectrum-SideNav-heading{margin-right:0}:host([dir=rtl]) .spectrum-SideNav-heading{margin-left:0}:host([dir=ltr]) .spectrum-SideNav-heading{margin-left:0}:host([dir=rtl]) .spectrum-SideNav-heading{margin-right:0}:host([dir=ltr]) .spectrum-SideNav--multiLevel #list #item-link{padding-left:calc(var(\n--spectrum-sidenav-multilevel-item-margin-left,\nvar(--spectrum-global-dimension-size-150)\n) + var(\n--spectrum-sidenav-item-padding-x,\nvar(--spectrum-global-dimension-size-150)\n))}:host([dir=rtl]) .spectrum-SideNav--multiLevel #list #item-link{padding-right:calc(var(\n--spectrum-sidenav-multilevel-item-margin-left,\nvar(--spectrum-global-dimension-size-150)\n) + var(\n--spectrum-sidenav-item-padding-x,\nvar(--spectrum-global-dimension-size-150)\n))}:host([dir=ltr]) .spectrum-SideNav--multiLevel #list #list #item-link{padding-left:calc(var(\n--spectrum-sidenav-multilevel-item-margin-left,\nvar(--spectrum-global-dimension-size-150)\n) + var(\n--spectrum-sidenav-item-padding-x,\nvar(--spectrum-global-dimension-size-150)\n))}:host([dir=rtl]) .spectrum-SideNav--multiLevel #list #list #item-link{padding-right:calc(var(\n--spectrum-sidenav-multilevel-item-margin-left,\nvar(--spectrum-global-dimension-size-150)\n) + var(\n--spectrum-sidenav-item-padding-x,\nvar(--spectrum-global-dimension-size-150)\n))}:host([selected])>#item-link{background-color:var(\n--spectrum-sidenav-item-background-color-selected,var(--spectrum-alias-highlight-hover)\n);color:var(\n--spectrum-sidenav-item-text-color-selected,var(--spectrum-alias-text-color-hover)\n)}.is-active>#item-link{background-color:var(\n--spectrum-sidenav-item-background-color-down,var(--spectrum-alias-highlight-hover)\n)}:host([disabled]) #item-link{background-color:var(\n--spectrum-sidenav-item-background-color-disabled,var(--spectrum-alias-background-color-transparent)\n);color:var(\n--spectrum-sidenav-item-text-color-disabled,var(--spectrum-alias-text-color-disabled)\n);cursor:default;pointer-events:none}#item-link{background-color:var(\n--spectrum-sidenav-item-background-color,var(--spectrum-alias-background-color-transparent)\n);color:var(\n--spectrum-sidenav-item-text-color,var(--spectrum-alias-text-color)\n)}#item-link:hover{background-color:var(\n--spectrum-sidenav-item-background-color-hover,var(--spectrum-alias-highlight-hover)\n);color:var(\n--spectrum-sidenav-item-text-color-hover,var(--spectrum-alias-text-color-hover)\n)}#item-link:active{background-color:var(\n--spectrum-sidenav-item-background-color-down,var(--spectrum-alias-highlight-hover)\n)}#item-link.focus-visible{background-color:var(\n--spectrum-sidenav-item-background-color-key-focus,var(--spectrum-alias-highlight-hover)\n);color:var(\n--spectrum-sidenav-item-text-color-key-focus,var(--spectrum-alias-text-color-hover)\n)}#item-link:focus-visible{background-color:var(\n--spectrum-sidenav-item-background-color-key-focus,var(--spectrum-alias-highlight-hover)\n);color:var(\n--spectrum-sidenav-item-text-color-key-focus,var(--spectrum-alias-text-color-hover)\n)}#item-link.focus-visible:before{border-color:var(\n--spectrum-sidenav-item-border-color-key-focus,var(--spectrum-alias-border-color-key-focus)\n)}#item-link:focus-visible:before{border-color:var(\n--spectrum-sidenav-item-border-color-key-focus,var(--spectrum-alias-border-color-key-focus)\n)}@media (forced-colors:active){:host{--spectrum-sidenav-item-text-color-selected:HighlightText;--spectrum-sidenav-item-background-color-selected:Highlight;--spectrum-sidenav-item-background-color-disabled:ButtonFace;--spectrum-sidenav-item-text-color-disabled:GrayText;--spectrum-sidenav-item-background-color:ButtonFace;--spectrum-sidenav-item-text-color:ButtonText;--spectrum-sidenav-item-background-color-hover:ButtonFace;--spectrum-sidenav-item-text-color-hover:ButtonText;--spectrum-sidenav-item-background-color-down:ButtonFace;--spectrum-sidenav-item-background-color-key-focus:ButtonFace;--spectrum-sidenav-item-text-color-key-focus:ButtonText;--spectrum-sidenav-item-border-color-key-focus:ButtonText;forced-color-adjust:none}}\n`;\nexport default styles;"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": []
|
|
5
|
+
"mappings": "aAWA,OAAS,OAAAA,MAAW,gCACpB,MAAMC,EAASD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAmFf,eAAeC",
|
|
6
|
+
"names": ["css", "styles"]
|
|
7
7
|
}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["spectrum-sidenav.css.ts"],
|
|
4
4
|
"sourcesContent": ["/*\nCopyright 2022 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 { css } from '@spectrum-web-components/base';\nconst styles = css`\n:host{--spectrum-sidenav-item-padding-y:var(\n--spectrum-global-dimension-size-65\n)}:host{list-style-type:none;margin:0;padding:0}\n`;\nexport default styles;"],
|
|
5
|
-
"mappings": "AAWA;
|
|
5
|
+
"mappings": ";AAWA,SAAS,WAAW;AACpB,MAAM,SAAS;AAAA;AAAA;AAAA;AAAA;AAKf,eAAe;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{css as s}from"@spectrum-web-components/base";const t=s`
|
|
1
|
+
"use strict";import{css as s}from"@spectrum-web-components/base";const t=s`
|
|
2
2
|
:host{--spectrum-sidenav-item-padding-y:var(
|
|
3
3
|
--spectrum-global-dimension-size-65
|
|
4
4
|
)}:host{list-style-type:none;margin:0;padding:0}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["spectrum-sidenav.css.ts"],
|
|
4
4
|
"sourcesContent": ["/*\nCopyright 2022 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 { css } from '@spectrum-web-components/base';\nconst styles = css`\n:host{--spectrum-sidenav-item-padding-y:var(\n--spectrum-global-dimension-size-65\n)}:host{list-style-type:none;margin:0;padding:0}\n`;\nexport default styles;"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": []
|
|
5
|
+
"mappings": "aAWA,OAAS,OAAAA,MAAW,gCACpB,MAAMC,EAASD;AAAA;AAAA;AAAA;AAAA,EAKf,eAAeC",
|
|
6
|
+
"names": ["css", "styles"]
|
|
7
7
|
}
|
|
@@ -1,5 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
import { html } from "@spectrum-web-components/base";
|
|
3
|
+
import "@spectrum-web-components/sidenav/sp-sidenav.js";
|
|
4
|
+
import "@spectrum-web-components/sidenav/sp-sidenav-item.js";
|
|
5
|
+
import "@spectrum-web-components/sidenav/sp-sidenav-heading.js";
|
|
6
|
+
export default {
|
|
7
|
+
component: "sp-sidenav",
|
|
8
|
+
title: "Sidenav",
|
|
9
|
+
argTypes: {
|
|
10
|
+
onChange: { action: "change" }
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
export const Default = ({
|
|
14
|
+
onChange
|
|
15
|
+
}) => {
|
|
16
|
+
return html`
|
|
17
|
+
<sp-sidenav @change=${onChange} value="Section 2">
|
|
3
18
|
<sp-sidenav-item
|
|
4
19
|
value="Section 1"
|
|
5
20
|
label="Section 1"
|
|
@@ -20,8 +35,13 @@ import{html as i}from"@spectrum-web-components/base";import"@spectrum-web-compon
|
|
|
20
35
|
></sp-sidenav-item>
|
|
21
36
|
</sp-sidenav-heading>
|
|
22
37
|
</sp-sidenav>
|
|
23
|
-
|
|
24
|
-
|
|
38
|
+
`;
|
|
39
|
+
};
|
|
40
|
+
export const Multilevel = ({
|
|
41
|
+
onChange
|
|
42
|
+
}) => {
|
|
43
|
+
return html`
|
|
44
|
+
<sp-sidenav variant="multilevel" value="2.3.1" @change=${onChange}>
|
|
25
45
|
<sp-sidenav-item value="foo" label="foo"></sp-sidenav-item>
|
|
26
46
|
<sp-sidenav-item value="baz" label="baz" expanded>
|
|
27
47
|
<sp-sidenav-item value="2.1" label="2.1"></sp-sidenav-item>
|
|
@@ -41,7 +61,11 @@ import{html as i}from"@spectrum-web-components/base";import"@spectrum-web-compon
|
|
|
41
61
|
<sp-sidenav-item value="test" label="test"></sp-sidenav-item>
|
|
42
62
|
<sp-sidenav-item value="hi" label="hi"></sp-sidenav-item>
|
|
43
63
|
</sp-sidenav>
|
|
44
|
-
`;
|
|
64
|
+
`;
|
|
65
|
+
};
|
|
66
|
+
Multilevel.storyName = "Multi-level";
|
|
67
|
+
export const levelsAndDisabled = () => {
|
|
68
|
+
return html`
|
|
45
69
|
<sp-sidenav>
|
|
46
70
|
<sp-sidenav-heading label="CATEGORY 1">
|
|
47
71
|
<sp-sidenav-item value="Section 1">Section 1</sp-sidenav-item>
|
|
@@ -56,7 +80,10 @@ import{html as i}from"@spectrum-web-components/base";import"@spectrum-web-compon
|
|
|
56
80
|
</sp-sidenav-item>
|
|
57
81
|
</sp-sidenav-heading>
|
|
58
82
|
</sp-sidenav>
|
|
59
|
-
|
|
83
|
+
`;
|
|
84
|
+
};
|
|
85
|
+
export const manageTabIndex = () => {
|
|
86
|
+
return html`
|
|
60
87
|
<sp-sidenav manage-tab-index>
|
|
61
88
|
<sp-sidenav-heading label="CATEGORY 1">
|
|
62
89
|
<sp-sidenav-item
|
|
@@ -81,8 +108,13 @@ import{html as i}from"@spectrum-web-components/base";import"@spectrum-web-compon
|
|
|
81
108
|
</sp-sidenav-item>
|
|
82
109
|
</sp-sidenav-heading>
|
|
83
110
|
</sp-sidenav>
|
|
84
|
-
|
|
85
|
-
|
|
111
|
+
`;
|
|
112
|
+
};
|
|
113
|
+
export const Hrefs = ({
|
|
114
|
+
onChange
|
|
115
|
+
}) => {
|
|
116
|
+
return html`
|
|
117
|
+
<sp-sidenav @change=${onChange} value="current">
|
|
86
118
|
<sp-sidenav-heading label="GITHUB">
|
|
87
119
|
<sp-sidenav-item
|
|
88
120
|
href=${window.location.href}
|
|
@@ -105,4 +137,5 @@ import{html as i}from"@spectrum-web-components/base";import"@spectrum-web-compon
|
|
|
105
137
|
</sp-sidenav-heading>
|
|
106
138
|
</sp-sidenav>
|
|
107
139
|
`;
|
|
140
|
+
};
|
|
108
141
|
//# sourceMappingURL=sidenav.stories.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["sidenav.stories.ts"],
|
|
4
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 { html, TemplateResult } from '@spectrum-web-components/base';\n\nimport '@spectrum-web-components/sidenav/sp-sidenav.js';\nimport '@spectrum-web-components/sidenav/sp-sidenav-item.js';\nimport '@spectrum-web-components/sidenav/sp-sidenav-heading.js';\n\nexport default {\n component: 'sp-sidenav',\n title: 'Sidenav',\n argTypes: {\n onChange: { action: 'change' },\n },\n};\n\nexport const Default = ({\n onChange,\n}: {\n onChange: () => void;\n}): TemplateResult => {\n return html`\n <sp-sidenav @change=${onChange} value=\"Section 2\">\n <sp-sidenav-item\n value=\"Section 1\"\n label=\"Section 1\"\n ></sp-sidenav-item>\n <sp-sidenav-item\n selected\n value=\"Section 2\"\n label=\"Section 2\"\n ></sp-sidenav-item>\n <sp-sidenav-heading label=\"CATEGORY 1\">\n <sp-sidenav-item\n value=\"Section 3\"\n label=\"Section 3\"\n ></sp-sidenav-item>\n <sp-sidenav-item\n value=\"Section 4\"\n label=\"Section 4\"\n ></sp-sidenav-item>\n </sp-sidenav-heading>\n </sp-sidenav>\n `;\n};\n\nexport const Multilevel = ({\n onChange,\n}: {\n onChange: () => void;\n}): TemplateResult => {\n return html`\n <sp-sidenav variant=\"multilevel\" value=\"2.3.1\" @change=${onChange}>\n <sp-sidenav-item value=\"foo\" label=\"foo\"></sp-sidenav-item>\n <sp-sidenav-item value=\"baz\" label=\"baz\" expanded>\n <sp-sidenav-item value=\"2.1\" label=\"2.1\"></sp-sidenav-item>\n <sp-sidenav-item value=\"2.2\" label=\"2.2\"></sp-sidenav-item>\n <sp-sidenav-item value=\"2.3\" label=\"2.3\" expanded>\n <sp-sidenav-item\n value=\"2.3.1\"\n label=\"2.3.1\"\n ></sp-sidenav-item>\n <sp-sidenav-item\n disabled\n value=\"2.3.2\"\n label=\"2.3.2\"\n ></sp-sidenav-item>\n </sp-sidenav-item>\n </sp-sidenav-item>\n <sp-sidenav-item value=\"test\" label=\"test\"></sp-sidenav-item>\n <sp-sidenav-item value=\"hi\" label=\"hi\"></sp-sidenav-item>\n </sp-sidenav>\n `;\n};\n\nMultilevel.storyName = 'Multi-level';\n\nexport const levelsAndDisabled = (): TemplateResult => {\n return html`\n <sp-sidenav>\n <sp-sidenav-heading label=\"CATEGORY 1\">\n <sp-sidenav-item value=\"Section 1\">Section 1</sp-sidenav-item>\n <sp-sidenav-item value=\"Section 2\" disabled>\n Section 2\n </sp-sidenav-item>\n <sp-sidenav-item value=\"Section 3\" expanded>\n Section 3\n <sp-sidenav-item value=\"Section 3a\">\n Section 3a\n </sp-sidenav-item>\n </sp-sidenav-item>\n </sp-sidenav-heading>\n </sp-sidenav>\n `;\n};\n\nexport const manageTabIndex = (): TemplateResult => {\n return html`\n <sp-sidenav manage-tab-index>\n <sp-sidenav-heading label=\"CATEGORY 1\">\n <sp-sidenav-item\n value=\"Section 0\"\n label=\"Section 0\"\n ></sp-sidenav-item>\n <sp-sidenav-item\n value=\"Section 1\"\n label=\"Section 1\"\n selected\n ></sp-sidenav-item>\n <sp-sidenav-item\n value=\"Section 2\"\n label=\"Section 2\"\n disabled\n ></sp-sidenav-item>\n <sp-sidenav-item value=\"Section 3\" label=\"Section 3\">\n <sp-sidenav-item\n value=\"Section 3a\"\n label=\"Section 3a\"\n ></sp-sidenav-item>\n </sp-sidenav-item>\n </sp-sidenav-heading>\n </sp-sidenav>\n `;\n};\n\nexport const Hrefs = ({\n onChange,\n}: {\n onChange: () => void;\n}): TemplateResult => {\n return html`\n <sp-sidenav @change=${onChange} value=\"current\">\n <sp-sidenav-heading label=\"GITHUB\">\n <sp-sidenav-item\n href=${window.location.href}\n label=\"Current\"\n value=\"current\"\n selected\n ></sp-sidenav-item>\n <sp-sidenav-item\n href=\"https://github.com/adobe/spectrum-web-components\"\n label=\"Code\"\n ></sp-sidenav-item>\n <sp-sidenav-item\n href=\"https://github.com/adobe/spectrum-web-components/issues\"\n label=\"Issues\"\n ></sp-sidenav-item>\n <sp-sidenav-item\n href=\"https://github.com/adobe/spectrum-web-components/pulls\"\n label=\"Pull Requests\"\n ></sp-sidenav-item>\n </sp-sidenav-heading>\n </sp-sidenav>\n `;\n};\n"],
|
|
5
|
-
"mappings": "AAWA,
|
|
5
|
+
"mappings": ";AAWA,SAAS,YAA4B;AAErC,OAAO;AACP,OAAO;AACP,OAAO;AAEP,eAAe;AAAA,EACX,WAAW;AAAA,EACX,OAAO;AAAA,EACP,UAAU;AAAA,IACN,UAAU,EAAE,QAAQ,SAAS;AAAA,EACjC;AACJ;AAEO,aAAM,UAAU,CAAC;AAAA,EACpB;AACJ,MAEsB;AAClB,SAAO;AAAA,8BACmB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAsB9B;AAEO,aAAM,aAAa,CAAC;AAAA,EACvB;AACJ,MAEsB;AAClB,SAAO;AAAA,iEACsD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAqBjE;AAEA,WAAW,YAAY;AAEhB,aAAM,oBAAoB,MAAsB;AACnD,SAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAgBX;AAEO,aAAM,iBAAiB,MAAsB;AAChD,SAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA0BX;AAEO,aAAM,QAAQ,CAAC;AAAA,EAClB;AACJ,MAEsB;AAClB,SAAO;AAAA,8BACmB;AAAA;AAAA;AAAA,2BAGH,OAAO,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAoB3C;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
import "@spectrum-web-components/sidenav/sp-sidenav.js";
|
|
3
|
+
import "@spectrum-web-components/sidenav/sp-sidenav-item.js";
|
|
4
|
+
import "@spectrum-web-components/sidenav/sp-sidenav-heading.js";
|
|
5
|
+
import { html } from "lit";
|
|
6
|
+
import { measureFixtureCreation } from "../../../../test/benchmark/helpers.js";
|
|
7
|
+
measureFixtureCreation(html`
|
|
2
8
|
<sp-sidenav manage-tab-index>
|
|
3
9
|
<sp-sidenav-item value="Section 1" label="Section 1"></sp-sidenav-item>
|
|
4
10
|
<sp-sidenav-item selected expanded value="Section 2" label="Section 2">
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["test-basic.ts"],
|
|
4
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 '@spectrum-web-components/sidenav/sp-sidenav.js';\nimport '@spectrum-web-components/sidenav/sp-sidenav-item.js';\nimport '@spectrum-web-components/sidenav/sp-sidenav-heading.js';\nimport { html } from 'lit';\nimport { measureFixtureCreation } from '../../../../test/benchmark/helpers.js';\n\nmeasureFixtureCreation(html`\n <sp-sidenav manage-tab-index>\n <sp-sidenav-item value=\"Section 1\" label=\"Section 1\"></sp-sidenav-item>\n <sp-sidenav-item selected expanded value=\"Section 2\" label=\"Section 2\">\n <sp-sidenav-item\n value=\"Section 2a\"\n label=\"Section 2a\"\n ></sp-sidenav-item>\n <sp-sidenav-item\n value=\"Section 2b\"\n label=\"Section 2b\"\n ></sp-sidenav-item>\n <sp-sidenav-item\n value=\"Section 2c\"\n label=\"Section 2c\"\n ></sp-sidenav-item>\n </sp-sidenav-item>\n <sp-sidenav-heading label=\"CATEGORY 1\">\n <sp-sidenav-item\n value=\"Section 3\"\n label=\"Section 3\"\n ></sp-sidenav-item>\n <sp-sidenav-item value=\"Section 4\" label=\"Section 4\">\n <sp-sidenav-item\n value=\"Section 4a\"\n label=\"Section 4a\"\n ></sp-sidenav-item>\n <sp-sidenav-item\n value=\"Section 4b\"\n label=\"Section 4b\"\n ></sp-sidenav-item>\n <sp-sidenav-item\n value=\"Section 4c\"\n label=\"Section 4c\"\n ></sp-sidenav-item>\n </sp-sidenav-item>\n </sp-sidenav-heading>\n <sp-sidenav-item value=\"Section 1\" label=\"Section 1\"></sp-sidenav-item>\n <sp-sidenav-item selected expanded value=\"Section 2\" label=\"Section 2\">\n <sp-sidenav-item\n value=\"Section 2a\"\n label=\"Section 2a\"\n ></sp-sidenav-item>\n <sp-sidenav-item\n value=\"Section 2b\"\n label=\"Section 2b\"\n ></sp-sidenav-item>\n <sp-sidenav-item\n value=\"Section 2c\"\n label=\"Section 2c\"\n ></sp-sidenav-item>\n </sp-sidenav-item>\n <sp-sidenav-heading label=\"CATEGORY 1\">\n <sp-sidenav-item\n value=\"Section 3\"\n label=\"Section 3\"\n ></sp-sidenav-item>\n <sp-sidenav-item value=\"Section 4\" label=\"Section 4\">\n <sp-sidenav-item\n value=\"Section 4a\"\n label=\"Section 4a\"\n ></sp-sidenav-item>\n <sp-sidenav-item\n value=\"Section 4b\"\n label=\"Section 4b\"\n ></sp-sidenav-item>\n <sp-sidenav-item\n value=\"Section 4c\"\n label=\"Section 4c\"\n ></sp-sidenav-item>\n </sp-sidenav-item>\n </sp-sidenav-heading>\n </sp-sidenav>\n`);\n"],
|
|
5
|
-
"mappings": "AAYA,
|
|
5
|
+
"mappings": ";AAYA,OAAO;AACP,OAAO;AACP,OAAO;AACP,SAAS,YAAY;AACrB,SAAS,8BAA8B;AAEvC,uBAAuB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,CAyEtB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,11 +1,36 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
import "@spectrum-web-components/sidenav/sp-sidenav.js";
|
|
3
|
+
import "@spectrum-web-components/sidenav/sp-sidenav-item.js";
|
|
4
|
+
import { elementUpdated, expect, fixture, html } from "@open-wc/testing";
|
|
5
|
+
describe("Sidenav Item", () => {
|
|
6
|
+
it("can exist disabled and with no parent", async () => {
|
|
7
|
+
let selected = false;
|
|
8
|
+
const onSidenavSelect = () => {
|
|
9
|
+
selected = true;
|
|
10
|
+
};
|
|
11
|
+
const el = await fixture(
|
|
12
|
+
html`
|
|
2
13
|
<sp-sidenav-item
|
|
3
14
|
disabled
|
|
4
15
|
value="Section 2"
|
|
5
16
|
label="Section 2"
|
|
6
|
-
@sidenav-select=${
|
|
17
|
+
@sidenav-select=${onSidenavSelect}
|
|
7
18
|
></sp-sidenav-item>
|
|
8
|
-
`
|
|
19
|
+
`
|
|
20
|
+
);
|
|
21
|
+
await elementUpdated(el);
|
|
22
|
+
expect(selected).to.be.false;
|
|
23
|
+
el.click();
|
|
24
|
+
await elementUpdated(el);
|
|
25
|
+
expect(selected).to.be.false;
|
|
26
|
+
el.disabled = false;
|
|
27
|
+
el.click();
|
|
28
|
+
await elementUpdated(el);
|
|
29
|
+
expect(selected).to.be.true;
|
|
30
|
+
});
|
|
31
|
+
it("clicking expands a sidenav item with children", async () => {
|
|
32
|
+
const el = await fixture(
|
|
33
|
+
html`
|
|
9
34
|
<sp-sidenav-item>
|
|
10
35
|
<sp-sidenav-item
|
|
11
36
|
value="Section 1"
|
|
@@ -16,7 +41,31 @@ import"@spectrum-web-components/sidenav/sp-sidenav.js";import"@spectrum-web-comp
|
|
|
16
41
|
label="Section 2"
|
|
17
42
|
></sp-sidenav-item>
|
|
18
43
|
</sp-sidenav-item>
|
|
19
|
-
`
|
|
44
|
+
`
|
|
45
|
+
);
|
|
46
|
+
await elementUpdated(el);
|
|
47
|
+
expect(el.shadowRoot).to.exist;
|
|
48
|
+
if (!el.shadowRoot)
|
|
49
|
+
return;
|
|
50
|
+
let slot = el.shadowRoot.querySelector(
|
|
51
|
+
'slot[name="descendant"]'
|
|
52
|
+
);
|
|
53
|
+
expect(slot).not.to.exist;
|
|
54
|
+
expect(el.expanded).to.be.false;
|
|
55
|
+
el.click();
|
|
56
|
+
await elementUpdated(el);
|
|
57
|
+
expect(el.expanded).to.be.true;
|
|
58
|
+
slot = el.shadowRoot.querySelector(
|
|
59
|
+
'slot[name="descendant"]'
|
|
60
|
+
);
|
|
61
|
+
expect(slot).to.exist;
|
|
62
|
+
if (!slot)
|
|
63
|
+
return;
|
|
64
|
+
expect(slot.assignedElements().length).to.equal(2);
|
|
65
|
+
});
|
|
66
|
+
it("populated `aria-current`", async () => {
|
|
67
|
+
const el = await fixture(
|
|
68
|
+
html`
|
|
20
69
|
<sp-sidenav value="Section 2">
|
|
21
70
|
<sp-sidenav-item
|
|
22
71
|
href="https://opensource.adobe.com/spectrum-web-components/"
|
|
@@ -30,5 +79,19 @@ import"@spectrum-web-components/sidenav/sp-sidenav.js";import"@spectrum-web-comp
|
|
|
30
79
|
selected
|
|
31
80
|
></sp-sidenav-item>
|
|
32
81
|
</sp-sidenav>
|
|
33
|
-
`
|
|
82
|
+
`
|
|
83
|
+
);
|
|
84
|
+
await elementUpdated(el);
|
|
85
|
+
const currentItem = el.querySelector(
|
|
86
|
+
"sp-sidenav-item:nth-child(2)"
|
|
87
|
+
);
|
|
88
|
+
const otherItem = el.querySelector(
|
|
89
|
+
"sp-sidenav-item:nth-child(1)"
|
|
90
|
+
);
|
|
91
|
+
await elementUpdated(currentItem);
|
|
92
|
+
await elementUpdated(otherItem);
|
|
93
|
+
expect(currentItem.focusElement.hasAttribute("aria-current"), "current").to.be.true;
|
|
94
|
+
expect(otherItem.focusElement.hasAttribute("aria-current"), "other").to.be.false;
|
|
95
|
+
});
|
|
96
|
+
});
|
|
34
97
|
//# sourceMappingURL=sidenav-item.test.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["sidenav-item.test.ts"],
|
|
4
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 '@spectrum-web-components/sidenav/sp-sidenav.js';\nimport '@spectrum-web-components/sidenav/sp-sidenav-item.js';\nimport { SideNavItem } from '@spectrum-web-components/sidenav';\nimport { elementUpdated, expect, fixture, html } from '@open-wc/testing';\n\ndescribe('Sidenav Item', () => {\n it('can exist disabled and with no parent', async () => {\n let selected = false;\n const onSidenavSelect = (): void => {\n selected = true;\n };\n const el = await fixture<SideNavItem>(\n html`\n <sp-sidenav-item\n disabled\n value=\"Section 2\"\n label=\"Section 2\"\n @sidenav-select=${onSidenavSelect}\n ></sp-sidenav-item>\n `\n );\n\n await elementUpdated(el);\n\n expect(selected).to.be.false;\n\n el.click();\n\n await elementUpdated(el);\n\n expect(selected).to.be.false;\n\n el.disabled = false;\n\n el.click();\n\n await elementUpdated(el);\n\n expect(selected).to.be.true;\n });\n\n it('clicking expands a sidenav item with children', async () => {\n const el = await fixture<SideNavItem>(\n html`\n <sp-sidenav-item>\n <sp-sidenav-item\n value=\"Section 1\"\n label=\"Section 1\"\n ></sp-sidenav-item>\n <sp-sidenav-item\n value=\"Section 2\"\n label=\"Section 2\"\n ></sp-sidenav-item>\n </sp-sidenav-item>\n `\n );\n\n await elementUpdated(el);\n\n expect(el.shadowRoot).to.exist;\n if (!el.shadowRoot) return;\n\n let slot: HTMLSlotElement | null = el.shadowRoot.querySelector(\n 'slot[name=\"descendant\"]'\n );\n expect(slot).not.to.exist;\n\n expect(el.expanded).to.be.false;\n\n el.click();\n\n await elementUpdated(el);\n\n expect(el.expanded).to.be.true;\n\n slot = el.shadowRoot.querySelector(\n 'slot[name=\"descendant\"]'\n ) as HTMLSlotElement;\n expect(slot).to.exist;\n if (!slot) return;\n\n expect(slot.assignedElements().length).to.equal(2);\n });\n\n it('populated `aria-current`', async () => {\n const el = await fixture<SideNavItem>(\n html`\n <sp-sidenav value=\"Section 2\">\n <sp-sidenav-item\n href=\"https://opensource.adobe.com/spectrum-web-components/\"\n label=\"Section 1\"\n value=\"Section 1\"\n ></sp-sidenav-item>\n <sp-sidenav-item\n href=${window.location.href}\n label=\"Section 2\"\n value=\"Section 2\"\n selected\n ></sp-sidenav-item>\n </sp-sidenav>\n `\n );\n\n await elementUpdated(el);\n\n const currentItem = el.querySelector(\n 'sp-sidenav-item:nth-child(2)'\n ) as SideNavItem;\n const otherItem = el.querySelector(\n 'sp-sidenav-item:nth-child(1)'\n ) as SideNavItem;\n\n await elementUpdated(currentItem);\n await elementUpdated(otherItem);\n\n expect(currentItem.focusElement.hasAttribute('aria-current'), 'current')\n .to.be.true;\n expect(otherItem.focusElement.hasAttribute('aria-current'), 'other').to\n .be.false;\n });\n});\n"],
|
|
5
|
-
"mappings": "AAYA,
|
|
5
|
+
"mappings": ";AAYA,OAAO;AACP,OAAO;AAEP,SAAS,gBAAgB,QAAQ,SAAS,YAAY;AAEtD,SAAS,gBAAgB,MAAM;AAC3B,KAAG,yCAAyC,YAAY;AACpD,QAAI,WAAW;AACf,UAAM,kBAAkB,MAAY;AAChC,iBAAW;AAAA,IACf;AACA,UAAM,KAAK,MAAM;AAAA,MACb;AAAA;AAAA;AAAA;AAAA;AAAA,sCAK0B;AAAA;AAAA;AAAA,IAG9B;AAEA,UAAM,eAAe,EAAE;AAEvB,WAAO,QAAQ,EAAE,GAAG,GAAG;AAEvB,OAAG,MAAM;AAET,UAAM,eAAe,EAAE;AAEvB,WAAO,QAAQ,EAAE,GAAG,GAAG;AAEvB,OAAG,WAAW;AAEd,OAAG,MAAM;AAET,UAAM,eAAe,EAAE;AAEvB,WAAO,QAAQ,EAAE,GAAG,GAAG;AAAA,EAC3B,CAAC;AAED,KAAG,iDAAiD,YAAY;AAC5D,UAAM,KAAK,MAAM;AAAA,MACb;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAYJ;AAEA,UAAM,eAAe,EAAE;AAEvB,WAAO,GAAG,UAAU,EAAE,GAAG;AACzB,QAAI,CAAC,GAAG;AAAY;AAEpB,QAAI,OAA+B,GAAG,WAAW;AAAA,MAC7C;AAAA,IACJ;AACA,WAAO,IAAI,EAAE,IAAI,GAAG;AAEpB,WAAO,GAAG,QAAQ,EAAE,GAAG,GAAG;AAE1B,OAAG,MAAM;AAET,UAAM,eAAe,EAAE;AAEvB,WAAO,GAAG,QAAQ,EAAE,GAAG,GAAG;AAE1B,WAAO,GAAG,WAAW;AAAA,MACjB;AAAA,IACJ;AACA,WAAO,IAAI,EAAE,GAAG;AAChB,QAAI,CAAC;AAAM;AAEX,WAAO,KAAK,iBAAiB,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;AAAA,EACrD,CAAC;AAED,KAAG,4BAA4B,YAAY;AACvC,UAAM,KAAK,MAAM;AAAA,MACb;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,+BAQmB,OAAO,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOvC;AAEA,UAAM,eAAe,EAAE;AAEvB,UAAM,cAAc,GAAG;AAAA,MACnB;AAAA,IACJ;AACA,UAAM,YAAY,GAAG;AAAA,MACjB;AAAA,IACJ;AAEA,UAAM,eAAe,WAAW;AAChC,UAAM,eAAe,SAAS;AAE9B,WAAO,YAAY,aAAa,aAAa,cAAc,GAAG,SAAS,EAClE,GAAG,GAAG;AACX,WAAO,UAAU,aAAa,aAAa,cAAc,GAAG,OAAO,EAAE,GAChE,GAAG;AAAA,EACZ,CAAC;AACL,CAAC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/test/sidenav.test-vrt.js
CHANGED
|
@@ -1,2 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
import * as stories from "../stories/sidenav.stories.js";
|
|
3
|
+
import { regressVisuals } from "../../../test/visual/test.js";
|
|
4
|
+
regressVisuals("SidenavStories", stories);
|
|
2
5
|
//# sourceMappingURL=sidenav.test-vrt.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["sidenav.test-vrt.ts"],
|
|
4
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 * as stories from '../stories/sidenav.stories.js';\nimport { regressVisuals } from '../../../test/visual/test.js';\n\nregressVisuals('SidenavStories', stories);\n"],
|
|
5
|
-
"mappings": "AAYA,
|
|
5
|
+
"mappings": ";AAYA,YAAY,aAAa;AACzB,SAAS,sBAAsB;AAE/B,eAAe,kBAAkB,OAAO;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|