@aquera/nile-elements 1.9.4 → 1.9.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (140) hide show
  1. package/README.md +7 -0
  2. package/dist/index-5fef1a0d.esm.js +1 -0
  3. package/dist/index-8f38fae3.cjs.js +2 -0
  4. package/dist/index-8f38fae3.cjs.js.map +1 -0
  5. package/dist/index.cjs.js +1 -1
  6. package/dist/index.esm.js +1 -1
  7. package/dist/index.js +1287 -736
  8. package/dist/nile-combobox/index.cjs.js +1 -1
  9. package/dist/nile-combobox/index.esm.js +1 -1
  10. package/dist/nile-combobox/nile-combobox.cjs.js +1 -1
  11. package/dist/nile-combobox/nile-combobox.esm.js +1 -1
  12. package/dist/nile-command-menu/index.cjs.js +2 -0
  13. package/dist/nile-command-menu/index.cjs.js.map +1 -0
  14. package/dist/nile-command-menu/index.esm.js +1 -0
  15. package/dist/nile-command-menu/nile-command-menu.cjs.js +2 -0
  16. package/dist/nile-command-menu/nile-command-menu.cjs.js.map +1 -0
  17. package/dist/nile-command-menu/nile-command-menu.css.cjs.js +2 -0
  18. package/dist/nile-command-menu/nile-command-menu.css.cjs.js.map +1 -0
  19. package/dist/nile-command-menu/nile-command-menu.css.esm.js +182 -0
  20. package/dist/nile-command-menu/nile-command-menu.esm.js +97 -0
  21. package/dist/nile-command-menu-group/index.cjs.js +2 -0
  22. package/dist/nile-command-menu-group/index.cjs.js.map +1 -0
  23. package/dist/nile-command-menu-group/index.esm.js +1 -0
  24. package/dist/nile-command-menu-group/nile-command-menu-group.cjs.js +2 -0
  25. package/dist/nile-command-menu-group/nile-command-menu-group.cjs.js.map +1 -0
  26. package/dist/nile-command-menu-group/nile-command-menu-group.css.cjs.js +2 -0
  27. package/dist/nile-command-menu-group/nile-command-menu-group.css.cjs.js.map +1 -0
  28. package/dist/nile-command-menu-group/nile-command-menu-group.css.esm.js +33 -0
  29. package/dist/nile-command-menu-group/nile-command-menu-group.esm.js +11 -0
  30. package/dist/nile-command-menu-item/index.cjs.js +2 -0
  31. package/dist/nile-command-menu-item/index.cjs.js.map +1 -0
  32. package/dist/nile-command-menu-item/index.esm.js +1 -0
  33. package/dist/nile-command-menu-item/nile-command-menu-item.cjs.js +2 -0
  34. package/dist/nile-command-menu-item/nile-command-menu-item.cjs.js.map +1 -0
  35. package/dist/nile-command-menu-item/nile-command-menu-item.css.cjs.js +2 -0
  36. package/dist/nile-command-menu-item/nile-command-menu-item.css.cjs.js.map +1 -0
  37. package/dist/nile-command-menu-item/nile-command-menu-item.css.esm.js +115 -0
  38. package/dist/nile-command-menu-item/nile-command-menu-item.esm.js +21 -0
  39. package/dist/nile-detail/index.cjs.js +1 -1
  40. package/dist/nile-detail/index.esm.js +1 -1
  41. package/dist/nile-detail/nile-detail.cjs.js +1 -1
  42. package/dist/nile-detail/nile-detail.esm.js +1 -1
  43. package/dist/nile-dialog/nile-dialog.cjs.js +1 -1
  44. package/dist/nile-dialog/nile-dialog.cjs.js.map +1 -1
  45. package/dist/nile-dialog/nile-dialog.esm.js +1 -1
  46. package/dist/nile-dot-stepper/index.cjs.js +2 -0
  47. package/dist/nile-dot-stepper/index.cjs.js.map +1 -0
  48. package/dist/nile-dot-stepper/index.esm.js +1 -0
  49. package/dist/nile-dot-stepper/nile-dot-stepper.cjs.js +2 -0
  50. package/dist/nile-dot-stepper/nile-dot-stepper.cjs.js.map +1 -0
  51. package/dist/nile-dot-stepper/nile-dot-stepper.css.cjs.js +2 -0
  52. package/dist/nile-dot-stepper/nile-dot-stepper.css.cjs.js.map +1 -0
  53. package/dist/nile-dot-stepper/nile-dot-stepper.css.esm.js +77 -0
  54. package/dist/nile-dot-stepper/nile-dot-stepper.esm.js +24 -0
  55. package/dist/nile-section-message/nile-section-message.css.cjs.js +1 -1
  56. package/dist/nile-section-message/nile-section-message.css.cjs.js.map +1 -1
  57. package/dist/nile-section-message/nile-section-message.css.esm.js +7 -8
  58. package/dist/src/index.d.ts +4 -0
  59. package/dist/src/index.js +4 -0
  60. package/dist/src/index.js.map +1 -1
  61. package/dist/src/nile-command-menu/index.d.ts +1 -0
  62. package/dist/src/nile-command-menu/index.js +2 -0
  63. package/dist/src/nile-command-menu/index.js.map +1 -0
  64. package/dist/src/nile-command-menu/nile-command-menu.css.d.ts +12 -0
  65. package/dist/src/nile-command-menu/nile-command-menu.css.js +194 -0
  66. package/dist/src/nile-command-menu/nile-command-menu.css.js.map +1 -0
  67. package/dist/src/nile-command-menu/nile-command-menu.d.ts +137 -0
  68. package/dist/src/nile-command-menu/nile-command-menu.js +557 -0
  69. package/dist/src/nile-command-menu/nile-command-menu.js.map +1 -0
  70. package/dist/src/nile-command-menu/nile-command-menu.test.d.ts +3 -0
  71. package/dist/src/nile-command-menu/nile-command-menu.test.js +268 -0
  72. package/dist/src/nile-command-menu/nile-command-menu.test.js.map +1 -0
  73. package/dist/src/nile-command-menu-group/index.d.ts +1 -0
  74. package/dist/src/nile-command-menu-group/index.js +2 -0
  75. package/dist/src/nile-command-menu-group/index.js.map +1 -0
  76. package/dist/src/nile-command-menu-group/nile-command-menu-group.css.d.ts +12 -0
  77. package/dist/src/nile-command-menu-group/nile-command-menu-group.css.js +45 -0
  78. package/dist/src/nile-command-menu-group/nile-command-menu-group.css.js.map +1 -0
  79. package/dist/src/nile-command-menu-group/nile-command-menu-group.d.ts +38 -0
  80. package/dist/src/nile-command-menu-group/nile-command-menu-group.js +68 -0
  81. package/dist/src/nile-command-menu-group/nile-command-menu-group.js.map +1 -0
  82. package/dist/src/nile-command-menu-group/nile-command-menu-group.test.d.ts +2 -0
  83. package/dist/src/nile-command-menu-group/nile-command-menu-group.test.js +22 -0
  84. package/dist/src/nile-command-menu-group/nile-command-menu-group.test.js.map +1 -0
  85. package/dist/src/nile-command-menu-item/index.d.ts +1 -0
  86. package/dist/src/nile-command-menu-item/index.js +2 -0
  87. package/dist/src/nile-command-menu-item/index.js.map +1 -0
  88. package/dist/src/nile-command-menu-item/nile-command-menu-item.css.d.ts +12 -0
  89. package/dist/src/nile-command-menu-item/nile-command-menu-item.css.js +127 -0
  90. package/dist/src/nile-command-menu-item/nile-command-menu-item.css.js.map +1 -0
  91. package/dist/src/nile-command-menu-item/nile-command-menu-item.d.ts +73 -0
  92. package/dist/src/nile-command-menu-item/nile-command-menu-item.js +174 -0
  93. package/dist/src/nile-command-menu-item/nile-command-menu-item.js.map +1 -0
  94. package/dist/src/nile-command-menu-item/nile-command-menu-item.test.d.ts +1 -0
  95. package/dist/src/nile-command-menu-item/nile-command-menu-item.test.js +35 -0
  96. package/dist/src/nile-command-menu-item/nile-command-menu-item.test.js.map +1 -0
  97. package/dist/src/nile-dialog/nile-dialog.js +1 -1
  98. package/dist/src/nile-dialog/nile-dialog.js.map +1 -1
  99. package/dist/src/nile-dot-stepper/index.d.ts +1 -0
  100. package/dist/src/nile-dot-stepper/index.js +2 -0
  101. package/dist/src/nile-dot-stepper/index.js.map +1 -0
  102. package/dist/src/nile-dot-stepper/nile-dot-stepper.css.d.ts +12 -0
  103. package/dist/src/nile-dot-stepper/nile-dot-stepper.css.js +89 -0
  104. package/dist/src/nile-dot-stepper/nile-dot-stepper.css.js.map +1 -0
  105. package/dist/src/nile-dot-stepper/nile-dot-stepper.d.ts +48 -0
  106. package/dist/src/nile-dot-stepper/nile-dot-stepper.js +153 -0
  107. package/dist/src/nile-dot-stepper/nile-dot-stepper.js.map +1 -0
  108. package/dist/src/nile-dot-stepper/nile-dot-stepper.test.d.ts +1 -0
  109. package/dist/src/nile-dot-stepper/nile-dot-stepper.test.js +319 -0
  110. package/dist/src/nile-dot-stepper/nile-dot-stepper.test.js.map +1 -0
  111. package/dist/src/nile-section-message/nile-section-message.css.js +7 -8
  112. package/dist/src/nile-section-message/nile-section-message.css.js.map +1 -1
  113. package/dist/src/version.js +1 -1
  114. package/dist/src/version.js.map +1 -1
  115. package/dist/tsconfig.tsbuildinfo +1 -1
  116. package/package.json +2 -1
  117. package/src/index.ts +4 -0
  118. package/src/nile-command-menu/index.ts +1 -0
  119. package/src/nile-command-menu/nile-command-menu.css.ts +196 -0
  120. package/src/nile-command-menu/nile-command-menu.test.ts +289 -0
  121. package/src/nile-command-menu/nile-command-menu.ts +601 -0
  122. package/src/nile-command-menu-group/index.ts +1 -0
  123. package/src/nile-command-menu-group/nile-command-menu-group.css.ts +47 -0
  124. package/src/nile-command-menu-group/nile-command-menu-group.test.ts +23 -0
  125. package/src/nile-command-menu-group/nile-command-menu-group.ts +72 -0
  126. package/src/nile-command-menu-item/index.ts +1 -0
  127. package/src/nile-command-menu-item/nile-command-menu-item.css.ts +129 -0
  128. package/src/nile-command-menu-item/nile-command-menu-item.test.ts +36 -0
  129. package/src/nile-command-menu-item/nile-command-menu-item.ts +172 -0
  130. package/src/nile-dialog/nile-dialog.ts +1 -1
  131. package/src/nile-dot-stepper/index.ts +1 -0
  132. package/src/nile-dot-stepper/nile-dot-stepper.css.ts +90 -0
  133. package/src/nile-dot-stepper/nile-dot-stepper.test.ts +493 -0
  134. package/src/nile-dot-stepper/nile-dot-stepper.ts +159 -0
  135. package/src/nile-section-message/nile-section-message.css.ts +7 -8
  136. package/stories/dot-stepper.stories.ts +67 -0
  137. package/vscode-html-custom-data.json +179 -0
  138. package/dist/index-c0b5232c.cjs.js +0 -2
  139. package/dist/index-c0b5232c.cjs.js.map +0 -1
  140. package/dist/index-e43a18eb.esm.js +0 -1
