@aquera/nile-elements 0.0.48 → 0.0.49

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 (175) hide show
  1. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/index.d.ts +1 -0
  2. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/index.js +1 -0
  3. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/index.js.map +1 -1
  4. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-avatar/index.d.ts +1 -0
  5. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-avatar/index.js +2 -0
  6. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-avatar/index.js.map +1 -0
  7. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-avatar/nile-avatar.css.d.ts +12 -0
  8. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-avatar/nile-avatar.css.js +101 -0
  9. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-avatar/nile-avatar.css.js.map +1 -0
  10. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-avatar/nile-avatar.d.ts +45 -0
  11. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-avatar/nile-avatar.js +134 -0
  12. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-avatar/nile-avatar.js.map +1 -0
  13. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-button-toggle/nile-button-toggle.css.js +7 -5
  14. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-button-toggle/nile-button-toggle.css.js.map +1 -1
  15. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-calendar/nile-calendar.js.map +1 -1
  16. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-card/nile-card.css.d.ts +5 -5
  17. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-card/nile-card.css.js +12 -15
  18. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-card/nile-card.css.js.map +1 -1
  19. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-icon/icons/svg/bar-chart-square-03.d.ts +5 -0
  20. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-icon/icons/svg/bar-chart-square-03.js +5 -0
  21. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-icon/icons/svg/bar-chart-square-03.js.map +1 -0
  22. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-icon/icons/svg/index.d.ts +2 -0
  23. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-icon/icons/svg/index.js +2 -0
  24. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-icon/icons/svg/index.js.map +1 -1
  25. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-icon/icons/svg/trend-up-02.d.ts +5 -0
  26. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-icon/icons/svg/trend-up-02.js +5 -0
  27. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-icon/icons/svg/trend-up-02.js.map +1 -0
  28. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-input/nile-input.css.js +18 -1
  29. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-input/nile-input.css.js.map +1 -1
  30. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-input/nile-input.d.ts +6 -0
  31. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-input/nile-input.js +56 -6
  32. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-input/nile-input.js.map +1 -1
  33. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/tsconfig.tsbuildinfo +1 -1
  34. package/demo/filenames.txt +1 -1
  35. package/demo/variables.css +17 -0
  36. package/demo/variables_v2.css +17 -0
  37. package/dist/index.cjs.js +1 -1
  38. package/dist/index.esm.js +1 -1
  39. package/dist/index.iife.js +374 -247
  40. package/dist/nile-avatar/index.cjs.js +2 -0
  41. package/dist/nile-avatar/index.cjs.js.map +1 -0
  42. package/dist/nile-avatar/index.esm.js +1 -0
  43. package/dist/nile-avatar/nile-avatar.cjs.js +2 -0
  44. package/dist/nile-avatar/nile-avatar.cjs.js.map +1 -0
  45. package/dist/nile-avatar/nile-avatar.css.cjs.js +2 -0
  46. package/dist/nile-avatar/nile-avatar.css.cjs.js.map +1 -0
  47. package/dist/nile-avatar/nile-avatar.css.esm.js +89 -0
  48. package/dist/nile-avatar/nile-avatar.esm.js +13 -0
  49. package/dist/nile-badge/index.cjs.js +1 -1
  50. package/dist/nile-badge/index.esm.js +1 -1
  51. package/dist/nile-badge/nile-badge.cjs.js +1 -1
  52. package/dist/nile-badge/nile-badge.cjs.js.map +1 -1
  53. package/dist/nile-badge/nile-badge.esm.js +1 -1
  54. package/dist/nile-button/index.cjs.js +1 -1
  55. package/dist/nile-button/index.esm.js +1 -1
  56. package/dist/nile-button/nile-button.cjs.js +1 -1
  57. package/dist/nile-button/nile-button.cjs.js.map +1 -1
  58. package/dist/nile-button/nile-button.esm.js +1 -1
  59. package/dist/nile-button-toggle/nile-button-toggle.css.cjs.js +1 -1
  60. package/dist/nile-button-toggle/nile-button-toggle.css.cjs.js.map +1 -1
  61. package/dist/nile-button-toggle/nile-button-toggle.css.esm.js +9 -7
  62. package/dist/nile-calendar/nile-calendar.cjs.js.map +1 -1
  63. package/dist/nile-card/nile-card.css.cjs.js +1 -1
  64. package/dist/nile-card/nile-card.css.cjs.js.map +1 -1
  65. package/dist/nile-card/nile-card.css.esm.js +7 -10
  66. package/dist/nile-dialog/index.cjs.js +1 -1
  67. package/dist/nile-dialog/index.esm.js +1 -1
  68. package/dist/nile-dialog/nile-dialog.cjs.js +1 -1
  69. package/dist/nile-dialog/nile-dialog.cjs.js.map +1 -1
  70. package/dist/nile-dialog/nile-dialog.esm.js +1 -1
  71. package/dist/nile-icon/icons/svg/bar-chart-square-03.cjs.js +2 -0
  72. package/dist/nile-icon/icons/svg/bar-chart-square-03.cjs.js.map +1 -0
  73. package/dist/nile-icon/icons/svg/bar-chart-square-03.esm.js +1 -0
  74. package/dist/nile-icon/icons/svg/index.cjs.js +1 -1
  75. package/dist/nile-icon/icons/svg/index.esm.js +1 -1
  76. package/dist/nile-icon/icons/svg/trend-up-02.cjs.js +2 -0
  77. package/dist/nile-icon/icons/svg/trend-up-02.cjs.js.map +1 -0
  78. package/dist/nile-icon/icons/svg/trend-up-02.esm.js +1 -0
  79. package/dist/nile-icon/index.cjs.js +1 -1
  80. package/dist/nile-icon/index.cjs.js.map +1 -1
  81. package/dist/nile-icon/index.esm.js +1 -1
  82. package/dist/nile-icon-button/index.cjs.js +1 -1
  83. package/dist/nile-icon-button/index.esm.js +1 -1
  84. package/dist/nile-icon-button/nile-icon-button.cjs.js +1 -1
  85. package/dist/nile-icon-button/nile-icon-button.cjs.js.map +1 -1
  86. package/dist/nile-icon-button/nile-icon-button.esm.js +1 -1
  87. package/dist/nile-input/index.cjs.js +1 -1
  88. package/dist/nile-input/index.esm.js +1 -1
  89. package/dist/nile-input/nile-input.cjs.js +1 -1
  90. package/dist/nile-input/nile-input.cjs.js.map +1 -1
  91. package/dist/nile-input/nile-input.css.cjs.js +1 -1
  92. package/dist/nile-input/nile-input.css.cjs.js.map +1 -1
  93. package/dist/nile-input/nile-input.css.esm.js +18 -1
  94. package/dist/nile-input/nile-input.esm.js +13 -2
  95. package/dist/nile-menu-item/index.cjs.js +1 -1
  96. package/dist/nile-menu-item/index.esm.js +1 -1
  97. package/dist/nile-menu-item/nile-menu-item.cjs.js +1 -1
  98. package/dist/nile-menu-item/nile-menu-item.cjs.js.map +1 -1
  99. package/dist/nile-menu-item/nile-menu-item.esm.js +1 -1
  100. package/dist/nile-option/index.cjs.js +1 -1
  101. package/dist/nile-option/index.esm.js +1 -1
  102. package/dist/nile-option/nile-option.cjs.js +1 -1
  103. package/dist/nile-option/nile-option.cjs.js.map +1 -1
  104. package/dist/nile-option/nile-option.esm.js +1 -1
  105. package/dist/nile-select/index.cjs.js +1 -1
  106. package/dist/nile-select/index.esm.js +1 -1
  107. package/dist/nile-select/nile-select.cjs.js +1 -1
  108. package/dist/nile-select/nile-select.cjs.js.map +1 -1
  109. package/dist/nile-select/nile-select.esm.js +1 -1
  110. package/dist/nile-tab/index.cjs.js +1 -1
  111. package/dist/nile-tab/index.esm.js +1 -1
  112. package/dist/nile-tab/nile-tab.cjs.js +1 -1
  113. package/dist/nile-tab/nile-tab.cjs.js.map +1 -1
  114. package/dist/nile-tab/nile-tab.esm.js +1 -1
  115. package/dist/nile-tab-group/index.cjs.js +1 -1
  116. package/dist/nile-tab-group/index.esm.js +1 -1
  117. package/dist/nile-tab-group/nile-tab-group.cjs.js +1 -1
  118. package/dist/nile-tab-group/nile-tab-group.cjs.js.map +1 -1
  119. package/dist/nile-tab-group/nile-tab-group.esm.js +1 -1
  120. package/dist/nile-tag/index.cjs.js +1 -1
  121. package/dist/nile-tag/index.esm.js +1 -1
  122. package/dist/nile-tag/nile-tag.cjs.js +1 -1
  123. package/dist/nile-tag/nile-tag.cjs.js.map +1 -1
  124. package/dist/nile-tag/nile-tag.esm.js +1 -1
  125. package/dist/nile-toast/index.cjs.js +1 -1
  126. package/dist/nile-toast/index.esm.js +1 -1
  127. package/dist/nile-toast/nile-toast.cjs.js +1 -1
  128. package/dist/nile-toast/nile-toast.cjs.js.map +1 -1
  129. package/dist/nile-toast/nile-toast.esm.js +2 -2
  130. package/dist/src/index.d.ts +1 -0
  131. package/dist/src/index.js +1 -0
  132. package/dist/src/index.js.map +1 -1
  133. package/dist/src/nile-avatar/index.d.ts +1 -0
  134. package/dist/src/nile-avatar/index.js +2 -0
  135. package/dist/src/nile-avatar/index.js.map +1 -0
  136. package/dist/src/nile-avatar/nile-avatar.css.d.ts +12 -0
  137. package/dist/src/nile-avatar/nile-avatar.css.js +101 -0
  138. package/dist/src/nile-avatar/nile-avatar.css.js.map +1 -0
  139. package/dist/src/nile-avatar/nile-avatar.d.ts +45 -0
  140. package/dist/src/nile-avatar/nile-avatar.js +134 -0
  141. package/dist/src/nile-avatar/nile-avatar.js.map +1 -0
  142. package/dist/src/nile-button-toggle/nile-button-toggle.css.js +7 -5
  143. package/dist/src/nile-button-toggle/nile-button-toggle.css.js.map +1 -1
  144. package/dist/src/nile-calendar/nile-calendar.js.map +1 -1
  145. package/dist/src/nile-card/nile-card.css.d.ts +5 -5
  146. package/dist/src/nile-card/nile-card.css.js +12 -15
  147. package/dist/src/nile-card/nile-card.css.js.map +1 -1
  148. package/dist/src/nile-icon/icons/svg/bar-chart-square-03.d.ts +5 -0
  149. package/dist/src/nile-icon/icons/svg/bar-chart-square-03.js +5 -0
  150. package/dist/src/nile-icon/icons/svg/bar-chart-square-03.js.map +1 -0
  151. package/dist/src/nile-icon/icons/svg/index.d.ts +2 -0
  152. package/dist/src/nile-icon/icons/svg/index.js +2 -0
  153. package/dist/src/nile-icon/icons/svg/index.js.map +1 -1
  154. package/dist/src/nile-icon/icons/svg/trend-up-02.d.ts +5 -0
  155. package/dist/src/nile-icon/icons/svg/trend-up-02.js +5 -0
  156. package/dist/src/nile-icon/icons/svg/trend-up-02.js.map +1 -0
  157. package/dist/src/nile-input/nile-input.css.js +18 -1
  158. package/dist/src/nile-input/nile-input.css.js.map +1 -1
  159. package/dist/src/nile-input/nile-input.d.ts +6 -0
  160. package/dist/src/nile-input/nile-input.js +56 -6
  161. package/dist/src/nile-input/nile-input.js.map +1 -1
  162. package/dist/tsconfig.tsbuildinfo +1 -1
  163. package/package.json +1 -1
  164. package/src/index.ts +4 -3
  165. package/src/nile-avatar/index.ts +1 -0
  166. package/src/nile-avatar/nile-avatar.css.ts +103 -0
  167. package/src/nile-avatar/nile-avatar.ts +143 -0
  168. package/src/nile-button-toggle/nile-button-toggle.css.ts +7 -5
  169. package/src/nile-calendar/nile-calendar.ts +0 -2
  170. package/src/nile-card/nile-card.css.ts +13 -16
  171. package/src/nile-icon/icons/svg/bar-chart-square-03.ts +5 -0
  172. package/src/nile-icon/icons/svg/index.ts +2 -0
  173. package/src/nile-icon/icons/svg/trend-up-02.ts +5 -0
  174. package/src/nile-input/nile-input.css.ts +18 -1
  175. package/src/nile-input/nile-input.ts +61 -2
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": "0.0.48",
6
+ "version": "0.0.49",
7
7
  "main": "dist/src/index.js",
