@momentum-design/components 0.95.6 → 0.95.8
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/browser/index.js +526 -320
- package/dist/browser/index.js.map +4 -4
- package/dist/components/buttonsimple/buttonsimple.component.js +5 -4
- package/dist/components/cardcheckbox/cardcheckbox.component.js +3 -2
- package/dist/components/cardradio/cardradio.component.js +3 -2
- package/dist/components/checkbox/checkbox.component.js +2 -1
- package/dist/components/input/input.component.js +2 -1
- package/dist/components/option/option.styles.js +2 -0
- package/dist/components/radio/radio.component.js +3 -2
- package/dist/components/searchfield/searchfield.component.js +3 -2
- package/dist/components/stepperconnector/index.d.ts +7 -0
- package/dist/components/stepperconnector/index.js +4 -0
- package/dist/components/stepperconnector/stepperconnector.component.d.ts +31 -0
- package/dist/components/stepperconnector/stepperconnector.component.js +60 -0
- package/dist/components/stepperconnector/stepperconnector.constants.d.ts +14 -0
- package/dist/components/stepperconnector/stepperconnector.constants.js +15 -0
- package/dist/components/stepperconnector/stepperconnector.styles.d.ts +2 -0
- package/dist/components/stepperconnector/stepperconnector.styles.js +38 -0
- package/dist/components/stepperconnector/stepperconnector.types.d.ts +5 -0
- package/dist/components/stepperconnector/stepperconnector.types.js +1 -0
- package/dist/components/stepperitem/index.d.ts +9 -0
- package/dist/components/stepperitem/index.js +6 -0
- package/dist/components/stepperitem/stepperitem.component.d.ts +107 -0
- package/dist/components/stepperitem/stepperitem.component.js +199 -0
- package/dist/components/stepperitem/stepperitem.constants.d.ts +22 -0
- package/dist/components/stepperitem/stepperitem.constants.js +23 -0
- package/dist/components/stepperitem/stepperitem.styles.d.ts +2 -0
- package/dist/components/stepperitem/stepperitem.styles.js +157 -0
- package/dist/components/stepperitem/stepperitem.types.d.ts +11 -0
- package/dist/components/stepperitem/stepperitem.types.js +1 -0
- package/dist/components/toggle/toggle.component.js +2 -1
- package/dist/custom-elements.json +1112 -727
- package/dist/index.d.ts +3 -1
- package/dist/index.js +3 -1
- package/dist/react/index.d.ts +4 -2
- package/dist/react/index.js +4 -2
- package/dist/react/stepperconnector/index.d.ts +15 -0
- package/dist/react/stepperconnector/index.js +24 -0
- package/dist/react/stepperitem/index.d.ts +40 -0
- package/dist/react/stepperitem/index.js +48 -0
- package/dist/utils/keys.d.ts +12 -12
- package/package.json +1 -1
@@ -13,6 +13,7 @@ import { Component } from '../../models';
|
|
13
13
|
import { DisabledMixin } from '../../utils/mixins/DisabledMixin';
|
14
14
|
import { TabIndexMixin } from '../../utils/mixins/TabIndexMixin';
|
15
15
|
import { AutoFocusMixin } from '../../utils/mixins/AutoFocusMixin';
|
16
|
+
import { KEYS } from '../../utils/keys';
|
16
17
|
import { BUTTON_TYPE, DEFAULTS } from './buttonsimple.constants';
|
17
18
|
import styles from './buttonsimple.styles';
|
18
19
|
/**
|
@@ -181,9 +182,9 @@ class Buttonsimple extends AutoFocusMixin(TabIndexMixin(DisabledMixin(Component)
|
|
181
182
|
* @param event - The keyboard event.
|
182
183
|
*/
|
183
184
|
handleKeyDown(event) {
|
184
|
-
if ([
|
185
|
+
if ([KEYS.ENTER, KEYS.SPACE].includes(event.key)) {
|
185
186
|
this.classList.add('pressed');
|
186
|
-
if (event.key ===
|
187
|
+
if (event.key === KEYS.ENTER) {
|
187
188
|
this.triggerClickEvent();
|
188
189
|
}
|
189
190
|
// preventing the default event behavior for space key
|
@@ -201,9 +202,9 @@ class Buttonsimple extends AutoFocusMixin(TabIndexMixin(DisabledMixin(Component)
|
|
201
202
|
* @param event - The keyboard event.
|
202
203
|
*/
|
203
204
|
handleKeyUp(event) {
|
204
|
-
if ([
|
205
|
+
if ([KEYS.ENTER, KEYS.SPACE].includes(event.key)) {
|
205
206
|
this.classList.remove('pressed');
|
206
|
-
if (event.key ===
|
207
|
+
if (event.key === KEYS.SPACE) {
|
207
208
|
this.triggerClickEvent();
|
208
209
|
}
|
209
210
|
}
|
@@ -13,6 +13,7 @@ import { DisabledMixin } from '../../utils/mixins/DisabledMixin';
|
|
13
13
|
import { TabIndexMixin } from '../../utils/mixins/TabIndexMixin';
|
14
14
|
import Card from '../card/card.component';
|
15
15
|
import { ROLE } from '../../utils/roles';
|
16
|
+
import { KEYS } from '../../utils/keys';
|
16
17
|
import { CHECK_MARK, DEFAULTS, SELECTION_TYPE } from './cardcheckbox.constants';
|
17
18
|
import styles from './cardcheckbox.styles';
|
18
19
|
/**
|
@@ -89,7 +90,7 @@ class CardCheckbox extends DisabledMixin(TabIndexMixin(Card)) {
|
|
89
90
|
* @param event - The keyboard event
|
90
91
|
*/
|
91
92
|
toggleOnEnter(event) {
|
92
|
-
if (event.key ===
|
93
|
+
if (event.key === KEYS.ENTER) {
|
93
94
|
this.toggleChecked();
|
94
95
|
}
|
95
96
|
}
|
@@ -98,7 +99,7 @@ class CardCheckbox extends DisabledMixin(TabIndexMixin(Card)) {
|
|
98
99
|
* @param event - The keyboard event
|
99
100
|
*/
|
100
101
|
toggleOnSpace(event) {
|
101
|
-
if (event.key ===
|
102
|
+
if (event.key === KEYS.SPACE) {
|
102
103
|
this.toggleChecked();
|
103
104
|
}
|
104
105
|
}
|
@@ -14,6 +14,7 @@ import { DisabledMixin } from '../../utils/mixins/DisabledMixin';
|
|
14
14
|
import { TabIndexMixin } from '../../utils/mixins/TabIndexMixin';
|
15
15
|
import Card from '../card/card.component';
|
16
16
|
import { ROLE } from '../../utils/roles';
|
17
|
+
import { KEYS } from '../../utils/keys';
|
17
18
|
import styles from './cardradio.styles';
|
18
19
|
/**
|
19
20
|
* cardradio component extends `mdc-card` and supports radio selection interaction addtionally.
|
@@ -126,7 +127,7 @@ class CardRadio extends DisabledMixin(TabIndexMixin(Card)) {
|
|
126
127
|
const prevIndex = (currentIndex - 1 + enabledCards.length) % enabledCards.length;
|
127
128
|
this.updateCardRadio(enabledCards, prevIndex);
|
128
129
|
}
|
129
|
-
if (event.key ===
|
130
|
+
if (event.key === KEYS.ENTER) {
|
130
131
|
this.toggleChecked();
|
131
132
|
}
|
132
133
|
}
|
@@ -135,7 +136,7 @@ class CardRadio extends DisabledMixin(TabIndexMixin(Card)) {
|
|
135
136
|
* @param event - The keyboard event
|
136
137
|
*/
|
137
138
|
toggleOnSpace(event) {
|
138
|
-
if (event.key ===
|
139
|
+
if (event.key === KEYS.SPACE) {
|
139
140
|
this.toggleChecked();
|
140
141
|
}
|
141
142
|
}
|
@@ -10,6 +10,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
10
10
|
import { html, nothing } from 'lit';
|
11
11
|
import { property } from 'lit/decorators.js';
|
12
12
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
13
|
+
import { KEYS } from '../../utils/keys';
|
13
14
|
import { DataAriaLabelMixin } from '../../utils/mixins/DataAriaLabelMixin';
|
14
15
|
import { FormInternalsMixin } from '../../utils/mixins/FormInternalsMixin';
|
15
16
|
import FormfieldWrapper from '../formfieldwrapper/formfieldwrapper.component';
|
@@ -140,7 +141,7 @@ class Checkbox extends FormInternalsMixin(DataAriaLabelMixin(FormfieldWrapper))
|
|
140
141
|
*/
|
141
142
|
handleKeyDown(event) {
|
142
143
|
var _a;
|
143
|
-
if (event.key ===
|
144
|
+
if (event.key === KEYS.ENTER) {
|
144
145
|
(_a = this.form) === null || _a === void 0 ? void 0 : _a.requestSubmit();
|
145
146
|
}
|
146
147
|
}
|
@@ -15,6 +15,7 @@ import FormfieldWrapper from '../formfieldwrapper';
|
|
15
15
|
import { DEFAULTS as FORMFIELD_DEFAULTS } from '../formfieldwrapper/formfieldwrapper.constants';
|
16
16
|
import { DataAriaLabelMixin } from '../../utils/mixins/DataAriaLabelMixin';
|
17
17
|
import { FormInternalsMixin } from '../../utils/mixins/FormInternalsMixin';
|
18
|
+
import { KEYS } from '../../utils/keys';
|
18
19
|
import { AUTO_CAPITALIZE, AUTO_COMPLETE, DEFAULTS, PREFIX_TEXT_OPTIONS } from './input.constants';
|
19
20
|
import styles from './input.styles';
|
20
21
|
/**
|
@@ -193,7 +194,7 @@ class Input extends FormInternalsMixin(DataAriaLabelMixin(FormfieldWrapper)) {
|
|
193
194
|
*/
|
194
195
|
handleKeyDown(event) {
|
195
196
|
var _a;
|
196
|
-
if (event.key ===
|
197
|
+
if (event.key === KEYS.ENTER) {
|
197
198
|
(_a = this.form) === null || _a === void 0 ? void 0 : _a.requestSubmit();
|
198
199
|
}
|
199
200
|
}
|
@@ -16,6 +16,7 @@ import { DataAriaLabelMixin } from '../../utils/mixins/DataAriaLabelMixin';
|
|
16
16
|
import { FormInternalsMixin } from '../../utils/mixins/FormInternalsMixin';
|
17
17
|
import { DEFAULTS as FORMFIELD_DEFAULTS } from '../formfieldwrapper/formfieldwrapper.constants';
|
18
18
|
import { ROLE } from '../../utils/roles';
|
19
|
+
import { KEYS } from '../../utils/keys';
|
19
20
|
import styles from './radio.styles';
|
20
21
|
/**
|
21
22
|
* Radio allow users to select single options from a list or turn an item/feature on or off.
|
@@ -238,11 +239,11 @@ class Radio extends FormInternalsMixin(DataAriaLabelMixin(FormfieldWrapper)) {
|
|
238
239
|
const prevIndex = (currentIndex - 1 + enabledRadios.length) % enabledRadios.length;
|
239
240
|
this.updateRadio(enabledRadios, prevIndex, event);
|
240
241
|
}
|
241
|
-
else if (event.key ===
|
242
|
+
else if (event.key === KEYS.SPACE) {
|
242
243
|
this.updateRadio(enabledRadios, currentIndex, event);
|
243
244
|
}
|
244
245
|
this.updateTabIndex();
|
245
|
-
if (event.key ===
|
246
|
+
if (event.key === KEYS.ENTER) {
|
246
247
|
(_a = this.form) === null || _a === void 0 ? void 0 : _a.requestSubmit();
|
247
248
|
}
|
248
249
|
}
|
@@ -11,6 +11,7 @@ import { html } from 'lit';
|
|
11
11
|
import { queryAssignedElements, state } from 'lit/decorators.js';
|
12
12
|
import { classMap } from 'lit-html/directives/class-map.js';
|
13
13
|
import Input from '../input/input.component';
|
14
|
+
import { KEYS } from '../../utils/keys';
|
14
15
|
import styles from './searchfield.styles';
|
15
16
|
import { DEFAULTS } from './searchfield.constants';
|
16
17
|
/**
|
@@ -110,8 +111,8 @@ class Searchfield extends Input {
|
|
110
111
|
<div
|
111
112
|
part="filters-container"
|
112
113
|
@click=${() => this.inputElement.focus()}
|
113
|
-
@keydown=${(e) => (e.key ===
|
114
|
-
@keyup=${(e) => (e.key ===
|
114
|
+
@keydown=${(e) => (e.key === KEYS.ENTER ? this.inputElement.focus() : null)}
|
115
|
+
@keyup=${(e) => (e.key === KEYS.SPACE ? this.inputElement.focus() : null)}
|
115
116
|
>
|
116
117
|
<slot name="filters" @slotchange=${this.renderInputChips}></slot>
|
117
118
|
</div>
|
@@ -0,0 +1,31 @@
|
|
1
|
+
import type { CSSResult } from 'lit';
|
2
|
+
import { Component } from '../../models';
|
3
|
+
import type { OrientationType, StatusType } from './stepperconnector.types';
|
4
|
+
/**
|
5
|
+
* StepperConnector component visually represents the connection between two stepper items.
|
6
|
+
* Indicates whether the connection is complete or incomplete, and supports vertical or horizontal orientation.
|
7
|
+
* They are used between 2 `mdc-stepperitem` components to visually connect them and wrapped in a `mdc-stepper` component.
|
8
|
+
*
|
9
|
+
* @tagname mdc-stepperconnector
|
10
|
+
*
|
11
|
+
* @csspart connector - The main connector line between steps
|
12
|
+
*
|
13
|
+
* @cssproperty --mdc-stepperconnector-complete-background - Background color for the complete connector
|
14
|
+
* @cssproperty --mdc-stepperconnector-incomplete-background - Background color for the incomplete connector
|
15
|
+
*/
|
16
|
+
declare class StepperConnector extends Component {
|
17
|
+
/**
|
18
|
+
* The status of the connector (complete or incomplete)
|
19
|
+
* @default "incomplete"
|
20
|
+
*/
|
21
|
+
status: StatusType;
|
22
|
+
/**
|
23
|
+
* The orientation of the connector (vertical or horizontal)
|
24
|
+
* @default "horizontal"
|
25
|
+
*/
|
26
|
+
orientation: OrientationType;
|
27
|
+
updated(changedProperties: Map<string, unknown>): void;
|
28
|
+
render(): import("lit-html").TemplateResult<1>;
|
29
|
+
static styles: Array<CSSResult>;
|
30
|
+
}
|
31
|
+
export default StepperConnector;
|
@@ -0,0 +1,60 @@
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
6
|
+
};
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
9
|
+
};
|
10
|
+
import { html } from 'lit';
|
11
|
+
import { property } from 'lit/decorators.js';
|
12
|
+
import { Component } from '../../models';
|
13
|
+
import { DEFAULTS } from './stepperconnector.constants';
|
14
|
+
import styles from './stepperconnector.styles';
|
15
|
+
/**
|
16
|
+
* StepperConnector component visually represents the connection between two stepper items.
|
17
|
+
* Indicates whether the connection is complete or incomplete, and supports vertical or horizontal orientation.
|
18
|
+
* They are used between 2 `mdc-stepperitem` components to visually connect them and wrapped in a `mdc-stepper` component.
|
19
|
+
*
|
20
|
+
* @tagname mdc-stepperconnector
|
21
|
+
*
|
22
|
+
* @csspart connector - The main connector line between steps
|
23
|
+
*
|
24
|
+
* @cssproperty --mdc-stepperconnector-complete-background - Background color for the complete connector
|
25
|
+
* @cssproperty --mdc-stepperconnector-incomplete-background - Background color for the incomplete connector
|
26
|
+
*/
|
27
|
+
class StepperConnector extends Component {
|
28
|
+
constructor() {
|
29
|
+
super(...arguments);
|
30
|
+
/**
|
31
|
+
* The status of the connector (complete or incomplete)
|
32
|
+
* @default "incomplete"
|
33
|
+
*/
|
34
|
+
this.status = DEFAULTS.STATUS;
|
35
|
+
/**
|
36
|
+
* The orientation of the connector (vertical or horizontal)
|
37
|
+
* @default "horizontal"
|
38
|
+
*/
|
39
|
+
this.orientation = DEFAULTS.ORIENTATION;
|
40
|
+
}
|
41
|
+
updated(changedProperties) {
|
42
|
+
super.updated(changedProperties);
|
43
|
+
if (changedProperties.has('orientation')) {
|
44
|
+
this.ariaOrientation = this.orientation;
|
45
|
+
}
|
46
|
+
}
|
47
|
+
render() {
|
48
|
+
return html ` <div part="connector"></div> `;
|
49
|
+
}
|
50
|
+
}
|
51
|
+
StepperConnector.styles = [...Component.styles, ...styles];
|
52
|
+
__decorate([
|
53
|
+
property({ type: String, reflect: true }),
|
54
|
+
__metadata("design:type", String)
|
55
|
+
], StepperConnector.prototype, "status", void 0);
|
56
|
+
__decorate([
|
57
|
+
property({ type: String, reflect: true }),
|
58
|
+
__metadata("design:type", String)
|
59
|
+
], StepperConnector.prototype, "orientation", void 0);
|
60
|
+
export default StepperConnector;
|
@@ -0,0 +1,14 @@
|
|
1
|
+
declare const STATUS: {
|
2
|
+
readonly COMPLETE: "complete";
|
3
|
+
readonly INCOMPLETE: "incomplete";
|
4
|
+
};
|
5
|
+
declare const ORIENTATION: {
|
6
|
+
readonly VERTICAL: "vertical";
|
7
|
+
readonly HORIZONTAL: "horizontal";
|
8
|
+
};
|
9
|
+
declare const DEFAULTS: {
|
10
|
+
readonly STATUS: "incomplete";
|
11
|
+
readonly ORIENTATION: "horizontal";
|
12
|
+
};
|
13
|
+
declare const TAG_NAME: "mdc-stepperconnector";
|
14
|
+
export { TAG_NAME, STATUS, ORIENTATION, DEFAULTS };
|
@@ -0,0 +1,15 @@
|
|
1
|
+
import utils from '../../utils/tag-name';
|
2
|
+
const STATUS = {
|
3
|
+
COMPLETE: 'complete',
|
4
|
+
INCOMPLETE: 'incomplete',
|
5
|
+
};
|
6
|
+
const ORIENTATION = {
|
7
|
+
VERTICAL: 'vertical',
|
8
|
+
HORIZONTAL: 'horizontal',
|
9
|
+
};
|
10
|
+
const DEFAULTS = {
|
11
|
+
STATUS: STATUS.INCOMPLETE,
|
12
|
+
ORIENTATION: ORIENTATION.HORIZONTAL,
|
13
|
+
};
|
14
|
+
const TAG_NAME = utils.constructTagName('stepperconnector');
|
15
|
+
export { TAG_NAME, STATUS, ORIENTATION, DEFAULTS };
|
@@ -0,0 +1,38 @@
|
|
1
|
+
import { css } from 'lit';
|
2
|
+
const styles = css `
|
3
|
+
:host {
|
4
|
+
--mdc-stepperconnector-complete-background: var(--mds-color-theme-outline-theme-normal);
|
5
|
+
--mdc-stepperconnector-incomplete-background: var(--mds-color-theme-outline-primary-normal);
|
6
|
+
display: block;
|
7
|
+
width: 100%;
|
8
|
+
height: 100%;
|
9
|
+
}
|
10
|
+
:host::part(connector) {
|
11
|
+
width: 100%;
|
12
|
+
height: 0.0625rem;
|
13
|
+
background: var(--mdc-stepperconnector-incomplete-background);
|
14
|
+
}
|
15
|
+
:host([status='complete'])::part(connector) {
|
16
|
+
background: var(--mdc-stepperconnector-complete-background);
|
17
|
+
}
|
18
|
+
:host([orientation='vertical'])::part(connector) {
|
19
|
+
width: 0.0625rem;
|
20
|
+
height: 100%;
|
21
|
+
}
|
22
|
+
|
23
|
+
@media (forced-colors: active) {
|
24
|
+
:host([orientation='horizontal'])::part(connector) {
|
25
|
+
border-top: 1px solid var(--mdc-stepperconnector-incomplete-background);
|
26
|
+
}
|
27
|
+
:host([status='complete'][orientation='horizontal'])::part(connector) {
|
28
|
+
border-top: 1px solid var(--mdc-stepperconnector-complete-background);
|
29
|
+
}
|
30
|
+
:host([orientation='vertical'])::part(connector) {
|
31
|
+
border-left: 1px solid var(--mdc-stepperconnector-incomplete-background);
|
32
|
+
}
|
33
|
+
:host([status='complete'][orientation='vertical'])::part(connector) {
|
34
|
+
border-left: 1px solid var(--mdc-stepperconnector-complete-background);
|
35
|
+
}
|
36
|
+
}
|
37
|
+
`;
|
38
|
+
export default [styles];
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1,107 @@
|
|
1
|
+
import { CSSResult } from 'lit';
|
2
|
+
import { Component } from '../../models';
|
3
|
+
import type { StatusType, VariantType } from './stepperitem.types';
|
4
|
+
declare const StepperItem_base: import("../../utils/mixins/index.types").Constructor<import("../../utils/mixins/TabIndexMixin").TabIndexMixinInterface> & typeof Component;
|
5
|
+
/**
|
6
|
+
* stepperitem component is used to represent a single step in a stepper component. It is used within a `mdc-stepper` component to indicate the current step in a process.
|
7
|
+
* It can have different statuses such as `completed`, `current`, `incomplete`, `error-current`, and `error-incomplete`.
|
8
|
+
* The component supports various visual styles and can be customized with labels, help text, and step numbers.
|
9
|
+
*
|
10
|
+
* This is an uncontrolled component, meaning it does not manage its own state. Instead, it relies on the consumer's to manage the state of each step.
|
11
|
+
* Make sure to set `aria-current="step"` on the current stepper item. It is applicable only when status is `current` or `error-current`. This ensures accessibility for the stepper component. Only one stepper item should have this attribute at a time.
|
12
|
+
*
|
13
|
+
* @dependency mdc-icon
|
14
|
+
* @dependency mdc-text
|
15
|
+
*
|
16
|
+
* @tagname mdc-stepperitem
|
17
|
+
*
|
18
|
+
* @event click - (React: onClick) This event is dispatched when the stepperitem is clicked.
|
19
|
+
* @event keydown - (React: onKeyDown) This event is dispatched when a key is pressed down on the stepperitem.
|
20
|
+
* @event keyup - (React: onKeyUp) This event is dispatched when a key is released on the stepperitem.
|
21
|
+
*
|
22
|
+
* @csspart status-container - The container for the status icon or step number.
|
23
|
+
* @csspart label-container - The container for the label and help text.
|
24
|
+
* @csspart help-text-container - The container for the help text and error icon when applicable.
|
25
|
+
* @csspart status-icon - The icon representing the status of the stepper item.
|
26
|
+
* @csspart step-number - The text representing the step number.
|
27
|
+
* @csspart label - The text representing the label of the stepper item.
|
28
|
+
* @csspart help-text - The text providing additional information about the stepper item.
|
29
|
+
* @csspart help-icon - The icon representing an error in the stepper item.
|
30
|
+
*
|
31
|
+
* @cssproperty --mdc-stepperitem-status-container-background - The background color of the status container.
|
32
|
+
* @cssproperty --mdc-stepperitem-status-container-border-color - The border color of the status container.
|
33
|
+
* @cssproperty --mdc-stepperitem-label-color - The color of the label text.
|
34
|
+
* @cssproperty --mdc-stepperitem-help-text-color - The color of the optional label text.
|
35
|
+
* @cssproperty --mdc-stepperitem-label-container-background - The background color of the label container.
|
36
|
+
*/
|
37
|
+
declare class StepperItem extends StepperItem_base {
|
38
|
+
/**
|
39
|
+
* The variant of the stepper item, which can be `inline` or `stacked`.
|
40
|
+
* @default 'inline'
|
41
|
+
*/
|
42
|
+
variant: VariantType;
|
43
|
+
/**
|
44
|
+
* The status of the stepper item, which can be `completed`, `current`, `not-started`, `error-current`, or `error-incomplete`.
|
45
|
+
* @default 'not-started'
|
46
|
+
*/
|
47
|
+
status: StatusType;
|
48
|
+
/**
|
49
|
+
* The label for the stepper item, which is displayed as the main text of the step.
|
50
|
+
* This label is typically used to describe the step or action that the step represents.
|
51
|
+
* @default ''
|
52
|
+
*/
|
53
|
+
label: string;
|
54
|
+
/**
|
55
|
+
* Additional informational text that appears below the label
|
56
|
+
* This text is optional and can be used to provide more context or instructions for the step.
|
57
|
+
* @default ''
|
58
|
+
*/
|
59
|
+
helpText?: string;
|
60
|
+
/**
|
61
|
+
* The step number for the stepper item, which is displayed as a numeric indicator of the step's position in the sequence.
|
62
|
+
* This is useful for indicating the order of steps in a process.
|
63
|
+
* @default ''
|
64
|
+
*/
|
65
|
+
stepNumber?: number;
|
66
|
+
connectedCallback(): void;
|
67
|
+
constructor();
|
68
|
+
/**
|
69
|
+
* Handles the keydown event on the stepperitem.
|
70
|
+
* If the key is 'Enter' or 'Space', the stepperitem is pressed.
|
71
|
+
* If the key is 'Enter', the stepperitem is pressed. The native HTML button works in the same way.
|
72
|
+
* If the key is 'Space', the stepperitem's default is prevent to avoid scrolling etc in the host application.
|
73
|
+
*
|
74
|
+
* @param event - The keyboard event.
|
75
|
+
*/
|
76
|
+
private handleKeyDown;
|
77
|
+
/**
|
78
|
+
* Triggers a click event on the stepper item.
|
79
|
+
*/
|
80
|
+
private triggerClickEvent;
|
81
|
+
/**
|
82
|
+
* Handles the keyup event on the stepperitem.
|
83
|
+
* If the key is 'Enter' or 'Space', the stepperitem is clicked.
|
84
|
+
* If the key is 'Space', the stepperitem is pressed. The native HTML button works in the same way.
|
85
|
+
*
|
86
|
+
* @param event - The keyboard event.
|
87
|
+
*/
|
88
|
+
private handleKeyUp;
|
89
|
+
/**
|
90
|
+
* Renders the status icon based on the current status of the stepper item.
|
91
|
+
* - If the status is `completed`, it renders a check icon.
|
92
|
+
* - If the status is `current` or `error-current`, it renders a pencil icon.
|
93
|
+
* - If the status is `not-started` or `error-incomplete`, it renders the step number.
|
94
|
+
* - If the status is anything else, it renders nothing.
|
95
|
+
* @returns A template literal that renders the status icon based on the current status of the stepper item.
|
96
|
+
*/
|
97
|
+
private renderStatusIcon;
|
98
|
+
/**
|
99
|
+
* Renders the help text for the stepper item.
|
100
|
+
* If the `helpText` property is not set, it returns nothing.
|
101
|
+
* @returns A template literal that renders the help text for the stepper item.
|
102
|
+
*/
|
103
|
+
private renderHelpText;
|
104
|
+
render(): import("lit-html").TemplateResult<1>;
|
105
|
+
static styles: Array<CSSResult>;
|
106
|
+
}
|
107
|
+
export default StepperItem;
|