@govtechsg/sgds-web-component 3.18.0 → 3.18.1-rc.1

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.
Files changed (50) hide show
  1. package/components/Stepper/index.d.ts +2 -0
  2. package/components/Stepper/index.js +2 -0
  3. package/components/Stepper/index.js.map +1 -1
  4. package/components/Stepper/index.umd.min.js +46 -23
  5. package/components/Stepper/index.umd.min.js.map +1 -1
  6. package/components/Stepper/sgds-step.d.ts +42 -0
  7. package/components/Stepper/sgds-step.js +117 -0
  8. package/components/Stepper/sgds-step.js.map +1 -0
  9. package/components/Stepper/sgds-stepper.d.ts +23 -2
  10. package/components/Stepper/sgds-stepper.js +87 -13
  11. package/components/Stepper/sgds-stepper.js.map +1 -1
  12. package/components/Stepper/step.js +6 -0
  13. package/components/Stepper/step.js.map +1 -0
  14. package/components/Stepper/stepper.js +1 -1
  15. package/components/Stepper/types.d.ts +1 -0
  16. package/components/index.d.ts +1 -0
  17. package/components/index.js +1 -0
  18. package/components/index.js.map +1 -1
  19. package/components/index.umd.min.js +38 -15
  20. package/components/index.umd.min.js.map +1 -1
  21. package/css/fouc.css +1 -0
  22. package/custom-elements.json +201 -5
  23. package/index.umd.min.js +62 -39
  24. package/index.umd.min.js.map +1 -1
  25. package/package.json +1 -1
  26. package/react/components/Stepper/sgds-step.cjs.js +123 -0
  27. package/react/components/Stepper/sgds-step.cjs.js.map +1 -0
  28. package/react/components/Stepper/sgds-step.js +118 -0
  29. package/react/components/Stepper/sgds-step.js.map +1 -0
  30. package/react/components/Stepper/sgds-stepper.cjs.js +86 -12
  31. package/react/components/Stepper/sgds-stepper.cjs.js.map +1 -1
  32. package/react/components/Stepper/sgds-stepper.js +87 -13
  33. package/react/components/Stepper/sgds-stepper.js.map +1 -1
  34. package/react/components/Stepper/step.cjs.js +11 -0
  35. package/react/components/Stepper/step.cjs.js.map +1 -0
  36. package/react/components/Stepper/step.js +7 -0
  37. package/react/components/Stepper/step.js.map +1 -0
  38. package/react/components/Stepper/stepper.cjs.js +1 -1
  39. package/react/components/Stepper/stepper.js +1 -1
  40. package/react/index.cjs.js +40 -38
  41. package/react/index.cjs.js.map +1 -1
  42. package/react/index.d.ts +1 -0
  43. package/react/index.js +1 -0
  44. package/react/index.js.map +1 -1
  45. package/react/step/index.cjs.js +40 -0
  46. package/react/step/index.cjs.js.map +1 -0
  47. package/react/step/index.d.ts +2 -0
  48. package/react/step/index.js +16 -0
  49. package/react/step/index.js.map +1 -0
  50. package/types/react.d.ts +18 -3
