@aquera/nile-elements 0.1.3 → 0.1.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/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.1.3",
6
+ "version": "0.1.4",
7
7
  "main": "dist/src/index.js",
8
8
  "type": "module",
9
9
  "module": "dist/src/index.js",
@@ -15,34 +15,99 @@ export const styles = css`
15
15
  }
16
16
 
17
17
  .introjs-tooltip {
18
- background-color: var(--nile-tour-background-color, #000);
18
+ background-color: var(--nile-tour-background-color, #fff);
19
19
  color: var(--nile-tour-text-color, #fff);
20
20
  width: 300px;
21
21
  max-width: 300px;
22
+ border-radius: 4px;
23
+ border: 1px solid var(--Neutral-30, #c7ced4);
24
+ background: var(--White-Normal, #fff);
25
+
26
+ /* Elevation/Lifted */
27
+ box-shadow: 0px 4px 8px 0px rgba(119, 125, 130, 0.15);
22
28
  }
23
29
 
24
- .introjs-arrow.bottom {
25
- border-top-color: var(--nile-tour-background-color, #000);
30
+ .introjs-tooltip-title {
31
+ color: #000;
32
+ font-size: 16px;
33
+ font-style: normal;
34
+ font-weight: 500;
35
+ line-height: 16px;
36
+ letter-spacing: 0.2px;
37
+ }
38
+
39
+ .introjs-tooltip-header {
40
+ padding-left: 18px;
41
+ padding-right: 18px;
42
+ padding-top: 18px;
43
+ }
44
+
45
+ .introjs-tooltiptext {
46
+ color: #7f7f7f;
47
+ font-size: 14px;
48
+ font-style: normal;
49
+ font-weight: 400;
50
+ line-height: 20px;
51
+ letter-spacing: 0.2px;
52
+ padding: 15px 18px;
53
+ }
54
+
55
+ .introjs-arrow {
56
+ width: 15px;
57
+ height: 20px;
58
+ background-image: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" width="15" height="20" viewBox="0 0 15 20" fill="none"%3E%3Cpath d="M1.43333 11.2C0.633333 10.6 0.633333 9.4 1.43333 8.8L12.1 0.800001C13.0889 0.0583585 14.5 0.763931 14.5 2L14.5 18C14.5 19.2361 13.0889 19.9416 12.1 19.2L1.43333 11.2Z" fill="white" stroke="%23C7CED4"/%3E%3C/svg%3E');
59
+ background-repeat: no-repeat;
60
+ background-size: contain;
61
+ background-position: center;
62
+ position: absolute;
63
+ border: none;
64
+ content: none;
26
65
  }
27
66
 
28
67
  .introjs-arrow.top {
29
- border-bottom-color: var(--nile-tour-background-color, #000);
68
+ top: -14.5px;
69
+ transform: rotate(90deg);
70
+ clip-path: inset(0px 3px 0px 0px);
71
+ }
72
+
73
+ .introjs-arrow.bottom {
74
+ bottom: -14.5px;
75
+ transform: rotate(270deg);
76
+ clip-path: inset(0px 3px 0px 0px);
30
77
  }
31
78
 
32
79
  .introjs-arrow.left {
33
- border-right-color: var(--nile-tour-background-color, #000);
80
+ left: -11.5px;
81
+ transform: rotate(0);
82
+ clip-path: inset(0px 3px 0px 0px);
34
83
  }
35
84
 
36
85
  .introjs-arrow.right {
37
- border-left-color: var(--nile-tour-background-color, #000);
86
+ right: -12px;
87
+ transform: rotate(180deg);
88
+ clip-path: inset(0px 3px 0px 0px);
38
89
  }
39
90
 
40
91
  .introjs-arrow.left-bottom {
41
- border-right-color: var(--nile-tour-background-color, #000) !important;
92
+ transform: rotate(0);
93
+ clip-path: inset(0px 1px 0px 0px);
94
+ left: -13.5px;
95
+ border-right-color: var(--nile-tour-background-color, #fff) !important;
42
96
  }
43
97
 
44
98
  .introjs-arrow.right-bottom {
45
- border-left-color: var(--nile-tour-background-color, #000) !important;
99
+ right: -12px;
100
+ transform: rotate(180deg);
101
+ clip-path: inset(0px 3px 0px 0px);
102
+ border-left-color: var(--nile-tour-background-color, #fff) !important;
103
+ }
104
+
105
+ .introjs-arrow.top-middle {
106
+ top: -14px;
107
+ left: 50%;
108
+ margin-left: -5px;
109
+ transform: rotate(90deg);
110
+ clip-path: inset(0px 3px 0px 0px);
46
111
  }
47
112
 
48
113
  .introjs-button {
@@ -53,26 +118,46 @@ export const styles = css`
53
118
  padding: 0;
