@mhmo91/schmancy 0.4.65 → 0.4.66
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/dist/{avatar--mnNHo1b.js → avatar-DnzsjVqx.js} +2 -2
- package/dist/{avatar--mnNHo1b.js.map → avatar-DnzsjVqx.js.map} +1 -1
- package/dist/{avatar-CJ3ybQtt.cjs → avatar-cIIj5C23.cjs} +2 -2
- package/dist/{avatar-CJ3ybQtt.cjs.map → avatar-cIIj5C23.cjs.map} +1 -1
- package/dist/badge.cjs +1 -1
- package/dist/badge.js +1 -1
- package/dist/content-drawer.cjs +1 -1
- package/dist/content-drawer.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +2 -2
- package/dist/nav-drawer.cjs +1 -1
- package/dist/nav-drawer.js +1 -1
- package/dist/{schmancy-steps-container-cDZHQ4QA.cjs → schmancy-steps-container-BLLfmYBF.cjs} +11 -10
- package/dist/schmancy-steps-container-BLLfmYBF.cjs.map +1 -0
- package/dist/{schmancy-steps-container-B05_VYrQ.js → schmancy-steps-container-Be0uKWP8.js} +22 -21
- package/dist/schmancy-steps-container-Be0uKWP8.js.map +1 -0
- package/dist/steps.cjs +1 -1
- package/dist/steps.js +1 -1
- package/dist/teleport.cjs +1 -1
- package/dist/teleport.js +1 -1
- package/package.json +1 -1
- package/dist/schmancy-steps-container-B05_VYrQ.js.map +0 -1
- package/dist/schmancy-steps-container-cDZHQ4QA.cjs.map +0 -1
package/dist/{schmancy-steps-container-cDZHQ4QA.cjs → schmancy-steps-container-BLLfmYBF.cjs}
RENAMED
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
"use strict";const S=require("./consume-edta5ng5.cjs"),c=require("lit"),i=require("lit/decorators.js"),h=require("lit/directives/when.js"),
|
|
1
|
+
"use strict";const S=require("./consume-edta5ng5.cjs"),c=require("lit"),i=require("lit/decorators.js"),h=require("lit/directives/when.js"),m=require("./litElement.mixin-CNI7suiz.cjs"),y=require("./provide-BxZ2kn_p.cjs"),g=require("rxjs");class d{constructor(){this._currentStep=new g.BehaviorSubject(1)}get currentStep$(){return this._currentStep.asObservable()}get currentStep(){return this._currentStep.value}setStep(e){this._currentStep.next(e)}}const u=y.n(Symbol("SchmancyStepsContext"));var b=Object.defineProperty,f=Object.getOwnPropertyDescriptor,p=(t,e,n,s)=>{for(var o,r=s>1?void 0:s?f(e,n):e,a=t.length-1;a>=0;a--)(o=t[a])&&(r=(s?o(e,n,r):o(r))||r);return s&&r&&b(e,n,r),r};exports.SchmancyStep=class extends m.$LitElement(c.css`
|
|
2
2
|
:host {
|
|
3
3
|
display: grid;
|
|
4
4
|
/* Base display is just grid, flex properties will be applied dynamically */
|
|
5
5
|
transition: all 0.2s ease-in-out;
|
|
6
6
|
}
|
|
7
|
-
`){constructor(){super(...arguments),this.position=1,this.title="",this.description="",this.completed=!1,this.lockBack=!1,this.currentStep=1}connectedCallback(){super.connectedCallback()}firstUpdated(){this.subscription=this.steps.currentStep$.subscribe(t=>{this.currentStep=t,this.updateFlexProperties()}),this.updateFlexProperties()}disconnectedCallback(){this.subscription?.unsubscribe(),super.disconnectedCallback()}updateFlexProperties(){const t=this.position===this.currentStep;this.style.flex=t?"1 1 auto":"0 0 auto"}get status(){return this.completed||this.position<this.steps.currentStep?"complete":this.position===this.steps.currentStep?"current":"upcoming"}_onStepClick(t){this.lockBack&&this.position<this.steps.currentStep||this.status!=="upcoming"&&this.steps.setStep(this.position)}render(){const t=this.position===this.currentStep,e=this.status==="complete",n=this.status==="upcoming",s={"bg-tertiary-default":e,"bg-outline-variant":!e},o={"relative border-solid z-10 flex size-8 items-center justify-center rounded-full transition-all duration-200":!0,"bg-tertiary-default text-tertiary-on shadow-md group-hover:shadow-lg":e,"border-2 border-primary-default bg-primary-container text-primary-onContainer shadow-sm":!e&&t,"border-2 border-outline bg-surface text-surface-onVariant group-hover:border-primary-default group-hover:bg-primary-container":n},r={"text-primary-default font-medium":t,"text-tertiary-default":e,"text-surface-onVariant":n},a=t||e?"cursor-pointer":"";return c.html`
|
|
7
|
+
`){constructor(){super(...arguments),this.position=1,this.title="",this.description="",this.completed=!1,this.lockBack=!1,this.currentStep=1}connectedCallback(){super.connectedCallback()}firstUpdated(){this.subscription=this.steps.currentStep$.subscribe(t=>{this.currentStep=t,this.updateFlexProperties()}),this.updateFlexProperties()}disconnectedCallback(){this.subscription?.unsubscribe(),super.disconnectedCallback()}updateFlexProperties(){const t=this.position===this.currentStep;this.style.flex=t?"1 1 auto":"0 0 auto"}get status(){return this.completed||this.position<this.steps.currentStep?"complete":this.position===this.steps.currentStep?"current":"upcoming"}_onStepClick(t){this.lockBack&&this.position<this.steps.currentStep||this.status!=="upcoming"&&this.steps.setStep(this.position)}render(){const t=this.position===this.currentStep,e=this.status==="complete",n=this.status==="upcoming",s={"bg-tertiary-default":e,"bg-outline-variant":!e},o={"relative border-solid z-10 flex size-8 items-center justify-center rounded-full transition-all duration-200":!0,"bg-tertiary-default text-tertiary-on shadow-md group-hover:shadow-lg":e,"border-2 border-primary-default bg-primary-container text-primary-onContainer shadow-sm":!e&&t,"border-2 border-outline bg-surface-default text-surface-onVariant group-hover:border-primary-default group-hover:bg-primary-container":n},r={"text-primary-default font-medium":t,"text-tertiary-default":e,"text-surface-onVariant":n},a=t||e?"cursor-pointer":"";return c.html`
|
|
8
8
|
<li class="relative">
|
|
9
9
|
<!-- Connector line -->
|
|
10
10
|
<div
|
|
11
|
-
class="absolute top-8 left-4 -ml-px
|
|
11
|
+
class="absolute top-8 left-4 -ml-px w-0.5 transition-colors duration-200 ${this.classMap(s)}"
|
|
12
|
+
style="height: calc(100% + var(--steps-gap, 0px))"
|
|
12
13
|
aria-hidden="true"
|
|
13
14
|
></div>
|
|
14
15
|
|
|
@@ -16,7 +17,7 @@
|
|
|
16
17
|
<button
|
|
17
18
|
type="button"
|
|
18
19
|
@click=${this._onStepClick}
|
|
19
|
-
class="relative flex items-
|
|
20
|
+
class="relative flex items-center group transition-all duration-200 hover:scale-[1.02] ${a} ${t?"bg-primary-container/20 -mx-2 px-2 py-3 rounded-lg":"py-2"}"
|
|
20
21
|
>
|
|
21
22
|
<span class="flex items-center h-12">
|
|
22
23
|
<span class=${this.classMap(o)}>
|
|
@@ -36,7 +37,7 @@
|
|
|
36
37
|
</span>
|
|
37
38
|
</span>
|
|
38
39
|
|
|
39
|
-
<span class="flex flex-col items-start min-w-0 ml-6">
|
|
40
|
+
<span class="flex flex-col items-start justify-center min-w-0 ml-6">
|
|
40
41
|
<schmancy-typography type="title" token="md">
|
|
41
42
|
<span class="transition-colors duration-200 ${this.classMap(r)}">${this.title}</span>
|
|
42
43
|
</schmancy-typography>
|
|
@@ -57,15 +58,15 @@
|
|
|
57
58
|
</div>
|
|
58
59
|
`)}
|
|
59
60
|
</li>
|
|
60
|
-
`}},p([i.property({type:Number})],exports.SchmancyStep.prototype,"position",2),p([i.property({type:String})],exports.SchmancyStep.prototype,"title",2),p([i.property({type:String})],exports.SchmancyStep.prototype,"description",2),p([i.property({type:Boolean,reflect:!0})],exports.SchmancyStep.prototype,"completed",2),p([i.property({type:Boolean})],exports.SchmancyStep.prototype,"lockBack",2),p([S.c({context:u})],exports.SchmancyStep.prototype,"steps",2),p([i.state()],exports.SchmancyStep.prototype,"currentStep",2),exports.SchmancyStep=p([i.customElement("schmancy-step")],exports.SchmancyStep);var v=Object.defineProperty,x=Object.getOwnPropertyDescriptor,l=(t,e,n,s)=>{for(var o,r=s>1?void 0:s?x(e,n):e,a=t.length-1;a>=0;a--)(o=t[a])&&(r=(s?o(e,n,r):o(r))||r);return s&&r&&v(e,n,r),r};exports.SchmancyStepsContainer=class extends
|
|
61
|
+
`}},p([i.property({type:Number})],exports.SchmancyStep.prototype,"position",2),p([i.property({type:String})],exports.SchmancyStep.prototype,"title",2),p([i.property({type:String})],exports.SchmancyStep.prototype,"description",2),p([i.property({type:Boolean,reflect:!0})],exports.SchmancyStep.prototype,"completed",2),p([i.property({type:Boolean})],exports.SchmancyStep.prototype,"lockBack",2),p([S.c({context:u})],exports.SchmancyStep.prototype,"steps",2),p([i.state()],exports.SchmancyStep.prototype,"currentStep",2),exports.SchmancyStep=p([i.customElement("schmancy-step")],exports.SchmancyStep);var v=Object.defineProperty,x=Object.getOwnPropertyDescriptor,l=(t,e,n,s)=>{for(var o,r=s>1?void 0:s?x(e,n):e,a=t.length-1;a>=0;a--)(o=t[a])&&(r=(s?o(e,n,r):o(r))||r);return s&&r&&v(e,n,r),r};exports.SchmancyStepsContainer=class extends m.$LitElement(c.css`
|
|
61
62
|
:host {
|
|
62
63
|
display: block;
|
|
63
64
|
}
|
|
64
|
-
`){constructor(){super(...arguments),this.controller=new d,this.stepsController=this.controller,this._currentStep=1,this.gap=4}set currentStep(t){const e=this._currentStep;this._currentStep=t,this.controller.setStep(t),this.requestUpdate("currentStep",e)}get currentStep(){return this._currentStep}connectedCallback(){super.connectedCallback(),this.controller.setStep(this.currentStep)}render(){const t=`gap-${this.gap}
|
|
65
|
+
`){constructor(){super(...arguments),this.controller=new d,this.stepsController=this.controller,this._currentStep=1,this.gap=4}set currentStep(t){const e=this._currentStep;this._currentStep=t,this.controller.setStep(t),this.requestUpdate("currentStep",e)}get currentStep(){return this._currentStep}connectedCallback(){super.connectedCallback(),this.controller.setStep(this.currentStep)}render(){const t=`gap-${this.gap}`,e={0:"0",1:"0.25rem",2:"0.5rem",3:"0.75rem",4:"1rem",5:"1.25rem",6:"1.5rem",8:"2rem",10:"2.5rem",12:"3rem",16:"4rem",20:"5rem",24:"6rem"}[this.gap]||"1rem";return c.html`
|
|
65
66
|
<nav class="flex h-full w-full" aria-label="Progress">
|
|
66
|
-
<ol class="flex flex-col flex-1 ${t}" role="list">
|
|
67
|
+
<ol class="flex flex-col flex-1 ${t}" role="list" style="--steps-gap: ${e}">
|
|
67
68
|
<slot></slot>
|
|
68
69
|
</ol>
|
|
69
70
|
</nav>
|
|
70
|
-
`}},l([
|
|
71
|
-
//# sourceMappingURL=schmancy-steps-container-
|
|
71
|
+
`}},l([y.e({context:u})],exports.SchmancyStepsContainer.prototype,"stepsController",2),l([i.property({type:Number,reflect:!0})],exports.SchmancyStepsContainer.prototype,"currentStep",1),l([i.property({type:Number,reflect:!0})],exports.SchmancyStepsContainer.prototype,"gap",2),exports.SchmancyStepsContainer=l([i.customElement("schmancy-steps-container")],exports.SchmancyStepsContainer),exports.StepsController=d,exports.stepsContext=u;
|
|
72
|
+
//# sourceMappingURL=schmancy-steps-container-BLLfmYBF.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schmancy-steps-container-BLLfmYBF.cjs","sources":["../src/steps/steps.context.ts","../src/steps/schmancy-step.ts","../src/steps/schmancy-steps-container.ts"],"sourcesContent":["import { createContext } from '@lit/context'\nimport { BehaviorSubject } from 'rxjs'\n\nexport class StepsController {\n\tprivate _currentStep = new BehaviorSubject(1)\n\n\tget currentStep$() {\n\t\treturn this._currentStep.asObservable()\n\t}\n\n\tget currentStep() {\n\t\treturn this._currentStep.value\n\t}\n\n\tsetStep(step: number) {\n\t\tthis._currentStep.next(step)\n\t}\n}\n\n/**\n * The actual context object. We provide/consume this in the container and steps.\n */\nexport const stepsContext = createContext<StepsController>(Symbol('SchmancyStepsContext'))\n","import { consume } from '@lit/context'\nimport { css, html } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\nimport { when } from 'lit/directives/when.js'\nimport { Subscription } from 'rxjs'\nimport { stepsContext, StepsController } from './steps.context'\nimport { $LitElement } from '@mixins/litElement.mixin'\n\n@customElement('schmancy-step')\nexport class SchmancyStep extends $LitElement(css`\n\t:host {\n\t\tdisplay: grid;\n\t\t/* Base display is just grid, flex properties will be applied dynamically */\n\t\ttransition: all 0.2s ease-in-out;\n\t}\n`) {\n\t/**\n\t * The step's position (1-based). This is used to compare against\n\t * the container's current step to decide if it's \"complete\",\n\t * \"current\", or \"upcoming\".\n\t */\n\t@property({ type: Number }) position = 1\n\n\t@property({ type: String }) title = ''\n\t@property({ type: String }) description = ''\n\n\t// NEW: Allow a step to be explicitly marked as complete.\n\t@property({ type: Boolean, reflect: true }) completed = false\n\n\t/**\n\t * NEW: Lock API to disable users from going back.\n\t * When set to true, clicking on a previous (completed) step is ignored.\n\t */\n\t@property({ type: Boolean }) lockBack = false\n\n\t/**\n\t * Consume the shared StepsController from context.\n\t */\n\t@consume({ context: stepsContext })\n\tprivate steps!: StepsController\n\n\t/**\n\t * Local reactive copy of the container's current step number.\n\t */\n\t@state()\n\tprivate currentStep = 1\n\n\t/**\n\t * Keep a reference to our subscription so we can unsubscribe cleanly.\n\t */\n\tprivate subscription?: Subscription\n\n\tconnectedCallback() {\n\t\tsuper.connectedCallback()\n\t}\n\n\tfirstUpdated() {\n\t\t// Subscribe to updates from the container's StepsController.\n\t\t// Context is guaranteed to be available after first render\n\t\tthis.subscription = this.steps.currentStep$.subscribe(step => {\n\t\t\tthis.currentStep = step\n\t\t\t// When the current step changes, update the flex properties\n\t\t\tthis.updateFlexProperties()\n\t\t})\n\t\t// Initial update of flex properties\n\t\tthis.updateFlexProperties()\n\t}\n\n\tdisconnectedCallback(): void {\n\t\tthis.subscription?.unsubscribe()\n\t\tsuper.disconnectedCallback()\n\t}\n\n\t/**\n\t * Update the host element's flex properties based on active state\n\t */\n\tprivate updateFlexProperties() {\n\t\tconst isActive = this.position === this.currentStep\n\n\t\tif (isActive) {\n\t\t\t// Apply flex-grow when active\n\t\t\tthis.style.flex = '1 1 auto'\n\t\t} else {\n\t\t\t// Make it shrink when not active\n\t\t\tthis.style.flex = '0 0 auto'\n\t\t}\n\t}\n\n\t/**\n\t * Compute visual status for styling purposes. Note that if a step is explicitly\n\t * marked as completed, it always appears as complete even if it's active.\n\t */\n\tget status(): 'complete' | 'current' | 'upcoming' {\n\t\tif (this.completed || this.position < this.steps.currentStep) return 'complete'\n\t\tif (this.position === this.steps.currentStep) return 'current'\n\t\treturn 'upcoming'\n\t}\n\n\t/**\n\t * Click handler to allow navigation between completed (or active) steps.\n\t * With lockBack enabled, clicking on a previous step is ignored.\n\t */\n\tprivate _onStepClick(_e: Event) {\n\t\t// If lockBack is enabled and the user attempts to go back, do nothing.\n\t\tif (this.lockBack && this.position < this.steps.currentStep) {\n\t\t\treturn\n\t\t}\n\t\tif (this.status !== 'upcoming') {\n\t\t\tthis.steps.setStep(this.position)\n\t\t}\n\t}\n\n\trender() {\n\t\t// Determine if the step is currently active.\n\t\tconst isActive = this.position === this.currentStep\n\n\t\t// Use computed status for visual styling.\n\t\tconst isComplete = this.status === 'complete'\n\t\tconst isUpcoming = this.status === 'upcoming'\n\n\t\t// Enhanced styling classes with better visual hierarchy\n\t\tconst connectorClasses = {\n\t\t\t'bg-tertiary-default': isComplete,\n\t\t\t'bg-outline-variant': !isComplete,\n\t\t}\n\n\t\tconst iconContainerClasses = {\n\t\t\t'relative border-solid z-10 flex size-8 items-center justify-center rounded-full transition-all duration-200': true,\n\t\t\t'bg-tertiary-default text-tertiary-on shadow-md group-hover:shadow-lg': isComplete,\n\t\t\t'border-2 border-primary-default bg-primary-container text-primary-onContainer shadow-sm': !isComplete && isActive,\n\t\t\t'border-2 border-outline bg-surface-default text-surface-onVariant group-hover:border-primary-default group-hover:bg-primary-container': isUpcoming,\n\t\t}\n\n\t\tconst textClasses = {\n\t\t\t'text-primary-default font-medium': isActive,\n\t\t\t'text-tertiary-default': isComplete,\n\t\t\t'text-surface-onVariant': isUpcoming,\n\t\t}\n\n\t\t// If the step is clickable (active or complete), add a pointer cursor.\n\t\tconst clickableClass = isActive || isComplete ? 'cursor-pointer' : ''\n\n\t\treturn html`\n\t\t\t<li class=\"relative\">\n\t\t\t\t<!-- Connector line -->\n\t\t\t\t<div\n\t\t\t\t\tclass=\"absolute top-8 left-4 -ml-px w-0.5 transition-colors duration-200 ${this.classMap(connectorClasses)}\"\n\t\t\t\t\tstyle=\"height: calc(100% + var(--steps-gap, 0px))\"\n\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t></div>\n\n\t\t\t\t<!-- Step Button/Label -->\n\t\t\t\t<button \n\t\t\t\t\ttype=\"button\" \n\t\t\t\t\t@click=${this._onStepClick} \n\t\t\t\t\tclass=\"relative flex items-center group transition-all duration-200 hover:scale-[1.02] ${clickableClass} ${isActive ? 'bg-primary-container/20 -mx-2 px-2 py-3 rounded-lg' : 'py-2'}\"\n\t\t\t\t>\n\t\t\t\t\t<span class=\"flex items-center h-12\">\n\t\t\t\t\t\t<span class=${this.classMap(iconContainerClasses)}>\n\t\t\t\t\t\t\t${isComplete\n\t\t\t\t\t\t\t\t? html`\n\t\t\t\t\t\t\t\t\t\t<svg class=\"size-5 transition-transform duration-200 group-hover:scale-110\" viewBox=\"0 0 20 20\" fill=\"currentColor\" aria-hidden=\"true\">\n\t\t\t\t\t\t\t\t\t\t\t<path\n\t\t\t\t\t\t\t\t\t\t\t\tfill-rule=\"evenodd\"\n\t\t\t\t\t\t\t\t\t\t\t\td=\"M16.704 4.153a.75.75 0 0 1 .143 1.052l-8 10.5a.75.75 0 0 1-1.127.075l-4.5-4.5a.75.75 0 0 1 1.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 0 1 1.05-.143Z\"\n\t\t\t\t\t\t\t\t\t\t\t\tclip-rule=\"evenodd\"\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t</svg>\n\t\t\t\t\t\t\t\t\t`\n\t\t\t\t\t\t\t\t: html`\n\t\t\t\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t\t\t\tclass=\"size-3 rounded-full transition-all duration-200 ${isActive\n\t\t\t\t\t\t\t\t\t\t\t\t? 'bg-primary-onContainer'\n\t\t\t\t\t\t\t\t\t\t\t\t: 'bg-transparent group-hover:bg-primary-default group-hover:scale-125'}\"\n\t\t\t\t\t\t\t\t\t\t></span>\n\t\t\t\t\t\t\t\t\t`}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</span>\n\n\t\t\t\t\t<span class=\"flex flex-col items-start justify-center min-w-0 ml-6\">\n\t\t\t\t\t\t<schmancy-typography type=\"title\" token=\"md\">\n\t\t\t\t\t\t\t<span class=\"transition-colors duration-200 ${this.classMap(textClasses)}\">${this.title}</span>\n\t\t\t\t\t\t</schmancy-typography>\n\t\t\t\t\t\t${when(\n\t\t\t\t\t\t\tthis.description,\n\t\t\t\t\t\t\t() => html`\n\t\t\t\t\t\t\t\t<schmancy-typography type=\"body\" token=\"sm\" class=\"mt-1\">\n\t\t\t\t\t\t\t\t\t<span class=\"text-surface-onVariant transition-colors duration-200 ${isActive ? 'text-primary-onContainer' : ''}\">${this.description}</span>\n\t\t\t\t\t\t\t\t</schmancy-typography>\n\t\t\t\t\t\t\t`,\n\t\t\t\t\t\t)}\n\t\t\t\t\t</span>\n\t\t\t\t</button>\n\n\t\t\t\t<!-- Render step content if the step is active, with enhanced spacing -->\n\t\t\t\t${when(\n\t\t\t\t\tisActive,\n\t\t\t\t\t() => html`\n\t\t\t\t\t\t<div class=\"ml-10 mt-4 pb-8 transition-all duration-300 ease-out\">\n\t\t\t\t\t\t\t<div class=\"pl-4 border-l-2 border-primary-default/20\">\n\t\t\t\t\t\t\t\t<slot></slot>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t`,\n\t\t\t\t)}\n\t\t\t</li>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-step': SchmancyStep\n\t}\n}\n","import { provide } from '@lit/context'\nimport { $LitElement } from '@mixins/litElement.mixin'\nimport { css, html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport { StepsController, stepsContext } from './steps.context'\n\n@customElement('schmancy-steps-container')\nexport class SchmancyStepsContainer extends $LitElement(css`\n\t:host {\n\t\tdisplay: block;\n\t}\n`) {\n\tprivate controller = new StepsController()\n\n\t@provide({ context: stepsContext })\n\tstepsController = this.controller\n\n\t@property({ type: Number, reflect: true })\n\tset currentStep(value: number) {\n\t\tconst oldValue = this._currentStep\n\t\tthis._currentStep = value\n\t\tthis.controller.setStep(value)\n\t\tthis.requestUpdate('currentStep', oldValue)\n\t}\n\n\tget currentStep(): number {\n\t\treturn this._currentStep\n\t}\n\n\tprivate _currentStep = 1\n\n\t/**\n\t * Gap between steps. Maps to Tailwind gap classes.\n\t * Options: 0, 1, 2, 3, 4, 5, 6, 8, 10, 12, 16, 20, 24\n\t * @default 4\n\t */\n\t@property({ type: Number, reflect: true })\n\tgap: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 8 | 10 | 12 | 16 | 20 | 24 = 4\n\n\tconnectedCallback() {\n\t\tsuper.connectedCallback()\n\t\tthis.controller.setStep(this.currentStep)\n\t}\n\n\trender() {\n\t\t// Map gap value to Tailwind gap class\n\t\tconst gapClass = `gap-${this.gap}`\n\t\t\n\t\t// Map gap value to actual rem value for CSS custom property\n\t\t// Tailwind gap scale: 1 = 0.25rem, 2 = 0.5rem, etc.\n\t\tconst gapRem = {\n\t\t\t0: '0',\n\t\t\t1: '0.25rem',\n\t\t\t2: '0.5rem',\n\t\t\t3: '0.75rem',\n\t\t\t4: '1rem',\n\t\t\t5: '1.25rem',\n\t\t\t6: '1.5rem',\n\t\t\t8: '2rem',\n\t\t\t10: '2.5rem',\n\t\t\t12: '3rem',\n\t\t\t16: '4rem',\n\t\t\t20: '5rem',\n\t\t\t24: '6rem'\n\t\t}[this.gap] || '1rem'\n\t\t\n\t\treturn html`\n\t\t\t<nav class=\"flex h-full w-full\" aria-label=\"Progress\">\n\t\t\t\t<ol class=\"flex flex-col flex-1 ${gapClass}\" role=\"list\" style=\"--steps-gap: ${gapRem}\">\n\t\t\t\t\t<slot></slot>\n\t\t\t\t</ol>\n\t\t\t</nav>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-steps-container': SchmancyStepsContainer\n\t}\n}\n"],"names":["StepsController","constructor","this","_currentStep","BehaviorSubject","currentStep$","asObservable","currentStep","value","step","next","stepsContext","createContext","Symbol","SchmancyStep","$LitElement","css","super","arguments","position","title","description","completed","lockBack","connectedCallback","firstUpdated","subscription","steps","subscribe","updateFlexProperties","disconnectedCallback","unsubscribe","isActive","style","flex","_e","status","setStep","render","isComplete","isUpcoming","connectorClasses","iconContainerClasses","textClasses","clickableClass","html","classMap","_onStepClick","when","__decorateClass","property","type","Number","prototype","String","Boolean","reflect","consume","context","state","customElement","SchmancyStepsContainer","controller","stepsController","gap","oldValue","requestUpdate","gapClass","gapRem","provide"],"mappings":"8OAGO,MAAMA,CAAAA,CAAN,aAAAC,CACNC,KAAQC,aAAe,IAAIC,EAAAA,gBAAgB,CAAA,CAAC,CAE5C,IAAA,cAAIC,CACH,OAAOH,KAAKC,aAAaG,aAAAA,CAC1B,CAEA,IAAA,aAAIC,CACH,OAAOL,KAAKC,aAAaK,KAC1B,CAEA,QAAQC,EAAAA,CACPP,KAAKC,aAAaO,KAAKD,CAAAA,CACxB,CAAA,CAMM,MAAME,EAAeC,EAAAA,EAA+BC,OAAO,sBAAA,CAAA,kMCbrDC,QAAAA,aAAN,cAA2BC,EAAAA,YAAYC,EAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA,CAAvC,CAAA,CAAA,aAAAf,CAAAgB,MAAAA,GAAAC,SAAAA,EAYsBhB,KAAAiB,SAAW,EAEXjB,KAAAkB,MAAQ,GACRlB,KAAAmB,YAAc,GAGEnB,KAAAoB,UAAAA,GAMfpB,KAAAqB,SAAAA,GAY7BrB,KAAQK,YAAc,CAAA,CAOtB,mBAAAiB,CACCP,MAAMO,kBAAAA,CACP,CAEA,cAAAC,CAGCvB,KAAKwB,aAAexB,KAAKyB,MAAMtB,aAAauB,UAAUnB,GAAAA,CACrDP,KAAKK,YAAcE,EAEnBP,KAAK2B,qBAAAA,CAAAA,CAAAA,EAGN3B,KAAK2B,qBAAAA,CACN,CAEA,sBAAAC,CACC5B,KAAKwB,cAAcK,cACnBd,MAAMa,qBAAAA,CACP,CAKQ,uBACP,MAAME,EAAW9B,KAAKiB,WAAajB,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5D,KAAQC,aAAe,EAQvBD,KAAA8D,IAA8D,CAAA,CAnB9D,IAAA,YAAgBxD,EAAAA,CACf,MAAMyD,EAAW/D,KAAKC,aACtBD,KAAKC,aAAeK,EACpBN,KAAK4D,WAAWzB,QAAQ7B,GACxBN,KAAKgE,cAAc,cAAeD,CAAAA,CACnC,CAEA,iBAAI1D,CACH,OAAOL,KAAKC,YACb,CAYA,mBAAAqB,CACCP,MAAMO,oBACNtB,KAAK4D,WAAWzB,QAAQnC,KAAKK,WAAAA,CAC9B,CAEA,QAAA+B,CAEC,MAAM6B,EAAW,OAAOjE,KAAK8D,GAAAA,GAIvBI,EAAS,CACd,EAAG,IACH,EAAG,UACH,EAAG,SACH,EAAG,UACH,EAAG,OACH,EAAG,UACH,EAAG,SACH,EAAG,OACH,GAAI,SACJ,GAAI,OACJ,GAAI,OACJ,GAAI,OACJ,GAAI,MAAA,EACHlE,KAAK8D,GAAAA,GAAQ,OAEf,OAAOnB,EAAAA;AAAAA;AAAAA,sCAE6BsB,CAAAA,qCAA6CC,CAAAA;AAAAA;AAAAA;AAAAA;AAAAA,GAKlF,CAAA,EA1DAnB,EAAA,CADCoB,IAAQ,CAAEX,QAAS/C,CAAAA,CAAAA,CAAAA,EAPRkD,+BAQZR,UAAA,kBAAA,CAAA,EAGIJ,EAAA,CADHC,EAAAA,SAAS,CAAEC,KAAMC,OAAQI,UAAS,CAAA,CAAA,EAVvBK,+BAWRR,UAAA,cAAA,CAAA,EAmBJJ,EAAA,CADCC,EAAAA,SAAS,CAAEC,KAAMC,OAAQI,UAAS,CAAA,CAAA,EA7BvBK,+BA8BZR,UAAA,MAAA,CAAA,EA9BYQ,QAAAA,uBAANZ,EAAA,CADNW,EAAAA,cAAc,0BAAA,CAAA,EACFC"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { c as
|
|
1
|
+
import { c as f } from "./consume-5D1qfVWM.js";
|
|
2
2
|
import { css as m, html as c } from "lit";
|
|
3
3
|
import { property as l, state as S, customElement as y } from "lit/decorators.js";
|
|
4
|
-
import { when as
|
|
4
|
+
import { when as d } from "lit/directives/when.js";
|
|
5
5
|
import { $ as b } from "./litElement.mixin-D0rbA0NW.js";
|
|
6
6
|
import { n as v, e as x } from "./provide-tcktw8xB.js";
|
|
7
|
-
import { BehaviorSubject as
|
|
8
|
-
class
|
|
7
|
+
import { BehaviorSubject as $ } from "rxjs";
|
|
8
|
+
class k {
|
|
9
9
|
constructor() {
|
|
10
|
-
this._currentStep = new
|
|
10
|
+
this._currentStep = new $(1);
|
|
11
11
|
}
|
|
12
12
|
get currentStep$() {
|
|
13
13
|
return this._currentStep.asObservable();
|
|
@@ -19,7 +19,7 @@ class $ {
|
|
|
19
19
|
this._currentStep.next(e);
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
|
-
const
|
|
22
|
+
const g = v(Symbol("SchmancyStepsContext"));
|
|
23
23
|
var C = Object.defineProperty, w = Object.getOwnPropertyDescriptor, p = (t, e, o, s) => {
|
|
24
24
|
for (var i, r = s > 1 ? void 0 : s ? w(e, o) : e, n = t.length - 1; n >= 0; n--) (i = t[n]) && (r = (s ? i(e, o, r) : i(r)) || r);
|
|
25
25
|
return s && r && C(e, o, r), r;
|
|
@@ -56,12 +56,13 @@ let a = class extends b(m`
|
|
|
56
56
|
this.lockBack && this.position < this.steps.currentStep || this.status !== "upcoming" && this.steps.setStep(this.position);
|
|
57
57
|
}
|
|
58
58
|
render() {
|
|
59
|
-
const t = this.position === this.currentStep, e = this.status === "complete", o = this.status === "upcoming", s = { "bg-tertiary-default": e, "bg-outline-variant": !e }, i = { "relative border-solid z-10 flex size-8 items-center justify-center rounded-full transition-all duration-200": !0, "bg-tertiary-default text-tertiary-on shadow-md group-hover:shadow-lg": e, "border-2 border-primary-default bg-primary-container text-primary-onContainer shadow-sm": !e && t, "border-2 border-outline bg-surface text-surface-onVariant group-hover:border-primary-default group-hover:bg-primary-container": o }, r = { "text-primary-default font-medium": t, "text-tertiary-default": e, "text-surface-onVariant": o }, n = t || e ? "cursor-pointer" : "";
|
|
59
|
+
const t = this.position === this.currentStep, e = this.status === "complete", o = this.status === "upcoming", s = { "bg-tertiary-default": e, "bg-outline-variant": !e }, i = { "relative border-solid z-10 flex size-8 items-center justify-center rounded-full transition-all duration-200": !0, "bg-tertiary-default text-tertiary-on shadow-md group-hover:shadow-lg": e, "border-2 border-primary-default bg-primary-container text-primary-onContainer shadow-sm": !e && t, "border-2 border-outline bg-surface-default text-surface-onVariant group-hover:border-primary-default group-hover:bg-primary-container": o }, r = { "text-primary-default font-medium": t, "text-tertiary-default": e, "text-surface-onVariant": o }, n = t || e ? "cursor-pointer" : "";
|
|
60
60
|
return c`
|
|
61
61
|
<li class="relative">
|
|
62
62
|
<!-- Connector line -->
|
|
63
63
|
<div
|
|
64
|
-
class="absolute top-8 left-4 -ml-px
|
|
64
|
+
class="absolute top-8 left-4 -ml-px w-0.5 transition-colors duration-200 ${this.classMap(s)}"
|
|
65
|
+
style="height: calc(100% + var(--steps-gap, 0px))"
|
|
65
66
|
aria-hidden="true"
|
|
66
67
|
></div>
|
|
67
68
|
|
|
@@ -69,7 +70,7 @@ let a = class extends b(m`
|
|
|
69
70
|
<button
|
|
70
71
|
type="button"
|
|
71
72
|
@click=${this._onStepClick}
|
|
72
|
-
class="relative flex items-
|
|
73
|
+
class="relative flex items-center group transition-all duration-200 hover:scale-[1.02] ${n} ${t ? "bg-primary-container/20 -mx-2 px-2 py-3 rounded-lg" : "py-2"}"
|
|
73
74
|
>
|
|
74
75
|
<span class="flex items-center h-12">
|
|
75
76
|
<span class=${this.classMap(i)}>
|
|
@@ -89,11 +90,11 @@ let a = class extends b(m`
|
|
|
89
90
|
</span>
|
|
90
91
|
</span>
|
|
91
92
|
|
|
92
|
-
<span class="flex flex-col items-start min-w-0 ml-6">
|
|
93
|
+
<span class="flex flex-col items-start justify-center min-w-0 ml-6">
|
|
93
94
|
<schmancy-typography type="title" token="md">
|
|
94
95
|
<span class="transition-colors duration-200 ${this.classMap(r)}">${this.title}</span>
|
|
95
96
|
</schmancy-typography>
|
|
96
|
-
${
|
|
97
|
+
${d(this.description, () => c`
|
|
97
98
|
<schmancy-typography type="body" token="sm" class="mt-1">
|
|
98
99
|
<span class="text-surface-onVariant transition-colors duration-200 ${t ? "text-primary-onContainer" : ""}">${this.description}</span>
|
|
99
100
|
</schmancy-typography>
|
|
@@ -102,7 +103,7 @@ let a = class extends b(m`
|
|
|
102
103
|
</button>
|
|
103
104
|
|
|
104
105
|
<!-- Render step content if the step is active, with enhanced spacing -->
|
|
105
|
-
${
|
|
106
|
+
${d(t, () => c`
|
|
106
107
|
<div class="ml-10 mt-4 pb-8 transition-all duration-300 ease-out">
|
|
107
108
|
<div class="pl-4 border-l-2 border-primary-default/20">
|
|
108
109
|
<slot></slot>
|
|
@@ -113,8 +114,8 @@ let a = class extends b(m`
|
|
|
113
114
|
`;
|
|
114
115
|
}
|
|
115
116
|
};
|
|
116
|
-
p([l({ type: Number })], a.prototype, "position", 2), p([l({ type: String })], a.prototype, "title", 2), p([l({ type: String })], a.prototype, "description", 2), p([l({ type: Boolean, reflect: !0 })], a.prototype, "completed", 2), p([l({ type: Boolean })], a.prototype, "lockBack", 2), p([
|
|
117
|
-
var _ = Object.defineProperty, B = Object.getOwnPropertyDescriptor,
|
|
117
|
+
p([l({ type: Number })], a.prototype, "position", 2), p([l({ type: String })], a.prototype, "title", 2), p([l({ type: String })], a.prototype, "description", 2), p([l({ type: Boolean, reflect: !0 })], a.prototype, "completed", 2), p([l({ type: Boolean })], a.prototype, "lockBack", 2), p([f({ context: g })], a.prototype, "steps", 2), p([S()], a.prototype, "currentStep", 2), a = p([y("schmancy-step")], a);
|
|
118
|
+
var _ = Object.defineProperty, B = Object.getOwnPropertyDescriptor, h = (t, e, o, s) => {
|
|
118
119
|
for (var i, r = s > 1 ? void 0 : s ? B(e, o) : e, n = t.length - 1; n >= 0; n--) (i = t[n]) && (r = (s ? i(e, o, r) : i(r)) || r);
|
|
119
120
|
return s && r && _(e, o, r), r;
|
|
120
121
|
};
|
|
@@ -124,7 +125,7 @@ let u = class extends b(m`
|
|
|
124
125
|
}
|
|
125
126
|
`) {
|
|
126
127
|
constructor() {
|
|
127
|
-
super(...arguments), this.controller = new
|
|
128
|
+
super(...arguments), this.controller = new k(), this.stepsController = this.controller, this._currentStep = 1, this.gap = 4;
|
|
128
129
|
}
|
|
129
130
|
set currentStep(t) {
|
|
130
131
|
const e = this._currentStep;
|
|
@@ -137,21 +138,21 @@ let u = class extends b(m`
|
|
|
137
138
|
super.connectedCallback(), this.controller.setStep(this.currentStep);
|
|
138
139
|
}
|
|
139
140
|
render() {
|
|
140
|
-
const t = `gap-${this.gap}
|
|
141
|
+
const t = `gap-${this.gap}`, e = { 0: "0", 1: "0.25rem", 2: "0.5rem", 3: "0.75rem", 4: "1rem", 5: "1.25rem", 6: "1.5rem", 8: "2rem", 10: "2.5rem", 12: "3rem", 16: "4rem", 20: "5rem", 24: "6rem" }[this.gap] || "1rem";
|
|
141
142
|
return c`
|
|
142
143
|
<nav class="flex h-full w-full" aria-label="Progress">
|
|
143
|
-
<ol class="flex flex-col flex-1 ${t}" role="list">
|
|
144
|
+
<ol class="flex flex-col flex-1 ${t}" role="list" style="--steps-gap: ${e}">
|
|
144
145
|
<slot></slot>
|
|
145
146
|
</ol>
|
|
146
147
|
</nav>
|
|
147
148
|
`;
|
|
148
149
|
}
|
|
149
150
|
};
|
|
150
|
-
|
|
151
|
+
h([x({ context: g })], u.prototype, "stepsController", 2), h([l({ type: Number, reflect: !0 })], u.prototype, "currentStep", 1), h([l({ type: Number, reflect: !0 })], u.prototype, "gap", 2), u = h([y("schmancy-steps-container")], u);
|
|
151
152
|
export {
|
|
152
153
|
a as S,
|
|
153
154
|
u as a,
|
|
154
|
-
|
|
155
|
-
|
|
155
|
+
k as b,
|
|
156
|
+
g as s
|
|
156
157
|
};
|
|
157
|
-
//# sourceMappingURL=schmancy-steps-container-
|
|
158
|
+
//# sourceMappingURL=schmancy-steps-container-Be0uKWP8.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schmancy-steps-container-Be0uKWP8.js","sources":["../src/steps/steps.context.ts","../src/steps/schmancy-step.ts","../src/steps/schmancy-steps-container.ts"],"sourcesContent":["import { createContext } from '@lit/context'\nimport { BehaviorSubject } from 'rxjs'\n\nexport class StepsController {\n\tprivate _currentStep = new BehaviorSubject(1)\n\n\tget currentStep$() {\n\t\treturn this._currentStep.asObservable()\n\t}\n\n\tget currentStep() {\n\t\treturn this._currentStep.value\n\t}\n\n\tsetStep(step: number) {\n\t\tthis._currentStep.next(step)\n\t}\n}\n\n/**\n * The actual context object. We provide/consume this in the container and steps.\n */\nexport const stepsContext = createContext<StepsController>(Symbol('SchmancyStepsContext'))\n","import { consume } from '@lit/context'\nimport { css, html } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\nimport { when } from 'lit/directives/when.js'\nimport { Subscription } from 'rxjs'\nimport { stepsContext, StepsController } from './steps.context'\nimport { $LitElement } from '@mixins/litElement.mixin'\n\n@customElement('schmancy-step')\nexport class SchmancyStep extends $LitElement(css`\n\t:host {\n\t\tdisplay: grid;\n\t\t/* Base display is just grid, flex properties will be applied dynamically */\n\t\ttransition: all 0.2s ease-in-out;\n\t}\n`) {\n\t/**\n\t * The step's position (1-based). This is used to compare against\n\t * the container's current step to decide if it's \"complete\",\n\t * \"current\", or \"upcoming\".\n\t */\n\t@property({ type: Number }) position = 1\n\n\t@property({ type: String }) title = ''\n\t@property({ type: String }) description = ''\n\n\t// NEW: Allow a step to be explicitly marked as complete.\n\t@property({ type: Boolean, reflect: true }) completed = false\n\n\t/**\n\t * NEW: Lock API to disable users from going back.\n\t * When set to true, clicking on a previous (completed) step is ignored.\n\t */\n\t@property({ type: Boolean }) lockBack = false\n\n\t/**\n\t * Consume the shared StepsController from context.\n\t */\n\t@consume({ context: stepsContext })\n\tprivate steps!: StepsController\n\n\t/**\n\t * Local reactive copy of the container's current step number.\n\t */\n\t@state()\n\tprivate currentStep = 1\n\n\t/**\n\t * Keep a reference to our subscription so we can unsubscribe cleanly.\n\t */\n\tprivate subscription?: Subscription\n\n\tconnectedCallback() {\n\t\tsuper.connectedCallback()\n\t}\n\n\tfirstUpdated() {\n\t\t// Subscribe to updates from the container's StepsController.\n\t\t// Context is guaranteed to be available after first render\n\t\tthis.subscription = this.steps.currentStep$.subscribe(step => {\n\t\t\tthis.currentStep = step\n\t\t\t// When the current step changes, update the flex properties\n\t\t\tthis.updateFlexProperties()\n\t\t})\n\t\t// Initial update of flex properties\n\t\tthis.updateFlexProperties()\n\t}\n\n\tdisconnectedCallback(): void {\n\t\tthis.subscription?.unsubscribe()\n\t\tsuper.disconnectedCallback()\n\t}\n\n\t/**\n\t * Update the host element's flex properties based on active state\n\t */\n\tprivate updateFlexProperties() {\n\t\tconst isActive = this.position === this.currentStep\n\n\t\tif (isActive) {\n\t\t\t// Apply flex-grow when active\n\t\t\tthis.style.flex = '1 1 auto'\n\t\t} else {\n\t\t\t// Make it shrink when not active\n\t\t\tthis.style.flex = '0 0 auto'\n\t\t}\n\t}\n\n\t/**\n\t * Compute visual status for styling purposes. Note that if a step is explicitly\n\t * marked as completed, it always appears as complete even if it's active.\n\t */\n\tget status(): 'complete' | 'current' | 'upcoming' {\n\t\tif (this.completed || this.position < this.steps.currentStep) return 'complete'\n\t\tif (this.position === this.steps.currentStep) return 'current'\n\t\treturn 'upcoming'\n\t}\n\n\t/**\n\t * Click handler to allow navigation between completed (or active) steps.\n\t * With lockBack enabled, clicking on a previous step is ignored.\n\t */\n\tprivate _onStepClick(_e: Event) {\n\t\t// If lockBack is enabled and the user attempts to go back, do nothing.\n\t\tif (this.lockBack && this.position < this.steps.currentStep) {\n\t\t\treturn\n\t\t}\n\t\tif (this.status !== 'upcoming') {\n\t\t\tthis.steps.setStep(this.position)\n\t\t}\n\t}\n\n\trender() {\n\t\t// Determine if the step is currently active.\n\t\tconst isActive = this.position === this.currentStep\n\n\t\t// Use computed status for visual styling.\n\t\tconst isComplete = this.status === 'complete'\n\t\tconst isUpcoming = this.status === 'upcoming'\n\n\t\t// Enhanced styling classes with better visual hierarchy\n\t\tconst connectorClasses = {\n\t\t\t'bg-tertiary-default': isComplete,\n\t\t\t'bg-outline-variant': !isComplete,\n\t\t}\n\n\t\tconst iconContainerClasses = {\n\t\t\t'relative border-solid z-10 flex size-8 items-center justify-center rounded-full transition-all duration-200': true,\n\t\t\t'bg-tertiary-default text-tertiary-on shadow-md group-hover:shadow-lg': isComplete,\n\t\t\t'border-2 border-primary-default bg-primary-container text-primary-onContainer shadow-sm': !isComplete && isActive,\n\t\t\t'border-2 border-outline bg-surface-default text-surface-onVariant group-hover:border-primary-default group-hover:bg-primary-container': isUpcoming,\n\t\t}\n\n\t\tconst textClasses = {\n\t\t\t'text-primary-default font-medium': isActive,\n\t\t\t'text-tertiary-default': isComplete,\n\t\t\t'text-surface-onVariant': isUpcoming,\n\t\t}\n\n\t\t// If the step is clickable (active or complete), add a pointer cursor.\n\t\tconst clickableClass = isActive || isComplete ? 'cursor-pointer' : ''\n\n\t\treturn html`\n\t\t\t<li class=\"relative\">\n\t\t\t\t<!-- Connector line -->\n\t\t\t\t<div\n\t\t\t\t\tclass=\"absolute top-8 left-4 -ml-px w-0.5 transition-colors duration-200 ${this.classMap(connectorClasses)}\"\n\t\t\t\t\tstyle=\"height: calc(100% + var(--steps-gap, 0px))\"\n\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t></div>\n\n\t\t\t\t<!-- Step Button/Label -->\n\t\t\t\t<button \n\t\t\t\t\ttype=\"button\" \n\t\t\t\t\t@click=${this._onStepClick} \n\t\t\t\t\tclass=\"relative flex items-center group transition-all duration-200 hover:scale-[1.02] ${clickableClass} ${isActive ? 'bg-primary-container/20 -mx-2 px-2 py-3 rounded-lg' : 'py-2'}\"\n\t\t\t\t>\n\t\t\t\t\t<span class=\"flex items-center h-12\">\n\t\t\t\t\t\t<span class=${this.classMap(iconContainerClasses)}>\n\t\t\t\t\t\t\t${isComplete\n\t\t\t\t\t\t\t\t? html`\n\t\t\t\t\t\t\t\t\t\t<svg class=\"size-5 transition-transform duration-200 group-hover:scale-110\" viewBox=\"0 0 20 20\" fill=\"currentColor\" aria-hidden=\"true\">\n\t\t\t\t\t\t\t\t\t\t\t<path\n\t\t\t\t\t\t\t\t\t\t\t\tfill-rule=\"evenodd\"\n\t\t\t\t\t\t\t\t\t\t\t\td=\"M16.704 4.153a.75.75 0 0 1 .143 1.052l-8 10.5a.75.75 0 0 1-1.127.075l-4.5-4.5a.75.75 0 0 1 1.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 0 1 1.05-.143Z\"\n\t\t\t\t\t\t\t\t\t\t\t\tclip-rule=\"evenodd\"\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t</svg>\n\t\t\t\t\t\t\t\t\t`\n\t\t\t\t\t\t\t\t: html`\n\t\t\t\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t\t\t\tclass=\"size-3 rounded-full transition-all duration-200 ${isActive\n\t\t\t\t\t\t\t\t\t\t\t\t? 'bg-primary-onContainer'\n\t\t\t\t\t\t\t\t\t\t\t\t: 'bg-transparent group-hover:bg-primary-default group-hover:scale-125'}\"\n\t\t\t\t\t\t\t\t\t\t></span>\n\t\t\t\t\t\t\t\t\t`}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</span>\n\n\t\t\t\t\t<span class=\"flex flex-col items-start justify-center min-w-0 ml-6\">\n\t\t\t\t\t\t<schmancy-typography type=\"title\" token=\"md\">\n\t\t\t\t\t\t\t<span class=\"transition-colors duration-200 ${this.classMap(textClasses)}\">${this.title}</span>\n\t\t\t\t\t\t</schmancy-typography>\n\t\t\t\t\t\t${when(\n\t\t\t\t\t\t\tthis.description,\n\t\t\t\t\t\t\t() => html`\n\t\t\t\t\t\t\t\t<schmancy-typography type=\"body\" token=\"sm\" class=\"mt-1\">\n\t\t\t\t\t\t\t\t\t<span class=\"text-surface-onVariant transition-colors duration-200 ${isActive ? 'text-primary-onContainer' : ''}\">${this.description}</span>\n\t\t\t\t\t\t\t\t</schmancy-typography>\n\t\t\t\t\t\t\t`,\n\t\t\t\t\t\t)}\n\t\t\t\t\t</span>\n\t\t\t\t</button>\n\n\t\t\t\t<!-- Render step content if the step is active, with enhanced spacing -->\n\t\t\t\t${when(\n\t\t\t\t\tisActive,\n\t\t\t\t\t() => html`\n\t\t\t\t\t\t<div class=\"ml-10 mt-4 pb-8 transition-all duration-300 ease-out\">\n\t\t\t\t\t\t\t<div class=\"pl-4 border-l-2 border-primary-default/20\">\n\t\t\t\t\t\t\t\t<slot></slot>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t`,\n\t\t\t\t)}\n\t\t\t</li>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-step': SchmancyStep\n\t}\n}\n","import { provide } from '@lit/context'\nimport { $LitElement } from '@mixins/litElement.mixin'\nimport { css, html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport { StepsController, stepsContext } from './steps.context'\n\n@customElement('schmancy-steps-container')\nexport class SchmancyStepsContainer extends $LitElement(css`\n\t:host {\n\t\tdisplay: block;\n\t}\n`) {\n\tprivate controller = new StepsController()\n\n\t@provide({ context: stepsContext })\n\tstepsController = this.controller\n\n\t@property({ type: Number, reflect: true })\n\tset currentStep(value: number) {\n\t\tconst oldValue = this._currentStep\n\t\tthis._currentStep = value\n\t\tthis.controller.setStep(value)\n\t\tthis.requestUpdate('currentStep', oldValue)\n\t}\n\n\tget currentStep(): number {\n\t\treturn this._currentStep\n\t}\n\n\tprivate _currentStep = 1\n\n\t/**\n\t * Gap between steps. Maps to Tailwind gap classes.\n\t * Options: 0, 1, 2, 3, 4, 5, 6, 8, 10, 12, 16, 20, 24\n\t * @default 4\n\t */\n\t@property({ type: Number, reflect: true })\n\tgap: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 8 | 10 | 12 | 16 | 20 | 24 = 4\n\n\tconnectedCallback() {\n\t\tsuper.connectedCallback()\n\t\tthis.controller.setStep(this.currentStep)\n\t}\n\n\trender() {\n\t\t// Map gap value to Tailwind gap class\n\t\tconst gapClass = `gap-${this.gap}`\n\t\t\n\t\t// Map gap value to actual rem value for CSS custom property\n\t\t// Tailwind gap scale: 1 = 0.25rem, 2 = 0.5rem, etc.\n\t\tconst gapRem = {\n\t\t\t0: '0',\n\t\t\t1: '0.25rem',\n\t\t\t2: '0.5rem',\n\t\t\t3: '0.75rem',\n\t\t\t4: '1rem',\n\t\t\t5: '1.25rem',\n\t\t\t6: '1.5rem',\n\t\t\t8: '2rem',\n\t\t\t10: '2.5rem',\n\t\t\t12: '3rem',\n\t\t\t16: '4rem',\n\t\t\t20: '5rem',\n\t\t\t24: '6rem'\n\t\t}[this.gap] || '1rem'\n\t\t\n\t\treturn html`\n\t\t\t<nav class=\"flex h-full w-full\" aria-label=\"Progress\">\n\t\t\t\t<ol class=\"flex flex-col flex-1 ${gapClass}\" role=\"list\" style=\"--steps-gap: ${gapRem}\">\n\t\t\t\t\t<slot></slot>\n\t\t\t\t</ol>\n\t\t\t</nav>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-steps-container': SchmancyStepsContainer\n\t}\n}\n"],"names":["StepsController","constructor","this","_currentStep","BehaviorSubject","currentStep$","asObservable","currentStep","value","step","next","stepsContext","createContext","Symbol","SchmancyStep","$LitElement","css","super","arguments","position","title","description","completed","lockBack","connectedCallback","firstUpdated","subscription","steps","subscribe","updateFlexProperties","disconnectedCallback","unsubscribe","isActive","style","flex","_e","status","setStep","render","isComplete","isUpcoming","connectorClasses","iconContainerClasses","textClasses","clickableClass","html","classMap","_onStepClick","when","__decorateClass","property","type","Number","prototype","String","Boolean","reflect","consume","context","state","customElement","SchmancyStepsContainer","controller","stepsController","gap","oldValue","requestUpdate","gapClass","gapRem","provide"],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,kBAAI1D;AACH,WAAOL,KAAKC;AAAAA,EACb;AAAA,EAYA,oBAAAqB;AACCP,UAAMO,qBACNtB,KAAK4D,WAAWzB,QAAQnC,KAAKK,WAAAA;AAAAA,EAC9B;AAAA,EAEA,SAAA+B;AAEC,UAAM6B,IAAW,OAAOjE,KAAK8D,GAAAA,IAIvBI,IAAS,EACd,GAAG,KACH,GAAG,WACH,GAAG,UACH,GAAG,WACH,GAAG,QACH,GAAG,WACH,GAAG,UACH,GAAG,QACH,IAAI,UACJ,IAAI,QACJ,IAAI,QACJ,IAAI,QACJ,IAAI,OAAA,EACHlE,KAAK8D,GAAAA,KAAQ;AAEf,WAAOnB;AAAAA;AAAAA,sCAE6BsB,CAAAA,qCAA6CC,CAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA,EAKlF;AAAA;AA1DAnB,EAAA,CADCoB,EAAQ,EAAEX,SAAS/C,EAAAA,CAAAA,CAAAA,GAPRkD,EAQZR,WAAA,mBAAA,IAGIJ,EAAA,CADHC,EAAS,EAAEC,MAAMC,QAAQI,SAAAA,GAAS,CAAA,CAAA,GAVvBK,EAWRR,WAAA,eAAA,CAAA,GAmBJJ,EAAA,CADCC,EAAS,EAAEC,MAAMC,QAAQI,SAAAA,QA7BdK,EA8BZR,WAAA,OAAA,CAAA,GA9BYQ,IAANZ,EAAA,CADNW,EAAc,8BACFC,CAAAA;"}
|
package/dist/steps.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./schmancy-steps-container-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./schmancy-steps-container-BLLfmYBF.cjs");Object.defineProperty(exports,"SchmancyStep",{enumerable:!0,get:()=>e.SchmancyStep}),Object.defineProperty(exports,"SchmancyStepsContainer",{enumerable:!0,get:()=>e.SchmancyStepsContainer}),exports.StepsController=e.StepsController,exports.stepsContext=e.stepsContext;
|
|
2
2
|
//# sourceMappingURL=steps.cjs.map
|
package/dist/steps.js
CHANGED
package/dist/teleport.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./avatar-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./avatar-cIIj5C23.cjs");exports.HereMorty=e.HereMorty,Object.defineProperty(exports,"SchmancyTeleportation",{enumerable:!0,get:()=>e.SchmancyTeleportation}),exports.WhereAreYouRicky=e.WhereAreYouRicky,exports.teleport=e.teleport;
|
|
2
2
|
//# sourceMappingURL=teleport.cjs.map
|
package/dist/teleport.js
CHANGED
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"schmancy-steps-container-B05_VYrQ.js","sources":["../src/steps/steps.context.ts","../src/steps/schmancy-step.ts","../src/steps/schmancy-steps-container.ts"],"sourcesContent":["import { createContext } from '@lit/context'\nimport { BehaviorSubject } from 'rxjs'\n\nexport class StepsController {\n\tprivate _currentStep = new BehaviorSubject(1)\n\n\tget currentStep$() {\n\t\treturn this._currentStep.asObservable()\n\t}\n\n\tget currentStep() {\n\t\treturn this._currentStep.value\n\t}\n\n\tsetStep(step: number) {\n\t\tthis._currentStep.next(step)\n\t}\n}\n\n/**\n * The actual context object. We provide/consume this in the container and steps.\n */\nexport const stepsContext = createContext<StepsController>(Symbol('SchmancyStepsContext'))\n","import { consume } from '@lit/context'\nimport { css, html } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\nimport { when } from 'lit/directives/when.js'\nimport { Subscription } from 'rxjs'\nimport { stepsContext, StepsController } from './steps.context'\nimport { $LitElement } from '@mixins/litElement.mixin'\n\n@customElement('schmancy-step')\nexport class SchmancyStep extends $LitElement(css`\n\t:host {\n\t\tdisplay: grid;\n\t\t/* Base display is just grid, flex properties will be applied dynamically */\n\t\ttransition: all 0.2s ease-in-out;\n\t}\n`) {\n\t/**\n\t * The step's position (1-based). This is used to compare against\n\t * the container's current step to decide if it's \"complete\",\n\t * \"current\", or \"upcoming\".\n\t */\n\t@property({ type: Number }) position = 1\n\n\t@property({ type: String }) title = ''\n\t@property({ type: String }) description = ''\n\n\t// NEW: Allow a step to be explicitly marked as complete.\n\t@property({ type: Boolean, reflect: true }) completed = false\n\n\t/**\n\t * NEW: Lock API to disable users from going back.\n\t * When set to true, clicking on a previous (completed) step is ignored.\n\t */\n\t@property({ type: Boolean }) lockBack = false\n\n\t/**\n\t * Consume the shared StepsController from context.\n\t */\n\t@consume({ context: stepsContext })\n\tprivate steps!: StepsController\n\n\t/**\n\t * Local reactive copy of the container's current step number.\n\t */\n\t@state()\n\tprivate currentStep = 1\n\n\t/**\n\t * Keep a reference to our subscription so we can unsubscribe cleanly.\n\t */\n\tprivate subscription?: Subscription\n\n\tconnectedCallback() {\n\t\tsuper.connectedCallback()\n\t}\n\n\tfirstUpdated() {\n\t\t// Subscribe to updates from the container's StepsController.\n\t\t// Context is guaranteed to be available after first render\n\t\tthis.subscription = this.steps.currentStep$.subscribe(step => {\n\t\t\tthis.currentStep = step\n\t\t\t// When the current step changes, update the flex properties\n\t\t\tthis.updateFlexProperties()\n\t\t})\n\t\t// Initial update of flex properties\n\t\tthis.updateFlexProperties()\n\t}\n\n\tdisconnectedCallback(): void {\n\t\tthis.subscription?.unsubscribe()\n\t\tsuper.disconnectedCallback()\n\t}\n\n\t/**\n\t * Update the host element's flex properties based on active state\n\t */\n\tprivate updateFlexProperties() {\n\t\tconst isActive = this.position === this.currentStep\n\n\t\tif (isActive) {\n\t\t\t// Apply flex-grow when active\n\t\t\tthis.style.flex = '1 1 auto'\n\t\t} else {\n\t\t\t// Make it shrink when not active\n\t\t\tthis.style.flex = '0 0 auto'\n\t\t}\n\t}\n\n\t/**\n\t * Compute visual status for styling purposes. Note that if a step is explicitly\n\t * marked as completed, it always appears as complete even if it's active.\n\t */\n\tget status(): 'complete' | 'current' | 'upcoming' {\n\t\tif (this.completed || this.position < this.steps.currentStep) return 'complete'\n\t\tif (this.position === this.steps.currentStep) return 'current'\n\t\treturn 'upcoming'\n\t}\n\n\t/**\n\t * Click handler to allow navigation between completed (or active) steps.\n\t * With lockBack enabled, clicking on a previous step is ignored.\n\t */\n\tprivate _onStepClick(_e: Event) {\n\t\t// If lockBack is enabled and the user attempts to go back, do nothing.\n\t\tif (this.lockBack && this.position < this.steps.currentStep) {\n\t\t\treturn\n\t\t}\n\t\tif (this.status !== 'upcoming') {\n\t\t\tthis.steps.setStep(this.position)\n\t\t}\n\t}\n\n\trender() {\n\t\t// Determine if the step is currently active.\n\t\tconst isActive = this.position === this.currentStep\n\n\t\t// Use computed status for visual styling.\n\t\tconst isComplete = this.status === 'complete'\n\t\tconst isUpcoming = this.status === 'upcoming'\n\n\t\t// Enhanced styling classes with better visual hierarchy\n\t\tconst connectorClasses = {\n\t\t\t'bg-tertiary-default': isComplete,\n\t\t\t'bg-outline-variant': !isComplete,\n\t\t}\n\n\t\tconst iconContainerClasses = {\n\t\t\t'relative border-solid z-10 flex size-8 items-center justify-center rounded-full transition-all duration-200': true,\n\t\t\t'bg-tertiary-default text-tertiary-on shadow-md group-hover:shadow-lg': isComplete,\n\t\t\t'border-2 border-primary-default bg-primary-container text-primary-onContainer shadow-sm': !isComplete && isActive,\n\t\t\t'border-2 border-outline bg-surface text-surface-onVariant group-hover:border-primary-default group-hover:bg-primary-container': isUpcoming,\n\t\t}\n\n\t\tconst textClasses = {\n\t\t\t'text-primary-default font-medium': isActive,\n\t\t\t'text-tertiary-default': isComplete,\n\t\t\t'text-surface-onVariant': isUpcoming,\n\t\t}\n\n\t\t// If the step is clickable (active or complete), add a pointer cursor.\n\t\tconst clickableClass = isActive || isComplete ? 'cursor-pointer' : ''\n\n\t\treturn html`\n\t\t\t<li class=\"relative\">\n\t\t\t\t<!-- Connector line -->\n\t\t\t\t<div\n\t\t\t\t\tclass=\"absolute top-8 left-4 -ml-px h-full w-0.5 transition-colors duration-200 ${this.classMap(connectorClasses)}\"\n\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t></div>\n\n\t\t\t\t<!-- Step Button/Label -->\n\t\t\t\t<button \n\t\t\t\t\ttype=\"button\" \n\t\t\t\t\t@click=${this._onStepClick} \n\t\t\t\t\tclass=\"relative flex items-start group transition-all duration-200 hover:scale-[1.02] ${clickableClass} ${isActive ? 'bg-primary-container/20 -mx-2 px-2 py-3 rounded-lg' : 'py-2'}\"\n\t\t\t\t>\n\t\t\t\t\t<span class=\"flex items-center h-12\">\n\t\t\t\t\t\t<span class=${this.classMap(iconContainerClasses)}>\n\t\t\t\t\t\t\t${isComplete\n\t\t\t\t\t\t\t\t? html`\n\t\t\t\t\t\t\t\t\t\t<svg class=\"size-5 transition-transform duration-200 group-hover:scale-110\" viewBox=\"0 0 20 20\" fill=\"currentColor\" aria-hidden=\"true\">\n\t\t\t\t\t\t\t\t\t\t\t<path\n\t\t\t\t\t\t\t\t\t\t\t\tfill-rule=\"evenodd\"\n\t\t\t\t\t\t\t\t\t\t\t\td=\"M16.704 4.153a.75.75 0 0 1 .143 1.052l-8 10.5a.75.75 0 0 1-1.127.075l-4.5-4.5a.75.75 0 0 1 1.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 0 1 1.05-.143Z\"\n\t\t\t\t\t\t\t\t\t\t\t\tclip-rule=\"evenodd\"\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t</svg>\n\t\t\t\t\t\t\t\t\t`\n\t\t\t\t\t\t\t\t: html`\n\t\t\t\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t\t\t\tclass=\"size-3 rounded-full transition-all duration-200 ${isActive\n\t\t\t\t\t\t\t\t\t\t\t\t? 'bg-primary-onContainer'\n\t\t\t\t\t\t\t\t\t\t\t\t: 'bg-transparent group-hover:bg-primary-default group-hover:scale-125'}\"\n\t\t\t\t\t\t\t\t\t\t></span>\n\t\t\t\t\t\t\t\t\t`}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</span>\n\n\t\t\t\t\t<span class=\"flex flex-col items-start min-w-0 ml-6\">\n\t\t\t\t\t\t<schmancy-typography type=\"title\" token=\"md\">\n\t\t\t\t\t\t\t<span class=\"transition-colors duration-200 ${this.classMap(textClasses)}\">${this.title}</span>\n\t\t\t\t\t\t</schmancy-typography>\n\t\t\t\t\t\t${when(\n\t\t\t\t\t\t\tthis.description,\n\t\t\t\t\t\t\t() => html`\n\t\t\t\t\t\t\t\t<schmancy-typography type=\"body\" token=\"sm\" class=\"mt-1\">\n\t\t\t\t\t\t\t\t\t<span class=\"text-surface-onVariant transition-colors duration-200 ${isActive ? 'text-primary-onContainer' : ''}\">${this.description}</span>\n\t\t\t\t\t\t\t\t</schmancy-typography>\n\t\t\t\t\t\t\t`,\n\t\t\t\t\t\t)}\n\t\t\t\t\t</span>\n\t\t\t\t</button>\n\n\t\t\t\t<!-- Render step content if the step is active, with enhanced spacing -->\n\t\t\t\t${when(\n\t\t\t\t\tisActive,\n\t\t\t\t\t() => html`\n\t\t\t\t\t\t<div class=\"ml-10 mt-4 pb-8 transition-all duration-300 ease-out\">\n\t\t\t\t\t\t\t<div class=\"pl-4 border-l-2 border-primary-default/20\">\n\t\t\t\t\t\t\t\t<slot></slot>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t`,\n\t\t\t\t)}\n\t\t\t</li>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-step': SchmancyStep\n\t}\n}\n","import { provide } from '@lit/context'\nimport { $LitElement } from '@mixins/litElement.mixin'\nimport { css, html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport { StepsController, stepsContext } from './steps.context'\n\n@customElement('schmancy-steps-container')\nexport class SchmancyStepsContainer extends $LitElement(css`\n\t:host {\n\t\tdisplay: block;\n\t}\n`) {\n\tprivate controller = new StepsController()\n\n\t@provide({ context: stepsContext })\n\tstepsController = this.controller\n\n\t@property({ type: Number, reflect: true })\n\tset currentStep(value: number) {\n\t\tconst oldValue = this._currentStep\n\t\tthis._currentStep = value\n\t\tthis.controller.setStep(value)\n\t\tthis.requestUpdate('currentStep', oldValue)\n\t}\n\n\tget currentStep(): number {\n\t\treturn this._currentStep\n\t}\n\n\tprivate _currentStep = 1\n\n\t/**\n\t * Gap between steps. Maps to Tailwind gap classes.\n\t * Options: 0, 1, 2, 3, 4, 5, 6, 8, 10, 12, 16, 20, 24\n\t * @default 4\n\t */\n\t@property({ type: Number, reflect: true })\n\tgap: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 8 | 10 | 12 | 16 | 20 | 24 = 4\n\n\tconnectedCallback() {\n\t\tsuper.connectedCallback()\n\t\tthis.controller.setStep(this.currentStep)\n\t}\n\n\trender() {\n\t\t// Map gap value to Tailwind gap class\n\t\tconst gapClass = `gap-${this.gap}`\n\t\t\n\t\treturn html`\n\t\t\t<nav class=\"flex h-full w-full\" aria-label=\"Progress\">\n\t\t\t\t<ol class=\"flex flex-col flex-1 ${gapClass}\" role=\"list\">\n\t\t\t\t\t<slot></slot>\n\t\t\t\t</ol>\n\t\t\t</nav>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-steps-container': SchmancyStepsContainer\n\t}\n}\n"],"names":["StepsController","constructor","this","_currentStep","BehaviorSubject","currentStep$","asObservable","currentStep","value","step","next","stepsContext","createContext","Symbol","SchmancyStep","$LitElement","css","super","arguments","position","title","description","completed","lockBack","connectedCallback","firstUpdated","subscription","steps","subscribe","updateFlexProperties","disconnectedCallback","unsubscribe","isActive","style","flex","_e","status","setStep","render","isComplete","isUpcoming","connectorClasses","iconContainerClasses","textClasses","clickableClass","html","classMap","_onStepClick","when","__decorateClass","property","type","Number","prototype","String","Boolean","reflect","consume","context","state","customElement","SchmancyStepsContainer","controller","stepsController","gap","oldValue","requestUpdate","gapClass","provide"],"mappings":";;;;;;;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AAAA,EAEA,IAAA,cAAI1D;AACH,WAAOL,KAAKC;AAAAA,EACb;AAAA,EAYA,oBAAAqB;AACCP,UAAMO,kBAAAA,GACNtB,KAAK4D,WAAWzB,QAAQnC,KAAKK,WAAAA;AAAAA,EAC9B;AAAA,EAEA,SAAA+B;AAEC,UAAM6B,IAAW,OAAOjE,KAAK8D,GAAAA;AAE7B,WAAOnB;AAAAA;AAAAA,sCAE6BsB,CAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA,EAKrC;AAAA;AAxCAlB,EAAA,CADCmB,EAAQ,EAAEV,SAAS/C,EAAAA,CAAAA,CAAAA,GAPRkD,EAQZR,WAAA,mBAAA,IAGIJ,EAAA,CADHC,EAAS,EAAEC,MAAMC,QAAQI,SAAAA,GAAS,CAAA,CAAA,GAVvBK,EAWRR,WAAA,eAAA,CAAA,GAmBJJ,EAAA,CADCC,EAAS,EAAEC,MAAMC,QAAQI,SAAAA,QA7BdK,EA8BZR,WAAA,OAAA,CAAA,GA9BYQ,IAANZ,EAAA,CADNW,EAAc,8BACFC,CAAAA;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"schmancy-steps-container-cDZHQ4QA.cjs","sources":["../src/steps/steps.context.ts","../src/steps/schmancy-step.ts","../src/steps/schmancy-steps-container.ts"],"sourcesContent":["import { createContext } from '@lit/context'\nimport { BehaviorSubject } from 'rxjs'\n\nexport class StepsController {\n\tprivate _currentStep = new BehaviorSubject(1)\n\n\tget currentStep$() {\n\t\treturn this._currentStep.asObservable()\n\t}\n\n\tget currentStep() {\n\t\treturn this._currentStep.value\n\t}\n\n\tsetStep(step: number) {\n\t\tthis._currentStep.next(step)\n\t}\n}\n\n/**\n * The actual context object. We provide/consume this in the container and steps.\n */\nexport const stepsContext = createContext<StepsController>(Symbol('SchmancyStepsContext'))\n","import { consume } from '@lit/context'\nimport { css, html } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\nimport { when } from 'lit/directives/when.js'\nimport { Subscription } from 'rxjs'\nimport { stepsContext, StepsController } from './steps.context'\nimport { $LitElement } from '@mixins/litElement.mixin'\n\n@customElement('schmancy-step')\nexport class SchmancyStep extends $LitElement(css`\n\t:host {\n\t\tdisplay: grid;\n\t\t/* Base display is just grid, flex properties will be applied dynamically */\n\t\ttransition: all 0.2s ease-in-out;\n\t}\n`) {\n\t/**\n\t * The step's position (1-based). This is used to compare against\n\t * the container's current step to decide if it's \"complete\",\n\t * \"current\", or \"upcoming\".\n\t */\n\t@property({ type: Number }) position = 1\n\n\t@property({ type: String }) title = ''\n\t@property({ type: String }) description = ''\n\n\t// NEW: Allow a step to be explicitly marked as complete.\n\t@property({ type: Boolean, reflect: true }) completed = false\n\n\t/**\n\t * NEW: Lock API to disable users from going back.\n\t * When set to true, clicking on a previous (completed) step is ignored.\n\t */\n\t@property({ type: Boolean }) lockBack = false\n\n\t/**\n\t * Consume the shared StepsController from context.\n\t */\n\t@consume({ context: stepsContext })\n\tprivate steps!: StepsController\n\n\t/**\n\t * Local reactive copy of the container's current step number.\n\t */\n\t@state()\n\tprivate currentStep = 1\n\n\t/**\n\t * Keep a reference to our subscription so we can unsubscribe cleanly.\n\t */\n\tprivate subscription?: Subscription\n\n\tconnectedCallback() {\n\t\tsuper.connectedCallback()\n\t}\n\n\tfirstUpdated() {\n\t\t// Subscribe to updates from the container's StepsController.\n\t\t// Context is guaranteed to be available after first render\n\t\tthis.subscription = this.steps.currentStep$.subscribe(step => {\n\t\t\tthis.currentStep = step\n\t\t\t// When the current step changes, update the flex properties\n\t\t\tthis.updateFlexProperties()\n\t\t})\n\t\t// Initial update of flex properties\n\t\tthis.updateFlexProperties()\n\t}\n\n\tdisconnectedCallback(): void {\n\t\tthis.subscription?.unsubscribe()\n\t\tsuper.disconnectedCallback()\n\t}\n\n\t/**\n\t * Update the host element's flex properties based on active state\n\t */\n\tprivate updateFlexProperties() {\n\t\tconst isActive = this.position === this.currentStep\n\n\t\tif (isActive) {\n\t\t\t// Apply flex-grow when active\n\t\t\tthis.style.flex = '1 1 auto'\n\t\t} else {\n\t\t\t// Make it shrink when not active\n\t\t\tthis.style.flex = '0 0 auto'\n\t\t}\n\t}\n\n\t/**\n\t * Compute visual status for styling purposes. Note that if a step is explicitly\n\t * marked as completed, it always appears as complete even if it's active.\n\t */\n\tget status(): 'complete' | 'current' | 'upcoming' {\n\t\tif (this.completed || this.position < this.steps.currentStep) return 'complete'\n\t\tif (this.position === this.steps.currentStep) return 'current'\n\t\treturn 'upcoming'\n\t}\n\n\t/**\n\t * Click handler to allow navigation between completed (or active) steps.\n\t * With lockBack enabled, clicking on a previous step is ignored.\n\t */\n\tprivate _onStepClick(_e: Event) {\n\t\t// If lockBack is enabled and the user attempts to go back, do nothing.\n\t\tif (this.lockBack && this.position < this.steps.currentStep) {\n\t\t\treturn\n\t\t}\n\t\tif (this.status !== 'upcoming') {\n\t\t\tthis.steps.setStep(this.position)\n\t\t}\n\t}\n\n\trender() {\n\t\t// Determine if the step is currently active.\n\t\tconst isActive = this.position === this.currentStep\n\n\t\t// Use computed status for visual styling.\n\t\tconst isComplete = this.status === 'complete'\n\t\tconst isUpcoming = this.status === 'upcoming'\n\n\t\t// Enhanced styling classes with better visual hierarchy\n\t\tconst connectorClasses = {\n\t\t\t'bg-tertiary-default': isComplete,\n\t\t\t'bg-outline-variant': !isComplete,\n\t\t}\n\n\t\tconst iconContainerClasses = {\n\t\t\t'relative border-solid z-10 flex size-8 items-center justify-center rounded-full transition-all duration-200': true,\n\t\t\t'bg-tertiary-default text-tertiary-on shadow-md group-hover:shadow-lg': isComplete,\n\t\t\t'border-2 border-primary-default bg-primary-container text-primary-onContainer shadow-sm': !isComplete && isActive,\n\t\t\t'border-2 border-outline bg-surface text-surface-onVariant group-hover:border-primary-default group-hover:bg-primary-container': isUpcoming,\n\t\t}\n\n\t\tconst textClasses = {\n\t\t\t'text-primary-default font-medium': isActive,\n\t\t\t'text-tertiary-default': isComplete,\n\t\t\t'text-surface-onVariant': isUpcoming,\n\t\t}\n\n\t\t// If the step is clickable (active or complete), add a pointer cursor.\n\t\tconst clickableClass = isActive || isComplete ? 'cursor-pointer' : ''\n\n\t\treturn html`\n\t\t\t<li class=\"relative\">\n\t\t\t\t<!-- Connector line -->\n\t\t\t\t<div\n\t\t\t\t\tclass=\"absolute top-8 left-4 -ml-px h-full w-0.5 transition-colors duration-200 ${this.classMap(connectorClasses)}\"\n\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t></div>\n\n\t\t\t\t<!-- Step Button/Label -->\n\t\t\t\t<button \n\t\t\t\t\ttype=\"button\" \n\t\t\t\t\t@click=${this._onStepClick} \n\t\t\t\t\tclass=\"relative flex items-start group transition-all duration-200 hover:scale-[1.02] ${clickableClass} ${isActive ? 'bg-primary-container/20 -mx-2 px-2 py-3 rounded-lg' : 'py-2'}\"\n\t\t\t\t>\n\t\t\t\t\t<span class=\"flex items-center h-12\">\n\t\t\t\t\t\t<span class=${this.classMap(iconContainerClasses)}>\n\t\t\t\t\t\t\t${isComplete\n\t\t\t\t\t\t\t\t? html`\n\t\t\t\t\t\t\t\t\t\t<svg class=\"size-5 transition-transform duration-200 group-hover:scale-110\" viewBox=\"0 0 20 20\" fill=\"currentColor\" aria-hidden=\"true\">\n\t\t\t\t\t\t\t\t\t\t\t<path\n\t\t\t\t\t\t\t\t\t\t\t\tfill-rule=\"evenodd\"\n\t\t\t\t\t\t\t\t\t\t\t\td=\"M16.704 4.153a.75.75 0 0 1 .143 1.052l-8 10.5a.75.75 0 0 1-1.127.075l-4.5-4.5a.75.75 0 0 1 1.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 0 1 1.05-.143Z\"\n\t\t\t\t\t\t\t\t\t\t\t\tclip-rule=\"evenodd\"\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t</svg>\n\t\t\t\t\t\t\t\t\t`\n\t\t\t\t\t\t\t\t: html`\n\t\t\t\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t\t\t\tclass=\"size-3 rounded-full transition-all duration-200 ${isActive\n\t\t\t\t\t\t\t\t\t\t\t\t? 'bg-primary-onContainer'\n\t\t\t\t\t\t\t\t\t\t\t\t: 'bg-transparent group-hover:bg-primary-default group-hover:scale-125'}\"\n\t\t\t\t\t\t\t\t\t\t></span>\n\t\t\t\t\t\t\t\t\t`}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</span>\n\n\t\t\t\t\t<span class=\"flex flex-col items-start min-w-0 ml-6\">\n\t\t\t\t\t\t<schmancy-typography type=\"title\" token=\"md\">\n\t\t\t\t\t\t\t<span class=\"transition-colors duration-200 ${this.classMap(textClasses)}\">${this.title}</span>\n\t\t\t\t\t\t</schmancy-typography>\n\t\t\t\t\t\t${when(\n\t\t\t\t\t\t\tthis.description,\n\t\t\t\t\t\t\t() => html`\n\t\t\t\t\t\t\t\t<schmancy-typography type=\"body\" token=\"sm\" class=\"mt-1\">\n\t\t\t\t\t\t\t\t\t<span class=\"text-surface-onVariant transition-colors duration-200 ${isActive ? 'text-primary-onContainer' : ''}\">${this.description}</span>\n\t\t\t\t\t\t\t\t</schmancy-typography>\n\t\t\t\t\t\t\t`,\n\t\t\t\t\t\t)}\n\t\t\t\t\t</span>\n\t\t\t\t</button>\n\n\t\t\t\t<!-- Render step content if the step is active, with enhanced spacing -->\n\t\t\t\t${when(\n\t\t\t\t\tisActive,\n\t\t\t\t\t() => html`\n\t\t\t\t\t\t<div class=\"ml-10 mt-4 pb-8 transition-all duration-300 ease-out\">\n\t\t\t\t\t\t\t<div class=\"pl-4 border-l-2 border-primary-default/20\">\n\t\t\t\t\t\t\t\t<slot></slot>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t`,\n\t\t\t\t)}\n\t\t\t</li>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-step': SchmancyStep\n\t}\n}\n","import { provide } from '@lit/context'\nimport { $LitElement } from '@mixins/litElement.mixin'\nimport { css, html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport { StepsController, stepsContext } from './steps.context'\n\n@customElement('schmancy-steps-container')\nexport class SchmancyStepsContainer extends $LitElement(css`\n\t:host {\n\t\tdisplay: block;\n\t}\n`) {\n\tprivate controller = new StepsController()\n\n\t@provide({ context: stepsContext })\n\tstepsController = this.controller\n\n\t@property({ type: Number, reflect: true })\n\tset currentStep(value: number) {\n\t\tconst oldValue = this._currentStep\n\t\tthis._currentStep = value\n\t\tthis.controller.setStep(value)\n\t\tthis.requestUpdate('currentStep', oldValue)\n\t}\n\n\tget currentStep(): number {\n\t\treturn this._currentStep\n\t}\n\n\tprivate _currentStep = 1\n\n\t/**\n\t * Gap between steps. Maps to Tailwind gap classes.\n\t * Options: 0, 1, 2, 3, 4, 5, 6, 8, 10, 12, 16, 20, 24\n\t * @default 4\n\t */\n\t@property({ type: Number, reflect: true })\n\tgap: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 8 | 10 | 12 | 16 | 20 | 24 = 4\n\n\tconnectedCallback() {\n\t\tsuper.connectedCallback()\n\t\tthis.controller.setStep(this.currentStep)\n\t}\n\n\trender() {\n\t\t// Map gap value to Tailwind gap class\n\t\tconst gapClass = `gap-${this.gap}`\n\t\t\n\t\treturn html`\n\t\t\t<nav class=\"flex h-full w-full\" aria-label=\"Progress\">\n\t\t\t\t<ol class=\"flex flex-col flex-1 ${gapClass}\" role=\"list\">\n\t\t\t\t\t<slot></slot>\n\t\t\t\t</ol>\n\t\t\t</nav>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-steps-container': SchmancyStepsContainer\n\t}\n}\n"],"names":["StepsController","constructor","this","_currentStep","BehaviorSubject","currentStep$","asObservable","currentStep","value","step","next","stepsContext","createContext","Symbol","SchmancyStep","$LitElement","css","super","arguments","position","title","description","completed","lockBack","connectedCallback","firstUpdated","subscription","steps","subscribe","updateFlexProperties","disconnectedCallback","unsubscribe","isActive","style","flex","_e","status","setStep","render","isComplete","isUpcoming","connectorClasses","iconContainerClasses","textClasses","clickableClass","html","classMap","_onStepClick","when","__decorateClass","property","type","Number","prototype","String","Boolean","reflect","consume","context","state","customElement","SchmancyStepsContainer","controller","stepsController","gap","oldValue","requestUpdate","gapClass","provide"],"mappings":"8OAGO,MAAMA,CAAAA,CAAN,aAAAC,CACNC,KAAQC,aAAe,IAAIC,EAAAA,gBAAgB,CAAA,CAAC,CAE5C,IAAA,cAAIC,CACH,OAAOH,KAAKC,aAAaG,aAAAA,CAC1B,CAEA,IAAA,aAAIC,CACH,OAAOL,KAAKC,aAAaK,KAC1B,CAEA,QAAQC,EAAAA,CACPP,KAAKC,aAAaO,KAAKD,CAAAA,CACxB,CAAA,CAMM,MAAME,EAAeC,EAAAA,EAA+BC,OAAO,sBAAA,CAAA,kMCbrDC,QAAAA,aAAN,cAA2BC,EAAAA,YAAYC,EAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA,CAAvC,CAAA,CAAA,aAAAf,CAAAgB,MAAAA,GAAAC,SAAAA,EAYsBhB,KAAAiB,SAAW,EAEXjB,KAAAkB,MAAQ,GACRlB,KAAAmB,YAAc,GAGEnB,KAAAoB,UAAAA,GAMfpB,KAAAqB,SAAAA,GAY7BrB,KAAQK,YAAc,CAAA,CAOtB,mBAAAiB,CACCP,MAAMO,kBAAAA,CACP,CAEA,cAAAC,CAGCvB,KAAKwB,aAAexB,KAAKyB,MAAMtB,aAAauB,UAAUnB,GAAAA,CACrDP,KAAKK,YAAcE,EAEnBP,KAAK2B,qBAAAA,CAAAA,CAAAA,EAGN3B,KAAK2B,qBAAAA,CACN,CAEA,sBAAAC,CACC5B,KAAKwB,cAAcK,cACnBd,MAAMa,qBAAAA,CACP,CAKQ,uBACP,MAAME,EAAW9B,KAAKiB,WAAajB,KAAKK,YAIvCL,KAAK+B,MAAMC,KAFRF,EAEe,WAGA,UAEpB,CAMA,IAAA,SACC,OAAI9B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