@digital-realty/ix-chip 1.0.7 → 1.0.9
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/LICENSE +20 -20
- package/README.md +32 -32
- package/dist/IxChip.d.ts +28 -28
- package/dist/IxChip.js +62 -62
- package/dist/IxChipSet.d.ts +5 -5
- package/dist/IxChipSet.js +7 -7
- package/dist/IxCustomChip.d.ts +16 -0
- package/dist/IxCustomChip.js +56 -0
- package/dist/IxCustomChip.js.map +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/ix-chip-set.d.ts +1 -1
- package/dist/ix-chip-set.js +2 -2
- package/dist/ix-chip.d.ts +1 -1
- package/dist/ix-chip.js +2 -2
- package/dist/ix-custom-chip.d.ts +4 -0
- package/dist/ix-custom-chip.js +71 -0
- package/dist/ix-custom-chip.js.map +1 -0
- package/dist/react/IxChip.d.ts +4 -4
- package/dist/react/IxChip.js +12 -12
- package/dist/react/IxChipSet.d.ts +2 -2
- package/dist/react/IxChipSet.js +9 -9
- package/package.json +6 -5
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2023 ix-chip
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023 ix-chip
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
21
|
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
# \<ix-chip>
|
|
2
|
-
|
|
3
|
-
This webcomponent follows the [open-wc](https://github.com/open-wc/open-wc) recommendation.
|
|
4
|
-
|
|
5
|
-
## Installation
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
npm i @digital-realty/ix-chip
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
## Usage
|
|
12
|
-
|
|
13
|
-
```html
|
|
14
|
-
<script type="module">
|
|
15
|
-
import '@digital-realty/ix-chip/ix-chip.js';
|
|
16
|
-
import '@digital-realty/ix-chip/ix-chip-set.js';
|
|
17
|
-
</script>
|
|
18
|
-
|
|
19
|
-
<ix-chip></ix-chip>
|
|
20
|
-
<ix-chip-set><ix-chip><ix-chip></ix-chip-set>
|
|
21
|
-
```
|
|
22
|
-
### In React
|
|
23
|
-
```html
|
|
24
|
-
<script type="module">
|
|
25
|
-
import { IxChip } from '@digital-realty/ix-chip/IxChip'
|
|
26
|
-
import { IxChipSet } from '@digital-realty/ix-chip/IxChipSet'
|
|
27
|
-
</script>
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
## Demo and Documentation
|
|
31
|
-
|
|
32
|
-
Full documentation and demo are available at [DLR Component Gallery](https://inxn-p1-uicomponentgallery.azurewebsites.net/?path=/story/inxn-ix-chip--default).
|
|
1
|
+
# \<ix-chip>
|
|
2
|
+
|
|
3
|
+
This webcomponent follows the [open-wc](https://github.com/open-wc/open-wc) recommendation.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm i @digital-realty/ix-chip
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```html
|
|
14
|
+
<script type="module">
|
|
15
|
+
import '@digital-realty/ix-chip/ix-chip.js';
|
|
16
|
+
import '@digital-realty/ix-chip/ix-chip-set.js';
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<ix-chip></ix-chip>
|
|
20
|
+
<ix-chip-set><ix-chip><ix-chip></ix-chip-set>
|
|
21
|
+
```
|
|
22
|
+
### In React
|
|
23
|
+
```html
|
|
24
|
+
<script type="module">
|
|
25
|
+
import { IxChip } from '@digital-realty/ix-chip/IxChip'
|
|
26
|
+
import { IxChipSet } from '@digital-realty/ix-chip/IxChipSet'
|
|
27
|
+
</script>
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Demo and Documentation
|
|
31
|
+
|
|
32
|
+
Full documentation and demo are available at [DLR Component Gallery](https://inxn-p1-uicomponentgallery.azurewebsites.net/?path=/story/inxn-ix-chip--default).
|
package/dist/IxChip.d.ts
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import { LitElement } from 'lit';
|
|
2
|
-
import '@material/web/chips/assist-chip.js';
|
|
3
|
-
import '@material/web/chips/filter-chip.js';
|
|
4
|
-
import '@material/web/chips/input-chip.js';
|
|
5
|
-
import '@material/web/chips/suggestion-chip.js';
|
|
6
|
-
export declare class IxChip extends LitElement {
|
|
7
|
-
appearance: 'assist' | 'filter' | 'input' | 'suggestion';
|
|
8
|
-
/**
|
|
9
|
-
* Whether or not the chip is disabled.
|
|
10
|
-
*
|
|
11
|
-
* Disabled chips are not focusable, unless `always-focusable` is set.
|
|
12
|
-
*/
|
|
13
|
-
disabled: boolean;
|
|
14
|
-
/**
|
|
15
|
-
* When true, allow disabled chips to be focused with arrow keys.
|
|
16
|
-
*
|
|
17
|
-
* Add this when a chip needs increased visibility when disabled. See
|
|
18
|
-
* https://www.w3.org/WAI/ARIA/apg/practices/keyboard-interface/#kbd_disabled_controls
|
|
19
|
-
* for more guidance on when this is needed.
|
|
20
|
-
*/
|
|
21
|
-
alwaysFocusable: boolean;
|
|
22
|
-
/**
|
|
23
|
-
* The label of the chip.
|
|
24
|
-
*/
|
|
25
|
-
label: string;
|
|
26
|
-
remove: () => void;
|
|
27
|
-
render(): import("lit").TemplateResult<1>;
|
|
28
|
-
}
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import '@material/web/chips/assist-chip.js';
|
|
3
|
+
import '@material/web/chips/filter-chip.js';
|
|
4
|
+
import '@material/web/chips/input-chip.js';
|
|
5
|
+
import '@material/web/chips/suggestion-chip.js';
|
|
6
|
+
export declare class IxChip extends LitElement {
|
|
7
|
+
appearance: 'assist' | 'filter' | 'input' | 'suggestion';
|
|
8
|
+
/**
|
|
9
|
+
* Whether or not the chip is disabled.
|
|
10
|
+
*
|
|
11
|
+
* Disabled chips are not focusable, unless `always-focusable` is set.
|
|
12
|
+
*/
|
|
13
|
+
disabled: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* When true, allow disabled chips to be focused with arrow keys.
|
|
16
|
+
*
|
|
17
|
+
* Add this when a chip needs increased visibility when disabled. See
|
|
18
|
+
* https://www.w3.org/WAI/ARIA/apg/practices/keyboard-interface/#kbd_disabled_controls
|
|
19
|
+
* for more guidance on when this is needed.
|
|
20
|
+
*/
|
|
21
|
+
alwaysFocusable: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* The label of the chip.
|
|
24
|
+
*/
|
|
25
|
+
label: string;
|
|
26
|
+
remove: () => void;
|
|
27
|
+
render(): import("lit").TemplateResult<1>;
|
|
28
|
+
}
|
package/dist/IxChip.js
CHANGED
|
@@ -1,84 +1,84 @@
|
|
|
1
|
-
import { __decorate } from "tslib";
|
|
2
|
-
import { html, LitElement } from 'lit';
|
|
3
|
-
import { property } from 'lit/decorators.js';
|
|
4
|
-
import '@material/web/chips/assist-chip.js';
|
|
5
|
-
import '@material/web/chips/filter-chip.js';
|
|
6
|
-
import '@material/web/chips/input-chip.js';
|
|
7
|
-
import '@material/web/chips/suggestion-chip.js';
|
|
8
|
-
export class IxChip extends LitElement {
|
|
9
|
-
constructor() {
|
|
10
|
-
super(...arguments);
|
|
11
|
-
this.appearance = 'assist';
|
|
12
|
-
/**
|
|
13
|
-
* Whether or not the chip is disabled.
|
|
14
|
-
*
|
|
15
|
-
* Disabled chips are not focusable, unless `always-focusable` is set.
|
|
16
|
-
*/
|
|
17
|
-
this.disabled = false;
|
|
18
|
-
/**
|
|
19
|
-
* When true, allow disabled chips to be focused with arrow keys.
|
|
20
|
-
*
|
|
21
|
-
* Add this when a chip needs increased visibility when disabled. See
|
|
22
|
-
* https://www.w3.org/WAI/ARIA/apg/practices/keyboard-interface/#kbd_disabled_controls
|
|
23
|
-
* for more guidance on when this is needed.
|
|
24
|
-
*/
|
|
25
|
-
this.alwaysFocusable = false;
|
|
26
|
-
/**
|
|
27
|
-
* The label of the chip.
|
|
28
|
-
*/
|
|
29
|
-
this.label = '';
|
|
30
|
-
this.remove = () => {
|
|
31
|
-
this.dispatchEvent(new CustomEvent('remove', { bubbles: true }));
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
render() {
|
|
35
|
-
let comp;
|
|
36
|
-
if (this.appearance === 'assist') {
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { html, LitElement } from 'lit';
|
|
3
|
+
import { property } from 'lit/decorators.js';
|
|
4
|
+
import '@material/web/chips/assist-chip.js';
|
|
5
|
+
import '@material/web/chips/filter-chip.js';
|
|
6
|
+
import '@material/web/chips/input-chip.js';
|
|
7
|
+
import '@material/web/chips/suggestion-chip.js';
|
|
8
|
+
export class IxChip extends LitElement {
|
|
9
|
+
constructor() {
|
|
10
|
+
super(...arguments);
|
|
11
|
+
this.appearance = 'assist';
|
|
12
|
+
/**
|
|
13
|
+
* Whether or not the chip is disabled.
|
|
14
|
+
*
|
|
15
|
+
* Disabled chips are not focusable, unless `always-focusable` is set.
|
|
16
|
+
*/
|
|
17
|
+
this.disabled = false;
|
|
18
|
+
/**
|
|
19
|
+
* When true, allow disabled chips to be focused with arrow keys.
|
|
20
|
+
*
|
|
21
|
+
* Add this when a chip needs increased visibility when disabled. See
|
|
22
|
+
* https://www.w3.org/WAI/ARIA/apg/practices/keyboard-interface/#kbd_disabled_controls
|
|
23
|
+
* for more guidance on when this is needed.
|
|
24
|
+
*/
|
|
25
|
+
this.alwaysFocusable = false;
|
|
26
|
+
/**
|
|
27
|
+
* The label of the chip.
|
|
28
|
+
*/
|
|
29
|
+
this.label = '';
|
|
30
|
+
this.remove = () => {
|
|
31
|
+
this.dispatchEvent(new CustomEvent('remove', { bubbles: true }));
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
render() {
|
|
35
|
+
let comp;
|
|
36
|
+
if (this.appearance === 'assist') {
|
|
37
37
|
comp = html `<md-assist-chip
|
|
38
38
|
?disabled=${this.disabled}
|
|
39
39
|
?always-focusable=${this.alwaysFocusable}
|
|
40
40
|
.label=${this.label}
|
|
41
41
|
>${this.label}</md-assist-chip
|
|
42
|
-
>`;
|
|
43
|
-
}
|
|
44
|
-
else if (this.appearance === 'filter') {
|
|
42
|
+
>`;
|
|
43
|
+
}
|
|
44
|
+
else if (this.appearance === 'filter') {
|
|
45
45
|
comp = html `<md-filter-chip
|
|
46
46
|
?disabled=${this.disabled}
|
|
47
47
|
?always-focusable=${this.alwaysFocusable}
|
|
48
48
|
.label=${this.label}
|
|
49
49
|
>${this.label}</md-filter-chip
|
|
50
|
-
>`;
|
|
51
|
-
}
|
|
52
|
-
else if (this.appearance === 'input') {
|
|
50
|
+
>`;
|
|
51
|
+
}
|
|
52
|
+
else if (this.appearance === 'input') {
|
|
53
53
|
comp = html `<md-input-chip
|
|
54
54
|
?disabled=${this.disabled}
|
|
55
55
|
?always-focusable=${this.alwaysFocusable}
|
|
56
56
|
.label=${this.label}
|
|
57
57
|
@remove=${this.remove}
|
|
58
58
|
>${this.label}</md-input-chip
|
|
59
|
-
>`;
|
|
60
|
-
}
|
|
61
|
-
else if (this.appearance === 'suggestion') {
|
|
59
|
+
>`;
|
|
60
|
+
}
|
|
61
|
+
else if (this.appearance === 'suggestion') {
|
|
62
62
|
comp = html `<md-suggestion-chip
|
|
63
63
|
?disabled=${this.disabled}
|
|
64
64
|
?always-focusable=${this.alwaysFocusable}
|
|
65
65
|
.label=${this.label}
|
|
66
66
|
>${this.label}</md-suggestion-chip
|
|
67
|
-
>`;
|
|
68
|
-
}
|
|
69
|
-
return html ` ${comp} `;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
__decorate([
|
|
73
|
-
property({ type: String })
|
|
74
|
-
], IxChip.prototype, "appearance", void 0);
|
|
75
|
-
__decorate([
|
|
76
|
-
property({ type: Boolean })
|
|
77
|
-
], IxChip.prototype, "disabled", void 0);
|
|
78
|
-
__decorate([
|
|
79
|
-
property({ type: Boolean, attribute: 'always-focusable' })
|
|
80
|
-
], IxChip.prototype, "alwaysFocusable", void 0);
|
|
81
|
-
__decorate([
|
|
82
|
-
property()
|
|
83
|
-
], IxChip.prototype, "label", void 0);
|
|
67
|
+
>`;
|
|
68
|
+
}
|
|
69
|
+
return html ` ${comp} `;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
__decorate([
|
|
73
|
+
property({ type: String })
|
|
74
|
+
], IxChip.prototype, "appearance", void 0);
|
|
75
|
+
__decorate([
|
|
76
|
+
property({ type: Boolean })
|
|
77
|
+
], IxChip.prototype, "disabled", void 0);
|
|
78
|
+
__decorate([
|
|
79
|
+
property({ type: Boolean, attribute: 'always-focusable' })
|
|
80
|
+
], IxChip.prototype, "alwaysFocusable", void 0);
|
|
81
|
+
__decorate([
|
|
82
|
+
property()
|
|
83
|
+
], IxChip.prototype, "label", void 0);
|
|
84
84
|
//# sourceMappingURL=IxChip.js.map
|
package/dist/IxChipSet.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { LitElement } from 'lit';
|
|
2
|
-
import '@material/web/chips/chip-set';
|
|
3
|
-
export declare class IxChipSet extends LitElement {
|
|
4
|
-
render(): import("lit").TemplateResult<1>;
|
|
5
|
-
}
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import '@material/web/chips/chip-set';
|
|
3
|
+
export declare class IxChipSet extends LitElement {
|
|
4
|
+
render(): import("lit").TemplateResult<1>;
|
|
5
|
+
}
|
package/dist/IxChipSet.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { LitElement, html } from 'lit';
|
|
2
|
-
import '@material/web/chips/chip-set';
|
|
3
|
-
export class IxChipSet extends LitElement {
|
|
4
|
-
render() {
|
|
5
|
-
return html `<md-chip-set><slot></slot></md-chip-set>`;
|
|
6
|
-
}
|
|
7
|
-
}
|
|
1
|
+
import { LitElement, html } from 'lit';
|
|
2
|
+
import '@material/web/chips/chip-set';
|
|
3
|
+
export class IxChipSet extends LitElement {
|
|
4
|
+
render() {
|
|
5
|
+
return html `<md-chip-set><slot></slot></md-chip-set>`;
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
8
|
//# sourceMappingURL=IxChipSet.js.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import '@digital-realty/ix-icon/ix-icon.js';
|
|
3
|
+
interface AppearanceConfig {
|
|
4
|
+
[key: string]: {
|
|
5
|
+
icon: string;
|
|
6
|
+
text: string;
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
declare const appearanceConfig: AppearanceConfig;
|
|
10
|
+
export declare class IxCustomChip extends LitElement {
|
|
11
|
+
appearance: keyof typeof appearanceConfig;
|
|
12
|
+
iconName: string;
|
|
13
|
+
noIcon: boolean;
|
|
14
|
+
render(): import("lit").TemplateResult<1>;
|
|
15
|
+
}
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { html, LitElement, nothing } from 'lit';
|
|
3
|
+
import { property } from 'lit/decorators.js';
|
|
4
|
+
import '@digital-realty/ix-icon/ix-icon.js';
|
|
5
|
+
const appearanceConfig = {
|
|
6
|
+
default: { icon: '', text: '' },
|
|
7
|
+
completed: { icon: 'check_circle', text: 'COMPLETED' },
|
|
8
|
+
cancelled: { icon: 'delete_forever', text: 'CANCELLED' },
|
|
9
|
+
cancellationRequested: {
|
|
10
|
+
icon: 'auto_delete',
|
|
11
|
+
text: 'CANCELLATION REQUESTED',
|
|
12
|
+
},
|
|
13
|
+
inProgress: { icon: 'clock_loader_60', text: 'IN PROGRESS' },
|
|
14
|
+
new: { icon: '', text: 'NEW' },
|
|
15
|
+
pending: { icon: 'assignment_late', text: 'PENDING APPROVAL' },
|
|
16
|
+
rejected: { icon: 'warning', text: 'REJECTED' },
|
|
17
|
+
};
|
|
18
|
+
export class IxCustomChip extends LitElement {
|
|
19
|
+
constructor() {
|
|
20
|
+
super(...arguments);
|
|
21
|
+
this.appearance = 'default';
|
|
22
|
+
this.iconName = 'star';
|
|
23
|
+
this.noIcon = false;
|
|
24
|
+
}
|
|
25
|
+
render() {
|
|
26
|
+
const { icon, text } = appearanceConfig[this.appearance];
|
|
27
|
+
return html `
|
|
28
|
+
<div
|
|
29
|
+
class="wrapper ${this.noIcon ? 'no-icon' : ''}"
|
|
30
|
+
appearance=${this.appearance}
|
|
31
|
+
>
|
|
32
|
+
${!this.noIcon
|
|
33
|
+
? html `
|
|
34
|
+
<slot name="icon" class="icon"> </slot>
|
|
35
|
+
${icon !== ''
|
|
36
|
+
? html `<ix-icon filled class="icon">${icon}</ix-icon>`
|
|
37
|
+
: html `<ix-icon filled class="icon">${this.iconName}</ix-icon>`}
|
|
38
|
+
`
|
|
39
|
+
: nothing}
|
|
40
|
+
${text ? html `${text}` : nothing}
|
|
41
|
+
|
|
42
|
+
<slot class="text-container"></slot>
|
|
43
|
+
</div>
|
|
44
|
+
`;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
__decorate([
|
|
48
|
+
property({ type: String })
|
|
49
|
+
], IxCustomChip.prototype, "appearance", void 0);
|
|
50
|
+
__decorate([
|
|
51
|
+
property({ type: String })
|
|
52
|
+
], IxCustomChip.prototype, "iconName", void 0);
|
|
53
|
+
__decorate([
|
|
54
|
+
property({ type: Boolean })
|
|
55
|
+
], IxCustomChip.prototype, "noIcon", void 0);
|
|
56
|
+
//# sourceMappingURL=IxCustomChip.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IxCustomChip.js","sourceRoot":"","sources":["../src/IxCustomChip.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,oCAAoC,CAAC;AAM5C,MAAM,gBAAgB,GAAqB;IACzC,OAAO,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;IAC/B,SAAS,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,WAAW,EAAE;IACtD,SAAS,EAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE,IAAI,EAAE,WAAW,EAAE;IACxD,qBAAqB,EAAE;QACrB,IAAI,EAAE,aAAa;QACnB,IAAI,EAAE,wBAAwB;KAC/B;IACD,UAAU,EAAE,EAAE,IAAI,EAAE,iBAAiB,EAAE,IAAI,EAAE,aAAa,EAAE;IAC5D,GAAG,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE;IAC9B,OAAO,EAAE,EAAE,IAAI,EAAE,iBAAiB,EAAE,IAAI,EAAE,kBAAkB,EAAE;IAC9D,QAAQ,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,UAAU,EAAE;CAChD,CAAC;AAEF,MAAM,OAAO,YAAa,SAAQ,UAAU;IAA5C;;QAC8B,eAAU,GACpC,SAAS,CAAC;QAEgB,aAAQ,GAAW,MAAM,CAAC;QAEzB,WAAM,GAAY,KAAK,CAAC;IAuBvD,CAAC;IArBC,MAAM;QACJ,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,gBAAgB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QACzD,OAAO,IAAI,CAAA;;yBAEU,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE;qBAChC,IAAI,CAAC,UAAU;;UAE1B,CAAC,IAAI,CAAC,MAAM;YACZ,CAAC,CAAC,IAAI,CAAA;;gBAEA,IAAI,KAAK,EAAE;gBACX,CAAC,CAAC,IAAI,CAAA,gCAAgC,IAAI,YAAY;gBACtD,CAAC,CAAC,IAAI,CAAA,gCAAgC,IAAI,CAAC,QAAQ,YAAY;aAClE;YACH,CAAC,CAAC,OAAO;UACT,IAAI,CAAC,CAAC,CAAC,IAAI,CAAA,GAAG,IAAI,EAAE,CAAC,CAAC,CAAC,OAAO;;;;KAInC,CAAC;IACJ,CAAC;CACF;AA5B6B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;gDACf;AAEgB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;8CAA2B;AAEzB;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;4CAAyB","sourcesContent":["import { html, LitElement, nothing } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport '@digital-realty/ix-icon/ix-icon.js';\n\ninterface AppearanceConfig {\n [key: string]: { icon: string; text: string };\n}\n\nconst appearanceConfig: AppearanceConfig = {\n default: { icon: '', text: '' },\n completed: { icon: 'check_circle', text: 'COMPLETED' },\n cancelled: { icon: 'delete_forever', text: 'CANCELLED' },\n cancellationRequested: {\n icon: 'auto_delete',\n text: 'CANCELLATION REQUESTED',\n },\n inProgress: { icon: 'clock_loader_60', text: 'IN PROGRESS' },\n new: { icon: '', text: 'NEW' },\n pending: { icon: 'assignment_late', text: 'PENDING APPROVAL' },\n rejected: { icon: 'warning', text: 'REJECTED' },\n};\n\nexport class IxCustomChip extends LitElement {\n @property({ type: String }) appearance: keyof typeof appearanceConfig =\n 'default';\n\n @property({ type: String }) iconName: string = 'star';\n\n @property({ type: Boolean }) noIcon: boolean = false;\n\n render() {\n const { icon, text } = appearanceConfig[this.appearance];\n return html`\n <div\n class=\"wrapper ${this.noIcon ? 'no-icon' : ''}\"\n appearance=${this.appearance}\n >\n ${!this.noIcon\n ? html`\n <slot name=\"icon\" class=\"icon\"> </slot>\n ${icon !== ''\n ? html`<ix-icon filled class=\"icon\">${icon}</ix-icon>`\n : html`<ix-icon filled class=\"icon\">${this.iconName}</ix-icon>`}\n `\n : nothing}\n ${text ? html`${text}` : nothing}\n\n <slot class=\"text-container\"></slot>\n </div>\n `;\n }\n}\n"]}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { IxChip } from './IxChip.js';
|
|
2
|
-
export { IxChipSet } from './IxChipSet.js';
|
|
1
|
+
export { IxChip } from './IxChip.js';
|
|
2
|
+
export { IxChipSet } from './IxChipSet.js';
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { IxChip } from './IxChip.js';
|
|
2
|
-
export { IxChipSet } from './IxChipSet.js';
|
|
1
|
+
export { IxChip } from './IxChip.js';
|
|
2
|
+
export { IxChipSet } from './IxChipSet.js';
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
package/dist/ix-chip-set.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
package/dist/ix-chip-set.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { IxChipSet } from './IxChipSet.js';
|
|
2
|
-
window.customElements.define('ix-chip-set', IxChipSet);
|
|
1
|
+
import { IxChipSet } from './IxChipSet.js';
|
|
2
|
+
window.customElements.define('ix-chip-set', IxChipSet);
|
|
3
3
|
//# sourceMappingURL=ix-chip-set.js.map
|
package/dist/ix-chip.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
package/dist/ix-chip.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { IxChip } from './IxChip.js';
|
|
2
|
-
window.customElements.define('ix-chip', IxChip);
|
|
1
|
+
import { IxChip } from './IxChip.js';
|
|
2
|
+
window.customElements.define('ix-chip', IxChip);
|
|
3
3
|
//# sourceMappingURL=ix-chip.js.map
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
import { IxCustomChip } from './IxCustomChip.js';
|
|
3
|
+
export class IxCustomChipStyled extends IxCustomChip {
|
|
4
|
+
}
|
|
5
|
+
IxCustomChipStyled.styles = css `
|
|
6
|
+
:host {
|
|
7
|
+
--ix-font-color: #092241;
|
|
8
|
+
--ix-icon-pending-color: #ff9800;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.wrapper {
|
|
12
|
+
align-items: center;
|
|
13
|
+
background-color: var(
|
|
14
|
+
--ix-custom-chip-background-color,
|
|
15
|
+
var(--md-sys-color-on-primary, #ffffff)
|
|
16
|
+
);
|
|
17
|
+
border-radius: var(--ix-custom-chip-border-radius, 62.4375rem);
|
|
18
|
+
color: var(--ix-custom-chip-color, --ix-font-color);
|
|
19
|
+
display: flex;
|
|
20
|
+
font-size: var(--ix-custom-chip-font-size, 0.75rem);
|
|
21
|
+
font-weight: var(--ix-custom-chip-font-weight, 700);
|
|
22
|
+
gap: var(--ix-custom-chip-icon-gap-right, 0.4375rem);
|
|
23
|
+
letter-spacing: var(--ix-custom-chip-letter-spacing, 0.078125rem);
|
|
24
|
+
padding: var(--ix-custom-chip-padding, 0.25rem 1rem 0.25rem 0.25rem);
|
|
25
|
+
text-transform: var(--ix-custom-chip-text-transform, uppercase);
|
|
26
|
+
width: fit-content;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.wrapper[appearance='new'] {
|
|
30
|
+
background-color: var(
|
|
31
|
+
--ix-button-confirm-color,
|
|
32
|
+
var(--md-sys-color-on-primary, #002020)
|
|
33
|
+
);
|
|
34
|
+
color: var(--md-sys-color-on-primary, var(--ix-font-color, #092241));
|
|
35
|
+
padding: var(--ix-custom-chip-no-icon-padding, 0.5625rem 1rem);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.wrapper.no-icon {
|
|
39
|
+
padding: var(--ix-custom-chip-no-icon-padding, 0.5625rem 1rem);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.icon {
|
|
43
|
+
color: var(
|
|
44
|
+
--ix-custom-chip-icon-color,
|
|
45
|
+
var(--md-sys-color-scrim, #000000)
|
|
46
|
+
);
|
|
47
|
+
font-size: var(--ix-custom-chip-icon-font-size, 1.5625rem);
|
|
48
|
+
line-height: var(--ix-custom-chip-icon-line-height, 1.5625rem);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
[appearance='completed'] .icon {
|
|
52
|
+
color: var(--ix-button-confirm-color);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
[appearance='pending'] .icon,
|
|
56
|
+
[appearance='inProgress'] .icon {
|
|
57
|
+
color: var(--ix-icon-pending-color, #ff9800);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
[appearance='rejected'] .icon,
|
|
61
|
+
[appearance='cancellationRequested'] .icon,
|
|
62
|
+
[appearance='cancelled'] .icon {
|
|
63
|
+
color: var(--ix-button-cancel-color, #db0028);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.text-container {
|
|
67
|
+
margin-right: var(--ix-custom-chip-margin-right, 1rem);
|
|
68
|
+
}
|
|
69
|
+
`;
|
|
70
|
+
window.customElements.define('ix-custom-chip', IxCustomChipStyled);
|
|
71
|
+
//# sourceMappingURL=ix-custom-chip.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ix-custom-chip.js","sourceRoot":"","sources":["../src/ix-custom-chip.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC1B,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,MAAM,OAAO,kBAAmB,SAAQ,YAAY;;AAClC,yBAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgE3B,CAAC;AAGJ,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,gBAAgB,EAAE,kBAAkB,CAAC,CAAC","sourcesContent":["import { css } from 'lit';\nimport { IxCustomChip } from './IxCustomChip.js';\n\nexport class IxCustomChipStyled extends IxCustomChip {\n static override styles = css`\n :host {\n --ix-font-color: #092241;\n --ix-icon-pending-color: #ff9800;\n }\n\n .wrapper {\n align-items: center;\n background-color: var(\n --ix-custom-chip-background-color,\n var(--md-sys-color-on-primary, #ffffff)\n );\n border-radius: var(--ix-custom-chip-border-radius, 62.4375rem);\n color: var(--ix-custom-chip-color, --ix-font-color);\n display: flex;\n font-size: var(--ix-custom-chip-font-size, 0.75rem);\n font-weight: var(--ix-custom-chip-font-weight, 700);\n gap: var(--ix-custom-chip-icon-gap-right, 0.4375rem);\n letter-spacing: var(--ix-custom-chip-letter-spacing, 0.078125rem);\n padding: var(--ix-custom-chip-padding, 0.25rem 1rem 0.25rem 0.25rem);\n text-transform: var(--ix-custom-chip-text-transform, uppercase);\n width: fit-content;\n }\n\n .wrapper[appearance='new'] {\n background-color: var(\n --ix-button-confirm-color,\n var(--md-sys-color-on-primary, #002020)\n );\n color: var(--md-sys-color-on-primary, var(--ix-font-color, #092241));\n padding: var(--ix-custom-chip-no-icon-padding, 0.5625rem 1rem);\n }\n\n .wrapper.no-icon {\n padding: var(--ix-custom-chip-no-icon-padding, 0.5625rem 1rem);\n }\n\n .icon {\n color: var(\n --ix-custom-chip-icon-color,\n var(--md-sys-color-scrim, #000000)\n );\n font-size: var(--ix-custom-chip-icon-font-size, 1.5625rem);\n line-height: var(--ix-custom-chip-icon-line-height, 1.5625rem);\n }\n\n [appearance='completed'] .icon {\n color: var(--ix-button-confirm-color);\n }\n\n [appearance='pending'] .icon,\n [appearance='inProgress'] .icon {\n color: var(--ix-icon-pending-color, #ff9800);\n }\n\n [appearance='rejected'] .icon,\n [appearance='cancellationRequested'] .icon,\n [appearance='cancelled'] .icon {\n color: var(--ix-button-cancel-color, #db0028);\n }\n\n .text-container {\n margin-right: var(--ix-custom-chip-margin-right, 1rem);\n }\n `;\n}\n\nwindow.customElements.define('ix-custom-chip', IxCustomChipStyled);\n"]}
|
package/dist/react/IxChip.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IxChip as LitComp } from '../IxChip.js';
|
|
2
|
-
export declare const IxChip: import("@lit/react").ReactWebComponent<LitComp, {
|
|
3
|
-
onclick: string;
|
|
4
|
-
}>;
|
|
1
|
+
import { IxChip as LitComp } from '../IxChip.js';
|
|
2
|
+
export declare const IxChip: import("@lit/react").ReactWebComponent<LitComp, {
|
|
3
|
+
onclick: string;
|
|
4
|
+
}>;
|
package/dist/react/IxChip.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { createComponent } from '@lit/react';
|
|
3
|
-
import { IxChip as LitComp } from '../IxChip.js';
|
|
4
|
-
customElements.define('ix-chip', LitComp);
|
|
5
|
-
export const IxChip = createComponent({
|
|
6
|
-
tagName: 'ix-chip',
|
|
7
|
-
elementClass: LitComp,
|
|
8
|
-
react: React,
|
|
9
|
-
events: {
|
|
10
|
-
onclick: 'onClick',
|
|
11
|
-
},
|
|
12
|
-
});
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { createComponent } from '@lit/react';
|
|
3
|
+
import { IxChip as LitComp } from '../IxChip.js';
|
|
4
|
+
customElements.define('ix-chip', LitComp);
|
|
5
|
+
export const IxChip = createComponent({
|
|
6
|
+
tagName: 'ix-chip',
|
|
7
|
+
elementClass: LitComp,
|
|
8
|
+
react: React,
|
|
9
|
+
events: {
|
|
10
|
+
onclick: 'onClick',
|
|
11
|
+
},
|
|
12
|
+
});
|
|
13
13
|
//# sourceMappingURL=IxChip.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { IxChipSet as LitComp } from '../IxChipSet.js';
|
|
2
|
-
export declare const IxChipSet: import("@lit/react").ReactWebComponent<LitComp, {}>;
|
|
1
|
+
import { IxChipSet as LitComp } from '../IxChipSet.js';
|
|
2
|
+
export declare const IxChipSet: import("@lit/react").ReactWebComponent<LitComp, {}>;
|
package/dist/react/IxChipSet.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { createComponent } from '@lit/react';
|
|
3
|
-
import { IxChipSet as LitComp } from '../IxChipSet.js';
|
|
4
|
-
customElements.define('ix-chip-set', LitComp);
|
|
5
|
-
export const IxChipSet = createComponent({
|
|
6
|
-
tagName: 'ix-chip-set',
|
|
7
|
-
elementClass: LitComp,
|
|
8
|
-
react: React,
|
|
9
|
-
});
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { createComponent } from '@lit/react';
|
|
3
|
+
import { IxChipSet as LitComp } from '../IxChipSet.js';
|
|
4
|
+
customElements.define('ix-chip-set', LitComp);
|
|
5
|
+
export const IxChipSet = createComponent({
|
|
6
|
+
tagName: 'ix-chip-set',
|
|
7
|
+
elementClass: LitComp,
|
|
8
|
+
react: React,
|
|
9
|
+
});
|
|
10
10
|
//# sourceMappingURL=IxChipSet.js.map
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "Webcomponent ix-chip following open-wc recommendations",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Digital Realty",
|
|
6
|
-
"version": "1.0.
|
|
6
|
+
"version": "1.0.9",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"main": "dist/index.js",
|
|
9
9
|
"module": "dist/index.js",
|
|
@@ -12,7 +12,8 @@
|
|
|
12
12
|
"./ix-chip.js": "./dist/ix-chip.js",
|
|
13
13
|
"./ix-chip-set.js": "./dist/ix-chip-set.js",
|
|
14
14
|
"./IxChipSet": "./dist/react/IxChipSet.js",
|
|
15
|
-
"./IxChip": "./dist/react/IxChip.js"
|
|
15
|
+
"./IxChip": "./dist/react/IxChip.js",
|
|
16
|
+
"./ix-custom-chip.js": "./dist/ix-custom-chip.js"
|
|
16
17
|
},
|
|
17
18
|
"publishConfig": {
|
|
18
19
|
"access": "public"
|
|
@@ -28,8 +29,9 @@
|
|
|
28
29
|
"test:watch": "tsc && concurrently -k -r \"tsc --watch --preserveWatchOutput\" \"wtr --watch\""
|
|
29
30
|
},
|
|
30
31
|
"dependencies": {
|
|
32
|
+
"@digital-realty/ix-icon": "^1.0.3",
|
|
31
33
|
"@lit/react": "^1.0.2",
|
|
32
|
-
"@material/web": "
|
|
34
|
+
"@material/web": "1.2.0",
|
|
33
35
|
"lit": "^2.0.2",
|
|
34
36
|
"react": "^18.2.0"
|
|
35
37
|
},
|
|
@@ -96,6 +98,5 @@
|
|
|
96
98
|
"package.json",
|
|
97
99
|
"README.md",
|
|
98
100
|
"LICENSE"
|
|
99
|
-
]
|
|
100
|
-
"gitHead": "7dd8615d5f732cb14d465b2d46b2ee743546a4b2"
|
|
101
|
+
]
|
|
101
102
|
}
|