@felleslosninger/minid-elements 0.0.106 → 0.0.107
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"step-indicator.component.d.ts","sourceRoot":"","sources":["../../src/components/step-indicator.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,UAAU,EAAE,MAAM,KAAK,CAAC;AAK5C,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,oBAAoB,EAAE,kBAAkB,CAAC;KAC1C;CACF;;AAWD,qBACa,kBAAmB,SAAQ,uBAA0B;IAEhE,KAAK,SAAK;IAGV,OAAO,SAAK;IAEH,MAAM;
|
|
1
|
+
{"version":3,"file":"step-indicator.component.d.ts","sourceRoot":"","sources":["../../src/components/step-indicator.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,UAAU,EAAE,MAAM,KAAK,CAAC;AAK5C,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,oBAAoB,EAAE,kBAAkB,CAAC;KAC1C;CACF;;AAWD,qBACa,kBAAmB,SAAQ,uBAA0B;IAEhE,KAAK,SAAK;IAGV,OAAO,SAAK;IAEH,MAAM;CAyBhB"}
|
|
@@ -28,15 +28,24 @@ let MinidStepIndicator = class extends styled(LitElement, styles) {
|
|
|
28
28
|
}
|
|
29
29
|
render() {
|
|
30
30
|
return html`
|
|
31
|
-
<ul class="flex
|
|
31
|
+
<ul class="flex gap-8">
|
|
32
32
|
${Array.from({ length: this.steps }).map((_, index) => {
|
|
33
33
|
const step = index + 1;
|
|
34
|
+
const isActive = step === this.current;
|
|
35
|
+
const isCompleted = step < this.current;
|
|
36
|
+
const isUpcoming = step > this.current;
|
|
34
37
|
return html`<li
|
|
35
38
|
class="${classMap({
|
|
36
|
-
"bg-accent-
|
|
37
|
-
"
|
|
38
|
-
"bg-
|
|
39
|
-
|
|
39
|
+
"after:bg-accent-base": isActive || isCompleted,
|
|
40
|
+
"border-accent-base": isActive || isCompleted,
|
|
41
|
+
"after:bg-neutral-surface-active": isUpcoming,
|
|
42
|
+
"border-neutral-surface-active": isUpcoming,
|
|
43
|
+
"bg-neutral-surface-active": isUpcoming,
|
|
44
|
+
"after:bg-transparent": step === 1,
|
|
45
|
+
"bg-neutral-surface": isCompleted,
|
|
46
|
+
"bg-accent-base": isActive,
|
|
47
|
+
"bg-accent": isUpcoming
|
|
48
|
+
})} relative rounded-full border-4 p-1.5 after:absolute after:-left-1 after:block after:h-1 after:w-8 after:-translate-x-full after:-translate-y-1/2"
|
|
40
49
|
></li>`;
|
|
41
50
|
})}
|
|
42
51
|
</ul>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"step-indicator.js","sources":["../../src/components/step-indicator.component.ts"],"sourcesContent":["import { css, html, LitElement } from 'lit';\nimport { styled } from '../mixins/tailwind.mixin';\nimport { customElement, property } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'mid-step-indicator': MinidStepIndicator;\n }\n}\n\nconst styles = [\n css`\n :host {\n display: flex;\n justify-content: center;\n }\n `,\n];\n\n@customElement('mid-step-indicator')\nexport class MinidStepIndicator extends styled(LitElement, styles) {\n @property({ type: Number })\n steps = 0;\n\n @property({ type: Number })\n current = 0;\n\n override render() {\n return html`\n <ul class=\"flex
|
|
1
|
+
{"version":3,"file":"step-indicator.js","sources":["../../src/components/step-indicator.component.ts"],"sourcesContent":["import { css, html, LitElement } from 'lit';\nimport { styled } from '../mixins/tailwind.mixin';\nimport { customElement, property } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'mid-step-indicator': MinidStepIndicator;\n }\n}\n\nconst styles = [\n css`\n :host {\n display: flex;\n justify-content: center;\n }\n `,\n];\n\n@customElement('mid-step-indicator')\nexport class MinidStepIndicator extends styled(LitElement, styles) {\n @property({ type: Number })\n steps = 0;\n\n @property({ type: Number })\n current = 0;\n\n override render() {\n return html`\n <ul class=\"flex gap-8\">\n ${Array.from({ length: this.steps }).map((_, index) => {\n const step = index + 1;\n const isActive = step === this.current;\n const isCompleted = step < this.current;\n const isUpcoming = step > this.current;\n return html`<li\n class=\"${classMap({\n 'after:bg-accent-base': isActive || isCompleted,\n 'border-accent-base': isActive || isCompleted,\n 'after:bg-neutral-surface-active': isUpcoming,\n 'border-neutral-surface-active': isUpcoming,\n 'bg-neutral-surface-active': isUpcoming,\n 'after:bg-transparent': step === 1,\n 'bg-neutral-surface': isCompleted,\n 'bg-accent-base': isActive,\n 'bg-accent': isUpcoming,\n })} relative rounded-full border-4 p-1.5 after:absolute after:-left-1 after:block after:h-1 after:w-8 after:-translate-x-full after:-translate-y-1/2\"\n ></li>`;\n })}\n </ul>\n `;\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAWA,MAAM,SAAS;AAAA,EACb;AAAA;AAAA;AAAA;AAAA;AAAA;AAMF;AAGO,IAAM,qBAAN,cAAiC,OAAO,YAAY,MAAM,EAAE;AAAA,EAA5D,cAAA;AAAA,UAAA,GAAA,SAAA;AAEG,SAAA,QAAA;AAGE,SAAA,UAAA;AAAA,EAAA;AAAA,EAED,SAAS;AACT,WAAA;AAAA;AAAA,UAED,MAAM,KAAK,EAAE,QAAQ,KAAK,MAAO,CAAA,EAAE,IAAI,CAAC,GAAG,UAAU;AACrD,YAAM,OAAO,QAAQ;AACf,YAAA,WAAW,SAAS,KAAK;AACzB,YAAA,cAAc,OAAO,KAAK;AAC1B,YAAA,aAAa,OAAO,KAAK;AACxB,aAAA;AAAA,qBACI,SAAS;AAAA,QAChB,wBAAwB,YAAY;AAAA,QACpC,sBAAsB,YAAY;AAAA,QAClC,mCAAmC;AAAA,QACnC,iCAAiC;AAAA,QACjC,6BAA6B;AAAA,QAC7B,wBAAwB,SAAS;AAAA,QACjC,sBAAsB;AAAA,QACtB,kBAAkB;AAAA,QAClB,aAAa;AAAA,MAAA,CACd,CAAC;AAAA;AAAA,IAAA,CAEL,CAAC;AAAA;AAAA;AAAA,EAAA;AAIV;AA9BE,gBAAA;AAAA,EADC,SAAS,EAAE,MAAM,OAAQ,CAAA;AAAA,GADf,mBAEX,WAAA,SAAA,CAAA;AAGA,gBAAA;AAAA,EADC,SAAS,EAAE,MAAM,OAAQ,CAAA;AAAA,GAJf,mBAKX,WAAA,WAAA,CAAA;AALW,qBAAN,gBAAA;AAAA,EADN,cAAc,oBAAoB;AAAA,GACtB,kBAAA;"}
|