8
8
  "type": "module",
9
9
  "module": "dist/src/index.js",
package/src/index.ts CHANGED
@@ -43,7 +43,8 @@ export { NileCodeEditor } from './nile-code-editor';
43
43
  export { NileToast } from './nile-toast';
44
44
  export { NileBreadcrumb } from './nile-breadcrumb';
45
45
  export { NileBreadcrumbItem } from './nile-breadcrumb-item';
46
- export {NileFormGroup} from './nile-form-group';
46
+ export { NileFormGroup } from './nile-form-group';
47
47
  export { NileCard } from './nile-card';
48
- export {NilePopover } from './nile-popover';
49
- export {NileButtonFilter} from './nile-button-filter';
48
+ export { NileAvatar } from './nile-avatar';
49
+ export { NilePopover } from './nile-popover';
50
+ export { NileButtonFilter } from './nile-button-filter';
@@ -0,0 +1 @@
1
+ export { NileAvatar } from './nile-avatar';
@@ -0,0 +1,103 @@
1
+ /**
2
+ * Copyright Aquera Inc 2023
3
+ *
4
+ * This source code is licensed under the BSD-3-Clause license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+
8
+ import { css } from 'lit-element';
9
+
10
+ /**
11
+ * Avatar CSS
12
+ */
13
+ export const styles = css`
14
+ :host {
15
+ }
16
+ .text__avatar {
17
+ box-sizing: border-box;
18
+ font-feature-settings: 'clig' off, 'liga' off;
19
+ font-family: var(--nile-font-family-serif);
20
+ font-style: normal;
21
+ font-weight: 500;
22
+ text-transform: uppercase;
23
+ display: flex;
24
+ flex-direction: column;
25
+ justify-content: center;
26
+ align-items: center;
27
+ box-sizing: border-box;
28
+ border: 1px solid;
29
+ border-color: var(--nile-colors-neutral-500);
30
+ }
31
+
32
+ .avatar {
33
+ box-sizing: border-box;
34
+ border: 1px solid var(--nile-colors-neutral-500);
35
+ background-position: 50% 50%;
36
+ background-size: cover;
37
+ background-repeat: no-repeat;
38
+ }
39
+
40
+ .avatar__small {
41
+ width: var(--nile-type-scale-4);
42
+ height: var(--nile-type-scale-4);
43
+ font-size: 6.516px;
44
+ line-height: 6.516px;
45
+ }
46
+
47
+ .avatar__medium {
48
+ width: var(--nile-spacing-3-x);
49
+ height: var(--nile-spacing-3-x);
50
+ font-size: var(--nile-type-scale-1);
51
+ line-height: var(--nile-type-scale-1);
52
+ }
53
+
54
+ .avatar__large {
55
+ width: 32px;
56
+ height: 32px;
57
+ font-size: 12.8px;
58
+ line-height: 12.8px;
59
+ }
60
+
61
+ .avatar__extralarge {
62
+ height: 40px;
63
+ width: 40px;
64
+ font-size: var(--nile-type-scale-3);
65
+ line-height: var(--nile-type-scale-3);
66
+ }
67
+
68
+ .avatar__rounded {
69
+ border-radius: 50%;
70
+ }
71
+
72
+ .variant__yellow {
73
+ color: var(--nile-colors-yellow-700);
74
+ border-color: var(--nile-colors-yellow-500);
75
+ background: var(--nile-colors-yellow-400);
76
+ }
77
+
78
+ .variant__blue {
79
+ color: var(--nile-colors-blue-700);
80
+ border-color: var(--nile-colors-blue-500);
81
+ background: var(--nile-colors-blue-400);
82
+ }
83
+
84
+ .variant__red {
85
+ color: var(--nile-colors-button-caution-pressed-border);
86
+ border-color: var(--nile-colors-red-500);
87
+ background: var(--nile-colors-red-400);
88
+ }
89
+
90
+ .variant__green {
91
+ color: var(--nile-colors-green-700);
92
+ border-color: var(--nile-colors-green-500);
93
+ background: var(--nile-colors-green-400);
94
+ }
95
+
96
+ .variant__neutral {
97
+ color: var(--nile-colors-neutral-700);
98
+ border-color: var(--nile-colors-neutral-500);
99
+ background: var(--nile-colors-dark-200);
100
+ }
101
+ `;
102
+
103
+ export default [styles];
@@ -0,0 +1,143 @@
1
+ /**
2
+ * Copyright Aquera Inc 2023
3
+ *
4
+ * This source code is licensed under the BSD-3-Clause license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+
8
+ import {
9
+ LitElement,
10
+ html,
11
+ property,
12
+ CSSResultArray,
13
+ TemplateResult,
14
+ } from 'lit-element';
15
+ import { customElement, state } from 'lit/decorators.js';
16
+ import { classMap } from 'lit/directives/class-map.js';
17
+
18
+ import { styles } from './nile-avatar.css';
19
+ import NileElement from '../internal/nile-element';
20
+ import { string } from '../nile-icon/icons/svg';
21
+
22
+ /**
23
+ * Nile icon component.
24
+ *
25
+ * @tag nile-avatar
26
+ *
27
+ */
28
+ @customElement('nile-avatar')
29
+ export class NileAvatar extends NileElement {
30
+ /**
31
+ * The styles for Avatar
32
+ * @remarks If you are extending this class you can extend the base styles with super. Eg `return [super(), myCustomStyles]`
33
+ */
34
+ public static get styles(): CSSResultArray {
35
+ return [styles];
36
+ }
37
+
38
+ /** Gives the url to the Avatar */
39
+ @property({ type: String, reflect: true }) src = '';
40
+
41
+ /** Gives the default Image Letters to the Avatar */
42
+ @property({ type: String, reflect: true }) name = '';
43
+
44
+ /** Size of the Avatar */
45
+ @property({ reflect: true }) size:
46
+ | 'small'
47
+ | 'medium'
48
+ | 'large'
49
+ | 'extralarge' = 'medium';
50
+
51
+ /** Gives a border radius of 50% to the Avatar */
52
+ @property({ type: Boolean, reflect: true }) isRounded = false;
53
+
54
+ /* #endregion */
55
+
56
+ /* #region Methods */
57
+
58
+ /**
59
+ * Render method
60
+ * @slot This is a slot test
61
+ */
62
+ @state() private isDefaultAvatar = true;
63
+
64
+ @state() private defaultAvatarContent = html``;
65
+
66
+ private generateInitials(name: String): string {
67
+ if (!name) {
68
+ return '';
69
+ }
70
+ const nameParts = name
71
+ .split(' ')
72
+ .filter(part => part.length > 0)
73
+ .map(part => part.charAt(0).toUpperCase())
74
+ .slice(0, 2);
75
+ return nameParts.length > 1 ? nameParts[0] + nameParts[1] : nameParts[0];
76
+ }
77
+
78
+ private generateVariantCode(initials: string): number {
79
+ const char1 = initials.charCodeAt(0);
80
+ const char2 = initials.length == 1 ? char1 : initials.charCodeAt(1);
81
+ const multifactor = char1 * char2 + (char1 % 23) + (char2 % 23);
82
+ return multifactor % 5;
83
+ }
84
+
85
+ private handleImageError(event: Event): void {
86
+ const defaultInitials = this.generateInitials(this.name);
87
+ const variant__code = this.generateVariantCode(defaultInitials);
88
+ this.defaultAvatarContent = html`<div
89
+ class=${classMap({
90
+ text__avatar: true,
91
+ avatar__small: this.size === 'small',
92
+ avatar__medium: this.size === 'medium',
93
+ avatar__large: this.size === 'large',
94
+ avatar__extralarge: this.size === 'extralarge',
95
+ avatar__rounded: this.isRounded,
96
+ variant__yellow: variant__code === 0,
97
+ variant__blue: variant__code === 1,
98
+ variant__red: variant__code === 2,
99
+ variant__green: variant__code === 3,
100
+ variant__neutral: variant__code === 4,
101
+ })}
102
+ >
103
+ ${defaultInitials
104
+ ? defaultInitials
105
+ : html`<nile-icon name="user" color="grey" size="14"></nile-icon>`}
106
+ </div>`;
107
+
108
+ this.isDefaultAvatar = false;
109
+ }
110
+
111
+ public render(): TemplateResult {
112
+ return html`
113
+ ${this.isDefaultAvatar
114
+ ? html` <img
115
+ src="${this.src}"
116
+ class="avatar"
117
+ class=${classMap({
118
+ avatar: true,
119
+ avatar__small: this.size === 'small',
120
+ avatar__medium: this.size === 'medium',
121
+ avatar__large: this.size === 'large',
122
+ avatar__extralarge: this.size === 'extralarge',
123
+ avatar__rounded: this.isRounded,
124
+ })}
125
+ style=" background-image: url(${this
126
+ .src}), linear-gradient(lightgray, lightgray);"
127
+ @error="${this.handleImageError}"
128
+ />`
129
+ : html`${this.defaultAvatarContent}`}
130
+ `;
131
+ }
132
+
133
+ /* #endregion */
134
+ }
135
+ // onerror="this.onerror=null;this.src='${defaultimg}';"
136
+
137
+ export default NileAvatar;
138
+
139
+ declare global {
140
+ interface HTMLElementTagNameMap {
141
+ 'nile-avatar': NileAvatar;
142
+ }
143
+ }
@@ -17,7 +17,7 @@ export const styles = css`
17
17
  .nile-button-toggle {
18
18
  display: flex;
19
19
  padding: 12px;
20
- border: 1px solid #ccc;
20
+ border: 1px solid var(--nile-button-toggle-border-color);
21
21
  cursor: pointer;
22
22
  border-radius: 4px;
23
23
  color: #000;
@@ -32,11 +32,11 @@ export const styles = css`
32
32
  }
