@cobwds/cob-stepper 1.19.3
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/cob-stepper.js +222 -0
- package/dist/cob-stepper.js.map +1 -0
- package/package.json +48 -0
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
import { LitElement as h, unsafeCSS as u, html as v } from "lit";
|
|
2
|
+
import { property as c } from "lit/decorators.js";
|
|
3
|
+
/*!
|
|
4
|
+
* █▄ █ █ █ █▀▀▀█ █▀▀▄ █▀▀▀█
|
|
5
|
+
* █ █ █ █▄▄▄█ ▀▀▀▄▄ █ █ ▀▀▀▄▄
|
|
6
|
+
* █ ▀█ █ █▄▄▄█ █▄▄▀ █▄▄▄█
|
|
7
|
+
*
|
|
8
|
+
* Stepper Component v1.19.3
|
|
9
|
+
* Part of the City of Boston Web Design System
|
|
10
|
+
* Repository: https://github.com/CityOfBoston/nywds-poc
|
|
11
|
+
* License: MIT
|
|
12
|
+
*/
|
|
13
|
+
const m = ':host{--_cob-stepper-font-size: var(--cob-font-size-ui-md, 16px);--_cob-stepper-font-weight: var(--cob-font-weight-semibold, 600);--_cob-stepper-line-height: var(--cob-font-lineheight-ui-md, 24px);--_cob-stepper-font-family: var( --cob-font-family-ui, var(--cob-font-family-serif, "Lora", "Georgia", "Times New Roman", serif) );--_cob-step-color: var(--cob-color-text, #1b1b1b);--_cob-stepper-background-color: var(--cob-color-surface-raised, #f6f6f6)}.cob-stepper{font-family:var(--_cob-stepper-font-family);font-size:var(--_cob-stepper-font-size);font-weight:var(--_cob-stepper-font-weight);line-height:var(--_cob-stepper-line-height);display:flex;flex-direction:column;counter-reset:step;background-color:var(--_cob-stepper-background-color);max-width:100%;height:100%}.cob-stepper__header{display:flex;flex-direction:column;padding:var(--cob-space-400, 32px) var(--cob-space-400, 32px) var(--cob-space-150, 12px)}::slotted(div[slot=actions]){display:flex;flex-wrap:wrap;justify-content:flex-start;gap:var(--cob-space-100, 8px);margin-bottom:var(--cob-space-300, 24px)}.cob-stepper__counter{display:none;text-decoration:underline;text-decoration-style:solid;text-decoration-skip-ink:auto;text-decoration-thickness:7%;text-underline-offset:auto;text-underline-position:from-font;color:var(--cob-color-text, #1b1b1b);text-overflow:ellipsis;font-family:var(--cob-font-family-ui, "Montserrat");font-size:var(--cob-font-size-ui-md, 16px);font-style:normal;font-weight:400;line-height:var(--cob-font-size-ui-md, 16px);cursor:pointer;width:fit-content}.cob-stepper__steps{display:flex;flex-direction:column;padding:var(--cob-space-150, 12px) var(--cob-space-400, 32px) var(--cob-space-400, 32px);overflow-y:scroll;height:fit-content;height:-moz-available;scrollbar-width:none;background:linear-gradient(var(--cob-color-surface-raised, #f6f6f6) 30%,rgba(255,255,255,0)) center top,linear-gradient(rgba(255,255,255,0),var(--cob-color-surface-raised, #f6f6f6) 70%) center bottom,linear-gradient(to bottom,#63636333,#0000) top,linear-gradient(to top,#63636333,#0000) bottom;background-repeat:no-repeat;background-size:100% 40px,100% 40px,100% 14px,100% 14px;background-attachment:local,local,scroll,scroll;background-color:var(--cob-color-surface-raised, #f6f6f6)}.cob-step{position:relative;counter-increment:step;display:flex;flex-direction:column}.cob-step__contentwrapper{display:flex;flex-direction:row;align-items:center;gap:var(--cob-space-150, 12px);cursor:default;width:fit-content}.cob-step__contentwrapper:focus-visible{outline:solid var(--cob-color-focus, #004dd1) var(--cob-border-width-md, 2px);outline-offset:var(--cob-space-2px, 2px);border-radius:var(--cob-radius-md, 4px)}.cob-step__linewrapper{width:24px;display:flex;justify-content:center}.cob-step__line{width:var(--cob-size-1px, 1px);height:var(--cob-size-300, 24px);border-radius:var(--cob-radius-round, 1776px);background:var(--cob-color-black-transparent-200, rgba(27, 27, 27, .2));margin:var(--cob-space-100, 8px) 0}.cob-step__number{border-radius:var(--cob-radius-round, 1776px);border:var(--cob-size-1px, 1px) solid var(--cob-color-neutral-400, #909395);background:var(--cob-color-white-transparent-900, rgba(255, 255, 255, .9));width:var(--cob-size-300, 24px);min-width:var(--cob-size-300, 24px);max-width:var(--cob-size-300, 24px);height:var(--cob-size-300, 24px);min-height:var(--cob-size-300, 24px);max-height:var(--cob-size-300, 24px);display:flex;align-items:center;justify-content:center;text-align:center;color:var(--cob-color-text, #1b1b1b)}:host([previous]) .cob-step__number,:host([previous]) .cob-step__line,:host([current]) .cob-step__number,:host([current]) .cob-step__line{background-color:var(--cob-color-theme-stronger, #091f2f);color:var(--cob-color-text-reverse, #ffffff);border-color:var(--cob-color-theme-stronger, #091f2f)}:host([selected]) .cob-step__number{background-color:var(--cob-color-theme, #1871bd);color:var(--cob-color-text-reverse, #ffffff);border-color:var(--cob-color-theme, #1871bd);outline:var(--cob-size-50, 4px) solid var(--cob-color-theme-weak, #cddde9)}:host([first]) .cob-step__linewrapper{display:none!important}.cob-step__content{display:flex;flex-direction:column;gap:var(--cob-space-100, 8px)}.cob-step__label{color:var(--_cob-step-color);font-family:var(--_cob-stepper-font-family);font-size:var(--_cob-stepper-font-size);font-weight:var(--_cob-stepper-font-weight);line-height:var(--_cob-stepper-line-height);line-height:var(--cob-font-size-ui-md, 16px);letter-spacing:var(--cob-font-letterspacing-ui-md, .044px);text-decoration-style:solid;text-decoration-skip-ink:auto;text-decoration-thickness:var(7%, 1.12px);text-underline-offset:auto}:host([current]) .cob-step__label,:host([previous]) .cob-step__label{text-decoration-line:underline}:host([current]) .cob-step__contentwrapper,:host([previous]) .cob-step__contentwrapper{cursor:pointer}:host([selected]) .cob-step__label{font-weight:700;text-decoration-line:none}:host([selected]) .cob-step__contentwrapper{cursor:default}:host([selected]) .cob-step__contentwrapper:focus-visible{outline-offset:6px}@media(max-width:1023px){.cob-stepper{max-width:1023px;width:100%}.cob-stepper__header{flex-direction:row-reverse;justify-content:space-between;padding:var(--cob-space-150, 12px);gap:var(--cob-space-200, 16px)}.cob-stepper__headertext{flex:1 1 0;min-width:0}::slotted(div[slot=actions]){margin-bottom:0;min-width:0;justify-content:end}.cob-stepper__counter{display:block}.cob-stepper__steps{flex-direction:row;gap:var(--cob-space-2px, 2px);padding:0}.cob-stepper__steps::slotted(*){flex:1}.cob-step__number{border-radius:0;border:none;background-color:var(--cob-color-neutral-200, #bec0c1);height:var(--cob-size-100, 8px);min-height:var(--cob-size-100, 8px);max-height:var(--cob-size-100, 8px);width:100%;min-width:100%;max-width:100%;color:transparent}:host([previous]) .cob-step__number,:host([current]) .cob-step__number{background-color:var(--cob-color-neutral-900, #1b1b1b);color:transparent}:host([selected]) .cob-step__number{background-color:var(--cob-color-theme-mid, #457aa5);outline:none}.cob-step__content,.cob-step__linewrapper{display:none}.cob-step__contentwrapper{cursor:default;pointer-events:none;width:auto}:host([isCompactExpanded]) .cob-step__content,:host([isCompactExpanded]) .cob-step__linewrapper{display:flex}:host([isCompactExpanded]) .cob-stepper__header{padding-bottom:var(--cob-space-250, 20px)}:host([isCompactExpanded]) .cob-stepper__steps{width:-webkit-fill-available;width:-moz-available;z-index:9999;overflow-y:auto;flex-direction:column;gap:0;padding:var(--cob-space-150, 12px) var(--cob-space-400, 32px) var(--cob-space-400, 32px)}:host([isCompactExpanded]) .cob-stepper__steps::slotted(*){flex:none}:host([isCompactExpanded]) .cob-step__number{border-radius:var(--cob-radius-round, 1776px);border:1px solid var(--cob-color-neutral-400, #909395);background:var(--cob-color-white-transparent-900, rgba(255, 255, 255, .9));width:var(--cob-space-300, 24px);min-width:var(--cob-space-300, 24px);max-width:var(--cob-space-300, 24px);height:var(--cob-space-300, 24px);min-height:var(--cob-space-300, 24px);max-height:var(--cob-space-300, 24px);color:var(--cob-color-text, #1b1b1b)}:host([isCompactExpanded][previous]) .cob-step__number,:host([isCompactExpanded][previous]) .cob-step__line,:host([isCompactExpanded][current]) .cob-step__number,:host([isCompactExpanded][current]) .cob-step__line{background:var(--cob-color-theme-stronger, #091f2f);color:var(--cob-color-text-reverse, #ffffff);border-color:var(--cob-color-theme-stronger, #091f2f)}:host([isCompactExpanded][selected]) .cob-step__number{background:var(--cob-color-theme, #1871bd);color:var(--cob-color-text-reverse, #ffffff);border-color:var(--cob-color-theme, #1871bd);outline:4px solid var(--cob-color-theme-weak, #cddde9)}:host([isCompactExpanded]) .cob-step__contentwrapper{pointer-events:all}}';
|
|
14
|
+
var x = Object.defineProperty, p = (l, e, r, s) => {
|
|
15
|
+
for (var o = void 0, t = l.length - 1, i; t >= 0; t--)
|
|
16
|
+
(i = l[t]) && (o = i(e, r, o) || o);
|
|
17
|
+
return o && x(e, r, o), o;
|
|
18
|
+
};
|
|
19
|
+
const b = class b extends h {
|
|
20
|
+
constructor() {
|
|
21
|
+
super(...arguments), this.selected = !1, this.current = !1, this.label = "", this.href = "", this.previous = !1, this.isCompactExpanded = !1, this.stepNumber = 0;
|
|
22
|
+
}
|
|
23
|
+
_handleActivate(e) {
|
|
24
|
+
typeof this.onClick == "function" && this.onClick(e);
|
|
25
|
+
const r = new CustomEvent("cob-step-click", {
|
|
26
|
+
bubbles: !0,
|
|
27
|
+
composed: !0,
|
|
28
|
+
cancelable: !0,
|
|
29
|
+
detail: { href: this.href, label: this.label }
|
|
30
|
+
});
|
|
31
|
+
(this.hasAttribute("previous") || this.current) && !this.selected && (this.dispatchEvent(r), !r.defaultPrevented && this.href && (window.location.href = this.href));
|
|
32
|
+
}
|
|
33
|
+
_handleKeydown(e) {
|
|
34
|
+
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), this._handleActivate(e));
|
|
35
|
+
}
|
|
36
|
+
render() {
|
|
37
|
+
return v`
|
|
38
|
+
<div class="cob-step">
|
|
39
|
+
<div class="cob-step__linewrapper">
|
|
40
|
+
<div class="cob-step__line"></div>
|
|
41
|
+
</div>
|
|
42
|
+
<div
|
|
43
|
+
class="cob-step__contentwrapper"
|
|
44
|
+
@click=${this._handleActivate}
|
|
45
|
+
@keydown=${this._handleKeydown}
|
|
46
|
+
?disabled=${!(this.selected || this.current || this.hasAttribute("previous"))}
|
|
47
|
+
>
|
|
48
|
+
<div class="cob-step__number" tabindex="-1" aria-hidden="true">
|
|
49
|
+
${this.stepNumber}
|
|
50
|
+
</div>
|
|
51
|
+
<div class="cob-step__content" tabindex="-1" aria-hidden="true">
|
|
52
|
+
<div
|
|
53
|
+
class="cob-step__label"
|
|
54
|
+
role="button"
|
|
55
|
+
aria-label="${this.label} Step"
|
|
56
|
+
tabindex=${this.selected || this.current || this.hasAttribute("previous") ? "0" : "-1"}
|
|
57
|
+
aria-hidden="true"
|
|
58
|
+
>
|
|
59
|
+
${this.label}
|
|
60
|
+
</div>
|
|
61
|
+
</div>
|
|
62
|
+
</div>
|
|
63
|
+
</div>
|
|
64
|
+
`;
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
b.styles = u(m);
|
|
68
|
+
let a = b;
|
|
69
|
+
p([
|
|
70
|
+
c({ type: Boolean, reflect: !0 })
|
|
71
|
+
], a.prototype, "selected");
|
|
72
|
+
p([
|
|
73
|
+
c({ type: Boolean, reflect: !0 })
|
|
74
|
+
], a.prototype, "current");
|
|
75
|
+
p([
|
|
76
|
+
c({ type: String })
|
|
77
|
+
], a.prototype, "label");
|
|
78
|
+
p([
|
|
79
|
+
c({ type: String })
|
|
80
|
+
], a.prototype, "href");
|
|
81
|
+
p([
|
|
82
|
+
c({ type: Boolean, reflect: !0 })
|
|
83
|
+
], a.prototype, "previous");
|
|
84
|
+
p([
|
|
85
|
+
c({ type: Boolean })
|
|
86
|
+
], a.prototype, "isCompactExpanded");
|
|
87
|
+
p([
|
|
88
|
+
c({ attribute: !1 })
|
|
89
|
+
], a.prototype, "onClick");
|
|
90
|
+
p([
|
|
91
|
+
c({ type: Number })
|
|
92
|
+
], a.prototype, "stepNumber");
|
|
93
|
+
customElements.get("cob-step") || customElements.define("cob-step", a);
|
|
94
|
+
var _ = Object.defineProperty, d = (l, e, r, s) => {
|
|
95
|
+
for (var o = void 0, t = l.length - 1, i; t >= 0; t--)
|
|
96
|
+
(i = l[t]) && (o = i(e, r, o) || o);
|
|
97
|
+
return o && _(e, r, o), o;
|
|
98
|
+
};
|
|
99
|
+
let g = 0;
|
|
100
|
+
const f = class f extends h {
|
|
101
|
+
constructor() {
|
|
102
|
+
super(), this.id = "", this.name = "", this.label = "", this.counterText = "initial", this.isCompactExpanded = !1, this._stepsNumbered = !1, this._onStepClick = async (e) => {
|
|
103
|
+
const r = e.composedPath().find(
|
|
104
|
+
(i) => i instanceof HTMLElement && i.tagName.toLowerCase() === "cob-step"
|
|
105
|
+
);
|
|
106
|
+
if (!r) return;
|
|
107
|
+
const s = Array.from(this.querySelectorAll("cob-step")), o = s.findIndex(
|
|
108
|
+
(i) => i.hasAttribute("current")
|
|
109
|
+
), t = s.indexOf(r);
|
|
110
|
+
o !== -1 && t > o || r.hasAttribute("selected") || (s.forEach((i) => i.removeAttribute("selected")), r.setAttribute("selected", ""), this._updateCounter(), this.isCompactExpanded = !1);
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
connectedCallback() {
|
|
114
|
+
super.connectedCallback(), this.addEventListener("cob-step-click", this._onStepClick), requestAnimationFrame(() => this._validateSteps()), this.id || (this.id = `cob-stepper-${++g}-${Date.now()}`);
|
|
115
|
+
}
|
|
116
|
+
disconnectedCallback() {
|
|
117
|
+
this.removeEventListener("cob-step-click", this._onStepClick), super.disconnectedCallback();
|
|
118
|
+
}
|
|
119
|
+
_validateSteps() {
|
|
120
|
+
Array.from(this.children).forEach((e) => {
|
|
121
|
+
const r = e instanceof HTMLElement && e.tagName.toLowerCase() === "cob-step", s = e instanceof HTMLElement && e.hasAttribute("slot") && e.getAttribute("slot") === "actions";
|
|
122
|
+
!r && !s && (console.warn(
|
|
123
|
+
"Only <cob-step> elements or the <div slot='actions'> container are allowed as direct children of <cob-stepper>. Removing:",
|
|
124
|
+
e
|
|
125
|
+
), e.remove());
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
_validateButtonSlot(e) {
|
|
129
|
+
const s = e.target.assignedElements();
|
|
130
|
+
if (s.length !== 1 || s[0].tagName.toLowerCase() !== "div") {
|
|
131
|
+
console.warn(
|
|
132
|
+
"The 'actions' slot must have exactly one <div> as a direct child."
|
|
133
|
+
);
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
const o = s[0];
|
|
137
|
+
Array.from(o.children).forEach((t) => {
|
|
138
|
+
t instanceof HTMLElement && t.tagName.toLowerCase() === "cob-button" ? (t.setAttribute("size", "sm"), t.hasAttribute("fullWidth") && (t.style.flex = "1 1 0")) : (console.warn(
|
|
139
|
+
"The <div> inside 'actions' slot only accepts <cob-button> elements. Removing invalid node:",
|
|
140
|
+
t
|
|
141
|
+
), t.remove());
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
_updateCounter() {
|
|
145
|
+
let e;
|
|
146
|
+
if (this.isCompactExpanded)
|
|
147
|
+
e = "Back to Form", this.style.height = "-webkit-fit-content", this.style.height = "-moz-fit-content", this.style.height = "fit-content";
|
|
148
|
+
else {
|
|
149
|
+
this.style.height = "auto";
|
|
150
|
+
const r = this.querySelectorAll("cob-step"), s = Array.from(r).findIndex(
|
|
151
|
+
(t) => t.hasAttribute("selected")
|
|
152
|
+
), o = r.length;
|
|
153
|
+
e = s >= 0 ? `Step ${s + 1} of ${o}` : `Step 1 of ${o}`;
|
|
154
|
+
}
|
|
155
|
+
e !== this.counterText && (this.counterText = e);
|
|
156
|
+
}
|
|
157
|
+
willUpdate() {
|
|
158
|
+
const e = this.querySelectorAll("cob-step");
|
|
159
|
+
this._stepsNumbered || (e.forEach((t, i) => {
|
|
160
|
+
t.stepNumber = i + 1;
|
|
161
|
+
}), this._stepsNumbered = !0);
|
|
162
|
+
let r = !1, s = !1, o = !1;
|
|
163
|
+
e.forEach((t, i) => {
|
|
164
|
+
t.current && (o ? t.current = !1 : o = !0), i === 0 ? t.setAttribute("first", "") : t.removeAttribute("first"), t.current ? (r = !0, t.previous = !1) : r ? t.previous = !1 : t.previous = !0, t.selected && (r || s ? t.selected = !1 : s = !0), this.isCompactExpanded ? t.setAttribute("isCompactExpanded", "") : t.removeAttribute("isCompactExpanded");
|
|
165
|
+
}), s || (o ? e.forEach((t) => {
|
|
166
|
+
t.current && !s && (t.setAttribute("selected", ""), s = !0);
|
|
167
|
+
}) : e.length > 0 && (e[0].setAttribute("current", ""), e[0].setAttribute("selected", ""))), this._updateCounter();
|
|
168
|
+
}
|
|
169
|
+
_toggleCompact() {
|
|
170
|
+
this.isCompactExpanded = !this.isCompactExpanded;
|
|
171
|
+
}
|
|
172
|
+
_handleCounterKeydown(e) {
|
|
173
|
+
(e.key === " " || e.key === "Enter") && (e.preventDefault(), this._toggleCompact());
|
|
174
|
+
}
|
|
175
|
+
render() {
|
|
176
|
+
return v`
|
|
177
|
+
<div class="cob-stepper" name=${this.name}>
|
|
178
|
+
<div class="cob-stepper__header">
|
|
179
|
+
<slot name="actions" @slotchange=${this._validateButtonSlot}></slot>
|
|
180
|
+
<div class="cob-stepper__headertext">
|
|
181
|
+
<div class="cob-stepper__label">${this.label}</div>
|
|
182
|
+
<div
|
|
183
|
+
class="cob-stepper__counter"
|
|
184
|
+
@click=${this._toggleCompact}
|
|
185
|
+
@keydown=${this._handleCounterKeydown}
|
|
186
|
+
role="button"
|
|
187
|
+
tabindex="0"
|
|
188
|
+
aria-label=${this.isCompactExpanded ? "Collapse step navigation to view the form" : `Expand step navigation. You are on ${this.counterText}`}
|
|
189
|
+
aria-expanded=${this.isCompactExpanded ? "true" : "false"}
|
|
190
|
+
>
|
|
191
|
+
${this.counterText}
|
|
192
|
+
</div>
|
|
193
|
+
</div>
|
|
194
|
+
</div>
|
|
195
|
+
<slot class="cob-stepper__steps"></slot>
|
|
196
|
+
</div>
|
|
197
|
+
`;
|
|
198
|
+
}
|
|
199
|
+
};
|
|
200
|
+
f.styles = u(m);
|
|
201
|
+
let n = f;
|
|
202
|
+
d([
|
|
203
|
+
c({ type: String, reflect: !0 })
|
|
204
|
+
], n.prototype, "id");
|
|
205
|
+
d([
|
|
206
|
+
c({ type: String, reflect: !0 })
|
|
207
|
+
], n.prototype, "name");
|
|
208
|
+
d([
|
|
209
|
+
c({ type: String })
|
|
210
|
+
], n.prototype, "label");
|
|
211
|
+
d([
|
|
212
|
+
c({ type: String })
|
|
213
|
+
], n.prototype, "counterText");
|
|
214
|
+
d([
|
|
215
|
+
c({ type: Boolean, reflect: !0 })
|
|
216
|
+
], n.prototype, "isCompactExpanded");
|
|
217
|
+
customElements.get("cob-stepper") || customElements.define("cob-stepper", n);
|
|
218
|
+
export {
|
|
219
|
+
a as CobStep,
|
|
220
|
+
n as CobStepper
|
|
221
|
+
};
|
|
222
|
+
//# sourceMappingURL=cob-stepper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cob-stepper.js","sources":["../src/cob-step.ts","../src/cob-stepper.ts"],"sourcesContent":["import { LitElement, html, unsafeCSS } from \"lit\";\nimport { property } from \"lit/decorators.js\";\n// @ts-ignore: SCSS module imported via bundler as inline\nimport styles from \"./cob-stepper.scss?inline\";\n\n/**\n * A single step within `cob-stepper`. Represents one stage in a multi-step process.\n *\n * Mark as `current` to indicate the active progress point. Previous steps become clickable for navigation.\n * Set `href` for page-based navigation, or omit it and listen to `cob-step-click` for SPA/framework routing.\n *\n * ## Step states\n *\n * Three boolean attributes control step appearance and behavior:\n *\n * - **`current`** — The furthest step the user has reached (the progress boundary). Only one step should\n * have `current` at a time; if multiple are set the parent stepper keeps the first and removes the rest.\n * Steps after `current` are not navigable and do not fire `cob-step-click`. Update `current` in your\n * application state when the user advances.\n *\n * - **`selected`** — Which step's content is currently displayed. Defaults to the `current` step if not\n * explicitly set. If `selected` is placed on a step after `current`, the stepper silently corrects it\n * to match `current`. When managing state from a framework, always set `selected` explicitly — without\n * it the stepper's fallback will reset in-sidebar navigation on every state update.\n *\n * - **`previous`** — Auto-applied by the parent stepper to every step before `current`. Do not set this\n * manually. Steps with `previous` are clickable and fire `cob-step-click`.\n *\n * ## `cob-step-click` firing conditions\n *\n * The event fires only when ALL of the following are true:\n * 1. The step has `previous` or `current` (i.e. it is navigable).\n * 2. The step does NOT already have `selected` (clicking the already-viewed step is a no-op).\n *\n * Steps that are neither `previous` nor `current` (future steps) never fire the event.\n *\n * ## `href` and navigation\n *\n * If `href` is set, the stepper calls `window.location.href = href` after dispatching `cob-step-click`\n * — but only if the event was **not canceled**. To handle navigation yourself (SPA routing, fetch, etc.),\n * always call `e.preventDefault()` in your listener. Omitting `href` entirely is simpler for SPAs.\n *\n * ## `onClick` vs `cob-step-click`\n *\n * The `onClick` property (a function reference, not a DOM attribute) is called **before** the\n * `cob-step-click` event is dispatched. Use it for imperative pre-navigation logic. In React, pass it\n * as the `onClick` prop on `CobStep`.\n *\n * ## Accessibility\n * - The step label renders with `role=\"button\"` and is keyboard-focusable (`tabindex=\"0\"`) for navigable\n * steps (`current`, `previous`). Future steps get `tabindex=\"-1\"` and are not reachable by keyboard.\n * - Enter and Space activate the step (same as click).\n * - `aria-label` is set to `\"{label} Step\"` for screen reader announcement.\n *\n * ## Common patterns\n *\n * **Initial state:** Set `current` on the first step. `selected` defaults to it.\n * ```html\n * <cob-step label=\"Step 1\" current></cob-step>\n * <cob-step label=\"Step 2\"></cob-step>\n * ```\n *\n * **User completed step 1, now on step 2:**\n * ```html\n * <cob-step label=\"Step 1\"></cob-step>\n * <cob-step label=\"Step 2\" current></cob-step>\n * ```\n *\n * **User went back to review step 1 (progress still at step 2):**\n * ```html\n * <cob-step label=\"Step 1\" selected></cob-step>\n * <cob-step label=\"Step 2\" current></cob-step>\n * ```\n *\n * @summary Individual step for use within cob-stepper with navigation support.\n * @element cob-step\n *\n * @fires cob-step-click - Fired when a navigable (`previous` or `current`) non-selected step is clicked\n * or activated by keyboard. Detail: `{ href: string, label: string }`. Cancelable — call\n * `e.preventDefault()` to suppress `window.location.href` navigation.\n */\nexport class CobStep extends LitElement {\n static styles = unsafeCSS(styles);\n\n /**\n * Which step is currently being displayed. If not set, defaults to the `current` step.\n * Setting this on a step after `current` is silently corrected to match `current`.\n * When controlling state from a framework, always set this explicitly.\n */\n @property({ type: Boolean, reflect: true }) selected = false;\n\n /** The furthest step the user has reached (progress boundary). Steps before this are navigable. */\n @property({ type: Boolean, reflect: true }) current = false;\n\n /** Step label text displayed alongside the step number. */\n @property({ type: String }) label = \"\";\n\n /**\n * URL navigated to when the step is activated, via `window.location.href`.\n * Navigation is suppressed if the `cob-step-click` listener calls `e.preventDefault()`.\n * Omit for SPA/framework routing and handle navigation in the event listener instead.\n */\n @property({ type: String }) href = \"\";\n\n /**\n * @internal Auto-applied by `cob-stepper` to every step that comes before `current`.\n * Marks the step as navigable and clickable. Do not set this manually — the parent stepper\n * adds and removes it on every render based on which step has `current`.\n */\n @property({ type: Boolean, reflect: true }) previous = false;\n\n /** @internal Propagated by the parent stepper. Do not set manually. */\n @property({ type: Boolean }) isCompactExpanded = false;\n\n /** Optional function called before `cob-step-click` is dispatched. Use for pre-navigation logic. */\n @property({ attribute: false }) onClick?: (e: Event) => void;\n\n /** @internal 1-indexed position. Auto-assigned by the parent stepper on first render. Do not set manually. */\n @property({ type: Number }) stepNumber = 0;\n\n private _handleActivate(e: Event) {\n // Run user-supplied onClick first (if present)\n if (typeof this.onClick === \"function\") {\n this.onClick(e);\n }\n\n // Dispatch event as cancelable so user can prevent navigation\n const event = new CustomEvent(\"cob-step-click\", {\n bubbles: true,\n composed: true,\n cancelable: true,\n detail: { href: this.href, label: this.label },\n });\n\n if ((this.hasAttribute(\"previous\") || this.current) && !this.selected) {\n this.dispatchEvent(event);\n\n // Only navigate if event was not canceled\n if (!event.defaultPrevented && this.href) {\n window.location.href = this.href;\n }\n }\n }\n\n private _handleKeydown(e: KeyboardEvent) {\n if (e.key === \"Enter\" || e.key === \" \") {\n e.preventDefault();\n this._handleActivate(e);\n }\n }\n\n render() {\n return html`\n <div class=\"cob-step\">\n <div class=\"cob-step__linewrapper\">\n <div class=\"cob-step__line\"></div>\n </div>\n <div\n class=\"cob-step__contentwrapper\"\n @click=${this._handleActivate}\n @keydown=${this._handleKeydown}\n ?disabled=${!(\n this.selected ||\n this.current ||\n this.hasAttribute(\"previous\")\n )}\n >\n <div class=\"cob-step__number\" tabindex=\"-1\" aria-hidden=\"true\">\n ${this.stepNumber}\n </div>\n <div class=\"cob-step__content\" tabindex=\"-1\" aria-hidden=\"true\">\n <div\n class=\"cob-step__label\"\n role=\"button\"\n aria-label=\"${this.label} Step\"\n tabindex=${!(\n this.selected ||\n this.current ||\n this.hasAttribute(\"previous\")\n )\n ? \"-1\"\n : \"0\"}\n aria-hidden=\"true\"\n >\n ${this.label}\n </div>\n </div>\n </div>\n </div>\n `;\n }\n}\n\nif (!customElements.get(\"cob-step\")) {\n customElements.define(\"cob-step\", CobStep);\n}\n","import { LitElement, html, unsafeCSS } from \"lit\";\nimport { property } from \"lit/decorators.js\";\nimport \"./cob-step\";\n// @ts-ignore: SCSS module imported via bundler as inline\nimport styles from \"./cob-stepper.scss?inline\";\n\nlet stepperIdCounter = 0;\n\n/**\n * A multi-step progress indicator for forms or wizards. Manages `cob-step` children with selection and navigation.\n *\n * Add `cob-step` elements as children. Mark one step as `current` to indicate the progress boundary; all steps\n * before it become navigable. Compact view on mobile expands to show all steps. Use the `actions` slot for\n * persistent navigation buttons (e.g., Save & Exit). Do not place the stepper inside a `<form>` element —\n * put form fields in the main content area alongside it.\n *\n * ## When to use\n * - Linear, ordered forms or wizards with more than 2 sections.\n *\n * ## When not to use\n * - Forms with only 1 or 2 sections — use a simpler layout.\n * - Non-linear forms where sections can be completed in any order.\n *\n * ## Compact mode (mobile)\n * On small screens the stepper collapses to a compact view: step labels are hidden and progress\n * is shown as a bar indicator with a \"Step x of y\" counter. Clicking or pressing Enter/Space on\n * the counter expands the full step list (counter text changes to \"Back to Form\"). Collapsing\n * again returns the user to the form view.\n *\n * ## actions slot constraints\n * The `actions` slot must contain exactly one `<div>` as its direct child. That `<div>` may only\n * contain `<cob-button>` elements — any other element is removed with a console warning.\n * The stepper automatically forces `size=\"sm\"` on every button in the slot. Buttons with the\n * `fullWidth` attribute get `flex: 1 1 0` injected so they share available width equally.\n *\n * ## Multiple `current` conflict\n * If more than one `cob-step` has the `current` attribute, only the first one is kept; the rest\n * are silently removed. Always mark exactly one step as `current`.\n *\n * ## id auto-generation\n * If no `id` is provided, a unique id is generated automatically in the form\n * `cob-stepper-{n}-{timestamp}`.\n *\n * ## Accessibility\n * - The compact counter is rendered as a `role=\"button\"` with `aria-expanded` and a descriptive\n * `aria-label` that announces the current step (e.g., \"Expand step navigation. You are on Step 2 of 4\").\n * - Keyboard: Enter or Space toggles the compact view.\n * - Each `cob-step` label is keyboard-focusable and activatable for navigable steps.\n * - Visual focus indicators are provided on all interactive elements.\n *\n * @summary Multi-step progress indicator with navigation and mobile-friendly compact view.\n * @element cob-stepper\n *\n * @slot - Default slot for `cob-step` elements. Only `cob-step` children are accepted; others are removed.\n * @slot actions - Persistent navigation buttons. Must contain exactly one `<div>` wrapping only `<cob-button>` elements.\n *\n * @example Basic\n * ```html\n * <div class=\"cob-grid-row\">\n * <cob-stepper\n * id=\"stepper\"\n * name=\"stepper\"\n * label=\"Register for Web Design System Office Hours\"\n * class=\"cob-desktop:cob-grid-col-3\"\n * >\n * <cob-step label=\"Personal Details\" href=\"/cob-stepper/personal.html\"></cob-step>\n * <cob-step label=\"Team Info\" selected href=\"/cob-stepper/team.html\"></cob-step>\n * <cob-step label=\"Usage Survey\" current href=\"/cob-stepper/survey.html\"></cob-step>\n * <cob-step label=\"Newsletter Opt-In\" href=\"/cob-stepper/newsletter.html\"></cob-step>\n * <div slot=\"actions\">\n * <cob-button variant=\"outline\" label=\"Save & Exit\" fullWidth></cob-button>\n * </div>\n * </cob-stepper>\n * <div class=\"cob-desktop:cob-grid-col-9\" id=\"cob-stepper-content\">\n * Loading...\n * </div>\n * </div>\n * ```\n * @render Basic\n * ```html\n * <div class=\"cob-grid-row\">\n * <cob-stepper\n * id=\"stepper\"\n * name=\"stepper\"\n * label=\"Register for Web Design System Office Hours\"\n * class=\"cob-desktop:cob-grid-col-3\"\n * >\n * <cob-step label=\"Personal Details\" href=\"/cob-stepper/personal.html\"></cob-step>\n * <cob-step label=\"Team Info\" selected href=\"/cob-stepper/team.html\"></cob-step>\n * <cob-step label=\"Usage Survey\" current href=\"/cob-stepper/survey.html\"></cob-step>\n * <cob-step label=\"Newsletter Opt-In\" href=\"/cob-stepper/newsletter.html\"></cob-step>\n * </cob-stepper>\n * <div class=\"cob-desktop:cob-grid-col-9\" id=\"cob-stepper-content\">\n * Loading...\n * </div>\n * </div>\n * <script>\n * document.addEventListener(\"DOMContentLoaded\", async () => {\n * const stepper = document.querySelector(\"cob-stepper\");\n * if (stepper?.updateComplete) await stepper.updateComplete;\n * const selectedStep = document.querySelector(\"cob-step[selected]\");\n * const href = selectedStep?.getAttribute(\"href\");\n * if (!href) return;\n * const res = await fetch(href);\n * if (!res.ok) return;\n * const container = document.querySelector(\"#cob-stepper-content\");\n * if (container) container.innerHTML = await res.text();\n * });\n *\n * document.addEventListener(\"cob-step-click\", async (e) => {\n * const href = e.detail?.href;\n * if (!href) return;\n * e.preventDefault();\n * const res = await fetch(href);\n * if (!res.ok) return;\n * const container = document.querySelector(\"#cob-stepper-content\");\n * if (container) container.innerHTML = await res.text();\n * });\n * </script>\n * ```\n *\n * @example Actions slot\n * ```html\n * <div class=\"cob-grid-row\">\n * <cob-stepper\n * id=\"stepper\"\n * name=\"stepper\"\n * label=\"Register for Web Design System Office Hours\"\n * class=\"cob-desktop:cob-grid-col-3\"\n * >\n * <cob-step label=\"Personal Details\" href=\"/cob-stepper/personal.html\"></cob-step>\n * <cob-step label=\"Team Info\" selected href=\"/cob-stepper/team.html\"></cob-step>\n * <cob-step label=\"Usage Survey\" current href=\"/cob-stepper/survey.html\"></cob-step>\n * <cob-step label=\"Newsletter Opt-In\" href=\"/cob-stepper/newsletter.html\"></cob-step>\n * <div slot=\"actions\">\n * <cob-button variant=\"outline\" label=\"Save & Exit\" fullWidth></cob-button>\n * </div>\n * </cob-stepper>\n * <div class=\"cob-desktop:cob-grid-col-9\" id=\"cob-stepper-content\">\n * Loading...\n * </div>\n * </div>\n * ```\n * @render Actions slot\n * ```html\n * <div class=\"cob-grid-row\">\n * <cob-stepper\n * id=\"stepper\"\n * name=\"stepper\"\n * label=\"Register for Web Design System Office Hours\"\n * class=\"cob-desktop:cob-grid-col-3\"\n * >\n * <cob-step label=\"Personal Details\" href=\"/cob-stepper/personal.html\"></cob-step>\n * <cob-step label=\"Team Info\" selected href=\"/cob-stepper/team.html\"></cob-step>\n * <cob-step label=\"Usage Survey\" current href=\"/cob-stepper/survey.html\"></cob-step>\n * <cob-step label=\"Newsletter Opt-In\" href=\"/cob-stepper/newsletter.html\"></cob-step>\n * <div slot=\"actions\">\n * <cob-button variant=\"outline\" label=\"Save & Exit\" fullWidth></cob-button>\n * </div>\n * </cob-stepper>\n * <div class=\"cob-desktop:cob-grid-col-9\" id=\"cob-stepper-content\">\n * Loading...\n * </div>\n * </div>\n * <script>\n * document.addEventListener(\"DOMContentLoaded\", async () => {\n * const stepper = document.querySelector(\"cob-stepper\");\n * if (stepper?.updateComplete) await stepper.updateComplete;\n * const selectedStep = document.querySelector(\"cob-step[selected]\");\n * const href = selectedStep?.getAttribute(\"href\");\n * if (!href) return;\n * const res = await fetch(href);\n * if (!res.ok) return;\n * const container = document.querySelector(\"#cob-stepper-content\");\n * if (container) container.innerHTML = await res.text();\n * });\n *\n * document.addEventListener(\"cob-step-click\", async (e) => {\n * const href = e.detail?.href;\n * if (!href) return;\n * e.preventDefault();\n * const res = await fetch(href);\n * if (!res.ok) return;\n * const container = document.querySelector(\"#cob-stepper-content\");\n * if (container) container.innerHTML = await res.text();\n * });\n * </script>\n * ```\n */\n\nexport class CobStepper extends LitElement {\n static styles = unsafeCSS(styles);\n\n /** Unique identifier. Auto-generated as `cob-stepper-{n}-{timestamp}` if not provided. */\n @property({ type: String, reflect: true }) id = \"\";\n\n /** Name attribute for form association. */\n @property({ type: String, reflect: true }) name = \"\";\n\n /** Title displayed above the step list and compact counter. */\n @property({ type: String }) label = \"\";\n\n /** Progress text displayed in compact mode (e.g., \"Step 2 of 5\"). Auto-managed — do not set manually. */\n @property({ type: String }) counterText = \"initial\";\n\n /** Whether compact mobile view is expanded to show all steps. Toggled by clicking the counter. */\n @property({ type: Boolean, reflect: true })\n isCompactExpanded = false;\n\n private _stepsNumbered = false;\n\n constructor() {\n super();\n }\n\n connectedCallback() {\n super.connectedCallback();\n this.addEventListener(\"cob-step-click\", this._onStepClick);\n // Defer step validation to next tick to ensure children are upgraded\n requestAnimationFrame(() => this._validateSteps());\n\n // Generate unique id if not provided\n if (!this.id) {\n this.id = `cob-stepper-${++stepperIdCounter}-${Date.now()}`;\n }\n }\n\n disconnectedCallback() {\n this.removeEventListener(\"cob-step-click\", this._onStepClick);\n super.disconnectedCallback();\n }\n\n private _validateSteps() {\n Array.from(this.children).forEach((child) => {\n const isStep =\n child instanceof HTMLElement &&\n child.tagName.toLowerCase() === \"cob-step\";\n const isSlotActionsContainer =\n child instanceof HTMLElement &&\n child.hasAttribute(\"slot\") &&\n child.getAttribute(\"slot\") === \"actions\";\n\n if (!isStep && !isSlotActionsContainer) {\n console.warn(\n \"Only <cob-step> elements or the <div slot='actions'> container are allowed as direct children of <cob-stepper>. Removing:\",\n child,\n );\n child.remove();\n }\n });\n }\n\n private _validateButtonSlot(event: Event) {\n const slot = event.target as HTMLSlotElement;\n const assignedElements = slot.assignedElements();\n\n // Ensure exactly one direct node in the slot, and it must be a div\n if (\n assignedElements.length !== 1 ||\n assignedElements[0].tagName.toLowerCase() !== \"div\"\n ) {\n console.warn(\n \"The 'actions' slot must have exactly one <div> as a direct child.\",\n );\n return;\n }\n\n const div = assignedElements[0] as HTMLElement;\n\n // Iterate through all buttons and validate\n Array.from(div.children).forEach((button) => {\n const isNysButton =\n button instanceof HTMLElement &&\n button.tagName.toLowerCase() === \"cob-button\";\n\n if (!isNysButton) {\n console.warn(\n \"The <div> inside 'actions' slot only accepts <cob-button> elements. Removing invalid node:\",\n button,\n );\n button.remove();\n } else {\n // Ensure cob-button has correct styles\n button.setAttribute(\"size\", \"sm\");\n if (button.hasAttribute(\"fullWidth\")) {\n button.style.flex = \"1 1 0\";\n }\n }\n });\n }\n\n private _onStepClick = async (event: Event) => {\n const clickedStep = event\n .composedPath()\n .find(\n (el) =>\n el instanceof HTMLElement && el.tagName.toLowerCase() === \"cob-step\",\n ) as HTMLElement | undefined;\n\n if (!clickedStep) return;\n\n const steps = Array.from(this.querySelectorAll(\"cob-step\"));\n const currentIndex = steps.findIndex((step) =>\n step.hasAttribute(\"current\"),\n );\n const clickedIndex = steps.indexOf(clickedStep);\n\n // Can't select past current\n if (currentIndex !== -1 && clickedIndex > currentIndex) return;\n\n // Can't select already selected\n if (clickedStep.hasAttribute(\"selected\")) return;\n\n // Remove selected from previous and move to new selected\n steps.forEach((step) => step.removeAttribute(\"selected\"));\n clickedStep.setAttribute(\"selected\", \"\");\n\n // Update counter immediately\n this._updateCounter();\n\n // Close expanded if it was open\n this.isCompactExpanded = false;\n };\n\n private _updateCounter() {\n let newCounterText: string;\n\n if (this.isCompactExpanded) {\n newCounterText = \"Back to Form\";\n this.style.height = \"-webkit-fit-content\";\n this.style.height = \"-moz-fit-content\";\n this.style.height = \"fit-content\";\n } else {\n this.style.height = \"auto\";\n\n const steps = this.querySelectorAll<HTMLElement>(\"cob-step\");\n const selectedIndex = Array.from(steps).findIndex((step) =>\n step.hasAttribute(\"selected\"),\n );\n const totalSteps = steps.length;\n\n newCounterText =\n selectedIndex >= 0\n ? `Step ${selectedIndex + 1} of ${totalSteps}`\n : `Step 1 of ${totalSteps}`;\n }\n\n if (newCounterText !== this.counterText) {\n this.counterText = newCounterText;\n }\n }\n\n willUpdate() {\n const steps = this.querySelectorAll<any>(\"cob-step\");\n\n if (!this._stepsNumbered) {\n steps.forEach((step, index) => {\n step.stepNumber = index + 1;\n });\n this._stepsNumbered = true;\n }\n\n let foundCurrent = false;\n let selectedAssigned = false;\n let currentAssigned = false;\n\n steps.forEach((step, i) => {\n // Check if multiple \"current\" exist, respect the first instance.\n // Read the Lit property (set synchronously by frameworks) rather than the\n // DOM attribute (which Lit reflects asynchronously) so this works in React.\n if (step.current) {\n if (!currentAssigned) {\n currentAssigned = true;\n } else {\n step.current = false;\n }\n }\n\n // Set first\n if (i === 0) {\n step.setAttribute(\"first\", \"\");\n } else {\n step.removeAttribute(\"first\");\n }\n\n // Set previous\n if (step.current) {\n foundCurrent = true;\n step.previous = false;\n } else if (!foundCurrent) {\n step.previous = true;\n } else {\n step.previous = false;\n }\n\n // Handle selected, respect first instance\n if (step.selected) {\n if (foundCurrent || selectedAssigned) {\n step.selected = false;\n } else {\n selectedAssigned = true;\n }\n }\n\n // Handle compact expanded\n if (this.isCompactExpanded) {\n step.setAttribute(\"isCompactExpanded\", \"\");\n } else {\n step.removeAttribute(\"isCompactExpanded\");\n }\n });\n\n // Selected fallback\n if (!selectedAssigned) {\n if (currentAssigned) {\n steps.forEach((step) => {\n if (step.current && !selectedAssigned) {\n step.setAttribute(\"selected\", \"\");\n selectedAssigned = true;\n }\n });\n } else if (steps.length > 0) {\n // If no current or selected, mark first as both current and selected\n steps[0].setAttribute(\"current\", \"\");\n steps[0].setAttribute(\"selected\", \"\");\n }\n }\n\n // Always update counter\n this._updateCounter();\n }\n\n private _toggleCompact() {\n this.isCompactExpanded = !this.isCompactExpanded;\n }\n\n private _handleCounterKeydown(event: KeyboardEvent) {\n if (event.key === \" \" || event.key === \"Enter\") {\n event.preventDefault();\n this._toggleCompact();\n }\n }\n\n render() {\n return html`\n <div class=\"cob-stepper\" name=${this.name}>\n <div class=\"cob-stepper__header\">\n <slot name=\"actions\" @slotchange=${this._validateButtonSlot}></slot>\n <div class=\"cob-stepper__headertext\">\n <div class=\"cob-stepper__label\">${this.label}</div>\n <div\n class=\"cob-stepper__counter\"\n @click=${this._toggleCompact}\n @keydown=${this._handleCounterKeydown}\n role=\"button\"\n tabindex=\"0\"\n aria-label=${this.isCompactExpanded\n ? \"Collapse step navigation to view the form\"\n : `Expand step navigation. You are on ${this.counterText}`}\n aria-expanded=${this.isCompactExpanded ? \"true\" : \"false\"}\n >\n ${this.counterText}\n </div>\n </div>\n </div>\n <slot class=\"cob-stepper__steps\"></slot>\n </div>\n `;\n }\n}\n\nif (!customElements.get(\"cob-stepper\")) {\n customElements.define(\"cob-stepper\", CobStepper);\n}\n"],"names":["_CobStep","LitElement","event","html","unsafeCSS","styles","CobStep","__decorateClass","property","stepperIdCounter","_CobStepper","clickedStep","el","steps","currentIndex","step","clickedIndex","child","isStep","isSlotActionsContainer","assignedElements","div","button","newCounterText","selectedIndex","totalSteps","index","foundCurrent","selectedAssigned","currentAssigned","CobStepper"],"mappings":";;;;;;;;;;;;;;;;;;AAiFO,MAAMA,IAAN,MAAMA,UAAgBC,EAAW;AAAA,EAAjC,cAAA;AAAA,UAAA,GAAA,SAAA,GAQuC,KAAA,WAAW,IAGX,KAAA,UAAU,IAG1B,KAAA,QAAQ,IAOR,KAAA,OAAO,IAOS,KAAA,WAAW,IAG1B,KAAA,oBAAoB,IAMrB,KAAA,aAAa;AAAA,EAAA;AAAA,EAEjC,gBAAgB,GAAU;AAEhC,IAAI,OAAO,KAAK,WAAY,cAC1B,KAAK,QAAQ,CAAC;AAIhB,UAAMC,IAAQ,IAAI,YAAY,kBAAkB;AAAA,MAC9C,SAAS;AAAA,MACT,UAAU;AAAA,MACV,YAAY;AAAA,MACZ,QAAQ,EAAE,MAAM,KAAK,MAAM,OAAO,KAAK,MAAA;AAAA,IAAM,CAC9C;AAED,KAAK,KAAK,aAAa,UAAU,KAAK,KAAK,YAAY,CAAC,KAAK,aAC3D,KAAK,cAAcA,CAAK,GAGpB,CAACA,EAAM,oBAAoB,KAAK,SAClC,OAAO,SAAS,OAAO,KAAK;AAAA,EAGlC;AAAA,EAEQ,eAAe,GAAkB;AACvC,KAAI,EAAE,QAAQ,WAAW,EAAE,QAAQ,SACjC,EAAE,eAAA,GACF,KAAK,gBAAgB,CAAC;AAAA,EAE1B;AAAA,EAEA,SAAS;AACP,WAAOC;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6CAEF,KAAK,mBAAmB;AAAA;AAAA,8CAEvB,KAAK,KAAK;AAAA;AAAA;AAAA,uBAGjC,KAAK,cAAc;AAAA,yBACjB,KAAK,qBAAqB;AAAA;AAAA;AAAA,2BAGxB,KAAK,oBACd,8CACA,sCAAsC,KAAK,WAAW,EAAE;AAAA,8BAC5C,KAAK,oBAAoB,SAAS,OAAO;AAAA;AAAA,gBAEvD,KAAK,WAAW;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAO9B;AACF;AAtREO,EAAO,SAASN,EAAUC,CAAM;AAD3B,IAAMyB,IAANpB;AAIsCH,EAAA;AAAA,EAA1CC,EAAS,EAAE,MAAM,QAAQ,SAAS,IAAM;AAAA,GAJ9BsB,EAIgC,WAAA,IAAA;AAGAvB,EAAA;AAAA,EAA1CC,EAAS,EAAE,MAAM,QAAQ,SAAS,IAAM;AAAA,GAP9BsB,EAOgC,WAAA,MAAA;AAGfvB,EAAA;AAAA,EAA3BC,EAAS,EAAE,MAAM,OAAA,CAAQ;AAAA,GAVfsB,EAUiB,WAAA,OAAA;AAGAvB,EAAA;AAAA,EAA3BC,EAAS,EAAE,MAAM,OAAA,CAAQ;AAAA,GAbfsB,EAaiB,WAAA,aAAA;AAI5BvB,EAAA;AAAA,EADCC,EAAS,EAAE,MAAM,SAAS,SAAS,IAAM;AAAA,GAhB/BsB,EAiBX,WAAA,mBAAA;AAwQG,eAAe,IAAI,aAAa,KACnC,eAAe,OAAO,eAAeA,CAAU;"}
|
package/package.json
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@cobwds/cob-stepper",
|
|
3
|
+
"version": "1.19.3",
|
|
4
|
+
"description": "The Stepper component from the City of Boston Web Design System.",
|
|
5
|
+
"module": "dist/cob-stepper.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"import": "./dist/cob-stepper.js",
|
|
10
|
+
"types": "./dist/index.d.ts"
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
"type": "module",
|
|
14
|
+
"files": [
|
|
15
|
+
"dist/"
|
|
16
|
+
],
|
|
17
|
+
"scripts": {
|
|
18
|
+
"dev": "tsc --emitDeclarationOnly && vite",
|
|
19
|
+
"build": "vite build",
|
|
20
|
+
"test": "vite build && wtr",
|
|
21
|
+
"build:watch": "tsc --emitDeclarationOnly && vite build --watch",
|
|
22
|
+
"test:watch": "vite build && wtr --watch",
|
|
23
|
+
"lit-analyze": "lit-analyzer '**/*.ts'"
|
|
24
|
+
},
|
|
25
|
+
"dependencies": {
|
|
26
|
+
"@cobwds/cob-button": "^1.19.3"
|
|
27
|
+
},
|
|
28
|
+
"devDependencies": {
|
|
29
|
+
"lit": "^3.3.1",
|
|
30
|
+
"typescript": "^5.9.3",
|
|
31
|
+
"vite": "^7.3.1"
|
|
32
|
+
},
|
|
33
|
+
"keywords": [
|
|
34
|
+
"city-of-boston",
|
|
35
|
+
"design-system",
|
|
36
|
+
"web-components",
|
|
37
|
+
"lit",
|
|
38
|
+
"cob",
|
|
39
|
+
"stepper",
|
|
40
|
+
"forms"
|
|
41
|
+
],
|
|
42
|
+
"author": "City of Boston Web Design System Team",
|
|
43
|
+
"license": "MIT",
|
|
44
|
+
"sideEffects": true,
|
|
45
|
+
"peerDependencies": {
|
|
46
|
+
"lit": "^3.3.1"
|
|
47
|
+
}
|
|
48
|
+
}
|