@aquera/nile-elements 2.0.3 → 2.0.5

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 (88) hide show
  1. package/README.md +21 -0
  2. package/demo/nxtgen-classes.css +596 -2
  3. package/demo/nxtgen-dark.css +240 -21
  4. package/demo/nxtgen-properties.css +2 -2
  5. package/demo/nxtgen-utilities.css +598 -4
  6. package/demo/nxtgen.css +57 -2
  7. package/dist/index.cjs.js +1 -1
  8. package/dist/index.esm.js +1 -1
  9. package/dist/index.js +458 -317
  10. package/dist/nile-combobox/nile-combobox.cjs.js +1 -1
  11. package/dist/nile-combobox/nile-combobox.cjs.js.map +1 -1
  12. package/dist/nile-combobox/nile-combobox.css.cjs.js +1 -1
  13. package/dist/nile-combobox/nile-combobox.css.cjs.js.map +1 -1
  14. package/dist/nile-combobox/nile-combobox.css.esm.js +28 -15
  15. package/dist/nile-combobox/nile-combobox.esm.js +11 -8
  16. package/dist/nile-combobox/portal-manager.cjs.js +1 -1
  17. package/dist/nile-combobox/portal-manager.cjs.js.map +1 -1
  18. package/dist/nile-combobox/portal-manager.esm.js +1 -1
  19. package/dist/nile-combobox/renderer.cjs.js +1 -1
  20. package/dist/nile-combobox/renderer.cjs.js.map +1 -1
  21. package/dist/nile-combobox/renderer.esm.js +31 -43
  22. package/dist/nile-empty-state/nile-empty-state.cjs.js +1 -1
  23. package/dist/nile-empty-state/nile-empty-state.cjs.js.map +1 -1
  24. package/dist/nile-empty-state/nile-empty-state.css.cjs.js +1 -1
  25. package/dist/nile-empty-state/nile-empty-state.css.cjs.js.map +1 -1
  26. package/dist/nile-empty-state/nile-empty-state.css.esm.js +129 -6
  27. package/dist/nile-empty-state/nile-empty-state.esm.js +45 -31
  28. package/dist/nile-pagination/nile-pagination.cjs.js +1 -1
  29. package/dist/nile-pagination/nile-pagination.cjs.js.map +1 -1
  30. package/dist/nile-pagination/nile-pagination.esm.js +25 -25
  31. package/dist/nile-wysiwyg-editor/engine/create-state.cjs.js +1 -1
  32. package/dist/nile-wysiwyg-editor/engine/create-state.esm.js +1 -1
  33. package/dist/nile-wysiwyg-editor/engine/index.cjs.js +1 -1
  34. package/dist/nile-wysiwyg-editor/engine/index.esm.js +1 -1
  35. package/dist/nile-wysiwyg-editor/engine/plugins/code-highlight.cjs.js +1 -1
  36. package/dist/nile-wysiwyg-editor/engine/plugins/code-highlight.cjs.js.map +1 -1
  37. package/dist/nile-wysiwyg-editor/engine/plugins/code-highlight.esm.js +1 -1
  38. package/dist/nile-wysiwyg-editor/index.cjs.js +1 -1
  39. package/dist/nile-wysiwyg-editor/index.esm.js +1 -1
  40. package/dist/nile-wysiwyg-editor/nile-wysiwyg-editor.cjs.js +1 -1
  41. package/dist/nile-wysiwyg-editor/nile-wysiwyg-editor.esm.js +1 -1
  42. package/dist/nile-wysiwyg-editor/ui/code-block-menu.cjs.js +1 -1
  43. package/dist/nile-wysiwyg-editor/ui/code-block-menu.esm.js +1 -1
  44. package/dist/nile-wysiwyg-editor/ui/source-view.cjs.js +1 -1
  45. package/dist/nile-wysiwyg-editor/ui/source-view.esm.js +1 -1
  46. package/dist/src/nile-combobox/nile-combobox.css.js +28 -15
  47. package/dist/src/nile-combobox/nile-combobox.css.js.map +1 -1
  48. package/dist/src/nile-combobox/nile-combobox.js +49 -10
  49. package/dist/src/nile-combobox/nile-combobox.js.map +1 -1
  50. package/dist/src/nile-combobox/portal-manager.js +2 -22
  51. package/dist/src/nile-combobox/portal-manager.js.map +1 -1
  52. package/dist/src/nile-combobox/renderer.d.ts +2 -3
  53. package/dist/src/nile-combobox/renderer.js +14 -45
  54. package/dist/src/nile-combobox/renderer.js.map +1 -1
  55. package/dist/src/nile-empty-state/nile-empty-state.css.js +127 -4
  56. package/dist/src/nile-empty-state/nile-empty-state.css.js.map +1 -1
  57. package/dist/src/nile-empty-state/nile-empty-state.d.ts +35 -5
  58. package/dist/src/nile-empty-state/nile-empty-state.js +159 -42
  59. package/dist/src/nile-empty-state/nile-empty-state.js.map +1 -1
  60. package/dist/src/nile-empty-state/nile-empty-state.test.d.ts +1 -0
  61. package/dist/src/nile-empty-state/nile-empty-state.test.js +186 -15
  62. package/dist/src/nile-empty-state/nile-empty-state.test.js.map +1 -1
  63. package/dist/src/nile-pagination/nile-pagination.js +5 -5
  64. package/dist/src/nile-pagination/nile-pagination.js.map +1 -1
  65. package/dist/src/version.d.ts +1 -1
  66. package/dist/src/version.js +11 -3
  67. package/dist/src/version.js.map +1 -1
  68. package/dist/tsconfig.tsbuildinfo +1 -1
  69. package/dist/version.cjs.js +1 -1
  70. package/dist/version.cjs.js.map +1 -1
  71. package/dist/version.esm.js +1 -1
  72. package/dist/xml-09119317.cjs.js +2 -0
  73. package/dist/xml-09119317.cjs.js.map +1 -0
  74. package/dist/{xml-25c4108a.esm.js → xml-9bf771b3.esm.js} +1 -1
  75. package/package.json +2 -1
  76. package/scripts/replace-version.cjs +12 -10
  77. package/src/nile-combobox/nile-combobox.css.ts +28 -15
  78. package/src/nile-combobox/nile-combobox.ts +61 -12
  79. package/src/nile-combobox/portal-manager.ts +4 -22
  80. package/src/nile-combobox/renderer.ts +26 -69
  81. package/src/nile-empty-state/nile-empty-state.css.ts +127 -4
  82. package/src/nile-empty-state/nile-empty-state.test.ts +192 -15
  83. package/src/nile-empty-state/nile-empty-state.ts +195 -34
  84. package/src/nile-pagination/nile-pagination.ts +5 -5
  85. package/src/version.ts +11 -2
  86. package/vscode-html-custom-data.json +79 -16
  87. package/dist/xml-90fd974e.cjs.js +0 -2
  88. package/dist/xml-90fd974e.cjs.js.map +0 -1