33
33
 
34
34
  .nile-button-toggle:hover {
35
- background: var(--nile-colors-neutral-100);
35
+ background:var(--nile-button-toggle-color-background-non-active-hover);
36
36
  }
37
37
 
38
38
  .nile-button-toggle:active {
39
- background: #E5E9EB;
39
+ background: #e5e9eb;
40
40
  }
41
41
 
42
42
  .nile-button-toggle__initial {
@@ -56,11 +56,13 @@ export const styles = css`
56
56
  }
57
57
 
58
58
  .nile-button-toggle__active {
59
- background-color: #c7ced4;
59
+ background-color:var(--nile-button-toggle-color-background-active-standard);
60
+ color: var(--nile-button-toggle-text-color-standard);
60
61
  }
61
62
 
62
63
  .nile-button-toggle__active:hover {
63
- background-color: #c7ced4;
64
+ background-color:var(--nile-button-toggle-color-background-active-hover);
65
+ color: var(--nile-button-toggle-text-color-hover);
64
66
  }
65
67
 
66
68
  .nile-button-toggle__disabled {
@@ -139,7 +139,6 @@ export class NileCalendar extends NileElement {
139
139
 
140
140
  @property({ type: Boolean,attribute:'hide-time-input' }) hideTimeInput: Boolean = false;
141
141
 
142
-
143
142
  @property({ type: Array, attribute: 'hide-duration-fields' })
144
143
  hideDurationFields: String[] = [];
145
144
  @property({ type: Boolean , attribute: 'hide-time-zone' }) hideTimeZone: Boolean = false;
@@ -722,7 +721,6 @@ export class NileCalendar extends NileElement {
722
721
  const nextYear =
723
722
  this.currentMonth === 11 ? this.currentYear + 1 : this.currentYear;
724
723
  const nextMonthDaysArray = this.getDaysArray(nextYear, nextMonth);
725
-
726
724
  return html`
727
725
  <div
728
726
  class="base ${this.range ? 'base__range' : ''} ${this.type ===
@@ -1,17 +1,16 @@
1
1
  /**
2
- * Copyright Aquera Inc 2023
3
- *
4
- * This source code is licensed under the BSD-3-Clause license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- */
2
+ * Copyright Aquera Inc 2023
3
+ *
4
+ * This source code is licensed under the BSD-3-Clause license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
7
 
8
- import {css} from 'lit-element';
8
+ import { css } from 'lit-element';
9
9
 
10
10
  /**
11
11
  * Card CSS
12
12
  */
13
13
  export const styles = css`
14
-
15
14
  :host {
16
15
  box-sizing: border-box;
17
16
  }
@@ -27,13 +26,11 @@ export const styles = css`
27
26
  }
