kemet-ui 3.0.0 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/custom-elements.json +657 -715
- package/dist/components/kemet-accordion/kemet-accordion-panel.d.ts +2 -2
- package/dist/components/kemet-accordion/kemet-accordion-panel.js +1 -1
- package/dist/components/kemet-accordion/kemet-accordion-panel.js.map +1 -1
- package/dist/components/kemet-accordion/kemet-accordion.d.ts +3 -3
- package/dist/components/kemet-accordion/kemet-accordion.js +2 -1
- package/dist/components/kemet-accordion/kemet-accordion.js.map +1 -1
- package/dist/components/kemet-alert/kemet-alert.d.ts +2 -2
- package/dist/components/kemet-alert/kemet-alert.js.map +1 -1
- package/dist/components/kemet-badge/kemet-badge.js.map +1 -1
- package/dist/components/kemet-button/kemet-button.d.ts +2 -2
- package/dist/components/kemet-button/kemet-button.js +1 -1
- package/dist/components/kemet-button/kemet-button.js.map +1 -1
- package/dist/components/kemet-card/kemet-card.d.ts +1 -1
- package/dist/components/kemet-card/kemet-card.js +1 -1
- package/dist/components/kemet-card/kemet-card.js.map +1 -1
- package/dist/components/kemet-carousel/kemet-carousel-current.d.ts +1 -1
- package/dist/components/kemet-carousel/kemet-carousel-current.js.map +1 -1
- package/dist/components/kemet-carousel/kemet-carousel-last.d.ts +1 -1
- package/dist/components/kemet-carousel/kemet-carousel-last.js +1 -1
- package/dist/components/kemet-carousel/kemet-carousel-last.js.map +1 -1
- package/dist/components/kemet-carousel/kemet-carousel.d.ts +18 -14
- package/dist/components/kemet-carousel/kemet-carousel.js +32 -13
- package/dist/components/kemet-carousel/kemet-carousel.js.map +1 -1
- package/dist/components/kemet-checkbox/kemet-checkbox.d.ts +4 -4
- package/dist/components/kemet-checkbox/kemet-checkbox.js +4 -4
- package/dist/components/kemet-checkbox/kemet-checkbox.js.map +1 -1
- package/dist/components/kemet-combo/kemet-combo.d.ts +8 -8
- package/dist/components/kemet-combo/kemet-combo.js +13 -17
- package/dist/components/kemet-combo/kemet-combo.js.map +1 -1
- package/dist/components/kemet-count/kemet-count.d.ts +1 -1
- package/dist/components/kemet-count/kemet-count.js +1 -1
- package/dist/components/kemet-count/kemet-count.js.map +1 -1
- package/dist/components/kemet-draggable/kemet-draggable.d.ts +3 -3
- package/dist/components/kemet-draggable/kemet-draggable.js +6 -5
- package/dist/components/kemet-draggable/kemet-draggable.js.map +1 -1
- package/dist/components/kemet-drawer/kemet-drawer.d.ts +2 -2
- package/dist/components/kemet-drawer/kemet-drawer.js +2 -2
- package/dist/components/kemet-drawer/kemet-drawer.js.map +1 -1
- package/dist/components/kemet-drawer/styles.js +1 -0
- package/dist/components/kemet-drawer/styles.js.map +1 -1
- package/dist/components/kemet-fab/kemet-fab.d.ts +1 -1
- package/dist/components/kemet-fab/kemet-fab.js +1 -1
- package/dist/components/kemet-fab/kemet-fab.js.map +1 -1
- package/dist/components/kemet-field/kemet-field.d.ts +7 -7
- package/dist/components/kemet-field/kemet-field.js +9 -14
- package/dist/components/kemet-field/kemet-field.js.map +1 -1
- package/dist/components/kemet-flipcard/kemet-flipcard-trigger.d.ts +1 -1
- package/dist/components/kemet-flipcard/kemet-flipcard-trigger.js +2 -3
- package/dist/components/kemet-flipcard/kemet-flipcard-trigger.js.map +1 -1
- package/dist/components/kemet-flipcard/kemet-flipcard.d.ts +2 -2
- package/dist/components/kemet-flipcard/kemet-flipcard.js +3 -5
- package/dist/components/kemet-flipcard/kemet-flipcard.js.map +1 -1
- package/dist/components/kemet-input/kemet-input.d.ts +3 -22
- package/dist/components/kemet-input/kemet-input.js +3 -23
- package/dist/components/kemet-input/kemet-input.js.map +1 -1
- package/dist/components/kemet-modal/kemet-modal.d.ts +4 -4
- package/dist/components/kemet-modal/kemet-modal.js +3 -3
- package/dist/components/kemet-modal/kemet-modal.js.map +1 -1
- package/dist/components/kemet-password/kemet-password.d.ts +14 -8
- package/dist/components/kemet-password/kemet-password.js +4 -33
- package/dist/components/kemet-password/kemet-password.js.map +1 -1
- package/dist/components/kemet-popper/kemet-popper-close.d.ts +1 -1
- package/dist/components/kemet-popper/kemet-popper-close.js +2 -3
- package/dist/components/kemet-popper/kemet-popper-close.js.map +1 -1
- package/dist/components/kemet-popper/kemet-popper.d.ts +18 -7
- package/dist/components/kemet-popper/kemet-popper.js +21 -25
- package/dist/components/kemet-popper/kemet-popper.js.map +1 -1
- package/dist/components/kemet-radio/kemet-radios.d.ts +5 -4
- package/dist/components/kemet-radio/kemet-radios.js +10 -4
- package/dist/components/kemet-radio/kemet-radios.js.map +1 -1
- package/dist/components/kemet-rotator/kemet-rotator.d.ts +1 -1
- package/dist/components/kemet-rotator/kemet-rotator.js +1 -2
- package/dist/components/kemet-rotator/kemet-rotator.js.map +1 -1
- package/dist/components/kemet-scroll-link/kemet-scroll-link.d.ts +2 -2
- package/dist/components/kemet-scroll-link/kemet-scroll-link.js +11 -10
- package/dist/components/kemet-scroll-link/kemet-scroll-link.js.map +1 -1
- package/dist/components/kemet-scroll-nav/kemet-scroll-nav.d.ts +2 -2
- package/dist/components/kemet-scroll-nav/kemet-scroll-nav.js +2 -7
- package/dist/components/kemet-scroll-nav/kemet-scroll-nav.js.map +1 -1
- package/dist/components/kemet-scroll-snap/kemet-scroll-snap-paginator.d.ts +5 -4
- package/dist/components/kemet-scroll-snap/kemet-scroll-snap-paginator.js +1 -1
- package/dist/components/kemet-scroll-snap/kemet-scroll-snap-paginator.js.map +1 -1
- package/dist/components/kemet-scroll-snap/kemet-scroll-snap-slide.d.ts +1 -1
- package/dist/components/kemet-scroll-snap/kemet-scroll-snap-slide.js +1 -1
- package/dist/components/kemet-scroll-snap/kemet-scroll-snap-slide.js.map +1 -1
- package/dist/components/kemet-scroll-snap/kemet-scroll-snap.d.ts +3 -2
- package/dist/components/kemet-scroll-snap/kemet-scroll-snap.js +2 -7
- package/dist/components/kemet-scroll-snap/kemet-scroll-snap.js.map +1 -1
- package/dist/components/kemet-select/kemet-option.d.ts +1 -1
- package/dist/components/kemet-select/kemet-option.js +1 -1
- package/dist/components/kemet-select/kemet-option.js.map +1 -1
- package/dist/components/kemet-select/kemet-select.d.ts +19 -10
- package/dist/components/kemet-select/kemet-select.js +3 -44
- package/dist/components/kemet-select/kemet-select.js.map +1 -1
- package/dist/components/kemet-sortable/kemet-sortable.d.ts +5 -5
- package/dist/components/kemet-sortable/kemet-sortable.js +5 -5
- package/dist/components/kemet-sortable/kemet-sortable.js.map +1 -1
- package/dist/components/kemet-svgs/kemet-svgs.d.ts +1 -1
- package/dist/components/kemet-svgs/kemet-svgs.js +1 -1
- package/dist/components/kemet-svgs/kemet-svgs.js.map +1 -1
- package/dist/components/kemet-tabs/kemet-tab-panel.d.ts +1 -0
- package/dist/components/kemet-tabs/kemet-tab-panel.js +3 -0
- package/dist/components/kemet-tabs/kemet-tab-panel.js.map +1 -1
- package/dist/components/kemet-tabs/kemet-tab.d.ts +1 -0
- package/dist/components/kemet-tabs/kemet-tab.js +4 -1
- package/dist/components/kemet-tabs/kemet-tab.js.map +1 -1
- package/dist/components/kemet-tabs/kemet-tabs.d.ts +23 -14
- package/dist/components/kemet-tabs/kemet-tabs.js +3 -47
- package/dist/components/kemet-tabs/kemet-tabs.js.map +1 -1
- package/dist/components/kemet-textarea/kemet-textarea.js.map +1 -1
- package/dist/components/kemet-toggle/kemet-toggle.d.ts +3 -3
- package/dist/components/kemet-toggle/kemet-toggle.js +3 -3
- package/dist/components/kemet-toggle/kemet-toggle.js.map +1 -1
- package/dist/components/kemet-tooltip/kemet-tooltip.d.ts +2 -2
- package/dist/components/kemet-tooltip/kemet-tooltip.js +13 -12
- package/dist/components/kemet-tooltip/kemet-tooltip.js.map +1 -1
- package/dist/components/kemet-tracker/kemet-tracker-step.d.ts +2 -2
- package/dist/components/kemet-tracker/kemet-tracker-step.js +2 -2
- package/dist/components/kemet-tracker/kemet-tracker-step.js.map +1 -1
- package/dist/components/kemet-tracker/kemet-tracker.d.ts +2 -1
- package/dist/components/kemet-tracker/kemet-tracker.js.map +1 -1
- package/dist/components/kemet-upload/kemet-upload-file.js +1 -2
- package/dist/components/kemet-upload/kemet-upload-file.js.map +1 -1
- package/dist/components/kemet-upload/kemet-upload.d.ts +3 -3
- package/dist/components/kemet-upload/kemet-upload.js +3 -8
- package/dist/components/kemet-upload/kemet-upload.js.map +1 -1
- package/dist/kemet-components.bundle.js +98 -86
- package/dist/kemet-components.bundle.js.map +1 -1
- package/dist/kemet-components.cjs +8680 -8803
- package/dist/kemet-components.js +8680 -8803
- package/dist/styles/kemet.core.css +1 -561
- package/dist/styles/kemet.core.css.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +5 -3
|
@@ -36,12 +36,12 @@ export default class KemetAccordionPanel extends LitElement {
|
|
|
36
36
|
/** @internal */
|
|
37
37
|
bodyElementLast: HTMLElement | null | undefined;
|
|
38
38
|
firstUpdated(): void;
|
|
39
|
-
updated(prevProps:
|
|
39
|
+
updated(prevProps: Map<string, never>): void;
|
|
40
40
|
render(): import("lit-html").TemplateResult<1>;
|
|
41
41
|
toggle(): void;
|
|
42
42
|
focusableBodyElements(): void;
|
|
43
43
|
a11y(): void;
|
|
44
|
-
handleKeyDown(event:
|
|
44
|
+
handleKeyDown(event: KeyboardEvent): void;
|
|
45
45
|
}
|
|
46
46
|
declare global {
|
|
47
47
|
interface HTMLElementTagNameMap {
|
|
@@ -62,7 +62,7 @@ let KemetAccordionPanel = class KemetAccordionPanel extends LitElement {
|
|
|
62
62
|
class="trigger"
|
|
63
63
|
part="trigger"
|
|
64
64
|
@click=${() => this.toggle()}
|
|
65
|
-
@keydown=${event => this.handleKeyDown(event)}
|
|
65
|
+
@keydown=${(event) => this.handleKeyDown(event)}
|
|
66
66
|
>
|
|
67
67
|
<slot name="trigger"></slot>
|
|
68
68
|
<slot name="icon"></slot>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kemet-accordion-panel.js","sourceRoot":"","sources":["../../../src/components/kemet-accordion/kemet-accordion-panel.ts"],"names":[],"mappings":";AA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CAAC;GAClB,mBAAmB,CA4GvC;eA5GoB,mBAAmB","sourcesContent":["import { html, LitElement } from 'lit';\nimport { customElement, property, state } from 'lit/decorators.js';\nimport { emitEvent } from '../../utilities/misc/events';\nimport { stylesPanel } from './styles';\n\n/**\n * @since 1.0.0\n * @status stable\n *\n * @tagname kemet-accordion-panel\n * @summary A blade for an accordion.\n *\n * @prop {boolean} opened - Determines the opened state of the panel\n * @prop {string} maxHeight - Sets the max height of the panel's body\n * @prop {string} slug - Uniquely identifies a panel for accessibility purposes\n *\n * @slot trigger - The trigger button that opens and closes the panel.\n * @slot body - The body content of the panel.\n * @slot icon - The icon for the panel.\n *\n * @csspart trigger - Contains the trigger for the panel.\n * @csspart body - Contains the body for the panel.\n *\n * @event kemet-accordion-panel-opened - Fires when a panel is opened\n * @event kemet-accordion-panel-closed - Fires when a panel is closed\n *\n */\n\n@customElement('kemet-accordion-panel')\nexport default class KemetAccordionPanel extends LitElement {\n static styles = [stylesPanel];\n\n @property({ type: Boolean, reflect: true })\n opened: boolean | undefined = undefined;\n\n @property({ type: String, attribute: 'max-height' })\n maxHeight: string = '0px';\n\n @property({ type: String })\n slug: string = 'panel';\n\n @property({ type: Number })\n index: number;\n\n /** @internal */\n @state()\n focusableSelector: string;\n\n /** @internal */\n @state()\n bodyElement: HTMLElement | null;\n\n /** @internal */\n @state()\n bodyElementFirst: HTMLElement | null | undefined;\n\n /** @internal */\n @state()\n bodyElementLast: HTMLElement | null | undefined;\n\n firstUpdated() {\n this.focusableSelector = 'body, a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, *[tabindex], *[contenteditable]';\n this.bodyElement = this.querySelector('[slot=\"body\"]');\n this.bodyElementFirst = this.bodyElement?.querySelector(':first-child');\n this.bodyElementLast = this.bodyElement?.querySelector(':last-child');\n\n if (this.bodyElementFirst) this.bodyElementFirst.style.marginTop = '0';\n if (this.bodyElementLast) this.bodyElementLast.style.marginBottom = '0';\n }\n\n updated(prevProps: Map<string, never>) {\n if (!prevProps.get('opened') && this.opened === true) {\n this.maxHeight = `${this.bodyElement?.offsetHeight}px`;\n emitEvent(this, 'kemet-accordion-panel-opened', this);\n }\n\n if (prevProps.get('opened') && this.opened === false) {\n this.maxHeight = '0px';\n emitEvent(this, 'kemet-accordion-panel-closed', this);\n }\n\n this.a11y();\n this.focusableBodyElements();\n }\n\n render() {\n return html`\n <button\n class=\"trigger\"\n part=\"trigger\"\n @click=${() => this.toggle()}\n @keydown=${(event: KeyboardEvent) => this.handleKeyDown(event)}\n >\n <slot name=\"trigger\"></slot>\n <slot name=\"icon\"></slot>\n </button>\n <section class=\"body\" part=\"body\" style=\"max-height:${this.maxHeight};\">\n <slot name=\"body\"></slot>\n </section>\n `;\n }\n\n toggle() {\n this.opened = !this.opened;\n }\n\n focusableBodyElements() {\n const focusableElements = this.bodyElement?.querySelectorAll(this.focusableSelector);\n\n if (this.opened) {\n focusableElements?.forEach((element) => {\n element.removeAttribute('tabindex');\n });\n } else {\n focusableElements?.forEach((element) => {\n element.setAttribute('tabindex', '-1');\n });\n }\n }\n\n a11y() {\n const trigger = this.shadowRoot?.querySelector('.trigger');\n const body = this.shadowRoot?.querySelector('.body');\n\n trigger?.setAttribute('id', `${this.slug}-button`);\n trigger?.setAttribute('aria-controls', `${this.slug}-content`);\n\n body?.setAttribute('id', `${this.slug}-content`);\n body?.setAttribute('aria-labelledby', `${this.slug}-button`);\n body?.setAttribute('aria-hidden', `${!this.opened}`);\n }\n\n handleKeyDown(event: KeyboardEvent) {\n if (event.key === 'Space' || event.key === 'Enter') {\n this.toggle();\n }\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'kemet-accordion-panel': KemetAccordionPanel\n }\n}\n"]}
|
|
@@ -25,9 +25,9 @@ export default class KemetAccordion extends LitElement {
|
|
|
25
25
|
firstUpdated(): void;
|
|
26
26
|
render(): import("lit-html").TemplateResult<1>;
|
|
27
27
|
handleSlotChange(): void;
|
|
28
|
-
handlePanelOpened(event:
|
|
29
|
-
navigatePanels(direction:
|
|
30
|
-
handleKeyDown(event:
|
|
28
|
+
handlePanelOpened(event: CustomEvent): void;
|
|
29
|
+
navigatePanels(direction: string): void;
|
|
30
|
+
handleKeyDown(event: KeyboardEvent): void;
|
|
31
31
|
expandAll(): void;
|
|
32
32
|
collapseAll(): void;
|
|
33
33
|
}
|
|
@@ -75,11 +75,12 @@ let KemetAccordion = class KemetAccordion extends LitElement {
|
|
|
75
75
|
this.panels[this.currentPanel].shadowRoot.querySelector('button').focus();
|
|
76
76
|
}
|
|
77
77
|
handleKeyDown(event) {
|
|
78
|
+
const target = event.target;
|
|
78
79
|
switch (event.key) {
|
|
79
80
|
case 'Enter':
|
|
80
81
|
case 'Space':
|
|
81
82
|
event.preventDefault();
|
|
82
|
-
|
|
83
|
+
target.click();
|
|
83
84
|
break;
|
|
84
85
|
case 'ArrowLeft':
|
|
85
86
|
case 'ArrowUp':
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kemet-accordion.js","sourceRoot":"","sources":["../../../src/components/kemet-accordion/kemet-accordion.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAGtC;;;;;;;;;;GAUG;AAGH,IAAqB,cAAc,GAAnC,MAAqB,cAAe,SAAQ,UAAU;IAqBpD;QACE,KAAK,EAAE,CAAC;QAlBV,iBAAY,GAAW,CAAC,CAAC;QAGzB,iBAAY,GAAY,KAAK,CAAC;QAiB5B,WAAW;QACX,IAAI,CAAC,gBAAgB,CAAC,8BAA8B,EAAE,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAC3F,CAAC;IAED,YAAY;QACV,IAAI,CAAC,SAAS,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cAAc,EAAE,CAAC;gBACvB,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;gBAC3B,MAAM;YACR,KAAK,MAAM;gBACT,KAAK,CAAC,cAAc,EAAE,CAAC;gBACvB,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;gBAC5B,MAAM;YACR;gBACE,MAAM;SACT;IACH,CAAC;IAED,SAAS;QACP,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;YAC5B,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC;QACtB,CAAC,CAAC,CAAC;IACL,CAAC;IAED,WAAW;QACT,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;YAC5B,KAAK,CAAC,MAAM,GAAG,KAAK,CAAC;QACvB,CAAC,CAAC,CAAC;IACL,CAAC;CACF,CAAA;AAhIQ,qBAAM,GAAG,CAAC,UAAU,CAAC,CAAC;AAG7B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,eAAe,EAAE,CAAC;oDAC9B;AAGzB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,CAAC;oDAC1B;AAI9B;IADC,KAAK,EAAE;8CACgC;AAIxC;IADC,KAAK,EAAE;iDACkC;AAI1C;IADC,KAAK,EAAE;yDACkB;AAnBP,cAAc;IADlC,aAAa,CAAC,iBAAiB,CAAC;GACZ,cAAc,CAiIlC;eAjIoB,cAAc","sourcesContent":["import { html, LitElement } from 'lit';\nimport { customElement, property, state } from 'lit/decorators.js';\nimport { stylesBase } from './styles';\nimport KemetAccordionPanel from './kemet-accordion-panel';\n\n/**\n * @since 1.0.0\n * @status stable\n *\n * @tagname kemet-accordion\n * @summary A component that acts like a standard accordion.\n *\n * @prop {number} currentPanel - The index value for the most recently opened panel\n * @prop {boolean} togglePanels - Support for closing all inactive panels when one is opened\n *\n */\n\n@customElement('kemet-accordion')\nexport default class KemetAccordion extends LitElement {\n static styles = [stylesBase];\n\n @property({ type: Number, attribute: 'current-panel' })\n currentPanel: number = 0;\n\n @property({ type: Boolean, attribute: 'toggle-panels' })\n togglePanels: boolean = false;\n\n /** @internal */\n @state()\n panels: NodeListOf<KemetAccordionPanel>;\n\n /** @internal */\n @state()\n onKeyDown: (event: KeyboardEvent) => void;\n\n /** @internal */\n @state()\n currentPanelFocus: number;\n\n constructor() {\n super();\n\n // bindings\n this.addEventListener('kemet-accordion-panel-opened', this.handlePanelOpened.bind(this));\n }\n\n firstUpdated() {\n this.onKeyDown = event => this.handleKeyDown(event);\n }\n\n render() {\n return html`<slot @slotchange=${() => this.handleSlotChange()}></slot>`;\n }\n\n handleSlotChange() {\n this.panels = this.querySelectorAll('kemet-accordion-panel');\n\n this.panels.forEach((panel: KemetAccordionPanel, index) => {\n panel.index = index;\n panel.removeEventListener('keydown', this.onKeyDown);\n panel.addEventListener('keydown', this.onKeyDown);\n });\n }\n\n handlePanelOpened(event: CustomEvent) {\n this.panels?.forEach((panel: KemetAccordionPanel) => {\n if (panel === event.detail) {\n this.currentPanel = panel.index;\n }\n });\n\n if (this.togglePanels) {\n this.panels?.forEach((panel: KemetAccordionPanel) => {\n if (panel !== event.detail) {\n panel.opened = false;\n }\n });\n }\n }\n\n navigatePanels(direction: string) {\n switch (direction) {\n case 'home':\n this.currentPanel = 0;\n break;\n case 'end':\n this.currentPanel = this.panels.length - 1;\n break;\n case 'next':\n this.currentPanel += 1;\n break;\n case 'prev':\n this.currentPanel -= 1;\n break;\n default:\n this.currentPanelFocus = 0;\n break;\n }\n\n if (this.currentPanel > this.panels.length - 1) this.currentPanel = 0;\n if (this.currentPanel < 0) this.currentPanel = this.panels.length - 1;\n\n this.panels[this.currentPanel].shadowRoot.querySelector('button').focus();\n }\n\n handleKeyDown(event: KeyboardEvent) {\n const target = event.target as HTMLElement;\n switch (event.key) {\n case 'Enter':\n case 'Space':\n event.preventDefault();\n target.click();\n break;\n case 'ArrowLeft':\n case 'ArrowUp':\n event.preventDefault();\n this.navigatePanels('prev');\n break;\n case 'ArrowRight':\n case 'ArrowDown':\n event.preventDefault();\n this.navigatePanels('next');\n break;\n case 'End':\n event.preventDefault();\n this.navigatePanels('end');\n break;\n case 'Home':\n event.preventDefault();\n this.navigatePanels('home');\n break;\n default:\n break;\n }\n }\n\n expandAll() {\n this.panels.forEach((panel) => {\n panel.opened = true;\n });\n }\n\n collapseAll() {\n this.panels.forEach((panel) => {\n panel.opened = false;\n });\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'kemet-accordion': KemetAccordion\n }\n}\n"]}
|
|
@@ -37,9 +37,9 @@ export default class KemetAlert extends LitElement {
|
|
|
37
37
|
borderStatus: string;
|
|
38
38
|
hidden: boolean;
|
|
39
39
|
overlay: string;
|
|
40
|
-
shouldUpdate(prevProps:
|
|
40
|
+
shouldUpdate(prevProps: Map<string, never>): boolean;
|
|
41
41
|
firstUpdated(): void;
|
|
42
|
-
updated(prevProps:
|
|
42
|
+
updated(prevProps: Map<string, never>): void;
|
|
43
43
|
render(): import("lit-html").TemplateResult<1>;
|
|
44
44
|
makeCloseBtn(): import("lit-html").TemplateResult<1>;
|
|
45
45
|
handleMotion(): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kemet-alert.js","sourceRoot":"","sources":["../../../src/components/kemet-alert/kemet-alert.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAGtC;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAGH,IAAqB,UAAU,GAA/B,MAAqB,UAAW,SAAQ,UAAU;IAAlD;;QAaE,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G,UAAU;IAD9B,aAAa,CAAC,aAAa,CAAC;GACR,UAAU,CA4E9B;eA5EoB,UAAU","sourcesContent":["import { html, LitElement } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { emitEvent } from '../../utilities/misc/events';\nimport { stylesBase } from './styles';\nimport { TypeStatus } from './types';\n\n/**\n * @since 1.4.0\n * @status stable\n *\n * @tagname kemet-alert\n * @summary Calls out important messages and notifications.\n *\n * @prop {boolean} opened - Determines if the alert is opened or not.\n * @prop {boolean} reveal - Fades in the alert when opened.\n * @prop {boolean} closable - Adds a close button to the alert.\n * @prop {string} borderStatus - Adds a border that indicates the status.\n * @prop {boolean} hidden - Hides the element from document flow.\n * @prop {string} overlay - Fixes the alert over content in specified position.\n *\n * @slot default - The contents of the alert.\n *\n * @event kemet-alert-opened - Fires when alert is opened.\n * @event kemet-alert-closed - Fires when alert is closed.\n *\n * @csspart close - Container for the close button.\n *\n * @cssproperty --kemet-alert-padding - The padding on the alert.\n * @cssproperty --kemet-alert-border-thickness - The thickness of the border.\n * @cssproperty --kemet-alert-status-color - The status color. Default: inherit.\n * @cssproperty --kemet-alert-align-items - The alert's alignment.\n * @cssproperty --kemet-alert-border - The border around the alert.\n *\n */\n\n@customElement('kemet-alert')\nexport default class KemetAlert extends LitElement {\n static styles = [stylesBase];\n\n @property({ type: Boolean, reflect: true })\n opened: boolean;\n\n @property({ type: Boolean, reflect: true })\n reveal: boolean;\n\n @property({ type: Boolean, reflect: true })\n closable: boolean;\n\n @property({ type: String, reflect: true })\n status: TypeStatus = 'standard';\n\n @property({ type: String, reflect: true, attribute: 'border-status' })\n borderStatus: string;\n\n @property({ type: Boolean, reflect: true })\n hidden: boolean;\n\n @property({ type: String, reflect: true })\n overlay: string;\n\n shouldUpdate(prevProps: Map<string, never>) {\n if (prevProps.has('opened') && !prevProps.get('opened')) {\n this.hidden = false;\n this.reveal = true;\n }\n\n return true;\n }\n\n firstUpdated() {\n this.handleMotion();\n }\n\n updated(prevProps: Map<string, never>) {\n if (!prevProps.get('opened') && this.opened === true) {\n emitEvent(this, 'kemet-alert-opened', this);\n } else {\n emitEvent(this, 'kemet-alert-closed', this);\n }\n }\n\n render() {\n return html`\n <slot name=\"icon\"></slot>\n <div>\n <slot></slot>\n </div>\n <div class=\"close\" part=\"close\">\n ${this.makeCloseBtn()}\n </div>\n `;\n }\n\n makeCloseBtn() {\n if (this.closable) {\n return html`<kemet-icon icon=\"x-lg\" @click=${() => { this.opened = false; }}></kemet-icon>`;\n }\n\n return null;\n }\n\n handleMotion() {\n this.addEventListener('transitionend', () => {\n if (!this.opened) {\n this.hidden = true;\n }\n });\n\n this.addEventListener('animationend', () => {\n this.reveal = false;\n });\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'kemet-alert': KemetAlert\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kemet-badge.js","sourceRoot":"","sources":["../../../src/components/kemet-badge/kemet-badge.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,
|
|
1
|
+
{"version":3,"file":"kemet-badge.js","sourceRoot":"","sources":["../../../src/components/kemet-badge/kemet-badge.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAGtC;;;;;;;;;;;;;;GAcG;AAGH,IAAqB,UAAU,GAA/B,MAAqB,UAAW,SAAQ,UAAU;IAAlD;;QAIE,WAAM,GAAe,SAAS,CAAC;QAG/B,WAAM,GAAY,KAAK,CAAC;QAGxB,SAAI,GAAY,KAAK,CAAC;QAGtB,kBAAa,GAAW,CAAC,CAAC;IAY5B,CAAC;IAVC,MAAM;QACJ,OAAO,IAAI,CAAA,qBAAqB,GAAG,EAAE,CAAC,IAAI,CAAC,gBAAgB,EAAE,UAAU,CAAC;IAC1E,CAAC;IAED,gBAAgB;QACd,IAAI,IAAI,CAAC,MAAM,EAAE;YACf,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,GAAG,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,aAAa,IAAI,CAAC;YACjE,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,GAAG,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,aAAa,IAAI,CAAC;SACjE;IACH,CAAC;CACF,CAAA;AAxBQ,iBAAM,GAAG,CAAC,UAAU,CAAC,CAAC;AAG7B;IADC,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;0CACG;AAG/B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;0CACnB;AAGxB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;wCACrB;AAGtB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAAC;iDAC9B;AAbP,UAAU;IAD9B,aAAa,CAAC,aAAa,CAAC;GACR,UAAU,CAyB9B;eAzBoB,UAAU","sourcesContent":["import { html, LitElement } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { stylesBase } from './styles';\nimport { TypeStatus } from './types';\n\n/**\n * @since 1.0.0\n * @status stable\n *\n * @tagname kemet-badge\n * @summary Badges display the status of information.\n *\n * @prop {string} status - The status of the badge\n * @prop {boolean} circle - Displays the badge in a circle\n * @prop {boolean} pill - Rounds the corners on the badge\n * @prop {number} circlePadding - Padding on the badge as a circle\n *\n * @cssproperty --kemet-badge-padding - The padding of the badge. Default: 10px.\n *\n */\n\n@customElement('kemet-badge')\nexport default class KemetBadge extends LitElement {\n static styles = [stylesBase];\n\n @property({ reflect: true })\n status: TypeStatus = 'primary';\n\n @property({ type: Boolean, reflect: true })\n circle: boolean = false;\n\n @property({ type: Boolean, reflect: true })\n pill: boolean = false;\n\n @property({ type: Number, attribute: 'circle-padding' })\n circlePadding: number = 0;\n\n render() {\n return html`<slot @slotchange=${() => this.handleSlotChange()}></slot>`;\n }\n\n handleSlotChange() {\n if (this.circle) {\n this.style.height = `${this.offsetWidth + this.circlePadding}px`;\n this.style.width = `${this.offsetWidth + this.circlePadding}px`;\n }\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'kemet-badge': KemetBadge\n }\n}\n"]}
|
|
@@ -9,7 +9,7 @@ import '../kemet-icon/kemet-icon';
|
|
|
9
9
|
* @tagname kemet-button
|
|
10
10
|
* @summary A versatile button that can be used either to submit a form, trigger an action, or link to content.
|
|
11
11
|
*
|
|
12
|
-
* @prop {boolean} active - Determines
|
|
12
|
+
* @prop {boolean} active - Determines if the button is active
|
|
13
13
|
* @prop {boolean} hover - Is true when the button is hovered
|
|
14
14
|
* @prop {boolean} focused - Is true when the button is focused
|
|
15
15
|
* @prop {string} link - The url a button should link too
|
|
@@ -80,7 +80,7 @@ export default class KemetButton extends LitElement {
|
|
|
80
80
|
* @private
|
|
81
81
|
* @param {object} event - event object
|
|
82
82
|
*/
|
|
83
|
-
handleKeyUp(event:
|
|
83
|
+
handleKeyUp(event: KeyboardEvent): void;
|
|
84
84
|
}
|
|
85
85
|
declare global {
|
|
86
86
|
interface HTMLElementTagNameMap {
|
|
@@ -11,7 +11,7 @@ import '../kemet-icon/kemet-icon';
|
|
|
11
11
|
* @tagname kemet-button
|
|
12
12
|
* @summary A versatile button that can be used either to submit a form, trigger an action, or link to content.
|
|
13
13
|
*
|
|
14
|
-
* @prop {boolean} active - Determines
|
|
14
|
+
* @prop {boolean} active - Determines if the button is active
|
|
15
15
|
* @prop {boolean} hover - Is true when the button is hovered
|
|
16
16
|
* @prop {boolean} focused - Is true when the button is focused
|
|
17
17
|
* @prop {string} link - The url a button should link too
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kemet-button.js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I,CAAC,IAAI,CAAC,QAAQ,EAAE;YAC/B,OAAO,IAAI,CAAA;kBACC,IAAI,CAAC,IAAI;;;;;OAKpB,CAAC;SACH;QAED,OAAO,IAAI,CAAA;uDACwC,IAAI,CAAC,QAAQ,kBAAkB,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO;;;;;KAKjH,CAAC;IACJ,CAAC;IAED;;;OAGG;IACH,eAAe;QACb,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;IACpB,CAAC;IAED;;;OAGG;IACH,cAAc;QACZ,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;IAED;;;OAGG;IACH,WAAW;QACT,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;QAEnB,UAAU,CAAC,GAAG,EAAE;YACd,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACtB,CAAC,EAAE,GAAG,CAAC,CAAC;QAER,IAAI,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,QAAQ,CAAC,EAAE;YAC3C,IAAI,CAAC,oBAAoB,CAAC,MAAM,EAAE,CAAC;SACpC;IACH,CAAC;IAED;;;OAGG;IACH,UAAU;QACR,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;QACrB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACpB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;IAED;;;;OAIG;IACH,WAAW,CAAC,
|
|
1
|
+
{"version":3,"file":"kemet-button.js","sourceRoot":"","sources":["../../../src/components/kemet-button/kemet-button.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE5D,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OA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;yCACd;AAGb;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;6CACjB;AAG1B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;6CACjB;AAG1B;IADC,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;4CACM;AAzBf,WAAW;IAD/B,aAAa,CAAC,cAAc,CAAC;GACT,WAAW,CAiH/B;eAjHoB,WAAW","sourcesContent":["import { html, LitElement } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { TypeVariant } from './types';\nimport { stylesBase } from './styles';\nimport { FormSubmitController } from '../../utilities/controllers/forms';\nimport '../kemet-icon/kemet-icon';\n\n/**\n * @since 1.0.0\n * @status stable\n *\n * @tagname kemet-button\n * @summary A versatile button that can be used either to submit a form, trigger an action, or link to content.\n *\n * @prop {boolean} active - Determines if the button is active\n * @prop {boolean} hover - Is true when the button is hovered\n * @prop {boolean} focused - Is true when the button is focused\n * @prop {string} link - The url a button should link too\n * @prop {boolean} outlined - Outline style for a button\n * @prop {boolean} disabled - Determines whether not a button is disabled\n * @prop {string} variant - Controls the type of button. standard | text | circle | rounded | pill\n *\n * @slot left - Allows you to place an icon to the left of the button text.\n * @slot right - Allows you to place an icon to the right of the button text.\n *\n * @csspart button - The button or anchor element.\n *\n * @cssproperty --kemet-button-font-size - The font size.\n * @cssproperty --kemet-button-color - The text color.\n * @cssproperty --kemet-button-width - The width.\n * @cssproperty --kemet-button-height - The height.\n * @cssproperty --kemet-button-border - The border.\n * @cssproperty --kemet-button-border-radius - The border radius.\n * @cssproperty --kemet-button-transition-speed - The transition speed of the hover effect.\n * @cssproperty --kemet-button-background-color - The background color.\n * @cssproperty --kemet-button-hover-brightness - The brightness of the hover effect.\n * @cssproperty --kemet-button-gap - The gap between the button and icons.\n * @cssproperty --kemet-button-padding - The button padding.\n * @cssproperty --kemet-button-hover-decoration - The decoration for a text button's hover.\n * @cssproperty --kemet-button-circle-size - The diameter of a circle button.\n * @cssproperty --kemet-button-rounded-amount - The border radius of the rounded button.\n * @cssproperty --kemet-button-border-width - The width of the outline border.\n * @cssproperty --kemet-button-border-style - The style of the outline border.\n * @cssproperty --kemet-button-border-color - The color of the outline border.\n * @cssproperty --kemet-button-disabled-opacity - The opacity of the disabled state.\n *\n */\n\n@customElement('kemet-button')\nexport default class KemetButton extends LitElement {\n /** @internal */\n formSubmitController: FormSubmitController;\n\n static styles = [stylesBase];\n\n @property({ type: Boolean, reflect: true })\n active: boolean;\n\n @property({ type: Boolean, reflect: true })\n hover: boolean;\n\n @property({ type: Boolean, reflect: true })\n focused: boolean;\n\n @property({ type: String })\n link: string;\n\n @property({ type: Boolean, reflect: true })\n outlined: boolean = false;\n\n @property({ type: Boolean, reflect: true })\n disabled: boolean = false;\n\n @property({ reflect: true })\n variant: TypeVariant = 'standard';\n\n constructor() {\n super();\n\n this.addEventListener('click', this.handleClick.bind(this));\n this.addEventListener('mouseover', this.handleMouseOver.bind(this));\n this.addEventListener('mouseout', this.handleMouseOut.bind(this));\n this.addEventListener('blur', this.handleBlur.bind(this));\n this.addEventListener('keyup', event => this.handleKeyUp(event));\n\n /** @internal */\n this.formSubmitController = new FormSubmitController(this);\n }\n\n render() {\n if (this.link && !this.disabled) {\n return html`\n <a href=${this.link} class=\"button\" role=\"button\" part=\"button\">\n <slot name=\"left\"></slot>\n <slot></slot>\n <slot name=\"right\"></slot>\n </a>\n `;\n }\n\n return html`\n <button class=\"button\" part=\"button\" ?disabled=${this.disabled} aria-disabled=${this.disabled ? 'true' : 'false'}>\n <slot name=\"left\"></slot>\n <slot></slot>\n <slot name=\"right\"></slot>\n </button>\n `;\n }\n\n /**\n * Sets hover to true onMouseOver\n * @private\n */\n handleMouseOver() {\n this.hover = true;\n }\n\n /**\n * Sets hover to false onMouseOut\n * @private\n */\n handleMouseOut() {\n this.hover = false;\n }\n\n /**\n * Handles click behavior\n * @private\n */\n handleClick() {\n this.hover = false;\n this.active = true;\n\n setTimeout(() => {\n this.active = false;\n }, 300);\n\n if (this.shadowRoot.querySelector('button')) {\n this.formSubmitController.submit();\n }\n }\n\n /**\n * Handles blur\n * @private\n */\n handleBlur() {\n this.focused = false;\n this.active = false;\n this.hover = false;\n }\n\n /**\n * Handles keyup\n * @private\n * @param {object} event - event object\n */\n handleKeyUp(event: KeyboardEvent) {\n if (event.key === 'Tab') {\n this.focused = true;\n }\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'kemet-button': KemetButton\n }\n}\n"]}
|
|
@@ -9,7 +9,7 @@ import { LitElement } from 'lit';
|
|
|
9
9
|
* @prop {boolean} center - Centers the elements in the card.
|
|
10
10
|
*
|
|
11
11
|
* @slot default - The contents of the alert.
|
|
12
|
-
* @slot header - The
|
|
12
|
+
* @slot header - The card's header.
|
|
13
13
|
* @slot media - A slot for images, videos, or embeds.
|
|
14
14
|
* @slot caption - Text for the media slot.
|
|
15
15
|
* @slot footer - The card's footer.
|
|
@@ -12,7 +12,7 @@ import { stylesBase } from './styles';
|
|
|
12
12
|
* @prop {boolean} center - Centers the elements in the card.
|
|
13
13
|
*
|
|
14
14
|
* @slot default - The contents of the alert.
|
|
15
|
-
* @slot header - The
|
|
15
|
+
* @slot header - The card's header.
|
|
16
16
|
* @slot media - A slot for images, videos, or embeds.
|
|
17
17
|
* @slot caption - Text for the media slot.
|
|
18
18
|
* @slot footer - The card's footer.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kemet-card.js","sourceRoot":"","sources":["../../../src/components/kemet-card/kemet-card.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAEtC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAGH,IAAqB,SAAS,GAA9B,MAAqB,SAAU,SAAQ,UAAU;IAM/C,MAAM;QACJ,OAAO,IAAI,CAAA;;;;;;;;;;;KAWV,CAAC;IACJ,CAAC;CACF,CAAA;AAnBQ,gBAAM,GAAG,CAAC,UAAU,CAAC,CAAC;AAG7B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;yCAC3B;AAJG,SAAS;IAD7B,aAAa,CAAC,YAAY,CAAC;GACP,SAAS,CAoB7B;eApBoB,SAAS","sourcesContent":["import { html, LitElement } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { stylesBase } from './styles';\n\n/**\n * @since 1.4.0\n * @status stable\n *\n * @tagname kemet-card\n * @summary A highly configurable panel design to display media and information.\n *\n * @prop {boolean} center - Centers the elements in the card.\n *\n * @slot default - The contents of the alert.\n * @slot header - The
|
|
1
|
+
{"version":3,"file":"kemet-card.js","sourceRoot":"","sources":["../../../src/components/kemet-card/kemet-card.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAEtC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAGH,IAAqB,SAAS,GAA9B,MAAqB,SAAU,SAAQ,UAAU;IAM/C,MAAM;QACJ,OAAO,IAAI,CAAA;;;;;;;;;;;KAWV,CAAC;IACJ,CAAC;CACF,CAAA;AAnBQ,gBAAM,GAAG,CAAC,UAAU,CAAC,CAAC;AAG7B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;yCAC3B;AAJG,SAAS;IAD7B,aAAa,CAAC,YAAY,CAAC;GACP,SAAS,CAoB7B;eApBoB,SAAS","sourcesContent":["import { html, LitElement } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { stylesBase } from './styles';\n\n/**\n * @since 1.4.0\n * @status stable\n *\n * @tagname kemet-card\n * @summary A highly configurable panel design to display media and information.\n *\n * @prop {boolean} center - Centers the elements in the card.\n *\n * @slot default - The contents of the alert.\n * @slot header - The card's header.\n * @slot media - A slot for images, videos, or embeds.\n * @slot caption - Text for the media slot.\n * @slot footer - The card's footer.\n *\n *\n * @csspart media - The media area of the card.\n * @csspart body - The main contents of the card.\n *\n * @cssproperty --kemet-card-padding - The space around elements.\n * @cssproperty --kemet-card-border-color - The color of the borders.\n * @cssproperty --kemet-card-color - The color of the text. Default:\n * @cssproperty --kemet-card-max-width - The max width of the card.\n * @cssproperty --kemet-card-border - The border around the card.\n * @cssproperty --kemet-card-border-radius - The border radius of the card.\n * @cssproperty --kemet-card-background-color - The background color.\n * @cssproperty --kemet-card-body-padding - The body spacing.\n * @cssproperty --kemet-card-header-padding - The header spacing.\n * @cssproperty --kemet-card-header-border-bottom - The header border.\n * @cssproperty --kemet-card-caption-color - The caption text color.\n * @cssproperty --kemet-card-caption-padding - The caption spacing.\n * @cssproperty --kemet-card-caption-background-color - The caption background color.\n * @cssproperty --kemet-card-footer-padding - The footer spacing.\n * @cssproperty --kemet-card-footer-border-top - The footer border.\n *\n */\n\n@customElement('kemet-card')\nexport default class KemetCard extends LitElement {\n static styles = [stylesBase];\n\n @property({ type: Boolean, reflect: true })\n center: boolean;\n\n render() {\n return html`\n <slot name=\"header\"></slot>\n <div class=\"media\" part=\"media\">\n <slot name=\"media\"></slot>\n <slot name=\"caption\"></slot>\n </div>\n <div class=\"body\" part=\"body\">\n <slot></slot>\n </div>\n </div>\n <slot name=\"footer\"></slot>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'kemet-card': KemetCard\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kemet-carousel-current.js","sourceRoot":"","sources":["../../../src/components/kemet-carousel/kemet-carousel-current.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAGnE;;;;;;;;;;GAUG;AAGH,IAAqB,oBAAoB,GAAzC,MAAqB,oBAAqB,SAAQ,UAAU;
|
|
1
|
+
{"version":3,"file":"kemet-carousel-current.js","sourceRoot":"","sources":["../../../src/components/kemet-carousel/kemet-carousel-current.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAGnE;;;;;;;;;;GAUG;AAGH,IAAqB,oBAAoB,GAAzC,MAAqB,oBAAqB,SAAQ,UAAU;IAe1D,YAAY;QACV,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC;IACjD,CAAC;IAED,OAAO;;QACL,IAAI,CAAC,OAAO,GAAG,CAAA,MAAA,IAAI,CAAC,QAAQ,0CAAE,KAAe,IAAG,CAAC,CAAC;IACpD,CAAC;IAED,MAAM;QACJ,OAAO,IAAI,CAAA,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC;IAC/B,CAAC;CACF,CAAA;AAzBQ,2BAAM,GAAG;IACd,GAAG,CAAA;;;;KAIF;CACF,CAAC;AAGF;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;qDACX;AAGhB;IADC,KAAK,EAAE;sDACuB;AAbZ,oBAAoB;IADxC,aAAa,CAAC,wBAAwB,CAAC;GACnB,oBAAoB,CA0BxC;eA1BoB,oBAAoB","sourcesContent":["import { html, css, LitElement } from 'lit';\nimport { customElement, property, state } from 'lit/decorators.js';\nimport type KemetCarousel from './kemet-carousel';\n\n/**\n *\n * @since 1.1.0\n * @status stable\n *\n * @tagname kemet-carousel-current\n * @summary Displays the active slide number.\n *\n * @prop {number} current - The current slide number.\n *\n */\n\n@customElement('kemet-carousel-current')\nexport default class KemetCarouselCurrent extends LitElement {\n static styles = [\n css`\n :host {\n display: inline-block;\n }\n `,\n ];\n\n @property({ type: Number })\n current: number;\n\n @state()\n carousel: KemetCarousel | null;\n\n firstUpdated() {\n this.carousel = this.closest('kemet-carousel');\n }\n\n updated() {\n this.current = this.carousel?.index as number + 1;\n }\n\n render() {\n return html`${this.current}`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'kemet-carousel-current': KemetCarouselCurrent\n }\n}\n"]}
|
|
@@ -8,7 +8,7 @@ import { emitEvent } from '../../utilities/misc/events';
|
|
|
8
8
|
* @status stable
|
|
9
9
|
*
|
|
10
10
|
* @tagname kemet-carousel-last
|
|
11
|
-
* @summary A link to the last slide in the carousel
|
|
11
|
+
* @summary A link to the last slide in the carousel.
|
|
12
12
|
*
|
|
13
13
|
* @prop {boolean} disabled - Deactivates the button.
|
|
14
14
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kemet-carousel-last.js","sourceRoot":"","sources":["../../../src/components/kemet-carousel/kemet-carousel-last.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAExD;;;;;;;;;;;;GAYG;AAGH,IAAqB,iBAAiB,GAAtC,MAAqB,iBAAkB,SAAQ,UAAU;IAgBvD,MAAM;QACJ,OAAO,IAAI,CAAA;kCACmB,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,WAAW,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE;;;KAG1E,CAAC;IACJ,CAAC;IAED,IAAI;QACF,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;YAClB,SAAS,CAAC,IAAI,EAAE,qBAAqB,EAAE,IAAI,CAAC,CAAC;SAC9C;IACH,CAAC;CACF,CAAA;AA5BQ,wBAAM,GAAG;IACd,GAAG,CAAA;;;;;;;;KAQF;CACF,CAAC;AAGF;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;mDACzB;AAdC,iBAAiB;IADrC,aAAa,CAAC,qBAAqB,CAAC;GAChB,iBAAiB,CA6BrC;eA7BoB,iBAAiB","sourcesContent":["import { html, css, LitElement } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { emitEvent } from '../../utilities/misc/events';\n\n/**\n *\n * @since 1.1.0\n * @status stable\n *\n * @tagname kemet-carousel-last\n * @summary A link to the last slide in the carousel
|
|
1
|
+
{"version":3,"file":"kemet-carousel-last.js","sourceRoot":"","sources":["../../../src/components/kemet-carousel/kemet-carousel-last.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAExD;;;;;;;;;;;;GAYG;AAGH,IAAqB,iBAAiB,GAAtC,MAAqB,iBAAkB,SAAQ,UAAU;IAgBvD,MAAM;QACJ,OAAO,IAAI,CAAA;kCACmB,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,WAAW,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE;;;KAG1E,CAAC;IACJ,CAAC;IAED,IAAI;QACF,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;YAClB,SAAS,CAAC,IAAI,EAAE,qBAAqB,EAAE,IAAI,CAAC,CAAC;SAC9C;IACH,CAAC;CACF,CAAA;AA5BQ,wBAAM,GAAG;IACd,GAAG,CAAA;;;;;;;;KAQF;CACF,CAAC;AAGF;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;mDACzB;AAdC,iBAAiB;IADrC,aAAa,CAAC,qBAAqB,CAAC;GAChB,iBAAiB,CA6BrC;eA7BoB,iBAAiB","sourcesContent":["import { html, css, LitElement } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { emitEvent } from '../../utilities/misc/events';\n\n/**\n *\n * @since 1.1.0\n * @status stable\n *\n * @tagname kemet-carousel-last\n * @summary A link to the last slide in the carousel.\n *\n * @prop {boolean} disabled - Deactivates the button.\n *\n * @event kemet-carousel-last\n *\n */\n\n@customElement('kemet-carousel-last')\nexport default class KemetCarouselLast extends LitElement {\n static styles = [\n css`\n :host {\n cursor: pointer;\n }\n\n :host([disabled]) {\n cursor: not-allowed;\n }\n `,\n ];\n\n @property({ type: Boolean, reflect: true })\n disabled: boolean;\n\n render() {\n return html`\n <span tabindex=\"0\" @keyup=${() => this.last()} @click=${() => this.last()}>\n <slot></slot>\n </span>\n `;\n }\n\n last() {\n if (!this.disabled) {\n emitEvent(this, 'kemet-carousel-last', this);\n }\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'kemet-carousel-last': KemetCarouselLast\n }\n}\n"]}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { LitElement } from 'lit';
|
|
2
|
+
import type KemetCarouselLink from './kemet-carousel-link';
|
|
3
|
+
import type KemetCarouselSlide from './kemet-carousel-slide';
|
|
2
4
|
/**
|
|
3
5
|
*
|
|
4
6
|
* @since 1.1.0
|
|
@@ -12,11 +14,11 @@ import { LitElement } from 'lit';
|
|
|
12
14
|
* @prop {string} sliderWidth - The width of the slider.
|
|
13
15
|
* @prop {string} sliderTranslateX - The X position of the slider.
|
|
14
16
|
* @prop {boolean} inner - Displays the toolbar inside the carousel container.
|
|
15
|
-
* @prop {boolean} arrows - Determines whether
|
|
17
|
+
* @prop {boolean} arrows - Determines whether to display arrows.
|
|
16
18
|
* @prop {object} options - Default options for the carousel.
|
|
17
19
|
* @prop {object} breakpoints - Options at different breakpoints for the carousel. Is mobile first.
|
|
18
20
|
*
|
|
19
|
-
* @event kemet-carousel-change-start - Fires
|
|
21
|
+
* @event kemet-carousel-change-start - Fires when the slide has begun to change.
|
|
20
22
|
* @event kemet-carousel-change-finished - Fires when a slide has changed and finished animating
|
|
21
23
|
*
|
|
22
24
|
* @slot slides - Place the slide elements here.
|
|
@@ -58,17 +60,19 @@ export default class KemetCarousel extends LitElement {
|
|
|
58
60
|
options: object;
|
|
59
61
|
breakpoints: object;
|
|
60
62
|
/** @internal */
|
|
61
|
-
slides:
|
|
63
|
+
slides: KemetCarouselSlide[];
|
|
62
64
|
/** @internal */
|
|
63
|
-
links:
|
|
65
|
+
links: KemetCarouselLink[];
|
|
64
66
|
/** @internal */
|
|
65
67
|
toolbarSlotElement: HTMLElement | null;
|
|
66
68
|
/** @internal */
|
|
67
69
|
informationElement: HTMLElement | null;
|
|
68
70
|
/** @internal */
|
|
69
|
-
swipeMove: (event:
|
|
71
|
+
swipeMove: (event: TouchEvent | MouseEvent) => void;
|
|
70
72
|
/** @internal */
|
|
71
|
-
handleSlideShow:
|
|
73
|
+
handleSlideShow: () => void;
|
|
74
|
+
/** @internal */
|
|
75
|
+
slideShowID: number;
|
|
72
76
|
/** @internal */
|
|
73
77
|
startX: number;
|
|
74
78
|
/** @internal */
|
|
@@ -85,11 +89,11 @@ export default class KemetCarousel extends LitElement {
|
|
|
85
89
|
toolbarElement: HTMLElement;
|
|
86
90
|
constructor();
|
|
87
91
|
firstUpdated(): void;
|
|
88
|
-
updated(prevProps:
|
|
92
|
+
updated(prevProps: Map<string, never>): void;
|
|
89
93
|
render(): import("lit-html").TemplateResult<1>;
|
|
90
|
-
swipeStart(event:
|
|
91
|
-
swipeEnd(event:
|
|
92
|
-
swipeUpdate(event:
|
|
94
|
+
swipeStart(event: TouchEvent | MouseEvent): void;
|
|
95
|
+
swipeEnd(event: TouchEvent | MouseEvent): void;
|
|
96
|
+
swipeUpdate(event: TouchEvent | MouseEvent): number;
|
|
93
97
|
swipeLeave(): void;
|
|
94
98
|
setSlideSize(): void;
|
|
95
99
|
setToolbarSize(): void;
|
|
@@ -100,12 +104,12 @@ export default class KemetCarousel extends LitElement {
|
|
|
100
104
|
handleLast(): void;
|
|
101
105
|
handleNext(): void;
|
|
102
106
|
handlePrev(): void;
|
|
103
|
-
updateIndex(newIndex:
|
|
107
|
+
updateIndex(newIndex: number): void;
|
|
104
108
|
updateInformation(): void;
|
|
105
|
-
goToSlide(index:
|
|
109
|
+
goToSlide(index: number): void;
|
|
106
110
|
handleTransitionEnd(): void;
|
|
107
|
-
handleLink(event:
|
|
108
|
-
getOption(option:
|
|
111
|
+
handleLink(event: CustomEvent): void;
|
|
112
|
+
getOption(option: string): any;
|
|
109
113
|
}
|
|
110
114
|
declare global {
|
|
111
115
|
interface HTMLElementTagNameMap {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
2
|
import { html, LitElement } from 'lit';
|
|
3
|
-
import { customElement, property, state, query } from 'lit/decorators.js';
|
|
3
|
+
import { customElement, property, state, query, } from 'lit/decorators.js';
|
|
4
4
|
import { emitEvent } from '../../utilities/misc/events';
|
|
5
5
|
import { stylesCarousel } from './styles';
|
|
6
6
|
/**
|
|
@@ -16,11 +16,11 @@ import { stylesCarousel } from './styles';
|
|
|
16
16
|
* @prop {string} sliderWidth - The width of the slider.
|
|
17
17
|
* @prop {string} sliderTranslateX - The X position of the slider.
|
|
18
18
|
* @prop {boolean} inner - Displays the toolbar inside the carousel container.
|
|
19
|
-
* @prop {boolean} arrows - Determines whether
|
|
19
|
+
* @prop {boolean} arrows - Determines whether to display arrows.
|
|
20
20
|
* @prop {object} options - Default options for the carousel.
|
|
21
21
|
* @prop {object} breakpoints - Options at different breakpoints for the carousel. Is mobile first.
|
|
22
22
|
*
|
|
23
|
-
* @event kemet-carousel-change-start - Fires
|
|
23
|
+
* @event kemet-carousel-change-start - Fires when the slide has begun to change.
|
|
24
24
|
* @event kemet-carousel-change-finished - Fires when a slide has changed and finished animating
|
|
25
25
|
*
|
|
26
26
|
* @slot slides - Place the slide elements here.
|
|
@@ -105,16 +105,16 @@ let KemetCarousel = class KemetCarousel extends LitElement {
|
|
|
105
105
|
// methods
|
|
106
106
|
this.swipeMove = (event) => {
|
|
107
107
|
event.preventDefault();
|
|
108
|
-
|
|
108
|
+
let pageX;
|
|
109
|
+
if ('touches' in event) {
|
|
110
|
+
pageX = event.touches[0].pageX;
|
|
111
|
+
}
|
|
112
|
+
else {
|
|
113
|
+
pageX = event.pageX;
|
|
114
|
+
}
|
|
109
115
|
const currentSlide = this.slides[this.index];
|
|
110
116
|
this.sliderTranslateX = `${pageX - this.startX - currentSlide.offsetLeft}px`;
|
|
111
117
|
};
|
|
112
|
-
this.handleSlideShow = () => {
|
|
113
|
-
if (this.getOption('slideshow') > 0) {
|
|
114
|
-
this.updateIndex(this.index + 1);
|
|
115
|
-
clearTimeout(this.handleSlideShow);
|
|
116
|
-
}
|
|
117
|
-
};
|
|
118
118
|
// setup
|
|
119
119
|
this.setSlideSize();
|
|
120
120
|
this.goToSlide(this.index);
|
|
@@ -124,7 +124,12 @@ let KemetCarousel = class KemetCarousel extends LitElement {
|
|
|
124
124
|
this.setToolbarSize();
|
|
125
125
|
if (prevProps.has('index')) {
|
|
126
126
|
this.updateIndex(this.index);
|
|
127
|
-
|
|
127
|
+
this.slideShowID = window.setTimeout(() => {
|
|
128
|
+
if (this.getOption('slideshow') > 0) {
|
|
129
|
+
this.updateIndex(this.index + 1);
|
|
130
|
+
clearTimeout(this.slideShowID);
|
|
131
|
+
}
|
|
132
|
+
}, this.getOption('slideshow') * 1000);
|
|
128
133
|
}
|
|
129
134
|
}
|
|
130
135
|
render() {
|
|
@@ -151,7 +156,12 @@ let KemetCarousel = class KemetCarousel extends LitElement {
|
|
|
151
156
|
`;
|
|
152
157
|
}
|
|
153
158
|
swipeStart(event) {
|
|
154
|
-
|
|
159
|
+
if ('touches' in event) {
|
|
160
|
+
this.startX = event.touches[0].pageX;
|
|
161
|
+
}
|
|
162
|
+
else {
|
|
163
|
+
this.startX = event.pageX;
|
|
164
|
+
}
|
|
155
165
|
this.addEventListener('mousemove', this.swipeMove);
|
|
156
166
|
this.addEventListener('touchmove', this.swipeMove);
|
|
157
167
|
}
|
|
@@ -161,7 +171,13 @@ let KemetCarousel = class KemetCarousel extends LitElement {
|
|
|
161
171
|
this.removeEventListener('touchmove', this.swipeMove, false);
|
|
162
172
|
}
|
|
163
173
|
swipeUpdate(event) {
|
|
164
|
-
|
|
174
|
+
let pageX;
|
|
175
|
+
if ('changedTouches' in event) {
|
|
176
|
+
pageX = event.changedTouches[0].pageX;
|
|
177
|
+
}
|
|
178
|
+
else {
|
|
179
|
+
pageX = event.pageX;
|
|
180
|
+
}
|
|
165
181
|
const direction = this.startX > pageX ? 'right' : 'left';
|
|
166
182
|
const threshold = this.slidesElement.offsetWidth / 3;
|
|
167
183
|
const diff = this.startX - pageX;
|
|
@@ -382,6 +398,9 @@ __decorate([
|
|
|
382
398
|
__decorate([
|
|
383
399
|
state()
|
|
384
400
|
], KemetCarousel.prototype, "handleSlideShow", void 0);
|
|
401
|
+
__decorate([
|
|
402
|
+
state()
|
|
403
|
+
], KemetCarousel.prototype, "slideShowID", void 0);
|
|
385
404
|
__decorate([
|
|
386
405
|
state()
|
|
387
406
|
], KemetCarousel.prototype, "startX", void 0);
|