@@ -11,6 +11,41 @@ import { classMap } from 'lit/directives/class-map.js';
11
11
  import { styles } from './nile-empty-state.css';
12
12
  import NileElement from '../internal/nile-element';
13
13
  import { ifDefined } from 'lit/directives/if-defined.js';
14
+ const STATUS_PRESETS = {
15
+ 'empty': {
16
+ icon: 'ng-database', tone: 'neutral', role: 'status', live: 'polite',
17
+ text: 'No data yet', subText: `Rows appear here once there's something to show.`,
18
+ },
19
+ 'no-results': {
20
+ icon: 'ng-search-lg', tone: 'neutral', role: 'status', live: 'polite',
21
+ text: 'No matches', subText: 'Try removing a filter or broadening your search.',
22
+ },
23
+ 'not-found': {
24
+ icon: 'ng-file-06', tone: 'warning', role: 'status', live: 'polite',
25
+ text: `We couldn't find that`, subText: 'It may have been moved or deleted.',
26
+ },
27
+ 'no-access': {
28
+ icon: 'ng-lock', tone: 'warning', role: 'status', live: 'polite',
29
+ text: `You don't have access`, subText: 'Ask an admin to grant you access to this resource.',
30
+ },
31
+ 'error': {
32
+ icon: 'ng-alert-circle', tone: 'error', role: 'alert', live: 'assertive',
33
+ text: 'Something went wrong', subText: `We couldn't load this. Try again.`,
34
+ },
35
+ 'offline': {
36
+ icon: 'ng-cloud-off', tone: 'error', role: 'alert', live: 'assertive',
37
+ text: 'Connection lost', subText: 'Check your connection and try again.',
38
+ },
39
+ };
40
+ const TONE_GLYPH_COLOR = {
41
+ neutral: undefined,
42
+ info: 'var(--nile-colors-primary-600, var(--ng-colors-fg-brand-primary-600))',
43
+ warning: 'var(--nile-colors-yellow-700, var(--ng-colors-fg-warning-primary))',
44
+ error: 'var(--nile-colors-red-700, var(--ng-colors-fg-error-primary))',
45
+ };
46
+ const DEFAULT_ICON = 'ng-x-circle';
47
+ const DEFAULT_TEXT = 'Empty State';
48
+ const DEFAULT_SUB_TEXT = 'No Data';
14
49
  /**
15
50
  * Nile empty-state component.
16
51
  *
@@ -22,11 +57,8 @@ let NileEmptyState = class NileEmptyState extends NileElement {
22
57
  super(...arguments);
23
58
  this.size = 'md';
24
59
  this.variant = 'tonal';
25
- this.icon = 'var(--nile-icon-error, var(--ng-icon-x-circle))';
26
- this.grayscale = false;
27
- this.text = 'Empty State';
28
- this.subText = 'No Data';
29
- this.svgIconSize = 40;
60
+ this.layout = 'stack';
61
+ this.bordered = false;
30
62
  /* #endregion */
