@aquera/nile-elements 1.6.8 → 1.7.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.
Files changed (92) hide show
  1. package/README.md +11 -0
  2. package/dist/index.cjs.js +1 -1
  3. package/dist/index.esm.js +1 -1
  4. package/dist/index.js +297 -132
  5. package/dist/nile-auto-complete/nile-auto-complete.cjs.js +1 -1
  6. package/dist/nile-auto-complete/nile-auto-complete.cjs.js.map +1 -1
  7. package/dist/nile-auto-complete/nile-auto-complete.esm.js +1 -1
  8. package/dist/nile-calendar/nile-calendar.cjs.js +1 -1
  9. package/dist/nile-calendar/nile-calendar.cjs.js.map +1 -1
  10. package/dist/nile-calendar/nile-calendar.css.cjs.js +1 -1
  11. package/dist/nile-calendar/nile-calendar.css.cjs.js.map +1 -1
  12. package/dist/nile-calendar/nile-calendar.css.esm.js +0 -3
  13. package/dist/nile-calendar/nile-calendar.esm.js +2 -2
  14. package/dist/nile-color-picker/index.cjs.js +2 -0
  15. package/dist/nile-color-picker/index.cjs.js.map +1 -0
  16. package/dist/nile-color-picker/index.esm.js +1 -0
  17. package/dist/nile-color-picker/nile-color-picker.cjs.js +2 -0
  18. package/dist/nile-color-picker/nile-color-picker.cjs.js.map +1 -0
  19. package/dist/nile-color-picker/nile-color-picker.css.cjs.js +2 -0
  20. package/dist/nile-color-picker/nile-color-picker.css.cjs.js.map +1 -0
  21. package/dist/nile-color-picker/nile-color-picker.css.esm.js +1 -0
  22. package/dist/nile-color-picker/nile-color-picker.esm.js +111 -0
  23. package/dist/nile-color-swatch/index.cjs.js +2 -0
  24. package/dist/nile-color-swatch/index.cjs.js.map +1 -0
  25. package/dist/nile-color-swatch/index.esm.js +1 -0
  26. package/dist/nile-color-swatch/nile-color-swatch.cjs.js +2 -0
  27. package/dist/nile-color-swatch/nile-color-swatch.cjs.js.map +1 -0
  28. package/dist/nile-color-swatch/nile-color-swatch.css.cjs.js +2 -0
  29. package/dist/nile-color-swatch/nile-color-swatch.css.cjs.js.map +1 -0
  30. package/dist/nile-color-swatch/nile-color-swatch.css.esm.js +44 -0
  31. package/dist/nile-color-swatch/nile-color-swatch.esm.js +16 -0
  32. package/dist/nile-dropdown/nile-dropdown.cjs.js +1 -1
  33. package/dist/nile-dropdown/nile-dropdown.cjs.js.map +1 -1
  34. package/dist/nile-dropdown/nile-dropdown.esm.js +1 -1
  35. package/dist/nile-stepper-item/nile-stepper-item.cjs.js +1 -1
  36. package/dist/nile-stepper-item/nile-stepper-item.cjs.js.map +1 -1
  37. package/dist/nile-stepper-item/nile-stepper-item.esm.js +13 -13
  38. package/dist/nile-vertical-stepper-item/nile-vertical-stepper-item.cjs.js +1 -1
  39. package/dist/nile-vertical-stepper-item/nile-vertical-stepper-item.cjs.js.map +1 -1
  40. package/dist/nile-vertical-stepper-item/nile-vertical-stepper-item.esm.js +1 -1
  41. package/dist/src/index.d.ts +3 -0
  42. package/dist/src/index.js +2 -0
  43. package/dist/src/index.js.map +1 -1
  44. package/dist/src/nile-auto-complete/nile-auto-complete.js +1 -1
  45. package/dist/src/nile-auto-complete/nile-auto-complete.js.map +1 -1
  46. package/dist/src/nile-calendar/nile-calendar.css.js +0 -3
  47. package/dist/src/nile-calendar/nile-calendar.css.js.map +1 -1
  48. package/dist/src/nile-calendar/nile-calendar.js +2 -2
  49. package/dist/src/nile-calendar/nile-calendar.js.map +1 -1
  50. package/dist/src/nile-color-picker/index.d.ts +3 -0
  51. package/dist/src/nile-color-picker/index.js +3 -0
  52. package/dist/src/nile-color-picker/index.js.map +1 -0
  53. package/dist/src/nile-color-picker/nile-color-picker.css.d.ts +1 -0
  54. package/dist/src/nile-color-picker/nile-color-picker.css.js +228 -0
  55. package/dist/src/nile-color-picker/nile-color-picker.css.js.map +1 -0
  56. package/dist/src/nile-color-picker/nile-color-picker.d.ts +92 -0
  57. package/dist/src/nile-color-picker/nile-color-picker.js +613 -0
  58. package/dist/src/nile-color-picker/nile-color-picker.js.map +1 -0
  59. package/dist/src/nile-color-swatch/index.d.ts +1 -0
  60. package/dist/src/nile-color-swatch/index.js +2 -0
  61. package/dist/src/nile-color-swatch/index.js.map +1 -0
  62. package/dist/src/nile-color-swatch/nile-color-swatch.css.d.ts +1 -0
  63. package/dist/src/nile-color-swatch/nile-color-swatch.css.js +46 -0
  64. package/dist/src/nile-color-swatch/nile-color-swatch.css.js.map +1 -0
  65. package/dist/src/nile-color-swatch/nile-color-swatch.d.ts +15 -0
  66. package/dist/src/nile-color-swatch/nile-color-swatch.js +66 -0
  67. package/dist/src/nile-color-swatch/nile-color-swatch.js.map +1 -0
  68. package/dist/src/nile-dropdown/nile-dropdown.d.ts +2 -0
  69. package/dist/src/nile-dropdown/nile-dropdown.js +21 -5
  70. package/dist/src/nile-dropdown/nile-dropdown.js.map +1 -1
  71. package/dist/src/nile-stepper-item/nile-stepper-item.js +1 -1
  72. package/dist/src/nile-stepper-item/nile-stepper-item.js.map +1 -1
  73. package/dist/src/nile-vertical-stepper-item/nile-vertical-stepper-item.js +1 -1
  74. package/dist/src/nile-vertical-stepper-item/nile-vertical-stepper-item.js.map +1 -1
  75. package/dist/src/version.js +1 -1
  76. package/dist/src/version.js.map +1 -1
  77. package/dist/tsconfig.tsbuildinfo +1 -1
  78. package/package.json +5 -3
  79. package/src/index.ts +3 -0
  80. package/src/nile-auto-complete/nile-auto-complete.ts +1 -1
  81. package/src/nile-calendar/nile-calendar.css.ts +0 -3
  82. package/src/nile-calendar/nile-calendar.ts +2 -2
  83. package/src/nile-color-picker/index.ts +3 -0
  84. package/src/nile-color-picker/nile-color-picker.css.ts +225 -0
  85. package/src/nile-color-picker/nile-color-picker.ts +541 -0
  86. package/src/nile-color-swatch/index.ts +1 -0
  87. package/src/nile-color-swatch/nile-color-swatch.css.ts +46 -0
  88. package/src/nile-color-swatch/nile-color-swatch.ts +72 -0
  89. package/src/nile-dropdown/nile-dropdown.ts +23 -5
  90. package/src/nile-stepper-item/nile-stepper-item.ts +1 -1
  91. package/src/nile-vertical-stepper-item/nile-vertical-stepper-item.ts +1 -1
  92. package/vscode-html-custom-data.json +126 -20
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "Webcomponent nile-elements following open-wc recommendations",
4
4
  "license": "MIT",
