@spectrum-web-components/dialog 0.40.1 → 0.40.2

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/dialog",
3
- "version": "0.40.1",
3
+ "version": "0.40.2",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -73,15 +73,15 @@
73
73
  "lit-html"
74
74
  ],
75
75
  "dependencies": {
76
- "@spectrum-web-components/alert-dialog": "^0.40.1",
77
- "@spectrum-web-components/base": "^0.40.1",
78
- "@spectrum-web-components/button": "^0.40.1",
79
- "@spectrum-web-components/button-group": "^0.40.1",
80
- "@spectrum-web-components/divider": "^0.40.1",
81
- "@spectrum-web-components/icons-workflow": "^0.40.1",
82
- "@spectrum-web-components/modal": "^0.40.1",
83
- "@spectrum-web-components/shared": "^0.40.1",
84
- "@spectrum-web-components/underlay": "^0.40.1"
76
+ "@spectrum-web-components/alert-dialog": "^0.40.2",
77
+ "@spectrum-web-components/base": "^0.40.2",
78
+ "@spectrum-web-components/button": "^0.40.2",
79
+ "@spectrum-web-components/button-group": "^0.40.2",
80
+ "@spectrum-web-components/divider": "^0.40.2",
81
+ "@spectrum-web-components/icons-workflow": "^0.40.2",
82
+ "@spectrum-web-components/modal": "^0.40.2",
83
+ "@spectrum-web-components/shared": "^0.40.2",
84
+ "@spectrum-web-components/underlay": "^0.40.2"
85
85
  },
86
86
  "devDependencies": {
87
87
  "@spectrum-css/dialog": "^6.0.68"
@@ -92,5 +92,5 @@
92
92
  "./sp-*.js",
93
93
  "./**/*.dev.js"
94
94
  ],
95
- "gitHead": "a75c4f83094c505d64658dbc7de20b5f18a8fde1"
95
+ "gitHead": "e5fd35c7a98569150ca695ec0e0e7411c9c64c28"
96
96
  }
@@ -9,7 +9,8 @@ import "@spectrum-web-components/tooltip/sp-tooltip.js";
9
9
  import "@spectrum-web-components/overlay/overlay-trigger.js";
10
10
  import "@spectrum-web-components/dialog/sp-dialog-wrapper.js";
11
11
  import { landscape } from "./images.js";