@@ -0,0 +1,42 @@
1
+ import SgdsElement from "../../base/sgds-element";
2
+ import SgdsIcon from "../Icon/sgds-icon";
3
+ /**
4
+ * @summary A step within a stepper component
5
+ * @slot default - Additional content to display under the step header
6
+ *
7
+ */
8
+ export declare class SgdsStep extends SgdsElement {
9
+ static styles: import("lit").CSSResult[];
10
+ /** @internal */
11
+ static dependencies: {
12
+ "sgds-icon": typeof SgdsIcon;
13
+ };
14
+ /** The header text for the step */
15
+ stepHeader: string;
16
+ /** Optional icon name to display instead of step number */
17
+ iconName: string | undefined;
18
+ /** Optional component to render for this step */
19
+ component: unknown;
20
+ /** @internal The index of this step within the stepper */
21
+ stepIndex: number;
22
+ /** @internal Whether this step is currently active */
23
+ active: boolean;
24
+ /** @internal Whether this step is currently disabled */
25
+ disabled: boolean;
26
+ /** @internal Whether this step is completed */
27
+ completed: boolean;
28
+ /** @internal Whether this step is clickable */
29
+ isClickable: boolean;
30
+ /** @internal Orientation of parent stepper (horizontal or vertical) */
31
+ orientation: "horizontal" | "vertical";
32
+ /** @internal Whether this step is the first sgds-step of its type in the slot */
33
+ isFirstOfType: boolean;
34
+ /** @internal Whether this step is completed */
35
+ _isCompleted: boolean;
36
+ render(): import("lit").TemplateResult<1>;
37
+ /**@internal */
38
+ _handleClick(): void;
39
+ /**@internal */
40
+ _handleKeyDown(event: KeyboardEvent): void;
41
+ }
42
+ export default SgdsStep;
@@ -0,0 +1,117 @@
1
+ import { __decorate } from 'tslib';
2
+ import { html } from 'lit';
3
+ import { property } from 'lit/decorators.js';
4
+ import { classMap } from 'lit/directives/class-map.js';
5
+ import SgdsElement from '../../base/sgds-element.js';
6
+ import { SgdsIcon } from '../Icon/sgds-icon.js';
7
+ import css_248z from './step.js';
8
+
9
+ /**
10
+ * @summary A step within a stepper component
11
+ * @slot default - Additional content to display under the step header
12
+ *
13
+ */
14
+ class SgdsStep extends SgdsElement {
15
+ constructor() {
16
+ super(...arguments);
17
+ /** The header text for the step */
18
+ this.stepHeader = "";
19
+ /** @internal The index of this step within the stepper */
20
+ this.stepIndex = 0;
21
+ /** @internal Whether this step is currently active */
22
+ this.active = false;
23
+ /** @internal Whether this step is currently disabled */
24
+ this.disabled = false;
25
+ /** @internal Whether this step is completed */
26
+ this.completed = false;
27
+ /** @internal Whether this step is clickable */
28
+ this.isClickable = false;
29
+ /** @internal Orientation of parent stepper (horizontal or vertical) */
30
+ this.orientation = "horizontal";
31
+ /** @internal Whether this step is the first sgds-step of its type in the slot */
32
+ this.isFirstOfType = false;
33
+ /** @internal Whether this step is completed */
34
+ this._isCompleted = false;
35
+ }
36
+ render() {
37
+ const isValidClickable = !this.disabled && this.isClickable;
38
+ return html `
39
+ <div class="stepper-item-container">
40
+ <div
41
+ class="stepper-item ${classMap({
42
+ first: this.isFirstOfType,
43
+ active: this.active,
44
+ completed: this._isCompleted,
45
+ clickable: this.isClickable,
46
+ vertical: this.orientation === "vertical",
47
+ disabled: this.disabled
48
+ })}"
49
+ tabindex=${isValidClickable ? "0" : "-1"}
50
+ aria-current=${this.active ? "step" : "false"}
51
+ aria-disabled=${this.disabled || (!this.active && !this._isCompleted) ? "true" : "false"}
52
+ @click="${isValidClickable ? () => this._handleClick() : null}"
53
+ @keydown=${isValidClickable ? (e) => this._handleKeyDown(e) : null}
54
+ >
55
+ <div class="stepper-marker">
56
+ ${this.iconName ? html `<sgds-icon name=${this.iconName} size="md"></sgds-icon>` : this.stepIndex + 1}
57
+ </div>
58
+
59
+ <div class="stepper-detail">
60
+ <div class="stepper-label">${this.stepHeader}</div>
61
+
62
+ <slot class="stepper-slot"></slot>
63
+ </div>
64
+ </div>
65
+ </div>
66
+ `;
67
+ }
68
+ /**@internal */
69
+ _handleClick() {
70
+ this.emit("i-sgds-click", { detail: { stepIndex: this.stepIndex } });
71
+ }
72
+ /**@internal */
73
+ _handleKeyDown(event) {
74
+ if (event.key === "Enter") {
75
+ this._handleClick();
76
+ }
77
+ }
78
+ }
79
+ SgdsStep.styles = [...SgdsElement.styles, css_248z];
80
+ /** @internal */
81
+ SgdsStep.dependencies = { "sgds-icon": SgdsIcon };
82
+ __decorate([
83
+ property({ type: String, reflect: true })
84
+ ], SgdsStep.prototype, "stepHeader", void 0);
85
+ __decorate([
86
+ property({ type: String, reflect: true })
87
+ ], SgdsStep.prototype, "iconName", void 0);
88
+ __decorate([
89
+ property({ type: Object })
90
+ ], SgdsStep.prototype, "component", void 0);
91
+ __decorate([
92
+ property({ type: Number })
93
+ ], SgdsStep.prototype, "stepIndex", void 0);
94
+ __decorate([
95
+ property({ type: Boolean, reflect: true })
96
+ ], SgdsStep.prototype, "active", void 0);
97
+ __decorate([
98
+ property({ type: Boolean, reflect: true })
99
+ ], SgdsStep.prototype, "disabled", void 0);
100
+ __decorate([
101
+ property({ type: Boolean, reflect: true })
102
+ ], SgdsStep.prototype, "completed", void 0);
103
+ __decorate([
104
+ property({ type: Boolean })
105
+ ], SgdsStep.prototype, "isClickable", void 0);
106
+ __decorate([
107
+ property({ type: String })
108
+ ], SgdsStep.prototype, "orientation", void 0);
109
+ __decorate([
110
+ property({ type: Boolean })
111
+ ], SgdsStep.prototype, "isFirstOfType", void 0);
112
+ __decorate([
113
+ property({ type: Boolean })
114
+ ], SgdsStep.prototype, "_isCompleted", void 0);
115
+
116
+ export { SgdsStep, SgdsStep as default };
117
+ //# sourceMappingURL=sgds-step.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sgds-step.js","sources":["../../../src/components/Stepper/sgds-step.ts"],"sourcesContent":["import { html } from \"lit\";\nimport { property } from \"lit/decorators.js\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport SgdsElement from \"../../base/sgds-element\";\nimport SgdsIcon from \"../Icon/sgds-icon\";\nimport stepStyle from \"./step.css\";\n\n/**\n * @summary A step within a stepper component\n * @slot default - Additional content to display under the step header\n *\n */\nexport class SgdsStep extends SgdsElement {\n static styles = [...SgdsElement.styles, stepStyle];\n /** @internal */\n static dependencies = { \"sgds-icon\": SgdsIcon };\n\n /** The header text for the step */\n @property({ type: String, reflect: true })\n stepHeader = \"\";\n\n /** Optional icon name to display instead of step number */\n @property({ type: String, reflect: true })\n iconName: string | undefined;\n\n /** Optional component to render for this step */\n @property({ type: Object })\n component: unknown;\n\n /** @internal The index of this step within the stepper */\n @property({ type: Number })\n stepIndex = 0;\n\n /** @internal Whether this step is currently active */\n @property({ type: Boolean, reflect: true })\n active = false;\n\n /** @internal Whether this step is currently disabled */\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n /** @internal Whether this step is completed */\n @property({ type: Boolean, reflect: true })\n completed = false;\n\n /** @internal Whether this step is clickable */\n @property({ type: Boolean })\n isClickable = false;\n\n /** @internal Orientation of parent stepper (horizontal or vertical) */\n @property({ type: String })\n orientation: \"horizontal\" | \"vertical\" = \"horizontal\";\n\n /** @internal Whether this step is the first sgds-step of its type in the slot */\n @property({ type: Boolean })\n isFirstOfType = false;\n\n /** @internal Whether this step is completed */\n @property({ type: Boolean })\n _isCompleted = false;\n\n render() {\n const isValidClickable = !this.disabled && this.isClickable;\n\n return html`\n <div class=\"stepper-item-container\">\n <div\n class=\"stepper-item ${classMap({\n first: this.isFirstOfType,\n active: this.active,\n completed: this._isCompleted,\n clickable: this.isClickable,\n vertical: this.orientation === \"vertical\",\n disabled: this.disabled\n })}\"\n tabindex=${isValidClickable ? \"0\" : \"-1\"}\n aria-current=${this.active ? \"step\" : \"false\"}\n aria-disabled=${this.disabled || (!this.active && !this._isCompleted) ? \"true\" : \"false\"}\n @click=\"${isValidClickable ? () => this._handleClick() : null}\"\n @keydown=${isValidClickable ? (e: KeyboardEvent) => this._handleKeyDown(e) : null}\n >\n <div class=\"stepper-marker\">\n ${this.iconName ? html`<sgds-icon name=${this.iconName} size=\"md\"></sgds-icon>` : this.stepIndex + 1}\n </div>\n\n <div class=\"stepper-detail\">\n <div class=\"stepper-label\">${this.stepHeader}</div>\n\n <slot class=\"stepper-slot\"></slot>\n </div>\n </div>\n </div>\n `;\n }\n\n /**@internal */\n _handleClick() {\n this.emit(\"i-sgds-click\", { detail: { stepIndex: this.stepIndex } });\n }\n\n /**@internal */\n _handleKeyDown(event: KeyboardEvent) {\n if (event.key === \"Enter\") {\n this._handleClick();\n }\n }\n}\n\nexport default SgdsStep;\n"],"names":["stepStyle"],"mappings":";;;;;;;;AAOA;;;;AAIG;AACG,MAAO,QAAS,SAAQ,WAAW,CAAA;AAAzC,IAAA,WAAA,GAAA;;;QAOE,IAAU,CAAA,UAAA,GAAG,EAAE,CAAC;;QAYhB,IAAS,CAAA,SAAA,GAAG,CAAC,CAAC;;QAId,IAAM,CAAA,MAAA,GAAG,KAAK,CAAC;;QAIf,IAAQ,CAAA,QAAA,GAAG,KAAK,CAAC;;QAIjB,IAAS,CAAA,SAAA,GAAG,KAAK,CAAC;;QAIlB,IAAW,CAAA,WAAA,GAAG,KAAK,CAAC;;QAIpB,IAAW,CAAA,WAAA,GAA8B,YAAY,CAAC;;QAItD,IAAa,CAAA,aAAA,GAAG,KAAK,CAAC;;QAItB,IAAY,CAAA,YAAA,GAAG,KAAK,CAAC;KA+CtB;IA7CC,MAAM,GAAA;QACJ,MAAM,gBAAgB,GAAG,CAAC,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,WAAW,CAAC;AAE5D,QAAA,OAAO,IAAI,CAAA,CAAA;;;AAGiB,8BAAA,EAAA,QAAQ,CAAC;YAC7B,KAAK,EAAE,IAAI,CAAC,aAAa;YACzB,MAAM,EAAE,IAAI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AAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAIlB,UAAA,CAAA;AADC,IAAA,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;AACR,CAAA,EAAA,QAAA,CAAA,SAAA,EAAA,aAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAIpB,UAAA,CAAA;AADC,IAAA,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;AAC2B,CAAA,EAAA,QAAA,CAAA,SAAA,EAAA,aAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAItD,UAAA,CAAA;AADC,IAAA,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;AACN,CAAA,EAAA,QAAA,CAAA,SAAA,EAAA,eAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAItB,UAAA,CAAA;AADC,IAAA,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;AACP,CAAA,EAAA,QAAA,CAAA,SAAA,EAAA,cAAA,EAAA,KAAA,CAAA,CAAA;;;;"}
@@ -11,6 +11,7 @@ export type { IStepMetaData };
11
11
  * @event sgds-first-step - Emitted on hide after animation has completed. Event is fired when firstStep method is called.
