@aquera/nile-elements 0.0.74 → 0.0.75

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/README.md +6 -0
  2. package/dist/index.iife.js +157 -206
  3. package/dist/nile-calendar/nile-calendar.css.cjs.js +1 -1
  4. package/dist/nile-calendar/nile-calendar.css.cjs.js.map +1 -1
  5. package/dist/nile-calendar/nile-calendar.css.esm.js +8 -0
  6. package/dist/nile-card/nile-card.css.cjs.js +1 -1
  7. package/dist/nile-card/nile-card.css.cjs.js.map +1 -1
  8. package/dist/nile-card/nile-card.css.esm.js +4 -4
  9. package/dist/nile-checkbox/nile-checkbox.cjs.js +1 -1
  10. package/dist/nile-checkbox/nile-checkbox.cjs.js.map +1 -1
  11. package/dist/nile-checkbox/nile-checkbox.css.cjs.js +1 -1
  12. package/dist/nile-checkbox/nile-checkbox.css.cjs.js.map +1 -1
  13. package/dist/nile-checkbox/nile-checkbox.css.esm.js +30 -47
  14. package/dist/nile-checkbox/nile-checkbox.esm.js +56 -54
  15. package/dist/nile-tag/nile-tag.cjs.js +1 -1
  16. package/dist/nile-tag/nile-tag.cjs.js.map +1 -1
  17. package/dist/nile-tag/nile-tag.css.cjs.js +1 -1
  18. package/dist/nile-tag/nile-tag.css.cjs.js.map +1 -1
  19. package/dist/nile-tag/nile-tag.css.esm.js +50 -91
  20. package/dist/nile-tag/nile-tag.esm.js +13 -14
  21. package/dist/src/nile-calendar/nile-calendar.css.js +8 -0
  22. package/dist/src/nile-calendar/nile-calendar.css.js.map +1 -1
  23. package/dist/src/nile-card/nile-card.css.js +2 -2
  24. package/dist/src/nile-card/nile-card.css.js.map +1 -1
  25. package/dist/src/nile-checkbox/nile-checkbox.css.js +30 -47
  26. package/dist/src/nile-checkbox/nile-checkbox.css.js.map +1 -1
  27. package/dist/src/nile-checkbox/nile-checkbox.d.ts +2 -4
  28. package/dist/src/nile-checkbox/nile-checkbox.js +63 -67
  29. package/dist/src/nile-checkbox/nile-checkbox.js.map +1 -1
  30. package/dist/src/nile-tag/nile-tag.css.js +48 -89
  31. package/dist/src/nile-tag/nile-tag.css.js.map +1 -1
  32. package/dist/src/nile-tag/nile-tag.d.ts +2 -1
  33. package/dist/src/nile-tag/nile-tag.js +30 -13
  34. package/dist/src/nile-tag/nile-tag.js.map +1 -1
  35. package/dist/tsconfig.tsbuildinfo +1 -1
  36. package/package.json +1 -1
  37. package/src/nile-calendar/nile-calendar.css.ts +8 -0
  38. package/src/nile-card/nile-card.css.ts +2 -2
  39. package/src/nile-checkbox/nile-checkbox.css.ts +34 -51
  40. package/src/nile-checkbox/nile-checkbox.ts +111 -108
  41. package/src/nile-tag/nile-tag.css.ts +48 -89
  42. package/src/nile-tag/nile-tag.ts +34 -15
@@ -11,21 +11,22 @@ import { css } from 'lit-element';
11
11
  export const styles = css `
12
12
  :host {
13
13
  display: inline-block;
14
- --nile-remove-icon-color: var(--nile-colors-blue-500);
15
14
  }
16
15
 
17
16
  .tag {
18
17
  display: flex;
19
18
  align-items: center;
20
- justify-items: center;
21
- text-align: center;
22
- gap: 3px;
19
+ border: solid 2px;
20
+ line-height: 1;
23
21
  white-space: nowrap;
24
22
  user-select: none;
25
23
  border-radius: 4px;
26
- box-sizing: border-box;
27
- color: var(--colors-text-text-secondary-700, #344054);
28
- font-family: var(--nile-font-family-serif);
24
+ gap: 6px;
25
+ }
26
+
27
+ .tag__remove::part(base) {
28
+ color: inherit;
29
+ padding: 0;
29
30
  }
30
31
 
31
32
  /*
@@ -33,120 +34,101 @@ export const styles = css `
33
34
  */