5
5
  "author": "nile-elements",
6
- "version": "1.6.8",
6
+ "version": "1.7.0",
7
7
  "main": "dist/src/index.js",
8
8
  "type": "module",
9
9
  "module": "dist/src/index.js",
@@ -124,7 +124,9 @@
124
124
  "./nile-inline-sidebar-item-body": "./dist/src/nile-inline-sidebar-item-body/index.js",
125
125
  "./nile-nav-tab-group": "./dist/src/nile-nav-tab-group/index.js",
126
126
  "./nile-nav-tab": "./dist/src/nile-nav-tab/index.js",
127
- "./nile-nav-tab-panel": "./dist/src/nile-nav-tab-panel/index.js"
127
+ "./nile-nav-tab-panel": "./dist/src/nile-nav-tab-panel/index.js",
128
+ "./nile-color-picker": "./dist/src/nile-color-picker/index.js",
129
+ "./nile-color-swatch": "./dist/src/nile-color-swatch/index.js"
128
130
  },
129
131
  "scripts": {
130
132
  "analyze": "cem analyze --litelement",
@@ -229,4 +231,4 @@
229
231
  "prettier --write"
230
232
  ]
231
233
  }
232
- }
234
+ }
package/src/index.ts CHANGED
@@ -91,6 +91,9 @@ export { NileGridHeadItem } from './nile-grid/nile-grid-head-item';
91
91
  export { NileGridCellItem } from './nile-grid/nile-grid-cell-item';