54
119
  cursor: pointer;
55
120
  text-shadow: none;
56
- background: transparent;
121
+ background: var(--Primary-Normal, #005ea6);
57
122
  border-color: transparent;
123
+ display: flex;
124
+ padding: 12px;
125
+ align-items: center;
126
+ gap: 12px;
127
+ border-radius: 4px;
58
128
  }
59
129
 
60
130
  .introjs-button:hover {
61
- outline: 0;
62
- text-decoration: none;
131
+ background: none;
132
+ border: none;
133
+ color: var(--nile-tour-text-color, #fff);
134
+ font-size: 14px;
135
+ padding: 0;
136
+ cursor: pointer;
137
+ text-shadow: none;
138
+ background: var(--Primary-Normal, #005ea6);
63
139
  border-color: transparent;
64
- background: transparent;
65
- color: white;
140
+ display: flex;
141
+ padding: 12px;
142
+ align-items: center;
143
+ gap: 12px;
66
144
  }
67
145
 
68
146
  .introjs-button:focus {
69
- outline: 0;
70
- text-decoration: none;
71
- border-color: transparent;
72
- background: transparent;
73
- color: white;
147
+ background: none;
74
148
  border: none;
149
+ color: var(--nile-tour-text-color, #fff);
150
+ font-size: 14px;
151
+ padding: 0;
152
+ cursor: pointer;
153
+ text-shadow: none;
75
154
  box-shadow: none;
155
+ background: var(--Primary-Normal, #005ea6);
156
+ border-color: transparent;
157
+ display: flex;
158
+ padding: 12px;
159
+ align-items: center;
160
+ gap: 12px;
76
161
  }
77
162
 
78
163
  .introjs-tooltipbuttons {
@@ -109,12 +194,16 @@ export const styles = css`
109
194
  }
110
195
 
111
196
  .introjs-step-counter {
112
- margin-right: auto; /* Push buttons to the opposite side */
197
+ margin-right: auto;
113
198
  font-size: 14px;
114
- color: #ffffff;
115
199
  padding: 0 10px;
116
200
  display: flex;
117
201
  align-items: center;
202
+ color: var(--Color-Text-Info, #1978B8);
203
+ font-style: normal;
204
+ font-weight: 400;
205
+ line-height: 14px;
206
+ letter-spacing: 0.2px;
118
207
  }
119
208
 
120
209
  @keyframes shake {
@@ -136,7 +225,7 @@ export const styles = css`
136
225
  }
137
226
 
138
227
  .introjs-shake {
139
- animation: shake 0.5s ease infinite; /* Repeats continuously */
228
+ animation: shake 0.5s ease infinite;
140
229
  }
141
230
  `;
142
231
 
@@ -28,7 +28,7 @@ export class NileTour extends LitElement {
28
28
  element: string;
29
29
  title: string;
30
30
  content: string;
31
- position: "top" | "left" | "right" | "bottom";
31
+ position: any;
32
32
  beforeChange?: () => Promise<boolean> | boolean;
33
33
  afterChange?: () => Promise<void> | void;
34
34
  }> = [];
@@ -101,13 +101,13 @@ export class NileTour extends LitElement {
101
101
  position: step.position,
102
102
  beforeChange: step.beforeChange,
103
103
  afterChange: step.afterChange,
104
- }))
105
- .filter((step) => step.element !== null);
104
+ }));
105
+ // .filter((step) => step.element !== null);
106
106
 
107
107
  this.tourInstance = introJs().setOptions({
108
108
  steps: introSteps,
109
- nextLabel: "<button class='introjs-button introjs-next-button'>Next</button>",
110
- prevLabel: "<button class='introjs-button introjs-prev-button'>Prev</button>",
109
+ nextLabel: "Next",
110
+ prevLabel: "Prev",
111
111
  overlayOpacity: 0,
112
112
  disableInteraction: this.disableInteraction,
113
113
  showButtons: true,
@@ -157,7 +157,26 @@ export class NileTour extends LitElement {
157
157
  }
158
158
  });
159
159
 
160
- this.tourInstance.start();
160
+
161
+
162
+ this.tourInstance.start().then(() => {
163
+ const currentStep = this.tourInstance?._currentStep ?? 0;
164
+ const totalSteps = this.steps.length;
165
+ const tooltip = document.querySelector('.introjs-tooltip');
166
+ if (tooltip) {
167
+ const navBar = tooltip.querySelector('.introjs-tooltipbuttons');
168
+ if (navBar) {
169
+ let stepCounter = navBar.querySelector('.introjs-step-counter') as HTMLElement;
170
+ if (!stepCounter) {
171
+ stepCounter = document.createElement('div');
172
+ stepCounter.className = 'introjs-step-counter';
173
+ navBar.insertBefore(stepCounter, navBar.firstChild);
174
+ }
175
+ stepCounter.textContent = `${currentStep + 1} of ${totalSteps}`;
176
+ }
177
+ } }).catch(err => {
178
+ console.error('Error starting the tour:', err);
179
+ });
161
180
  }
162
181
 
163
182
  private shakeTooltip(): void {
@@ -3766,11 +3766,11 @@
3766
3766
  },
3767
3767
  {
3768
3768
  "name": "nile-tour",
3769
- "description": "Nile tour component.\n\nAttributes:\n\n * `steps` {`{ stepNo: number; element: string; title: string; content: string; position: \"top\" | \"bottom\" | \"right\" | \"left\"; beforeChange?: (() => boolean | Promise<boolean>) | undefined; afterChange?: (() => void | Promise<...>) | undefined; }[]`} - The steps for the tour.\n\n * `stepsJson` {`string`} - JSON string for steps.\n\n * `showBackdrop` {`boolean`} - Whether to show the backdrop overlay.\n\n * `disableInteraction` {`boolean`} - Whether to disable interaction during the tour.\n\nProperties:\n\n * `tourInstance` - \n\n * `steps` {`{ stepNo: number; element: string; title: string; content: string; position: \"top\" | \"bottom\" | \"right\" | \"left\"; beforeChange?: (() => boolean | Promise<boolean>) | undefined; afterChange?: (() => void | Promise<...>) | undefined; }[]`} - The steps for the tour.\n\n * `stepsJson` {`string`} - JSON string for steps.\n\n * `showBackdrop` {`boolean`} - Whether to show the backdrop overlay.\n\n * `disableInteraction` {`boolean`} - Whether to disable interaction during the tour.",
3769
+ "description": "Nile tour component.\n\nAttributes:\n\n * `steps` {`{ stepNo: number; element: string; title: string; content: string; position: any; beforeChange?: (() => boolean | Promise<boolean>) | undefined; afterChange?: (() => void | Promise<void>) | undefined; }[]`} - The steps for the tour.\n\n * `stepsJson` {`string`} - JSON string for steps.\n\n * `showBackdrop` {`boolean`} - Whether to show the backdrop overlay.\n\n * `disableInteraction` {`boolean`} - Whether to disable interaction during the tour.\n\nProperties:\n\n * `tourInstance` - \n\n * `steps` {`{ stepNo: number; element: string; title: string; content: string; position: any; beforeChange?: (() => boolean | Promise<boolean>) | undefined; afterChange?: (() => void | Promise<void>) | undefined; }[]`} - The steps for the tour.\n\n * `stepsJson` {`string`} - JSON string for steps.\n\n * `showBackdrop` {`boolean`} - Whether to show the backdrop overlay.\n\n * `disableInteraction` {`boolean`} - Whether to disable interaction during the tour.",
3770
3770
  "attributes": [
3771
3771
  {
3772
3772
  "name": "steps",
3773
- "description": "`steps` {`{ stepNo: number; element: string; title: string; content: string; position: \"top\" | \"bottom\" | \"right\" | \"left\"; beforeChange?: (() => boolean | Promise<boolean>) | undefined; afterChange?: (() => void | Promise<...>) | undefined; }[]`} - The steps for the tour.\n\nProperty: steps\n\nDefault: "
3773
+ "description": "`steps` {`{ stepNo: number; element: string; title: string; content: string; position: any; beforeChange?: (() => boolean | Promise<boolean>) | undefined; afterChange?: (() => void | Promise<void>) | undefined; }[]`} - The steps for the tour.\n\nProperty: steps\n\nDefault: "
3774
3774
  },
3775
3775
  {
3776
3776
  "name": "stepsJson",