@prioticket/design-system-web 1.0.0
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/COMPONENT-DOCUMENTATION.md +608 -0
- package/README.md +229 -0
- package/component-documentation.json +1681 -0
- package/dist/components/pd-button.cjs.js +99 -0
- package/dist/components/pd-button.es.js +156 -0
- package/dist/components/pd-card.cjs.js +59 -0
- package/dist/components/pd-card.es.js +93 -0
- package/dist/components/pd-checkbox.cjs.js +85 -0
- package/dist/components/pd-checkbox.es.js +154 -0
- package/dist/components/pd-chip.cjs.js +118 -0
- package/dist/components/pd-chip.es.js +220 -0
- package/dist/components/pd-dialog.cjs.js +195 -0
- package/dist/components/pd-dialog.es.js +285 -0
- package/dist/components/pd-expandable-card.cjs.js +134 -0
- package/dist/components/pd-expandable-card.es.js +205 -0
- package/dist/components/pd-fab.cjs.js +119 -0
- package/dist/components/pd-fab.es.js +179 -0
- package/dist/components/pd-icon-button.cjs.js +159 -0
- package/dist/components/pd-icon-button.es.js +268 -0
- package/dist/components/pd-icon.cjs.js +71 -0
- package/dist/components/pd-icon.es.js +102 -0
- package/dist/components/pd-list.cjs.js +108 -0
- package/dist/components/pd-list.es.js +229 -0
- package/dist/components/pd-menu-item.cjs.js +85 -0
- package/dist/components/pd-menu-item.es.js +156 -0
- package/dist/components/pd-menu.cjs.js +42 -0
- package/dist/components/pd-menu.es.js +122 -0
- package/dist/components/pd-progress.cjs.js +72 -0
- package/dist/components/pd-progress.es.js +119 -0
- package/dist/components/pd-radio.cjs.js +38 -0
- package/dist/components/pd-radio.es.js +153 -0
- package/dist/components/pd-segmented-button.cjs.js +135 -0
- package/dist/components/pd-segmented-button.es.js +234 -0
- package/dist/components/pd-segmented-stepper.cjs.js +191 -0
- package/dist/components/pd-segmented-stepper.es.js +333 -0
- package/dist/components/pd-select.cjs.js +59 -0
- package/dist/components/pd-select.es.js +136 -0
- package/dist/components/pd-slider.cjs.js +42 -0
- package/dist/components/pd-slider.es.js +123 -0
- package/dist/components/pd-stepper.cjs.js +279 -0
- package/dist/components/pd-stepper.es.js +375 -0
- package/dist/components/pd-switch.cjs.js +57 -0
- package/dist/components/pd-switch.es.js +126 -0
- package/dist/components/pd-tabs.cjs.js +32 -0
- package/dist/components/pd-tabs.es.js +139 -0
- package/dist/components/pd-text-field.cjs.js +86 -0
- package/dist/components/pd-text-field.es.js +202 -0
- package/dist/design-system-web.css +1 -0
- package/dist/fonts/ProximaNova-Bold.woff2 +0 -0
- package/dist/fonts/ProximaNova-Extrabld.woff2 +0 -0
- package/dist/fonts/ProximaNova-Light.woff2 +0 -0
- package/dist/fonts/ProximaNova-Medium.woff2 +0 -0
- package/dist/fonts/ProximaNova-Regular.woff2 +0 -0
- package/dist/fonts/ProximaNova-Semibold.woff2 +0 -0
- package/dist/fonts/ProximaNovaCond-Semibold.woff2 +0 -0
- package/dist/fonts-only.css +59 -0
- package/dist/fonts.cjs.js +1 -0
- package/dist/fonts.es.js +1 -0
- package/dist/prioticket-design-system-web.cjs.js +1 -0
- package/dist/prioticket-design-system-web.es.js +52 -0
- package/dist/theme-only.css +311 -0
- package/dist/theme-with-fonts.cjs.js +1 -0
- package/dist/theme-with-fonts.css +372 -0
- package/dist/theme-with-fonts.es.js +2 -0
- package/dist/theme.cjs.js +1 -0
- package/dist/theme.es.js +1 -0
- package/dist/types/components/pd-button.d.ts +30 -0
- package/dist/types/components/pd-card.d.ts +8 -0
- package/dist/types/components/pd-checkbox.d.ts +16 -0
- package/dist/types/components/pd-chip.d.ts +26 -0
- package/dist/types/components/pd-dialog.d.ts +49 -0
- package/dist/types/components/pd-expandable-card.d.ts +39 -0
- package/dist/types/components/pd-fab.d.ts +17 -0
- package/dist/types/components/pd-icon-button.d.ts +24 -0
- package/dist/types/components/pd-icon.d.ts +9 -0
- package/dist/types/components/pd-list.d.ts +36 -0
- package/dist/types/components/pd-menu-item.d.ts +38 -0
- package/dist/types/components/pd-menu.d.ts +58 -0
- package/dist/types/components/pd-progress.d.ts +30 -0
- package/dist/types/components/pd-radio.d.ts +54 -0
- package/dist/types/components/pd-segmented-button.d.ts +53 -0
- package/dist/types/components/pd-segmented-stepper.d.ts +65 -0
- package/dist/types/components/pd-select.d.ts +46 -0
- package/dist/types/components/pd-slider.d.ts +43 -0
- package/dist/types/components/pd-stepper.d.ts +47 -0
- package/dist/types/components/pd-switch.d.ts +37 -0
- package/dist/types/components/pd-tabs.d.ts +54 -0
- package/dist/types/components/pd-text-field.d.ts +30 -0
- package/dist/types/fonts.d.ts +1 -0
- package/dist/types/index.d.ts +22 -0
- package/dist/types/theme-with-fonts.d.ts +2 -0
- package/dist/types/theme.d.ts +1 -0
- package/package.json +93 -0
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
import { css as u, LitElement as p, html as d } from "lit";
|
|
2
|
+
import { property as n, state as g, customElement as h } from "lit/decorators.js";
|
|
3
|
+
import "@material/web/icon/icon.js";
|
|
4
|
+
var y = Object.defineProperty, b = Object.getOwnPropertyDescriptor, t = (a, e, s, i) => {
|
|
5
|
+
for (var o = i > 1 ? void 0 : i ? b(e, s) : e, c = a.length - 1, m; c >= 0; c--)
|
|
6
|
+
(m = a[c]) && (o = (i ? m(e, s, o) : m(o)) || o);
|
|
7
|
+
return i && o && y(e, s, o), o;
|
|
8
|
+
};
|
|
9
|
+
let r = class extends p {
|
|
10
|
+
constructor() {
|
|
11
|
+
super(...arguments), this.multiSelect = !1, this.size = "medium", this.disabled = !1, this.selectedValues = [], this._segments = [];
|
|
12
|
+
}
|
|
13
|
+
connectedCallback() {
|
|
14
|
+
super.connectedCallback(), this.addEventListener("segment-click", this._handleSegmentClick);
|
|
15
|
+
}
|
|
16
|
+
disconnectedCallback() {
|
|
17
|
+
super.disconnectedCallback(), this.removeEventListener("segment-click", this._handleSegmentClick);
|
|
18
|
+
}
|
|
19
|
+
firstUpdated() {
|
|
20
|
+
this._updateSegments();
|
|
21
|
+
}
|
|
22
|
+
_updateSegments() {
|
|
23
|
+
const a = this.querySelectorAll("pd-segment-item");
|
|
24
|
+
this._segments = Array.from(a), this._segments.forEach((e, s) => {
|
|
25
|
+
e.disabled = this.disabled || e.disabled, e.setAttribute("data-segment-index", s.toString()), this.selectedValues.includes(e.value) && (e.selected = !0);
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
_handleSegmentClick(a) {
|
|
29
|
+
if (this.disabled) return;
|
|
30
|
+
const e = a.target, s = e.value;
|
|
31
|
+
this.multiSelect ? this.selectedValues.indexOf(s) > -1 ? (this.selectedValues = this.selectedValues.filter((o) => o !== s), e.selected = !1) : (this.selectedValues = [...this.selectedValues, s], e.selected = !0) : this.selectedValues[0] === s ? (this.selectedValues = [], e.selected = !1) : (this._segments.forEach((i) => i.selected = !1), this.selectedValues = [s], e.selected = !0), this.dispatchEvent(new CustomEvent("selectionchange", {
|
|
32
|
+
detail: {
|
|
33
|
+
selectedValues: this.selectedValues,
|
|
34
|
+
multiSelect: this.multiSelect
|
|
35
|
+
},
|
|
36
|
+
bubbles: !0,
|
|
37
|
+
composed: !0
|
|
38
|
+
}));
|
|
39
|
+
}
|
|
40
|
+
render() {
|
|
41
|
+
return d`
|
|
42
|
+
<div class="segmented-button" role="group">
|
|
43
|
+
<slot @slotchange=${this._updateSegments}></slot>
|
|
44
|
+
</div>
|
|
45
|
+
`;
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
r.styles = u`
|
|
49
|
+
:host {
|
|
50
|
+
display: inline-flex;
|
|
51
|
+
font-family: var(--md-sys-typescale-body-large-font, 'Proxima Nova', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.segmented-button {
|
|
55
|
+
display: inline-flex;
|
|
56
|
+
border-radius: var(--md-segmented-button-shape, var(--md-sys-shape-corner-small, 20px));
|
|
57
|
+
border: 1px solid var(--md-sys-color-outline, #79747e);
|
|
58
|
+
overflow: hidden;
|
|
59
|
+
background: var(--md-sys-color-surface, #fef7ff);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
:host([disabled]) .segmented-button {
|
|
63
|
+
border-color: var(--md-sys-color-on-surface-opacity-12, rgba(29, 27, 32, 0.12));
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/* Size variants */
|
|
67
|
+
:host([size='small']) {
|
|
68
|
+
--md-segmented-button-container-height: var(--md-sys-button-container-height-small, 2rem);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
:host([size='medium']) {
|
|
72
|
+
--md-segmented-button-container-height: var(--md-sys-button-container-height-medium, 2.5rem);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
:host([size='large']) {
|
|
76
|
+
--md-segmented-button-container-height: var(--md-sys-button-container-height-large, 3rem);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
::slotted(pd-segment-item) {
|
|
80
|
+
border-right: 1px solid var(--md-sys-color-outline, #79747e);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
::slotted(pd-segment-item:last-child) {
|
|
84
|
+
border-right: none;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
:host([disabled]) ::slotted(pd-segment-item) {
|
|
88
|
+
border-right-color: var(--md-sys-color-on-surface-opacity-12, rgba(29, 27, 32, 0.12));
|
|
89
|
+
}
|
|
90
|
+
`;
|
|
91
|
+
t([
|
|
92
|
+
n({ type: Boolean, attribute: "multi-select" })
|
|
93
|
+
], r.prototype, "multiSelect", 2);
|
|
94
|
+
t([
|
|
95
|
+
n({ type: String, reflect: !0 })
|
|
96
|
+
], r.prototype, "size", 2);
|
|
97
|
+
t([
|
|
98
|
+
n({ type: Boolean, reflect: !0 })
|
|
99
|
+
], r.prototype, "disabled", 2);
|
|
100
|
+
t([
|
|
101
|
+
n({ type: Array })
|
|
102
|
+
], r.prototype, "selectedValues", 2);
|
|
103
|
+
t([
|
|
104
|
+
g()
|
|
105
|
+
], r.prototype, "_segments", 2);
|
|
106
|
+
r = t([
|
|
107
|
+
h("pd-segmented-button")
|
|
108
|
+
], r);
|
|
109
|
+
let l = class extends p {
|
|
110
|
+
constructor() {
|
|
111
|
+
super(...arguments), this.value = "", this.selected = !1, this.disabled = !1, this.icon = "", this.iconOnly = !1;
|
|
112
|
+
}
|
|
113
|
+
_handleClick() {
|
|
114
|
+
this.disabled || this.dispatchEvent(new CustomEvent("segment-click", {
|
|
115
|
+
detail: { value: this.value },
|
|
116
|
+
bubbles: !0,
|
|
117
|
+
composed: !0
|
|
118
|
+
}));
|
|
119
|
+
}
|
|
120
|
+
render() {
|
|
121
|
+
return d`
|
|
122
|
+
<button
|
|
123
|
+
class="segment ${this.selected ? "selected" : ""} ${this.iconOnly ? "icon-only" : ""}"
|
|
124
|
+
?disabled=${this.disabled}
|
|
125
|
+
@click=${this._handleClick}
|
|
126
|
+
aria-pressed=${this.selected}
|
|
127
|
+
>
|
|
128
|
+
${this.icon ? d`<md-icon class="segment-icon">${this.icon}</md-icon>` : ""}
|
|
129
|
+
${this.iconOnly ? "" : d`<span class="segment-label"><slot></slot></span>`}
|
|
130
|
+
</button>
|
|
131
|
+
`;
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
l.styles = u`
|
|
135
|
+
:host {
|
|
136
|
+
display: inline-flex;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.segment {
|
|
140
|
+
display: inline-flex;
|
|
141
|
+
align-items: center;
|
|
142
|
+
justify-content: center;
|
|
143
|
+
gap: var(--md-sys-spacing-200, 8px);
|
|
144
|
+
padding: 0 var(--md-sys-spacing-400, 16px);
|
|
145
|
+
height: var(--md-segmented-button-container-height, 2.5rem);
|
|
146
|
+
border: none;
|
|
147
|
+
background: transparent;
|
|
148
|
+
color: var(--md-sys-color-on-surface, #1d1b20);
|
|
149
|
+
font-family: inherit;
|
|
150
|
+
font-size: var(--md-sys-typescale-label-large-size, 0.875rem);
|
|
151
|
+
font-weight: var(--md-sys-typescale-label-large-weight, 500);
|
|
152
|
+
cursor: pointer;
|
|
153
|
+
transition: all 150ms ease-in-out;
|
|
154
|
+
position: relative;
|
|
155
|
+
outline: none;
|
|
156
|
+
min-width: 48px;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.segment.icon-only {
|
|
160
|
+
padding: 0;
|
|
161
|
+
width: var(--md-segmented-button-container-height, 2.5rem);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
.segment:hover:not(:disabled) {
|
|
165
|
+
background: var(--md-sys-color-on-surface-opacity-08, rgba(29, 27, 32, 0.08));
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.segment:focus-visible {
|
|
169
|
+
background: var(--md-sys-color-on-surface-opacity-12, rgba(29, 27, 32, 0.12));
|
|
170
|
+
outline: 2px solid var(--md-sys-color-primary, #6750a4);
|
|
171
|
+
outline-offset: -2px;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
.segment:active:not(:disabled) {
|
|
175
|
+
background: var(--md-sys-color-on-surface-opacity-12, rgba(29, 27, 32, 0.12));
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
.segment.selected {
|
|
179
|
+
background: var(--md-sys-color-secondary-container, #e8def8);
|
|
180
|
+
color: var(--md-sys-color-on-secondary-container, #1d192b);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
.segment.selected:hover:not(:disabled) {
|
|
184
|
+
background: var(--md-sys-color-secondary-container, #e8def8);
|
|
185
|
+
filter: brightness(0.95);
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
.segment:disabled {
|
|
189
|
+
color: var(--md-sys-color-on-surface-opacity-38, rgba(29, 27, 32, 0.38));
|
|
190
|
+
cursor: not-allowed;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
.segment.selected:disabled {
|
|
194
|
+
background: var(--md-sys-color-on-surface-opacity-12, rgba(29, 27, 32, 0.12));
|
|
195
|
+
color: var(--md-sys-color-on-surface-opacity-38, rgba(29, 27, 32, 0.38));
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
.segment-icon {
|
|
199
|
+
--md-icon-size: 18px;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
.segment-label {
|
|
203
|
+
white-space: nowrap;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
/* Accessibility */
|
|
207
|
+
@media (prefers-reduced-motion: reduce) {
|
|
208
|
+
.segment {
|
|
209
|
+
transition: none;
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
`;
|
|
213
|
+
t([
|
|
214
|
+
n({ type: String })
|
|
215
|
+
], l.prototype, "value", 2);
|
|
216
|
+
t([
|
|
217
|
+
n({ type: Boolean, reflect: !0 })
|
|
218
|
+
], l.prototype, "selected", 2);
|
|
219
|
+
t([
|
|
220
|
+
n({ type: Boolean, reflect: !0 })
|
|
221
|
+
], l.prototype, "disabled", 2);
|
|
222
|
+
t([
|
|
223
|
+
n({ type: String })
|
|
224
|
+
], l.prototype, "icon", 2);
|
|
225
|
+
t([
|
|
226
|
+
n({ type: Boolean, attribute: "icon-only" })
|
|
227
|
+
], l.prototype, "iconOnly", 2);
|
|
228
|
+
l = t([
|
|
229
|
+
h("pd-segment-item")
|
|
230
|
+
], l);
|
|
231
|
+
export {
|
|
232
|
+
l as PdSegmentItem,
|
|
233
|
+
r as PdSegmentedButton
|
|
234
|
+
};
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("lit"),r=require("lit/decorators.js");require("@material/web/icon/icon.js");var n=Object.defineProperty,d=Object.getOwnPropertyDescriptor,i=(p,e,t,s)=>{for(var a=s>1?void 0:s?d(e,t):e,c=p.length-1,l;c>=0;c--)(l=p[c])&&(a=(s?l(e,t,a):l(a))||a);return s&&a&&n(e,t,a),a};exports.PdSegmentedStepper=class extends o.LitElement{constructor(){super(...arguments),this.activeStep=0,this.completedSteps=[],this.size="medium",this.disabled=!1,this.allowStepNavigation=!0,this._steps=[]}connectedCallback(){super.connectedCallback(),this.addEventListener("stepper-item-click",this._handleStepClick)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("stepper-item-click",this._handleStepClick)}firstUpdated(){this._updateSteps()}updated(e){super.updated(e),(e.has("activeStep")||e.has("completedSteps")||e.has("disabled")||e.has("allowStepNavigation"))&&this._updateSteps()}_updateSteps(){const e=this.querySelectorAll("pd-stepper-item");this._steps=Array.from(e),this._steps.forEach((t,s)=>{t.disabled=this.disabled||t.disabled,t.setAttribute("data-step-index",s.toString()),t.stepNumber=s+1,this.completedSteps.includes(s)?t.state="completed":s===this.activeStep?t.state="active":t.state="pending",t.clickable=this.allowStepNavigation&&(t.state==="completed"||t.state==="active"&&!this.disabled)})}_handleStepClick(e){if(this.disabled)return;const t=e.target,s=parseInt(t.getAttribute("data-step-index")||"0");this.allowStepNavigation&&(this.completedSteps.includes(s)||s===this.activeStep)&&this.goToStep(s)}goToStep(e){if(e>=0&&e<this._steps.length){const t=this.activeStep;this.activeStep=e,this._updateSteps(),this.dispatchEvent(new CustomEvent("stepchange",{detail:{activeStep:this.activeStep,previousStep:t,totalSteps:this._steps.length},bubbles:!0,composed:!0}))}}nextStep(){this.activeStep<this._steps.length-1&&this.goToStep(this.activeStep+1)}previousStep(){this.activeStep>0&&this.goToStep(this.activeStep-1)}completeCurrentStep(){this.completeStep(this.activeStep)}completeStep(e){this.completedSteps.includes(e)||(this.completedSteps=[...this.completedSteps,e].sort((t,s)=>t-s),this._updateSteps(),this.dispatchEvent(new CustomEvent("stepcomplete",{detail:{completedStep:e,completedSteps:this.completedSteps,totalSteps:this._steps.length},bubbles:!0,composed:!0}))),e===this.activeStep&&this.activeStep<this._steps.length-1&&this.nextStep()}reset(){this.activeStep=0,this.completedSteps=[],this._updateSteps()}render(){return o.html`
|
|
2
|
+
<div class="segmented-stepper" role="group" aria-label="Progress stepper">
|
|
3
|
+
<slot @slotchange=${this._updateSteps}></slot>
|
|
4
|
+
</div>
|
|
5
|
+
`}};exports.PdSegmentedStepper.styles=o.css`
|
|
6
|
+
:host {
|
|
7
|
+
display: inline-flex;
|
|
8
|
+
font-family: var(--md-sys-typescale-body-large-font, 'Proxima Nova', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.segmented-stepper {
|
|
12
|
+
display: inline-flex;
|
|
13
|
+
border-radius: var(--md-sys-shape-corner-small, 8px);
|
|
14
|
+
border: 1px solid var(--md-sys-color-outline-variant, #cac4d0);
|
|
15
|
+
overflow: hidden;
|
|
16
|
+
background: var(--md-sys-color-surface, #fef7ff);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
:host([disabled]) .segmented-stepper {
|
|
20
|
+
border-color: var(--md-sys-color-on-surface-opacity-12, rgba(29, 27, 32, 0.12));
|
|
21
|
+
background: var(--md-sys-color-surface-variant, #e7e0ec);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/* Size variants */
|
|
25
|
+
:host([size='small']) {
|
|
26
|
+
--md-stepper-container-height: var(--md-sys-button-container-height-small, 2rem);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
:host([size='medium']) {
|
|
30
|
+
--md-stepper-container-height: var(--md-sys-button-container-height-medium, 2.5rem);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
:host([size='large']) {
|
|
34
|
+
--md-stepper-container-height: var(--md-sys-button-container-height-large, 3rem);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
::slotted(pd-stepper-item) {
|
|
38
|
+
border-right: 1px solid var(--md-sys-color-outline-variant, #cac4d0);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
::slotted(pd-stepper-item:last-child) {
|
|
42
|
+
border-right: none;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
:host([disabled]) ::slotted(pd-stepper-item) {
|
|
46
|
+
border-right-color: var(--md-sys-color-on-surface-opacity-12, rgba(29, 27, 32, 0.12));
|
|
47
|
+
}
|
|
48
|
+
`;i([r.property({type:Number,attribute:"active-step"})],exports.PdSegmentedStepper.prototype,"activeStep",2);i([r.property({type:Array,attribute:"completed-steps"})],exports.PdSegmentedStepper.prototype,"completedSteps",2);i([r.property({type:String,reflect:!0})],exports.PdSegmentedStepper.prototype,"size",2);i([r.property({type:Boolean,reflect:!0})],exports.PdSegmentedStepper.prototype,"disabled",2);i([r.property({type:Boolean,attribute:"allow-step-navigation"})],exports.PdSegmentedStepper.prototype,"allowStepNavigation",2);i([r.state()],exports.PdSegmentedStepper.prototype,"_steps",2);exports.PdSegmentedStepper=i([r.customElement("pd-segmented-stepper")],exports.PdSegmentedStepper);exports.PdStepperItem=class extends o.LitElement{constructor(){super(...arguments),this.stepNumber=1,this.state="pending",this.disabled=!1,this.clickable=!1,this.icon=""}_handleClick(){this.disabled||!this.clickable||this.dispatchEvent(new CustomEvent("stepper-item-click",{detail:{stepNumber:this.stepNumber},bubbles:!0,composed:!0}))}render(){const e=this.state==="completed"&&!this.icon,t=this.state!=="completed"&&!this.icon;return o.html`
|
|
49
|
+
<button
|
|
50
|
+
class="step ${this.state} ${this.clickable?"clickable":""}"
|
|
51
|
+
?disabled=${this.disabled}
|
|
52
|
+
@click=${this._handleClick}
|
|
53
|
+
aria-current=${this.state==="active"?"step":"false"}
|
|
54
|
+
aria-label="Step ${this.stepNumber}: ${this.state}"
|
|
55
|
+
>
|
|
56
|
+
<div class="step-indicator">
|
|
57
|
+
${e?o.html`<md-icon class="check-icon">check</md-icon>`:""}
|
|
58
|
+
${this.icon?o.html`<md-icon class="step-icon">${this.icon}</md-icon>`:""}
|
|
59
|
+
${t?o.html`<span class="step-number">${this.stepNumber}</span>`:""}
|
|
60
|
+
</div>
|
|
61
|
+
<span class="step-label"><slot></slot></span>
|
|
62
|
+
</button>
|
|
63
|
+
`}};exports.PdStepperItem.styles=o.css`
|
|
64
|
+
:host {
|
|
65
|
+
display: inline-flex;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.step {
|
|
69
|
+
display: inline-flex;
|
|
70
|
+
align-items: center;
|
|
71
|
+
gap: var(--md-sys-spacing-200, 8px);
|
|
72
|
+
padding: 0 var(--md-sys-spacing-300, 12px);
|
|
73
|
+
height: var(--md-stepper-container-height, 2.5rem);
|
|
74
|
+
border: none;
|
|
75
|
+
background: transparent;
|
|
76
|
+
color: var(--md-sys-color-on-surface-variant, #49454f);
|
|
77
|
+
font-family: inherit;
|
|
78
|
+
font-size: var(--md-sys-typescale-label-large-size, 0.875rem);
|
|
79
|
+
font-weight: var(--md-sys-typescale-label-large-weight, 500);
|
|
80
|
+
cursor: default;
|
|
81
|
+
transition: all 150ms ease-in-out;
|
|
82
|
+
position: relative;
|
|
83
|
+
outline: none;
|
|
84
|
+
min-width: fit-content;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.step.clickable {
|
|
88
|
+
cursor: pointer;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.step.clickable:hover:not(:disabled) {
|
|
92
|
+
background: var(--md-sys-color-surface-container-highest, rgba(29, 27, 32, 0.08));
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.step.clickable:focus-visible {
|
|
96
|
+
background: var(--md-sys-color-surface-container-highest, rgba(29, 27, 32, 0.12));
|
|
97
|
+
outline: 2px solid var(--md-sys-color-primary, #6750a4);
|
|
98
|
+
outline-offset: -2px;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.step.clickable:active:not(:disabled) {
|
|
102
|
+
background: var(--md-sys-color-surface-container-highest, rgba(29, 27, 32, 0.16));
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/* Step states */
|
|
106
|
+
.step.pending {
|
|
107
|
+
color: var(--md-sys-color-on-surface-variant, #49454f);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.step.active {
|
|
111
|
+
background: var(--md-sys-color-primary-container, #eaddff);
|
|
112
|
+
color: var(--md-sys-color-on-primary-container, #21005d);
|
|
113
|
+
font-weight: 600;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.step.completed {
|
|
117
|
+
background: var(--md-sys-color-secondary-container, #e8def8);
|
|
118
|
+
color: var(--md-sys-color-on-secondary-container, #1d192b);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.step.disabled {
|
|
122
|
+
color: var(--md-sys-color-on-surface-opacity-38, rgba(29, 27, 32, 0.38));
|
|
123
|
+
cursor: not-allowed;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/* Step indicator */
|
|
127
|
+
.step-indicator {
|
|
128
|
+
display: flex;
|
|
129
|
+
align-items: center;
|
|
130
|
+
justify-content: center;
|
|
131
|
+
width: 20px;
|
|
132
|
+
height: 20px;
|
|
133
|
+
border-radius: 50%;
|
|
134
|
+
background: var(--md-sys-color-outline-variant, #cac4d0);
|
|
135
|
+
color: var(--md-sys-color-on-surface, #1d1b20);
|
|
136
|
+
font-size: 0.75rem;
|
|
137
|
+
font-weight: 600;
|
|
138
|
+
flex-shrink: 0;
|
|
139
|
+
transition: all 150ms ease-in-out;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.step.pending .step-indicator {
|
|
143
|
+
background: var(--md-sys-color-outline-variant, #cac4d0);
|
|
144
|
+
color: var(--md-sys-color-on-surface-variant, #49454f);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.step.active .step-indicator {
|
|
148
|
+
background: var(--md-sys-color-primary, #6750a4);
|
|
149
|
+
color: var(--md-sys-color-on-primary, #ffffff);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.step.completed .step-indicator {
|
|
153
|
+
background: var(--md-sys-color-secondary, #625b71);
|
|
154
|
+
color: var(--md-sys-color-on-secondary, #ffffff);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.step.disabled .step-indicator {
|
|
158
|
+
background: var(--md-sys-color-on-surface-opacity-12, rgba(29, 27, 32, 0.12));
|
|
159
|
+
color: var(--md-sys-color-on-surface-opacity-38, rgba(29, 27, 32, 0.38));
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/* Icons */
|
|
163
|
+
.check-icon,
|
|
164
|
+
.step-icon {
|
|
165
|
+
--md-icon-size: 14px;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.step-number {
|
|
169
|
+
font-size: 0.75rem;
|
|
170
|
+
font-weight: 600;
|
|
171
|
+
line-height: 1;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
.step-label {
|
|
175
|
+
white-space: nowrap;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
/* Accessibility */
|
|
179
|
+
@media (prefers-reduced-motion: reduce) {
|
|
180
|
+
.step,
|
|
181
|
+
.step-indicator {
|
|
182
|
+
transition: none;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
/* Focus ring for keyboard navigation */
|
|
187
|
+
.step:focus-visible {
|
|
188
|
+
outline: 2px solid var(--md-sys-color-primary, #6750a4);
|
|
189
|
+
outline-offset: 2px;
|
|
190
|
+
}
|
|
191
|
+
`;i([r.property({type:Number,attribute:"step-number"})],exports.PdStepperItem.prototype,"stepNumber",2);i([r.property({type:String,reflect:!0})],exports.PdStepperItem.prototype,"state",2);i([r.property({type:Boolean,reflect:!0})],exports.PdStepperItem.prototype,"disabled",2);i([r.property({type:Boolean})],exports.PdStepperItem.prototype,"clickable",2);i([r.property({type:String})],exports.PdStepperItem.prototype,"icon",2);exports.PdStepperItem=i([r.customElement("pd-stepper-item")],exports.PdStepperItem);
|