92
92
  export { NileGridHead } from './nile-grid/nile-grid-head';
93
93
  export { NileRichTextEditor } from './nile-rich-text-editor';
94
+ export { NileColorPicker } from './nile-color-picker';
95
+ export type { ColorPickerType, SwatchTooltip, PaletteEntry } from './nile-color-picker';
96
+ export { NileColorSwatch } from './nile-color-swatch';
94
97
 
95
98
  // Import version utility to set nile version in window object
96
99
  import './version';
@@ -33,7 +33,7 @@ export class NileAutoComplete extends NileElement {
33
33
 
34
34
  // Define component properties
35
35
 
36
- @property({ type: Boolean }) disabled: boolean = false;
36
+ @property({ type: Boolean, reflect: true }) disabled: boolean = false;
37
37
 
38
38
  @property({ type: Boolean }) isDropdownOpen: boolean = false;
39
39
 
@@ -640,9 +640,6 @@ export const styles = css`
640
640
  }
641
641
  :host([disabled]) .duration__value {
642
642
  cursor: not-allowed;
643
- background: var(--nile-colors-dark-200, var(--ng-colors-bg-disabled-subtle));
644
- color: var(--nile-colors-dark-500, var(--ng-colors-fg-disabled));
645
- border-color: var(--nile-colors-neutral-400, var(--ng-colors-border-disabled));
646
643
  }
647
644
  `;
648
645
 
@@ -295,7 +295,7 @@ private handleEndDateInput(event: CustomEvent): void {
295
295
  class="clear-button"
296
296
  variant="secondary"
297
297
  role="button"
298
- ?disabled="${ !this.startDate || !this.endDate }"
298
+ ?disabled="${ !this.startDate || !this.endDate || this.disabled }"
299
299
  @keydown="${(e: KeyboardEvent) => {if (e.key === 'Enter' || e.key === ' ') this.clearDate();}}"
300
300
  @click="${this.clearDate}"
301
301
 
@@ -303,7 +303,7 @@ private handleEndDateInput(event: CustomEvent): void {
303
303
  }
304
304
  <nile-button
305
305
  class="apply-button"
306
- ?disabled="${ !this.startDate || !this.endDate }"
306
+ ?disabled="${ !this.startDate || !this.endDate || this.disabled }"
307
307
  @click="${this.confimRange}"
308
308
  @keydown="${(e: KeyboardEvent) => {if (e.key === 'Enter' || e.key === ' ') this.confimRange();}}"
309
309
  > Apply</nile-button>
@@ -0,0 +1,3 @@
1
+ export { NileColorPicker } from './nile-color-picker';
2
+ export type { ColorPickerType, ColorPickerMode, SwatchTooltip, PaletteEntry } from './nile-color-picker';
3
+ export { DEFAULT_PALETTE, hexToRgb, rgbToHex, rgbToHsv, hsvToRgb } from './nile-color-picker';
@@ -0,0 +1,225 @@
1
+ export function getCssText(): string { return `
2
+
3
+ .ncp-trigger {
4
+ display: block;
5
+ width: 20px;
6
+ height: 20px;
7
+ border-radius: 4px;
8
+ border: 1px solid var(--nile-colors-neutral-500, var(--ng-colors-border-secondary));
9
+ padding: 0;
10
+ cursor: pointer;
11
+ box-sizing: border-box;
12
+ transition: box-shadow 0.15s ease, transform 0.15s ease;
13
+ }
14
+ .ncp-trigger:hover {
15
+ transform: translateY(-1px);
16
+ }
17
+ .ncp-trigger:focus-visible {
18
+ outline: none;
19
+ }
20
+ .ncp-trigger--no-fill {
21
+ background:
22
+ repeating-conic-gradient(#E4E7EC 0% 25%, #FFFFFF 0% 50%)
23
+ 0 0 / 12px 12px;
24
+ }
25
+
26
+ /* ── inline panel ────────────────────────────────────────────────── */
27
+ .ncp-panel {
28
+ padding: 8px;
29
+ background: #FFFFFF;
30
+ box-sizing: border-box;
31
+ width: 236px;
32
+ border-radius: 8px;
33
+ }
34
+ .ncp-panel--picker {
35
+ width: 260px;
36
+ }
37
+
38
+ .ncp-palette-grid {
39
+ display: grid;
40
+ grid-template-columns: repeat(8, 24px);
41
+ column-gap: 4px;
42
+ row-gap: 4px;
43
+ align-content: start;
44
+ max-height: min(240px, 42vh);
45
+ overflow-x: hidden;
46
+ overflow-y: auto;
47
+ -webkit-overflow-scrolling: touch;
48
+ min-height: 0;
49
+ }
50
+ nile-popover#color-picker-popover::part(popover) {
51
+ min-width: 236px;
52
+ gap: 0px;
53
+ padding: 4px;
54
+ }
55
+
56
+ /* no fill */
57
+ .ncp-no-fill {
58
+ display: flex;
59
+ align-items: center;
60
+ justify-content: center;
61
+ gap: 6px;
62
+ width: 100%;
63
+ margin-top: 8px;
64
+ padding: 8px 0;
65
+ border: 1px solid var(--nile-colors-neutral-500, var(--ng-colors-border-secondary));
66
+ border-radius: 8px;
67
+ background: #FFFFFF;
68
+ color: #475467;
69
+ font-size: 13px;
70
+ font-weight: 500;
71
+ cursor: pointer;
72
+ transition: background 0.15s ease;
73
+ }
74
+ .ncp-no-fill:hover { background: #F9FAFB; }
75
+
76
+ /* custom section */
77
+ .ncp-custom-section {
78
+ margin-top: 16px;
79
+ padding-top: 8px;
80
+ border-top: 1px solid #EAECF0;
81
+ }
82
+ .ncp-custom-title {
83
+ margin: 0 0 8px;
84
+ color: var(--nile-colors-dark-500, var(--ng-colors-text-secondary-700));
85
+ font-size: 13px;
86
+ font-weight: 600;
87
+ line-height: 18px;
88
+ font-weight: 500;
89
+ }
90
+ .ncp-custom-row {
91
+ display: flex;
92
+ flex-wrap: wrap;
93
+ align-items: center;
94
+ gap: 4px;
95
+ }
96
+ /* tooltip wrappers default to inline — must be block so flex aligns them correctly */
97
+ .ncp-custom-row nile-lite-tooltip {
98
+ display: block;
99
+ line-height: 0;
100
+ }
101
+ .ncp-custom-row nile-color-swatch {
102
+ display: block;
103
+ }
104
+ .ncp-action-btn {
105
+ width: 24px;
106
+ height: 24px;
107
+ display: inline-flex;
108
+ align-items: center;
109
+ justify-content: center;
110
+ border-radius: 6px;
111
+ border: 1.5px solid #CBD5E1;
112
+ background: #FFFFFF;
113
+ color: #111827;
114
+ cursor: pointer;
115
+ box-sizing: border-box;
116
+ padding: 0;
117
+ transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
118
+ }
119
+ .ncp-action-btn:hover {
120
+ border-color: #98A2B3;
121
+ background: #F8FAFC;
122
+ transform: translateY(-1px);
123
+ }
124
+ .ncp-plus-icon {
125
+ position: relative;
126
+ width: 12px;
127
+ height: 12px;
128
+ }
129
+ .ncp-plus-icon::before,
130
+ .ncp-plus-icon::after {
131
+ content: '';
132
+ position: absolute;
133
+ left: 50%; top: 50%;
134
+ background: currentColor;
135
+ transform: translate(-50%,-50%);
136
+ border-radius: 999px;
137
+ }
138
+ .ncp-plus-icon::before { width: 12px; height: 2px; }
139
+ .ncp-plus-icon::after { width: 2px; height: 12px; }
140
+
141
+ /* ── picker panel ───────────────────────────────────────────────── */
142
+ .ncp-sv-area {
143
+ position: relative;
144
+ width: 244px;
145
+ height: 130px;
146
+ border-radius: 8px;
147
+ overflow: hidden;
148
+ cursor: crosshair;
149
+ user-select: none;
150
+ }
151
+ .ncp-sv-canvas { display: block; width: 100%; height: 100%; }
152
+ .ncp-sv-thumb {
153
+ position: absolute;
154
+ width: 20px; height: 20px;
155
+ transform: translate(-50%,-50%);
156
+ pointer-events: none;
157
+ }
158
+ .ncp-sv-thumb-inner {
159
+ width: 20px; height: 20px;
160
+ border-radius: 50%;
161
+ border: 2.5px solid #FFFFFF;
162
+ box-shadow: 0 0 0 1px rgba(0,0,0,0.15), 0 2px 6px rgba(0,0,0,0.2);
163
+ box-sizing: border-box;
164
+ }
165
+
166
+ .ncp-hue-row {
167
+ display: flex;
168
+ align-items: center;
169
+ gap: 10px;
170
+ margin-top: 14px;
171
+ }
172
+ .ncp-hue-wrap {
173
+ position: relative;
174
+ flex: 1;
175
+ height: 14px;
176
+ border-radius: 7px;
177
+ overflow: hidden;
178
+ cursor: pointer;
179
+ user-select: none;
180
+ }
181
+ .ncp-hue-canvas { display: block; width: 100%; height: 100%; border-radius: 7px; }
182
+ .ncp-hue-thumb {
183
+ position: absolute;
184
+ top: 50%;
185
+ width: 18px; height: 18px;
186
+ border-radius: 50%;
187
+ border: 2.5px solid #FFFFFF;
188
+ box-shadow: 0 0 0 1px rgba(0,0,0,0.12), 0 2px 4px rgba(0,0,0,0.18);
189
+ transform: translate(-50%,-50%);
190
+ pointer-events: none;
191
+ box-sizing: border-box;
192
+ }
193
+ .ncp-eyedropper {
194
+ width: 28px; height: 28px;
195
+ display: flex; align-items: center; justify-content: center;
196
+ border: none; background: none;
197
+ color: #475467; cursor: pointer; padding: 0; border-radius: 6px;
198
+ }
199
+ .ncp-eyedropper:hover { background: #F3F4F6; }
200
+
201
+ .ncp-input-row {
202
+ display: flex;
203
+ align-items: center;
204
+ gap: 6px;
205
+ margin-top: 14px;
206
+ }
207
+ /* Safari: display:block needed so the custom element participates in flex layout */
208
+ .ncp-input-row .ncp-mode-dropdown { display: block; flex-shrink: 0; width: 62px; min-width: 62px; }
209
+ .ncp-input-row .ncp-mode-dropdown nile-button.ncp-mode-btn { width: 100%; min-width: 0; white-space: nowrap; }
210
+ .ncp-input-row .ncp-mode-dropdown nile-button.ncp-mode-btn::part(base) {
211
+ padding: 0 6px; width: 100%; min-width: 0; font-size: 11px; gap: 2px;
212
+ }
213
+ /* Safari: custom elements default to display:inline — must be block to flex-grow */
214
+ .ncp-input-row nile-input.ncp-hex { display: block; flex: 1; min-width: 0; }
215
+ .ncp-input-row nile-input.ncp-rgb { display: block; flex: 1; min-width: 0; }
216
+ .ncp-input-row nile-input.ncp-rgb::part(input)::-webkit-inner-spin-button,
217
+ .ncp-input-row nile-input.ncp-rgb::part(input)::-webkit-outer-spin-button { -webkit-appearance: none; }
218
+
219
+ .ncp-picker-actions {
220
+ display: flex;
221
+ justify-content: flex-end;
222
+ gap: 8px;
223
+ margin-top: 16px;
224
+ }
225
+ `; }