31
63
  }
32
64
  /**
@@ -36,56 +68,128 @@ let NileEmptyState = class NileEmptyState extends NileElement {
36
68
  static get styles() {
37
69
  return [styles];
38
70
  }
71
+ get icon() {
72
+ return this._icon ?? this.preset?.icon ?? DEFAULT_ICON;
73
+ }
74
+ set icon(value) {
75
+ const old = this.icon;
76
+ this._icon = value ?? undefined;
77
+ this.requestUpdate('icon', old);
78
+ }
79
+ /** Headline. Resolves through the `status` preset to `DEFAULT_TEXT`. */
80
+ get text() {
81
+ return this._text ?? this.preset?.text ?? DEFAULT_TEXT;
82
+ }
83
+ set text(value) {
84
+ const old = this.text;
85
+ this._text = value ?? undefined;
86
+ this.requestUpdate('text', old);
87
+ }
88
+ /** Supporting line. Resolves through the `status` preset to `DEFAULT_SUB_TEXT`. */
89
+ get subText() {
90
+ return this._subText ?? this.preset?.subText ?? DEFAULT_SUB_TEXT;
91
+ }
92
+ set subText(value) {
93
+ const old = this.subText;
94
+ this._subText = value ?? undefined;
95
+ this.requestUpdate('subText', old);
96
+ }
97
+ get tone() {
98
+ return this._tone ?? this.preset?.tone ?? 'neutral';
99
+ }
100
+ set tone(value) {
101
+ const old = this.tone;
102
+ this._tone = value ?? undefined;
103
+ this.requestUpdate('tone', old);
104
+ }
39
105
  /* #endregion */
40
106
  /* #region Methods */
107
+ /** The preset backing the current `status`, or undefined when none is set. */
108
+ get preset() {
109
+ return this.status ? STATUS_PRESETS[this.status] : undefined;
110
+ }
111
+ get glyphColor() {
112
+ return this.svgIconColor ?? TONE_GLYPH_COLOR[this.tone];
113
+ }
114
+ /** ARIA wiring */
115
+ get liveRegion() {
116
+ const preset = this.preset;
117
+ if (!preset)
118
+ return undefined;
119
+ return { role: preset.role, live: preset.live };
120
+ }
121
+ renderGlyph(size) {
122
+ const color = this.glyphColor;
123
+ return this.svgIconUrl ? html `
124
+ <nile-glyph
125
+ customSvgPath="${this.svgIconUrl}"
126
+ size="${this.svgIconSize ?? size}"
127
+ method="stroke"
128
+ color="${ifDefined(color)}"
129
+ noFill
130
+ ></nile-glyph>
131
+ ` : html `
132
+ <nile-glyph
133
+ name="${this.icon}"
134
+ method="stroke"
135
+ size="${size}"
136
+ color="${ifDefined(color)}"
137
+ ></nile-glyph>
138
+ `;
139
+ }
41
140
  /**
42
141
  * Render method
43
142
  * @slot This is a slot test
44
143
  */