28
27
 
29
28
  :host {
30
- --border-color: var(--nile-colors-neutral-400);
29
+ --border-color: var(--nile-card-color-border); /* for v2 */
31
30
  --border-radius: 8px;
32
31
  --border-width: 1px;
33
32
  --padding: 18px;
34
- --footer-padding: 9px 18px;
35
- ;
36
-
33
+ --footer-padding: var(--nile-card-footer-padding); /*for v2 */
37
34
  display: inline-block;
38
35
  }
39
36
 
@@ -43,6 +40,7 @@ export const styles = css`
43
40
  background-color: var(--nile-colors-white-base);
44
41
  border: solid var(--border-width) var(--border-color);
45
42
  border-radius: var(--border-radius);
43
+ box-shadow: var(--nile-card-box-shadow) rgba(16, 24, 40, 0.05);
46
44
  }
47
45
 
48
46
  .card__body {
@@ -55,19 +53,18 @@ export const styles = css`
55
53
  border-bottom: none;
56
54
  }
57
55
 
58
- .card__footer {
56
+ .card__footer {
59
57
  display: block;
60
58
  border-top: solid var(--border-width) var(--border-color);
61
59
  padding: var(--footer-padding);
62
- border: 1px solid var(--nile-colors-neutral-500);
63
- background: var(--nile-colors-neutral-100);
64
- border-radius: 0 0 4px 4px;
60
+ border:1px solid var(--nile-card-footer-border-color);
61
+ background-color:var(--nile-card-footer-background-color);
62
+ border-radius:var(--nile-card-footer-border-radius);
65
63
  }
66
64
 
67
65
  .card:not(.card--has-footer) .card__footer {
68
66
  display: none;
69
67
  }
70
-
71
68
  `;
72
69
 
73
70
  export default [styles];
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Do not edit directly
3
+ */
4
+
5
+ export default "PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNNS4zMzMzMyAxMFYxMS4zMzMzTTggNy4zMzMzM1YxMS4zMzMzTTEwLjY2NjcgNC42NjY2N1YxMS4zMzMzTTUuMiAxNEgxMC44QzExLjkyMDEgMTQgMTIuNDgwMiAxNCAxMi45MDggMTMuNzgyQzEzLjI4NDMgMTMuNTkwMyAxMy41OTAzIDEzLjI4NDMgMTMuNzgyIDEyLjkwOEMxNCAxMi40ODAyIDE0IDExLjkyMDEgMTQgMTAuOFY1LjJDMTQgNC4wNzk5IDE0IDMuNTE5ODQgMTMuNzgyIDMuMDkyMDJDMTMuNTkwMyAyLjcxNTY5IDEzLjI4NDMgMi40MDk3MyAxMi45MDggMi4yMTc5OUMxMi40ODAyIDIgMTEuOTIwMSAyIDEwLjggMkg1LjJDNC4wNzk5IDIgMy41MTk4NCAyIDMuMDkyMDIgMi4yMTc5OUMyLjcxNTY5IDIuNDA5NzMgMi40MDk3MyAyLjcxNTY5IDIuMjE3OTkgMy4wOTIwMkMyIDMuNTE5ODQgMiA0LjA3OTkgMiA1LjJWMTAuOEMyIDExLjkyMDEgMiAxMi40ODAyIDIuMjE3OTkgMTIuOTA4QzIuNDA5NzMgMTMuMjg0MyAyLjcxNTY5IDEzLjU5MDMgMy4wOTIwMiAxMy43ODJDMy41MTk4NCAxNCA0LjA3OTkgMTQgNS4yIDE0WiIgc3Ryb2tlPSIjMzQ0MDU0IiBzdHJva2Utd2lkdGg9IjEuNiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+PC9zdmc+";
@@ -32,6 +32,7 @@ export { default as attributemapanalysisicon } from './attribute-map-analysis-ic
32
32
  export { default as attributemap } from './attributemap';
33
33
  export { default as back } from './back';
34
34
  export { default as barchartsquare02 } from './bar-chart-square-02';
35
+ export { default as barchartsquare03 } from './bar-chart-square-03';
35
36
  export { default as bargraph } from './bargraph';
36
37
  export { default as basic } from './basic';
37
38
  export { default as bellicon } from './bell-icon';
@@ -388,6 +389,7 @@ export { default as timezone } from './timezone';
388
389
  export { default as trash01 } from './trash-01';
389
390
  export { default as trashnofill } from './trash-no-fill';
390
391
  export { default as trash } from './trash';
392
+ export { default as trendup02 } from './trend-up-02';
391
393
  export { default as trigger } from './trigger';
392
394
  export { default as undo1 } from './undo-1';
393
395
  export { default as undo } from './undo';
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Do not edit directly
3
+ */
4
+
5
+ export default "PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNNyAxN0wxNyA3TTE3IDdIN00xNyA3VjE3IiBzdHJva2U9ImJsYWNrIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz48L3N2Zz4=";
@@ -93,7 +93,8 @@ export const styles = css`
93
93
  font-size: 14px;
94
94
  font-style: normal;
95
95
  line-height: 14px;
96
- letter-spacing: 0.2px; }
96
+ letter-spacing: 0.2px;
97
+ }
97
98
 
