@aquera/nile-elements 0.1.28 → 0.1.29-beta-1.2
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/demo/index.html +0 -97
- package/dist/nile-accordion/nile-accordion.cjs.js +1 -1
- package/dist/nile-accordion/nile-accordion.cjs.js.map +1 -1
- package/dist/nile-accordion/nile-accordion.esm.js +2 -2
- 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 +47 -29
- package/dist/nile-circular-progressbar/nile-circular-progressbar.esm.js +16 -13
- 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 +16 -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-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-accordion/nile-accordion.d.ts +6 -5
- package/dist/src/nile-accordion/nile-accordion.js +19 -6
- package/dist/src/nile-accordion/nile-accordion.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 +52 -34
- 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 +6 -2
- package/dist/src/nile-circular-progressbar/nile-circular-progressbar.js +47 -32
- package/dist/src/nile-circular-progressbar/nile-circular-progressbar.js.map +1 -1
- package/dist/src/nile-progress-bar/nile-progress-bar.css.js +14 -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-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-accordion/nile-accordion.ts +13 -2
- package/src/nile-circular-progressbar/nile-circular-progressbar.css.ts +48 -31
- package/src/nile-circular-progressbar/nile-circular-progressbar.ts +49 -26
- package/src/nile-progress-bar/nile-progress-bar.css.ts +15 -2
- package/src/nile-progress-bar/nile-progress-bar.ts +6 -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-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 +30 -9
@@ -18,7 +18,8 @@ import NileElement from '../internal/nile-element';
|
|
18
18
|
let NileCircularProgressbar = class NileCircularProgressbar extends NileElement {
|
19
19
|
constructor() {
|
20
20
|
super(...arguments);
|
21
|
-
this.
|
21
|
+
this.value = 0;
|
22
|
+
this.size = 40;
|
22
23
|
/* #endregion */
|
23
24
|
}
|
24
25
|
/**
|
@@ -28,45 +29,53 @@ let NileCircularProgressbar = class NileCircularProgressbar extends NileElement
|
|
28
29
|
static get styles() {
|
29
30
|
return [styles];
|
30
31
|
}
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
32
|
+
get circleSize() {
|
33
|
+
const radius = this.size / 2 - 4;
|
34
|
+
return {
|
35
|
+
radius,
|
36
|
+
viewBox: this.size,
|
37
|
+
fontSize: `${this.size * 0.25}px`,
|
38
|
+
};
|
39
|
+
}
|
38
40
|
connectedCallback() {
|
39
41
|
super.connectedCallback();
|
40
42
|
this.updateComplete.then(() => {
|
41
|
-
|
42
|
-
|
43
|
-
}
|
44
|
-
if (this.progress > 100) {
|
45
|
-
this.progress = 100;
|
46
|
-
}
|
47
|
-
this.setProgress(this.progress);
|
43
|
+
this.value = Math.max(0, Math.min(100, this.value));
|
44
|
+
this.setProgress(this.value);
|
48
45
|
});
|
49
46
|
}
|
50
47
|
setProgress(percent) {
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
48
|
+
if (this.progressCircle) {
|
49
|
+
const circleRadius = this.progressCircle.r.baseVal.value;
|
50
|
+
const circumference = circleRadius * 2 * Math.PI;
|
51
|
+
this.progressCircle.style.transition = 'stroke-dashoffset 0.8s ease-in-out';
|
52
|
+
this.progressCircle.style.strokeDasharray = `${circumference}`;
|
53
|
+
this.progressCircle.style.strokeDashoffset = `${circumference - (percent / 100) * circumference}`;
|
54
|
+
}
|
55
|
+
}
|
56
|
+
updated(changedProperties) {
|
57
|
+
if (changedProperties.has('value')) {
|
58
|
+
this.setProgress(this.value);
|
59
|
+
}
|
56
60
|
}
|
57
61
|
render() {
|
62
|
+
const { radius, viewBox, fontSize } = this.circleSize;
|
63
|
+
const innerText = this.content ?? `${Math.round(this.value)}%`;
|
58
64
|
return html `
|
59
|
-
<svg width="
|
60
|
-
<circle r="
|
61
|
-
<circle r="
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
65
|
+
<svg width="${viewBox}" height="${viewBox}" viewBox="0 0 ${viewBox} ${viewBox}">
|
66
|
+
<circle r="${radius}" cx="${viewBox / 2}" cy="${viewBox / 2}" class="track"></circle>
|
67
|
+
<circle r="${radius}" cx="${viewBox / 2}" cy="${viewBox / 2}" class="progress"></circle>
|
68
|
+
|
69
|
+
|
70
|
+
<text
|
71
|
+
x="50%"
|
72
|
+
y="53%"
|
73
|
+
text-anchor="middle"
|
74
|
+
alignment-baseline="middle"
|
75
|
+
class="circle__text"
|
76
|
+
style="font-size: ${fontSize};"
|
77
|
+
>
|
78
|
+
${innerText}
|
70
79
|
</text>
|
71
80
|
</svg>
|
72
81
|
`;
|
@@ -77,7 +86,13 @@ __decorate([
|
|
77
86
|
], NileCircularProgressbar.prototype, "progressCircle", void 0);
|
78
87
|
__decorate([
|
79
88
|
property({ type: Number, reflect: true })
|
80
|
-
], NileCircularProgressbar.prototype, "
|
89
|
+
], NileCircularProgressbar.prototype, "value", void 0);
|
90
|
+
__decorate([
|
91
|
+
property({ type: String, reflect: true })
|
92
|
+
], NileCircularProgressbar.prototype, "content", void 0);
|
93
|
+
__decorate([
|
94
|
+
property({ type: Number, reflect: true })
|
95
|
+
], NileCircularProgressbar.prototype, "size", void 0);
|
81
96
|
NileCircularProgressbar = __decorate([
|
82
97
|
customElement('nile-circular-progressbar')
|
83
98
|
], NileCircularProgressbar);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"nile-circular-progressbar.js","sourceRoot":"","sources":["../../../src/nile-circular-progressbar/nile-circular-progressbar.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAEH,OAAO,EAEL,IAAI,GAGL,MAAM,KAAK,CAAC;AACb,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAC;AACzD,OAAO,WAAW,MAAM,0BAA0B,CAAC;AAGnD;;;;;GAKG;AAEI,IAAM,uBAAuB,GAA7B,MAAM,uBAAwB,SAAQ,WAAW;IAAjD;;
|
1
|
+
{"version":3,"file":"nile-circular-progressbar.js","sourceRoot":"","sources":["../../../src/nile-circular-progressbar/nile-circular-progressbar.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAEH,OAAO,EAEL,IAAI,GAGL,MAAM,KAAK,CAAC;AACb,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAC;AACzD,OAAO,WAAW,MAAM,0BAA0B,CAAC;AAGnD;;;;;GAKG;AAEI,IAAM,uBAAuB,GAA7B,MAAM,uBAAwB,SAAQ,WAAW;IAAjD;;QAWsC,UAAK,GAAG,CAAC,CAAC;QAWV,SAAI,GAAG,EAAE,CAAC;QA4DrD,gBAAgB;IAClB,CAAC;IAlFC;;;OAGG;IACI,MAAM,KAAK,MAAM;QACtB,OAAO,CAAC,MAAM,CAAC,CAAC;IAClB,CAAC;IAiBD,IAAY,UAAU;QACpB,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC;QACjC,OAAO;YACL,MAAM;YACN,OAAO,EAAE,IAAI,CAAC,IAAI;YAClB,QAAQ,EAAE,GAAG,IAAI,CAAC,IAAI,GAAG,IAAI,IAAI;SAClC,CAAC;IACJ,CAAC;IAED,iBAAiB;QACf,KAAK,CAAC,iBAAiB,EAAE,CAAC;QAC1B,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG,EAAE;YAC5B,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;YACpD,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC/B,CAAC,CAAC,CAAC;IACL,CAAC;IAEO,WAAW,CAAC,OAAe;QAC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C,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;sDAAW;AAUV;IAA1C,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;wDAAkB;AACjB;IAA1C,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;qDAAW;AAtB1C,uBAAuB;IADnC,aAAa,CAAC,2BAA2B,CAAC;GAC9B,uBAAuB,CAmFnC;;AAED,eAAe,uBAAuB,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 {\n LitElement,\n html,\n CSSResultArray,\n TemplateResult,\n} from 'lit';\nimport { customElement, query, property } from 'lit/decorators.js';\nimport { styles } from './nile-circular-progressbar.css';\nimport NileElement from '../internal/nile-element';\nimport logInfo from '../nile-icon/icons/svg/log-info';\n\n/**\n * Nile icon component.\n *\n * @tag nile-progressbar\n *\n */\n@customElement('nile-circular-progressbar')\nexport class NileCircularProgressbar extends NileElement {\n /**\n * The styles for Progressbar\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 @query('.progress') progressCircle!: SVGCircleElement;\n \n @property({ type: Number, reflect: true }) value = 0;\n/* #endregion */\n\n /* #region Methods */\n\n /**\n * Render method\n * @slot This is a slot test\n */\n // make reactive to pass through\n @property({ type: String, reflect: true }) content?: string;\n @property({ type: Number, reflect: true }) size = 40; \n\n private get circleSize() {\n const radius = this.size / 2 - 4; \n return {\n radius,\n viewBox: this.size,\n fontSize: `${this.size * 0.25}px`, \n };\n }\n\n connectedCallback() {\n super.connectedCallback();\n this.updateComplete.then(() => {\n this.value = Math.max(0, Math.min(100, this.value));\n this.setProgress(this.value);\n });\n }\n\n private setProgress(percent: number) {\n if (this.progressCircle) {\n const circleRadius = this.progressCircle.r.baseVal.value;\n const circumference = circleRadius * 2 * Math.PI;\n\n this.progressCircle.style.transition = 'stroke-dashoffset 0.8s ease-in-out'; \n this.progressCircle.style.strokeDasharray = `${circumference}`;\n this.progressCircle.style.strokeDashoffset = `${circumference - (percent / 100) * circumference}`;\n }\n }\n\n updated(changedProperties: Map<string, any>) {\n if (changedProperties.has('value')) {\n this.setProgress(this.value);\n }\n }\n\n public render(): TemplateResult {\n const { radius, viewBox, fontSize } = this.circleSize;\n const innerText = this.content ?? `${Math.round(this.value)}%`;\n\n return html`\n <svg width=\"${viewBox}\" height=\"${viewBox}\" viewBox=\"0 0 ${viewBox} ${viewBox}\">\n <circle r=\"${radius}\" cx=\"${viewBox / 2}\" cy=\"${viewBox / 2}\" class=\"track\"></circle>\n <circle r=\"${radius}\" cx=\"${viewBox / 2}\" cy=\"${viewBox / 2}\" class=\"progress\"></circle>\n \n \n <text\n x=\"50%\"\n y=\"53%\"\n text-anchor=\"middle\"\n alignment-baseline=\"middle\"\n class=\"circle__text\"\n style=\"font-size: ${fontSize};\"\n >\n ${innerText}\n </text>\n </svg>\n `;\n }\n\n /* #endregion */\n}\n\nexport default NileCircularProgressbar;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-circular-progressbar': NileCircularProgressbar;\n }\n}\n"]}
|
@@ -21,6 +21,14 @@ export default css `
|
|
21
21
|
width: 100%;
|
22
22
|
height: 2px;
|
23
23
|
background-color: var(--nile-colors-neutral-400);
|
24
|
+
transition: stroke-dashoffset 0.8s ease-in-out
|
25
|
+
}
|
26
|
+
|
27
|
+
|
28
|
+
.nile-progress-bar__progress-bar.rounded li {
|
29
|
+
height: 4px;
|
30
|
+
border-radius: 4px;
|
31
|
+
overflow: hidden;
|
24
32
|
}
|
25
33
|
|
26
34
|
.nile-progress-bar__progress-bar li.changeColor::after {
|
@@ -32,10 +40,15 @@ export default css `
|
|
32
40
|
top: 0;
|
33
41
|
left: 0;
|
34
42
|
background-color: var(--nile-colors-primary-600);
|
35
|
-
height:
|
43
|
+
height: 100%;
|
36
44
|
transition: all 1s linear;
|
37
45
|
}
|
38
46
|
|
47
|
+
|
48
|
+
.nile-progress-bar__progress-bar.rounded li span {
|
49
|
+
border-radius: 4px;
|
50
|
+
}
|
51
|
+
|
39
52
|
.nile-progress-bar__reset {
|
40
53
|
background-color: var(--nile-colors-neutral-400);
|
41
54
|
position: absolute;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"nile-progress-bar.css.js","sourceRoot":"","sources":["../../../src/nile-progress-bar/nile-progress-bar.css.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,eAAe,GAAG,CAAA
|
1
|
+
{"version":3,"file":"nile-progress-bar.css.js","sourceRoot":"","sources":["../../../src/nile-progress-bar/nile-progress-bar.css.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,eAAe,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuDjB,CAAC","sourcesContent":["import { css } from 'lit';\n\nexport default css`\n .nile-progress-bar__container {\n width: 100%;\n margin: 0 auto;\n }\n\n .nile-progress-bar__progress-bar {\n width: 100%;\n counter-reset: step;\n padding: 0;\n margin: 0 auto;\n list-style: none;\n display: flex;\n height: 2px;\n justify-content: space-between;\n }\n\n .nile-progress-bar__progress-bar li {\n position: relative;\n width: 100%;\n height: 2px;\n background-color: var(--nile-colors-neutral-400);\n transition: stroke-dashoffset 0.8s ease-in-out\n }\n\n \n .nile-progress-bar__progress-bar.rounded li {\n height: 4px; \n border-radius: 4px;\n overflow: hidden; \n }\n\n .nile-progress-bar__progress-bar li.changeColor::after {\n background-color: var(--nile-colors-primary-600);\n }\n\n .nile-progress-bar__progress-bar li span {\n position: absolute;\n top: 0;\n left: 0;\n background-color: var(--nile-colors-primary-600);\n height: 100%; \n transition: all 1s linear;\n }\n\n \n .nile-progress-bar__progress-bar.rounded li span {\n border-radius: 4px;\n }\n\n .nile-progress-bar__reset {\n background-color: var(--nile-colors-neutral-400);\n position: absolute;\n z-index: 1;\n }\n`;"]}
|
@@ -6,11 +6,13 @@ let NileProgressBar = class NileProgressBar extends LitElement {
|
|
6
6
|
constructor() {
|
7
7
|
super(...arguments);
|
8
8
|
this.value = 0;
|
9
|
+
this.variant = 'normal';
|
9
10
|
}
|
10
11
|
render() {
|
12
|
+
const variantClass = this.variant === 'rounded' ? 'rounded' : '';
|
11
13
|
return html `
|
12
14
|
<div class="nile-progress-bar__container">
|
13
|
-
<ul class="nile-progress-bar__progress-bar">
|
15
|
+
<ul class="nile-progress-bar__progress-bar ${variantClass}">
|
14
16
|
<li><span style="width: ${this.value}%"></span></li>
|
15
17
|
</ul>
|
16
18
|
</div>
|
@@ -21,6 +23,9 @@ NileProgressBar.styles = styles;
|
|
21
23
|
__decorate([
|
22
24
|
property({ type: Number })
|
23
25
|
], NileProgressBar.prototype, "value", void 0);
|
26
|
+
__decorate([
|
27
|
+
property({ type: String })
|
28
|
+
], NileProgressBar.prototype, "variant", void 0);
|
24
29
|
NileProgressBar = __decorate([
|
25
30
|
customElement('nile-progress-bar')
|
26
31
|
], NileProgressBar);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"nile-progress-bar.js","sourceRoot":"","sources":["../../../src/nile-progress-bar/nile-progress-bar.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAuB,MAAM,KAAK,CAAC;AAC5D,OAAO,MAAM,MAAM,yBAAyB,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAGrD,IAAM,eAAe,GAArB,MAAM,eAAgB,SAAQ,UAAU;IAAxC;;QAGuB,UAAK,GAAG,CAAC,CAAC;
|
1
|
+
{"version":3,"file":"nile-progress-bar.js","sourceRoot":"","sources":["../../../src/nile-progress-bar/nile-progress-bar.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAuB,MAAM,KAAK,CAAC;AAC5D,OAAO,MAAM,MAAM,yBAAyB,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAGrD,IAAM,eAAe,GAArB,MAAM,eAAgB,SAAQ,UAAU;IAAxC;;QAGuB,UAAK,GAAG,CAAC,CAAC;QACV,YAAO,GAAyB,QAAQ,CAAC;IAevE,CAAC;IAbU,MAAM;QACb,MAAM,YAAY,GAAG,IAAI,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC;QAIjE,OAAO,IAAI,CAAA;;qDAEsC,YAAY;oCAC7B,IAAI,CAAC,KAAK;;;KAGzC,CAAC;IACJ,CAAC;;AAjBe,sBAAM,GAAmB,MAAM,AAAzB,CAA0B;AAEpB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;8CAAW;AACV;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;gDAA0C;AAJ1D,eAAe;IAD3B,aAAa,CAAC,mBAAmB,CAAC;GACtB,eAAe,CAmB3B","sourcesContent":["import { LitElement, html, css, CSSResultGroup } from 'lit';\nimport styles from './nile-progress-bar.css';\nimport { customElement, property } from 'lit/decorators.js';\n\n@customElement('nile-progress-bar')\nexport class NileProgressBar extends LitElement {\n static override styles: CSSResultGroup = styles;\n\n @property({ type: Number }) value = 0;\n @property({ type: String }) variant: 'normal' | 'rounded' = 'normal';\n\n override render() {\n const variantClass = this.variant === 'rounded' ? 'rounded' : '';\n \n \n\n return html`\n <div class=\"nile-progress-bar__container\">\n <ul class=\"nile-progress-bar__progress-bar ${variantClass}\">\n <li><span style=\"width: ${this.value}%\"></span></li>\n </ul>\n </div>\n `;\n }\n}\n"]}
|
@@ -9,6 +9,9 @@ import { css } from 'lit';
|
|
9
9
|
* Stepper CSS
|
10
10
|
*/
|
11
11
|
export const styles = css `
|
12
|
+
*{
|
13
|
+
box-sizing:border-box;
|
14
|
+
}
|
12
15
|
:host {
|
13
16
|
display:block;
|
14
17
|
height:100%;
|
@@ -16,11 +19,14 @@ export const styles = css `
|
|
16
19
|
.nile-stepper--horizontal{
|
17
20
|
display:flex;
|
18
21
|
align-items:center;
|
22
|
+
padding: var(--nile-spacing-spacing-3xl) 0;
|
19
23
|
}
|
24
|
+
|
20
25
|
.nile-stepper--vertical{
|
21
26
|
height:100%;
|
22
27
|
display:flex;
|
23
28
|
flex-direction:column;
|
29
|
+
padding: var(--nile-spacing-spacing-3xl) var(--nile-spacing-spacing-3xl) 0;
|
24
30
|
}
|
25
31
|
`;
|
26
32
|
export default [styles];
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"nile-stepper.css.js","sourceRoot":"","sources":["../../../src/nile-stepper/nile-stepper.css.ts"],"names":[],"mappings":"AAAA;;;;;EAKE;AAEF,OAAO,EAAC,GAAG,EAAC,MAAM,KAAK,CAAC;AAExB;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA
|
1
|
+
{"version":3,"file":"nile-stepper.css.js","sourceRoot":"","sources":["../../../src/nile-stepper/nile-stepper.css.ts"],"names":[],"mappings":"AAAA;;;;;EAKE;AAEF,OAAO,EAAC,GAAG,EAAC,MAAM,KAAK,CAAC;AAExB;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;CAoBxB,CAAC;AAEF,eAAe,CAAC,MAAM,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 {css} from 'lit';\n\n/**\n * Stepper CSS\n */\nexport const styles = css`\n\t*{\n\t\tbox-sizing:border-box;\n\t}\n\t:host {\n\t\tdisplay:block;\n\t\theight:100%;\n\t}\n\t.nile-stepper--horizontal{\n\t\tdisplay:flex;\n\t\talign-items:center;\n\t\tpadding: var(--nile-spacing-spacing-3xl) 0;\n\t}\n\n\t.nile-stepper--vertical{\n\t\theight:100%;\n\t\tdisplay:flex;\n\t\tflex-direction:column;\n\t\tpadding: var(--nile-spacing-spacing-3xl) var(--nile-spacing-spacing-3xl) 0;\n\t}\n`;\n\nexport default [styles];"]}
|
@@ -4,7 +4,7 @@
|
|
4
4
|
* This source code is licensed under the BSD-3-Clause license found in the
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
6
6
|
*/
|
7
|
-
import { CSSResultArray, TemplateResult } from 'lit';
|
7
|
+
import { CSSResultArray, TemplateResult, PropertyValueMap } from 'lit';
|
8
8
|
import NileElement from '../internal/nile-element';
|
9
9
|
/**
|
10
10
|
* Nile stepper component.
|
@@ -19,7 +19,7 @@ export declare class NileStepper extends NileElement {
|
|
19
19
|
completedStep: number;
|
20
20
|
size: 'sm' | 'md' | 'lg';
|
21
21
|
icon: string;
|
22
|
-
|
22
|
+
protected update(changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>): void;
|
23
23
|
handleCurrentStepChanges(): void;
|
24
24
|
handleCompletedStepChanges(): void;
|
25
25
|
private updateItems;
|
@@ -28,11 +28,11 @@ let NileStepper = class NileStepper extends NileElement {
|
|
28
28
|
this.icon = 'tick';
|
29
29
|
/* #endregion */
|
30
30
|
}
|
31
|
-
|
32
|
-
super.
|
33
|
-
|
31
|
+
update(changedProperties) {
|
32
|
+
super.update(changedProperties);
|
33
|
+
if (changedProperties.has('currentStep') || changedProperties.has('completedStep')) {
|
34
34
|
this.updateItems();
|
35
|
-
}
|
35
|
+
}
|
36
36
|
}
|
37
37
|
handleCurrentStepChanges() {
|
38
38
|
this.updateItems();
|
@@ -119,16 +119,16 @@ __decorate([
|
|
119
119
|
property({ type: Boolean, attribute: 'vertical' })
|
120
120
|
], NileStepper.prototype, "isVertical", void 0);
|
121
121
|
__decorate([
|
122
|
-
property({ type: Boolean, attribute:
|
122
|
+
property({ type: Boolean, attribute: true, reflect: true })
|
123
123
|
], NileStepper.prototype, "contentBelow", void 0);
|
124
124
|
__decorate([
|
125
|
-
property({ type: Number, attribute:
|
125
|
+
property({ type: Number, attribute: true, reflect: true })
|
126
126
|
], NileStepper.prototype, "currentStep", void 0);
|
127
127
|
__decorate([
|
128
|
-
property({ type: Number, attribute:
|
128
|
+
property({ type: Number, attribute: true, reflect: true })
|
129
129
|
], NileStepper.prototype, "completedStep", void 0);
|
130
130
|
__decorate([
|
131
|
-
property({ type: String, attribute:
|
131
|
+
property({ type: String, attribute: true, reflect: true })
|
132
132
|
], NileStepper.prototype, "size", void 0);
|
133
133
|
__decorate([
|
134
134
|
property()
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"nile-stepper.js","sourceRoot":"","sources":["../../../src/nile-stepper/nile-stepper.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAEH,OAAO,EAAc,IAAI,
|
1
|
+
{"version":3,"file":"nile-stepper.js","sourceRoot":"","sources":["../../../src/nile-stepper/nile-stepper.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAEH,OAAO,EAAc,IAAI,EAAoD,MAAM,KAAK,CAAC;AACzF,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,WAAW,MAAM,0BAA0B,CAAC;AACnD,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAGvD;;;;;GAKG;AAEI,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,WAAW;IAArC;;QAE8C,eAAU,GAAY,KAAK,CAAC;QACpB,iBAAY,GAAY,KAAK,CAAC;QAC/B,gBAAW,GAAW,CAAC,CAAC;QACvB,kBAAa,GAA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,CAAC;kDAA2B;AAC1B;IAA3D,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAC,IAAI,EAAG,CAAC;yCAAiC;AAChF;IAAX,QAAQ,EAAE;yCAAuB;AAUlC;IADC,KAAK,CAAC,aAAa,CAAC;2DAIpB;AAGD;IADC,KAAK,CAAC,eAAe,CAAC;6DAItB;AA1BW,WAAW;IADvB,aAAa,CAAC,cAAc,CAAC;GACjB,WAAW,CAwGvB;;AAED,eAAe,WAAW,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 { LitElement, html, CSSResultArray, TemplateResult, PropertyValueMap } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { styles } from './nile-stepper.css';\nimport NileElement from '../internal/nile-element';\nimport { watch } from '../internal/watch';\nimport { classMap } from 'lit/directives/class-map.js';\n\n\n/**\n * Nile stepper component.\n *\n * @tag nile-stepper\n *\n */\n@customElement('nile-stepper')\nexport class NileStepper extends NileElement {\n\n\t@property({ type: Boolean, attribute: 'vertical' }) isVertical: boolean = false;\n\t@property({ type: Boolean, attribute: true, reflect:true }) contentBelow: boolean = false;\n\t@property({ type: Number, attribute: true, reflect:true }) currentStep: number = 0;\n\t@property({ type: Number, attribute: true, reflect:true }) completedStep: number = 0;\n\t@property({ type: String, attribute: true, reflect:true }) size: 'sm' | 'md' | 'lg' = 'md';\n\t@property() icon: string = 'tick';\n\n\tprotected update(changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>): void{\n super.update(changedProperties);\n\t\tif(changedProperties.has('currentStep') || changedProperties.has('completedStep')){\n\t\t\tthis.updateItems();\n\t\t}\n\t}\n\n\t@watch('currentStep')\n\thandleCurrentStepChanges() {\n\t\tthis.updateItems();\n\t\tthis.emit('nile-current-change', { value: this.currentStep });\n\t}\n\n\t@watch('completedStep')\n\thandleCompletedStepChanges() {\n\t\tthis.updateItems()\n\t\tthis.emit('nile-completed-change', { value: this.completedStep });\n\t}\n\t\n\tprivate updateItems() {\n\t\tconst items: any = [...this.querySelectorAll(this.isVertical ? 'nile-vertical-stepper-item' : 'nile-stepper-item')];\n\t\tif (!items.length) return;\n\t\tconst haveFlex = items.length < 3;\n\n\t\tconst current = (this.currentStep == 0 || this.currentStep > items.length) ? 1 : this.currentStep;\n\t\tconst calculatedCompleted = this.completedStep > items.length ? current : this.completedStep < current ? current : this.completedStep;\n\t\tconst completed = this.completedStep > items.length ? 0 : this.completedStep;\n\n\t\titems.forEach((el: any, index: number) => {\n\t\t\t// set item is complete and is current values\n\t\t\tif (index + 1 < current) {\n\t\t\t\tel.isComplete = true;\n\t\t\t\tel.isCurrent = false;\n\t\t\t}\n\t\t\telse if (index + 1 == current) {\n\t\t\t\tif (index + 1 <= calculatedCompleted) el.isComplete = true;\n\t\t\t\telse el.isComplete = false;\n\t\t\t\tel.isCurrent = true;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif (index + 1 <= calculatedCompleted) el.isComplete = true;\n\t\t\t\telse el.isComplete = false;\n\t\t\t\tel.isCurrent = false;\n\t\t\t}\n\n\t\t\t// Set isLast and isFirst\n\t\t\tif (index == 0) el.isFirst = true;\n\t\t\tif (index == items.length - 1) el.isLast = true;\n\n\t\t\t// setting default values\n\t\t\tel.currentStepValue = current;\n\t\t\tel.calculatedCompletedStepValue = calculatedCompleted;\n\t\t\tel.completedStepValue = completed;\n\n\t\t\tel.icon = this.icon;\n\t\t\tel.size = this.size;\n\t\t\tel.value = index + 1;\n\t\t\tel.contentBelow = this.contentBelow\n\t\t\tif (index == 0 || index == items.length - 1) {\n\t\t\t\tel.haveFlex = haveFlex;\n\t\t\t}\n\t\t})\n\t}\n\n\t/**\n\t * The styles for nile-stepper\n\t * @remarks If you are extending this class you can extend the base styles with super. Eg `return [super(), myCustomStyles]`\n\t */\n\tpublic static get styles(): CSSResultArray {\n\t\treturn [styles];\n\t}\n\n\t/* #endregion */\n\n\t/* #region Methods */\n\n\t/**\n\t * Render method\n\t * @slot This is a slot test\n\t */\n\tpublic render(): TemplateResult {\n\t\treturn html`\n\t\t\t<div class=${classMap({\n\t\t\t\t'nile-stepper':true,\n\t\t\t\t'nile-stepper--horizontal':!this.isVertical,\n\t\t\t\t'nile-stepper--vertical':this.isVertical\n\t\t\t})}>\n\t\t\t\t<slot\n\t\t\t\t\t@slotchange=${this.updateItems}\n\t\t\t\t></slot>\n\t\t\t</div>\n\t\t\t`;\n\t}\n\n\t/* #endregion */\n}\n\nexport default NileStepper;\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'nile-stepper': NileStepper;\n\t}\n}\n"]}
|
@@ -13,7 +13,7 @@ export const styles = css `
|
|
13
13
|
--stepper-flex-val:1;
|
14
14
|
--bulletin--dot--seperation:30%;
|
15
15
|
|
16
|
-
display:inline-block;
|
16
|
+
display: inline-block;
|
17
17
|
flex-grow:var(--stepper-flex-val);
|
18
18
|
min-width:var(--nile-stepper-min-width);
|
19
19
|
}
|
@@ -23,7 +23,7 @@ export const styles = css `
|
|
23
23
|
}
|
24
24
|
|
25
25
|
.stepper__item--sm {
|
26
|
-
--item-spacing: var(--nile-spacing-spacing-
|
26
|
+
--item-spacing: var(--nile-spacing-spacing-md);
|
27
27
|
--stepper-item-title-size:14px;
|
28
28
|
--stepper-item-subtitle-size:14px;
|
29
29
|
--stepper-item-text-line-height:20px;
|
@@ -31,17 +31,17 @@ export const styles = css `
|
|
31
31
|
}
|
32
32
|
|
33
33
|
.stepper__item--md {
|
34
|
-
--item-spacing: var(--nile-spacing-spacing-
|
34
|
+
--item-spacing: var(--nile-spacing-spacing-md);
|
35
35
|
--stepper-item-title-size:16px;
|
36
|
-
--stepper-item-subtitle-size:
|
37
|
-
--stepper-item-text-line-
|
36
|
+
--stepper-item-subtitle-size:14px;
|
37
|
+
--stepper-item-text-line-height:24px;
|
38
38
|
--circle-height:20px;
|
39
39
|
}
|
40
40
|
|
41
41
|
.stepper__item--lg {
|
42
|
-
--item-spacing: var(--nile-spacing-spacing-
|
42
|
+
--item-spacing: var(--nile-spacing-spacing-lg);
|
43
43
|
--stepper-item-title-size:16px;
|
44
|
-
--stepper-item-subtitle-size:
|
44
|
+
--stepper-item-subtitle-size:14px;
|
45
45
|
--stepper-item-text-line-height:24px;
|
46
46
|
--circle-height:28px;
|
47
47
|
}
|
@@ -65,13 +65,24 @@ export const styles = css `
|
|
65
65
|
.stepper__line {
|
66
66
|
display: block;
|
67
67
|
border: 0;
|
68
|
-
border-top: 2px solid var(--nile-colors-
|
68
|
+
border-top: 2px solid var(--nile-colors-neutral-500);
|
69
69
|
}
|
70
70
|
|
71
71
|
.stepper__line--active {
|
72
72
|
border-top: 2px solid var(--nile-colors-primary-600);
|
73
73
|
}
|
74
74
|
|
75
|
+
.stepper__item__content--above{
|
76
|
+
position:relative;
|
77
|
+
padding: 0 var(--nile-spacing-spacing-md);
|
78
|
+
}
|
79
|
+
|
80
|
+
.stepper__item__content--above .stepper__content__subtitle{
|
81
|
+
position: absolute;
|
82
|
+
top: 100%;
|
83
|
+
white-space: nowrap;
|
84
|
+
}
|
85
|
+
|
75
86
|
.stepper__item__content--below {
|
76
87
|
margin-top: var(--item-spacing);
|
77
88
|
display:flex;
|
@@ -85,25 +96,35 @@ export const styles = css `
|
|
85
96
|
margin:0 -1px;
|
86
97
|
}
|
87
98
|
|
99
|
+
.stepper__item__bulletin{
|
100
|
+
margin-left: 6px;
|
101
|
+
margin-right: 6px;
|
102
|
+
}
|
103
|
+
|
104
|
+
.stepper__item__bulletin--inline{
|
105
|
+
margin-right: 0px;
|
106
|
+
}
|
107
|
+
|
88
108
|
.stepper__content__title {
|
89
|
-
color:var(--nile-colors-
|
109
|
+
color:var(--nile-colors-dark-900);
|
90
110
|
font-size: var(--stepper-item-title-size);
|
91
111
|
line-height: var(--stepper-item-text-line-height);
|
92
112
|
font-family: var(--nile-font-family-medium);
|
93
|
-
font-weight:
|
113
|
+
font-weight: 400;
|
94
114
|
}
|
95
115
|
|
96
116
|
.stepper__content__title--inline{
|
97
117
|
padding: 0 8px;
|
98
|
-
color:var(--nile-colors-
|
118
|
+
color:var(--nile-colors-dark-900);
|
99
119
|
}
|
100
120
|
|
101
121
|
.stepper__content__title--active{
|
102
|
-
color:var(--nile-colors-primary-
|
122
|
+
color:var(--nile-colors-primary-600);
|
123
|
+
font-weight: 600;
|
103
124
|
}
|
104
125
|
|
105
126
|
.stepper__content__subtitle {
|
106
|
-
color:var(--nile-colors-
|
127
|
+
color:var(--nile-colors-dark-500);
|
107
128
|
font-size: var(--stepper-item-subtitle-size);
|
108
129
|
line-height: var(--stepper-item-text-line-height);
|
109
130
|
font-family: var(--nile-font-family-sans-serif);
|
@@ -118,13 +139,13 @@ export const styles = css `
|
|
118
139
|
width: var(--circle-height);
|
119
140
|
aspect-ratio: 1 / 1;
|
120
141
|
border-radius: 50%;
|
121
|
-
background: radial-gradient(var(--nile-colors-
|
122
|
-
border: 2px solid var(--nile-colors-
|
142
|
+
background: radial-gradient(var(--nile-colors-neutral-500) var(--bulletin--dot--seperation), var(--nile-colors-dark-200) var(--bulletin--dot--seperation));
|
143
|
+
border: 2px solid var(--nile-colors-neutral-500);
|
123
144
|
}
|
124
145
|
|
125
146
|
.stepper__bulletin__dot--active{
|
126
147
|
background: radial-gradient(var(--nile-colors-white-base) var(--bulletin--dot--seperation), var(--nile-colors-primary-600) var(--bulletin--dot--seperation));
|
127
|
-
border: 2px solid var(--nile-colors-primary-
|
148
|
+
border: 2px solid var(--nile-colors-primary-500);
|
128
149
|
}
|
129
150
|
|
130
151
|
.stepper__bulletin--icon {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"nile-stepper-item.css.js","sourceRoot":"","sources":["../../../src/nile-stepper-item/nile-stepper-item.css.ts"],"names":[],"mappings":"AAAA;;;;;EAKE;AAEF,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA
|
1
|
+
{"version":3,"file":"nile-stepper-item.css.js","sourceRoot":"","sources":["../../../src/nile-stepper-item/nile-stepper-item.css.ts"],"names":[],"mappings":"AAAA;;;;;EAKE;AAEF,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsJxB,CAAC;AACF,eAAe,CAAC,MAAM,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 { css } from 'lit';\n\n/**\n * StepperItem CSS\n */\nexport const styles = css`\n\t:host {\n\t\t--stepper-flex-val:1;\n\t\t--bulletin--dot--seperation:30%;\n\t\t\n\t\tdisplay: inline-block;\n\t\tflex-grow:var(--stepper-flex-val);\n\t\tmin-width:var(--nile-stepper-min-width);\n\t}\n\t\n\t.stepper__item {\n\t\tmargin: 0 -1px;\n\t}\n\n\t.stepper__item--sm {\n\t\t--item-spacing: var(--nile-spacing-spacing-md);\n\t\t--stepper-item-title-size:14px;\n\t\t--stepper-item-subtitle-size:14px;\n\t\t--stepper-item-text-line-height:20px;\n\t\t--circle-height:16px;\n\t}\n\n\t.stepper__item--md {\n\t\t--item-spacing: var(--nile-spacing-spacing-md);\n\t\t--stepper-item-title-size:16px;\n\t\t--stepper-item-subtitle-size:14px;\n\t\t--stepper-item-text-line-height:24px;\n\t\t--circle-height:20px;\n\t}\n\n\t.stepper__item--lg {\n\t\t--item-spacing: var(--nile-spacing-spacing-lg);\n\t\t--stepper-item-title-size:16px;\n\t\t--stepper-item-subtitle-size:14px;\n\t\t--stepper-item-text-line-height:24px;\n\t\t--circle-height:28px;\n\t}\n\n\t.stepper__line__content {\n\t\tdisplay:flex;\n\t\twidth:100%;\n\t\talign-items:center;\n\t}\n\n\t.stepper__line__container {\n\t\tflex-grow:1;\n\t\tpadding:0 1px;\n\t}\n\n\t.stepper__line--hastitle {\n\t\tdisplay:flex;\n\t\talign-items:center;\n\t}\n\n\t.stepper__line {\n\t\tdisplay: block;\n\t\tborder: 0;\n\t\tborder-top: 2px solid var(--nile-colors-neutral-500);\n\t}\n\n\t.stepper__line--active {\n\t\tborder-top: 2px solid var(--nile-colors-primary-600);\n\t}\n\n\t.stepper__item__content--above{\n\t\tposition:relative;\n\t\tpadding: 0 var(--nile-spacing-spacing-md);\n\t}\n\n\t.stepper__item__content--above .stepper__content__subtitle{\n\t\tposition: absolute;\n top: 100%;\n white-space: nowrap;\n\t}\n\n\t.stepper__item__content--below {\n\t\tmargin-top: var(--item-spacing);\n\t\tdisplay:flex;\n\t\tflex-direction:column;\n\t\talign-items:center;\n\t}\n\t\n\t.stepper__item__bulletin {\n\t\tdisplay:grid;\n\t\tplace-content:center;\n\t\tmargin:0 -1px;\n\t}\n\n\t.stepper__item__bulletin{\n\t\tmargin-left: 6px;\n\t\tmargin-right: 6px;\n\t}\n\n\t.stepper__item__bulletin--inline{\n\t\tmargin-right: 0px;\n\t}\n\n\t.stepper__content__title {\n\t\tcolor:var(--nile-colors-dark-900);\n\t\tfont-size: var(--stepper-item-title-size);\n\t\tline-height: var(--stepper-item-text-line-height);\n\t\tfont-family: var(--nile-font-family-medium);\n\t\tfont-weight: 400;\n\t}\n\n\t.stepper__content__title--inline{\n\t\tpadding: 0 8px;\n\t\tcolor:var(--nile-colors-dark-900);\n\t}\n\n\t.stepper__content__title--active{\n\t\tcolor:var(--nile-colors-primary-600);\n\t\tfont-weight: 600;\n\t}\n\n\t.stepper__content__subtitle {\n\t\tcolor:var(--nile-colors-dark-500);\n\t\tfont-size: var(--stepper-item-subtitle-size);\n\t\tline-height: var(--stepper-item-text-line-height);\n\t\tfont-family: var(--nile-font-family-sans-serif);\n\t\tfont-weight: 400;\n\t}\n\n\t.stepper__content__subtitle--active{\n\t\tcolor:var(--nile-colors-primary-600);\n\t}\n\n\t.stepper__bulletin--dot {\n\t\twidth: var(--circle-height);\n\t\taspect-ratio: 1 / 1;\n\t\tborder-radius: 50%;\n\t\tbackground: radial-gradient(var(--nile-colors-neutral-500) var(--bulletin--dot--seperation), var(--nile-colors-dark-200) var(--bulletin--dot--seperation));\n\t\tborder: 2px solid var(--nile-colors-neutral-500);\n\t}\n\n\t.stepper__bulletin__dot--active{\n\t\tbackground: radial-gradient(var(--nile-colors-white-base) var(--bulletin--dot--seperation), var(--nile-colors-primary-600) var(--bulletin--dot--seperation));\n\t\tborder: 2px solid var(--nile-colors-primary-500);\n\t}\n\n\t.stepper__bulletin--icon {\n\t\tdisplay:grid;\n\t\tplace-content:center;\n\t\twidth: var(--circle-height);\n\t\tborder: 2px solid var(--nile-colors-primary-600);\n\t\taspect-ratio: 1 / 1;\n\t\tborder-radius: 50%;\n\t\tbackground-color:var(--nile-colors-primary-600);\n\t\toverflow:hidden;\n\t}\n`;\nexport default [styles];"]}
|
@@ -4,7 +4,7 @@
|
|
4
4
|
* This source code is licensed under the BSD-3-Clause license found in the
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
6
6
|
*/
|
7
|
-
import { CSSResultArray, TemplateResult } from 'lit';
|
7
|
+
import { CSSResultArray, TemplateResult, PropertyValues } from 'lit';
|
8
8
|
import NileElement from '../internal/nile-element';
|
9
9
|
/**
|
10
10
|
* Nile stepper-item component.
|
@@ -13,6 +13,8 @@ import NileElement from '../internal/nile-element';
|
|
13
13
|
*
|
14
14
|
*/
|
15
15
|
export declare class NileStepperItem extends NileElement {
|
16
|
+
absoluteTitle: HTMLDivElement;
|
17
|
+
absoluteSubtitle: HTMLDivElement;
|
16
18
|
title: string;
|
17
19
|
subtitle: string;
|
18
20
|
private contentBelow;
|
@@ -32,11 +34,13 @@ export declare class NileStepperItem extends NileElement {
|
|
32
34
|
* @remarks If you are extending this class you can extend the base styles with super. Eg `return [super(), myCustomStyles]`
|
33
35
|
*/
|
34
36
|
static get styles(): CSSResultArray;
|
37
|
+
protected updated(_changedProperties: PropertyValues): void;
|
35
38
|
/**
|
36
39
|
* Render method
|
37
40
|
* @slot This is a slot test
|
38
41
|
*/
|
39
42
|
render(): TemplateResult;
|
43
|
+
getSvg(): TemplateResult;
|
40
44
|
}
|
41
45
|
export default NileStepperItem;
|
42
46
|
declare global {
|