12
12
  * @event sgds-arrived - Emitted right after the activeStep has updated its state, when upcoming step has arrived. Call `getMethod()` on this event to get the current step's component.
13
13
  * @event sgds-reset - Emitted right before the step is reset to its defaultActiveStep. Event is fired when reset method is called.
14
+ * @slot default - slot for sgds-step children
14
15
  *
15
16
  */
16
17
  export declare class SgdsStepper extends SgdsElement {
@@ -19,8 +20,8 @@ export declare class SgdsStepper extends SgdsElement {
19
20
  static dependencies: {
20
21
  "sgds-icon": typeof SgdsIcon;
21
22
  };
22
- /** The metadata of stepper, type `IStepMetaData`, that consist of `stepHeader: string`, `component:unknown`, `iconName:string`. `stepHeader` is the name of the step and `component` is the content that should appear at the each step. `component` is set to `unknown` to allow users to pass in their desired component based on the framework of choice. e.g. pass in your own react/angular/vue component or it can also be a text content.
23
- * It is required to populate this array to properly render the stepper. By default, stepper markers will render numbers. For icon stepper markers, pass the name of sgds icon via `iconName` key. `iconName` is optional.
23
+ /** The metadata of stepper, type `IStepMetaData`. Deprecated: use sgds-step child components instead.
24
+ * @deprecated Use sgds-step child components instead of the steps property
24
25
  */
25
26
  steps: IStepMetaData[];
26
27
  /** The current state of active step. Defaults to 0 */
@@ -29,8 +30,22 @@ export declare class SgdsStepper extends SgdsElement {
29
30
  orientation: StepperOrientation;
30
31
  /** When true, the stepper's steps will be clickable */
31
32
  clickable: boolean;
33
+ /** When true, the stepper's steps can only be clicked in a linear manner */
34
+ linear: boolean;
32
35
  /** @internal Gets or sets the default activeStep used to reset this element. The initial value corresponds to the one originally specified in the HTML that created this element. */
33
36
  defaultActiveStep: number;
37
+ /** @internal */
38
+ private _slotNodes;
39
+ /** @internal */
40
+ private _items;
41
+ private _totalSteps;
42
+ /** @internal Bound i-sgds-click handler for proper event listener removal */
43
+ private _boundHandleItemClick;
44
+ connectedCallback(): void;
45
+ /** @internal */
46
+ private _handleSlotChange;
47
+ /** @internal Updates step item properties based on active step and clickable state */
48
+ private _updateStepItems;
34
49
  /** By default, it returns the corresponding component of the current activeStep as defined in the steps metadata. To get other components, pass in your desired step number as the parameter*/
35
50
  getComponent(step?: number): unknown;
36
51
  /** Moves the active step forward one step */
@@ -48,7 +63,13 @@ export declare class SgdsStepper extends SgdsElement {
48
63
  /**@internal */
49
64
  _handleActiveStepChange(): void;
50
65
  /**@internal */
66
+ _handleClickableChange(): void;
67
+ /**@internal */
68
+ _handleOrientationChange(): void;
69
+ /**@internal */
51
70
  _handleKeyDown(event: KeyboardEvent, index: number): void;
71
+ /**@internal */
72
+ _handleStepClick(e: Event): void;
52
73
  render(): import("lit").TemplateResult<1>;
53
74
  }
54
75
  export type StepperOrientation = "horizontal" | "vertical";
@@ -1,6 +1,6 @@
1
1
  import { __decorate } from 'tslib';
2
2
  import { html } from 'lit';
3
- import { property } from 'lit/decorators.js';
3
+ import { property, queryAssignedElements } from 'lit/decorators.js';
4
4
  import { classMap } from 'lit/directives/class-map.js';
5
5
  import SgdsElement from '../../base/sgds-element.js';
6
6
  import { defaultValue } from '../../utils/defaultvalue.js';
@@ -17,13 +17,14 @@ import { SgdsIcon } from '../Icon/sgds-icon.js';
17
17
  * @event sgds-first-step - Emitted on hide after animation has completed. Event is fired when firstStep method is called.
18
18
  * @event sgds-arrived - Emitted right after the activeStep has updated its state, when upcoming step has arrived. Call `getMethod()` on this event to get the current step's component.
19
19
  * @event sgds-reset - Emitted right before the step is reset to its defaultActiveStep. Event is fired when reset method is called.
20
+ * @slot default - slot for sgds-step children
20
21
  *
21
22
  */
22
23
  class SgdsStepper extends SgdsElement {
23
24
  constructor() {
24
25
  super(...arguments);
25
- /** The metadata of stepper, type `IStepMetaData`, that consist of `stepHeader: string`, `component:unknown`, `iconName:string`. `stepHeader` is the name of the step and `component` is the content that should appear at the each step. `component` is set to `unknown` to allow users to pass in their desired component based on the framework of choice. e.g. pass in your own react/angular/vue component or it can also be a text content.
26
- * It is required to populate this array to properly render the stepper. By default, stepper markers will render numbers. For icon stepper markers, pass the name of sgds icon via `iconName` key. `iconName` is optional.
26
+ /** The metadata of stepper, type `IStepMetaData`. Deprecated: use sgds-step child components instead.
27
+ * @deprecated Use sgds-step child components instead of the steps property
27
28
  */
28
29
  this.steps = [];
29
30
  /** The current state of active step. Defaults to 0 */
@@ -32,32 +33,77 @@ class SgdsStepper extends SgdsElement {
32
33
  this.orientation = "horizontal";
33
34
  /** When true, the stepper's steps will be clickable */
34
35
  this.clickable = false;
36
+ /** When true, the stepper's steps can only be clicked in a linear manner */
37
+ this.linear = false;
35
38
  /** @internal Gets or sets the default activeStep used to reset this element. The initial value corresponds to the one originally specified in the HTML that created this element. */
36
39
  this.defaultActiveStep = 0;
40
+ this._totalSteps = 0;
41
+ /** @internal Bound i-sgds-click handler for proper event listener removal */
42
+ this._boundHandleItemClick = this._handleStepClick.bind(this);
43
+ }
44
+ connectedCallback() {
45
+ super.connectedCallback();
46
+ this._totalSteps = this.steps.length;
47
+ this.addEventListener("i-sgds-click", this._boundHandleItemClick);
48
+ }
49
+ /** @internal */
50
+ _handleSlotChange() {
51
+ this._items = this._slotNodes;
52
+ this._totalSteps = this._items.length;
53
+ this._updateStepItems();
54
+ }
55
+ /** @internal Updates step item properties based on active step and clickable state */
56
+ _updateStepItems() {
57
+ if (this._items && this._items.length > 0) {
58
+ this._items.forEach((item, index) => {
59
+ item.stepIndex = index;
60
+ item.active = this.activeStep === index;
61
+ item._isCompleted = item.completed || this.activeStep > index;
62
+ item.isClickable = this.linear
63
+ ? !item.disabled && this.clickable && (this.activeStep - 1 == index || this.activeStep + 1 == index)
64
+ : !item.disabled && this.clickable;
65
+ item.orientation = this.orientation;
66
+ if (this._items.length > 1) {
67
+ item.isFirstOfType = index === 0;
68
+ item.classList.toggle("last", index === this._items.length - 1);
69
+ }
70
+ });
71
+ }
37
72
  }
38
73
  /** By default, it returns the corresponding component of the current activeStep as defined in the steps metadata. To get other components, pass in your desired step number as the parameter*/
39
74
  getComponent(step = this.activeStep) {
40
- return this.steps[step].component;
75
+ var _a, _b;
76
+ const items = this._slotNodes.length > 1 ? this._items : this.steps;
77
+ if (items && items.length > 0) {
78
+ return (_a = items[step]) === null || _a === void 0 ? void 0 : _a.component;
79
+ }
80
+ return (_b = this.steps[step]) === null || _b === void 0 ? void 0 : _b.component;
41
81
  }
42
82
  /** Moves the active step forward one step */
43
83
  nextStep() {
84
+ var _a;
44
85
  this.emit("sgds-next-step");
45
- if (this.activeStep < this.steps.length - 1) {
46
- this.activeStep++;
86
+ if (this.activeStep < this._totalSteps - 1) {
87
+ if (!((_a = this._slotNodes[this.activeStep + 1]) === null || _a === void 0 ? void 0 : _a.disabled)) {
88
+ this.activeStep++;
89
+ }
47
90
  }
48
91
  }
49
92
  /** Moves the active step back one step */
50
93
  previousStep() {
94
+ var _a;
51
95
  this.emit("sgds-previous-step");
52
96
  if (this.activeStep > 0) {
53
- this.activeStep--;
97
+ if (!((_a = this._slotNodes[this.activeStep - 1]) === null || _a === void 0 ? void 0 : _a.disabled)) {
98
+ this.activeStep--;
99
+ }
54
100
  }
55
101
  }
56
102
  /** Changes the active step to the last step */
57
103
  lastStep() {
58
104
  this.emit("sgds-last-step");
59
- if (this.activeStep !== this.steps.length - 1) {
60
- this.activeStep = this.steps.length - 1;
105
+ if (this.activeStep !== this._totalSteps - 1) {
106
+ this.activeStep = this._totalSteps - 1;
61
107
  }
62
108
  }
63
109
  /** Changes active step to the first step */
@@ -74,21 +120,35 @@ class SgdsStepper extends SgdsElement {
74
120
  }
75
121
  /**@internal */
76
122
  _onStepperItemClick(index) {
77
- //emit an event before moving to next step
78
- if (this.activeStep > index) {
79
- this.activeStep = index;
80
- }
123
+ this.activeStep = index;
81
124
  }
82
125
  /**@internal */
83
126
  _handleActiveStepChange() {
127
+ this._updateStepItems();
84
128
  this.emit("sgds-arrived");
85
129
  }
86
130
  /**@internal */
131
+ _handleClickableChange() {
132
+ this._updateStepItems();
133
+ }
134
+ /**@internal */
135
+ _handleOrientationChange() {
136
+ this._updateStepItems();
137
+ }
138
+ /**@internal */
87
139
  _handleKeyDown(event, index) {
88
140
  if (event.key === "Enter") {
89
141
  this._onStepperItemClick(index);
90
142
  }
91
143
  }
144
+ /**@internal */
145
+ _handleStepClick(e) {
146
+ var _a;
147
+ const event = e;
148
+ e.stopPropagation();
149
+ const stepIndex = (_a = event.detail) === null || _a === void 0 ? void 0 : _a.stepIndex;
150
+ this._onStepperItemClick(stepIndex);
151
+ }
92
152
  render() {
93
153
  return html `
94
154
  <div
@@ -97,6 +157,8 @@ class SgdsStepper extends SgdsElement {
97
157
  clickable: this.clickable
98
158
  })}"
99
159
  >
160
+ <slot @slotchange=${this._handleSlotChange}></slot>
161
+
100
162
  ${this.steps.map(({ stepHeader: step, iconName }, index) => {
101
163
  return html `
102
164
  <div class="stepper-item-container">
@@ -139,12 +201,24 @@ __decorate([
139
201
  __decorate([
140
202
  property({ type: Boolean, reflect: true })
141
203
  ], SgdsStepper.prototype, "clickable", void 0);
204
+ __decorate([
205
+ property({ type: Boolean, reflect: true })
206
+ ], SgdsStepper.prototype, "linear", void 0);
142
207
  __decorate([
143
208
  defaultValue("activeStep")
144
209
  ], SgdsStepper.prototype, "defaultActiveStep", void 0);
210
+ __decorate([
211
+ queryAssignedElements()
212
+ ], SgdsStepper.prototype, "_slotNodes", void 0);
145
213
  __decorate([
146
214
  watch("activeStep", { waitUntilFirstUpdate: true })
147
215
  ], SgdsStepper.prototype, "_handleActiveStepChange", null);
216
+ __decorate([
217
+ watch("clickable", { waitUntilFirstUpdate: true })
218
+ ], SgdsStepper.prototype, "_handleClickableChange", null);
219
+ __decorate([
220
+ watch("orientation", { waitUntilFirstUpdate: true })
221
+ ], SgdsStepper.prototype, "_handleOrientationChange", null);
148
222
 
149
223
  export { SgdsStepper, SgdsStepper as default };
150
224
  //# sourceMappingURL=sgds-stepper.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"sgds-stepper.js","sources":["../../../src/components/Stepper/sgds-stepper.ts"],"sourcesContent":["import { html } from \"lit\";\nimport { property } from \"lit/decorators.js\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport SgdsElement from \"../../base/sgds-element\";\nimport { defaultValue } from \"../../utils/defaultvalue\";\nimport { watch } from \"../../utils/watch\";\nimport stepperStyle from \"./stepper.css\";\nimport SgdsIcon from \"../Icon/sgds-icon\";\nimport { IStepMetaData } from \"./types\";\nexport type { IStepMetaData };\n/**\n * @summary Steppers are used to inform users which step they are at in a form or a process\n *\n * @event sgds-next-step - Emitted right before the next step is reached. Event is fired when nextStep method is called.\n * @event sgds-previous-step - Emitted right before the previous step is reached. Event is fired when previousStep method is called.\n * @event sgds-last-step - Emitted right before the last step is reached. Event is fired when lastStep method is called.\n * @event sgds-first-step - Emitted on hide after animation has completed. Event is fired when firstStep method is called.\n * @event sgds-arrived - Emitted right after the activeStep has updated its state, when upcoming step has arrived. Call `getMethod()` on this event to get the current step's component.\n * @event sgds-reset - Emitted right before the step is reset to its defaultActiveStep. Event is fired when reset method is called.\n *\n */\nexport class SgdsStepper extends SgdsElement {\n static styles = [...SgdsElement.styles, stepperStyle];\n /** @internal */\n static dependencies = { \"sgds-icon\": SgdsIcon };\n /** The metadata of stepper, type `IStepMetaData`, that consist of `stepHeader: string`, `component:unknown`, `iconName:string`. `stepHeader` is the name of the step and `component` is the content that should appear at the each step. `component` is set to `unknown` to allow users to pass in their desired component based on the framework of choice. e.g. pass in your own react/angular/vue component or it can also be a text content.\n * It is required to populate this array to properly render the stepper. By default, stepper markers will render numbers. For icon stepper markers, pass the name of sgds icon via `iconName` key. `iconName` is optional.\n */\n @property({ type: Array })\n steps: IStepMetaData[] = [];\n\n /** The current state of active step. Defaults to 0 */\n @property({ type: Number, reflect: true })\n activeStep = 0;\n\n /** The orientation of stepper. By default, the stepper is of horizontal orientation */\n @property({ type: String, reflect: true }) orientation: StepperOrientation = \"horizontal\";\n\n /** When true, the stepper's steps will be clickable */\n @property({ type: Boolean, reflect: true }) clickable = false;\n\n /** @internal Gets or sets the default activeStep used to reset this element. The initial value corresponds to the one originally specified in the HTML that created this element. */\n @defaultValue(\"activeStep\")\n defaultActiveStep = 0;\n\n /** By default, it returns the corresponding component of the current activeStep as defined in the steps metadata. To get other components, pass in your desired step number as the parameter*/\n public getComponent(step: number = this.activeStep) {\n return this.steps[step].component;\n }\n /** Moves the active step forward one step */\n public nextStep() {\n this.emit(\"sgds-next-step\");\n if (this.activeStep < this.steps.length - 1) {\n this.activeStep++;\n }\n }\n\n /** Moves the active step back one step */\n public previousStep() {\n this.emit(\"sgds-previous-step\");\n\n if (this.activeStep > 0) {\n this.activeStep--;\n }\n }\n\n /** Changes the active step to the last step */\n public lastStep() {\n this.emit(\"sgds-last-step\");\n if (this.activeStep !== this.steps.length - 1) {\n this.activeStep = this.steps.length - 1;\n }\n }\n\n /** Changes active step to the first step */\n public firstStep() {\n this.emit(\"sgds-first-step\");\n if (this.activeStep > 0) {\n this.activeStep = 0;\n }\n }\n\n /** Resets the Stepper to its initial active step state */\n public reset() {\n this.emit(\"sgds-reset\");\n this.activeStep = this.defaultActiveStep;\n }\n\n /**@internal */\n _onStepperItemClick(index: number) {\n //emit an event before moving to next step\n if (this.activeStep > index) {\n this.activeStep = index;\n }\n }\n\n /**@internal */\n @watch(\"activeStep\", { waitUntilFirstUpdate: true })\n _handleActiveStepChange() {\n this.emit(\"sgds-arrived\");\n }\n\n /**@internal */\n _handleKeyDown(event: KeyboardEvent, index: number) {\n if (event.key === \"Enter\") {\n this._onStepperItemClick(index);\n }\n }\n\n render() {\n return html`\n <div\n class=\"stepper ${classMap({\n [`${this.orientation}`]: this.orientation,\n clickable: this.clickable\n })}\"\n >\n ${this.steps.map(({ stepHeader: step, iconName }, index) => {\n return html`\n <div class=\"stepper-item-container\">\n <div\n class=\"stepper-item ${classMap({\n \"is-active\": this.activeStep === index,\n \"is-completed\": this.activeStep > index,\n \"is-clickable\": this.clickable && this.activeStep > index\n })}\"\n tabindex=${this.clickable && this.activeStep > index ? \"0\" : \"-1\"}\n aria-current=${this.activeStep === index ? \"step\" : \"false\"}\n aria-disabled=${this.activeStep <= index ? \"true\" : \"false\"}\n @click=\"${this.clickable ? () => this._onStepperItemClick(index) : null}\"\n @keydown=${this.clickable ? (e: KeyboardEvent) => this._handleKeyDown(e, index) : null}\n >\n <div class=\"stepper-marker\">\n ${iconName ? html`<sgds-icon name=${iconName} size=\"md\"></sgds-icon>` : index + 1}\n </div>\n <div class=\"stepper-detail\">${step}</div>\n </div>\n </div>\n `;\n })}\n </div>\n `;\n }\n}\n\nexport type StepperOrientation = \"horizontal\" | \"vertical\";\n\nexport default SgdsStepper;\n"],"names":["stepperStyle"],"mappings":";;;;;;;;;;AAUA;;;;;;;;;;AAUG;AACG,MAAO,WAAY,SAAQ,WAAW,CAAA;AAA5C,IAAA,WAAA,GAAA;;AAIE;;AAEG;QAEH,IAAK,CAAA,KAAA,GAAoB,EAAE,CAAC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AAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;AAAmB,CAAA,EAAA,WAAA,CAAA,SAAA,EAAA,WAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAI9D,UAAA,CAAA;IADC,YAAY,CAAC,YAAY,CAAC;AACL,CAAA,EAAA,WAAA,CAAA,SAAA,EAAA,mBAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAuDtB,UAAA,CAAA;IADC,KAAK,CAAC,YAAY,EAAE,EAAE,oBAAoB,EAAE,IAAI,EAAE,CAAC;AAGnD,CAAA,EAAA,WAAA,CAAA,SAAA,EAAA,yBAAA,EAAA,IAAA,CAAA;;;;"}
1
+ {"version":3,"file":"sgds-stepper.js","sources":["../../../src/components/Stepper/sgds-stepper.ts"],"sourcesContent":["import { html } from \"lit\";\nimport { property, queryAssignedElements } from \"lit/decorators.js\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport SgdsElement from \"../../base/sgds-element\";\nimport { defaultValue } from \"../../utils/defaultvalue\";\nimport { watch } from \"../../utils/watch\";\nimport stepperStyle from \"./stepper.css\";\nimport SgdsIcon from \"../Icon/sgds-icon\";\nimport { IStepMetaData } from \"./types\";\nimport type SgdsStep from \"./sgds-step\";\nexport type { IStepMetaData };\n\n/**\n * @summary Steppers are used to inform users which step they are at in a form or a process\n *\n * @event sgds-next-step - Emitted right before the next step is reached. Event is fired when nextStep method is called.\n * @event sgds-previous-step - Emitted right before the previous step is reached. Event is fired when previousStep method is called.\n * @event sgds-last-step - Emitted right before the last step is reached. Event is fired when lastStep method is called.\n * @event sgds-first-step - Emitted on hide after animation has completed. Event is fired when firstStep method is called.\n * @event sgds-arrived - Emitted right after the activeStep has updated its state, when upcoming step has arrived. Call `getMethod()` on this event to get the current step's component.\n * @event sgds-reset - Emitted right before the step is reset to its defaultActiveStep. Event is fired when reset method is called.\n * @slot default - slot for sgds-step children\n *\n */\nexport class SgdsStepper extends SgdsElement {\n static styles = [...SgdsElement.styles, stepperStyle];\n /** @internal */\n static dependencies = { \"sgds-icon\": SgdsIcon };\n /** The metadata of stepper, type `IStepMetaData`. Deprecated: use sgds-step child components instead.\n * @deprecated Use sgds-step child components instead of the steps property\n */\n @property({ type: Array })\n steps: IStepMetaData[] = [];\n\n /** The current state of active step. Defaults to 0 */\n @property({ type: Number, reflect: true })\n activeStep = 0;\n\n /** The orientation of stepper. By default, the stepper is of horizontal orientation */\n @property({ type: String, reflect: true }) orientation: StepperOrientation = \"horizontal\";\n\n /** When true, the stepper's steps will be clickable */\n @property({ type: Boolean, reflect: true }) clickable = false;\n\n /** When true, the stepper's steps can only be clicked in a linear manner */\n @property({ type: Boolean, reflect: true }) linear = false;\n\n /** @internal Gets or sets the default activeStep used to reset this element. The initial value corresponds to the one originally specified in the HTML that created this element. */\n @defaultValue(\"activeStep\")\n defaultActiveStep = 0;\n\n /** @internal */\n @queryAssignedElements() private _slotNodes!: SgdsStep[];\n\n /** @internal */\n private _items!: SgdsStep[];\n private _totalSteps = 0;\n\n /** @internal Bound i-sgds-click handler for proper event listener removal */\n private _boundHandleItemClick = this._handleStepClick.bind(this);\n\n connectedCallback() {\n super.connectedCallback();\n\n this._totalSteps = this.steps.length;\n this.addEventListener(\"i-sgds-click\", this._boundHandleItemClick);\n }\n\n /** @internal */\n private _handleSlotChange() {\n this._items = this._slotNodes;\n this._totalSteps = this._items.length;\n\n this._updateStepItems();\n }\n\n /** @internal Updates step item properties based on active step and clickable state */\n private _updateStepItems() {\n if (this._items && this._items.length > 0) {\n this._items.forEach((item, index) => {\n item.stepIndex = index;\n item.active = this.activeStep === index;\n item._isCompleted = item.completed || this.activeStep > index;\n item.isClickable = this.linear\n ? !item.disabled && this.clickable && (this.activeStep - 1 == index || this.activeStep + 1 == index)\n : !item.disabled && this.clickable;\n item.orientation = this.orientation;\n\n if (this._items.length > 1) {\n item.isFirstOfType = index === 0;\n item.classList.toggle(\"last\", index === this._items.length - 1);\n }\n });\n }\n }\n\n /** By default, it returns the corresponding component of the current activeStep as defined in the steps metadata. To get other components, pass in your desired step number as the parameter*/\n public getComponent(step: number = this.activeStep) {\n const items = this._slotNodes.length > 1 ? this._items : this.steps;\n if (items && items.length > 0) {\n return items[step]?.component;\n }\n return this.steps[step]?.component;\n }\n\n /** Moves the active step forward one step */\n public nextStep() {\n this.emit(\"sgds-next-step\");\n if (this.activeStep < this._totalSteps - 1) {\n if (!this._slotNodes[this.activeStep + 1]?.disabled) {\n this.activeStep++;\n }\n }\n }\n\n /** Moves the active step back one step */\n public previousStep() {\n this.emit(\"sgds-previous-step\");\n\n if (this.activeStep > 0) {\n if (!this._slotNodes[this.activeStep - 1]?.disabled) {\n this.activeStep--;\n }\n }\n }\n\n /** Changes the active step to the last step */\n public lastStep() {\n this.emit(\"sgds-last-step\");\n if (this.activeStep !== this._totalSteps - 1) {\n this.activeStep = this._totalSteps - 1;\n }\n }\n\n /** Changes active step to the first step */\n public firstStep() {\n this.emit(\"sgds-first-step\");\n if (this.activeStep > 0) {\n this.activeStep = 0;\n }\n }\n\n /** Resets the Stepper to its initial active step state */\n public reset() {\n this.emit(\"sgds-reset\");\n this.activeStep = this.defaultActiveStep;\n }\n\n /**@internal */\n _onStepperItemClick(index: number) {\n this.activeStep = index;\n }\n\n /**@internal */\n @watch(\"activeStep\", { waitUntilFirstUpdate: true })\n _handleActiveStepChange() {\n this._updateStepItems();\n this.emit(\"sgds-arrived\");\n }\n\n /**@internal */\n @watch(\"clickable\", { waitUntilFirstUpdate: true })\n _handleClickableChange() {\n this._updateStepItems();\n }\n\n /**@internal */\n @watch(\"orientation\", { waitUntilFirstUpdate: true })\n _handleOrientationChange() {\n this._updateStepItems();\n }\n\n /**@internal */\n _handleKeyDown(event: KeyboardEvent, index: number) {\n if (event.key === \"Enter\") {\n this._onStepperItemClick(index);\n }\n }\n\n /**@internal */\n _handleStepClick(e: Event) {\n const event = e as CustomEvent;\n e.stopPropagation();\n\n const stepIndex = event.detail?.stepIndex;\n this._onStepperItemClick(stepIndex);\n }\n\n render() {\n return html`\n <div\n class=\"stepper ${classMap({\n [`${this.orientation}`]: this.orientation,\n clickable: this.clickable\n })}\"\n >\n <slot @slotchange=${this._handleSlotChange}></slot>\n\n ${this.steps.map(({ stepHeader: step, iconName }, index) => {\n return html`\n <div class=\"stepper-item-container\">\n <div\n class=\"stepper-item ${classMap({\n \"is-active\": this.activeStep === index,\n \"is-completed\": this.activeStep > index,\n \"is-clickable\": this.clickable && this.activeStep > index\n })}\"\n tabindex=${this.clickable && this.activeStep > index ? \"0\" : \"-1\"}\n aria-current=${this.activeStep === index ? \"step\" : \"false\"}\n aria-disabled=${this.activeStep <= index ? \"true\" : \"false\"}\n @click=\"${this.clickable ? () => this._onStepperItemClick(index) : null}\"\n @keydown=${this.clickable ? (e: KeyboardEvent) => this._handleKeyDown(e, index) : null}\n >\n <div class=\"stepper-marker\">\n ${iconName ? html`<sgds-icon name=${iconName} size=\"md\"></sgds-icon>` : index + 1}\n </div>\n <div class=\"stepper-detail\">${step}</div>\n </div>\n </div>\n `;\n })}\n </div>\n `;\n }\n}\n\nexport type StepperOrientation = \"horizontal\" | \"vertical\";\n\nexport default SgdsStepper;\n"],"names":["stepperStyle"],"mappings":";;;;;;;;;;AAYA;;;;;;;;;;;AAWG;AACG,MAAO,WAAY,SAAQ,WAAW,CAAA;AAA5C,IAAA,WAAA,GAAA;;AAIE;;AAEG;QAEH,IAAK,CAAA,KAAA,GAAoB,EAAE,CAAC;;QAI5B,IAAU,CAAA,UAAA,GAAG,CAAC,CAAC;;QAG4B,IAAW,CAAA,WAAA,GAAuB,YAAY,CAAC;;QAG9C,IAAS,CAAA,SAAA,GAAG,KAAK,CAAC;;QAGlB,IAAM,CAAA,MAAA,GAAG,KAAK,CAAC;;QAI3D,IAAiB,CAAA,iBAAA,GAAG,CAAC,CAAC;QAOd,IAAW,CAAA,WAAA,GAAG,CAAC,CAAC;;QAGhB,IAAqB,CAAA,qBAAA,GAAG,IAAI,CAAC,gBAAgB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,EAAE,IAAI,EAAE,CAAC;AAAmB,CAAA,EAAA,WAAA,CAAA,SAAA,EAAA,WAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAGlB,UAAA,CAAA;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;AAAgB,CAAA,EAAA,WAAA,CAAA,SAAA,EAAA,QAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAI3D,UAAA,CAAA;IADC,YAAY,CAAC,YAAY,CAAC;AACL,CAAA,EAAA,WAAA,CAAA,SAAA,EAAA,mBAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAGW,UAAA,CAAA;AAAhC,IAAA,qBAAqB,EAAE;AAAiC,CAAA,EAAA,WAAA,CAAA,SAAA,EAAA,YAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAuGzD,UAAA,CAAA;IADC,KAAK,CAAC,YAAY,EAAE,EAAE,oBAAoB,EAAE,IAAI,EAAE,CAAC;AAInD,CAAA,EAAA,WAAA,CAAA,SAAA,EAAA,yBAAA,EAAA,IAAA,CAAA,CAAA;AAID,UAAA,CAAA;IADC,KAAK,CAAC,WAAW,EAAE,EAAE,oBAAoB,EAAE,IAAI,EAAE,CAAC;AAGlD,CAAA,EAAA,WAAA,CAAA,SAAA,EAAA,wBAAA,EAAA,IAAA,CAAA,CAAA;AAID,UAAA,CAAA;IADC,KAAK,CAAC,aAAa,EAAE,EAAE,oBAAoB,EAAE,IAAI,EAAE,CAAC;AAGpD,CAAA,EAAA,WAAA,CAAA,SAAA,EAAA,0BAAA,EAAA,IAAA,CAAA;;;;"}
@@ -0,0 +1,6 @@
1
+ import { css } from 'lit';
2
+
3
+ var css_248z = css`:host{display:contents}.stepper-item-container{flex-basis:1em;flex-grow:1;flex-shrink:1;position:relative;width:fit-content}.stepper-item,.stepper-item-container{align-items:center;display:flex;flex-direction:column}.stepper-item{gap:var(--sgds-gap-sm)}.stepper-item.vertical{align-items:flex-start;flex-direction:row;margin-bottom:var(--sgds-padding-xl)}.stepper-item.clickable:focus-visible{outline:var(--sgds-outline-focus);outline-offset:var(--sgds-outline-offset-focus)}.stepper-item:not(.first):not(.vertical):before{background:var(--sgds-border-color-translucent);content:" ";height:var(--sgds-dimension-2);left:calc(-50% + 16px);position:absolute;top:15px;width:calc(100% - var(--sgds-dimension-32))}:host(:not(.last)) .stepper-item-container .stepper-item.vertical:after{background:var(--sgds-bg-translucent);content:" ";height:calc(100% - var(--sgds-dimension-32));left:15px;position:absolute;top:32px;width:var(--sgds-dimension-2)}.stepper-item-container .stepper-item.active:not(.first):before,.stepper-item-container .stepper-item.completed:not(.first):before,:host(:not(.last)) .stepper-item-container .stepper-item.completed:after{background:var(--sgds-primary-border-color-default)}.stepper-item.clickable{cursor:pointer}.stepper-marker{align-items:center;background:var(--sgds-bg-translucent);border:var(--sgds-border-width-2) solid var(--sgds-border-color-transparent);border-radius:50%;color:var(--sgds-color-default);display:flex;height:var(--sgds-dimension-32);justify-content:center;width:var(--sgds-dimension-32);z-index:1}.stepper-detail{display:flex;flex-direction:column;gap:var(--sgds-gap-2-xs);max-width:var(--sgds-dimension-128);text-align:center}.stepper-item.vertical .stepper-detail{padding:var(--sgds-padding-2-xs) 0 0;text-align:left}.stepper-item:not(.active):not(.completed) .stepper-label{color:var(--sgds-color-subtle)}.stepper-item.clickable:focus .stepper-marker,.stepper-item.clickable:focus-visible .stepper-marker,.stepper-item.clickable:hover .stepper-marker{background-color:var(--sgds-primary-surface-emphasis);border-color:var(--sgds-border-color-transparent);color:var(--sgds-color-fixed-light)}.stepper-item.clickable:focus .stepper-label,.stepper-item.clickable:focus-visible .stepper-label,.stepper-item.clickable:hover .stepper-label{color:var(--sgds-primary-color-emphasis)}.stepper-item.clickable .stepper-label{color:var(--sgds-primary-color-default)}.stepper-item.completed .stepper-marker{background-color:var(--sgds-bg-transparent);border:var(--sgds-border-width-2) solid var(--sgds-primary-border-color-default);color:var(--sgds-primary-color-default)}.stepper-item.active .stepper-marker{background-color:var(--sgds-primary-surface-default);color:var(--sgds-color-fixed-light)}.stepper-slot{color:var(--sgds-color-subtle);display:flex;flex-direction:column;font-size:var(--sgds-font-size-label-sm);font-weight:var(--sgds-font-weight-regular);gap:var(--sgds-gap-xs);letter-spacing:var(--sgds-letter-spacing-normal);line-height:var(--sgds-line-height-2-xs)}.stepper-item.disabled{opacity:var(--sgds-opacity-40)}`;
4
+
5
+ export { css_248z as default };
6
+ //# sourceMappingURL=step.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"step.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}
@@ -1,6 +1,6 @@
1
1
  import { css } from 'lit';
2
2
 
3
- var css_248z = css`.stepper{display:flex;flex-wrap:wrap}.stepper.vertical{flex-direction:column}.stepper.horizontal .stepper-item-container{align-items:center;display:flex;flex-basis:1em;flex-direction:column;flex-grow:1;flex-shrink:1;position:relative}.stepper.vertical .stepper-item-container{position:relative;width:fit-content}.stepper .stepper-item{align-items:center;display:flex;flex-direction:column;gap:var(--sgds-gap-sm)}.stepper.vertical .stepper-item{align-items:flex-start;flex-direction:row}.stepper.vertical .stepper-item-container:not(:last-child) .stepper-item{margin-bottom:var(--sgds-padding-xl)}.stepper .stepper-item.is-clickable:focus-visible{outline:var(--sgds-outline-focus);outline-offset:var(--sgds-outline-offset-focus)}.stepper.horizontal .stepper-item-container:not(:first-child) .stepper-item:before{background:var(--sgds-border-color-translucent);bottom:0;content:" ";height:var(--sgds-dimension-2);left:calc(-50% + 16px);position:absolute;top:15px;width:calc(100% - var(--sgds-dimension-32))}.stepper.vertical .stepper-item-container:not(:last-child) .stepper-item:after{background:var(--sgds-bg-translucent);bottom:0;content:" ";height:calc(100% - var(--sgds-dimension-32));left:15px;position:absolute;top:32px;width:var(--sgds-dimension-2)}.stepper.horizontal .stepper-item-container .stepper-item.is-active:before,.stepper.horizontal .stepper-item-container .stepper-item.is-completed:before,.stepper.vertical .stepper-item-container .stepper-item.is-completed:after{background:var(--sgds-primary-border-color-default)}.stepper .stepper-item.is-clickable{cursor:pointer}.stepper .stepper-marker{align-items:center;background:var(--sgds-bg-translucent);border:var(--sgds-border-width-2) solid var(--sgds-border-color-transparent);border-radius:50%;color:var(--sgds-color-default);display:flex;height:var(--sgds-dimension-32);justify-content:center;width:var(--sgds-dimension-32);z-index:1}.stepper:not(.vertical) .stepper-detail{max-width:var(--sgds-dimension-128);text-align:center}.stepper.vertical .stepper-detail{padding:var(--sgds-padding-2-xs) 0 0;text-align:left}.stepper .stepper-item:not(.is-active):not(.is-completed) .stepper-detail{color:var(--sgds-color-subtle)}.stepper .stepper-item.is-clickable:focus .stepper-marker,.stepper .stepper-item.is-clickable:focus-visible .stepper-marker,.stepper .stepper-item.is-clickable:hover .stepper-marker{background-color:var(--sgds-primary-surface-emphasis);border-color:var(--sgds-border-color-transparent);color:var(--sgds-color-fixed-light)}.stepper .stepper-item.is-clickable:focus .stepper-detail,.stepper .stepper-item.is-clickable:focus-visible .stepper-detail,.stepper .stepper-item.is-clickable:hover .stepper-detail{color:var(--sgds-primary-color-emphasis)}.stepper .stepper-item.is-clickable .stepper-detail,.stepper.clickable .stepper-item.is-active .stepper-detail{color:var(--sgds-primary-color-default)}.stepper .stepper-item.is-active .stepper-marker{background-color:var(--sgds-primary-surface-default);color:var(--sgds-color-fixed-light)}.stepper .stepper-item.is-completed .stepper-marker{background-color:var(--sgds-bg-transparent);border:var(--sgds-border-width-2) solid var(--sgds-primary-border-color-default);color:var(--sgds-primary-color-default)}`;
3
+ var css_248z = css`.stepper{display:flex;flex-wrap:wrap}.stepper.vertical{flex-direction:column}.stepper.horizontal .stepper-item-container{align-items:center;display:flex;flex-basis:1em;flex-direction:column;flex-grow:1;flex-shrink:1;position:relative}.stepper.vertical .stepper-item-container{position:relative;width:fit-content}.stepper .stepper-item{align-items:center;display:flex;flex-direction:column;gap:var(--sgds-gap-sm)}.stepper.vertical .stepper-item{align-items:flex-start;flex-direction:row}.stepper.vertical .stepper-item-container:not(:last-child) .stepper-item{margin-bottom:var(--sgds-padding-xl)}.stepper .stepper-item.is-clickable:focus-visible{outline:var(--sgds-outline-focus);outline-offset:var(--sgds-outline-offset-focus)}.stepper.horizontal .stepper-item-container:not(:first-of-type) .stepper-item:before{background:var(--sgds-border-color-translucent);bottom:0;content:" ";height:var(--sgds-dimension-2);left:calc(-50% + 16px);position:absolute;top:15px;width:calc(100% - var(--sgds-dimension-32))}.stepper.vertical .stepper-item-container:not(:last-child) .stepper-item:after{background:var(--sgds-bg-translucent);bottom:0;content:" ";height:calc(100% - var(--sgds-dimension-32));left:15px;position:absolute;top:32px;width:var(--sgds-dimension-2)}.stepper.horizontal .stepper-item-container .stepper-item.is-active:before,.stepper.horizontal .stepper-item-container .stepper-item.is-completed:before,.stepper.vertical .stepper-item-container .stepper-item.is-completed:after{background:var(--sgds-primary-border-color-default)}.stepper .stepper-item.is-clickable{cursor:pointer}.stepper .stepper-marker{align-items:center;background:var(--sgds-bg-translucent);border:var(--sgds-border-width-2) solid var(--sgds-border-color-transparent);border-radius:50%;color:var(--sgds-color-default);display:flex;height:var(--sgds-dimension-32);justify-content:center;width:var(--sgds-dimension-32);z-index:1}.stepper:not(.vertical) .stepper-detail{max-width:var(--sgds-dimension-128);text-align:center}.stepper.vertical .stepper-detail{padding:var(--sgds-padding-2-xs) 0 0;text-align:left}.stepper .stepper-item:not(.is-active):not(.is-completed) .stepper-detail{color:var(--sgds-color-subtle)}.stepper .stepper-item.is-clickable:focus .stepper-marker,.stepper .stepper-item.is-clickable:focus-visible .stepper-marker,.stepper .stepper-item.is-clickable:hover .stepper-marker{background-color:var(--sgds-primary-surface-emphasis);border-color:var(--sgds-border-color-transparent);color:var(--sgds-color-fixed-light)}.stepper .stepper-item.is-clickable:focus .stepper-detail,.stepper .stepper-item.is-clickable:focus-visible .stepper-detail,.stepper .stepper-item.is-clickable:hover .stepper-detail{color:var(--sgds-primary-color-emphasis)}.stepper .stepper-item.is-clickable .stepper-detail,.stepper.clickable .stepper-item.is-active .stepper-detail{color:var(--sgds-primary-color-default)}.stepper .stepper-item.is-active .stepper-marker{background-color:var(--sgds-primary-surface-default);color:var(--sgds-color-fixed-light)}.stepper .stepper-item.is-completed .stepper-marker{background-color:var(--sgds-bg-transparent);border:var(--sgds-border-width-2) solid var(--sgds-primary-border-color-default);color:var(--sgds-primary-color-default)}`;
4
4
 
5
5
  export { css_248z as default };
6
6
  //# sourceMappingURL=stepper.js.map
@@ -2,4 +2,5 @@ export interface IStepMetaData {
2
2
  component: unknown;
3
3
  stepHeader: string;
4
4
  iconName?: string;
5
+ isCompleted?: boolean;
5
6
  }
@@ -48,6 +48,7 @@ export * from "./Sidenav/sgds-sidenav-item";
48
48
  export * from "./Sidenav/sgds-sidenav-link";
49
49
  export * from "./Skeleton/sgds-skeleton";
50
50
  export * from "./Spinner/sgds-spinner";
51
+ export * from "./Stepper/sgds-step";
51
52
  export * from "./Stepper/sgds-stepper";
52
53
  export * from "./Subnav/sgds-subnav";
53
54
  export * from "./Subnav/sgds-subnav-item";
@@ -48,6 +48,7 @@ export { SgdsSidenavItem } from './Sidenav/sgds-sidenav-item.js';
48
48
  export { SgdsSidenavLink } from './Sidenav/sgds-sidenav-link.js';
49
49
  export { SgdsSkeleton } from './Skeleton/sgds-skeleton.js';
50
50
  export { SgdsSpinner } from './Spinner/sgds-spinner.js';
51
+ export { SgdsStep } from './Stepper/sgds-step.js';
51
52
  export { SgdsStepper } from './Stepper/sgds-stepper.js';
52
53
  export { SgdsSubnav } from './Subnav/sgds-subnav.js';
53
54
  export { SgdsSubnavItem } from './Subnav/sgds-subnav-item.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}