@digital-realty/ix-icon-button 1.0.40 → 1.0.42-alpha.0

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.
@@ -1,54 +1,54 @@
1
- import { LitElement } from 'lit';
2
- import '@material/web/iconbutton/icon-button.js';
3
- import '@material/web/iconbutton/filled-icon-button.js';
4
- import '@material/web/iconbutton/filled-tonal-icon-button.js';
5
- import '@material/web/iconbutton/outlined-icon-button.js';
6
- import '@digital-realty/ix-icon/ix-icon.js';
7
- import { IconButton } from '@material/web/iconbutton/internal/icon-button';
8
- import { FormSubmitterType } from '@material/web/internal/controller/form-submitter.js';
9
- type LinkTarget = '_blank' | '_parent' | '_self' | '_top';
10
- export type Appearance = 'filled' | 'filled-tonal' | 'outlined' | 'icon-filled' | 'default';
11
- export declare class IxIconButton extends LitElement {
12
- readonly component: IconButton;
13
- appearance: Appearance;
14
- icon: string;
15
- selectedIcon: string;
16
- /**
17
- * Disables the icon button and makes it non-interactive.
18
- */
19
- disabled: boolean;
20
- /**
21
- * Flips the icon if it is in an RTL context at startup.
22
- */
23
- flipIconInRtl: boolean;
24
- /**
25
- * Sets the underlying `HTMLAnchorElement`'s `href` resource attribute.
26
- */
27
- href: string | undefined;
28
- /**
29
- * Sets the underlying `HTMLAnchorElement`'s `target` attribute.
30
- */
31
- target: LinkTarget | '' | undefined;
32
- /**
33
- * The `aria-label` of the button when the button is toggleable and selected.
34
- */
35
- ariaLabelSelected: string | undefined;
36
- /**
37
- * When true, the button will toggle between selected and unselected
38
- * states
39
- */
40
- toggle: boolean;
41
- /**
42
- * Sets the selected state. When false, displays the default icon. When true,
43
- * displays the selected icon, or the default icon If no `slot="selected"`
44
- * icon is provided.
45
- */
46
- selected: boolean;
47
- type: FormSubmitterType;
48
- name: string | undefined;
49
- value: string | undefined;
50
- label: string | undefined;
51
- filledIcon: boolean;
52
- render(): import("lit").TemplateResult<1 | 2>;
53
- }
54
- export {};
1
+ import { LitElement } from 'lit';
2
+ import '@material/web/iconbutton/icon-button.js';
3
+ import '@material/web/iconbutton/filled-icon-button.js';
4
+ import '@material/web/iconbutton/filled-tonal-icon-button.js';
5
+ import '@material/web/iconbutton/outlined-icon-button.js';
6
+ import '@digital-realty/ix-icon/ix-icon.js';
7
+ import { IconButton } from '@material/web/iconbutton/internal/icon-button';
8
+ import { FormSubmitterType } from '@material/web/internal/controller/form-submitter.js';
9
+ type LinkTarget = '_blank' | '_parent' | '_self' | '_top';
10
+ export type Appearance = 'filled' | 'filled-tonal' | 'outlined' | 'icon-filled' | 'default';
11
+ export declare class IxIconButton extends LitElement {
12
+ readonly component: IconButton;
13
+ appearance: Appearance;
14
+ icon: string;
15
+ selectedIcon: string;
16
+ /**
17
+ * Disables the icon button and makes it non-interactive.
18
+ */
19
+ disabled: boolean;
20
+ /**
21
+ * Flips the icon if it is in an RTL context at startup.
22
+ */
23
+ flipIconInRtl: boolean;
24
+ /**
25
+ * Sets the underlying `HTMLAnchorElement`'s `href` resource attribute.
26
+ */
27
+ href: string | undefined;
28
+ /**
29
+ * Sets the underlying `HTMLAnchorElement`'s `target` attribute.
30
+ */
31
+ target: LinkTarget | '' | undefined;
32
+ /**
33
+ * The `aria-label` of the button when the button is toggleable and selected.
34
+ */
35
+ ariaLabelSelected: string | undefined;
36
+ /**
37
+ * When true, the button will toggle between selected and unselected
38
+ * states
39
+ */
40
+ toggle: boolean;
41
+ /**
42
+ * Sets the selected state. When false, displays the default icon. When true,
43
+ * displays the selected icon, or the default icon If no `slot="selected"`
44
+ * icon is provided.
45
+ */
46
+ selected: boolean;
47
+ type: FormSubmitterType;
48
+ name: string | undefined;
49
+ value: string | undefined;
50
+ label: string | undefined;
51
+ filledIcon: boolean;
52
+ render(): import("lit").TemplateResult<1 | 2>;
53
+ }
54
+ export {};
@@ -1,68 +1,68 @@
1
- import { __decorate } from "tslib";
2
- import { html, LitElement, nothing } from 'lit';
3
- import { property, query } from 'lit/decorators.js';
4
- import { literal, html as staticHtml } from 'lit/static-html.js';
5
- import { ifDefined } from 'lit/directives/if-defined.js';
6
- import '@material/web/iconbutton/icon-button.js';
7
- import '@material/web/iconbutton/filled-icon-button.js';
8
- import '@material/web/iconbutton/filled-tonal-icon-button.js';
9
- import '@material/web/iconbutton/outlined-icon-button.js';
10
- import '@digital-realty/ix-icon/ix-icon.js';
11
- export class IxIconButton extends LitElement {
12
- constructor() {
13
- super(...arguments);
14
- this.appearance = 'default';
15
- this.icon = '';
16
- this.selectedIcon = '';
17
- /**
18
- * Disables the icon button and makes it non-interactive.
19
- */
20
- this.disabled = false;
21
- /**
22
- * Flips the icon if it is in an RTL context at startup.
23
- */
24
- this.flipIconInRtl = false;
25
- /**
26
- * Sets the underlying `HTMLAnchorElement`'s `href` resource attribute.
27
- */
28
- this.href = undefined;
29
- /**
30
- * Sets the underlying `HTMLAnchorElement`'s `target` attribute.
31
- */
32
- this.target = undefined;
33
- /**
34
- * The `aria-label` of the button when the button is toggleable and selected.
35
- */
36
- this.ariaLabelSelected = undefined;
37
- /**
38
- * When true, the button will toggle between selected and unselected
39
- * states
40
- */
41
- this.toggle = false;
42
- /**
43
- * Sets the selected state. When false, displays the default icon. When true,
44
- * displays the selected icon, or the default icon If no `slot="selected"`
45
- * icon is provided.
46
- */
47
- this.selected = false;
48
- this.type = 'submit';
49
- this.name = undefined;
50
- this.value = undefined;
51
- this.label = undefined;
52
- this.filledIcon = false;
53
- }
54
- render() {
55
- const ariaLabel = this.label || this.ariaLabel;
56
- let tag = literal `md-icon-button`;
57
- if (this.appearance === 'outlined') {
58
- tag = literal `md-outlined-icon-button`;
59
- }
60
- else if (this.appearance === 'filled') {
61
- tag = literal `md-filled-icon-button`;
62
- }
63
- else if (this.appearance === 'filled-tonal') {
64
- tag = literal `md-filled-tonal-icon-button`;
65
- }
1
+ import { __decorate } from "tslib";
2
+ import { html, LitElement, nothing } from 'lit';
3
+ import { property, query } from 'lit/decorators.js';
4
+ import { literal, html as staticHtml } from 'lit/static-html.js';
5
+ import { ifDefined } from 'lit/directives/if-defined.js';
6
+ import '@material/web/iconbutton/icon-button.js';
7
+ import '@material/web/iconbutton/filled-icon-button.js';
8
+ import '@material/web/iconbutton/filled-tonal-icon-button.js';
9
+ import '@material/web/iconbutton/outlined-icon-button.js';
10
+ import '@digital-realty/ix-icon/ix-icon.js';
11
+ export class IxIconButton extends LitElement {
12
+ constructor() {
13
+ super(...arguments);
14
+ this.appearance = 'default';
15
+ this.icon = '';
16
+ this.selectedIcon = '';
17
+ /**
18
+ * Disables the icon button and makes it non-interactive.
19
+ */
20
+ this.disabled = false;
21
+ /**
22
+ * Flips the icon if it is in an RTL context at startup.
23
+ */
24
+ this.flipIconInRtl = false;
25
+ /**
26
+ * Sets the underlying `HTMLAnchorElement`'s `href` resource attribute.
27
+ */
28
+ this.href = undefined;
29
+ /**
30
+ * Sets the underlying `HTMLAnchorElement`'s `target` attribute.
31
+ */
32
+ this.target = undefined;
33
+ /**
34
+ * The `aria-label` of the button when the button is toggleable and selected.
35
+ */
36
+ this.ariaLabelSelected = undefined;
37
+ /**
38
+ * When true, the button will toggle between selected and unselected
39
+ * states
40
+ */
41
+ this.toggle = false;
42
+ /**
43
+ * Sets the selected state. When false, displays the default icon. When true,
44
+ * displays the selected icon, or the default icon If no `slot="selected"`
45
+ * icon is provided.
46
+ */
47
+ this.selected = false;
48
+ this.type = 'submit';
49
+ this.name = undefined;
50
+ this.value = undefined;
51
+ this.label = undefined;
52
+ this.filledIcon = false;
53
+ }
54
+ render() {
55
+ const ariaLabel = this.label || this.ariaLabel;
56
+ let tag = literal `md-icon-button`;
57
+ if (this.appearance === 'outlined') {
58
+ tag = literal `md-outlined-icon-button`;
59
+ }
60
+ else if (this.appearance === 'filled') {
61
+ tag = literal `md-filled-icon-button`;
62
+ }
63
+ else if (this.appearance === 'filled-tonal') {
64
+ tag = literal `md-filled-tonal-icon-button`;
65
+ }
66
66
  return staticHtml `<${tag}
67
67
  class="button"
68
68
  ?disabled=${this.disabled}
@@ -76,64 +76,64 @@ export class IxIconButton extends LitElement {
76
76
  type=${this.type}
77
77
  name=${ifDefined(this.name)}
78
78
  value=${ifDefined(this.value)}
79
- >${this.icon
80
- ? html `<ix-icon ?filled=${this.filledIcon}>${this.icon}</ix-icon>`
79
+ >${this.icon
80
+ ? html `<ix-icon ?filled=${this.filledIcon}>${this.icon}</ix-icon>`
81
81
  : html `<slot name="default"></slot
82
82
  ><slot name="selected" slot="selected"></slot>`}
83
- ${this.selectedIcon
83
+ ${this.selectedIcon
84
84
  ? html `<ix-icon ?filled=${this.filledIcon} slot="selected"
85
85
  >${this.selectedIcon}</ix-icon
86
- >`
86
+ >`
87
87
  : nothing}
88
- </${tag}>`;
89
- }
90
- }
91
- __decorate([
92
- query('.button')
93
- ], IxIconButton.prototype, "component", void 0);
94
- __decorate([
95
- property()
96
- ], IxIconButton.prototype, "appearance", void 0);
97
- __decorate([
98
- property()
99
- ], IxIconButton.prototype, "icon", void 0);
100
- __decorate([
101
- property()
102
- ], IxIconButton.prototype, "selectedIcon", void 0);
103
- __decorate([
104
- property({ type: Boolean, reflect: true })
105
- ], IxIconButton.prototype, "disabled", void 0);
106
- __decorate([
107
- property({ type: Boolean, attribute: 'flip-icon-in-rtl' })
108
- ], IxIconButton.prototype, "flipIconInRtl", void 0);
109
- __decorate([
110
- property()
111
- ], IxIconButton.prototype, "href", void 0);
112
- __decorate([
113
- property()
114
- ], IxIconButton.prototype, "target", void 0);
115
- __decorate([
116
- property({ attribute: 'aria-label-selected' })
117
- ], IxIconButton.prototype, "ariaLabelSelected", void 0);
118
- __decorate([
119
- property({ type: Boolean })
120
- ], IxIconButton.prototype, "toggle", void 0);
121
- __decorate([
122
- property({ type: Boolean, reflect: true })
123
- ], IxIconButton.prototype, "selected", void 0);
124
- __decorate([
125
- property()
126
- ], IxIconButton.prototype, "type", void 0);
127
- __decorate([
128
- property()
129
- ], IxIconButton.prototype, "name", void 0);
130
- __decorate([
131
- property()
132
- ], IxIconButton.prototype, "value", void 0);
133
- __decorate([
134
- property()
135
- ], IxIconButton.prototype, "label", void 0);
136
- __decorate([
137
- property({ type: Boolean })
138
- ], IxIconButton.prototype, "filledIcon", void 0);
88
+ </${tag}>`;
89
+ }
90
+ }
91
+ __decorate([
92
+ query('.button')
93
+ ], IxIconButton.prototype, "component", void 0);
94
+ __decorate([
95
+ property()
96
+ ], IxIconButton.prototype, "appearance", void 0);
97
+ __decorate([
98
+ property()
99
+ ], IxIconButton.prototype, "icon", void 0);
100
+ __decorate([
101
+ property()
102
+ ], IxIconButton.prototype, "selectedIcon", void 0);
103
+ __decorate([
104
+ property({ type: Boolean, reflect: true })
105
+ ], IxIconButton.prototype, "disabled", void 0);
106
+ __decorate([
107
+ property({ type: Boolean, attribute: 'flip-icon-in-rtl' })
108
+ ], IxIconButton.prototype, "flipIconInRtl", void 0);
109
+ __decorate([
110
+ property()
111
+ ], IxIconButton.prototype, "href", void 0);
112
+ __decorate([
113
+ property()
114
+ ], IxIconButton.prototype, "target", void 0);
115
+ __decorate([
116
+ property({ attribute: 'aria-label-selected' })
117
+ ], IxIconButton.prototype, "ariaLabelSelected", void 0);
118
+ __decorate([
119
+ property({ type: Boolean })
120
+ ], IxIconButton.prototype, "toggle", void 0);
121
+ __decorate([
122
+ property({ type: Boolean, reflect: true })
123
+ ], IxIconButton.prototype, "selected", void 0);
124
+ __decorate([
125
+ property()
126
+ ], IxIconButton.prototype, "type", void 0);
127
+ __decorate([
128
+ property()
129
+ ], IxIconButton.prototype, "name", void 0);
130
+ __decorate([
131
+ property()
132
+ ], IxIconButton.prototype, "value", void 0);
133
+ __decorate([
134
+ property()
135
+ ], IxIconButton.prototype, "label", void 0);
136
+ __decorate([
137
+ property({ type: Boolean })
138
+ ], IxIconButton.prototype, "filledIcon", void 0);
139
139
  //# sourceMappingURL=IxIconButton.js.map
package/dist/index.d.ts CHANGED
@@ -1 +1 @@
1
- export { IxIconButton } from './IxIconButton.js';
1
+ export { IxIconButton } from './IxIconButton.js';
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- export { IxIconButton } from './IxIconButton.js';
1
+ export { IxIconButton } from './IxIconButton.js';
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- export {};
1
+ export {};
@@ -1,3 +1,3 @@
1
- import { IxIconButton } from './IxIconButton.js';
2
- window.customElements.define('ix-icon-button', IxIconButton);
1
+ import { IxIconButton } from './IxIconButton.js';
2
+ window.customElements.define('ix-icon-button', IxIconButton);
3
3
  //# sourceMappingURL=ix-icon-button.js.map
@@ -1,2 +1,2 @@
1
- import { IxIconButton as LitComp } from '../IxIconButton.js';
2
- export declare const IxButton: import("@lit/react").ReactWebComponent<LitComp, {}>;
1
+ import { IxIconButton as LitComp } from '../IxIconButton.js';
2
+ export declare const IxButton: import("@lit/react").ReactWebComponent<LitComp, {}>;
@@ -1,10 +1,10 @@
1
- import React from 'react';
2
- import { createComponent } from '@lit/react';
3
- import { IxIconButton as LitComp } from '../IxIconButton.js';
4
- customElements.define('ix-icon-button', LitComp);
5
- export const IxButton = createComponent({
6
- tagName: 'ix-icon-button',
7
- elementClass: LitComp,
8
- react: React,
9
- });
1
+ import React from 'react';
2
+ import { createComponent } from '@lit/react';
3
+ import { IxIconButton as LitComp } from '../IxIconButton.js';
4
+ customElements.define('ix-icon-button', LitComp);
5
+ export const IxButton = createComponent({
6
+ tagName: 'ix-icon-button',
7
+ elementClass: LitComp,
8
+ react: React,
9
+ });
10
10
  //# sourceMappingURL=IxIconButton.js.map
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "Webcomponent ix-icon-button following open-wc recommendations",
4
4
  "license": "MIT",
5
5
  "author": "Digital Realty",
6
- "version": "1.0.40",
6
+ "version": "1.0.42-alpha.0",
7
7
  "type": "module",
8
8
  "main": "dist/index.js",
9
9
  "module": "dist/index.js",
@@ -27,7 +27,7 @@
27
27
  "test:watch": "tsc && concurrently -k -r \"tsc --watch --preserveWatchOutput\" \"wtr --watch\""
28
28
  },
29
29
  "dependencies": {
30
- "@digital-realty/ix-icon": "^1.0.36",
30
+ "@digital-realty/ix-icon": "^1.0.38-alpha.0",
31
31
  "@lit/react": "^1.0.2",
32
32
  "@material/web": "1.2.0",
33
33
  "lit": "^2.0.2",
@@ -35,7 +35,7 @@
35
35
  },
36
36
  "devDependencies": {
37
37
  "@custom-elements-manifest/analyzer": "^0.4.17",
38
- "@digital-realty/theme": "^1.0.30",
38
+ "@digital-realty/theme": "^1.0.32-alpha.0",
39
39
  "@open-wc/eslint-config": "^9.2.1",
40
40
  "@open-wc/testing": "^3.1.6",
41
41
  "@typescript-eslint/eslint-plugin": "^5.48.0",
@@ -103,5 +103,5 @@
103
103
  "README.md",
104
104
  "LICENSE"
105
105
  ],
106
- "gitHead": "024e4b85148c7a248e9f283e35085f512e7c3b1e"
106
+ "gitHead": "020de6dab25bbe6058e9a71b2c56681822403481"
107
107
  }