@@ -265,7 +265,7 @@ let NileDialog = class NileDialog extends NileElement {
265
265
  name="var(--nile-icon-close, var(--ng-icon-x-close))"
266
266
  method="var(--nile-svg-method-fill, var(--ng-svg-method-stroke))"
267
267
  label="close"
268
- color="var(--nile-dialog-remove-icon-color, var(--ng-colors-fg-quaternary-400))"
268
+ color="var(--nile-dialog-remove-icon-color, var(--ng-colors-fg-secondary-700))"
269
269
  @click="${() => this.requestClose('close-button')}"
270
270
  ></nile-icon>
271
271
  </div>
@@ -1 +1 @@
1
- {"version":3,"file":"nile-dialog.js","sourceRoot":"","sources":["../../../src/nile-dialog/nile-dialog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AAG,EAAE;CAC3B,CAAC,CAAC;AAEH,mBAAmB,CAAC,qBAAqB,EAAE;IACzC,SAAS,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;IAC3C,OAAO,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE;CAC3B,CAAC,CAAC;AAEH,eAAe,UAAU,CAAC","sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport {LitElement, CSSResultArray, TemplateResult} from 'lit';\nimport {styles} from './nile-dialog.css';\n\nimport '../nile-icon-button/nile-icon-button';\nimport { animateTo, stopAnimations } from '../internal/animate';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { customElement, property, query } from 'lit/decorators.js';\nimport { getAnimation, setDefaultAnimation } from '../utilities/animation-registry';\nimport { HasSlotController } from '../internal/slot';\nimport { html,nothing } from 'lit';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { lockBodyScrolling, unlockBodyScrolling } from '../internal/scroll';\nimport { waitForEvent } from '../internal/event';\nimport { watch } from '../internal/watch';\nimport Modal from '../internal/modal';\nimport type { CSSResultGroup } from 'lit';\nimport NileElement from '../internal/nile-element';\n/**\n * Nile icon component.\n *\n * @tag nile-modal\n *\n */\n@customElement('nile-dialog')\nexport class NileDialog extends NileElement {\n static styles: CSSResultGroup = styles;\n\n private readonly hasSlotController = new HasSlotController(this, 'footer','sublabel','label');\n private modal: Modal;\n private originalTrigger: HTMLElement | null;\n\n @query('.dialog') dialog: HTMLElement;\n @query('.dialog__panel') panel: HTMLElement;\n @query('.dialog__overlay') overlay: HTMLElement;\n\n /**\n * Indicates whether or not the dialog is open. You can toggle this attribute to show and hide the dialog, or you can\n * use the `show()` and `hide()` methods and this attribute will reflect the dialog's open state.\n */\n @property({ type: Boolean, reflect: true }) open = false;\n\n /**\n * The dialog's label as displayed in the header. You should always include a relevant label even when using\n * `no-header`, as it is required for proper accessibility. If you need to display HTML, use the `label` slot instead.\n */\n @property({ reflect: true }) label = '';\n \n @property({ reflect: true }) sublabel = '';\n\n /**\n * Disables the header. This will also remove the default close button, so please ensure you provide an easy,\n * accessible way for users to dismiss the dialog.\n */\n @property({ type: Boolean, reflect: true }) noHeader = false;\n\n @property({ type: Boolean, reflect: true }) preventOverlayClose = false;\n\n /**\n * Added to resolve conflicts between Angular Material's mat-drawer components.\n */\n private drawerStyle = `\n <style id=\"drawer-style\">\n .mat-drawer.mat-drawer-side { z-index: 1; }\n </style>\n `;\n\n connectedCallback() {\n super.connectedCallback();\n this.handleDocumentKeyDown = this.handleDocumentKeyDown.bind(this);\n this.modal = new Modal(this);\n }\n\n firstUpdated() {\n this.dialog.hidden = !this.open;\n\n if (this.open) {\n this.addOpenListeners();\n this.modal.activate();\n lockBodyScrolling(this);\n document.head.insertAdjacentHTML('beforeend', this.drawerStyle);\n }\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n unlockBodyScrolling(this);\n }\n\n private requestClose(source: 'close-button' | 'keyboard' | 'overlay') {\n const nileRequestClose = this.emit('nile-request-close', {\n cancelable: true,\n detail: { source },\n });\n\n if (source === 'close-button') {\n this.hide();\n return;\n }\n\n if (nileRequestClose.defaultPrevented || this.preventOverlayClose) {\n const animation = getAnimation(this, 'dialog.denyClose', {\n dir: 'right',\n });\n animateTo(this.panel, animation.keyframes, animation.options);\n return;\n }\n\n this.hide();\n }\n\n private addOpenListeners() {\n document.addEventListener('keydown', this.handleDocumentKeyDown);\n }\n\n private removeOpenListeners() {\n document.removeEventListener('keydown', this.handleDocumentKeyDown);\n }\n\n private handleDocumentKeyDown(event: KeyboardEvent) {\n if (this.open && event.key === 'Escape') {\n event.stopPropagation();\n this.requestClose('keyboard');\n }\n }\n\n @watch('open', { waitUntilFirstUpdate: true })\n async handleOpenChange() {\n if (this.open) {\n this.emit('nile-show');\n this.addOpenListeners();\n this.originalTrigger = document.activeElement as HTMLElement;\n this.modal.activate();\n document.head.insertAdjacentHTML('beforeend', this.drawerStyle);\n lockBodyScrolling(this);\n\n const autoFocusTarget = this.querySelector('[autofocus]');\n if (autoFocusTarget) {\n autoFocusTarget.removeAttribute('autofocus');\n }\n\n await Promise.all([\n stopAnimations(this.dialog),\n stopAnimations(this.overlay),\n ]);\n this.dialog.hidden = false;\n\n // Set initial focus\n requestAnimationFrame(() => {\n const nileInitialFocus = this.emit('nile-initial-focus', {\n cancelable: true,\n });\n\n if (!nileInitialFocus.defaultPrevented) {\n // Set focus to the autofocus target and restore the attribute\n if (autoFocusTarget) {\n (autoFocusTarget as HTMLInputElement).focus({\n preventScroll: true,\n });\n } else {\n this.panel.focus({ preventScroll: true });\n }\n }\n\n // Restore the autofocus attribute\n if (autoFocusTarget) {\n autoFocusTarget.setAttribute('autofocus', '');\n }\n });\n\n const panelAnimation = getAnimation(this, 'dialog.show', {\n dir: 'right',\n });\n const overlayAnimation = getAnimation(this, 'dialog.overlay.show', {\n dir: 'right',\n });\n await Promise.all([\n animateTo(this.panel, panelAnimation.keyframes, panelAnimation.options),\n animateTo(\n this.overlay,\n overlayAnimation.keyframes,\n overlayAnimation.options\n ),\n ]);\n\n this.emit('nile-after-show');\n } else {\n // Hide\n this.emit('nile-hide');\n this.removeOpenListeners();\n this.modal.deactivate();\n\n await Promise.all([\n stopAnimations(this.dialog),\n stopAnimations(this.overlay),\n ]);\n const panelAnimation = getAnimation(this, 'dialog.hide', {\n dir: 'right',\n });\n const overlayAnimation = getAnimation(this, 'dialog.overlay.hide', {\n dir: 'right',\n });\n\n const styleTag = document.getElementById('drawer-style');\n if (styleTag) {\n document.head.removeChild(styleTag);\n }\n // Animate the overlay and the panel at the same time. Because animation durations might be different, we need to\n // hide each one individually when the animation finishes, otherwise the first one that finishes will reappear\n // unexpectedly. We'll unhide them after all animations have completed.\n await Promise.all([\n animateTo(\n this.overlay,\n overlayAnimation.keyframes,\n overlayAnimation.options\n ).then(() => {\n this.overlay.hidden = true;\n }),\n animateTo(\n this.panel,\n panelAnimation.keyframes,\n panelAnimation.options\n ).then(() => {\n this.panel.hidden = true;\n }),\n ]);\n\n this.dialog.hidden = true;\n\n // Now that the dialog is hidden, restore the overlay and panel for next time\n this.overlay.hidden = false;\n this.panel.hidden = false;\n\n unlockBodyScrolling(this);\n\n // Restore focus to the original trigger\n const trigger = this.originalTrigger;\n if (typeof trigger?.focus === 'function') {\n setTimeout(() => trigger.focus());\n }\n\n this.emit('nile-after-hide');\n }\n }\n\n /** Shows the dialog. */\n async show() {\n if (this.open) {\n return undefined;\n }\n\n this.open = true;\n return waitForEvent(this, 'nile-after-show');\n }\n\n /** Hides the dialog */\n async hide() {\n if (!this.open) {\n return undefined;\n }\n\n this.open = false;\n return waitForEvent(this, 'nile-after-hide');\n }\n\n render() {\n return html`\n <div\n part=\"base\"\n class=${classMap({\n dialog: true,\n 'dialog--open': this.open,\n 'dialog--has-footer': this.hasSlotController.test('footer'),\n })}\n >\n <div\n part=\"overlay\"\n class=\"dialog__overlay\"\n @click=${() => this.requestClose('overlay')}\n tabindex=\"-1\"\n ></div>\n\n <div\n part=\"panel\"\n class=\"dialog__panel\"\n role=\"dialog\"\n aria-modal=\"true\"\n aria-hidden=${this.open ? 'false' : 'true'}\n aria-label=${ifDefined(this.noHeader ? this.label : undefined)}\n aria-labelledby=${ifDefined(!this.noHeader ? 'title' : undefined)}\n tabindex=\"0\"\n >\n ${!this.noHeader\n ? html`\n <header part=\"header\" class=\"dialog__header\">\n <h2 part=\"title\" class=\"dialog__header__text\" id=\"title\">\n <slot name=\"label\">\n ${this.label?.length\n ? this.label\n : nothing}\n </slot>\n ${this.sublabel || this.hasSlotController.test('sublabel')?html`\n <slot name=\"sublabel\">\n ${this.sublabel?.length\n ? this.sublabel\n : nothing}\n </slot>\n `:''}\n </h2>\n <div part=\"header-actions\" class=\"dialog__header-actions\">\n <slot name=\"header-actions\"></slot>\n <nile-icon\n part=\"close-button\"\n exportparts=\"base:close-button__base\"\n class=\"dialog__close\"\n name=\"var(--nile-icon-close, var(--ng-icon-x-close))\"\n method=\"var(--nile-svg-method-fill, var(--ng-svg-method-stroke))\"\n label=\"close\"\n color=\"var(--nile-dialog-remove-icon-color, var(--ng-colors-fg-quaternary-400))\"\n @click=\"${() => this.requestClose('close-button')}\"\n ></nile-icon>\n </div>\n </header>\n `\n : ''}\n\n <slot\n part=\"body\"\n class=\"dialog__body ${this.noHeader\n ? 'dialog__body-noheader'\n : ''}\"\n ></slot>\n\n <footer part=\"footer\" class=\"dialog__footer\">\n <slot name=\"footer\"></slot>\n </footer>\n </div>\n </div>\n `;\n }\n}\n\nsetDefaultAnimation('dialog.show', {\n keyframes: [\n { opacity: 0, scale: 0.8 },\n { opacity: 1, scale: 1 }\n ],\n options: { duration: 250, easing: 'ease' }\n});\n\nsetDefaultAnimation('dialog.hide', {\n keyframes: [\n { opacity: 1, scale: 1 },\n { opacity: 0, scale: 0.8 }\n ],\n options: { duration: 250, easing: 'ease' }\n});\n\nsetDefaultAnimation('dialog.denyClose', {\n keyframes: [{ scale: 1 }, { scale: 1.02 }, { scale: 1 }],\n options: { duration: 250 }\n});\n\nsetDefaultAnimation('dialog.overlay.show', {\n keyframes: [{ opacity: 0 }, { opacity: 1 }],\n options: { duration: 250 }\n});\n\nsetDefaultAnimation('dialog.overlay.hide', {\n keyframes: [{ opacity: 1 }, { opacity: 0 }],\n options: { duration: 250 }\n});\n\nexport default NileDialog;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-dialog': NileDialog;\n }\n}\n"]}
1
+ {"version":3,"file":"nile-dialog.js","sourceRoot":"","sources":["../../../src/nile-dialog/nile-dialog.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAGH,OAAO,EAAC,MAAM,EAAC,MAAM,mBAAmB,CAAC;AAEzC,OAAO,sCAAsC,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,QAAQ,E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EAAE;CAC3B,CAAC,CAAC;AAEH,eAAe,UAAU,CAAC","sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport {LitElement, CSSResultArray, TemplateResult} from 'lit';\nimport {styles} from './nile-dialog.css';\n\nimport '../nile-icon-button/nile-icon-button';\nimport { animateTo, stopAnimations } from '../internal/animate';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { customElement, property, query } from 'lit/decorators.js';\nimport { getAnimation, setDefaultAnimation } from '../utilities/animation-registry';\nimport { HasSlotController } from '../internal/slot';\nimport { html,nothing } from 'lit';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { lockBodyScrolling, unlockBodyScrolling } from '../internal/scroll';\nimport { waitForEvent } from '../internal/event';\nimport { watch } from '../internal/watch';\nimport Modal from '../internal/modal';\nimport type { CSSResultGroup } from 'lit';\nimport NileElement from '../internal/nile-element';\n/**\n * Nile icon component.\n *\n * @tag nile-modal\n *\n */\n@customElement('nile-dialog')\nexport class NileDialog extends NileElement {\n static styles: CSSResultGroup = styles;\n\n private readonly hasSlotController = new HasSlotController(this, 'footer','sublabel','label');\n private modal: Modal;\n private originalTrigger: HTMLElement | null;\n\n @query('.dialog') dialog: HTMLElement;\n @query('.dialog__panel') panel: HTMLElement;\n @query('.dialog__overlay') overlay: HTMLElement;\n\n /**\n * Indicates whether or not the dialog is open. You can toggle this attribute to show and hide the dialog, or you can\n * use the `show()` and `hide()` methods and this attribute will reflect the dialog's open state.\n */\n @property({ type: Boolean, reflect: true }) open = false;\n\n /**\n * The dialog's label as displayed in the header. You should always include a relevant label even when using\n * `no-header`, as it is required for proper accessibility. If you need to display HTML, use the `label` slot instead.\n */\n @property({ reflect: true }) label = '';\n \n @property({ reflect: true }) sublabel = '';\n\n /**\n * Disables the header. This will also remove the default close button, so please ensure you provide an easy,\n * accessible way for users to dismiss the dialog.\n */\n @property({ type: Boolean, reflect: true }) noHeader = false;\n\n @property({ type: Boolean, reflect: true }) preventOverlayClose = false;\n\n /**\n * Added to resolve conflicts between Angular Material's mat-drawer components.\n */\n private drawerStyle = `\n <style id=\"drawer-style\">\n .mat-drawer.mat-drawer-side { z-index: 1; }\n </style>\n `;\n\n connectedCallback() {\n super.connectedCallback();\n this.handleDocumentKeyDown = this.handleDocumentKeyDown.bind(this);\n this.modal = new Modal(this);\n }\n\n firstUpdated() {\n this.dialog.hidden = !this.open;\n\n if (this.open) {\n this.addOpenListeners();\n this.modal.activate();\n lockBodyScrolling(this);\n document.head.insertAdjacentHTML('beforeend', this.drawerStyle);\n }\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n unlockBodyScrolling(this);\n }\n\n private requestClose(source: 'close-button' | 'keyboard' | 'overlay') {\n const nileRequestClose = this.emit('nile-request-close', {\n cancelable: true,\n detail: { source },\n });\n\n if (source === 'close-button') {\n this.hide();\n return;\n }\n\n if (nileRequestClose.defaultPrevented || this.preventOverlayClose) {\n const animation = getAnimation(this, 'dialog.denyClose', {\n dir: 'right',\n });\n animateTo(this.panel, animation.keyframes, animation.options);\n return;\n }\n\n this.hide();\n }\n\n private addOpenListeners() {\n document.addEventListener('keydown', this.handleDocumentKeyDown);\n }\n\n private removeOpenListeners() {\n document.removeEventListener('keydown', this.handleDocumentKeyDown);\n }\n\n private handleDocumentKeyDown(event: KeyboardEvent) {\n if (this.open && event.key === 'Escape') {\n event.stopPropagation();\n this.requestClose('keyboard');\n }\n }\n\n @watch('open', { waitUntilFirstUpdate: true })\n async handleOpenChange() {\n if (this.open) {\n this.emit('nile-show');\n this.addOpenListeners();\n this.originalTrigger = document.activeElement as HTMLElement;\n this.modal.activate();\n document.head.insertAdjacentHTML('beforeend', this.drawerStyle);\n lockBodyScrolling(this);\n\n const autoFocusTarget = this.querySelector('[autofocus]');\n if (autoFocusTarget) {\n autoFocusTarget.removeAttribute('autofocus');\n }\n\n await Promise.all([\n stopAnimations(this.dialog),\n stopAnimations(this.overlay),\n ]);\n this.dialog.hidden = false;\n\n // Set initial focus\n requestAnimationFrame(() => {\n const nileInitialFocus = this.emit('nile-initial-focus', {\n cancelable: true,\n });\n\n if (!nileInitialFocus.defaultPrevented) {\n // Set focus to the autofocus target and restore the attribute\n if (autoFocusTarget) {\n (autoFocusTarget as HTMLInputElement).focus({\n preventScroll: true,\n });\n } else {\n this.panel.focus({ preventScroll: true });\n }\n }\n\n // Restore the autofocus attribute\n if (autoFocusTarget) {\n autoFocusTarget.setAttribute('autofocus', '');\n }\n });\n\n const panelAnimation = getAnimation(this, 'dialog.show', {\n dir: 'right',\n });\n const overlayAnimation = getAnimation(this, 'dialog.overlay.show', {\n dir: 'right',\n });\n await Promise.all([\n animateTo(this.panel, panelAnimation.keyframes, panelAnimation.options),\n animateTo(\n this.overlay,\n overlayAnimation.keyframes,\n overlayAnimation.options\n ),\n ]);\n\n this.emit('nile-after-show');\n } else {\n // Hide\n this.emit('nile-hide');\n this.removeOpenListeners();\n this.modal.deactivate();\n\n await Promise.all([\n stopAnimations(this.dialog),\n stopAnimations(this.overlay),\n ]);\n const panelAnimation = getAnimation(this, 'dialog.hide', {\n dir: 'right',\n });\n const overlayAnimation = getAnimation(this, 'dialog.overlay.hide', {\n dir: 'right',\n });\n\n const styleTag = document.getElementById('drawer-style');\n if (styleTag) {\n document.head.removeChild(styleTag);\n }\n // Animate the overlay and the panel at the same time. Because animation durations might be different, we need to\n // hide each one individually when the animation finishes, otherwise the first one that finishes will reappear\n // unexpectedly. We'll unhide them after all animations have completed.\n await Promise.all([\n animateTo(\n this.overlay,\n overlayAnimation.keyframes,\n overlayAnimation.options\n ).then(() => {\n this.overlay.hidden = true;\n }),\n animateTo(\n this.panel,\n panelAnimation.keyframes,\n panelAnimation.options\n ).then(() => {\n this.panel.hidden = true;\n }),\n ]);\n\n this.dialog.hidden = true;\n\n // Now that the dialog is hidden, restore the overlay and panel for next time\n this.overlay.hidden = false;\n this.panel.hidden = false;\n\n unlockBodyScrolling(this);\n\n // Restore focus to the original trigger\n const trigger = this.originalTrigger;\n if (typeof trigger?.focus === 'function') {\n setTimeout(() => trigger.focus());\n }\n\n this.emit('nile-after-hide');\n }\n }\n\n /** Shows the dialog. */\n async show() {\n if (this.open) {\n return undefined;\n }\n\n this.open = true;\n return waitForEvent(this, 'nile-after-show');\n }\n\n /** Hides the dialog */\n async hide() {\n if (!this.open) {\n return undefined;\n }\n\n this.open = false;\n return waitForEvent(this, 'nile-after-hide');\n }\n\n render() {\n return html`\n <div\n part=\"base\"\n class=${classMap({\n dialog: true,\n 'dialog--open': this.open,\n 'dialog--has-footer': this.hasSlotController.test('footer'),\n })}\n >\n <div\n part=\"overlay\"\n class=\"dialog__overlay\"\n @click=${() => this.requestClose('overlay')}\n tabindex=\"-1\"\n ></div>\n\n <div\n part=\"panel\"\n class=\"dialog__panel\"\n role=\"dialog\"\n aria-modal=\"true\"\n aria-hidden=${this.open ? 'false' : 'true'}\n aria-label=${ifDefined(this.noHeader ? this.label : undefined)}\n aria-labelledby=${ifDefined(!this.noHeader ? 'title' : undefined)}\n tabindex=\"0\"\n >\n ${!this.noHeader\n ? html`\n <header part=\"header\" class=\"dialog__header\">\n <h2 part=\"title\" class=\"dialog__header__text\" id=\"title\">\n <slot name=\"label\">\n ${this.label?.length\n ? this.label\n : nothing}\n </slot>\n ${this.sublabel || this.hasSlotController.test('sublabel')?html`\n <slot name=\"sublabel\">\n ${this.sublabel?.length\n ? this.sublabel\n : nothing}\n </slot>\n `:''}\n </h2>\n <div part=\"header-actions\" class=\"dialog__header-actions\">\n <slot name=\"header-actions\"></slot>\n <nile-icon\n part=\"close-button\"\n exportparts=\"base:close-button__base\"\n class=\"dialog__close\"\n name=\"var(--nile-icon-close, var(--ng-icon-x-close))\"\n method=\"var(--nile-svg-method-fill, var(--ng-svg-method-stroke))\"\n label=\"close\"\n color=\"var(--nile-dialog-remove-icon-color, var(--ng-colors-fg-secondary-700))\"\n @click=\"${() => this.requestClose('close-button')}\"\n ></nile-icon>\n </div>\n </header>\n `\n : ''}\n\n <slot\n part=\"body\"\n class=\"dialog__body ${this.noHeader\n ? 'dialog__body-noheader'\n : ''}\"\n ></slot>\n\n <footer part=\"footer\" class=\"dialog__footer\">\n <slot name=\"footer\"></slot>\n </footer>\n </div>\n </div>\n `;\n }\n}\n\nsetDefaultAnimation('dialog.show', {\n keyframes: [\n { opacity: 0, scale: 0.8 },\n { opacity: 1, scale: 1 }\n ],\n options: { duration: 250, easing: 'ease' }\n});\n\nsetDefaultAnimation('dialog.hide', {\n keyframes: [\n { opacity: 1, scale: 1 },\n { opacity: 0, scale: 0.8 }\n ],\n options: { duration: 250, easing: 'ease' }\n});\n\nsetDefaultAnimation('dialog.denyClose', {\n keyframes: [{ scale: 1 }, { scale: 1.02 }, { scale: 1 }],\n options: { duration: 250 }\n});\n\nsetDefaultAnimation('dialog.overlay.show', {\n keyframes: [{ opacity: 0 }, { opacity: 1 }],\n options: { duration: 250 }\n});\n\nsetDefaultAnimation('dialog.overlay.hide', {\n keyframes: [{ opacity: 1 }, { opacity: 0 }],\n options: { duration: 250 }\n});\n\nexport default NileDialog;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-dialog': NileDialog;\n }\n}\n"]}
@@ -0,0 +1 @@
1
+ export { NileDotStepper } from './nile-dot-stepper';
@@ -0,0 +1,2 @@
1
+ export { NileDotStepper } from './nile-dot-stepper';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/nile-dot-stepper/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC","sourcesContent":["export { NileDotStepper } from './nile-dot-stepper';\n"]}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Copyright Aquera Inc 2023
3
+ *
4
+ * This source code is licensed under the BSD-3-Clause license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+ /**
8
+ * Dot Stepper CSS
9
+ */
10
+ export declare const styles: import("lit").CSSResult;
11
+ declare const _default: import("lit").CSSResult[];
12
+ export default _default;
@@ -0,0 +1,89 @@
1
+ /**
2
+ * Copyright Aquera Inc 2023
3
+ *
4
+ * This source code is licensed under the BSD-3-Clause license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+ import { css } from 'lit';
8
+ /**
9
+ * Dot Stepper CSS
10
+ */
11
+ export const styles = css `
12
+ :host {
13
+ display: inline-block;
14
+ -webkit-font-smoothing: var(
15
+ --nile-webkit-font-smoothing,
16
+ var(--ng-webkit-font-smoothing)
17
+ );
18
+ -moz-osx-font-smoothing: var(
19
+ --nile-moz-osx-font-smoothing,
20
+ var(--ng-moz-osx-font-smoothing)
21
+ );
22
+ text-rendering: var(--nile-text-rendering, var(--ng-text-rendering));
23
+ }
24
+
25
+ .dots {
26
+ display: flex;
27
+ flex-wrap: wrap;
28
+ gap: var(--nile-spacing-10px, var(--ng-spacing-2-5));
29
+ align-items: center;
30
+ }
31
+
32
+ .dot {
33
+ background: var(--nile-colors-neutral-400, var(--ng-colors-border-secondary));
34
+ border: none;
35
+ padding: 0;
36
+ margin: 0;
37
+ box-sizing: border-box;
38
+ cursor: pointer;
39
+ border-radius: 50%;
40
+ width: var(--nile-spacing-10px, var(--ng-spacing-2-5));
41
+ height: var(--nile-spacing-10px, var(--ng-spacing-2-5));
42
+ transition: background-color 0.2s ease-out, transform 0.2s ease-out;
43
+ }
44
+
45
+ .dot--active {
46
+ background: var(
47
+ --nile-colors-primary-600,
48
+ var(--ng-colors-text-brand-secondary-700)
49
+ );
50
+ }
51
+
52
+ /* Sizes */
53
+ .dot--sm {
54
+ width: var(--nile-spacing-4px, var(--ng-spacing-1));
55
+ height: var(--nile-spacing-4px, var(--ng-spacing-1));
56
+ }
57
+
58
+ .dot--md {
59
+ width: var(--nile-spacing-10px, var(--ng-spacing-2-5));
60
+ height: var(--nile-spacing-10px, var(--ng-spacing-2-5));
61
+ }
62
+
63
+ .dot--lg {
64
+ width: var(--nile-spacing-14px, var(--ng-spacing-3-5));
65
+ height: var(--nile-spacing-14px, var(--ng-spacing-3-5));
66
+ }
67
+
68
+ .dots:has(.dot--sm) {
69
+ gap: var(--nile-spacing-6px, var(--ng-spacing-1-5));
70
+ }
71
+
72
+ .dots:has(.dot--lg) {
73
+ gap: var(--nile-spacing-2-x, var(--ng-spacing-3));
74
+ }
75
+
76
+ .dot:focus-visible {
77
+ outline: var(--nile-spacing-2px, var(--ng-spacing-0-5)) solid
78
+ var(--nile-colors-stroke-strong-950, var(--ng-colors-border-secondary));
79
+ outline-offset: var(--nile-spacing-2px, var(--ng-spacing-0-5));
80
+ }
81
+
82
+ :host([disabled]) .dot,
83
+ .dot:disabled {
84
+ cursor: not-allowed;
85
+ opacity: 0.5;
86
+ }
87
+ `;
88
+ export default [styles];
89
+ //# sourceMappingURL=nile-dot-stepper.css.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nile-dot-stepper.css.js","sourceRoot":"","sources":["../../../src/nile-dot-stepper/nile-dot-stepper.css.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4ExB,CAAC;AACF,eAAe,CAAC,MAAM,CAAC,CAAC","sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { css } from 'lit';\n\n/**\n * Dot Stepper CSS\n */\nexport const styles = css`\n :host {\n display: inline-block;\n -webkit-font-smoothing: var(\n --nile-webkit-font-smoothing,\n var(--ng-webkit-font-smoothing)\n );\n -moz-osx-font-smoothing: var(\n --nile-moz-osx-font-smoothing,\n var(--ng-moz-osx-font-smoothing)\n );\n text-rendering: var(--nile-text-rendering, var(--ng-text-rendering));\n }\n\n .dots {\n display: flex;\n flex-wrap: wrap;\n gap: var(--nile-spacing-10px, var(--ng-spacing-2-5));\n align-items: center;\n }\n\n .dot {\n background: var(--nile-colors-neutral-400, var(--ng-colors-border-secondary));\n border: none;\n padding: 0;\n margin: 0;\n box-sizing: border-box;\n cursor: pointer;\n border-radius: 50%;\n width: var(--nile-spacing-10px, var(--ng-spacing-2-5));\n height: var(--nile-spacing-10px, var(--ng-spacing-2-5));\n transition: background-color 0.2s ease-out, transform 0.2s ease-out;\n }\n\n .dot--active {\n background: var(\n --nile-colors-primary-600,\n var(--ng-colors-text-brand-secondary-700)\n );\n }\n\n /* Sizes */\n .dot--sm {\n width: var(--nile-spacing-4px, var(--ng-spacing-1));\n height: var(--nile-spacing-4px, var(--ng-spacing-1));\n }\n\n .dot--md {\n width: var(--nile-spacing-10px, var(--ng-spacing-2-5));\n height: var(--nile-spacing-10px, var(--ng-spacing-2-5));\n }\n\n .dot--lg {\n width: var(--nile-spacing-14px, var(--ng-spacing-3-5));\n height: var(--nile-spacing-14px, var(--ng-spacing-3-5));\n }\n\n .dots:has(.dot--sm) {\n gap: var(--nile-spacing-6px, var(--ng-spacing-1-5));\n }\n\n .dots:has(.dot--lg) {\n gap: var(--nile-spacing-2-x, var(--ng-spacing-3));\n }\n\n .dot:focus-visible {\n outline: var(--nile-spacing-2px, var(--ng-spacing-0-5)) solid\n var(--nile-colors-stroke-strong-950, var(--ng-colors-border-secondary));\n outline-offset: var(--nile-spacing-2px, var(--ng-spacing-0-5));\n }\n\n :host([disabled]) .dot,\n .dot:disabled {\n cursor: not-allowed;\n opacity: 0.5;\n }\n`;\nexport default [styles];\n"]}
@@ -0,0 +1,48 @@
1
+ /**
2
+ * Copyright Aquera Inc 2023
3
+ *
4
+ * This source code is licensed under the BSD-3-Clause license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+ import NileElement from '../internal/nile-element';
8
+ import type { CSSResultGroup, TemplateResult } from 'lit';
9
+ /**
10
+ * Nile dot stepper component.
11
+ *
12
+ * @tag nile-dot-stepper
13
+ *
14
+ */
15
+ /**
16
+ * @summary Dot steppers display a horizontal row of small dots indicating progress or position, with one active dot and the rest inactive.
17
+ * @status stable
18
+ *
19
+ * @event nile-step-change - Emitted when a dot is selected via click or keyboard. The `detail` contains the 1-based `value` of the selected dot.
20
+ *
21
+ * @csspart base - The component's base wrapper (the dots container).
22
+ * @csspart dot - An individual dot button.
23
+ */
24
+ export declare class NileDotStepper extends NileElement {
25
+ static styles: CSSResultGroup;
26
+ connectedCallback(): void;
27
+ /** The total number of dots. */
28
+ total: number;
29
+ /** The 1-based index of the active dot. */
30
+ current: number;
31
+ /** The size of each dot. */
32
+ size: 'sm' | 'md' | 'lg';
33
+ /** Disables click and keyboard interaction. */
34
+ disabled: boolean;
35
+ /** Clamps the active value to the valid `[1, total]` range. */
36
+ private clamp;
37
+ private selectStep;
38
+ private handleDotClick;
39
+ private focusDot;
40
+ private handleKeyDown;
41
+ render(): TemplateResult;
42
+ }
43
+ export default NileDotStepper;
44
+ declare global {
45
+ interface HTMLElementTagNameMap {
46
+ 'nile-dot-stepper': NileDotStepper;
47
+ }
48
+ }
@@ -0,0 +1,153 @@
1
+ /**
2
+ * Copyright Aquera Inc 2023
3
+ *
4
+ * This source code is licensed under the BSD-3-Clause license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+ import { __decorate } from "tslib";
8
+ import { html } from 'lit';
9
+ import { styles } from './nile-dot-stepper.css';
10
+ import { classMap } from 'lit/directives/class-map.js';
11
+ import { customElement, property } from 'lit/decorators.js';
12
+ import NileElement, { setupA11yMetadata } from '../internal/nile-element';
13
+ import { A11yProperty } from '../internal/accessibility/a11y.property.enum';
14
+ import { A11yRole } from '../internal/accessibility/a11y.role.enum';
15
+ import { Role } from '../internal/accessibility/role.enum';
16
+ /**
17
+ * Nile dot stepper component.
18
+ *
19
+ * @tag nile-dot-stepper
20
+ *
21
+ */
22
+ /**
23
+ * @summary Dot steppers display a horizontal row of small dots indicating progress or position, with one active dot and the rest inactive.
24
+ * @status stable
25
+ *
26
+ * @event nile-step-change - Emitted when a dot is selected via click or keyboard. The `detail` contains the 1-based `value` of the selected dot.
27
+ *
28
+ * @csspart base - The component's base wrapper (the dots container).
29
+ * @csspart dot - An individual dot button.
30
+ */
31
+ let NileDotStepper = class NileDotStepper extends NileElement {
32
+ constructor() {
33
+ super(...arguments);
34
+ /** The total number of dots. */
35
+ this.total = 0;
36
+ /** The 1-based index of the active dot. */
37
+ this.current = 1;
38
+ /** The size of each dot. */
39
+ this.size = 'md';
40
+ /** Disables click and keyboard interaction. */
41
+ this.disabled = false;
42
+ }
43
+ connectedCallback() {
44
+ super.connectedCallback();
45
+ setupA11yMetadata(this, {
46
+ [Role.Role]: A11yRole.Tablist,
47
+ [A11yProperty.AriaLabel]: 'Progress',
48
+ });
49
+ }
50
+ /** Clamps the active value to the valid `[1, total]` range. */
51
+ clamp(value) {
52
+ if (this.total < 1)
53
+ return 1;
54
+ return Math.min(Math.max(value, 1), this.total);
55
+ }
56
+ selectStep(value) {
57
+ if (this.disabled)
58
+ return;
59
+ const next = this.clamp(value);
60
+ this.current = next;
61
+ this.emit('nile-step-change', { value: next });
62
+ }
63
+ handleDotClick(value) {
64
+ this.selectStep(value);
65
+ }
66
+ focusDot(value) {
67
+ const dot = this.shadowRoot?.querySelector(`[part="dot"][data-index="${value}"]`);
68
+ dot?.focus();
69
+ }
70
+ handleKeyDown(event) {
71
+ if (this.disabled || this.total < 1)
72
+ return;
73
+ const active = this.clamp(this.current);
74
+ let next = null;
75
+ switch (event.key) {
76
+ case 'ArrowRight':
77
+ next = this.clamp(active + 1);
78
+ break;
79
+ case 'ArrowLeft':
80
+ next = this.clamp(active - 1);
81
+ break;
82
+ case 'Home':
83
+ next = 1;
84
+ break;
85
+ case 'End':
86
+ next = this.total;
87
+ break;
88
+ default:
89
+ return;
90
+ }
91
+ event.preventDefault();
92
+ if (next !== null) {
93
+ this.selectStep(next);
94
+ this.focusDot(next);
95
+ }
96
+ }
97
+ render() {
98
+ const active = this.clamp(this.current);
99
+ return html `
100
+ <div
101
+ part="base"
102
+ class="dots"
103
+ role="tablist"
104
+ aria-label="Progress"
105
+ @keydown=${this.handleKeyDown}
106
+ >
107
+ ${Array.from({ length: this.total }).map((_, index) => {
108
+ const value = index + 1;
109
+ const isActive = value === active;
110
+ return html `
111
+ <button
112
+ part="dot"
113
+ role="tab"
114
+ type="button"
115
+ data-index=${value}
116
+ class=${classMap({
117
+ dot: true,
118
+ 'dot--active': isActive,
119
+ 'dot--sm': this.size === 'sm',
120
+ 'dot--md': this.size === 'md',
121
+ 'dot--lg': this.size === 'lg',
122
+ })}
123
+ aria-selected=${isActive ? 'true' : 'false'}
124
+ aria-label="Step ${value} of ${this.total}"
125
+ tabindex=${isActive ? 0 : -1}
126
+ ?disabled=${this.disabled}
127
+ @click=${() => this.handleDotClick(value)}
128
+ ></button>
129
+ `;
130
+ })}
131
+ </div>
132
+ `;
133
+ }
134
+ };
135
+ NileDotStepper.styles = styles;
136
+ __decorate([
137
+ property({ type: Number, reflect: true })
138
+ ], NileDotStepper.prototype, "total", void 0);
139
+ __decorate([
140
+ property({ type: Number, reflect: true })
141
+ ], NileDotStepper.prototype, "current", void 0);
142
+ __decorate([
143
+ property({ reflect: true })
144
+ ], NileDotStepper.prototype, "size", void 0);
145
+ __decorate([
146
+ property({ type: Boolean, reflect: true })
147
+ ], NileDotStepper.prototype, "disabled", void 0);
148
+ NileDotStepper = __decorate([
149
+ customElement('nile-dot-stepper')
150
+ ], NileDotStepper);
151
+ export { NileDotStepper };
152
+ export default NileDotStepper;
153
+ //# sourceMappingURL=nile-dot-stepper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nile-dot-stepper.js","sourceRoot":"","sources":["../../../src/nile-dot-stepper/nile-dot-stepper.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAEH,OAAO,EAAE,IA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,IAAI,EAAE,CAAC;+CAAa;AAG1B;IAA5B,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;4CAAiC;AAGjB;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;gDAAkB;AArBlD,cAAc;IAD1B,aAAa,CAAC,kBAAkB,CAAC;GACrB,cAAc,CAmH1B;;AAED,eAAe,cAAc,CAAC","sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { html } from 'lit';\nimport { styles } from './nile-dot-stepper.css';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { customElement, property } from 'lit/decorators.js';\nimport NileElement, { setupA11yMetadata } from '../internal/nile-element';\nimport type { CSSResultGroup, TemplateResult } from 'lit';\nimport { A11yProperty } from '../internal/accessibility/a11y.property.enum';\nimport { A11yRole } from '../internal/accessibility/a11y.role.enum';\nimport { Role } from '../internal/accessibility/role.enum';\n\n/**\n * Nile dot stepper component.\n *\n * @tag nile-dot-stepper\n *\n */\n\n/**\n * @summary Dot steppers display a horizontal row of small dots indicating progress or position, with one active dot and the rest inactive.\n * @status stable\n *\n * @event nile-step-change - Emitted when a dot is selected via click or keyboard. The `detail` contains the 1-based `value` of the selected dot.\n *\n * @csspart base - The component's base wrapper (the dots container).\n * @csspart dot - An individual dot button.\n */\n\n@customElement('nile-dot-stepper')\nexport class NileDotStepper extends NileElement {\n static styles: CSSResultGroup = styles;\n\n connectedCallback(): void {\n super.connectedCallback();\n setupA11yMetadata(this, {\n [Role.Role]: A11yRole.Tablist,\n [A11yProperty.AriaLabel]: 'Progress',\n });\n }\n\n /** The total number of dots. */\n @property({ type: Number, reflect: true }) total = 0;\n\n /** The 1-based index of the active dot. */\n @property({ type: Number, reflect: true }) current = 1;\n\n /** The size of each dot. */\n @property({ reflect: true }) size: 'sm' | 'md' | 'lg' = 'md';\n\n /** Disables click and keyboard interaction. */\n @property({ type: Boolean, reflect: true }) disabled = false;\n\n /** Clamps the active value to the valid `[1, total]` range. */\n private clamp(value: number): number {\n if (this.total < 1) return 1;\n return Math.min(Math.max(value, 1), this.total);\n }\n\n private selectStep(value: number): void {\n if (this.disabled) return;\n const next = this.clamp(value);\n this.current = next;\n this.emit('nile-step-change', { value: next });\n }\n\n private handleDotClick(value: number): void {\n this.selectStep(value);\n }\n\n private focusDot(value: number): void {\n const dot = this.shadowRoot?.querySelector<HTMLButtonElement>(\n `[part=\"dot\"][data-index=\"${value}\"]`\n );\n dot?.focus();\n }\n\n private handleKeyDown(event: KeyboardEvent): void {\n if (this.disabled || this.total < 1) return;\n\n const active = this.clamp(this.current);\n let next: number | null = null;\n\n switch (event.key) {\n case 'ArrowRight':\n next = this.clamp(active + 1);\n break;\n case 'ArrowLeft':\n next = this.clamp(active - 1);\n break;\n case 'Home':\n next = 1;\n break;\n case 'End':\n next = this.total;\n break;\n default:\n return;\n }\n\n event.preventDefault();\n if (next !== null) {\n this.selectStep(next);\n this.focusDot(next);\n }\n }\n\n render(): TemplateResult {\n const active = this.clamp(this.current);\n\n return html`\n <div\n part=\"base\"\n class=\"dots\"\n role=\"tablist\"\n aria-label=\"Progress\"\n @keydown=${this.handleKeyDown}\n >\n ${Array.from({ length: this.total }).map((_, index) => {\n const value = index + 1;\n const isActive = value === active;\n return html`\n <button\n part=\"dot\"\n role=\"tab\"\n type=\"button\"\n data-index=${value}\n class=${classMap({\n dot: true,\n 'dot--active': isActive,\n 'dot--sm': this.size === 'sm',\n 'dot--md': this.size === 'md',\n 'dot--lg': this.size === 'lg',\n })}\n aria-selected=${isActive ? 'true' : 'false'}\n aria-label=\"Step ${value} of ${this.total}\"\n tabindex=${isActive ? 0 : -1}\n ?disabled=${this.disabled}\n @click=${() => this.handleDotClick(value)}\n ></button>\n `;\n })}\n </div>\n `;\n }\n}\n\nexport default NileDotStepper;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-dot-stepper': NileDotStepper;\n }\n}\n"]}
@@ -0,0 +1 @@
1
+ import './nile-dot-stepper';