@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
@@ -13,21 +13,22 @@ import { css } from 'lit-element';
13
13
  export const styles = css`
14
14
  :host {
15
15
  display: inline-block;
16
- --nile-remove-icon-color: var(--nile-colors-blue-500);
17
16
  }
18
17
 
19
18
  .tag {
20
19
  display: flex;
21
20
  align-items: center;
22
- justify-items: center;
23
- text-align: center;
24
- gap: 3px;
21
+ border: solid 2px;
22
+ line-height: 1;
25
23
  white-space: nowrap;
26
24
  user-select: none;
27
25
  border-radius: 4px;
28
- box-sizing: border-box;
29
- color: var(--colors-text-text-secondary-700, #344054);
30
- font-family: var(--nile-font-family-serif);
26
+ gap: 6px;
27
+ }
28
+
29
+ .tag__remove::part(base) {
30
+ color: inherit;
31
+ padding: 0;
31
32
  }
32
33
 
33
34
  /*
@@ -35,120 +36,101 @@ export const styles = css`
35
36
  */
36
37
 
37
38
  .tag--primary {
38
- background: #005ea6;
39
- color: #fff;
40
- --nile-remove-icon-color: var(--nile-colors-blue-500);
39
+ background: #005EA6;
40
+ border-color: #005EA6;
41
+ border: 2px solid #005EA6;
42
+ color: #FFF;
41
43
  }
42
44
 
43
45
  .tag--primary:hover {
44
- outline: 2px solid rgba(0, 94, 166, 0.5);
46
+ border: 2px solid rgba(0, 94, 166, 0.50);
45
47
  }
46
48
 