12
- import { overlayTriggerDecorator } from "./index.js";
12
+ import { isOverlayOpen } from "../../overlay/stories/index.js";
13
+ import "../../overlay/stories/index.js";
13
14
  export default {
14
15
  title: "Dialog Wrapped",
15
16
  component: "sp-dialog-wrapper",
@@ -204,7 +205,7 @@ export const form = (args = {}, context = {}) => {
204
205
  </overlay-trigger>
205
206
  `;
206
207
  };
207
- form.decorators = [overlayTriggerDecorator];
208
+ form.decorators = [isOverlayOpen];
208
209
  export const longContent = (args = {}, context = {}) => {
209
210
  const open = context.viewMode === "docs" ? void 0 : "click";
210
211
  return html`
@@ -320,7 +321,7 @@ export const longContent = (args = {}, context = {}) => {
320
321
  </overlay-trigger>
321
322
  `;
322
323
  };
323
- longContent.decorators = [overlayTriggerDecorator];
324
+ longContent.decorators = [isOverlayOpen];
324
325
  export const wrapperDismissableUnderlayError = (args = {}, context = {}) => {
325
326
  const open = context.viewMode === "docs" ? false : true;
326
327
  return html`
@@ -483,7 +484,7 @@ export const tooltips = (args = {}, context = {}) => {
483
484
  </overlay-trigger>
484
485
  `;
485
486
  };
486
- tooltips.decorators = [overlayTriggerDecorator];
487
+ tooltips.decorators = [isOverlayOpen];
487
488
  export const lazyHero = ({ src }) => {
488
489
  const handleOpened = () => {
489
490
  document.querySelector("sp-dialog-wrapper").hero = src;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["dialog-wrapper.stories.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 { html, TemplateResult } from '@spectrum-web-components/base';\nimport { ifDefined } from '@spectrum-web-components/base/src/directives.js';\n\nimport '@spectrum-web-components/button/sp-button.js';\nimport '@spectrum-web-components/field-label/sp-field-label.js';\nimport '@spectrum-web-components/help-text/sp-help-text.js';\nimport '@spectrum-web-components/textfield/sp-textfield.js';\nimport '@spectrum-web-components/tooltip/sp-tooltip.js';\nimport '@spectrum-web-components/overlay/overlay-trigger.js';\n\nimport '@spectrum-web-components/dialog/sp-dialog-wrapper.js';\nimport { landscape } from './images.js';\nimport { overlayTriggerDecorator } from './index.js';\nimport type { DialogWrapper } from '@spectrum-web-components/dialog';\n\nexport default {\n title: 'Dialog Wrapped',\n component: 'sp-dialog-wrapper',\n argTypes: {\n onClose: { action: 'close' },\n onConfirm: { action: 'confirm' },\n onSecondary: { action: 'secondary' },\n onCancel: { action: 'cancel' },\n },\n};\n\ntype StoryArgs = {\n onClose?: (event: Event) => void;\n onConfirm?: (event: Event) => void;\n onSecondary?: (event: Event) => void;\n onCancel?: (event: Event) => void;\n};\n\nconst handleClose =\n ({ onClose }: StoryArgs) =>\n (event: Event) => {\n if (onClose) onClose(event);\n };\n\nconst handleConfirm =\n ({ onConfirm }: StoryArgs) =>\n (event: Event) => {\n if (onConfirm) onConfirm(event);\n };\n\nconst handleSecondary =\n ({ onSecondary }: StoryArgs) =>\n (event: Event) => {\n if (onSecondary) onSecondary(event);\n };\n\nconst handleCancel =\n ({ onCancel }: StoryArgs) =>\n (event: Event) => {\n if (onCancel) onCancel(event);\n };\n\nexport const wrapperLabeledHero = (\n args: StoryArgs = {},\n context: { viewMode?: string } = {}\n): TemplateResult => {\n const open = context.viewMode === 'docs' ? false : true;\n return html`\n <style>\n sp-story-decorator {\n inset: 0;\n position: absolute;\n overflow: hidden;\n }\n </style>\n <sp-dialog-wrapper\n ?open=${open}\n hero=${landscape}\n hero-label=\"Hero Image Alt Text\"\n dismissable\n headline=\"Wrapped Dialog w/ Hero Image\"\n @close=${handleClose(args)}\n size=\"s\"\n >\n Content of the dialog\n </sp-dialog-wrapper>\n <sp-button\n onClick=\"\n this.previousElementSibling.open = !this.previousElementSibling.open;\n if (this.previousElementSibling.open) {\n this.previousElementSibling.focus();\n }\n \"\n variant=\"primary\"\n >\n Toggle Dialog\n </sp-button>\n `;\n};\n\nexport const wrapperDismissable = (\n args: StoryArgs = {},\n context: { viewMode?: string } = {}\n): TemplateResult => {\n const open = context.viewMode === 'docs' ? false : true;\n return html`\n <sp-dialog-wrapper\n ?open=${open}\n .hero=${landscape}\n dismissable\n headline=\"Wrapped Dialog w/ Hero Image\"\n @close=${handleClose(args)}\n size=\"s\"\n tabindex=\"0\"\n >\n Content of the dialog\n </sp-dialog-wrapper>\n <sp-button\n onClick=\"\n this.previousElementSibling.open = !this.previousElementSibling.open;\n if (this.previousElementSibling.open) {\n this.previousElementSibling.focus();\n }\n \"\n variant=\"primary\"\n >\n Toggle Dialog\n </sp-button>\n `;\n};\n\nexport const wrapperDismissableUnderlay = (\n args: StoryArgs = {},\n context: { viewMode?: string } = {}\n): TemplateResult => {\n const open = context.viewMode === 'docs' ? false : true;\n return html`\n <sp-dialog-wrapper\n ?open=${open}\n hero=${landscape}\n dismissable\n headline=\"Wrapped Dialog w/ Hero Image\"\n underlay\n @close=${handleClose(args)}\n size=\"s\"\n >\n Content of the dialog\n </sp-dialog-wrapper>\n <sp-button\n onClick=\"\n this.previousElementSibling.open = !this.previousElementSibling.open;\n if (this.previousElementSibling.open) {\n this.previousElementSibling.focus();\n }\n \"\n variant=\"primary\"\n >\n Toggle Dialog\n </sp-button>\n `;\n};\n\nexport const form = (\n args: StoryArgs = {},\n context: { viewMode?: string } = {}\n): TemplateResult => {\n const open = context.viewMode === 'docs' ? undefined : 'click';\n return html`\n <overlay-trigger\n type=\"modal\"\n @close=${handleClose(args)}\n open=${ifDefined(open)}\n >\n <sp-button slot=\"trigger\" variant=\"primary\">\n Toggle Dialog\n </sp-button>\n <sp-dialog-wrapper\n id=\"form-fields\"\n slot=\"click-content\"\n headline=\"Add Delivery Address\"\n underlay\n size=\"m\"\n confirm-label=\"Verify Address\"\n secondary-label=\"Add\"\n cancel-label=\"Cancel\"\n @close=${handleClose(args)}\n @confirm=${({ target }: Event & { target: HTMLElement }) => {\n target.dispatchEvent(\n new Event('close', { bubbles: true, composed: true })\n );\n handleConfirm(args);\n }}\n @secondary=${({ target }: Event & { target: HTMLElement }) => {\n target.dispatchEvent(\n new Event('close', { bubbles: true, composed: true })\n );\n handleSecondary(args);\n }}\n @cancel=${({ target }: Event & { target: HTMLElement }) => {\n target.dispatchEvent(\n new Event('close', { bubbles: true, composed: true })\n );\n handleCancel(args);\n }}\n >\n <style>\n #form-fields div {\n display: grid;\n row-gap: var(--spectrum-global-dimension-size-150);\n grid-template-columns: auto auto;\n\n --spectrum-fieldlabel-m-side-padding-right: 0;\n }\n </style>\n <div>\n <sp-field-label side-aligned=\"end\" for=\"street\">\n Street:\n </sp-field-label>\n <sp-textfield id=\"street\" autofocus></sp-textfield>\n <sp-field-label side-aligned=\"end\" for=\"city\">\n City:\n </sp-field-label>\n <sp-textfield id=\"city\"></sp-textfield>\n <sp-field-label side-aligned=\"end\" for=\"state\">\n State:\n </sp-field-label>\n <sp-textfield id=\"state\"></sp-textfield>\n <sp-field-label side-aligned=\"end\" for=\"zip\">\n Zip:\n </sp-field-label>\n <sp-textfield id=\"zip\"></sp-textfield>\n <sp-field-label side-aligned=\"end\" for=\"instructions\">\n Special instructions:\n </sp-field-label>\n <sp-textfield id=\"instructions\" multiline>\n <sp-help-text slot=\"help-text\">\n For example, gate code or other information to help\n the driver find you\n </sp-help-text>\n </sp-textfield>\n </div>\n </sp-dialog-wrapper>\n </overlay-trigger>\n `;\n};\n\nform.decorators = [overlayTriggerDecorator];\n\nexport const longContent = (\n args: StoryArgs = {},\n context: { viewMode?: string } = {}\n): TemplateResult => {\n const open = context.viewMode === 'docs' ? undefined : 'click';\n return html`\n <overlay-trigger\n type=\"modal\"\n @close=${handleClose(args)}\n open=${ifDefined(open)}\n >\n <sp-button slot=\"trigger\" variant=\"primary\">\n Toggle Dialog\n </sp-button>\n <sp-dialog-wrapper\n slot=\"click-content\"\n headline=\"Dialog title\"\n dismissable\n underlay\n size=\"s\"\n >\n <p>\n Lorem ipsum dolor sit amet, consectetuer adipiscing elit.\n Sed ac dolor sit amet purus malesuada congue. Donec quis\n nibh at felis congue commodo. Ut enim ad minima veniam, quis\n nostrum exercitationem ullam corporis suscipit laboriosam,\n nisi ut aliquid ex ea commodi consequatur? Sed ac dolor sit\n amet purus malesuada congue. Nam libero tempore, cum soluta\n nobis est eligendi optio cumque nihil impedit quo minus id\n quod maxime placeat facere possimus, omnis voluptas\n assumenda est, omnis dolor repellendus. Nullam sit amet\n magna in magna gravida vehicula. Itaque earum rerum hic\n tenetur a sapiente delectus, ut aut reiciendis voluptatibus\n maiores alias consequatur aut perferendis doloribus\n asperiores repellat. Neque porro quisquam est, qui dolorem\n ipsum quia dolor sit amet, consectetur, adipisci velit, sed\n quia non numquam eius modi tempora incidunt ut labore et\n dolore magnam aliquam quaerat voluptatem. Phasellus faucibus\n molestie nisl. Vestibulum fermentum tortor id mi. Integer\n rutrum, orci vestibulum ullamcorper ultricies, lacus quam\n ultricies odio, vitae placerat pede sem sit amet enim.\n Maecenas sollicitudin. Nullam rhoncus aliquam metus.\n </p>\n <p>\n Curabitur ligula sapien, pulvinar a vestibulum quis,\n facilisis vel sapien. Fusce nibh. Proin pede metus,\n vulputate nec, fermentum fringilla, vehicula vitae, justo.\n Aenean placerat. Aliquam erat volutpat. Et harum quidem\n rerum facilis est et expedita distinctio. Fusce nibh.\n Temporibus autem quibusdam et aut officiis debitis aut rerum\n necessitatibus saepe eveniet ut et voluptates repudiandae\n sint et molestiae non recusandae. Vestibulum erat nulla,\n ullamcorper nec, rutrum non, nonummy ac, erat. Etiam posuere\n lacus quis dolor. Mauris elementum mauris vitae tortor.\n Nulla turpis magna, cursus sit amet, suscipit a, interdum\n id, felis. Nam libero tempore, cum soluta nobis est eligendi\n optio cumque nihil impedit quo minus id quod maxime placeat\n facere possimus, omnis voluptas assumenda est, omnis dolor\n repellendus. Nulla accumsan, elit sit amet varius semper,\n nulla mauris mollis quam, tempor suscipit diam nulla vel\n leo. Pellentesque sapien.\n </p>\n <p>\n Curabitur vitae diam non enim vestibulum interdum. Sed elit\n dui, pellentesque a, faucibus vel, interdum nec, diam.\n Praesent vitae arcu tempor neque lacinia pretium. Ut tempus\n purus at lorem. Phasellus rhoncus. Temporibus autem\n quibusdam et aut officiis debitis aut rerum necessitatibus\n saepe eveniet ut et voluptates repudiandae sint et molestiae\n non recusandae. Duis ante orci, molestie vitae vehicula\n venenatis, tincidunt ac pede. Integer vulputate sem a nibh\n rutrum consequat. Aenean placerat. Cum sociis natoque\n penatibus et magnis dis parturient montes, nascetur\n ridiculus mus. Sed vel lectus. Donec odio tempus molestie,\n porttitor ut, iaculis quis, sem. Class aptent taciti\n sociosqu ad litora torquent per conubia nostra, per inceptos\n hymenaeos. Integer in sapien. Nullam dapibus fermentum\n ipsum.\n </p>\n <p>\n Integer vulputate sem a nibh rutrum consequat. Class aptent\n taciti sociosqu ad litora torquent per conubia nostra, per\n inceptos hymenaeos. Duis bibendum, lectus ut viverra\n rhoncus, dolor nunc faucibus libero, eget facilisis enim\n ipsum id lacus. Aliquam erat volutpat. Aenean id metus id\n velit ullamcorper pulvinar. Morbi scelerisque luctus velit.\n Aliquam erat volutpat. Temporibus autem quibusdam et aut\n officiis debitis aut rerum necessitatibus saepe eveniet ut\n et voluptates repudiandae sint et molestiae non recusandae.\n Fusce dui leo, imperdiet in, aliquam sit amet, feugiat eu,\n orci. Suspendisse sagittis ultrices augue. Nullam justo\n enim, consectetuer nec, ullamcorper ac, vestibulum in, elit.\n Praesent vitae arcu tempor neque lacinia pretium. Nullam\n faucibus mi quis velit. Maecenas aliquet accumsan leo. Morbi\n scelerisque luctus velit. Aliquam ornare wisi eu metus.\n </p>\n <p>\n Sed elit dui, pellentesque a, faucibus vel, interdum nec,\n diam. Praesent vitae arcu tempor neque lacinia pretium.\n Etiam dictum tincidunt diam. Et harum quidem rerum facilis\n est et expedita distinctio. Duis ante orci, molestie vitae\n vehicula venenatis, tincidunt ac pede. Integer lacinia.\n Excepteur sint occaecat cupidatat non proident, sunt in\n culpa qui officia deserunt mollit anim id est laborum.\n Mauris tincidunt sem sed arcu. Praesent in mauris eu tortor\n porttitor accumsan. Aenean id metus id velit ullamcorper\n pulvinar. Donec iaculis gravida nulla. Duis bibendum, lectus\n ut viverra rhoncus, dolor nunc faucibus libero, eget\n facilisis enim ipsum id lacus. Nulla quis diam. Quisque\n porta. Integer rutrum, orci vestibulum ullamcorper\n ultricies, lacus quam ultricies odio, vitae placerat pede\n sem sit amet enim. Nam sed tellus id magna elementum\n tincidunt. In enim a arcu imperdiet malesuada.\n </p>\n </sp-dialog-wrapper>\n </overlay-trigger>\n `;\n};\n\nlongContent.decorators = [overlayTriggerDecorator];\n\nexport const wrapperDismissableUnderlayError = (\n args: StoryArgs = {},\n context: { viewMode?: string } = {}\n): TemplateResult => {\n const open = context.viewMode === 'docs' ? false : true;\n return html`\n <div>\n <sp-dialog-wrapper\n ?open=${open}\n hero=${landscape}\n dismissable\n error\n headline=\"Wrapped Dialog w/ Hero Image\"\n underlay\n @close=${handleClose(args)}\n size=\"s\"\n >\n Content of the dialog\n </sp-dialog-wrapper>\n <sp-button\n onClick=\"\n this.previousElementSibling.open = !this.previousElementSibling.open;\n if (this.previousElementSibling.open) {\n this.previousElementSibling.focus();\n }\n \"\n variant=\"primary\"\n >\n Toggle Dialog\n </sp-button>\n </div>\n `;\n};\n\nexport const wrapperButtons = (\n args: StoryArgs = {},\n context: { viewMode?: string } = {}\n): TemplateResult => {\n const open = context.viewMode === 'docs' ? false : true;\n return html`\n <sp-dialog-wrapper\n ?open=${open}\n size=\"l\"\n headline=\"Wrapped Dialog w/ Buttons\"\n confirm-label=\"Keep Both\"\n secondary-label=\"Replace\"\n cancel-label=\"Cancel\"\n footer=\"Content for footer\"\n @close=${handleClose(args)}\n @confirm=${handleConfirm(args)}\n @secondary=${handleSecondary(args)}\n @cancel=${handleCancel(args)}\n >\n Content of the dialog\n </sp-dialog-wrapper>\n `;\n};\n\nexport const wrapperButtonsUnderlay = (\n args: StoryArgs = {},\n context: { viewMode?: string } = {}\n): TemplateResult => {\n const open = context.viewMode === 'docs' ? false : true;\n return html`\n <sp-dialog-wrapper\n ?open=${open}\n underlay\n size=\"l\"\n headline=\"Wrapped Dialog w/ Buttons\"\n confirm-label=\"Keep Both\"\n secondary-label=\"Replace\"\n cancel-label=\"Cancel\"\n footer=\"Content for footer\"\n @close=${handleClose(args)}\n @confirm=${handleConfirm(args)}\n @secondary=${handleSecondary(args)}\n @cancel=${handleCancel(args)}\n >\n Content of the dialog\n </sp-dialog-wrapper>\n `;\n};\n\nexport const wrapperFullscreen = (\n args: StoryArgs = {},\n context: { viewMode?: string } = {}\n): TemplateResult => {\n const open = context.viewMode === 'docs' ? false : true;\n return html`\n <sp-dialog-wrapper\n ?open=${open}\n headline=\"Wrapped Dialog - Fullscreen\"\n mode=\"fullscreen\"\n confirm-label=\"Keep Both\"\n secondary-label=\"Replace\"\n cancel-label=\"Cancel\"\n @close=${handleClose(args)}\n @confirm=${handleConfirm(args)}\n @secondary=${handleSecondary(args)}\n @cancel=${handleCancel(args)}\n >\n Content of the dialog\n </sp-dialog-wrapper>\n `;\n};\n\nexport const wrapperWithHeadline = (\n args: StoryArgs = {},\n context: { viewMode?: string } = {}\n): TemplateResult => {\n const open = context.viewMode === 'docs' ? false : true;\n return html`\n <sp-dialog-wrapper\n ?open=${open}\n headline=\"Headline for dialog\"\n @close=${handleClose(args)}\n >\n Content of the dialog\n </sp-dialog-wrapper>\n `;\n};\n\nexport const wrapperWithHeadlineNoDivider = (\n args: StoryArgs = {},\n context: { viewMode?: string } = {}\n): TemplateResult => {\n const open = context.viewMode === 'docs' ? false : true;\n return html`\n <sp-dialog-wrapper\n ?open=${open}\n headline=\"Headline for dialog\"\n no-divider=${true}\n @close=${handleClose(args)}\n >\n Content of the dialog\n </sp-dialog-wrapper>\n `;\n};\n\nexport const wrapperHeadlineVisibilityNone = (\n args: StoryArgs = {},\n context: { viewMode?: string } = {}\n): TemplateResult => {\n const open = context.viewMode === 'docs' ? false : true;\n return html`\n <sp-dialog-wrapper\n headline=\"Accessible headline\"\n .headlineVisibility=${'none'}\n ?open=${open}\n @close=${handleClose(args)}\n >\n Content of the dialog\n </sp-dialog-wrapper>\n `;\n};\n\nexport const tooltips = (\n args: StoryArgs = {},\n context: { viewMode?: string } = {}\n): TemplateResult => {\n const open = context.viewMode === 'docs' ? undefined : 'click';\n return html`\n <overlay-trigger\n type=\"modal\"\n @close=${handleClose(args)}\n open=${ifDefined(open)}\n >\n <sp-button slot=\"trigger\" variant=\"primary\">\n Toggle Dialog\n </sp-button>\n <sp-dialog-wrapper\n slot=\"click-content\"\n headline=\"Dialog title\"\n dismissable\n underlay\n size=\"s\"\n >\n ${[1, 2, 3, 4].map(\n (index) => html`\n <overlay-trigger>\n <sp-button slot=\"trigger\">\n Button with Tooltip ${index}\n </sp-button>\n <sp-tooltip slot=\"hover-content\">\n Tooltip ${index}\n </sp-tooltip>\n </overlay-trigger>\n `\n )}\n </sp-dialog-wrapper>\n </overlay-trigger>\n `;\n};\n\ntooltips.decorators = [overlayTriggerDecorator];\n\nexport const lazyHero = ({ src }: { src: string }): TemplateResult => {\n const handleOpened = (): void => {\n (document.querySelector('sp-dialog-wrapper') as DialogWrapper).hero =\n src;\n };\n return html`\n <overlay-trigger content=\"click\" @sp-opened=${handleOpened}>\n <sp-button slot=\"trigger\">Toggle Dialog</sp-button>\n <sp-dialog-wrapper\n slot=\"click-content\"\n headline=\"Dialog title\"\n confirm-label=\"Primary\"\n >\n <p>Content of the dialog</p>\n <ol>\n <li>\n Select the following checkbox to have the dialog close\n when clicking one of its buttons.\n </li>\n <li>\n Select the following checkbox to have the dialog close\n when clicking one of its buttons.\n </li>\n <li>\n Select the following checkbox to have the dialog close\n when clicking one of its buttons.\n </li>\n <li>\n Select the following checkbox to have the dialog close\n when clicking one of its buttons.\n </li>\n <li>\n Select the following checkbox to have the dialog close\n when clicking one of its buttons.\n </li>\n <li>\n Select the following checkbox to have the dialog close\n when clicking one of its buttons.\n </li>\n <li>\n Select the following checkbox to have the dialog close\n when clicking one of its buttons.\n </li>\n <li>\n Select the following checkbox to have the dialog close\n when clicking one of its buttons.\n </li>\n <li>\n Select the following checkbox to have the dialog close\n when clicking one of its buttons.\n </li>\n <li>\n Select the following checkbox to have the dialog close\n when clicking one of its buttons.\n </li>\n <li>\n Select the following checkbox to have the dialog close\n when clicking one of its buttons.\n </li>\n </ol>\n </sp-dialog-wrapper>\n </overlay-trigger>\n `;\n};\n\nlazyHero.args = {\n src: 'https://dummyimage.com/800x400/000/fff',\n};\n\nlazyHero.swc_vrt = {\n skip: true,\n};\n"],
5
- "mappings": ";AAYA,SAAS,YAA4B;AACrC,SAAS,iBAAiB;AAE1B,OAAO;AACP,OAAO;AACP,OAAO;AACP,OAAO;AACP,OAAO;AACP,OAAO;AAEP,OAAO;AACP,SAAS,iBAAiB;AAC1B,SAAS,+BAA+B;AAGxC,eAAe;AAAA,EACX,OAAO;AAAA,EACP,WAAW;AAAA,EACX,UAAU;AAAA,IACN,SAAS,EAAE,QAAQ,QAAQ;AAAA,IAC3B,WAAW,EAAE,QAAQ,UAAU;AAAA,IAC/B,aAAa,EAAE,QAAQ,YAAY;AAAA,IACnC,UAAU,EAAE,QAAQ,SAAS;AAAA,EACjC;AACJ;AASA,MAAM,cACF,CAAC,EAAE,QAAQ,MACX,CAAC,UAAiB;AACd,MAAI;AAAS,YAAQ,KAAK;AAC9B;AAEJ,MAAM,gBACF,CAAC,EAAE,UAAU,MACb,CAAC,UAAiB;AACd,MAAI;AAAW,cAAU,KAAK;AAClC;AAEJ,MAAM,kBACF,CAAC,EAAE,YAAY,MACf,CAAC,UAAiB;AACd,MAAI;AAAa,gBAA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f,MAAM;AACV;",
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 { html, TemplateResult } from '@spectrum-web-components/base';\nimport { ifDefined } from '@spectrum-web-components/base/src/directives.js';\n\nimport '@spectrum-web-components/button/sp-button.js';\nimport '@spectrum-web-components/field-label/sp-field-label.js';\nimport '@spectrum-web-components/help-text/sp-help-text.js';\nimport '@spectrum-web-components/textfield/sp-textfield.js';\nimport '@spectrum-web-components/tooltip/sp-tooltip.js';\nimport '@spectrum-web-components/overlay/overlay-trigger.js';\n\nimport '@spectrum-web-components/dialog/sp-dialog-wrapper.js';\nimport { landscape } from './images.js';\nimport { isOverlayOpen } from '../../overlay/stories/index.js';\nimport '../../overlay/stories/index.js';\nimport type { DialogWrapper } from '@spectrum-web-components/dialog';\n\nexport default {\n title: 'Dialog Wrapped',\n component: 'sp-dialog-wrapper',\n argTypes: {\n onClose: { action: 'close' },\n onConfirm: { action: 'confirm' },\n onSecondary: { action: 'secondary' },\n onCancel: { action: 'cancel' },\n },\n};\n\ntype StoryArgs = {\n onClose?: (event: Event) => void;\n onConfirm?: (event: Event) => void;\n onSecondary?: (event: Event) => void;\n onCancel?: (event: Event) => void;\n};\n\nconst handleClose =\n ({ onClose }: StoryArgs) =>\n (event: Event) => {\n if (onClose) onClose(event);\n };\n\nconst handleConfirm =\n ({ onConfirm }: StoryArgs) =>\n (event: Event) => {\n if (onConfirm) onConfirm(event);\n };\n\nconst handleSecondary =\n ({ onSecondary }: StoryArgs) =>\n (event: Event) => {\n if (onSecondary) onSecondary(event);\n };\n\nconst handleCancel =\n ({ onCancel }: StoryArgs) =>\n (event: Event) => {\n if (onCancel) onCancel(event);\n };\n\nexport const wrapperLabeledHero = (\n args: StoryArgs = {},\n context: { viewMode?: string } = {}\n): TemplateResult => {\n const open = context.viewMode === 'docs' ? false : true;\n return html`\n <style>\n sp-story-decorator {\n inset: 0;\n position: absolute;\n overflow: hidden;\n }\n </style>\n <sp-dialog-wrapper\n ?open=${open}\n hero=${landscape}\n hero-label=\"Hero Image Alt Text\"\n dismissable\n headline=\"Wrapped Dialog w/ Hero Image\"\n @close=${handleClose(args)}\n size=\"s\"\n >\n Content of the dialog\n </sp-dialog-wrapper>\n <sp-button\n onClick=\"\n this.previousElementSibling.open = !this.previousElementSibling.open;\n if (this.previousElementSibling.open) {\n this.previousElementSibling.focus();\n }\n \"\n variant=\"primary\"\n >\n Toggle Dialog\n </sp-button>\n `;\n};\n\nexport const wrapperDismissable = (\n args: StoryArgs = {},\n context: { viewMode?: string } = {}\n): TemplateResult => {\n const open = context.viewMode === 'docs' ? false : true;\n return html`\n <sp-dialog-wrapper\n ?open=${open}\n .hero=${landscape}\n dismissable\n headline=\"Wrapped Dialog w/ Hero Image\"\n @close=${handleClose(args)}\n size=\"s\"\n tabindex=\"0\"\n >\n Content of the dialog\n </sp-dialog-wrapper>\n <sp-button\n onClick=\"\n this.previousElementSibling.open = !this.previousElementSibling.open;\n if (this.previousElementSibling.open) {\n this.previousElementSibling.focus();\n }\n \"\n variant=\"primary\"\n >\n Toggle Dialog\n </sp-button>\n `;\n};\n\nexport const wrapperDismissableUnderlay = (\n args: StoryArgs = {},\n context: { viewMode?: string } = {}\n): TemplateResult => {\n const open = context.viewMode === 'docs' ? false : true;\n return html`\n <sp-dialog-wrapper\n ?open=${open}\n hero=${landscape}\n dismissable\n headline=\"Wrapped Dialog w/ Hero Image\"\n underlay\n @close=${handleClose(args)}\n size=\"s\"\n >\n Content of the dialog\n </sp-dialog-wrapper>\n <sp-button\n onClick=\"\n this.previousElementSibling.open = !this.previousElementSibling.open;\n if (this.previousElementSibling.open) {\n this.previousElementSibling.focus();\n }\n \"\n variant=\"primary\"\n >\n Toggle Dialog\n </sp-button>\n `;\n};\n\nexport const form = (\n args: StoryArgs = {},\n context: { viewMode?: string } = {}\n): TemplateResult => {\n const open = context.viewMode === 'docs' ? undefined : 'click';\n return html`\n <overlay-trigger\n type=\"modal\"\n @close=${handleClose(args)}\n open=${ifDefined(open)}\n >\n <sp-button slot=\"trigger\" variant=\"primary\">\n Toggle Dialog\n </sp-button>\n <sp-dialog-wrapper\n id=\"form-fields\"\n slot=\"click-content\"\n headline=\"Add Delivery Address\"\n underlay\n size=\"m\"\n confirm-label=\"Verify Address\"\n secondary-label=\"Add\"\n cancel-label=\"Cancel\"\n @close=${handleClose(args)}\n @confirm=${({ target }: Event & { target: HTMLElement }) => {\n target.dispatchEvent(\n new Event('close', { bubbles: true, composed: true })\n );\n handleConfirm(args);\n }}\n @secondary=${({ target }: Event & { target: HTMLElement }) => {\n target.dispatchEvent(\n new Event('close', { bubbles: true, composed: true })\n );\n handleSecondary(args);\n }}\n @cancel=${({ target }: Event & { target: HTMLElement }) => {\n target.dispatchEvent(\n new Event('close', { bubbles: true, composed: true })\n );\n handleCancel(args);\n }}\n >\n <style>\n #form-fields div {\n display: grid;\n row-gap: var(--spectrum-global-dimension-size-150);\n grid-template-columns: auto auto;\n\n --spectrum-fieldlabel-m-side-padding-right: 0;\n }\n </style>\n <div>\n <sp-field-label side-aligned=\"end\" for=\"street\">\n Street:\n </sp-field-label>\n <sp-textfield id=\"street\" autofocus></sp-textfield>\n <sp-field-label side-aligned=\"end\" for=\"city\">\n City:\n </sp-field-label>\n <sp-textfield id=\"city\"></sp-textfield>\n <sp-field-label side-aligned=\"end\" for=\"state\">\n State:\n </sp-field-label>\n <sp-textfield id=\"state\"></sp-textfield>\n <sp-field-label side-aligned=\"end\" for=\"zip\">\n Zip:\n </sp-field-label>\n <sp-textfield id=\"zip\"></sp-textfield>\n <sp-field-label side-aligned=\"end\" for=\"instructions\">\n Special instructions:\n </sp-field-label>\n <sp-textfield id=\"instructions\" multiline>\n <sp-help-text slot=\"help-text\">\n For example, gate code or other information to help\n the driver find you\n </sp-help-text>\n </sp-textfield>\n </div>\n </sp-dialog-wrapper>\n </overlay-trigger>\n `;\n};\n\nform.decorators = [isOverlayOpen];\n\nexport const longContent = (\n args: StoryArgs = {},\n context: { viewMode?: string } = {}\n): TemplateResult => {\n const open = context.viewMode === 'docs' ? undefined : 'click';\n return html`\n <overlay-trigger\n type=\"modal\"\n @close=${handleClose(args)}\n open=${ifDefined(open)}\n >\n <sp-button slot=\"trigger\" variant=\"primary\">\n Toggle Dialog\n </sp-button>\n <sp-dialog-wrapper\n slot=\"click-content\"\n headline=\"Dialog title\"\n dismissable\n underlay\n size=\"s\"\n >\n <p>\n Lorem ipsum dolor sit amet, consectetuer adipiscing elit.\n Sed ac dolor sit amet purus malesuada congue. Donec quis\n nibh at felis congue commodo. Ut enim ad minima veniam, quis\n nostrum exercitationem ullam corporis suscipit laboriosam,\n nisi ut aliquid ex ea commodi consequatur? Sed ac dolor sit\n amet purus malesuada congue. Nam libero tempore, cum soluta\n nobis est eligendi optio cumque nihil impedit quo minus id\n quod maxime placeat facere possimus, omnis voluptas\n assumenda est, omnis dolor repellendus. Nullam sit amet\n magna in magna gravida vehicula. Itaque earum rerum hic\n tenetur a sapiente delectus, ut aut reiciendis voluptatibus\n maiores alias consequatur aut perferendis doloribus\n asperiores repellat. Neque porro quisquam est, qui dolorem\n ipsum quia dolor sit amet, consectetur, adipisci velit, sed\n quia non numquam eius modi tempora incidunt ut labore et\n dolore magnam aliquam quaerat voluptatem. Phasellus faucibus\n molestie nisl. Vestibulum fermentum tortor id mi. Integer\n rutrum, orci vestibulum ullamcorper ultricies, lacus quam\n ultricies odio, vitae placerat pede sem sit amet enim.\n Maecenas sollicitudin. Nullam rhoncus aliquam metus.\n </p>\n <p>\n Curabitur ligula sapien, pulvinar a vestibulum quis,\n facilisis vel sapien. Fusce nibh. Proin pede metus,\n vulputate nec, fermentum fringilla, vehicula vitae, justo.\n Aenean placerat. Aliquam erat volutpat. Et harum quidem\n rerum facilis est et expedita distinctio. Fusce nibh.\n Temporibus autem quibusdam et aut officiis debitis aut rerum\n necessitatibus saepe eveniet ut et voluptates repudiandae\n sint et molestiae non recusandae. Vestibulum erat nulla,\n ullamcorper nec, rutrum non, nonummy ac, erat. Etiam posuere\n lacus quis dolor. Mauris elementum mauris vitae tortor.\n Nulla turpis magna, cursus sit amet, suscipit a, interdum\n id, felis. Nam libero tempore, cum soluta nobis est eligendi\n optio cumque nihil impedit quo minus id quod maxime placeat\n facere possimus, omnis voluptas assumenda est, omnis dolor\n repellendus. Nulla accumsan, elit sit amet varius semper,\n nulla mauris mollis quam, tempor suscipit diam nulla vel\n leo. Pellentesque sapien.\n </p>\n <p>\n Curabitur vitae diam non enim vestibulum interdum. Sed elit\n dui, pellentesque a, faucibus vel, interdum nec, diam.\n Praesent vitae arcu tempor neque lacinia pretium. Ut tempus\n purus at lorem. Phasellus rhoncus. Temporibus autem\n quibusdam et aut officiis debitis aut rerum necessitatibus\n saepe eveniet ut et voluptates repudiandae sint et molestiae\n non recusandae. Duis ante orci, molestie vitae vehicula\n venenatis, tincidunt ac pede. Integer vulputate sem a nibh\n rutrum consequat. Aenean placerat. Cum sociis natoque\n penatibus et magnis dis parturient montes, nascetur\n ridiculus mus. Sed vel lectus. Donec odio tempus molestie,\n porttitor ut, iaculis quis, sem. Class aptent taciti\n sociosqu ad litora torquent per conubia nostra, per inceptos\n hymenaeos. Integer in sapien. Nullam dapibus fermentum\n ipsum.\n </p>\n <p>\n Integer vulputate sem a nibh rutrum consequat. Class aptent\n taciti sociosqu ad litora torquent per conubia nostra, per\n inceptos hymenaeos. Duis bibendum, lectus ut viverra\n rhoncus, dolor nunc faucibus libero, eget facilisis enim\n ipsum id lacus. Aliquam erat volutpat. Aenean id metus id\n velit ullamcorper pulvinar. Morbi scelerisque luctus velit.\n Aliquam erat volutpat. Temporibus autem quibusdam et aut\n officiis debitis aut rerum necessitatibus saepe eveniet ut\n et voluptates repudiandae sint et molestiae non recusandae.\n Fusce dui leo, imperdiet in, aliquam sit amet, feugiat eu,\n orci. Suspendisse sagittis ultrices augue. Nullam justo\n enim, consectetuer nec, ullamcorper ac, vestibulum in, elit.\n Praesent vitae arcu tempor neque lacinia pretium. Nullam\n faucibus mi quis velit. Maecenas aliquet accumsan leo. Morbi\n scelerisque luctus velit. Aliquam ornare wisi eu metus.\n </p>\n <p>\n Sed elit dui, pellentesque a, faucibus vel, interdum nec,\n diam. Praesent vitae arcu tempor neque lacinia pretium.\n Etiam dictum tincidunt diam. Et harum quidem rerum facilis\n est et expedita distinctio. Duis ante orci, molestie vitae\n vehicula venenatis, tincidunt ac pede. Integer lacinia.\n Excepteur sint occaecat cupidatat non proident, sunt in\n culpa qui officia deserunt mollit anim id est laborum.\n Mauris tincidunt sem sed arcu. Praesent in mauris eu tortor\n porttitor accumsan. Aenean id metus id velit ullamcorper\n pulvinar. Donec iaculis gravida nulla. Duis bibendum, lectus\n ut viverra rhoncus, dolor nunc faucibus libero, eget\n facilisis enim ipsum id lacus. Nulla quis diam. Quisque\n porta. Integer rutrum, orci vestibulum ullamcorper\n ultricies, lacus quam ultricies odio, vitae placerat pede\n sem sit amet enim. Nam sed tellus id magna elementum\n tincidunt. In enim a arcu imperdiet malesuada.\n </p>\n </sp-dialog-wrapper>\n </overlay-trigger>\n `;\n};\n\nlongContent.decorators = [isOverlayOpen];\n\nexport const wrapperDismissableUnderlayError = (\n args: StoryArgs = {},\n context: { viewMode?: string } = {}\n): TemplateResult => {\n const open = context.viewMode === 'docs' ? false : true;\n return html`\n <div>\n <sp-dialog-wrapper\n ?open=${open}\n hero=${landscape}\n dismissable\n error\n headline=\"Wrapped Dialog w/ Hero Image\"\n underlay\n @close=${handleClose(args)}\n size=\"s\"\n >\n Content of the dialog\n </sp-dialog-wrapper>\n <sp-button\n onClick=\"\n this.previousElementSibling.open = !this.previousElementSibling.open;\n if (this.previousElementSibling.open) {\n this.previousElementSibling.focus();\n }\n \"\n variant=\"primary\"\n >\n Toggle Dialog\n </sp-button>\n </div>\n `;\n};\n\nexport const wrapperButtons = (\n args: StoryArgs = {},\n context: { viewMode?: string } = {}\n): TemplateResult => {\n const open = context.viewMode === 'docs' ? false : true;\n return html`\n <sp-dialog-wrapper\n ?open=${open}\n size=\"l\"\n headline=\"Wrapped Dialog w/ Buttons\"\n confirm-label=\"Keep Both\"\n secondary-label=\"Replace\"\n cancel-label=\"Cancel\"\n footer=\"Content for footer\"\n @close=${handleClose(args)}\n @confirm=${handleConfirm(args)}\n @secondary=${handleSecondary(args)}\n @cancel=${handleCancel(args)}\n >\n Content of the dialog\n </sp-dialog-wrapper>\n `;\n};\n\nexport const wrapperButtonsUnderlay = (\n args: StoryArgs = {},\n context: { viewMode?: string } = {}\n): TemplateResult => {\n const open = context.viewMode === 'docs' ? false : true;\n return html`\n <sp-dialog-wrapper\n ?open=${open}\n underlay\n size=\"l\"\n headline=\"Wrapped Dialog w/ Buttons\"\n confirm-label=\"Keep Both\"\n secondary-label=\"Replace\"\n cancel-label=\"Cancel\"\n footer=\"Content for footer\"\n @close=${handleClose(args)}\n @confirm=${handleConfirm(args)}\n @secondary=${handleSecondary(args)}\n @cancel=${handleCancel(args)}\n >\n Content of the dialog\n </sp-dialog-wrapper>\n `;\n};\n\nexport const wrapperFullscreen = (\n args: StoryArgs = {},\n context: { viewMode?: string } = {}\n): TemplateResult => {\n const open = context.viewMode === 'docs' ? false : true;\n return html`\n <sp-dialog-wrapper\n ?open=${open}\n headline=\"Wrapped Dialog - Fullscreen\"\n mode=\"fullscreen\"\n confirm-label=\"Keep Both\"\n secondary-label=\"Replace\"\n cancel-label=\"Cancel\"\n @close=${handleClose(args)}\n @confirm=${handleConfirm(args)}\n @secondary=${handleSecondary(args)}\n @cancel=${handleCancel(args)}\n >\n Content of the dialog\n </sp-dialog-wrapper>\n `;\n};\n\nexport const wrapperWithHeadline = (\n args: StoryArgs = {},\n context: { viewMode?: string } = {}\n): TemplateResult => {\n const open = context.viewMode === 'docs' ? false : true;\n return html`\n <sp-dialog-wrapper\n ?open=${open}\n headline=\"Headline for dialog\"\n @close=${handleClose(args)}\n >\n Content of the dialog\n </sp-dialog-wrapper>\n `;\n};\n\nexport const wrapperWithHeadlineNoDivider = (\n args: StoryArgs = {},\n context: { viewMode?: string } = {}\n): TemplateResult => {\n const open = context.viewMode === 'docs' ? false : true;\n return html`\n <sp-dialog-wrapper\n ?open=${open}\n headline=\"Headline for dialog\"\n no-divider=${true}\n @close=${handleClose(args)}\n >\n Content of the dialog\n </sp-dialog-wrapper>\n `;\n};\n\nexport const wrapperHeadlineVisibilityNone = (\n args: StoryArgs = {},\n context: { viewMode?: string } = {}\n): TemplateResult => {\n const open = context.viewMode === 'docs' ? false : true;\n return html`\n <sp-dialog-wrapper\n headline=\"Accessible headline\"\n .headlineVisibility=${'none'}\n ?open=${open}\n @close=${handleClose(args)}\n >\n Content of the dialog\n </sp-dialog-wrapper>\n `;\n};\n\nexport const tooltips = (\n args: StoryArgs = {},\n context: { viewMode?: string } = {}\n): TemplateResult => {\n const open = context.viewMode === 'docs' ? undefined : 'click';\n return html`\n <overlay-trigger\n type=\"modal\"\n @close=${handleClose(args)}\n open=${ifDefined(open)}\n >\n <sp-button slot=\"trigger\" variant=\"primary\">\n Toggle Dialog\n </sp-button>\n <sp-dialog-wrapper\n slot=\"click-content\"\n headline=\"Dialog title\"\n dismissable\n underlay\n size=\"s\"\n >\n ${[1, 2, 3, 4].map(\n (index) => html`\n <overlay-trigger>\n <sp-button slot=\"trigger\">\n Button with Tooltip ${index}\n </sp-button>\n <sp-tooltip slot=\"hover-content\">\n Tooltip ${index}\n </sp-tooltip>\n </overlay-trigger>\n `\n )}\n </sp-dialog-wrapper>\n </overlay-trigger>\n `;\n};\n\ntooltips.decorators = [isOverlayOpen];\n\nexport const lazyHero = ({ src }: { src: string }): TemplateResult => {\n const handleOpened = (): void => {\n (document.querySelector('sp-dialog-wrapper') as DialogWrapper).hero =\n src;\n };\n return html`\n <overlay-trigger content=\"click\" @sp-opened=${handleOpened}>\n <sp-button slot=\"trigger\">Toggle Dialog</sp-button>\n <sp-dialog-wrapper\n slot=\"click-content\"\n headline=\"Dialog title\"\n confirm-label=\"Primary\"\n >\n <p>Content of the dialog</p>\n <ol>\n <li>\n Select the following checkbox to have the dialog close\n when clicking one of its buttons.\n </li>\n <li>\n Select the following checkbox to have the dialog close\n when clicking one of its buttons.\n </li>\n <li>\n Select the following checkbox to have the dialog close\n when clicking one of its buttons.\n </li>\n <li>\n Select the following checkbox to have the dialog close\n when clicking one of its buttons.\n </li>\n <li>\n Select the following checkbox to have the dialog close\n when clicking one of its buttons.\n </li>\n <li>\n Select the following checkbox to have the dialog close\n when clicking one of its buttons.\n </li>\n <li>\n Select the following checkbox to have the dialog close\n when clicking one of its buttons.\n </li>\n <li>\n Select the following checkbox to have the dialog close\n when clicking one of its buttons.\n </li>\n <li>\n Select the following checkbox to have the dialog close\n when clicking one of its buttons.\n </li>\n <li>\n Select the following checkbox to have the dialog close\n when clicking one of its buttons.\n </li>\n <li>\n Select the following checkbox to have the dialog close\n when clicking one of its buttons.\n </li>\n </ol>\n </sp-dialog-wrapper>\n </overlay-trigger>\n `;\n};\n\nlazyHero.args = {\n src: 'https://dummyimage.com/800x400/000/fff',\n};\n\nlazyHero.swc_vrt = {\n skip: true,\n};\n"],
5
+ "mappings": ";AAYA,SAAS,YAA4B;AACrC,SAAS,iBAAiB;AAE1B,OAAO;AACP,OAAO;AACP,OAAO;AACP,OAAO;AACP,OAAO;AACP,OAAO;AAEP,OAAO;AACP,SAAS,iBAAiB;AAC1B,SAAS,qBAAqB;AAC9B,OAAO;AAGP,eAAe;AAAA,EACX,OAAO;AAAA,EACP,WAAW;AAAA,EACX,UAAU;AAAA,IACN,SAAS,EAAE,QAAQ,QAAQ;AAAA,IAC3B,WAAW,EAAE,QAAQ,UAAU;AAAA,IAC/B,aAAa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AA;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;AAyDlE;AAEA,SAAS,OAAO;AAAA,EACZ,KAAK;AACT;AAEA,SAAS,UAAU;AAAA,EACf,MAAM;AACV;",
6
6
  "names": []
7
7
  }
package/stories/index.js CHANGED
@@ -1,42 +1,5 @@
1
1
  "use strict";
2
2
  import { html } from "@spectrum-web-components/base";
3
- function nextFrame() {
4
- return new Promise((res) => requestAnimationFrame(() => res()));
5
- }
6
- class OverlayTriggerReady extends HTMLElement {
7
- constructor() {
8
- super(...arguments);
9
- this.handleTriggerOpened = async () => {
10
- await nextFrame();
11
- this.ready(true);
12
- };
13
- this.readyPromise = Promise.resolve(false);
14
- }
15
- connectedCallback() {
16
- this.readyPromise = new Promise((res) => {
17
- this.ready = res;
18
- this.setup();
19
- });
20
- }
21
- async setup() {
22
- await nextFrame();
23
- await nextFrame();
24
- const overlay = document.querySelector(
25
- `overlay-trigger[open]`
26
- );
27
- overlay.addEventListener("sp-opened", this.handleTriggerOpened);
28
- }
29
- get updateComplete() {
30
- return this.readyPromise;
31
- }
32
- }
33
- customElements.define("overlay-trigger-ready", OverlayTriggerReady);
34
- export const overlayTriggerDecorator = (story) => {
35
- return html`
36
- ${story()}
37
- <overlay-trigger-ready></overlay-trigger-ready>
38
- `;
39
- };
40
3
  class CountdownWatcher extends HTMLElement {
41
4
  constructor() {
42
5
  super(...arguments);
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["index.ts"],
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*/\n\nimport { html, TemplateResult } from '@spectrum-web-components/base';\n\nfunction nextFrame(): Promise<void> {\n return new Promise((res) => requestAnimationFrame(() => res()));\n}\n\nclass OverlayTriggerReady extends HTMLElement {\n ready!: (value: boolean | PromiseLike<boolean>) => void;\n\n connectedCallback(): void {\n this.readyPromise = new Promise((res) => {\n this.ready = res;\n this.setup();\n });\n }\n\n async setup(): Promise<void> {\n await nextFrame();\n await nextFrame();\n\n const overlay = document.querySelector(\n `overlay-trigger[open]`\n ) as HTMLElement;\n overlay.addEventListener('sp-opened', this.handleTriggerOpened);\n }\n\n handleTriggerOpened = async (): Promise<void> => {\n await nextFrame();\n\n this.ready(true);\n };\n\n private readyPromise: Promise<boolean> = Promise.resolve(false);\n\n get updateComplete(): Promise<boolean> {\n return this.readyPromise;\n }\n}\n\ncustomElements.define('overlay-trigger-ready', OverlayTriggerReady);\n\nexport const overlayTriggerDecorator = (\n story: () => TemplateResult\n): TemplateResult => {\n return html`\n ${story()}\n <overlay-trigger-ready></overlay-trigger-ready>\n `;\n};\n\nclass CountdownWatcher extends HTMLElement {\n ready!: (value: boolean | PromiseLike<boolean>) => void;\n\n connectedCallback(): void {\n (this.previousElementSibling as HTMLElement).addEventListener(\n 'countdown-complete',\n () => {\n this.ready(true);\n }\n );\n this.readyPromise = new Promise((res) => {\n this.ready = res;\n });\n }\n private readyPromise: Promise<boolean> = Promise.resolve(false);\n\n get updateComplete(): Promise<boolean> {\n return this.readyPromise;\n }\n}\n\ncustomElements.define('countdown-complete-watcher', CountdownWatcher);\n\nexport const disabledButtonDecorator = (\n story: () => TemplateResult\n): TemplateResult => {\n return html`\n ${story()}\n <countdown-complete-watcher></countdown-compl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C,UACiB;AACjB,SAAO;AAAA,UACD,MAAM,CAAC;AAAA;AAAA;AAGjB;",
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*/\n\nimport { html, TemplateResult } from '@spectrum-web-components/base';\n\nclass CountdownWatcher extends HTMLElement {\n ready!: (value: boolean | PromiseLike<boolean>) => void;\n\n connectedCallback(): void {\n (this.previousElementSibling as HTMLElement).addEventListener(\n 'countdown-complete',\n () => {\n this.ready(true);\n }\n );\n this.readyPromise = new Promise((res) => {\n this.ready = res;\n });\n }\n private readyPromise: Promise<boolean> = Promise.resolve(false);\n\n get updateComplete(): Promise<boolean> {\n return this.readyPromise;\n }\n}\n\ncustomElements.define('countdown-complete-watcher', CountdownWatcher);\n\nexport const disabledButtonDecorator = (\n story: () => TemplateResult\n): TemplateResult => {\n return html`\n ${story()}\n <countdown-complete-watcher></countdown-complete-watcher>\n `;\n};\n"],
5
+ "mappings": ";AAYA,SAAS,YAA4B;AAErC,MAAM,yBAAyB,YAAY;AAAA,EAA3C;AAAA;AAcI,SAAQ,eAAiC,QAAQ,QAAQ,KAAK;AAAA;AAAA,EAX9D,oBAA0B;AACtB,IAAC,KAAK,uBAAuC;AAAA,MACzC;AAAA,MACA,MAAM;AACF,aAAK,MAAM,IAAI;AAAA,MACnB;AAAA,IACJ;AACA,SAAK,eAAe,IAAI,QAAQ,CAAC,QAAQ;AACrC,WAAK,QAAQ;AAAA,IACjB,CAAC;AAAA,EACL;AAAA,EAGA,IAAI,iBAAmC;AACnC,WAAO,KAAK;AAAA,EAChB;AACJ;AAEA,eAAe,OAAO,8BAA8B,gBAAgB;AAE7D,aAAM,0BAA0B,CACnC,UACiB;AACjB,SAAO;AAAA,UACD,MAAM,CAAC;AAAA;AAAA;AAGjB;",
6
6
  "names": []
7
7
  }