@crowdstrike/glide-core 0.9.1 → 0.9.3
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/dist/accordion.stories.d.ts +2 -4
- package/dist/accordion.styles.js +2 -4
- package/dist/button-group.button.styles.js +3 -8
- package/dist/button-group.stories.d.ts +2 -6
- package/dist/button-group.styles.js +2 -2
- package/dist/button.d.ts +12 -1
- package/dist/button.js +1 -1
- package/dist/button.stories.d.ts +2 -12
- package/dist/button.styles.js +2 -4
- package/dist/button.test.basics.js +47 -165
- package/dist/button.test.events.js +86 -10
- package/dist/checkbox-group.stories.d.ts +2 -3
- package/dist/checkbox.js +1 -1
- package/dist/checkbox.stories.d.ts +2 -6
- package/dist/checkbox.styles.js +43 -6
- package/dist/checkbox.test.form.js +16 -0
- package/dist/checkbox.test.interactions.js +8 -0
- package/dist/drawer.js +1 -1
- package/dist/drawer.stories.d.ts +1 -1
- package/dist/dropdown.d.ts +4 -2
- package/dist/dropdown.js +1 -1
- package/dist/dropdown.option.js +1 -1
- package/dist/dropdown.option.styles.js +2 -0
- package/dist/dropdown.stories.d.ts +4 -10
- package/dist/dropdown.styles.js +47 -29
- package/dist/dropdown.test.focus.filterable.js +20 -0
- package/dist/dropdown.test.focus.js +1 -0
- package/dist/dropdown.test.form.js +23 -112
- package/dist/dropdown.test.interactions.filterable.js +121 -17
- package/dist/dropdown.test.interactions.multiple.js +15 -22
- package/dist/dropdown.test.interactions.single.js +44 -22
- package/dist/form-controls-layout.stories.d.ts +1 -1
- package/dist/icon-button.d.ts +1 -1
- package/dist/icon-button.stories.d.ts +1 -3
- package/dist/icon-button.styles.js +2 -4
- package/dist/icons/checked.d.ts +5 -0
- package/dist/icons/checked.js +1 -1
- package/dist/input.d.ts +1 -1
- package/dist/input.js +1 -1
- package/dist/input.stories.d.ts +2 -13
- package/dist/input.styles.d.ts +1 -1
- package/dist/input.styles.js +93 -93
- package/dist/input.test.basics.js +45 -45
- package/dist/input.test.form.js +17 -0
- package/dist/label.styles.js +6 -11
- package/dist/library/localize.test.js +45 -0
- package/dist/menu.button.styles.js +1 -0
- package/dist/menu.js +1 -1
- package/dist/menu.link.styles.js +1 -0
- package/dist/menu.stories.d.ts +1 -1
- package/dist/menu.styles.js +3 -1
- package/dist/menu.test.events.js +1 -97
- package/dist/menu.test.focus.js +26 -3
- package/dist/menu.test.interactions.js +3 -0
- package/dist/modal.d.ts +0 -7
- package/dist/modal.icon-button.test.basics.js +9 -9
- package/dist/modal.stories.d.ts +3 -5
- package/dist/modal.styles.js +2 -4
- package/dist/modal.tertiary-icon.test.basics.js +14 -14
- package/dist/modal.test.accessibility.js +16 -27
- package/dist/modal.test.basics.js +64 -68
- package/dist/modal.test.close.js +12 -16
- package/dist/modal.test.events.js +32 -44
- package/dist/modal.test.lock-scroll.js +15 -25
- package/dist/modal.test.methods.js +8 -12
- package/dist/modal.test.scrollbars.js +2 -4
- package/dist/radio-group.js +1 -1
- package/dist/radio-group.stories.d.ts +2 -3
- package/dist/radio-group.test.basics.js +3 -3
- package/dist/radio-group.test.events.js +6 -6
- package/dist/radio-group.test.form.js +19 -0
- package/dist/radio.styles.js +2 -6
- package/dist/split-button.stories.d.ts +3 -8
- package/dist/split-button.styles.js +2 -4
- package/dist/split-container.styles.js +2 -4
- package/dist/status-indicator.stories.d.ts +1 -13
- package/dist/styles/focus-outline.d.ts +1 -1
- package/dist/styles/focus-outline.js +7 -1
- package/dist/styles/opacity-and-scale-animation.d.ts +2 -0
- package/dist/styles/opacity-and-scale-animation.js +24 -0
- package/dist/styles/variables.css +1 -1
- package/dist/styles/visually-hidden.d.ts +1 -1
- package/dist/styles/visually-hidden.js +14 -1
- package/dist/tab.group.d.ts +6 -6
- package/dist/tab.group.js +1 -1
- package/dist/tab.group.styles.js +46 -5
- package/dist/tab.group.test.basics.js +9 -2
- package/dist/tab.group.test.interactions.js +70 -93
- package/dist/tab.js +1 -1
- package/dist/tab.panel.styles.js +3 -9
- package/dist/tab.styles.js +6 -13
- package/dist/tab.test.basics.js +15 -17
- package/dist/tabs.stories.d.ts +2 -2
- package/dist/tag.js +1 -1
- package/dist/tag.stories.d.ts +2 -4
- package/dist/tag.styles.js +2 -4
- package/dist/tag.test.basics.js +28 -27
- package/dist/tag.test.events.js +3 -3
- package/dist/tag.test.focus.js +4 -4
- package/dist/textarea.d.ts +1 -1
- package/dist/textarea.stories.d.ts +1 -8
- package/dist/textarea.styles.d.ts +1 -1
- package/dist/textarea.styles.js +63 -67
- package/dist/textarea.test.basics.js +52 -52
- package/dist/toasts.d.ts +5 -0
- package/dist/toasts.stories.d.ts +1 -1
- package/dist/toasts.styles.js +1 -1
- package/dist/toggle.stories.d.ts +1 -4
- package/dist/toggle.styles.js +2 -1
- package/dist/toggle.test.interactions.js +11 -0
- package/dist/tooltip.js +1 -1
- package/dist/tooltip.styles.js +16 -30
- package/dist/tooltip.test.interactions.js +6 -6
- package/dist/translations/en.js +1 -1
- package/dist/translations/fr.d.ts +3 -1
- package/dist/translations/fr.js +1 -1
- package/dist/translations/ja.d.ts +3 -1
- package/dist/translations/ja.js +1 -1
- package/dist/tree.item.styles.js +11 -3
- package/dist/tree.item.test.basics.js +0 -30
- package/dist/tree.stories.d.ts +0 -9
- package/package.json +1 -3
- package/dist/button.test.form.d.ts +0 -1
- package/dist/button.test.form.js +0 -50
- package/dist/input.test.translations.js +0 -38
- package/dist/tag.test.translations.d.ts +0 -1
- package/dist/tag.test.translations.js +0 -25
- package/dist/textarea.test.translations.d.ts +0 -1
- package/dist/textarea.test.translations.js +0 -34
- /package/dist/{input.test.translations.d.ts → library/localize.test.d.ts} +0 -0
@@ -3,7 +3,5 @@ import './icons/storybook.js';
|
|
3
3
|
import type { Meta, StoryObj } from '@storybook/web-components';
|
4
4
|
declare const meta: Meta;
|
5
5
|
export default meta;
|
6
|
-
export declare const
|
7
|
-
export declare const
|
8
|
-
export declare const WithSuffix: StoryObj;
|
9
|
-
export declare const WithPrefixAndSuffix: StoryObj;
|
6
|
+
export declare const Accordion: StoryObj;
|
7
|
+
export declare const WithIcons: StoryObj;
|
package/dist/accordion.styles.js
CHANGED
@@ -1,4 +1,6 @@
|
|
1
1
|
import{css}from"lit";import focusOutline from"./styles/focus-outline.js";export default[css`
|
2
|
+
${focusOutline(".summary:focus-visible")}
|
3
|
+
`,css`
|
2
4
|
.component {
|
3
5
|
border-radius: 0.625rem;
|
4
6
|
box-shadow: var(--glide-core-shadow-sm);
|
@@ -24,10 +26,6 @@ import{css}from"lit";import focusOutline from"./styles/focus-outline.js";export
|
|
24
26
|
outline: none;
|
25
27
|
}
|
26
28
|
|
27
|
-
&:focus-visible {
|
28
|
-
${focusOutline};
|
29
|
-
}
|
30
|
-
|
31
29
|
&::marker,
|
32
30
|
&::-webkit-details-marker {
|
33
31
|
display: none;
|
@@ -1,4 +1,7 @@
|
|
1
1
|
import{css}from"lit";import focusOutline from"./styles/focus-outline.js";import visuallyHidden from"./styles/visually-hidden.js";export default[css`
|
2
|
+
${focusOutline(".component:focus-visible")}
|
3
|
+
${visuallyHidden(".label.visually-hidden")}
|
4
|
+
`,css`
|
2
5
|
:host(:first-of-type) {
|
3
6
|
.component {
|
4
7
|
&.horizontal {
|
@@ -58,8 +61,6 @@ import{css}from"lit";import focusOutline from"./styles/focus-outline.js";import
|
|
58
61
|
background-color: var(--glide-core-surface-selected);
|
59
62
|
border-color: var(--glide-core-border-focus);
|
60
63
|
color: var(--glide-core-color-white);
|
61
|
-
|
62
|
-
${focusOutline};
|
63
64
|
outline-offset: 2px;
|
64
65
|
|
65
66
|
/* Create a stacking context so the outline isn't obscured by other elements. */
|
@@ -115,10 +116,4 @@ import{css}from"lit";import focusOutline from"./styles/focus-outline.js";import
|
|
115
116
|
}
|
116
117
|
}
|
117
118
|
}
|
118
|
-
|
119
|
-
.label {
|
120
|
-
&.visually-hidden {
|
121
|
-
${visuallyHidden};
|
122
|
-
}
|
123
|
-
}
|
124
119
|
`];
|
@@ -4,9 +4,5 @@ import './icons/storybook.js';
|
|
4
4
|
import type { Meta, StoryObj } from '@storybook/web-components';
|
5
5
|
declare const meta: Meta;
|
6
6
|
export default meta;
|
7
|
-
export declare const
|
8
|
-
export declare const
|
9
|
-
export declare const DefaultWithPrefixIcon: StoryObj;
|
10
|
-
export declare const DefaultWithOrientationVerticalPrefixIcon: StoryObj;
|
11
|
-
export declare const DefaultWithIconOnly: StoryObj;
|
12
|
-
export declare const DefaultWithOrientationVerticalOnlyIcon: StoryObj;
|
7
|
+
export declare const ButtonGroup: StoryObj;
|
8
|
+
export declare const WithIcons: StoryObj;
|
@@ -1,4 +1,6 @@
|
|
1
1
|
import{css}from"lit";import visuallyHidden from"./styles/visually-hidden.js";export default[css`
|
2
|
+
${visuallyHidden(".label")}
|
3
|
+
`,css`
|
2
4
|
.component {
|
3
5
|
border: 1px solid var(--glide-core-border-base);
|
4
6
|
border-radius: 0.75rem;
|
@@ -13,8 +15,6 @@ import{css}from"lit";import visuallyHidden from"./styles/visually-hidden.js";exp
|
|
13
15
|
checking for the entire component.
|
14
16
|
*/
|
15
17
|
color: var(--glide-core-color-white);
|
16
|
-
|
17
|
-
${visuallyHidden};
|
18
18
|
}
|
19
19
|
|
20
20
|
.container {
|
package/dist/button.d.ts
CHANGED
@@ -20,11 +20,22 @@ export default class GlideCoreButton extends LitElement {
|
|
20
20
|
ariaExpanded: 'true' | 'false' | null;
|
21
21
|
ariaHasPopup: 'true' | 'false' | 'menu' | 'listbox' | 'tree' | 'grid' | 'dialog' | null;
|
22
22
|
ariaControls: string | null;
|
23
|
+
autofocus: boolean;
|
23
24
|
disabled: boolean;
|
25
|
+
formAction: string;
|
26
|
+
formEncType: '' | 'application/x-www-form-urlencoded' | 'multipart/form-data' | 'text/plain';
|
27
|
+
formMethod: '' | 'dialog' | 'get' | 'post';
|
28
|
+
formNoValidate: boolean;
|
29
|
+
formTarget: '' | '_blank' | '_parent' | '_self' | '_top';
|
30
|
+
name: string;
|
31
|
+
popoverTarget?: string;
|
32
|
+
popoverTargetAction: '' | 'hide' | 'show' | 'toggle';
|
33
|
+
size: 'large' | 'small';
|
24
34
|
type: 'button' | 'submit' | 'reset';
|
35
|
+
value: string;
|
25
36
|
variant: 'primary' | 'secondary' | 'tertiary';
|
26
|
-
size: 'large' | 'small';
|
27
37
|
get form(): HTMLFormElement | null;
|
38
|
+
click(): void;
|
28
39
|
firstUpdated(): void;
|
29
40
|
render(): import("lit").TemplateResult<1>;
|
30
41
|
constructor();
|
package/dist/button.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
var __decorate=this&&this.__decorate||function(t,e,o,
|
1
|
+
var __decorate=this&&this.__decorate||function(t,e,o,r){var i,a=arguments.length,l=a<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(t,e,o,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(l=(a<3?i(l):a>3?i(e,o,l):i(e,o))||l);return a>3&&l&&Object.defineProperty(e,o,l),l};import{LitElement,html}from"lit";import{classMap}from"lit/directives/class-map.js";import{createRef,ref}from"lit/directives/ref.js";import{customElement,property,state}from"lit/decorators.js";import{ifDefined}from"lit/directives/if-defined.js";import{owSlot}from"./library/ow.js";import styles from"./button.styles.js";let GlideCoreButton=class GlideCoreButton extends LitElement{static{this.formAssociated=!0}static{this.shadowRootOptions={...LitElement.shadowRootOptions,delegatesFocus:!0,mode:"closed"}}static{this.styles=styles}get form(){return this.#t.form}click(){this.#e.value?.click()}firstUpdated(){owSlot(this.#o.value)}render(){return html`<button aria-controls="${ifDefined(this.ariaControls??void 0)}" aria-expanded="${ifDefined(this.ariaExpanded??void 0)}" aria-haspopup="${ifDefined(this.ariaHasPopup??void 0)}" ?autofocus="${this.autofocus}" class="${classMap({component:!0,primary:"primary"===this.variant,secondary:"secondary"===this.variant,tertiary:"tertiary"===this.variant,large:"large"===this.size,small:"small"===this.size,"has-prefix":this.hasPrefixSlot,"has-suffix":this.hasSuffixSlot})}" ?disabled="${this.disabled}" @click="${this.#r}" ${ref(this.#e)}><slot name="prefix" @slotchange="${this.#i}" ${ref(this.#a)}></slot><slot @slotchange="${this.#l}" ${ref(this.#o)}></slot><slot name="suffix" @slotchange="${this.#s}" ${ref(this.#n)}></slot></button>`}constructor(){super(),this.ariaExpanded=null,this.ariaHasPopup=null,this.ariaControls=null,this.autofocus=!1,this.disabled=!1,this.formAction="",this.formEncType="",this.formMethod="",this.formNoValidate=!1,this.formTarget="",this.name="",this.popoverTargetAction="",this.size="large",this.type="button",this.value="",this.variant="primary",this.hasPrefixSlot=!1,this.hasSuffixSlot=!1,this.#e=createRef(),this.#o=createRef(),this.#a=createRef(),this.#n=createRef(),this.#t=this.attachInternals()}#e;#o;#t;#a;#n;#r(){"submit"!==this.type?"reset"!==this.type||this.form?.reset():this.form?.requestSubmit()}#l(){owSlot(this.#o.value)}#i(){const t=this.#a.value?.assignedNodes();this.hasPrefixSlot=Boolean(t&&t.length>0)}#s(){const t=this.#n.value?.assignedNodes();this.hasSuffixSlot=Boolean(t&&t.length>0)}};__decorate([property({attribute:"aria-expanded",reflect:!0})],GlideCoreButton.prototype,"ariaExpanded",void 0),__decorate([property({attribute:"aria-haspopup",reflect:!0})],GlideCoreButton.prototype,"ariaHasPopup",void 0),__decorate([property({attribute:"aria-controls",reflect:!0})],GlideCoreButton.prototype,"ariaControls",void 0),__decorate([property({type:Boolean,reflect:!0})],GlideCoreButton.prototype,"autofocus",void 0),__decorate([property({type:Boolean,reflect:!0})],GlideCoreButton.prototype,"disabled",void 0),__decorate([property({attribute:"formaction",reflect:!0})],GlideCoreButton.prototype,"formAction",void 0),__decorate([property({attribute:"formenctype",reflect:!0})],GlideCoreButton.prototype,"formEncType",void 0),__decorate([property({attribute:"formmethod",reflect:!0})],GlideCoreButton.prototype,"formMethod",void 0),__decorate([property({attribute:"formnovalidate",type:Boolean,reflect:!0})],GlideCoreButton.prototype,"formNoValidate",void 0),__decorate([property({attribute:"formtarget",reflect:!0})],GlideCoreButton.prototype,"formTarget",void 0),__decorate([property({reflect:!0})],GlideCoreButton.prototype,"name",void 0),__decorate([property({attribute:"popovertarget",reflect:!0})],GlideCoreButton.prototype,"popoverTarget",void 0),__decorate([property({attribute:"popovertargetaction",reflect:!0})],GlideCoreButton.prototype,"popoverTargetAction",void 0),__decorate([property({reflect:!0})],GlideCoreButton.prototype,"size",void 0),__decorate([property({reflect:!0})],GlideCoreButton.prototype,"type",void 0),__decorate([property({reflect:!0})],GlideCoreButton.prototype,"value",void 0),__decorate([property({reflect:!0})],GlideCoreButton.prototype,"variant",void 0),__decorate([state()],GlideCoreButton.prototype,"hasPrefixSlot",void 0),__decorate([state()],GlideCoreButton.prototype,"hasSuffixSlot",void 0),GlideCoreButton=__decorate([customElement("glide-core-button")],GlideCoreButton);export default GlideCoreButton;
|
package/dist/button.stories.d.ts
CHANGED
@@ -3,15 +3,5 @@ import './icons/storybook.js';
|
|
3
3
|
import type { Meta, StoryObj } from '@storybook/web-components';
|
4
4
|
declare const meta: Meta;
|
5
5
|
export default meta;
|
6
|
-
export declare const
|
7
|
-
export declare const
|
8
|
-
export declare const PrimaryWithSuffixIcon: StoryObj;
|
9
|
-
export declare const PrimaryWithPrefixAndSuffixIcons: StoryObj;
|
10
|
-
export declare const Secondary: StoryObj;
|
11
|
-
export declare const SecondaryWithPrefixIcon: StoryObj;
|
12
|
-
export declare const SecondaryWithSuffixIcon: StoryObj;
|
13
|
-
export declare const SecondaryWithPrefixAndSuffixIcons: StoryObj;
|
14
|
-
export declare const Tertiary: StoryObj;
|
15
|
-
export declare const TertiaryWithPrefixIcon: StoryObj;
|
16
|
-
export declare const TertiaryWithSuffixIcon: StoryObj;
|
17
|
-
export declare const TertiaryWithPrefixAndSuffixIcons: StoryObj;
|
6
|
+
export declare const Button: StoryObj;
|
7
|
+
export declare const WithIcons: StoryObj;
|
package/dist/button.styles.js
CHANGED
@@ -1,4 +1,6 @@
|
|
1
1
|
import{css}from"lit";import focusOutline from"./styles/focus-outline.js";export default[css`
|
2
|
+
${focusOutline(".component:focus-visible")}
|
3
|
+
`,css`
|
2
4
|
:host {
|
3
5
|
/* Contains elements with "padding" and "width". Inline by default. */
|
4
6
|
display: inline-block;
|
@@ -28,10 +30,6 @@ import{css}from"lit";import focusOutline from"./styles/focus-outline.js";export
|
|
28
30
|
outline: none;
|
29
31
|
}
|
30
32
|
|
31
|
-
&:focus-visible {
|
32
|
-
${focusOutline};
|
33
|
-
}
|
34
|
-
|
35
33
|
&:disabled {
|
36
34
|
cursor: not-allowed;
|
37
35
|
opacity: 1;
|
@@ -1,7 +1,7 @@
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-unused-expressions */
|
2
2
|
import './button.js';
|
3
3
|
import { ArgumentError } from 'ow';
|
4
|
-
import {
|
4
|
+
import { expect, fixture, html } from '@open-wc/testing';
|
5
5
|
import GlideCoreButton from './button.js';
|
6
6
|
import sinon from 'sinon';
|
7
7
|
GlideCoreButton.shadowRootOptions.mode = 'open';
|
@@ -16,179 +16,45 @@ it('has defaults', async () => {
|
|
16
16
|
const component = await fixture(html `
|
17
17
|
<glide-core-button>Button</glide-core-button>
|
18
18
|
`);
|
19
|
+
expect(component.ariaControls).to.be.null;
|
20
|
+
expect(component.ariaExpanded).to.be.null;
|
21
|
+
expect(component.ariaHasPopup).to.be.null;
|
22
|
+
expect(component.autofocus).to.be.false;
|
23
|
+
expect(component.disabled).to.be.false;
|
24
|
+
expect(component.formAction).to.be.empty.string;
|
25
|
+
expect(component.formEncType).to.be.empty.string;
|
26
|
+
expect(component.formMethod).to.be.empty.string;
|
27
|
+
expect(component.formNoValidate).to.be.false;
|
28
|
+
expect(component.name).to.be.empty.string;
|
29
|
+
expect(component.popoverTarget).to.be.undefined;
|
30
|
+
expect(component.popoverTargetAction).to.be.empty.string;
|
31
|
+
expect(component.value).to.be.empty.string;
|
19
32
|
expect(component.type).to.equal('button');
|
20
|
-
expect(component.
|
21
|
-
expect(component.
|
22
|
-
expect(component
|
23
|
-
expect(component
|
24
|
-
expect(component
|
33
|
+
expect(component.hasAttribute('autofocus')).to.be.false;
|
34
|
+
expect(component.getAttribute('aria-controls')).to.be.null;
|
35
|
+
expect(component.getAttribute('aria-expanded')).to.be.null;
|
36
|
+
expect(component.getAttribute('aria-haspopup')).to.be.null;
|
37
|
+
expect(component.hasAttribute('disabled')).to.be.false;
|
38
|
+
expect(component.getAttribute('formaction')).to.be.empty.string;
|
39
|
+
expect(component.getAttribute('formenctype')).to.be.empty.string;
|
40
|
+
expect(component.getAttribute('formmethod')).to.be.empty.string;
|
41
|
+
expect(component.hasAttribute('formnovalidate')).to.be.false;
|
42
|
+
expect(component.getAttribute('name')).to.be.empty.string;
|
43
|
+
expect(component.getAttribute('popovertarget')).to.be.null;
|
44
|
+
expect(component.getAttribute('popovertargetaction')).to.be.empty.string;
|
45
|
+
expect(component.getAttribute('type')).to.equal('button');
|
46
|
+
expect(component.getAttribute('value')).to.be.empty.string;
|
25
47
|
const button = component.shadowRoot?.querySelector('button');
|
26
|
-
expect(button?.getAttribute('
|
27
|
-
expect(button?.
|
28
|
-
expect(button?.
|
29
|
-
expect(button?.ariaHasPopup).to.equal(null);
|
48
|
+
expect(button?.getAttribute('aria-controls')).to.be.null;
|
49
|
+
expect(button?.ariaExpanded).to.be.null;
|
50
|
+
expect(button?.ariaHasPopup).to.be.null;
|
30
51
|
expect(button?.disabled).to.equal(false);
|
31
|
-
expect([...button.classList]).to.deep.equal([
|
32
|
-
'component',
|
33
|
-
'primary',
|
34
|
-
'large',
|
35
|
-
]);
|
36
52
|
});
|
37
53
|
it('delegates focus', async () => {
|
38
54
|
const component = await fixture(html `<glide-core-button>Button</glide-core-button>`);
|
39
55
|
component.focus();
|
40
56
|
expect(component.shadowRoot?.activeElement).to.equal(component.shadowRoot?.querySelector('button'));
|
41
57
|
});
|
42
|
-
it('renders a secondary variant', async () => {
|
43
|
-
const component = await fixture(html `
|
44
|
-
<glide-core-button variant="secondary">Button</glide-core-button>
|
45
|
-
`);
|
46
|
-
expect([
|
47
|
-
...component.shadowRoot.querySelector('button').classList,
|
48
|
-
]).to.deep.equal(['component', 'secondary', 'large']);
|
49
|
-
});
|
50
|
-
it('renders a tertiary variant', async () => {
|
51
|
-
const component = await fixture(html `
|
52
|
-
<glide-core-button variant="tertiary">Button</glide-core-button>
|
53
|
-
`);
|
54
|
-
expect([
|
55
|
-
...component.shadowRoot.querySelector('button').classList,
|
56
|
-
]).to.deep.equal(['component', 'tertiary', 'large']);
|
57
|
-
});
|
58
|
-
it('sets the size to "large" by default', async () => {
|
59
|
-
const component = await fixture(html `
|
60
|
-
<glide-core-button>Button</glide-core-button>
|
61
|
-
`);
|
62
|
-
expect(component.size).to.equal('large');
|
63
|
-
expect([
|
64
|
-
...component.shadowRoot.querySelector('button').classList,
|
65
|
-
]).to.deep.equal(['component', 'primary', 'large']);
|
66
|
-
});
|
67
|
-
it('sets the size attribute to "large"', async () => {
|
68
|
-
const component = await fixture(html `
|
69
|
-
<glide-core-button size="large">Button</glide-core-button>
|
70
|
-
`);
|
71
|
-
expect(component.size).to.equal('large');
|
72
|
-
expect([
|
73
|
-
...component.shadowRoot.querySelector('button').classList,
|
74
|
-
]).to.deep.equal(['component', 'primary', 'large']);
|
75
|
-
});
|
76
|
-
it('sets the size attribute to "small"', async () => {
|
77
|
-
const component = await fixture(html `
|
78
|
-
<glide-core-button size="small">Button</glide-core-button>
|
79
|
-
`);
|
80
|
-
expect(component.size).to.equal('small');
|
81
|
-
expect([
|
82
|
-
...component.shadowRoot.querySelector('button').classList,
|
83
|
-
]).to.deep.equal(['component', 'primary', 'small']);
|
84
|
-
});
|
85
|
-
it('sets the disabled attribute', async () => {
|
86
|
-
const component = await fixture(html `
|
87
|
-
<glide-core-button disabled>Button</glide-core-button>
|
88
|
-
`);
|
89
|
-
expect(component.disabled).to.equal(true);
|
90
|
-
expect(component.shadowRoot.querySelector('button')?.disabled).to.equal(true);
|
91
|
-
});
|
92
|
-
it('sets the type attribute to "submit"', async () => {
|
93
|
-
const component = await fixture(html `
|
94
|
-
<glide-core-button type="submit">Button</glide-core-button>
|
95
|
-
`);
|
96
|
-
expect(component.type).to.equal('submit');
|
97
|
-
expect(component.shadowRoot.querySelector('button')?.getAttribute('type')).to.equal('submit');
|
98
|
-
});
|
99
|
-
it('sets the type attribute to "reset"', async () => {
|
100
|
-
const component = await fixture(html `
|
101
|
-
<glide-core-button type="reset">Button</glide-core-button>
|
102
|
-
`);
|
103
|
-
expect(component.type).to.equal('reset');
|
104
|
-
expect(component.shadowRoot?.querySelector('button')?.getAttribute('type')).to.equal('reset');
|
105
|
-
});
|
106
|
-
it('renders with a prefix slot', async () => {
|
107
|
-
const component = await fixture(html `
|
108
|
-
<glide-core-button>
|
109
|
-
<span slot="prefix" data-prefix>prefix</span>
|
110
|
-
Button
|
111
|
-
</glide-core-button>
|
112
|
-
`);
|
113
|
-
expect([
|
114
|
-
...component.shadowRoot.querySelector('button').classList,
|
115
|
-
]).to.deep.equal(['component', 'primary', 'large', 'has-prefix']);
|
116
|
-
expect(document.querySelector('[data-prefix]')).to.be.ok;
|
117
|
-
});
|
118
|
-
it('renders with a suffix slot', async () => {
|
119
|
-
const component = await fixture(html `
|
120
|
-
<glide-core-button>
|
121
|
-
Button
|
122
|
-
<span slot="suffix" data-suffix>suffix</span>
|
123
|
-
</glide-core-button>
|
124
|
-
`);
|
125
|
-
expect([
|
126
|
-
...component.shadowRoot.querySelector('button').classList,
|
127
|
-
]).to.deep.equal(['component', 'primary', 'large', 'has-suffix']);
|
128
|
-
expect(document.querySelector('[data-suffix]')).to.be.ok;
|
129
|
-
});
|
130
|
-
it('renders with a prefix and suffix slot when both are present initially', async () => {
|
131
|
-
const component = await fixture(html `
|
132
|
-
<glide-core-button>
|
133
|
-
<span slot="prefix" data-prefix>prefix</span>
|
134
|
-
Button
|
135
|
-
<span slot="suffix" data-suffix>suffix</span>
|
136
|
-
</glide-core-button>
|
137
|
-
`);
|
138
|
-
expect([
|
139
|
-
...component.shadowRoot.querySelector('button').classList,
|
140
|
-
]).to.deep.equal([
|
141
|
-
'component',
|
142
|
-
'primary',
|
143
|
-
'large',
|
144
|
-
'has-prefix',
|
145
|
-
'has-suffix',
|
146
|
-
]);
|
147
|
-
expect(document.querySelector('[data-prefix]')).to.be.ok;
|
148
|
-
expect(document.querySelector('[data-suffix]')).to.be.ok;
|
149
|
-
});
|
150
|
-
it('renders with prefix and suffix classes when both are dynamically added', async () => {
|
151
|
-
const component = await fixture(html `
|
152
|
-
<glide-core-button>Button</glide-core-button>
|
153
|
-
`);
|
154
|
-
const prefix = document.createElement('span');
|
155
|
-
prefix.setAttribute('slot', 'prefix');
|
156
|
-
prefix.dataset.prefix = undefined;
|
157
|
-
prefix.textContent = 'prefix';
|
158
|
-
component.append(prefix);
|
159
|
-
const suffix = document.createElement('span');
|
160
|
-
suffix.setAttribute('slot', 'suffix');
|
161
|
-
prefix.dataset.suffix = undefined;
|
162
|
-
suffix.textContent = 'suffix';
|
163
|
-
component.append(suffix);
|
164
|
-
await elementUpdated(component);
|
165
|
-
expect([
|
166
|
-
...component.shadowRoot.querySelector('button').classList,
|
167
|
-
]).to.deep.equal([
|
168
|
-
'component',
|
169
|
-
'primary',
|
170
|
-
'large',
|
171
|
-
'has-prefix',
|
172
|
-
'has-suffix',
|
173
|
-
]);
|
174
|
-
expect(document.querySelector('[data-prefix]')).to.be.ok;
|
175
|
-
expect(document.querySelector('[data-suffix]')).to.be.ok;
|
176
|
-
});
|
177
|
-
it('renders without prefix and suffix classes after both are removed', async () => {
|
178
|
-
const component = await fixture(html `
|
179
|
-
<glide-core-button>
|
180
|
-
<span slot="prefix">prefix</span>
|
181
|
-
Button
|
182
|
-
<span slot="suffix">suffix</span>
|
183
|
-
</glide-core-button>
|
184
|
-
`);
|
185
|
-
component.querySelector('[slot="prefix"]')?.remove();
|
186
|
-
component.querySelector('[slot="suffix"]')?.remove();
|
187
|
-
await elementUpdated(component);
|
188
|
-
expect([
|
189
|
-
...component.shadowRoot.querySelector('button').classList,
|
190
|
-
]).to.deep.equal(['component', 'primary', 'large']);
|
191
|
-
});
|
192
58
|
it('throws if it does not have a default slot', async () => {
|
193
59
|
const spy = sinon.spy();
|
194
60
|
try {
|
@@ -201,3 +67,19 @@ it('throws if it does not have a default slot', async () => {
|
|
201
67
|
}
|
202
68
|
expect(spy.callCount).to.equal(1);
|
203
69
|
});
|
70
|
+
it('`#onPrefixSlotChange` coverage', async () => {
|
71
|
+
await fixture(html `
|
72
|
+
<glide-core-button>
|
73
|
+
<span slot="prefix">Prefix</span>
|
74
|
+
Button
|
75
|
+
</glide-core-button>
|
76
|
+
`);
|
77
|
+
});
|
78
|
+
it('`#onSuffixSlotChange` coverage', async () => {
|
79
|
+
await fixture(html `
|
80
|
+
<glide-core-button>
|
81
|
+
Button
|
82
|
+
<span slot="suffix">Suffix</span>
|
83
|
+
</glide-core-button>
|
84
|
+
`);
|
85
|
+
});
|
@@ -4,23 +4,99 @@ import { expect, fixture, html, oneEvent } from '@open-wc/testing';
|
|
4
4
|
import { sendKeys } from '@web/test-runner-commands';
|
5
5
|
import GlideCoreButton from './button.js';
|
6
6
|
GlideCoreButton.shadowRootOptions.mode = 'open';
|
7
|
-
it('dispatches
|
7
|
+
it('dispatches a "click" event when clicked', async () => {
|
8
8
|
const component = await fixture(html `
|
9
9
|
<glide-core-button type="button">Button</glide-core-button>
|
10
10
|
`);
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
11
|
+
setTimeout(() => {
|
12
|
+
component.click();
|
13
|
+
});
|
14
|
+
const event = await oneEvent(component, 'click');
|
15
|
+
expect(event instanceof PointerEvent).to.be.true;
|
16
|
+
expect(event.bubbles).to.be.true;
|
17
|
+
});
|
18
|
+
it('dispatches a "click" event on Enter', async () => {
|
19
|
+
const component = await fixture(html `
|
20
|
+
<glide-core-button type="button">Button</glide-core-button>
|
21
|
+
`);
|
22
|
+
component.focus();
|
23
|
+
sendKeys({ press: 'Enter' });
|
24
|
+
const event = await oneEvent(component, 'click');
|
25
|
+
expect(event instanceof PointerEvent).to.be.true;
|
26
|
+
expect(event.bubbles).to.be.true;
|
15
27
|
});
|
16
|
-
it('dispatches
|
28
|
+
it('dispatches a "click" event on Space', async () => {
|
17
29
|
const component = await fixture(html `
|
18
30
|
<glide-core-button type="button">Button</glide-core-button>
|
19
31
|
`);
|
20
|
-
const keyDownEvent = oneEvent(component, 'keydown');
|
21
32
|
component.focus();
|
22
|
-
|
23
|
-
const event = await
|
33
|
+
sendKeys({ press: ' ' });
|
34
|
+
const event = await oneEvent(component, 'click');
|
35
|
+
expect(event instanceof PointerEvent).to.be.true;
|
36
|
+
expect(event.bubbles).to.be.true;
|
37
|
+
});
|
38
|
+
it('dispatches a "reset" event on click', async () => {
|
39
|
+
const form = document.createElement('form');
|
40
|
+
const component = await fixture(html ` <glide-core-button type="reset">Button</glide-core-button> `, {
|
41
|
+
parentNode: form,
|
42
|
+
});
|
43
|
+
setTimeout(() => {
|
44
|
+
component.click();
|
45
|
+
});
|
46
|
+
const event = await oneEvent(form, 'reset');
|
47
|
+
expect(event instanceof Event).to.be.true;
|
48
|
+
});
|
49
|
+
it('dispatches a "reset" event on Enter', async () => {
|
50
|
+
const form = document.createElement('form');
|
51
|
+
const component = await fixture(html ` <glide-core-button type="reset">Button</glide-core-button> `, {
|
52
|
+
parentNode: form,
|
53
|
+
});
|
54
|
+
component.focus();
|
55
|
+
sendKeys({ press: 'Enter' });
|
56
|
+
const event = await oneEvent(form, 'reset');
|
57
|
+
expect(event instanceof Event).to.be.true;
|
58
|
+
});
|
59
|
+
it('dispatches a "reset" event on Space', async () => {
|
60
|
+
const form = document.createElement('form');
|
61
|
+
const component = await fixture(html ` <glide-core-button type="reset">Button</glide-core-button> `, {
|
62
|
+
parentNode: form,
|
63
|
+
});
|
64
|
+
component.focus();
|
65
|
+
sendKeys({ press: ' ' });
|
66
|
+
const event = await oneEvent(form, 'reset');
|
67
|
+
expect(event instanceof Event).to.be.true;
|
68
|
+
});
|
69
|
+
it('dispatches a "submit" event on click', async () => {
|
70
|
+
const form = document.createElement('form');
|
71
|
+
const component = await fixture(html ` <glide-core-button type="submit">Button</glide-core-button> `, {
|
72
|
+
parentNode: form,
|
73
|
+
});
|
74
|
+
form.addEventListener('submit', (event) => event.preventDefault());
|
75
|
+
setTimeout(() => {
|
76
|
+
component.click();
|
77
|
+
});
|
78
|
+
const event = await oneEvent(form, 'submit');
|
79
|
+
expect(event instanceof Event).to.be.true;
|
80
|
+
});
|
81
|
+
it('dispatches a "submit" event on Enter', async () => {
|
82
|
+
const form = document.createElement('form');
|
83
|
+
const component = await fixture(html ` <glide-core-button type="submit">Button</glide-core-button> `, {
|
84
|
+
parentNode: form,
|
85
|
+
});
|
86
|
+
form.addEventListener('submit', (event) => event.preventDefault());
|
87
|
+
component.focus();
|
88
|
+
sendKeys({ press: 'Enter' });
|
89
|
+
const event = await oneEvent(form, 'submit');
|
90
|
+
expect(event instanceof Event).to.be.true;
|
91
|
+
});
|
92
|
+
it('dispatches a "submit" event on Space', async () => {
|
93
|
+
const form = document.createElement('form');
|
94
|
+
const component = await fixture(html ` <glide-core-button type="submit">Button</glide-core-button> `, {
|
95
|
+
parentNode: form,
|
96
|
+
});
|
97
|
+
form.addEventListener('submit', (event) => event.preventDefault());
|
98
|
+
component.focus();
|
99
|
+
sendKeys({ press: ' ' });
|
100
|
+
const event = await oneEvent(form, 'submit');
|
24
101
|
expect(event instanceof Event).to.be.true;
|
25
|
-
expect(event.key).to.equal('Enter');
|
26
102
|
});
|
@@ -2,6 +2,5 @@ import './checkbox.js';
|
|
2
2
|
import type { Meta, StoryObj } from '@storybook/web-components';
|
3
3
|
declare const meta: Meta;
|
4
4
|
export default meta;
|
5
|
-
export declare const
|
6
|
-
export declare const
|
7
|
-
export declare const VerticalWithError: StoryObj;
|
5
|
+
export declare const CheckboxGroup: StoryObj;
|
6
|
+
export declare const WithError: StoryObj;
|
package/dist/checkbox.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
var __decorate=this&&this.__decorate||function(e,t,i,o){var r,a=arguments.length,s=a<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,o);else for(var l=e.length-1;l>=0;l--)(r=e[l])&&(s=(a<3?r(s):a>3?r(t,i,s):r(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s};import"./label.js";import"./tooltip.js";import{LitElement,html}from"lit";import{classMap}from"lit/directives/class-map.js";import{createRef,ref}from"lit/directives/ref.js";import{customElement,property,state}from"lit/decorators.js";import{ifDefined}from"lit/directives/if-defined.js";import{when}from"lit/directives/when.js";import checkedIcon from"./icons/checked.js";import styles from"./checkbox.styles.js";const indeterminateIcon=html`<svg width="14" height="14" viewBox="0 0 14 14" fill="none" class="indeterminate-icon"><rect x="0.5" y="0.5" width="13" height="13" rx="3.5"/><path d="M3 5C3 3.89543 3.89543 3 5 3H9.79289C10.2383 3 10.4614 3.53857 10.1464 3.85355L3.85355 10.1464C3.53857 10.4614 3 10.2383 3 9.79289V5Z" fill="currentColor"/></svg>`;let GlideCoreCheckbox=class GlideCoreCheckbox extends LitElement{static{this.formAssociated=!0}static{this.shadowRootOptions={...LitElement.shadowRootOptions,mode:"closed"}}static{this.styles=styles}get label(){return this.#e}set label(e){this.#e=e,setTimeout((()=>{this.#t()}))}get form(){return this.#i.form}blur(){this.#o.value?.blur()}checkValidity(){this.isCheckingValidity=!0;const e=this.#i.checkValidity();return this.isCheckingValidity=!1,e}click(){this.#o.value?.click()}connectedCallback(){super.connectedCallback(),this.#r=new IntersectionObserver((()=>{this.checkVisibility()&&this.#t()})),this.#r.observe(this)}disconnectedCallback(){super.disconnectedCallback(),this.form?.removeEventListener("formdata",this.#a),this.#r?.disconnect()}get validity(){return"minimal"===this.privateVariant||(this.required&&!this.checked?this.#i.setValidity({valueMissing:!0}," ",this.#o.value):this.#i.setValidity({})),this.#i.validity}focus(e){this.#o.value?.focus(e)}formAssociatedCallback(){this.form?.addEventListener("formdata",this.#a)}formResetCallback(){this.checked=""===this.getAttribute("checked"),this.indeterminate=""===this.getAttribute("indeterminate")}render(){return html`<div class="component" data-test="component">${when("minimal"===this.privateVariant,(()=>html`<label class="label-and-input-and-checkbox" part="private-label-and-input-and-checkbox"><div class="input-and-checkbox"><input aria-invalid="${this.#s}" data-test="input" type="checkbox" .checked="${this.checked}" .inert="${this.internallyInert}" ?disabled="${this.disabled}" ?required="${this.required}" @change="${this.#l}" @input="${this.#l}" ${ref(this.#o)}><div class="${classMap({checkbox:!0,disabled:this.disabled,error:this.#s})}"><div class="checked-icon">${checkedIcon}</div>${indeterminateIcon}</div></div><glide-core-tooltip class="label-tooltip" offset="${this.privateLabelTooltipOffset}" ?disabled="${!this.isLabelOverflow}" ?open="${this.privateShowLabelTooltip}"><div aria-hidden="true" data-test="tooltip">${this.label}</div><div class="label" slot="target" ${ref(this.#
|
1
|
+
var __decorate=this&&this.__decorate||function(e,t,i,o){var r,a=arguments.length,s=a<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,o);else for(var l=e.length-1;l>=0;l--)(r=e[l])&&(s=(a<3?r(s):a>3?r(t,i,s):r(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s};import"./label.js";import"./tooltip.js";import{LitElement,html}from"lit";import{classMap}from"lit/directives/class-map.js";import{createRef,ref}from"lit/directives/ref.js";import{customElement,property,state}from"lit/decorators.js";import{ifDefined}from"lit/directives/if-defined.js";import{when}from"lit/directives/when.js";import checkedIcon from"./icons/checked.js";import styles from"./checkbox.styles.js";const indeterminateIcon=html`<svg width="14" height="14" viewBox="0 0 14 14" fill="none" class="indeterminate-icon"><rect x="0.5" y="0.5" width="13" height="13" rx="3.5"/><path d="M3 5C3 3.89543 3.89543 3 5 3H9.79289C10.2383 3 10.4614 3.53857 10.1464 3.85355L3.85355 10.1464C3.53857 10.4614 3 10.2383 3 9.79289V5Z" fill="currentColor"/></svg>`;let GlideCoreCheckbox=class GlideCoreCheckbox extends LitElement{static{this.formAssociated=!0}static{this.shadowRootOptions={...LitElement.shadowRootOptions,mode:"closed"}}static{this.styles=styles}get label(){return this.#e}set label(e){this.#e=e,setTimeout((()=>{this.#t()}))}get form(){return this.#i.form}blur(){this.#o.value?.blur()}checkValidity(){this.isCheckingValidity=!0;const e=this.#i.checkValidity();return this.isCheckingValidity=!1,e}click(){this.#o.value?.click()}connectedCallback(){super.connectedCallback(),this.#r=new IntersectionObserver((()=>{this.checkVisibility()&&this.#t()})),this.#r.observe(this)}disconnectedCallback(){super.disconnectedCallback(),this.form?.removeEventListener("formdata",this.#a),this.#r?.disconnect()}get validity(){return"minimal"===this.privateVariant||(this.required&&!this.checked?this.#i.setValidity({valueMissing:!0}," ",this.#o.value):this.#i.setValidity({})),this.#i.validity}focus(e){this.#o.value?.focus(e)}formAssociatedCallback(){this.form?.addEventListener("formdata",this.#a)}formResetCallback(){this.checked=""===this.getAttribute("checked"),this.indeterminate=""===this.getAttribute("indeterminate")}render(){return html`<div class="component" data-test="component">${when("minimal"===this.privateVariant,(()=>html`<label class="label-and-input-and-checkbox" part="private-label-and-input-and-checkbox"><div class="input-and-checkbox"><input aria-invalid="${this.#s}" data-test="input" type="checkbox" .checked="${this.checked}" .inert="${this.internallyInert}" ?disabled="${this.disabled}" ?required="${this.required}" @change="${this.#l}" @input="${this.#l}" @keydown="${this.#n}" ${ref(this.#o)}><div class="${classMap({checkbox:!0,disabled:this.disabled,error:this.#s})}"><div class="checked-icon">${checkedIcon}</div>${indeterminateIcon}</div></div><glide-core-tooltip class="label-tooltip" offset="${this.privateLabelTooltipOffset}" ?disabled="${!this.isLabelOverflow}" ?open="${this.privateShowLabelTooltip}"><div aria-hidden="true" data-test="tooltip">${this.label}</div><div class="label" slot="target" ${ref(this.#d)}>${this.label}</div></glide-core-tooltip></label>`),(()=>html`<glide-core-private-label orientation="${this.orientation}" split="${ifDefined(this.privateSplit??void 0)}" ?disabled="${this.disabled}" ?error="${this.#s}" ?hide="${this.hideLabel}" ?required="${this.required}"><slot name="tooltip" slot="tooltip"></slot><label for="input">${this.label}</label><div class="input-and-checkbox" slot="control"><input aria-describedby="summary description" aria-invalid="${this.#s}" data-test="input" id="input" type="checkbox" .checked="${this.checked}" ?disabled="${this.disabled}" ?required="${this.required}" @blur="${this.#h}" @change="${this.#l}" @input="${this.#l}" @keydown="${this.#n}" ${ref(this.#o)}><div class="${classMap({checkbox:!0,disabled:this.disabled,error:this.#s})}"><div class="checked-icon">${checkedIcon}</div>${indeterminateIcon}</div></div><div id="summary" slot="summary">${this.summary}</div><slot id="description" name="description" slot="description"></slot></glide-core-private-label>`))}</div>`}reportValidity(){this.isReportValidityOrSubmit=!0;const e=this.#i.reportValidity();return this.requestUpdate(),e}setValidity(e,t,i){return this.#i.setValidity(e,t,i)}get willValidate(){return this.#i.willValidate}updated(){this.#o.value&&(this.#o.value.indeterminate=this.indeterminate)}constructor(){super(),this.checked=!1,this.internallyInert=!1,this.disabled=!1,this.hideLabel=!1,this.indeterminate=!1,this.orientation="horizontal",this.privateLabelTooltipOffset=4,this.privateShowLabelTooltip=!1,this.required=!1,this.value="",this.isReportValidityOrSubmit=!1,this.isBlurring=!1,this.isCheckingValidity=!1,this.isLabelOverflow=!1,this.#o=createRef(),this.#e="",this.#d=createRef(),this.#a=({formData:e})=>{this.checked&&this.name&&this.value&&!this.disabled&&e.append(this.name,this.value)},this.#i=this.attachInternals(),this.addEventListener("invalid",(e=>{if(e?.preventDefault(),this.isCheckingValidity||this.isBlurring)return;this.isReportValidityOrSubmit=!0;this.form?.querySelector(":invalid")===this&&this.focus()}))}#o;#i;#r;#e;#d;#a;get#s(){return"minimal"===this.privateVariant?!this.validity.valid&&this.isReportValidityOrSubmit:this.required&&!this.disabled&&!this.validity.valid&&this.isReportValidityOrSubmit}#h(){this.isBlurring=!0,this.reportValidity(),this.isBlurring=!1}#l(e){e.target instanceof HTMLInputElement&&(this.checked=e.target.checked),this.indeterminate=!1,"change"===e.type&&this.dispatchEvent(new Event(e.type,e))}#n(e){"Enter"===e.key&&this.form?.requestSubmit()}#t(){this.#d.value&&(this.isLabelOverflow=this.#d.value.scrollWidth>this.#d.value.clientWidth)}};__decorate([property({type:Boolean})],GlideCoreCheckbox.prototype,"checked",void 0),__decorate([property({attribute:"internally-inert",type:Boolean})],GlideCoreCheckbox.prototype,"internallyInert",void 0),__decorate([property({reflect:!0,type:Boolean})],GlideCoreCheckbox.prototype,"disabled",void 0),__decorate([property({attribute:"hide-label",type:Boolean})],GlideCoreCheckbox.prototype,"hideLabel",void 0),__decorate([property({type:Boolean})],GlideCoreCheckbox.prototype,"indeterminate",void 0),__decorate([property({reflect:!0})],GlideCoreCheckbox.prototype,"label",null),__decorate([property({reflect:!0})],GlideCoreCheckbox.prototype,"orientation",void 0),__decorate([property({reflect:!0})],GlideCoreCheckbox.prototype,"name",void 0),__decorate([property({attribute:"private-label-tooltip-offset",reflect:!0,type:Number})],GlideCoreCheckbox.prototype,"privateLabelTooltipOffset",void 0),__decorate([property({attribute:"private-show-label-tooltip",reflect:!0,type:Boolean})],GlideCoreCheckbox.prototype,"privateShowLabelTooltip",void 0),__decorate([property()],GlideCoreCheckbox.prototype,"privateSplit",void 0),__decorate([property({attribute:"private-variant"})],GlideCoreCheckbox.prototype,"privateVariant",void 0),__decorate([property({reflect:!0,type:Boolean})],GlideCoreCheckbox.prototype,"required",void 0),__decorate([property({reflect:!0})],GlideCoreCheckbox.prototype,"summary",void 0),__decorate([property({reflect:!0})],GlideCoreCheckbox.prototype,"value",void 0),__decorate([state()],GlideCoreCheckbox.prototype,"isReportValidityOrSubmit",void 0),__decorate([state()],GlideCoreCheckbox.prototype,"isBlurring",void 0),__decorate([state()],GlideCoreCheckbox.prototype,"isCheckingValidity",void 0),__decorate([state()],GlideCoreCheckbox.prototype,"isLabelOverflow",void 0),GlideCoreCheckbox=__decorate([customElement("glide-core-checkbox")],GlideCoreCheckbox);export default GlideCoreCheckbox;
|
@@ -1,9 +1,5 @@
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/web-components';
|
2
2
|
declare const meta: Meta;
|
3
3
|
export default meta;
|
4
|
-
export declare const
|
5
|
-
export declare const
|
6
|
-
export declare const HorizontalWithError: StoryObj;
|
7
|
-
export declare const Vertical: StoryObj;
|
8
|
-
export declare const VerticalWithTooltip: StoryObj;
|
9
|
-
export declare const VerticalWithError: StoryObj;
|
4
|
+
export declare const Checkbox: StoryObj;
|
5
|
+
export declare const WithError: StoryObj;
|