34
35
 
35
36
  .tag--primary {
36
- background: #005ea6;
37
- color: #fff;
38
- --nile-remove-icon-color: var(--nile-colors-blue-500);
37
+ background: #005EA6;
38
+ border-color: #005EA6;
39
+ border: 2px solid #005EA6;
40
+ color: #FFF;
39
41
  }
40
42
 
41
43
  .tag--primary:hover {
42
- outline: 2px solid rgba(0, 94, 166, 0.5);
44
+ border: 2px solid rgba(0, 94, 166, 0.50);
43
45
  }
44
46
 
45
- .tag--primary:active > nile-icon {
47
+ .tag--primary:active > nile-icon-button {
46
48
  color: hsl(200.4 98% 39.4%);
47
49
  }
48
50
 
49
51
  .tag--success {
50
- background: #a5f3e1;
52
+ background: #A5F3E1;
53
+ border: 2px solid #A5F3E1;
51
54
  color: #000;
52
- --nile-remove-icon-color: var(--nile-colors-green-500);
53
55
  }
54
56
 
55
57
  .tag--success:hover {
56
- outline: 2px solid #43e5c0;
58
+ border: 2px solid #43E5C0;
57
59
  }
58
60
 
59
- .tag--success:active > nile-icon {
61
+ .tag--success:active > nile-icon-button {
60
62
  color: hsl(142.1 76.2% 36.3%);
61
63
  }
62
64
 
63
65
  .tag--normal {
64
- background: #e5e9eb;
66
+ background: #E5E9EB;
67
+ border: 2px solid #E5E9EB;
65
68
  color: #000;
66
- --nile-remove-icon-color: var(--nile-colors-dark-500);
67
69
  }
68
70
 
69
71
  .tag--normal:hover {
70
- outline: 2px solid #c7ced4;
72
+ border: 2px solid #C7CED4;
71
73
  }
72
74
 
73
- .tag--normal:active > nile-icon {
75
+
76
+ .tag--normal:active > nile-icon-button {
74
77
  color: hsl(240 5.2% 33.9%);
75
78
  }
76
79
 
77
80
  .tag--warning {
78
- background: #f3e0a5;
81
+ background: #F3E0A5;
82
+ border: 2px solid #F3E0A5;
79
83
  color: #000;
80
- --nile-remove-icon-color: var(--nile-colors-yellow-500);
81
84
  }
82
85
 
83
86
  .tag--warning:hover {
84
- outline: 2px solid #e5bf43;
87
+ border: 2px solid #E5BF43;
85
88
  }
86
89
 
87
- .tag--warning:active > nile-icon {
90
+ .tag--warning:active > nile-icon-button {
88
91
  color: hsl(32.1 94.6% 43.7%);
89
92
  }
90
93
 
94
+
91
95
  .tag--error {
92
- background: #f3a5aa;
96
+ background: #F3A5AA;
97
+ border: 2px solid #F3A5AA;
93
98
  color: #000;
94
- --nile-remove-icon-color: var(--nile-colors-red-500);
95
99
  }
96
100
 
97
101
  .tag--error:hover {
98
- outline: 2px solid #e5434d;
102
+ border: 2px solid #E5434D;
99
103
  }
100
104
 
101
- .tag--error:active > nile-icon {
105
+ .tag--error:active > nile-icon-button {
102
106
  color: hsl(0 72.2% 50.6%);
103
107
  }
104
108
 
105
109
  .tag--info {
106
- background: #a5d3f3;
110
+ background: #A5D3F3;
111
+ border: 2px solid #A5D3F3;
107
112
  color: #000000;
108
- --nile-remove-icon-color: var(--nile-colors-blue-500);
109
113
  }
110
114
 
111
115
  .tag--info:hover {
112
- outline: 2px solid #42a3e5;
116
+ border: 2px solid #42A3E5;
113
117
  }
114
118
 
115
- .tag--info:active > nile-icon {
119
+ .tag--info:active > nile-icon-button {
116
120
  color: hsl(0 72.2% 50.6%);
117
121
  }
118
122
 
119
- .tag--gray {
120
- background: var(--nile-tag-gray-background-color);
121
- border: 1px solid var(--nile-colors-gray-light-mode-300);
122
- color: var(--nile-tag-gray-color);
123
- --nile-remove-icon-color: var(--nile-tag-gray-x-color);
124
- }
125
-
126
- .tag--gray:hover {
127
- background-color: var(--nile-tag-gray-hover-background-color);
128
- }
129
-
130
- /* .tag--gray:active > nile-icon {
131
- color: #101828;
132
- } */
133
-
134
- .tag--small {
135
- height: 24px;
136
- padding: 3px 8px;
137
- font-size: 12px;
138
- font-style: normal;
139
- font-weight: 500;
140
- line-height: 18px;
141
- }
142
123
 
143
124
  .tag--medium {
144
- height: 24px;
145
- padding: 2px 9px;
146
125
  font-size: 14px;
147
- font-style: normal;
148
- font-weight: 500;
149
- line-height: 20px;
126
+ height: 26px;
127
+ padding: 0 0.75rem;
128
+ }
129
+
130
+ .tag__remove {
131
+ margin-inline-start: 0.5rem;
150
132
  }
151
133
 
152
134
  /*
@@ -157,37 +139,14 @@ export const styles = css `
157
139
  border-radius: 9999px;
158
140
  }
159
141
 
160
- .tag__content {
161
- display: inline-block;
162
- }
163
-
164
- .tag--medium .tag__remove-wrapper {
165
- display: inline-flex;
166
- justify-content: centre;
167
- box-sizing: border-box;
168
- height: 16px;
169
- width: 16px;
170
- padding: 2px;
171
- }
142
+ .tag__prefix {
143
+ padding: 3px 6px;
144
+ }
172
145
 
173
- .tag--small .tag__remove-wrapper {
174
- display: inline-flex;
175
- justify-content: centre;
176
- box-sizing: border-box;
177
- height: 14px;
178
- width: 14px;
179
- padding: 2px;
180
- }
146
+ .tag__content {
147
+ font-size: 14px;
148
+ }
181
149
 
182
- .tag--removable {
183
- padding: 2px 2px 2px 9px;
184
- }
185
-
186
- .tag__remove:hover {
187
- cursor: pointer;
188
- --nile-remove-icon-color: #101828;
189
- color: red;
190
- }
191
150
  `;
192
151
  export default [styles];
193
152
  //# sourceMappingURL=nile-tag.css.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"nile-tag.css.js","sourceRoot":"","sources":["../../../src/nile-tag/nile-tag.css.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAElC;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoLxB,CAAC;AAEF,eAAe,CAAC,MAAM,CAAC,CAAC","sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { css } from 'lit-element';\n\n/**\n * Tag CSS\n */\nexport const styles = css`\n :host {\n display: inline-block;\n --nile-remove-icon-color: var(--nile-colors-blue-500);\n }\n\n .tag {\n display: flex;\n align-items: center;\n justify-items: center;\n text-align: center;\n gap: 3px;\n white-space: nowrap;\n user-select: none;\n border-radius: 4px;\n box-sizing: border-box;\n color: var(--colors-text-text-secondary-700, #344054);\n font-family: var(--nile-font-family-serif);\n }\n\n /*\n * Variant modifiers\n */\n\n .tag--primary {\n background: #005ea6;\n color: #fff;\n --nile-remove-icon-color: var(--nile-colors-blue-500);\n }\n\n .tag--primary:hover {\n outline: 2px solid rgba(0, 94, 166, 0.5);\n }\n\n .tag--primary:active > nile-icon {\n color: hsl(200.4 98% 39.4%);\n }\n\n .tag--success {\n background: #a5f3e1;\n color: #000;\n --nile-remove-icon-color: var(--nile-colors-green-500);\n }\n\n .tag--success:hover {\n outline: 2px solid #43e5c0;\n }\n\n .tag--success:active > nile-icon {\n color: hsl(142.1 76.2% 36.3%);\n }\n\n .tag--normal {\n background: #e5e9eb;\n color: #000;\n --nile-remove-icon-color: var(--nile-colors-dark-500);\n }\n\n .tag--normal:hover {\n outline: 2px solid #c7ced4;\n }\n\n .tag--normal:active > nile-icon {\n color: hsl(240 5.2% 33.9%);\n }\n\n .tag--warning {\n background: #f3e0a5;\n color: #000;\n --nile-remove-icon-color: var(--nile-colors-yellow-500);\n }\n\n .tag--warning:hover {\n outline: 2px solid #e5bf43;\n }\n\n .tag--warning:active > nile-icon {\n color: hsl(32.1 94.6% 43.7%);\n }\n\n .tag--error {\n background: #f3a5aa;\n color: #000;\n --nile-remove-icon-color: var(--nile-colors-red-500);\n }\n\n .tag--error:hover {\n outline: 2px solid #e5434d;\n }\n\n .tag--error:active > nile-icon {\n color: hsl(0 72.2% 50.6%);\n }\n\n .tag--info {\n background: #a5d3f3;\n color: #000000;\n --nile-remove-icon-color: var(--nile-colors-blue-500);\n }\n\n .tag--info:hover {\n outline: 2px solid #42a3e5;\n }\n\n .tag--info:active > nile-icon {\n color: hsl(0 72.2% 50.6%);\n }\n\n .tag--gray {\n background: var(--nile-tag-gray-background-color);\n border: 1px solid var(--nile-colors-gray-light-mode-300);\n color: var(--nile-tag-gray-color);\n --nile-remove-icon-color: var(--nile-tag-gray-x-color);\n }\n\n .tag--gray:hover {\n background-color: var(--nile-tag-gray-hover-background-color);\n }\n\n /* .tag--gray:active > nile-icon {\n color: #101828;\n } */\n\n .tag--small {\n height: 24px;\n padding: 3px 8px;\n font-size: 12px;\n font-style: normal;\n font-weight: 500;\n line-height: 18px;\n }\n\n .tag--medium {\n height: 24px;\n padding: 2px 9px;\n font-size: 14px;\n font-style: normal;\n font-weight: 500;\n line-height: 20px;\n }\n\n /*\n * Pill modifier\n */\n\n .tag--pill {\n border-radius: 9999px;\n }\n\n .tag__content {\n display: inline-block;\n }\n\n .tag--medium .tag__remove-wrapper {\n display: inline-flex;\n justify-content: centre;\n box-sizing: border-box;\n height: 16px;\n width: 16px;\n padding: 2px;\n }\n\n .tag--small .tag__remove-wrapper {\n display: inline-flex;\n justify-content: centre;\n box-sizing: border-box;\n height: 14px;\n width: 14px;\n padding: 2px;\n }\n\n .tag--removable {\n padding: 2px 2px 2px 9px;\n }\n\n .tag__remove:hover {\n cursor: pointer;\n --nile-remove-icon-color: #101828;\n color: red;\n }\n`;\n\nexport default [styles];\n"]}
1
+ {"version":3,"file":"nile-tag.css.js","sourceRoot":"","sources":["../../../src/nile-tag/nile-tag.css.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAElC;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2IxB,CAAC;AAEF,eAAe,CAAC,MAAM,CAAC,CAAC","sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { css } from 'lit-element';\n\n/**\n * Tag CSS\n */\nexport const styles = css`\n :host {\n display: inline-block;\n }\n\n .tag {\n display: flex;\n align-items: center;\n border: solid 2px;\n line-height: 1;\n white-space: nowrap;\n user-select: none;\n border-radius: 4px;\n gap: 6px;\n }\n\n .tag__remove::part(base) {\n color: inherit;\n padding: 0;\n }\n\n /*\n * Variant modifiers\n */\n\n .tag--primary {\n background: #005EA6;\n border-color: #005EA6;\n border: 2px solid #005EA6;\n color: #FFF;\n }\n\n .tag--primary:hover {\n border: 2px solid rgba(0, 94, 166, 0.50);\n }\n\n .tag--primary:active > nile-icon-button {\n color: hsl(200.4 98% 39.4%);\n }\n\n .tag--success {\n background: #A5F3E1;\n border: 2px solid #A5F3E1;\n color: #000;\n }\n\n .tag--success:hover {\n border: 2px solid #43E5C0;\n }\n\n .tag--success:active > nile-icon-button {\n color: hsl(142.1 76.2% 36.3%);\n }\n\n .tag--normal {\n background: #E5E9EB;\n border: 2px solid #E5E9EB;\n color: #000;\n }\n\n .tag--normal:hover {\n border: 2px solid #C7CED4;\n }\n\n\n .tag--normal:active > nile-icon-button {\n color: hsl(240 5.2% 33.9%);\n }\n\n .tag--warning {\n background: #F3E0A5;\n border: 2px solid #F3E0A5;\n color: #000;\n }\n\n .tag--warning:hover {\n border: 2px solid #E5BF43;\n }\n\n .tag--warning:active > nile-icon-button {\n color: hsl(32.1 94.6% 43.7%);\n }\n\n\n .tag--error {\n background: #F3A5AA;\n border: 2px solid #F3A5AA;\n color: #000;\n }\n\n .tag--error:hover {\n border: 2px solid #E5434D;\n }\n\n .tag--error:active > nile-icon-button {\n color: hsl(0 72.2% 50.6%);\n }\n\n .tag--info {\n background: #A5D3F3;\n border: 2px solid #A5D3F3;\n color: #000000;\n }\n\n .tag--info:hover {\n border: 2px solid #42A3E5;\n }\n\n .tag--info:active > nile-icon-button {\n color: hsl(0 72.2% 50.6%);\n }\n\n\n .tag--medium {\n font-size: 14px;\n height: 26px;\n padding: 0 0.75rem;\n }\n\n .tag__remove {\n margin-inline-start: 0.5rem;\n }\n\n /*\n * Pill modifier\n */\n\n .tag--pill {\n border-radius: 9999px;\n }\n\n .tag__prefix {\n padding: 3px 6px;\n}\n\n .tag__content {\n font-size: 14px;\n}\n\n`;\n\nexport default [styles];\n"]}
@@ -32,7 +32,7 @@ import type { CSSResultGroup } from 'lit';
32
32
  export declare class NileTag extends NileElement {
33
33
  static styles: CSSResultGroup;
34
34
  /** The tag's theme variant. */
35
- variant: 'primary' | 'success' | 'normal' | 'warning' | 'error' | 'info' | 'gray';
35
+ variant: 'primary' | 'success' | 'normal' | 'warning' | 'error' | 'info';
36
36
  /** The tag's size. */
37
37
  size: 'small' | 'medium' | 'large';
38
38
  /** Draws a pill-style tag with rounded edges. */
@@ -40,6 +40,7 @@ export declare class NileTag extends NileElement {
40
40
  /** Makes the tag removable and shows a remove button. */
41
41
  removable: boolean;
42
42
  private handleRemoveClick;
43
+ getCloseButtonColor(): "--nile-colors-blue-500" | "--nile-colors-green-500" | "--nile-colors-dark-500" | "--nile-colors-yellow-500" | "--nile-colors-red-500";
43
44
  render(): TemplateResult<1>;
44
45
  }
45
46
  export default NileTag;
@@ -47,7 +47,26 @@ let NileTag = class NileTag extends NileElement {
47
47
  handleRemoveClick() {
48
48
  this.emit('nile-remove');
49
49
  }
50
+ getCloseButtonColor() {
51
+ switch (this.variant) {
52
+ case 'primary':
53
+ return '--nile-colors-blue-500';
54
+ case 'success':
55
+ return '--nile-colors-green-500';
56
+ case 'normal':
57
+ return '--nile-colors-dark-500';
58
+ case 'warning':
59
+ return '--nile-colors-yellow-500';
60
+ case 'error':
61
+ return '--nile-colors-red-500';
62
+ case 'info':
63
+ return '--nile-colors-blue-500';
64
+ default:
65
+ return '--nile-colors-dark-500';
66
+ }
67
+ }
50
68
  render() {
69
+ const colorVariable = this.getCloseButtonColor();
51
70
  return html `
52
71
  <span
53
72
  part="base"
@@ -60,7 +79,6 @@ let NileTag = class NileTag extends NileElement {
60
79
  'tag--warning': this.variant === 'warning',
61
80
  'tag--error': this.variant === 'error',
62
81
  'tag--info': this.variant === 'info',
63
- 'tag--gray': this.variant === 'gray',
64
82
  // Sizes
65
83
  'tag--small': this.size === 'small',
66
84
  'tag--medium': this.size === 'medium',
@@ -76,18 +94,17 @@ let NileTag = class NileTag extends NileElement {
76
94
 
77
95
  ${this.removable
78
96
  ? html `
79
- <span class="tag__remove-wrapper">
80
- <nile-icon
81
- name="close"
82
- part="remove-button"
83
- exportparts="base:remove-button__base"
84
- class="tag__remove"
85
- @click=${this.handleRemoveClick}
86
- tabindex="-1"
87
- color="var(--nile-remove-icon-color)"
88
- size="${this.size === 'small' ? '10' : '12'}"
89
- /> </nile-icon>
90
- </span>
97
+ <nile-icon-button
98
+ part="remove-button"
99
+ exportparts="base:remove-button__base"
100
+ name="close"
101
+ library="system"
102
+ label="remove"
103
+ class="tag__remove"
104
+ @click=${this.handleRemoveClick}
105
+ tabindex="-1"
106
+ color="var(${colorVariable})"
107
+ ></nile-icon-button>
91
108
  `
92
109
  : ''}
93
110
  </span>
@@ -1 +1 @@
1
- {"version":3,"file":"nile-tag.js","sourceRoot":"","sources":["../../../src/nile-tag/nile-tag.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAEH,OAAO,EAEL,IAAI,EACJ,QAAQ,GAGT,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,OAAO,sCAAsC,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,WAAW,MAAM,0BAA0B,CAAC;AAEnD;;;;;GAKG;AAEH;;;;;;;;;;;;;;GAcG;AAGI,IAAM,OAAO,GAAb,MAAM,OAAQ,SAAQ,WAAW;IAAjC;;QAGL,+BAA+B;QACF,YAAO,GAOvB,QAAQ,CAAC;QAEtB,sBAAsB;QACO,SAAI,GAAiC,QAAQ,CAAC;QAE3E,iDAAiD;QACL,SAAI,GAAG,KAAK,CAAC;QAEzD,yDAAyD;QAC5B,cAAS,GAAG,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C,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;qCAAc;AAG5B;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;0CAAmB;AApBpC,OAAO;IADnB,aAAa,CAAC,UAAU,CAAC;GACb,OAAO,CA2EnB;SA3EY,OAAO;AA6EpB,eAAe,OAAO,CAAC","sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport {\n LitElement,\n html,\n property,\n CSSResultArray,\n TemplateResult,\n} from 'lit-element';\nimport { styles } from './nile-tag.css';\nimport '../nile-icon-button/nile-icon-button';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { customElement } from 'lit/decorators.js';\nimport NileElement from '../internal/nile-element';\nimport type { CSSResultGroup } from 'lit';\n/**\n * Nile icon component.\n *\n * @tag nile-tag\n *\n */\n\n/**\n * @summary Tags are used as labels to organize things or to indicate a selection.\n * @status stable\n *\n * @dependency nile-icon-button\n *\n * @slot - The tag's content.\n *\n * @event nile-remove - Emitted when the remove button is activated.\n *\n * @csspart base - The component's base wrapper.\n * @csspart content - The tag's content.\n * @csspart remove-button - The tag's remove button, an `<nile-icon-button>`.\n * @csspart remove-button__base - The remove button's exported `base` part.\n */\n\n@customElement('nile-tag')\nexport class NileTag extends NileElement {\n static styles: CSSResultGroup = styles;\n\n /** The tag's theme variant. */\n @property({ reflect: true }) variant:\n | 'primary'\n | 'success'\n | 'normal'\n | 'warning'\n | 'error'\n | 'info'\n | 'gray' = 'normal';\n\n /** The tag's size. */\n @property({ reflect: true }) size: 'small' | 'medium' | 'large' = 'medium';\n\n /** Draws a pill-style tag with rounded edges. */\n @property({ type: Boolean, reflect: true }) pill = false;\n\n /** Makes the tag removable and shows a remove button. */\n @property({ type: Boolean }) removable = false;\n\n private handleRemoveClick() {\n this.emit('nile-remove');\n }\n \n render() {\n return html`\n <span\n part=\"base\"\n class=${classMap({\n tag: true,\n\n // Types\n 'tag--primary': this.variant === 'primary',\n 'tag--success': this.variant === 'success',\n 'tag--normal': this.variant === 'normal',\n 'tag--warning': this.variant === 'warning',\n 'tag--error': this.variant === 'error',\n 'tag--info': this.variant === 'info',\n 'tag--gray': this.variant === 'gray',\n\n // Sizes\n 'tag--small': this.size === 'small',\n 'tag--medium': this.size === 'medium',\n 'tag--large': this.size === 'large',\n\n // Modifiers\n 'tag--pill': this.pill,\n 'tag--removable': this.removable,\n })}\n >\n <slot name=\"prefix\" part=\"prefix\" class=\"tag__prefix\"></slot>\n\n <slot part=\"content\" class=\"tag__content\"></slot>\n\n ${this.removable\n ? html`\n <span class=\"tag__remove-wrapper\">\n <nile-icon \n name=\"close\"\n part=\"remove-button\"\n exportparts=\"base:remove-button__base\"\n class=\"tag__remove\"\n @click=${this.handleRemoveClick}\n tabindex=\"-1\"\n color=\"var(--nile-remove-icon-color)\"\n size=\"${this.size === 'small' ? '10' : '12'}\"\n /> </nile-icon>\n </span>\n `\n : ''}\n </span>\n `;\n }\n}\n\nexport default NileTag;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-tag': NileTag;\n }\n}\n"]}
1
+ {"version":3,"file":"nile-tag.js","sourceRoot":"","sources":["../../../src/nile-tag/nile-tag.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAEH,OAAO,EAEL,IAAI,EACJ,QAAQ,GAGT,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,OAAO,sCAAsC,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,WAAW,MAAM,0BAA0B,CAAC;AAEnD;;;;;GAKG;AAEH;;;;;;;;;;;;;;GAcG;AAGI,IAAM,OAAO,GAAb,MAAM,OAAQ,SAAQ,WAAW;IAAjC;;QAGL,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AAK,OAAO;YAEnC,YAAY;YACZ,WAAW,EAAE,IAAI,CAAC,IAAI;YACtB,gBAAgB,EAAE,IAAI,CAAC,SAAS;SAEjC,CAAC;;;;;;UAMA,IAAI,CAAC,SAAS;YACd,CAAC,CAAC,IAAI,CAAA;;;;;;;;yBAQS,IAAI,CAAC,iBAAiB;;6BAElB,aAAa;;aAE7B;YACH,CAAC,CAAC,EAAE;;KAET,CAAC;IACJ,CAAC;;AA5FM,cAAM,GAAmB,MAAM,CAAC;AAGV;IAA5B,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;wCAMN;AAGO;IAA5B,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;qCAA+C;AAG/B;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;qCAAc;AAG5B;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;0CAAmB;AAnBpC,OAAO;IADnB,aAAa,CAAC,UAAU,CAAC;GACb,OAAO,CA8FnB;SA9FY,OAAO;AAgGpB,eAAe,OAAO,CAAC","sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport {\n LitElement,\n html,\n property,\n CSSResultArray,\n TemplateResult,\n} from 'lit-element';\nimport { styles } from './nile-tag.css';\nimport '../nile-icon-button/nile-icon-button';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { customElement } from 'lit/decorators.js';\nimport NileElement from '../internal/nile-element';\nimport type { CSSResultGroup } from 'lit';\n/**\n * Nile icon component.\n *\n * @tag nile-tag\n *\n */\n\n/**\n * @summary Tags are used as labels to organize things or to indicate a selection.\n * @status stable\n *\n * @dependency nile-icon-button\n *\n * @slot - The tag's content.\n *\n * @event nile-remove - Emitted when the remove button is activated.\n *\n * @csspart base - The component's base wrapper.\n * @csspart content - The tag's content.\n * @csspart remove-button - The tag's remove button, an `<nile-icon-button>`.\n * @csspart remove-button__base - The remove button's exported `base` part.\n */\n\n@customElement('nile-tag')\nexport class NileTag extends NileElement {\n static styles: CSSResultGroup = styles;\n\n /** The tag's theme variant. */\n @property({ reflect: true }) variant:\n | 'primary'\n | 'success'\n | 'normal'\n | 'warning'\n | 'error'\n | 'info' = 'normal';\n\n /** The tag's size. */\n @property({ reflect: true }) size: 'small' | 'medium' | 'large' = 'medium';\n\n /** Draws a pill-style tag with rounded edges. */\n @property({ type: Boolean, reflect: true }) pill = false;\n\n /** Makes the tag removable and shows a remove button. */\n @property({ type: Boolean }) removable = false;\n\n private handleRemoveClick() {\n this.emit('nile-remove');\n }\n\n getCloseButtonColor() {\n switch (this.variant) {\n case 'primary':\n return '--nile-colors-blue-500'; \n case 'success':\n return '--nile-colors-green-500'; \n case 'normal':\n return '--nile-colors-dark-500'; \n case 'warning':\n return '--nile-colors-yellow-500';\n case 'error':\n return '--nile-colors-red-500';\n case 'info':\n return '--nile-colors-blue-500';\n default:\n return '--nile-colors-dark-500'; \n }\n }\n \n\n render() {\n const colorVariable = this.getCloseButtonColor();\n return html`\n <span\n part=\"base\"\n class=${classMap({\n tag: true,\n\n // Types\n 'tag--primary': this.variant === 'primary',\n 'tag--success': this.variant === 'success',\n 'tag--normal': this.variant === 'normal',\n 'tag--warning': this.variant === 'warning',\n 'tag--error': this.variant === 'error',\n 'tag--info': this.variant === 'info',\n\n // Sizes\n 'tag--small': this.size === 'small',\n 'tag--medium': this.size === 'medium',\n 'tag--large': this.size === 'large',\n\n // Modifiers\n 'tag--pill': this.pill,\n 'tag--removable': this.removable,\n\n })}\n >\n <slot name=\"prefix\" part=\"prefix\" class=\"tag__prefix\"></slot>\n\n <slot part=\"content\" class=\"tag__content\"></slot>\n\n ${this.removable\n ? html`\n <nile-icon-button\n part=\"remove-button\"\n exportparts=\"base:remove-button__base\"\n name=\"close\"\n library=\"system\"\n label=\"remove\"\n class=\"tag__remove\"\n @click=${this.handleRemoveClick}\n tabindex=\"-1\"\n color=\"var(${colorVariable})\"\n ></nile-icon-button>\n `\n : ''}\n </span>\n `;\n }\n}\n\nexport default NileTag;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-tag': NileTag;\n }\n}\n"]}