45
144
  render() {
145
+ const live = this.liveRegion;
146
+ const inline = this.layout === 'inline';
46
147
  return html `
47
148
  <div part="container" class="${classMap({
48
149
  'empty-state': true,
49
150
  'empty-state--sm': this.size == 'sm',
50
151
  'empty-state--md': this.size == 'md',
51
- 'empty-state--lg': this.size == 'lg'
52
- })}">
152
+ 'empty-state--lg': this.size == 'lg',
153
+ 'empty-state--stack': this.layout === 'stack',
154
+ 'empty-state--inline': inline,
155
+ 'empty-state--page': this.layout === 'page',
156
+ 'empty-state--bordered': this.bordered,
157
+ [`empty-state--tone-${this.tone}`]: true,
158
+ })}"
159
+ role="${ifDefined(live?.role)}"
160
+ aria-live="${ifDefined(live?.live)}"
161
+ >
53
162
  <div part="body" class="${classMap({ 'empty-state__body': true })}">
54
163
 
55
- ${this.variant == 'content' ? html `
164
+ ${inline ? html `
165
+ <span part="inline-icon icon-chrome" class="empty-state__body--inline">
166
+ ${this.renderGlyph(20)}
167
+ </span>` : nothing}
168
+
169
+ ${!inline && this.variant == 'content' ? html `
56
170
  <div part="content-image" class="empty-state__body--content">
57
171
  ${!this.icon && !this.svgIconUrl ? nothing : html `
58
- <div part="icon-wrapper" class="empty-state__img__icon">
59
- ${this.svgIconUrl ? html `
60
- <nile-icon customSvgPath="${this.svgIconUrl}" size="${this.svgIconSize}" color="${ifDefined(this.svgIconColor)}" noFill></nile-icon>
61
- <!-- <nile-icon customSvgPath="${this.svgIconUrl}" size="${this.svgIconSize}" color="${this.svgIconColor ? this.svgIconColor : '#ddd'}"></nile-icon> -->
62
- ` : html `
63
- <nile-icon name="${this.icon}" color="white" size="${this.size == 'sm' ? 24 : this.size == 'md' ? 24 : 28}"></nile-icon>
64
- `}
172
+ <div part="icon-wrapper icon-chrome" class="empty-state__img__icon">
173
+ ${this.renderGlyph(this.size == 'lg' ? 28 : 24)}
65
174
  </div>`}
66
175
  </div>` : nothing}
67
176
 
68
- ${this.variant == 'tonal' ? html `
69
- <div part="tonal-body" class="empty-state__body--tonal">
70
- ${this.svgIconUrl ? html `
71
- <nile-icon customSvgPath="${this.svgIconUrl}" size="${this.svgIconSize}" method="var(--nile-svg-method-fill, var(--ng-svg-method-stroke))" color="${ifDefined(this.svgIconColor)}" noFill></nile-icon>
72
- ` : html `
73
- <nile-icon name="${this.icon}" method="var(--nile-svg-method-fill, var(--ng-svg-method-stroke))" size="40"></nile-icon>
74
- `}
177
+ ${!inline && this.variant == 'tonal' ? html `
178
+ <div part="tonal-body icon-chrome" class="empty-state__body--tonal">
179
+ ${this.renderGlyph(40)}
75
180
  </div>` : nothing}
76
181
 
77
- ${this.variant == 'flat' ? html `
182
+ ${!inline && this.variant == 'flat' ? html `
78
183
  <div part="flat-body" class="empty-state__body--flat">
79
- <span class="nile-flat-type-icon">
80
- ${this.svgIconUrl ? html `
81
- <nile-icon customSvgPath="${this.svgIconUrl}" size="${this.svgIconSize}" method="var(--nile-svg-method-fill, var(--ng-svg-method-stroke))" variant="secondary" color="${ifDefined(this.svgIconColor)}" noFill></nile-icon>
82
- ` : html `
83
- <nile-icon name="${this.icon}" method="var(--nile-svg-method-fill, var(--ng-svg-method-stroke))" size="${this.size == 'sm' ? 24 : this.size == 'md' ? 24 : 28}" variant="secondary"></nile-icon>
84
- `}
184
+ <span part="icon-chrome" class="nile-flat-type-icon">
185
+ ${this.renderGlyph(this.size == 'lg' ? 28 : 24)}
85
186
  </span>
86
187
  </div>` : nothing}
87
188
 
88
189
  <div part="text-section" class="empty__state__text-section">
190
+ ${this.code ? html `
191
+ <div part="code" class="empty-state__code">${this.code}</div>
192
+ ` : nothing}
89
193
  <div part="text" class="empty-state__text">${this.text}</div>
90
194
  <div part="subtitle" class="empty-state__subtext">${this.subText}</div>
91
195
  </div>
@@ -94,37 +198,50 @@ let NileEmptyState = class NileEmptyState extends NileElement {
94
198
  <div part="actions" class="empty-state-actions">
95
199
  <slot></slot>
96
200
  </div>
201
+
97
202
  </div>
98
203
  `;
99
204
  }
100
205
  };
101
206
  __decorate([
102
- property()
207
+ property({ type: String, attribute: true })
103
208
  ], NileEmptyState.prototype, "size", void 0);
104
209
  __decorate([
105
- property()
210
+ property({ type: String, attribute: true })
106
211
  ], NileEmptyState.prototype, "variant", void 0);
107
212
  __decorate([
108
- property()
109
- ], NileEmptyState.prototype, "icon", void 0);
213
+ property({ type: String, attribute: true, reflect: true })
214
+ ], NileEmptyState.prototype, "status", void 0);
110
215
  __decorate([
111
- property({ type: Boolean })
112
- ], NileEmptyState.prototype, "grayscale", void 0);
216
+ property({ type: String, attribute: true, reflect: true })
217
+ ], NileEmptyState.prototype, "layout", void 0);
113
218
  __decorate([
114
- property()
115
- ], NileEmptyState.prototype, "text", void 0);
219
+ property({ type: String, attribute: true })
220
+ ], NileEmptyState.prototype, "code", void 0);
116
221
  __decorate([
117
- property({ attribute: 'sub-text' })
118
- ], NileEmptyState.prototype, "subText", void 0);
222
+ property({ type: Boolean, attribute: true, reflect: true })
223
+ ], NileEmptyState.prototype, "bordered", void 0);
119
224
  __decorate([
120
- property()
225
+ property({ type: String, attribute: true })
121
226
  ], NileEmptyState.prototype, "svgIconUrl", void 0);
122
227
  __decorate([
123
- property({ type: Number })
228
+ property({ type: Number, attribute: true })
124
229
  ], NileEmptyState.prototype, "svgIconSize", void 0);
125
230
  __decorate([
126
- property({ type: String })
231
+ property({ type: String, attribute: true })
127
232
  ], NileEmptyState.prototype, "svgIconColor", void 0);
233
+ __decorate([
234
+ property({ type: String, attribute: true })
235
+ ], NileEmptyState.prototype, "icon", null);
236
+ __decorate([
237
+ property({ type: String, attribute: true })
238
+ ], NileEmptyState.prototype, "text", null);
239
+ __decorate([
240
+ property({ type: String, attribute: 'sub-text' })
241
+ ], NileEmptyState.prototype, "subText", null);
242
+ __decorate([
243
+ property({ type: String, attribute: true, reflect: true })
244
+ ], NileEmptyState.prototype, "tone", null);
128
245
  NileEmptyState = __decorate([
129
246
  customElement('nile-empty-state')
130
247
  ], NileEmptyState);
@@ -1 +1 @@
1
- {"version":3,"file":"nile-empty-state.js","sourceRoot":"","sources":["../../../src/nile-empty-state/nile-empty-state.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAEH,OAAO,EAAE,IAAI,EAAE,OAAO,EAAkC,MAAM,KAAK,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAS,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,WAAW,MAAM,0BAA0B,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD;;;;;GAKG;AAEI,IAAM,cAAc,GAApB,MAAM,cAAe,SAAQ,WAAW;IAAxC;;QAUO,SAAI,GAAwB,IAAI,CAAC;QAEjC,YAAO,GAGL,OAAO,CAAC;QAEV,SAAI,GAAW,iDAAiD,CAAC;QACnD,cAAS,GAAY,KAAK,CAAC;QAEzC,SAAI,GAAW,aAAa,CAAC;QACP,YAAO,GAAW,SAAS,CAAC;QAEpC,gBAAW,GAAW,EAAE,CAAC;QAuEnD,gBAAgB;IAClB,CAAC;IA7FC;;;OAGG;IACI,MAAM,KAAK,MAAM;QACtB,OAAO,CAAC,MAAM,CAAC,CAAC;IAClB,CAAC;IAkBD,gBAAgB;IAEhB,qBAAqB;IAErB;;;OAGG;IACI,MAAM;QACX,OAAO,IAAI,CAAA;qCACsB,QAAQ,CAAC;YACtC,aAAa,EAAE,IAAI;YACnB,iBAAiB,EAAE,IAAI,CAAC,IAAI,IAAI,IAAI;YACpC,iBAAiB,EAAE,IAAI,CAAC,IAAI,IAAI,IAAI;YACpC,iBAAiB,EAAE,IAAI,CAAC,IAAI,IAAI,IAAI;SACrC,CAAC;kCAC0B,QAAQ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CAAC,UAAU,WAAW,IAAI,CAAC,WAAW,kGAAkG,SAAS,CAAC,IAAI,CAAC,YAAY,CAAC;aACrM,CAAC,CAAC,CAAC,IAAI,CAAA;iCACa,IAAI,CAAC,IAAI,6EAA6E,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE;aAC9J;;mBAEM,CAAA,CAAC,CAAC,OACX;;;yDAG+C,IAAI,CAAC,IAAI;gEACF,IAAI,CAAC,OAAO;;;;;;;;KAQvE,CAAC;IACJ,CAAC;CAGF,CAAA;AArFa;IAAX,QAAQ,EAAE;4CAAkC;AAEjC;IAAX,QAAQ,EAAE;+CAGW;AAEV;IAAX,QAAQ,EAAE;4CAAkE;AACnD;IAAzB,QAAQ,CAAC,EAAC,IAAI,EAAC,OAAO,EAAC,CAAC;iDAA4B;AAEzC;IAAX,QAAQ,EAAE;4CAA8B;AACP;IAAjC,QAAQ,CAAC,EAAC,SAAS,EAAC,UAAU,EAAC,CAAC;+CAA6B;AAClD;IAAX,QAAQ,EAAE;kDAAoB;AACL;IAAzB,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;mDAA0B;AACzB;IAAzB,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;oDAAsB;AAxBpC,cAAc;IAD1B,aAAa,CAAC,kBAAkB,CAAC;GACrB,cAAc,CA+F1B;;AAED,eAAe,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 { html, nothing, CSSResultArray, TemplateResult } from 'lit';\nimport { customElement, property, state } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { styles } from './nile-empty-state.css';\nimport NileElement from '../internal/nile-element';\nimport { ifDefined } from 'lit/directives/if-defined.js';\n/**\n * Nile empty-state component.\n *\n * @tag nile-empty-state\n *\n */\n@customElement('nile-empty-state')\nexport class NileEmptyState extends NileElement {\n\n /**\n * The styles for nile-empty-state\n * @remarks If you are extending this class you can extend the base styles with super. Eg `return [super(), myCustomStyles]`\n */\n public static get styles(): CSSResultArray {\n return [styles];\n }\n\n @property() size: 'sm' | 'md' | 'lg' = 'md';\n\n @property() variant:\n | 'flat'\n | 'content'\n | 'tonal' = 'tonal';\n\n @property() icon: string = 'var(--nile-icon-error, var(--ng-icon-x-circle))';\n @property({type:Boolean}) grayscale: boolean = false;\n\n @property() text: String = 'Empty State';\n @property({attribute:'sub-text'}) subText: String = 'No Data';\n @property() svgIconUrl: string;\n @property({type: Number}) svgIconSize: number = 40;\n @property({type: String}) svgIconColor: string;\n\n /* #endregion */\n\n /* #region Methods */\n\n /**\n * Render method\n * @slot This is a slot test\n */\n public render(): TemplateResult {\n return html`\n <div part=\"container\" class=\"${classMap({\n 'empty-state': true,\n 'empty-state--sm': this.size == 'sm',\n 'empty-state--md': this.size == 'md',\n 'empty-state--lg': this.size == 'lg'\n })}\">\n <div part=\"body\" class=\"${classMap({ 'empty-state__body': true })}\">\n\n ${this.variant == 'content' ? html`\n <div part=\"content-image\" class=\"empty-state__body--content\">\n ${!this.icon && !this.svgIconUrl ? nothing : html`\n <div part=\"icon-wrapper\" class=\"empty-state__img__icon\">\n ${this.svgIconUrl ? html`\n <nile-icon customSvgPath=\"${this.svgIconUrl}\" size=\"${this.svgIconSize}\" color=\"${ifDefined(this.svgIconColor)}\" noFill></nile-icon>\n <!-- <nile-icon customSvgPath=\"${this.svgIconUrl}\" size=\"${this.svgIconSize}\" color=\"${this.svgIconColor ? this.svgIconColor : '#ddd'}\"></nile-icon> -->\n ` : html`\n <nile-icon name=\"${this.icon}\" color=\"white\" size=\"${this.size == 'sm' ? 24 : this.size == 'md' ? 24 : 28}\"></nile-icon>\n `}\n </div>`\n }\n </div>`: nothing\n }\n\n ${this.variant == 'tonal' ? html`\n <div part=\"tonal-body\" class=\"empty-state__body--tonal\">\n ${this.svgIconUrl ? html`\n <nile-icon customSvgPath=\"${this.svgIconUrl}\" size=\"${this.svgIconSize}\" method=\"var(--nile-svg-method-fill, var(--ng-svg-method-stroke))\" color=\"${ifDefined(this.svgIconColor)}\" noFill></nile-icon>\n ` : html`\n <nile-icon name=\"${this.icon}\" method=\"var(--nile-svg-method-fill, var(--ng-svg-method-stroke))\" size=\"40\"></nile-icon>\n `}\n </div>`: nothing\n }\n\n ${this.variant == 'flat' ? html`\n <div part=\"flat-body\" class=\"empty-state__body--flat\">\n\t\t\t\t\t<span class=\"nile-flat-type-icon\">\n\t\t\t\t\t\t${this.svgIconUrl ? html`\n <nile-icon customSvgPath=\"${this.svgIconUrl}\" size=\"${this.svgIconSize}\" method=\"var(--nile-svg-method-fill, var(--ng-svg-method-stroke))\" variant=\"secondary\" color=\"${ifDefined(this.svgIconColor)}\" noFill></nile-icon>\n ` : html`\n <nile-icon name=\"${this.icon}\" method=\"var(--nile-svg-method-fill, var(--ng-svg-method-stroke))\" size=\"${this.size == 'sm' ? 24 : this.size == 'md' ? 24 : 28}\" variant=\"secondary\"></nile-icon>\n `}\n\t\t\t\t\t</span>\n </div>`: nothing\n }\n\n <div part=\"text-section\" class=\"empty__state__text-section\">\n <div part=\"text\" class=\"empty-state__text\">${this.text}</div>\n <div part=\"subtitle\" class=\"empty-state__subtext\">${this.subText}</div>\n </div>\n </div>\n\n <div part=\"actions\" class=\"empty-state-actions\">\n <slot></slot>\n </div>\n </div>\n `;\n }\n\n /* #endregion */\n}\n\nexport default NileEmptyState;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-empty-state': NileEmptyState;\n }\n}\n"]}
1
+ {"version":3,"file":"nile-empty-state.js","sourceRoot":"","sources":["../../../src/nile-empty-state/nile-empty-state.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAEH,OAAO,EAAE,IAAI,EAAE,OAAO,EAA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cesContent":["/**\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 { html, nothing, CSSResultArray, TemplateResult } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { styles } from './nile-empty-state.css';\nimport NileElement from '../internal/nile-element';\nimport { ifDefined } from 'lit/directives/if-defined.js';\n\n/** What happened. Selects an icon, tone, default copy and ARIA role. */\nexport type NileEmptyStateStatus =\n | 'empty'\n | 'no-results'\n | 'not-found'\n | 'no-access'\n | 'error'\n | 'offline';\n\n/** How loud the state looks. Defaults from `status`, always overridable. */\nexport type NileEmptyStateTone = 'neutral' | 'info' | 'warning' | 'error';\n\n/** What shape the state occupies. */\nexport type NileEmptyStateLayout = 'stack' | 'inline' | 'page';\n\ninterface StatusPreset {\n icon: string;\n tone: NileEmptyStateTone;\n text: string;\n subText: string;\n role: 'status' | 'alert';\n live: 'polite' | 'assertive';\n}\n\nconst STATUS_PRESETS: Record<NileEmptyStateStatus, StatusPreset> = {\n 'empty': {\n icon: 'ng-database', tone: 'neutral', role: 'status', live: 'polite',\n text: 'No data yet', subText: `Rows appear here once there's something to show.`,\n },\n 'no-results': {\n icon: 'ng-search-lg', tone: 'neutral', role: 'status', live: 'polite',\n text: 'No matches', subText: 'Try removing a filter or broadening your search.',\n },\n 'not-found': {\n icon: 'ng-file-06', tone: 'warning', role: 'status', live: 'polite',\n text: `We couldn't find that`, subText: 'It may have been moved or deleted.',\n },\n 'no-access': {\n icon: 'ng-lock', tone: 'warning', role: 'status', live: 'polite',\n text: `You don't have access`, subText: 'Ask an admin to grant you access to this resource.',\n },\n 'error': {\n icon: 'ng-alert-circle', tone: 'error', role: 'alert', live: 'assertive',\n text: 'Something went wrong', subText: `We couldn't load this. Try again.`,\n },\n 'offline': {\n icon: 'ng-cloud-off', tone: 'error', role: 'alert', live: 'assertive',\n text: 'Connection lost', subText: 'Check your connection and try again.',\n },\n};\n\nconst TONE_GLYPH_COLOR: Record<NileEmptyStateTone, string | undefined> = {\n neutral: undefined,\n info: 'var(--nile-colors-primary-600, var(--ng-colors-fg-brand-primary-600))',\n warning: 'var(--nile-colors-yellow-700, var(--ng-colors-fg-warning-primary))',\n error: 'var(--nile-colors-red-700, var(--ng-colors-fg-error-primary))',\n};\n\nconst DEFAULT_ICON = 'ng-x-circle';\nconst DEFAULT_TEXT = 'Empty State';\nconst DEFAULT_SUB_TEXT = 'No Data';\n\n/**\n * Nile empty-state component.\n *\n * @tag nile-empty-state\n *\n */\n@customElement('nile-empty-state')\nexport class NileEmptyState extends NileElement {\n\n /**\n * The styles for nile-empty-state\n * @remarks If you are extending this class you can extend the base styles with super. Eg `return [super(), myCustomStyles]`\n */\n public static get styles(): CSSResultArray {\n return [styles];\n }\n\n @property({ type: String, attribute: true }) size: 'sm' | 'md' | 'lg' = 'md';\n\n @property({ type: String, attribute: true }) variant:\n | 'flat'\n | 'content'\n | 'tonal' = 'tonal';\n\n @property({ type: String, attribute: true, reflect: true }) status?: NileEmptyStateStatus;\n @property({ type: String, attribute: true, reflect: true }) layout: NileEmptyStateLayout = 'stack';\n @property({ type: String, attribute: true }) code?: string;\n @property({ type: Boolean, attribute: true, reflect: true }) bordered: boolean = false;\n @property({ type: String, attribute: true }) svgIconUrl: string;\n /**\n * Overrides the layout-driven glyph size for a custom `svgIconUrl`. Left unset,\n * the SVG matches whatever size the current variant/layout draws at.\n */\n @property({ type: Number, attribute: true }) svgIconSize?: number;\n @property({ type: String, attribute: true }) svgIconColor: string;\n\n private _icon?: string;\n private _text?: string;\n private _subText?: string;\n private _tone?: NileEmptyStateTone;\n @property({ type: String, attribute: true })\n get icon(): string {\n return this._icon ?? this.preset?.icon ?? DEFAULT_ICON;\n }\n\n set icon(value: string | null) {\n const old = this.icon;\n this._icon = value ?? undefined;\n this.requestUpdate('icon', old);\n }\n\n /** Headline. Resolves through the `status` preset to `DEFAULT_TEXT`. */\n @property({ type: String, attribute: true })\n get text(): string {\n return this._text ?? this.preset?.text ?? DEFAULT_TEXT;\n }\n\n set text(value: string | null) {\n const old = this.text;\n this._text = value ?? undefined;\n this.requestUpdate('text', old);\n }\n\n /** Supporting line. Resolves through the `status` preset to `DEFAULT_SUB_TEXT`. */\n @property({ type: String, attribute: 'sub-text' })\n get subText(): string {\n return this._subText ?? this.preset?.subText ?? DEFAULT_SUB_TEXT;\n }\n\n set subText(value: string | null) {\n const old = this.subText;\n this._subText = value ?? undefined;\n this.requestUpdate('subText', old);\n }\n\n @property({ type: String, attribute: true, reflect: true })\n get tone(): NileEmptyStateTone {\n return this._tone ?? this.preset?.tone ?? 'neutral';\n }\n\n set tone(value: NileEmptyStateTone | null) {\n const old = this.tone;\n this._tone = value ?? undefined;\n this.requestUpdate('tone', old);\n }\n\n /* #endregion */\n\n /* #region Methods */\n\n /** The preset backing the current `status`, or undefined when none is set. */\n private get preset(): StatusPreset | undefined {\n return this.status ? STATUS_PRESETS[this.status] : undefined;\n }\n\n private get glyphColor(): string | undefined {\n return this.svgIconColor ?? TONE_GLYPH_COLOR[this.tone];\n }\n\n /** ARIA wiring */\n private get liveRegion(): { role: string; live: string } | undefined {\n const preset = this.preset;\n if (!preset) return undefined;\n return { role: preset.role, live: preset.live };\n }\n\n private renderGlyph(size: number | string): TemplateResult {\n const color = this.glyphColor;\n return this.svgIconUrl ? html`\n <nile-glyph\n customSvgPath=\"${this.svgIconUrl}\"\n size=\"${this.svgIconSize ?? size}\"\n method=\"stroke\"\n color=\"${ifDefined(color)}\"\n noFill\n ></nile-glyph>\n ` : html`\n <nile-glyph\n name=\"${this.icon}\"\n method=\"stroke\"\n size=\"${size}\"\n color=\"${ifDefined(color)}\"\n ></nile-glyph>\n `;\n }\n\n /**\n * Render method\n * @slot This is a slot test\n */\n public render(): TemplateResult {\n const live = this.liveRegion;\n const inline = this.layout === 'inline';\n\n return html`\n <div part=\"container\" class=\"${classMap({\n 'empty-state': true,\n 'empty-state--sm': this.size == 'sm',\n 'empty-state--md': this.size == 'md',\n 'empty-state--lg': this.size == 'lg',\n 'empty-state--stack': this.layout === 'stack',\n 'empty-state--inline': inline,\n 'empty-state--page': this.layout === 'page',\n 'empty-state--bordered': this.bordered,\n [`empty-state--tone-${this.tone}`]: true,\n })}\"\n role=\"${ifDefined(live?.role)}\"\n aria-live=\"${ifDefined(live?.live)}\"\n >\n <div part=\"body\" class=\"${classMap({ 'empty-state__body': true })}\">\n\n ${inline ? html`\n <span part=\"inline-icon icon-chrome\" class=\"empty-state__body--inline\">\n ${this.renderGlyph(20)}\n </span>` : nothing\n }\n\n ${!inline && this.variant == 'content' ? html`\n <div part=\"content-image\" class=\"empty-state__body--content\">\n ${!this.icon && !this.svgIconUrl ? nothing : html`\n <div part=\"icon-wrapper icon-chrome\" class=\"empty-state__img__icon\">\n ${\n this.renderGlyph(this.size == 'lg' ? 28 : 24)}\n </div>`\n }\n </div>`: nothing\n }\n\n ${!inline && this.variant == 'tonal' ? html`\n <div part=\"tonal-body icon-chrome\" class=\"empty-state__body--tonal\">\n ${this.renderGlyph(40)}\n </div>`: nothing\n }\n\n ${!inline && this.variant == 'flat' ? html`\n <div part=\"flat-body\" class=\"empty-state__body--flat\">\n\t\t\t\t\t<span part=\"icon-chrome\" class=\"nile-flat-type-icon\">\n\t\t\t\t\t\t${this.renderGlyph(this.size == 'lg' ? 28 : 24)}\n\t\t\t\t\t</span>\n </div>`: nothing\n }\n\n <div part=\"text-section\" class=\"empty__state__text-section\">\n ${this.code ? html`\n <div part=\"code\" class=\"empty-state__code\">${this.code}</div>\n ` : nothing}\n <div part=\"text\" class=\"empty-state__text\">${this.text}</div>\n <div part=\"subtitle\" class=\"empty-state__subtext\">${this.subText}</div>\n </div>\n </div>\n\n <div part=\"actions\" class=\"empty-state-actions\">\n <slot></slot>\n </div>\n\n </div>\n `;\n }\n\n /* #endregion */\n}\n\nexport default NileEmptyState;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-empty-state': NileEmptyState;\n }\n}\n"]}
@@ -1 +1,2 @@
1
1
  import './nile-empty-state';
2
+ import '@aquera/nile-glyph/nile-glyph';