@aquera/nile-elements 0.0.3-2 → 0.0.3-4
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/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-input/nile-input.css.js +14 -8
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-input/nile-input.css.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-option/nile-option.d.ts +2 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-option/nile-option.js +23 -9
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-option/nile-option.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-select/nile-select.css.js +17 -4
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-select/nile-select.css.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-select/nile-select.d.ts +6 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-select/nile-select.js +40 -19
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-select/nile-select.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-textarea/nile-textarea.css.js +7 -8
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-textarea/nile-textarea.css.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/index.iife.js +72 -56
- package/dist/nile-input/nile-input.css.cjs.js +1 -1
- package/dist/nile-input/nile-input.css.cjs.js.map +1 -1
- package/dist/nile-input/nile-input.css.esm.js +14 -8
- package/dist/nile-option/index.cjs.js +1 -1
- package/dist/nile-option/index.esm.js +1 -1
- package/dist/nile-option/nile-option.cjs.js +1 -1
- package/dist/nile-option/nile-option.cjs.js.map +1 -1
- package/dist/nile-option/nile-option.esm.js +6 -10
- package/dist/nile-select/nile-select.cjs.js +1 -1
- package/dist/nile-select/nile-select.cjs.js.map +1 -1
- package/dist/nile-select/nile-select.css.cjs.js +1 -1
- package/dist/nile-select/nile-select.css.cjs.js.map +1 -1
- package/dist/nile-select/nile-select.css.esm.js +17 -4
- package/dist/nile-select/nile-select.esm.js +21 -19
- package/dist/nile-textarea/nile-textarea.css.cjs.js +1 -1
- package/dist/nile-textarea/nile-textarea.css.cjs.js.map +1 -1
- package/dist/nile-textarea/nile-textarea.css.esm.js +7 -8
- package/dist/src/nile-input/nile-input.css.js +14 -8
- package/dist/src/nile-input/nile-input.css.js.map +1 -1
- package/dist/src/nile-option/nile-option.d.ts +2 -0
- package/dist/src/nile-option/nile-option.js +23 -9
- package/dist/src/nile-option/nile-option.js.map +1 -1
- package/dist/src/nile-select/nile-select.css.js +17 -4
- package/dist/src/nile-select/nile-select.css.js.map +1 -1
- package/dist/src/nile-select/nile-select.d.ts +6 -0
- package/dist/src/nile-select/nile-select.js +40 -19
- package/dist/src/nile-select/nile-select.js.map +1 -1
- package/dist/src/nile-textarea/nile-textarea.css.js +7 -8
- package/dist/src/nile-textarea/nile-textarea.css.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/nile-input/nile-input.css.ts +14 -8
- package/src/nile-option/nile-option.ts +22 -9
- package/src/nile-select/nile-select.css.ts +17 -4
- package/src/nile-select/nile-select.ts +39 -29
- package/src/nile-textarea/nile-textarea.css.ts +7 -8
package/package.json
CHANGED
@@ -44,7 +44,7 @@ export const styles = css`
|
|
44
44
|
:host([required]) .form-control--has-label .form-control__label::after {
|
45
45
|
content: '*';
|
46
46
|
margin-inline-start: -2px;
|
47
|
-
color:
|
47
|
+
color: #A4121C;
|
48
48
|
}
|
49
49
|
|
50
50
|
/* Help text */
|
@@ -81,16 +81,19 @@ export const styles = css`
|
|
81
81
|
justify-content: start;
|
82
82
|
position: relative;
|
83
83
|
width: 100%;
|
84
|
-
font-family: inherit;
|
85
84
|
font-weight: 400;
|
86
|
-
letter-spacing: normal;
|
87
85
|
vertical-align: middle;
|
88
86
|
overflow: hidden;
|
89
87
|
cursor: text;
|
90
88
|
transition: 150ms color, 150ms border, 150ms box-shadow,
|
91
89
|
150ms background-color;
|
92
90
|
box-sizing: border-box;
|
93
|
-
|
91
|
+
color: var(--nile-colors-dark-900);
|
92
|
+
font-family: Colfax-regular;
|
93
|
+
font-size: 14px;
|
94
|
+
font-style: normal;
|
95
|
+
line-height: 14px;
|
96
|
+
letter-spacing: 0.2px; }
|
94
97
|
|
95
98
|
/* Standard inputs */
|
96
99
|
.input--standard {
|
@@ -164,12 +167,8 @@ export const styles = css`
|
|
164
167
|
|
165
168
|
.input__control {
|
166
169
|
flex: 1 1 auto;
|
167
|
-
font-family: inherit;
|
168
|
-
font-size: inherit;
|
169
|
-
font-weight: inherit;
|
170
170
|
min-width: 0;
|
171
171
|
height: 100%;
|
172
|
-
color: hsl(240 5.3% 26.1%);
|
173
172
|
border: none;
|
174
173
|
background: none;
|
175
174
|
box-shadow: none;
|
@@ -177,6 +176,13 @@ export const styles = css`
|
|
177
176
|
margin: 0;
|
178
177
|
cursor: inherit;
|
179
178
|
-webkit-appearance: none;
|
179
|
+
color: var(--nile-colors-dark-900);
|
180
|
+
font-family: Colfax-regular;
|
181
|
+
font-size: 14px;
|
182
|
+
font-style: normal;
|
183
|
+
font-weight: 400;
|
184
|
+
line-height: 14px;
|
185
|
+
letter-spacing: 0.2px;
|
180
186
|
}
|
181
187
|
|
182
188
|
.input__control::-webkit-search-decoration,
|
@@ -14,6 +14,7 @@ import { html } from 'lit';
|
|
14
14
|
import { watch } from '../internal/watch';
|
15
15
|
import type { CSSResultGroup } from 'lit';
|
16
16
|
import NileElement from '../internal/nile-element';
|
17
|
+
import '../nile-checkbox';
|
17
18
|
|
18
19
|
/**
|
19
20
|
* Nile icon component.
|
@@ -51,6 +52,7 @@ export class NileOption extends NileElement {
|
|
51
52
|
@state() selected = false; // the option is selected and has aria-selected="true"
|
52
53
|
@state() hasHover = false; // we need this because Safari doesn't honor :hover styles while dragging
|
53
54
|
@state() hidden = false; // the option is hidden
|
55
|
+
@state() isMultipleSelect = false;
|
54
56
|
|
55
57
|
/**
|
56
58
|
* The option's value. When selected, the containing form control will receive this value. The value must be unique
|
@@ -66,6 +68,20 @@ export class NileOption extends NileElement {
|
|
66
68
|
super.connectedCallback();
|
67
69
|
this.setAttribute('role', 'option');
|
68
70
|
this.setAttribute('aria-selected', 'false');
|
71
|
+
|
72
|
+
// Find the closest parent 'nile-select' element
|
73
|
+
const parentSelect = this.closest('nile-select');
|
74
|
+
|
75
|
+
// Check if the parent has the 'multiple' attribute
|
76
|
+
if (parentSelect && parentSelect.hasAttribute('multiple')) {
|
77
|
+
let multipleValue = parentSelect.getAttribute('multiple');
|
78
|
+
if (multipleValue !== 'false') {
|
79
|
+
if(multipleValue === ''){
|
80
|
+
multipleValue = 'true';
|
81
|
+
}
|
82
|
+
this.isMultipleSelect = Boolean(multipleValue);
|
83
|
+
}
|
84
|
+
}
|
69
85
|
}
|
70
86
|
|
71
87
|
private handleDefaultSlotChange() {
|
@@ -135,21 +151,18 @@ export class NileOption extends NileElement {
|
|
135
151
|
part="base"
|
136
152
|
class=${classMap({
|
137
153
|
option: true,
|
138
|
-
'option--current': this.current,
|
154
|
+
// 'option--current': this.current,
|
155
|
+
'option--current': this.selected && !this.isMultipleSelect,
|
139
156
|
'option--disabled': this.disabled,
|
140
|
-
'option--selected': this.selected,
|
157
|
+
'option--selected': this.selected && !this.isMultipleSelect,
|
141
158
|
'option--hover': this.hasHover,
|
142
159
|
})}
|
143
160
|
@mouseenter=${this.handleMouseEnter}
|
144
161
|
@mouseleave=${this.handleMouseLeave}
|
145
162
|
>
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
name="tick"
|
150
|
-
color=${this.current ? '#005EA6' : ''}
|
151
|
-
aria-hidden="true"
|
152
|
-
></nile-icon>
|
163
|
+
|
164
|
+
${this.isMultipleSelect ? html`<nile-checkbox style="pointer-events: none;" .checked=${this.selected}></nile-checkbox>` : ''}
|
165
|
+
|
153
166
|
<slot part="prefix" name="prefix" class="option__prefix"></slot>
|
154
167
|
<slot
|
155
168
|
part="label"
|
@@ -205,6 +205,11 @@ export const styles = css`
|
|
205
205
|
border: solid 1px #cccccc;
|
206
206
|
}
|
207
207
|
|
208
|
+
.select--standard .select__combobox:hover {
|
209
|
+
border: 1px solid #000;
|
210
|
+
background: #fff;
|
211
|
+
}
|
212
|
+
|
208
213
|
.select--standard.select--disabled .select__combobox {
|
209
214
|
background-color: #f4f4f4;
|
210
215
|
border-color: #cccccc;
|
@@ -218,7 +223,18 @@ export const styles = css`
|
|
218
223
|
.select--standard:not(.select--disabled).select--focused .select__combobox {
|
219
224
|
background-color: #f4f4f4;
|
220
225
|
border-color: #0059ff;
|
221
|
-
|
226
|
+
}
|
227
|
+
|
228
|
+
.select--warning .select__combobox {
|
229
|
+
border-color: var(--nile-colors-yellow-500);
|
230
|
+
}
|
231
|
+
|
232
|
+
.select--error .select__combobox {
|
233
|
+
border-color: #e5434d;
|
234
|
+
}
|
235
|
+
|
236
|
+
.select--success {
|
237
|
+
border-color: #43e5c0;
|
222
238
|
}
|
223
239
|
|
224
240
|
/* Filled selects */
|
@@ -328,7 +344,6 @@ export const styles = css`
|
|
328
344
|
position: relative;
|
329
345
|
font-size: 1rem;
|
330
346
|
font-weight: 400;
|
331
|
-
box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.15);
|
332
347
|
background: #ffffff;
|
333
348
|
border: solid 1px #cccccc;
|
334
349
|
border-radius: 0.25rem;
|
@@ -346,8 +361,6 @@ export const styles = css`
|
|
346
361
|
}
|
347
362
|
|
348
363
|
.select__options {
|
349
|
-
padding: 5px;
|
350
|
-
margin: 4px;
|
351
364
|
font-size: 14px;
|
352
365
|
color: rgb(133, 129, 129);
|
353
366
|
}
|
@@ -154,6 +154,15 @@ export class NileSelect extends NileElement implements NileFormControl {
|
|
154
154
|
|
155
155
|
@property({ attribute: 'error-message' }) errorMessage = '';
|
156
156
|
|
157
|
+
/** Sets the input to a warning state, changing its visual appearance. */
|
158
|
+
@property({ type: Boolean }) warning = false;
|
159
|
+
|
160
|
+
/** Sets the input to an error state, changing its visual appearance. */
|
161
|
+
@property({ type: Boolean }) error = false;
|
162
|
+
|
163
|
+
/** Sets the input to a success state, changing its visual appearance. */
|
164
|
+
@property({ type: Boolean }) success = false;
|
165
|
+
|
157
166
|
/**
|
158
167
|
* The maximum number of selected options to show when `multiple` is true. After the maximum, "+n" will be shown to
|
159
168
|
* indicate the number of additional items that are selected. Set to 0 to remove the limit.
|
@@ -854,6 +863,9 @@ export class NileSelect extends NileElement implements NileFormControl {
|
|
854
863
|
<nile-popup
|
855
864
|
class=${classMap({
|
856
865
|
select: true,
|
866
|
+
'select--warning': this.warning,
|
867
|
+
'select--error': this.error,
|
868
|
+
'select--success': this.success,
|
857
869
|
'select--standard': true,
|
858
870
|
'select--filled': this.filled,
|
859
871
|
'select--pill': this.pill,
|
@@ -883,11 +895,14 @@ export class NileSelect extends NileElement implements NileFormControl {
|
|
883
895
|
@keydown=${this.handleComboboxKeyDown}
|
884
896
|
@mousedown=${this.handleComboboxMouseDown}
|
885
897
|
>
|
886
|
-
<slot
|
887
|
-
|
888
|
-
|
889
|
-
|
890
|
-
|
898
|
+
<slot
|
899
|
+
part="prefix"
|
900
|
+
name="prefix"
|
901
|
+
class=${classMap({
|
902
|
+
select__prefix: true,
|
903
|
+
multiple: this.multiple,
|
904
|
+
})}
|
905
|
+
></slot>
|
891
906
|
|
892
907
|
<input
|
893
908
|
part="display-input"
|
@@ -1012,7 +1027,7 @@ export class NileSelect extends NileElement implements NileFormControl {
|
|
1012
1027
|
@mouseup=${this.handleOptionClick}
|
1013
1028
|
@slotchange=${this.handleDefaultSlotChange}
|
1014
1029
|
>
|
1015
|
-
|
1030
|
+
${this.searchEnabled
|
1016
1031
|
? html` <div class="select__search">
|
1017
1032
|
<nile-input
|
1018
1033
|
size="small"
|
@@ -1027,13 +1042,16 @@ export class NileSelect extends NileElement implements NileFormControl {
|
|
1027
1042
|
</nile-input>
|
1028
1043
|
</div>`
|
1029
1044
|
: ``}
|
1030
|
-
|
1045
|
+
<div class="select__options">
|
1031
1046
|
${this.showNoResults
|
1032
|
-
|
1033
|
-
|
1047
|
+
? html`
|
1048
|
+
<div class="select__no-results">
|
1049
|
+
${this.noResultsMessage}
|
1050
|
+
</div>
|
1051
|
+
`
|
1052
|
+
: ''}
|
1034
1053
|
<slot></slot>
|
1035
|
-
|
1036
|
-
|
1054
|
+
</div>
|
1037
1055
|
|
1038
1056
|
${this.multiple
|
1039
1057
|
? html` <div
|
@@ -1060,24 +1078,16 @@ export class NileSelect extends NileElement implements NileFormControl {
|
|
1060
1078
|
</nile-popup>
|
1061
1079
|
</div>
|
1062
1080
|
|
1063
|
-
${
|
1064
|
-
|
1065
|
-
|
1066
|
-
|
1067
|
-
|
1068
|
-
|
1069
|
-
|
1070
|
-
|
1071
|
-
|
1072
|
-
|
1073
|
-
? html`
|
1074
|
-
<nile-form-error-message
|
1075
|
-
>${this.errorMessage}</nile-form-error-message
|
1076
|
-
>
|
1077
|
-
`
|
1078
|
-
: ``
|
1079
|
-
}
|
1080
|
-
|
1081
|
+
${hasHelpText
|
1082
|
+
? html` <nile-form-help-text>${this.helpText}</nile-form-help-text> `
|
1083
|
+
: ``}
|
1084
|
+
${hasErrorMessage
|
1085
|
+
? html`
|
1086
|
+
<nile-form-error-message
|
1087
|
+
>${this.errorMessage}</nile-form-error-message
|
1088
|
+
>
|
1089
|
+
`
|
1090
|
+
: ``}
|
1081
1091
|
</div>
|
1082
1092
|
`;
|
1083
1093
|
}
|
@@ -39,7 +39,7 @@ export const styles = css`
|
|
39
39
|
:host([required]) .form-control--has-label .form-control__label::after {
|
40
40
|
content: '*';
|
41
41
|
margin-inline-start: -2px;
|
42
|
-
color:
|
42
|
+
color: #A4121C;
|
43
43
|
}
|
44
44
|
|
45
45
|
/* Help text */
|
@@ -75,9 +75,6 @@ export const styles = css`
|
|
75
75
|
align-items: center;
|
76
76
|
position: relative;
|
77
77
|
width: 100%;
|
78
|
-
font-family: Arial, sans-serif;
|
79
|
-
font-weight: 400;
|
80
|
-
line-height: 1.5;
|
81
78
|
letter-spacing: 0.5px;
|
82
79
|
vertical-align: middle;
|
83
80
|
border-radius: var(--nile-radius-base-standard);
|
@@ -145,10 +142,12 @@ export const styles = css`
|
|
145
142
|
/* Textarea control styles */
|
146
143
|
.textarea__control {
|
147
144
|
flex: 1 1 auto;
|
148
|
-
font-family:
|
149
|
-
font-size:
|
150
|
-
font-
|
151
|
-
|
145
|
+
font-family: Colfax-regular;
|
146
|
+
font-size: 14px;
|
147
|
+
font-style: normal;
|
148
|
+
font-weight: 400;
|
149
|
+
line-height: 14px; /* 100% */
|
150
|
+
letter-spacing: 0.2px;
|
152
151
|
color: var(--nile-colors-dark-900);
|
153
152
|
border: none;
|
154
153
|
background: none;
|