47
- .tag--primary:active > nile-icon {
49
+ .tag--primary:active > nile-icon-button {
48
50
  color: hsl(200.4 98% 39.4%);
49
51
  }
50
52
 
51
53
  .tag--success {
52
- background: #a5f3e1;
54
+ background: #A5F3E1;
55
+ border: 2px solid #A5F3E1;
53
56
  color: #000;
54
- --nile-remove-icon-color: var(--nile-colors-green-500);
55
57
  }
56
58
 
57
59
  .tag--success:hover {
58
- outline: 2px solid #43e5c0;
60
+ border: 2px solid #43E5C0;
59
61
  }
60
62
 
61
- .tag--success:active > nile-icon {
63
+ .tag--success:active > nile-icon-button {
62
64
  color: hsl(142.1 76.2% 36.3%);
63
65
  }
64
66
 
65
67
  .tag--normal {
66
- background: #e5e9eb;
68
+ background: #E5E9EB;
69
+ border: 2px solid #E5E9EB;
67
70
  color: #000;
68
- --nile-remove-icon-color: var(--nile-colors-dark-500);
69
71
  }
70
72
 
71
73
  .tag--normal:hover {
72
- outline: 2px solid #c7ced4;
74
+ border: 2px solid #C7CED4;
73
75
  }
74
76
 
75
- .tag--normal:active > nile-icon {
77
+
78
+ .tag--normal:active > nile-icon-button {
76
79
  color: hsl(240 5.2% 33.9%);
77
80
  }
78
81
 
79
82
  .tag--warning {
80
- background: #f3e0a5;
83
+ background: #F3E0A5;
84
+ border: 2px solid #F3E0A5;
81
85
  color: #000;
82
- --nile-remove-icon-color: var(--nile-colors-yellow-500);
83
86
  }
84
87
 
85
88
  .tag--warning:hover {
86
- outline: 2px solid #e5bf43;
89
+ border: 2px solid #E5BF43;
87
90
  }
88
91
 
89
- .tag--warning:active > nile-icon {
92
+ .tag--warning:active > nile-icon-button {
90
93
  color: hsl(32.1 94.6% 43.7%);
91
94
  }
92
95
 
96
+
93
97
  .tag--error {
94
- background: #f3a5aa;
98
+ background: #F3A5AA;
99
+ border: 2px solid #F3A5AA;
95
100
  color: #000;
96
- --nile-remove-icon-color: var(--nile-colors-red-500);
97
101
  }
98
102
 
99
103
  .tag--error:hover {
100
- outline: 2px solid #e5434d;
104
+ border: 2px solid #E5434D;
101
105
  }
102
106
 
103
- .tag--error:active > nile-icon {
107
+ .tag--error:active > nile-icon-button {
104
108
  color: hsl(0 72.2% 50.6%);
105
109
  }
106
110
 
107
111
  .tag--info {
108
- background: #a5d3f3;
112
+ background: #A5D3F3;
113
+ border: 2px solid #A5D3F3;
109
114
  color: #000000;
110
- --nile-remove-icon-color: var(--nile-colors-blue-500);
111
115
  }
112
116
 
113
117
  .tag--info:hover {
114
- outline: 2px solid #42a3e5;
118
+ border: 2px solid #42A3E5;
115
119
  }
116
120
 
117
- .tag--info:active > nile-icon {
121
+ .tag--info:active > nile-icon-button {
118
122
  color: hsl(0 72.2% 50.6%);
119
123
  }
120
124
 
121
- .tag--gray {
122
- background: var(--nile-tag-gray-background-color);
123
- border: 1px solid var(--nile-colors-gray-light-mode-300);
124
- color: var(--nile-tag-gray-color);
125
- --nile-remove-icon-color: var(--nile-tag-gray-x-color);
126
- }
127
-
128
- .tag--gray:hover {
129
- background-color: var(--nile-tag-gray-hover-background-color);
130
- }
131
-
132
- /* .tag--gray:active > nile-icon {
133
- color: #101828;
134
- } */
135
-
136
- .tag--small {
137
- height: 24px;
138
- padding: 3px 8px;
139
- font-size: 12px;
140
- font-style: normal;
141
- font-weight: 500;
142
- line-height: 18px;
143
- }
144
125
 
145
126
  .tag--medium {
146
- height: 24px;
147
- padding: 2px 9px;
148
127
  font-size: 14px;
149
- font-style: normal;
150
- font-weight: 500;
151
- line-height: 20px;
128
+ height: 26px;
129
+ padding: 0 0.75rem;
130
+ }
131
+
132
+ .tag__remove {
133
+ margin-inline-start: 0.5rem;
152
134
  }
153
135
 
154
136
  /*
@@ -159,37 +141,14 @@ export const styles = css`
159
141
  border-radius: 9999px;
160
142
  }
161
143
 
162
- .tag__content {
163
- display: inline-block;
164
- }
165
-
166
- .tag--medium .tag__remove-wrapper {
167
- display: inline-flex;
168
- justify-content: centre;
169
- box-sizing: border-box;
170
- height: 16px;
171
- width: 16px;
172
- padding: 2px;
173
- }
144
+ .tag__prefix {
145
+ padding: 3px 6px;
146
+ }
174
147
 
175
- .tag--small .tag__remove-wrapper {
176
- display: inline-flex;
177
- justify-content: centre;
178
- box-sizing: border-box;
179
- height: 14px;
180
- width: 14px;
181
- padding: 2px;
182
- }
148
+ .tag__content {
149
+ font-size: 14px;
150
+ }
183
151
 
184
- .tag--removable {
185
- padding: 2px 2px 2px 9px;
186
- }
187
-
188
- .tag__remove:hover {
189
- cursor: pointer;
190
- --nile-remove-icon-color: #101828;
191
- color: red;
192
- }
193
152
  `;
194
153
 
195
154
  export default [styles];
@@ -52,8 +52,7 @@ export class NileTag extends NileElement {
52
52
  | 'normal'
53
53
  | 'warning'
54
54
  | 'error'
55
- | 'info'
56
- | 'gray' = 'normal';
55
+ | 'info' = 'normal';
57
56
 
58
57
  /** The tag's size. */
59
58
  @property({ reflect: true }) size: 'small' | 'medium' | 'large' = 'medium';
@@ -67,8 +66,29 @@ export class NileTag extends NileElement {
67
66
  private handleRemoveClick() {
68
67
  this.emit('nile-remove');
69
68
  }
69
+
70
+ getCloseButtonColor() {
71
+ switch (this.variant) {
72
+ case 'primary':
73
+ return '--nile-colors-blue-500';
74
+ case 'success':
75
+ return '--nile-colors-green-500';
76
+ case 'normal':
77
+ return '--nile-colors-dark-500';
78
+ case 'warning':
79
+ return '--nile-colors-yellow-500';
80
+ case 'error':
81
+ return '--nile-colors-red-500';
82
+ case 'info':
83
+ return '--nile-colors-blue-500';
84
+ default:
85
+ return '--nile-colors-dark-500';
86
+ }
87
+ }
70
88
 
89
+
71
90
  render() {
91
+ const colorVariable = this.getCloseButtonColor();
72
92
  return html`
73
93
  <span
74
94
  part="base"
@@ -82,7 +102,6 @@ export class NileTag extends NileElement {
82
102
  'tag--warning': this.variant === 'warning',
83
103
  'tag--error': this.variant === 'error',
84
104
  'tag--info': this.variant === 'info',
85
- 'tag--gray': this.variant === 'gray',
86
105
 
87
106
  // Sizes
88
107
  'tag--small': this.size === 'small',
@@ -92,6 +111,7 @@ export class NileTag extends NileElement {
92
111
  // Modifiers
93
112
  'tag--pill': this.pill,
94
113
  'tag--removable': this.removable,
114
+
95
115
  })}
96
116
  >
97
117
  <slot name="prefix" part="prefix" class="tag__prefix"></slot>
@@ -100,18 +120,17 @@ export class NileTag extends NileElement {
100
120
 
101
121
  ${this.removable
102
122
  ? html`
103
- <span class="tag__remove-wrapper">
104
- <nile-icon
105
- name="close"
106
- part="remove-button"
107
- exportparts="base:remove-button__base"
108
- class="tag__remove"
109
- @click=${this.handleRemoveClick}
110
- tabindex="-1"
111
- color="var(--nile-remove-icon-color)"
112
- size="${this.size === 'small' ? '10' : '12'}"
113
- /> </nile-icon>
114
- </span>
123
+ <nile-icon-button
124
+ part="remove-button"
125
+ exportparts="base:remove-button__base"
126
+ name="close"
127
+ library="system"
128
+ label="remove"
129
+ class="tag__remove"
130
+ @click=${this.handleRemoveClick}
131
+ tabindex="-1"
132
+ color="var(${colorVariable})"
133
+ ></nile-icon-button>
115
134
  `
116
135
  : ''}
117
136
  </span>