98
99
  /* Standard inputs */
99
100
  .input--standard {
@@ -448,6 +449,22 @@ export const styles = css`
448
449
  .input__password {
449
450
  font-family: 'disc';
450
451
  }
452
+
453
+ .input__non-printable {
454
+ width: 280px;
455
+ height: 12px;
456
+ border-radius: 4px;
457
+ background-color: #ffffff;
458
+ border: 1px solid grey;
459
+ color: red;
460
+ padding: 10px;
461
+ font-size: 12px;
462
+ }
463
+
464
+ .input__remove-non-printable {
465
+ color: #035da6;
466
+ margin-left: 10px;
467
+ }
451
468
  `;
452
469
 
453
470
  export default [styles];
@@ -72,6 +72,9 @@ export class NileInput extends NileElement implements NileFormControl {
72
72
  /** The current value of the input, submitted as a name/value pair with form data. */
73
73
  @property() value = '';
74
74
 
75
+ @property({type: Boolean}) checkNonPrintableChar: boolean = false;
76
+
77
+
75
78
  /** The default value of the form control. Primarily used for resetting the form control. */
76
79
  @defaultValue() defaultValue = '';
77
80
 
@@ -218,6 +221,7 @@ export class NileInput extends NileElement implements NileFormControl {
218
221
  // can be set before the component is rendered.
219
222
  //
220
223
 
224
+ @state() hasPrintableCharacters: boolean = false;
221
225
 
222
226
  connectedCallback() {
223
227
  super.connectedCallback();
@@ -345,15 +349,57 @@ export class NileInput extends NileElement implements NileFormControl {
345
349
  // If step changes, the value may become invalid so we need to recheck after the update. We set the new step
346
350
  // imperatively so we don't have to wait for the next render to report the updated validity.
347
351
  this.input.step = String(this.step);
348
- this.formControlController.updateValidity();
349
352
  }
350
353
 
351
354
  @watch('value', { waitUntilFirstUpdate: true })
352
355
  async handleValueChange() {
353
356
  await this.updateComplete;
354
- this.formControlController.updateValidity();
357
+
358
+ if(this.checkNonPrintableChar){
359
+ this.findNonPrintableChar();
360
+ }
361
+ }
362
+
363
+
364
+ /** checks non printable characters in the value. */
365
+ findNonPrintableChar() {
366
+ this.hasPrintableCharacters = false;
367
+
368
+ if (this.value) {
369
+ for (let i = 0, n = this.value.length; i < n; i++) {
370
+ const charCode = this.value.charCodeAt(i);
371
+
372
+ // Check if the character is non-printable
373
+ if ((charCode > 255 && charCode !== 9109) || [129, 143, 144, 157, 160].includes(charCode)) {
374
+ this.hasPrintableCharacters = true;
375
+ this.emit('nile-value', { value: this.value , hasPrintableCharacters: true });
376
+ break;
377
+ }
378
+ }
379
+ }
355
380
  }
356
381
 
382
+ /** Removes all non printable characters from the value. */
383
+ removeAllNonPrintableCharacters() {
384
+ let cleanedValue = '';
385
+
386
+ if (this.value) {
387
+ for (let i = 0, n = this.value.length; i < n; i++) {
388
+ const charCode = this.value.charCodeAt(i);
389
+
390
+ // Consider a character printable if it's not in the specified non-printable ranges
391
+ if (!(charCode > 255 && charCode !== 9109) && ![129, 143, 144, 157, 160].includes(charCode)) {
392
+ cleanedValue += this.value.charAt(i);
393
+ }
394
+ }
395
+ }
396
+
397
+ this.value = cleanedValue;
398
+ this.emit('nile-npchar-removed', { value: this.value });
399
+
400
+ }
401
+
402
+
357
403
  /** Sets focus on the input. */
358
404
  focus(options?: FocusOptions) {
359
405
  this.input.focus(options);
@@ -478,7 +524,13 @@ export class NileInput extends NileElement implements NileFormControl {
478
524
  ${hasLabelSuffixSlot ? html` <slot name="label-suffix"></slot> ` : ``}
479
525
 
480
526
  <div part="form-control-input" class="form-control-input">
527
+ <nile-popup ?active=${this.hasPrintableCharacters}
528
+ placement="bottom-start"
529
+ distance="5"
530
+ strategy="fixed"
531
+ >
481
532
  <div
533
+ slot="anchor"
482
534
  part="base"
483
535
  class=${classMap({
484
536
  input: true,
@@ -598,6 +650,13 @@ export class NileInput extends NileElement implements NileFormControl {
598
650
 
599
651
  <slot name="suffix" part="suffix" class="input__suffix"></slot>
600
652
  </div>
653
+
654
+ <div class="input__non-printable">
655
+ Non-printable character detected.<span class="input__remove-non-printable" @click=${
656
+ this.removeAllNonPrintableCharacters
657
+ }> Remove All </span>
658
+ </div>
659
+ </nile-popup>
601
660
  </div>
602
661
 
603
662
  ${