@aquera/nile-elements 0.1.26 → 0.1.28-beta-1.1
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/README.md +6 -0
- package/demo/index.html +0 -97
- package/dist/nile-auto-complete/nile-auto-complete.cjs.js +1 -1
- package/dist/nile-auto-complete/nile-auto-complete.cjs.js.map +1 -1
- package/dist/nile-auto-complete/nile-auto-complete.esm.js +1 -1
- package/dist/nile-circular-progressbar/nile-circular-progressbar.cjs.js +1 -1
- package/dist/nile-circular-progressbar/nile-circular-progressbar.cjs.js.map +1 -1
- package/dist/nile-circular-progressbar/nile-circular-progressbar.css.cjs.js +1 -1
- package/dist/nile-circular-progressbar/nile-circular-progressbar.css.cjs.js.map +1 -1
- package/dist/nile-circular-progressbar/nile-circular-progressbar.css.esm.js +23 -5
- package/dist/nile-circular-progressbar/nile-circular-progressbar.esm.js +22 -15
- package/dist/nile-progress-bar/nile-progress-bar.cjs.js +1 -1
- package/dist/nile-progress-bar/nile-progress-bar.cjs.js.map +1 -1
- package/dist/nile-progress-bar/nile-progress-bar.css.cjs.js +1 -1
- package/dist/nile-progress-bar/nile-progress-bar.css.cjs.js.map +1 -1
- package/dist/nile-progress-bar/nile-progress-bar.css.esm.js +15 -3
- package/dist/nile-progress-bar/nile-progress-bar.esm.js +3 -3
- package/dist/nile-stepper/nile-stepper.cjs.js +1 -1
- package/dist/nile-stepper/nile-stepper.cjs.js.map +1 -1
- package/dist/nile-stepper/nile-stepper.css.cjs.js +1 -1
- package/dist/nile-stepper/nile-stepper.css.cjs.js.map +1 -1
- package/dist/nile-stepper/nile-stepper.css.esm.js +8 -2
- package/dist/nile-stepper/nile-stepper.esm.js +3 -3
- package/dist/nile-stepper-item/nile-stepper-item.cjs.js +1 -1
- package/dist/nile-stepper-item/nile-stepper-item.cjs.js.map +1 -1
- package/dist/nile-stepper-item/nile-stepper-item.css.cjs.js +1 -1
- package/dist/nile-stepper-item/nile-stepper-item.css.cjs.js.map +1 -1
- package/dist/nile-stepper-item/nile-stepper-item.css.esm.js +37 -16
- package/dist/nile-stepper-item/nile-stepper-item.esm.js +20 -17
- package/dist/nile-tab-group/nile-tab-group.cjs.js.map +1 -1
- package/dist/nile-tab-group/nile-tab-group.css.cjs.js +1 -1
- package/dist/nile-tab-group/nile-tab-group.css.cjs.js.map +1 -1
- package/dist/nile-tab-group/nile-tab-group.css.esm.js +3 -3
- package/dist/nile-vertical-stepper-item/nile-vertical-stepper-item.cjs.js +1 -1
- package/dist/nile-vertical-stepper-item/nile-vertical-stepper-item.cjs.js.map +1 -1
- package/dist/nile-vertical-stepper-item/nile-vertical-stepper-item.css.cjs.js +1 -1
- package/dist/nile-vertical-stepper-item/nile-vertical-stepper-item.css.cjs.js.map +1 -1
- package/dist/nile-vertical-stepper-item/nile-vertical-stepper-item.css.esm.js +28 -14
- package/dist/nile-vertical-stepper-item/nile-vertical-stepper-item.esm.js +11 -13
- package/dist/src/nile-auto-complete/nile-auto-complete.js +0 -1
- package/dist/src/nile-auto-complete/nile-auto-complete.js.map +1 -1
- package/dist/src/nile-circular-progressbar/nile-circular-progressbar.css.d.ts +5 -5
- package/dist/src/nile-circular-progressbar/nile-circular-progressbar.css.js +28 -10
- package/dist/src/nile-circular-progressbar/nile-circular-progressbar.css.js.map +1 -1
- package/dist/src/nile-circular-progressbar/nile-circular-progressbar.d.ts +3 -0
- package/dist/src/nile-circular-progressbar/nile-circular-progressbar.js +46 -20
- package/dist/src/nile-circular-progressbar/nile-circular-progressbar.js.map +1 -1
- package/dist/src/nile-progress-bar/nile-progress-bar.css.js +13 -1
- package/dist/src/nile-progress-bar/nile-progress-bar.css.js.map +1 -1
- package/dist/src/nile-progress-bar/nile-progress-bar.d.ts +1 -0
- package/dist/src/nile-progress-bar/nile-progress-bar.js +6 -1
- package/dist/src/nile-progress-bar/nile-progress-bar.js.map +1 -1
- package/dist/src/nile-stepper/nile-stepper.css.js +6 -0
- package/dist/src/nile-stepper/nile-stepper.css.js.map +1 -1
- package/dist/src/nile-stepper/nile-stepper.d.ts +2 -2
- package/dist/src/nile-stepper/nile-stepper.js +8 -8
- package/dist/src/nile-stepper/nile-stepper.js.map +1 -1
- package/dist/src/nile-stepper-item/nile-stepper-item.css.js +37 -16
- package/dist/src/nile-stepper-item/nile-stepper-item.css.js.map +1 -1
- package/dist/src/nile-stepper-item/nile-stepper-item.d.ts +5 -1
- package/dist/src/nile-stepper-item/nile-stepper-item.js +33 -14
- package/dist/src/nile-stepper-item/nile-stepper-item.js.map +1 -1
- package/dist/src/nile-tab-group/nile-tab-group.css.js +3 -3
- package/dist/src/nile-tab-group/nile-tab-group.css.js.map +1 -1
- package/dist/src/nile-tab-group/nile-tab-group.js.map +1 -1
- package/dist/src/nile-vertical-stepper-item/nile-vertical-stepper-item.css.js +28 -14
- package/dist/src/nile-vertical-stepper-item/nile-vertical-stepper-item.css.js.map +1 -1
- package/dist/src/nile-vertical-stepper-item/nile-vertical-stepper-item.d.ts +1 -0
- package/dist/src/nile-vertical-stepper-item/nile-vertical-stepper-item.js +10 -8
- package/dist/src/nile-vertical-stepper-item/nile-vertical-stepper-item.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/nile-auto-complete/nile-auto-complete.ts +0 -1
- package/src/nile-circular-progressbar/nile-circular-progressbar.css.ts +24 -6
- package/src/nile-circular-progressbar/nile-circular-progressbar.ts +39 -15
- package/src/nile-progress-bar/nile-progress-bar.css.ts +14 -2
- package/src/nile-progress-bar/nile-progress-bar.ts +4 -1
- package/src/nile-stepper/nile-stepper.css.ts +6 -0
- package/src/nile-stepper/nile-stepper.ts +11 -11
- package/src/nile-stepper-item/nile-stepper-item.css.ts +37 -16
- package/src/nile-stepper-item/nile-stepper-item.ts +34 -17
- package/src/nile-tab-group/nile-tab-group.css.ts +3 -3
- package/src/nile-tab-group/nile-tab-group.ts +1 -1
- package/src/nile-vertical-stepper-item/nile-vertical-stepper-item.css.ts +28 -14
- package/src/nile-vertical-stepper-item/nile-vertical-stepper-item.ts +12 -8
- package/vscode-html-custom-data.json +37 -6
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.
|
6
|
+
"version": "0.1.28-beta-1.1",
|
7
7
|
"main": "dist/src/index.js",
|
8
8
|
"type": "module",
|
9
9
|
"module": "dist/src/index.js",
|
@@ -118,7 +118,6 @@ export class NileAutoComplete extends NileElement {
|
|
118
118
|
private handleSelect(event: CustomEvent) {
|
119
119
|
this.value = event.detail.value;
|
120
120
|
this.emit('nile-complete', { value: event.detail.value });
|
121
|
-
this.emit('nile-input', { value: event.detail.value });
|
122
121
|
this.isDropdownOpen = false;
|
123
122
|
this.dropdownElement?.hide();
|
124
123
|
}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
/**
|
1
|
+
/**
|
2
2
|
* Copyright Aquera Inc 2023
|
3
3
|
*
|
4
4
|
* This source code is licensed under the BSD-3-Clause license found in the
|
@@ -14,16 +14,18 @@ export const styles = css`
|
|
14
14
|
:host{
|
15
15
|
|
16
16
|
}
|
17
|
+
|
17
18
|
.track {
|
18
|
-
stroke-width:
|
19
|
-
stroke: var(--nile-colors-
|
19
|
+
stroke-width: 4px;
|
20
|
+
stroke: var(--nile-colors-neutral-400);
|
20
21
|
opacity: 0.5;
|
21
22
|
fill: none;
|
23
|
+
height: 2px;
|
22
24
|
}
|
23
25
|
|
24
26
|
.progress {
|
25
|
-
stroke-width:
|
26
|
-
stroke: var(--nile-colors-
|
27
|
+
stroke-width: 4px;
|
28
|
+
stroke: var(--nile-colors-primary-600);
|
27
29
|
stroke-linecap: round;
|
28
30
|
fill: none;
|
29
31
|
transform: rotate(270deg);
|
@@ -38,7 +40,23 @@ export const styles = css`
|
|
38
40
|
font-weight: var(--nile-font-weight-regular);
|
39
41
|
line-height: var(--nile-type-scale-1);
|
40
42
|
letter-spacing: 0.2px;
|
41
|
-
|
43
|
+
|
44
|
+
}
|
45
|
+
|
46
|
+
|
47
|
+
.nile-progress-bar__status {
|
48
|
+
display: flex;
|
49
|
+
justify-content: space-between;
|
50
|
+
align-items: center;
|
51
|
+
margin-bottom: 4px;
|
52
|
+
}
|
53
|
+
|
54
|
+
.nile-progress-bar__message {
|
55
|
+
flex-grow: 1;
|
56
|
+
}
|
57
|
+
|
58
|
+
.nile-progress-bar__percentage {
|
59
|
+
white-space: nowrap;
|
42
60
|
}
|
43
61
|
`;
|
44
62
|
|
@@ -31,10 +31,11 @@ export class NileCircularProgressbar extends NileElement {
|
|
31
31
|
public static get styles(): CSSResultArray {
|
32
32
|
return [styles];
|
33
33
|
}
|
34
|
+
|
34
35
|
@query('.progress') progressCircle: any;
|
35
36
|
@property({ type: Number, reflect: true }) progress = 50;
|
36
|
-
|
37
|
-
|
37
|
+
@property({ reflect: true }) content: String;
|
38
|
+
/* #endregion */
|
38
39
|
|
39
40
|
/* #region Methods */
|
40
41
|
|
@@ -43,6 +44,18 @@ export class NileCircularProgressbar extends NileElement {
|
|
43
44
|
* @slot This is a slot test
|
44
45
|
*/
|
45
46
|
// make reactive to pass through
|
47
|
+
@property({ type: String, reflect: true }) size: 'sm' | 'md' | 'lg' = 'md';
|
48
|
+
|
49
|
+
private get circleSize() {
|
50
|
+
switch (this.size) {
|
51
|
+
case 'sm':
|
52
|
+
return { radius: 9, viewBox: 24, fontSize: '5px' };
|
53
|
+
case 'lg':
|
54
|
+
return { radius: 28, viewBox: 64, fontSize: '10px' };
|
55
|
+
default:
|
56
|
+
return { radius: 18, viewBox: 40, fontSize: '10px' };
|
57
|
+
}
|
58
|
+
}
|
46
59
|
|
47
60
|
connectedCallback() {
|
48
61
|
super.connectedCallback();
|
@@ -65,20 +78,31 @@ export class NileCircularProgressbar extends NileElement {
|
|
65
78
|
}
|
66
79
|
|
67
80
|
public render(): TemplateResult {
|
81
|
+
const { radius, viewBox, fontSize } = this.circleSize;
|
82
|
+
const innerText = this.content === undefined ? `${Math.round(this.progress)}%` : this.content;
|
83
|
+
|
84
|
+
|
68
85
|
return html`
|
69
|
-
<svg width="
|
70
|
-
<circle r="
|
71
|
-
<circle r="
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
86
|
+
<svg width="${viewBox}" height="${viewBox}" viewBox="0 0 ${viewBox} ${viewBox}">
|
87
|
+
<circle r="${radius}" cx="${viewBox / 2}" cy="${viewBox / 2}" class="track"></circle>
|
88
|
+
<circle r="${radius}" cx="${viewBox / 2}" cy="${viewBox / 2}" class="progress"></circle>
|
89
|
+
|
90
|
+
|
91
|
+
<text
|
92
|
+
x="50%"
|
93
|
+
y="53%"
|
94
|
+
text-anchor="middle"
|
95
|
+
alignment-baseline="middle"
|
96
|
+
class="circle__text"
|
97
|
+
style="font-size: ${fontSize};"
|
98
|
+
>
|
99
|
+
${innerText}
|
100
|
+
</text>
|
101
|
+
|
102
|
+
</svg>
|
103
|
+
|
104
|
+
|
105
|
+
|
82
106
|
`;
|
83
107
|
}
|
84
108
|
|
@@ -24,6 +24,13 @@ export default css`
|
|
24
24
|
background-color: var(--nile-colors-neutral-400);
|
25
25
|
}
|
26
26
|
|
27
|
+
|
28
|
+
.nile-progress-bar__progress-bar.rounded li {
|
29
|
+
height: 4px;
|
30
|
+
border-radius: 4px;
|
31
|
+
overflow: hidden;
|
32
|
+
}
|
33
|
+
|
27
34
|
.nile-progress-bar__progress-bar li.changeColor::after {
|
28
35
|
background-color: var(--nile-colors-primary-600);
|
29
36
|
}
|
@@ -33,13 +40,18 @@ export default css`
|
|
33
40
|
top: 0;
|
34
41
|
left: 0;
|
35
42
|
background-color: var(--nile-colors-primary-600);
|
36
|
-
height:
|
43
|
+
height: 100%;
|
37
44
|
transition: all 1s linear;
|
38
45
|
}
|
39
46
|
|
47
|
+
|
48
|
+
.nile-progress-bar__progress-bar.rounded li span {
|
49
|
+
border-radius: 4px;
|
50
|
+
}
|
51
|
+
|
40
52
|
.nile-progress-bar__reset {
|
41
53
|
background-color: var(--nile-colors-neutral-400);
|
42
54
|
position: absolute;
|
43
55
|
z-index: 1;
|
44
56
|
}
|
45
|
-
`;
|
57
|
+
`;
|
@@ -7,11 +7,14 @@ export class NileProgressBar extends LitElement {
|
|
7
7
|
static override styles: CSSResultGroup = styles;
|
8
8
|
|
9
9
|
@property({ type: Number }) value = 0;
|
10
|
+
@property({ type: String }) variant: 'normal' | 'rounded' = 'normal';
|
10
11
|
|
11
12
|
override render() {
|
13
|
+
const variantClass = this.variant === 'rounded' ? 'rounded' : '';
|
14
|
+
|
12
15
|
return html`
|
13
16
|
<div class="nile-progress-bar__container">
|
14
|
-
<ul class="nile-progress-bar__progress-bar">
|
17
|
+
<ul class="nile-progress-bar__progress-bar ${variantClass}">
|
15
18
|
<li><span style="width: ${this.value}%"></span></li>
|
16
19
|
</ul>
|
17
20
|
</div>
|
@@ -11,6 +11,9 @@ import {css} from 'lit';
|
|
11
11
|
* Stepper CSS
|
12
12
|
*/
|
13
13
|
export const styles = css`
|
14
|
+
*{
|
15
|
+
box-sizing:border-box;
|
16
|
+
}
|
14
17
|
:host {
|
15
18
|
display:block;
|
16
19
|
height:100%;
|
@@ -18,11 +21,14 @@ export const styles = css`
|
|
18
21
|
.nile-stepper--horizontal{
|
19
22
|
display:flex;
|
20
23
|
align-items:center;
|
24
|
+
padding: var(--nile-spacing-spacing-3xl) 0;
|
21
25
|
}
|
26
|
+
|
22
27
|
.nile-stepper--vertical{
|
23
28
|
height:100%;
|
24
29
|
display:flex;
|
25
30
|
flex-direction:column;
|
31
|
+
padding: var(--nile-spacing-spacing-3xl) var(--nile-spacing-spacing-3xl) 0;
|
26
32
|
}
|
27
33
|
`;
|
28
34
|
|
@@ -5,7 +5,7 @@
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
6
6
|
*/
|
7
7
|
|
8
|
-
import { LitElement, html, CSSResultArray, TemplateResult } from 'lit';
|
8
|
+
import { LitElement, html, CSSResultArray, TemplateResult, PropertyValueMap } from 'lit';
|
9
9
|
import { customElement, property } from 'lit/decorators.js';
|
10
10
|
import { styles } from './nile-stepper.css';
|
11
11
|
import NileElement from '../internal/nile-element';
|
@@ -23,17 +23,17 @@ import { classMap } from 'lit/directives/class-map.js';
|
|
23
23
|
export class NileStepper extends NileElement {
|
24
24
|
|
25
25
|
@property({ type: Boolean, attribute: 'vertical' }) isVertical: boolean = false;
|
26
|
-
@property({ type: Boolean, attribute:
|
27
|
-
@property({ type: Number, attribute:
|
28
|
-
@property({ type: Number, attribute:
|
29
|
-
@property({ type: String, attribute:
|
26
|
+
@property({ type: Boolean, attribute: true, reflect:true }) contentBelow: boolean = false;
|
27
|
+
@property({ type: Number, attribute: true, reflect:true }) currentStep: number = 0;
|
28
|
+
@property({ type: Number, attribute: true, reflect:true }) completedStep: number = 0;
|
29
|
+
@property({ type: String, attribute: true, reflect:true }) size: 'sm' | 'md' | 'lg' = 'md';
|
30
30
|
@property() icon: string = 'tick';
|
31
31
|
|
32
|
-
|
33
|
-
|
34
|
-
|
32
|
+
protected update(changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>): void{
|
33
|
+
super.update(changedProperties);
|
34
|
+
if(changedProperties.has('currentStep') || changedProperties.has('completedStep')){
|
35
35
|
this.updateItems();
|
36
|
-
}
|
36
|
+
}
|
37
37
|
}
|
38
38
|
|
39
39
|
@watch('currentStep')
|
@@ -47,9 +47,9 @@ export class NileStepper extends NileElement {
|
|
47
47
|
this.updateItems()
|
48
48
|
this.emit('nile-completed-change', { value: this.completedStep });
|
49
49
|
}
|
50
|
-
|
50
|
+
|
51
51
|
private updateItems() {
|
52
|
-
const items: any = [...this.querySelectorAll(this.isVertical?'nile-vertical-stepper-item':'nile-stepper-item')];
|
52
|
+
const items: any = [...this.querySelectorAll(this.isVertical ? 'nile-vertical-stepper-item' : 'nile-stepper-item')];
|
53
53
|
if (!items.length) return;
|
54
54
|
const haveFlex = items.length < 3;
|
55
55
|
|
@@ -15,7 +15,7 @@ export const styles = css`
|
|
15
15
|
--stepper-flex-val:1;
|
16
16
|
--bulletin--dot--seperation:30%;
|
17
17
|
|
18
|
-
display:inline-block;
|
18
|
+
display: inline-block;
|
19
19
|
flex-grow:var(--stepper-flex-val);
|
20
20
|
min-width:var(--nile-stepper-min-width);
|
21
21
|
}
|
@@ -25,7 +25,7 @@ export const styles = css`
|
|
25
25
|
}
|
26
26
|
|
27
27
|
.stepper__item--sm {
|
28
|
-
--item-spacing: var(--nile-spacing-spacing-
|
28
|
+
--item-spacing: var(--nile-spacing-spacing-md);
|
29
29
|
--stepper-item-title-size:14px;
|
30
30
|
--stepper-item-subtitle-size:14px;
|
31
31
|
--stepper-item-text-line-height:20px;
|
@@ -33,17 +33,17 @@ export const styles = css`
|
|
33
33
|
}
|
34
34
|
|
35
35
|
.stepper__item--md {
|
36
|
-
--item-spacing: var(--nile-spacing-spacing-
|
36
|
+
--item-spacing: var(--nile-spacing-spacing-md);
|
37
37
|
--stepper-item-title-size:16px;
|
38
|
-
--stepper-item-subtitle-size:
|
39
|
-
--stepper-item-text-line-
|
38
|
+
--stepper-item-subtitle-size:14px;
|
39
|
+
--stepper-item-text-line-height:24px;
|
40
40
|
--circle-height:20px;
|
41
41
|
}
|
42
42
|
|
43
43
|
.stepper__item--lg {
|
44
|
-
--item-spacing: var(--nile-spacing-spacing-
|
44
|
+
--item-spacing: var(--nile-spacing-spacing-lg);
|
45
45
|
--stepper-item-title-size:16px;
|
46
|
-
--stepper-item-subtitle-size:
|
46
|
+
--stepper-item-subtitle-size:14px;
|
47
47
|
--stepper-item-text-line-height:24px;
|
48
48
|
--circle-height:28px;
|
49
49
|
}
|
@@ -67,13 +67,24 @@ export const styles = css`
|
|
67
67
|
.stepper__line {
|
68
68
|
display: block;
|
69
69
|
border: 0;
|
70
|
-
border-top: 2px solid var(--nile-colors-
|
70
|
+
border-top: 2px solid var(--nile-colors-neutral-500);
|
71
71
|
}
|
72
72
|
|
73
73
|
.stepper__line--active {
|
74
74
|
border-top: 2px solid var(--nile-colors-primary-600);
|
75
75
|
}
|
76
76
|
|
77
|
+
.stepper__item__content--above{
|
78
|
+
position:relative;
|
79
|
+
padding: 0 var(--nile-spacing-spacing-md);
|
80
|
+
}
|
81
|
+
|
82
|
+
.stepper__item__content--above .stepper__content__subtitle{
|
83
|
+
position: absolute;
|
84
|
+
top: 100%;
|
85
|
+
white-space: nowrap;
|
86
|
+
}
|
87
|
+
|
77
88
|
.stepper__item__content--below {
|
78
89
|
margin-top: var(--item-spacing);
|
79
90
|
display:flex;
|
@@ -87,25 +98,35 @@ export const styles = css`
|
|
87
98
|
margin:0 -1px;
|
88
99
|
}
|
89
100
|
|
101
|
+
.stepper__item__bulletin{
|
102
|
+
margin-left: 6px;
|
103
|
+
margin-right: 6px;
|
104
|
+
}
|
105
|
+
|
106
|
+
.stepper__item__bulletin--inline{
|
107
|
+
margin-right: 0px;
|
108
|
+
}
|
109
|
+
|
90
110
|
.stepper__content__title {
|
91
|
-
color:var(--nile-colors-
|
111
|
+
color:var(--nile-colors-dark-900);
|
92
112
|
font-size: var(--stepper-item-title-size);
|
93
113
|
line-height: var(--stepper-item-text-line-height);
|
94
114
|
font-family: var(--nile-font-family-medium);
|
95
|
-
font-weight:
|
115
|
+
font-weight: 400;
|
96
116
|
}
|
97
117
|
|
98
118
|
.stepper__content__title--inline{
|
99
119
|
padding: 0 8px;
|
100
|
-
color:var(--nile-colors-
|
120
|
+
color:var(--nile-colors-dark-900);
|
101
121
|
}
|
102
122
|
|
103
123
|
.stepper__content__title--active{
|
104
|
-
color:var(--nile-colors-primary-
|
124
|
+
color:var(--nile-colors-primary-600);
|
125
|
+
font-weight: 600;
|
105
126
|
}
|
106
127
|
|
107
128
|
.stepper__content__subtitle {
|
108
|
-
color:var(--nile-colors-
|
129
|
+
color:var(--nile-colors-dark-500);
|
109
130
|
font-size: var(--stepper-item-subtitle-size);
|
110
131
|
line-height: var(--stepper-item-text-line-height);
|
111
132
|
font-family: var(--nile-font-family-sans-serif);
|
@@ -120,13 +141,13 @@ export const styles = css`
|
|
120
141
|
width: var(--circle-height);
|
121
142
|
aspect-ratio: 1 / 1;
|
122
143
|
border-radius: 50%;
|
123
|
-
background: radial-gradient(var(--nile-colors-
|
124
|
-
border: 2px solid var(--nile-colors-
|
144
|
+
background: radial-gradient(var(--nile-colors-neutral-500) var(--bulletin--dot--seperation), var(--nile-colors-dark-200) var(--bulletin--dot--seperation));
|
145
|
+
border: 2px solid var(--nile-colors-neutral-500);
|
125
146
|
}
|
126
147
|
|
127
148
|
.stepper__bulletin__dot--active{
|
128
149
|
background: radial-gradient(var(--nile-colors-white-base) var(--bulletin--dot--seperation), var(--nile-colors-primary-600) var(--bulletin--dot--seperation));
|
129
|
-
border: 2px solid var(--nile-colors-primary-
|
150
|
+
border: 2px solid var(--nile-colors-primary-500);
|
130
151
|
}
|
131
152
|
|
132
153
|
.stepper__bulletin--icon {
|
@@ -5,8 +5,8 @@
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
6
6
|
*/
|
7
7
|
|
8
|
-
import { LitElement, nothing, html, CSSResultArray, TemplateResult } from 'lit';
|
9
|
-
import { customElement, property, state } from 'lit/decorators.js';
|
8
|
+
import { LitElement, nothing, html, CSSResultArray, TemplateResult, PropertyValues } from 'lit';
|
9
|
+
import { customElement, property, state, query } from 'lit/decorators.js';
|
10
10
|
import { classMap } from 'lit/directives/class-map.js';
|
11
11
|
import { styles } from './nile-stepper-item.css';
|
12
12
|
import NileElement from '../internal/nile-element';
|
@@ -20,11 +20,14 @@ import NileElement from '../internal/nile-element';
|
|
20
20
|
*/
|
21
21
|
@customElement('nile-stepper-item')
|
22
22
|
export class NileStepperItem extends NileElement {
|
23
|
+
|
24
|
+
@query('.stepper__item__content--above .stepper__content__title') absoluteTitle:HTMLDivElement;
|
25
|
+
@query('.stepper__item__content--above .stepper__content__subtitle') absoluteSubtitle:HTMLDivElement;
|
26
|
+
|
23
27
|
/* Properties passed directly */
|
24
28
|
@property() title: string = '';
|
25
29
|
@property() subtitle: string = '';
|
26
30
|
|
27
|
-
|
28
31
|
/* Properties passed to parent component: NileStepper */
|
29
32
|
@state() private contentBelow = false;
|
30
33
|
@state() private size : 'sm' | 'md' | 'lg' = 'md';
|
@@ -44,7 +47,6 @@ export class NileStepperItem extends NileElement {
|
|
44
47
|
@state() private value :Number;
|
45
48
|
@state() private haveFlex :Boolean=true;
|
46
49
|
|
47
|
-
|
48
50
|
/**
|
49
51
|
* The styles for nile-stepper-item
|
50
52
|
* @remarks If you are extending this class you can extend the base styles with super. Eg `return [super(), myCustomStyles]`
|
@@ -53,6 +55,13 @@ export class NileStepperItem extends NileElement {
|
|
53
55
|
return [styles];
|
54
56
|
}
|
55
57
|
|
58
|
+
protected updated(_changedProperties: PropertyValues): void {
|
59
|
+
if(_changedProperties.has('subtitle') && this.isLast && !this.contentBelow && this.subtitle){
|
60
|
+
const subtitleWidth=this.absoluteSubtitle?.scrollWidth as number ?? '0';
|
61
|
+
this.absoluteTitle.style.minWidth=subtitleWidth+"px"
|
62
|
+
}
|
63
|
+
}
|
64
|
+
|
56
65
|
/* #endregion */
|
57
66
|
|
58
67
|
/* #region Methods */
|
@@ -75,14 +84,13 @@ export class NileStepperItem extends NileElement {
|
|
75
84
|
suffixStepperLineActive = true;
|
76
85
|
if (this.calculatedCompletedStepValue == this.value) suffixStepperLineActive = false;
|
77
86
|
}
|
78
|
-
let iconSize = this.size == 'sm' ? 20 : this.size == 'md' ? 24 : 28;
|
79
87
|
return html`
|
80
88
|
<div class="${classMap({
|
81
89
|
'stepper__item':true,
|
82
90
|
'stepper__item--selected':isCurrent,
|
83
91
|
'stepper__item--sm':this.size=='sm',
|
84
92
|
'stepper__item--md':this.size=='md',
|
85
|
-
'stepper__item--lg':this.size=='lg'
|
93
|
+
'stepper__item--lg':this.size=='lg'
|
86
94
|
})}">
|
87
95
|
<div class="stepper__line__content">
|
88
96
|
<div class="stepper__line__container">
|
@@ -94,13 +102,9 @@ export class NileStepperItem extends NileElement {
|
|
94
102
|
`}
|
95
103
|
</div>
|
96
104
|
|
97
|
-
<div class
|
105
|
+
<div class=${classMap({ 'stepper__item__bulletin':true, 'stepper__item__bulletin--inline': !this.contentBelow })}>
|
98
106
|
${showCompletedIcon ?
|
99
|
-
html`<div class="stepper__bulletin--icon"
|
100
|
-
<svg width="${iconSize}" height="${iconSize}" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
|
101
|
-
<path fill-rule="evenodd" clip-rule="evenodd" d="M22.7953 9.85334L13.2487 19.0667L10.7153 16.36C10.2487 15.92 9.51534 15.8933 8.982 16.2667C8.462 16.6533 8.31534 17.3333 8.63534 17.88L11.6353 22.76C11.9287 23.2133 12.4353 23.4933 13.0087 23.4933C13.5553 23.4933 14.0753 23.2133 14.3687 22.76C14.8487 22.1333 24.0087 11.2133 24.0087 11.2133C25.2087 9.98668 23.7553 8.90668 22.7953 9.84001V9.85334Z" fill="white"/>
|
102
|
-
</svg>
|
103
|
-
</div>`
|
107
|
+
html`<div class="stepper__bulletin--icon">${this.getSvg()}</div>`
|
104
108
|
: html`<div class="${classMap({ 'stepper__bulletin--dot':true, 'stepper__bulletin__dot--active':isCurrent })}"></div>`
|
105
109
|
}
|
106
110
|
</div>
|
@@ -110,9 +114,12 @@ export class NileStepperItem extends NileElement {
|
|
110
114
|
'stepper__line--hastitle':!this.contentBelow
|
111
115
|
})}">
|
112
116
|
${this.contentBelow || !this.title ? nothing:html`
|
113
|
-
|
114
|
-
class="
|
115
|
-
|
117
|
+
|
118
|
+
<div class="stepper__item__content--above">
|
119
|
+
<div class="${classMap({ 'stepper__content__title':true, 'stepper__content__title--active':isCurrent })}">
|
120
|
+
${this.title}
|
121
|
+
</div>
|
122
|
+
<div class="${classMap({ 'stepper__content__subtitle':true, 'stepper__content__subtitle--active':isCurrent })}">${this.subtitle}</div>
|
116
123
|
</div>
|
117
124
|
`}
|
118
125
|
${this.isLast ? nothing : html`
|
@@ -123,18 +130,28 @@ export class NileStepperItem extends NileElement {
|
|
123
130
|
`}
|
124
131
|
</div>
|
125
132
|
</div>
|
126
|
-
${
|
133
|
+
${this.contentBelow?
|
134
|
+
html`
|
127
135
|
<div class="stepper__item__content--below">
|
128
136
|
<div class="${classMap({ 'stepper__content__title':true, 'stepper__content__title--active':isCurrent })}">
|
129
137
|
${this.title}
|
130
138
|
</div>
|
131
139
|
<div class="${classMap({ 'stepper__content__subtitle':true, 'stepper__content__subtitle--active':isCurrent })}">${this.subtitle}</div>
|
132
140
|
</div>
|
133
|
-
|
141
|
+
`:nothing}
|
134
142
|
</div>
|
135
143
|
`;
|
136
144
|
}
|
137
145
|
|
146
|
+
getSvg():TemplateResult{
|
147
|
+
let iconSize = this.size == 'sm' ? 20 : this.size == 'md' ? 24 : 28;
|
148
|
+
return html`
|
149
|
+
<svg width="${iconSize}" height="${iconSize}" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
|
150
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M22.7953 9.85334L13.2487 19.0667L10.7153 16.36C10.2487 15.92 9.51534 15.8933 8.982 16.2667C8.462 16.6533 8.31534 17.3333 8.63534 17.88L11.6353 22.76C11.9287 23.2133 12.4353 23.4933 13.0087 23.4933C13.5553 23.4933 14.0753 23.2133 14.3687 22.76C14.8487 22.1333 24.0087 11.2133 24.0087 11.2133C25.2087 9.98668 23.7553 8.90668 22.7953 9.84001V9.85334Z" fill="white"/>
|
151
|
+
</svg>
|
152
|
+
`
|
153
|
+
}
|
154
|
+
|
138
155
|
/* #endregion */
|
139
156
|
}
|
140
157
|
|
@@ -49,9 +49,9 @@ export const styles = css`
|
|
49
49
|
position: absolute;
|
50
50
|
height: var(--track-width);
|
51
51
|
width: 100%;
|
52
|
-
background: var(--nile-
|
52
|
+
background: var(--nile-colors-neutral-400);
|
53
53
|
bottom:0px;
|
54
|
-
z-index
|
54
|
+
z-index:0;
|
55
55
|
}
|
56
56
|
|
57
57
|
.tab-group--has-scroll-controls .tab-group__nav-container {
|
@@ -127,7 +127,7 @@ export const styles = css`
|
|
127
127
|
.tab-group--top .tab-group__indicator {
|
128
128
|
bottom: 0px;
|
129
129
|
border-bottom: 2px solid var(--nile-colors-primary-600);
|
130
|
-
z-index
|
130
|
+
z-index:0;
|
131
131
|
}
|
132
132
|
|
133
133
|
.tab-group--top .tab-group__body {
|
@@ -5,7 +5,7 @@
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
6
6
|
*/
|
7
7
|
|
8
|
-
import {LitElement, html, CSSResultArray, TemplateResult} from 'lit';
|
8
|
+
import {LitElement, html, CSSResultArray, TemplateResult, nothing} from 'lit';
|
9
9
|
import { customElement, property } from 'lit/decorators.js';
|
10
10
|
import {styles} from './nile-tab-group.css';
|
11
11
|
|
@@ -25,25 +25,28 @@ export const styles = css`
|
|
25
25
|
}
|
26
26
|
|
27
27
|
.stepper__item--sm {
|
28
|
-
--item-spacing: var(--nile-spacing-spacing-
|
28
|
+
--item-spacing: var(--nile-spacing-spacing-md);
|
29
29
|
--stepper-item-title-size:14px;
|
30
|
+
--stepper-item-title-margin-top:15%;
|
30
31
|
--stepper-item-subtitle-size:14px;
|
31
32
|
--stepper-item-text-line-height:20px;
|
32
33
|
--circle-height:16px;
|
33
34
|
}
|
34
35
|
|
35
36
|
.stepper__item--md {
|
36
|
-
--item-spacing: var(--nile-spacing-spacing-
|
37
|
+
--item-spacing: var(--nile-spacing-spacing-md);
|
37
38
|
--stepper-item-title-size:16px;
|
38
|
-
--stepper-item-
|
39
|
-
--stepper-item-
|
39
|
+
--stepper-item-title-margin-top:15%;
|
40
|
+
--stepper-item-subtitle-size:14px;
|
41
|
+
--stepper-item-text-line-height:24px;
|
40
42
|
--circle-height:20px;
|
41
43
|
}
|
42
44
|
|
43
45
|
.stepper__item--lg {
|
44
|
-
--item-spacing: var(--nile-spacing-spacing-
|
46
|
+
--item-spacing: var(--nile-spacing-spacing-lg);
|
45
47
|
--stepper-item-title-size:16px;
|
46
|
-
--stepper-item-
|
48
|
+
--stepper-item-title-margin-top:25%;
|
49
|
+
--stepper-item-subtitle-size:14px;
|
47
50
|
--stepper-item-text-line-height:24px;
|
48
51
|
--circle-height:28px;
|
49
52
|
}
|
@@ -52,22 +55,28 @@ export const styles = css`
|
|
52
55
|
display: flex;
|
53
56
|
flex-direction: column;
|
54
57
|
}
|
58
|
+
|
55
59
|
.stepper__item__bulletin {
|
56
60
|
display:grid;
|
57
61
|
place-content:center;
|
58
62
|
}
|
59
63
|
|
64
|
+
.stepper__item__bulletin {
|
65
|
+
margin-top:3px;
|
66
|
+
margin-bottom:3px;
|
67
|
+
}
|
68
|
+
|
60
69
|
.stepper__bulletin--dot {
|
61
70
|
width: var(--circle-height);
|
62
71
|
aspect-ratio: 1 / 1;
|
63
72
|
border-radius: 50%;
|
64
|
-
background: radial-gradient(var(--nile-colors-
|
65
|
-
border: 2px solid var(--nile-colors-
|
73
|
+
background: radial-gradient(var(--nile-colors-neutral-500) var(--bulletin--dot--seperation), var(--nile-colors-dark-200) var(--bulletin--dot--seperation));
|
74
|
+
border: 2px solid var(--nile-colors-neutral-500);
|
66
75
|
}
|
67
76
|
|
68
77
|
.stepper__bulletin__dot--active{
|
69
78
|
background: radial-gradient(var(--nile-colors-white-base) var(--bulletin--dot--seperation), var(--nile-colors-primary-600) var(--bulletin--dot--seperation));
|
70
|
-
border: 2px solid var(--nile-colors-primary-
|
79
|
+
border: 2px solid var(--nile-colors-primary-500);
|
71
80
|
}
|
72
81
|
|
73
82
|
.stepper__bulletin--icon {
|
@@ -91,7 +100,7 @@ export const styles = css`
|
|
91
100
|
|
92
101
|
.stepper__item__line{
|
93
102
|
height:100%;
|
94
|
-
border-left: 2px solid var(--nile-colors-
|
103
|
+
border-left: 2px solid var(--nile-colors-neutral-500);
|
95
104
|
}
|
96
105
|
.stepper__item__line--active{
|
97
106
|
border-left: 2px solid var(--nile-colors-primary-600);
|
@@ -103,19 +112,24 @@ export const styles = css`
|
|
103
112
|
justify-content:start;
|
104
113
|
}
|
105
114
|
.stepper__content__title {
|
106
|
-
color:var(--nile-colors-
|
115
|
+
color:var(--nile-colors-dark-900);
|
107
116
|
font-size: var(--stepper-item-title-size);
|
108
117
|
line-height: var(--stepper-item-text-line-height);
|
109
118
|
font-family: var(--nile-font-family-medium);
|
110
|
-
font-weight:
|
119
|
+
font-weight: 400;
|
120
|
+
}
|
121
|
+
|
122
|
+
.stepper__content__title--alone{
|
123
|
+
margin-top: var(--stepper-item-title-margin-top);
|
111
124
|
}
|
112
125
|
|
113
126
|
.stepper__content__title--active{
|
114
|
-
color:var(--nile-colors-primary-
|
127
|
+
color:var(--nile-colors-primary-600);
|
128
|
+
font-weight: 600;
|
115
129
|
}
|
116
130
|
|
117
131
|
.stepper__content__subtitle {
|
118
|
-
color:var(--nile-colors-
|
132
|
+
color:var(--nile-colors-dark-500);
|
119
133
|
font-size: var(--stepper-item-subtitle-size);
|
120
134
|
line-height: var(--stepper-item-text-line-height);
|
121
135
|
font-family: var( --nile-font-family-sans-serif);
|