From 70555018099bfd1c0d6f5c8cdc0a211b9b2417d3 Mon Sep 17 00:00:00 2001 From: Erik Harper Date: Fri, 9 Feb 2024 15:15:48 -0800 Subject: [PATCH 01/11] first commit adding new layout type definition and demos --- .../calcite-components/src/components.d.ts | 12 +- .../components/stepper-item/stepper-item.tsx | 5 +- .../src/components/stepper/interfaces.ts | 2 + .../src/components/stepper/stepper.tsx | 10 +- .../calcite-components/src/demos/stepper.html | 441 ++++++++++++++++++ 5 files changed, 459 insertions(+), 11 deletions(-) diff --git a/packages/calcite-components/src/components.d.ts b/packages/calcite-components/src/components.d.ts index 2ac3aa8b583..e70dd81ed9c 100644 --- a/packages/calcite-components/src/components.d.ts +++ b/packages/calcite-components/src/components.d.ts @@ -73,8 +73,8 @@ import { DisplayMode } from "./components/sheet/interfaces"; import { DisplayMode as DisplayMode1 } from "./components/shell-panel/interfaces"; import { ShellPanelMessages } from "./components/shell-panel/assets/shell-panel/t9n"; import { DragDetail } from "./utils/sortableComponent"; +import { StepperItemChangeEventDetail, StepperItemEventDetail, StepperItemKeyEventDetail, StepperLayout } from "./components/stepper/interfaces"; import { StepperMessages } from "./components/stepper/assets/stepper/t9n"; -import { StepperItemChangeEventDetail, StepperItemEventDetail, StepperItemKeyEventDetail } from "./components/stepper/interfaces"; import { StepperItemMessages } from "./components/stepper-item/assets/stepper-item/t9n"; import { TabID, TabLayout, TabPosition } from "./components/tabs/interfaces"; import { TabChangeEventDetail, TabCloseEventDetail } from "./components/tab/interfaces"; @@ -159,8 +159,8 @@ export { DisplayMode } from "./components/sheet/interfaces"; export { DisplayMode as DisplayMode1 } from "./components/shell-panel/interfaces"; export { ShellPanelMessages } from "./components/shell-panel/assets/shell-panel/t9n"; export { DragDetail } from "./utils/sortableComponent"; +export { StepperItemChangeEventDetail, StepperItemEventDetail, StepperItemKeyEventDetail, StepperLayout } from "./components/stepper/interfaces"; export { StepperMessages } from "./components/stepper/assets/stepper/t9n"; -export { StepperItemChangeEventDetail, StepperItemEventDetail, StepperItemKeyEventDetail } from "./components/stepper/interfaces"; export { StepperItemMessages } from "./components/stepper-item/assets/stepper-item/t9n"; export { TabID, TabLayout, TabPosition } from "./components/tabs/interfaces"; export { TabChangeEventDetail, TabCloseEventDetail } from "./components/tab/interfaces"; @@ -4382,7 +4382,7 @@ export namespace Components { /** * Defines the layout of the component. */ - "layout": Extract<"horizontal" | "vertical", Layout>; + "layout": StepperLayout; /** * Use this property to override individual strings used by the component. */ @@ -4453,7 +4453,7 @@ export namespace Components { /** * Specifies the layout of the `calcite-stepper-item` inherited from parent `calcite-stepper`, defaults to `horizontal`. */ - "layout": Extract<"horizontal" | "vertical", Layout>; + "layout": StepperLayout; /** * Use this property to override individual strings used by the component. */ @@ -11866,7 +11866,7 @@ declare namespace LocalJSX { /** * Defines the layout of the component. */ - "layout"?: Extract<"horizontal" | "vertical", Layout>; + "layout"?: StepperLayout; /** * Use this property to override individual strings used by the component. */ @@ -11933,7 +11933,7 @@ declare namespace LocalJSX { /** * Specifies the layout of the `calcite-stepper-item` inherited from parent `calcite-stepper`, defaults to `horizontal`. */ - "layout"?: Extract<"horizontal" | "vertical", Layout>; + "layout"?: StepperLayout; /** * Use this property to override individual strings used by the component. */ diff --git a/packages/calcite-components/src/components/stepper-item/stepper-item.tsx b/packages/calcite-components/src/components/stepper-item/stepper-item.tsx index 0e122cc6dd0..2797e0757b9 100644 --- a/packages/calcite-components/src/components/stepper-item/stepper-item.tsx +++ b/packages/calcite-components/src/components/stepper-item/stepper-item.tsx @@ -12,7 +12,7 @@ import { VNode, Watch, } from "@stencil/core"; -import { Layout, Scale } from "../interfaces"; +import { Scale } from "../interfaces"; import { connectInteractive, disconnectInteractive, @@ -24,6 +24,7 @@ import { StepperItemChangeEventDetail, StepperItemEventDetail, StepperItemKeyEventDetail, + StepperLayout, } from "../stepper/interfaces"; import { numberStringFormatter, @@ -119,7 +120,7 @@ export class StepperItem * * @internal */ - @Prop({ reflect: true }) layout: Extract<"horizontal" | "vertical", Layout>; + @Prop({ reflect: true }) layout: StepperLayout; /** * Made into a prop for testing purposes only diff --git a/packages/calcite-components/src/components/stepper/interfaces.ts b/packages/calcite-components/src/components/stepper/interfaces.ts index 9f4798e22d2..70852421efb 100644 --- a/packages/calcite-components/src/components/stepper/interfaces.ts +++ b/packages/calcite-components/src/components/stepper/interfaces.ts @@ -9,3 +9,5 @@ export interface StepperItemKeyEventDetail { export interface StepperItemChangeEventDetail { position: number; } + +export type StepperLayout = "horizontal" | "vertical" | "single-horizontal"; diff --git a/packages/calcite-components/src/components/stepper/stepper.tsx b/packages/calcite-components/src/components/stepper/stepper.tsx index de487d192b5..6af9fa49219 100644 --- a/packages/calcite-components/src/components/stepper/stepper.tsx +++ b/packages/calcite-components/src/components/stepper/stepper.tsx @@ -14,8 +14,12 @@ import { readTask, } from "@stencil/core"; import { focusElementInGroup, slotChangeGetAssignedElements } from "../../utils/dom"; -import { Layout, Position, Scale } from "../interfaces"; -import { StepperItemChangeEventDetail, StepperItemKeyEventDetail } from "./interfaces"; +import { Position, Scale } from "../interfaces"; +import { + StepperItemChangeEventDetail, + StepperItemKeyEventDetail, + StepperLayout, +} from "./interfaces"; import { createObserver } from "../../utils/observers"; import { StepBar } from "./functional/step-bar"; import { ITEM_MIN_WIDTH, CSS } from "./resources"; @@ -56,7 +60,7 @@ export class Stepper implements LocalizedComponent, T9nComponent { @Prop({ reflect: true }) icon = false; /** Defines the layout of the component. */ - @Prop({ reflect: true }) layout: Extract<"horizontal" | "vertical", Layout> = "horizontal"; + @Prop({ reflect: true }) layout: StepperLayout = "horizontal"; /** When `true`, displays the step number in the `calcite-stepper-item` heading. */ @Prop({ reflect: true }) numbered = false; diff --git a/packages/calcite-components/src/demos/stepper.html b/packages/calcite-components/src/demos/stepper.html index 9df97446357..b54fce8bb11 100644 --- a/packages/calcite-components/src/demos/stepper.html +++ b/packages/calcite-components/src/demos/stepper.html @@ -41,6 +41,447 @@ + + +
+
+
Small
+
+ +
+
complete, active, error, idle + icons
+ +
+ + + +
Step 1 Content Goes Here
+
+
+ + +
Step 2 Content Goes Here
+
+
+ + +
Step 3 Content Goes Here
+
+
+ + +
Step 4 Content Goes Here
+
+
+
+
+
+ + +
+
no content
+ +
+ + + + + + + +
+
+ + +
+
numbered
+ +
+ + + +
Step 1 Content Goes Here
+
+
+ + +
Step 2 Content Goes Here
+
+
+ + +
Step 3 Content Goes Here
+
+
+ + +
Step 4 Content Goes Here
+
+
+
+
+
+ + +
+
Arabic numbering system
+ +
+ + + +
الخطوة الأولى للمحتوى هنا
+
+
+ + +
الخطوة الثانية للمحتوى هنا
+
+
+ + +
الخطوة الثالثة المحتوى يذهب هنا
+
+
+ + +
الخطوة الرابعة المحتوى يذهب هنا
+
+
+
+
+
+ + +
+
disabled
+ +
+ + + +
Step 1 Content Goes Here
+
+
+ + +
Step 2 Content Goes Here
+
+
+ + +
Step 3 Content Goes Here
+
+
+ + +
Step 4 Content Goes Here
+
+
+
+
+
+ +
+ + + +
+
+
Medium
+
+ +
+
complete, active, error, idle + icons
+ +
+ + + +
Step 1 Content Goes Here
+
+
+ + +
Step 2 Content Goes Here
+
+
+ + +
Step 3 Content Goes Here
+
+
+ + +
Step 4 Content Goes Here
+
+
+
+
+
+ + +
+
no content
+ +
+ + + + + + + +
+
+ + +
+
numbered
+ +
+ + + +
Step 1 Content Goes Here
+
+
+ + +
Step 2 Content Goes Here
+
+
+ + +
Step 3 Content Goes Here
+
+
+ + +
Step 4 Content Goes Here
+
+
+
+
+
+ + +
+
Arabic numbering system
+ +
+ + + +
الخطوة الأولى للمحتوى هنا
+
+
+ + +
الخطوة الثانية للمحتوى هنا
+
+
+ + +
الخطوة الثالثة المحتوى يذهب هنا
+
+
+ + +
الخطوة الرابعة المحتوى يذهب هنا
+
+
+
+
+
+ + +
+
disabled
+ +
+ + + +
Step 1 Content Goes Here
+
+
+ + +
Step 2 Content Goes Here
+
+
+ + +
Step 3 Content Goes Here
+
+
+ + +
Step 4 Content Goes Here
+
+
+
+
+
+ +
+ + + +
+
+
Large
+
+ +
+
complete, active, error, idle + icons
+ +
+ + + +
Step 1 Content Goes Here
+
+
+ + +
Step 2 Content Goes Here
+
+
+ + +
Step 3 Content Goes Here
+
+
+ + +
Step 4 Content Goes Here
+
+
+
+
+
+ + +
+
no content
+ +
+ + + + + + + +
+
+ + +
+
numbered
+ +
+ + + +
Step 1 Content Goes Here
+
+
+ + +
Step 2 Content Goes Here
+
+
+ + +
Step 3 Content Goes Here
+
+
+ + +
Step 4 Content Goes Here
+
+
+
+
+
+ + +
+
Arabic numbering system
+ +
+ + + +
الخطوة الأولى للمحتوى هنا
+
+
+ + +
الخطوة الثانية للمحتوى هنا
+
+
+ + +
الخطوة الثالثة المحتوى يذهب هنا
+
+
+ + +
الخطوة الرابعة المحتوى يذهب هنا
+
+
+
+
+
+ + +
+
disabled
+ +
+ + + +
Step 1 Content Goes Here
+
+
+ + +
Step 2 Content Goes Here
+
+
+ + +
Step 3 Content Goes Here
+
+
+ + +
Step 4 Content Goes Here
+
+
+
+
+
+ +
+
-
Small
+
Small single-horizontal
@@ -196,7 +196,7 @@
-
Medium
+
Medium single-horizontal
@@ -343,7 +343,7 @@
-
Large
+
Large single-horizontal
@@ -490,7 +490,7 @@
-
Small
+
Small horizontal
@@ -637,7 +637,7 @@
-
Medium
+
Medium horizontal
@@ -784,7 +784,7 @@
-
Large
+
Large horizontal
From cf022d0a0dba62ea71edc874db4eb07063471d97 Mon Sep 17 00:00:00 2001 From: Erik Harper Date: Tue, 13 Feb 2024 14:27:25 -0800 Subject: [PATCH 05/11] renaming to horizontal-single --- .../components/stepper-item/stepper-item.scss | 36 +++++++++--------- .../src/components/stepper/interfaces.ts | 2 +- .../src/components/stepper/stepper.scss | 6 +-- .../src/components/stepper/stepper.tsx | 4 +- .../calcite-components/src/demos/stepper.html | 38 +++++++++---------- 5 files changed, 43 insertions(+), 43 deletions(-) diff --git a/packages/calcite-components/src/components/stepper-item/stepper-item.scss b/packages/calcite-components/src/components/stepper-item/stepper-item.scss index 4b87093622d..93910dc6785 100644 --- a/packages/calcite-components/src/components/stepper-item/stepper-item.scss +++ b/packages/calcite-components/src/components/stepper-item/stepper-item.scss @@ -248,7 +248,7 @@ } :host([layout="horizontal"]), -:host([layout="single-horizontal"]) { +:host([layout="horizontal-single"]) { display: contents; .container { @@ -277,63 +277,63 @@ } :host([layout="horizontal"][disabled]), -:host([layout="single-horizontal"][disabled]) { +:host([layout="horizontal-single"][disabled]) { .stepper-item-header { @extend %disabled-host-only; } } -:host([layout="single-horizontal"][selected]) { +:host([layout="horizontal-single"][selected]) { .stepper-item-header { grid-area: 1 / 1 / 1 / -1; } } :host([layout="horizontal"][selected]), -:host([layout="single-horizontal"][selected]) { +:host([layout="horizontal-single"][selected]) { .stepper-item-content { grid-area: 2 / 1 / 2 / -1; } } :host([layout="horizontal"][complete]), -:host([layout="single-horizontal"][complete]) { +:host([layout="horizontal-single"][complete]) { .stepper-item-header { border-color: rgba($h-bb-060, 0.5); } } :host([layout="horizontal"][complete]:hover:not([disabled]):not([selected])), :host([layout="horizontal"][complete]:focus:not([disabled]):not([selected])), -:host([layout="single-horizontal"][complete]:hover:not([disabled]):not([selected])), -:host([layout="single-horizontal"][complete]:focus:not([disabled]):not([selected])) { +:host([layout="horizontal-single"][complete]:hover:not([disabled]):not([selected])), +:host([layout="horizontal-single"][complete]:focus:not([disabled]):not([selected])) { .stepper-item-header { @apply border-color-brand; } } :host([layout="horizontal"][error]), -:host([layout="single-horizontal"][error]) { +:host([layout="horizontal-single"][error]) { .stepper-item-header { @apply border-color-danger; } } :host([layout="horizontal"][selected][multiple-view-mode]), -:host([layout="single-horizontal"][selected][multiple-view-mode]) { +:host([layout="horizontal-single"][selected][multiple-view-mode]) { .stepper-item-header { @apply border-color-brand; } } :host([layout="horizontal"]:hover:not([disabled]):not([selected])), :host([layout="horizontal"]:focus:not([disabled]):not([selected])), -:host([layout="single-horizontal"]:hover:not([disabled]):not([selected])), -:host([layout="single-horizontal"]:focus:not([disabled]):not([selected])) { +:host([layout="horizontal-single"]:hover:not([disabled]):not([selected])), +:host([layout="horizontal-single"]:focus:not([disabled]):not([selected])) { .stepper-item-header { border-color: rgba($h-bb-060, 0.5); } } :host([layout="horizontal"][error]:hover:not([disabled]):not([selected])), :host([layout="horizontal"][error]:focus:not([disabled]):not([selected])), -:host([layout="single-horizontal"][error]:hover:not([disabled]):not([selected])), -:host([layout="single-horizontal"][error]:focus:not([disabled]):not([selected])) { +:host([layout="horizontal-single"][error]:hover:not([disabled]):not([selected])), +:host([layout="horizontal-single"][error]:focus:not([disabled]):not([selected])) { .stepper-item-header { @apply border-color-danger-hover; } @@ -365,14 +365,14 @@ } } -:host([layout="single-horizontal"]) .stepper-item-header { +:host([layout="horizontal-single"]) .stepper-item-header { @apply border-none box-border me-0; inline-size: 100%; padding-inline: calc(var(--calcite-internal-stepper-action-inline-size) + 0.5rem); } -:host([layout="single-horizontal"][error]) .container { +:host([layout="horizontal-single"][error]) .container { & .stepper-item-number { color: theme("backgroundColor.danger"); } @@ -382,15 +382,15 @@ } } -:host([layout="single-horizontal"][error][selected]), -:host([layout="single-horizontal"][complete][selected]) .container { +:host([layout="horizontal-single"][error][selected]), +:host([layout="horizontal-single"][complete][selected]) .container { @apply text-color-3; & .stepper-item-heading { @apply text-color-2; } } -:host([layout="single-horizontal"][complete][selected]) .container { +:host([layout="horizontal-single"][complete][selected]) .container { & .stepper-item-icon { @apply opacity-disabled; } diff --git a/packages/calcite-components/src/components/stepper/interfaces.ts b/packages/calcite-components/src/components/stepper/interfaces.ts index 70852421efb..83051ad73d4 100644 --- a/packages/calcite-components/src/components/stepper/interfaces.ts +++ b/packages/calcite-components/src/components/stepper/interfaces.ts @@ -10,4 +10,4 @@ export interface StepperItemChangeEventDetail { position: number; } -export type StepperLayout = "horizontal" | "vertical" | "single-horizontal"; +export type StepperLayout = "horizontal" | "vertical" | "horizontal-single"; diff --git a/packages/calcite-components/src/components/stepper/stepper.scss b/packages/calcite-components/src/components/stepper/stepper.scss index 027dfd3e9aa..2f70fa621a6 100644 --- a/packages/calcite-components/src/components/stepper/stepper.scss +++ b/packages/calcite-components/src/components/stepper/stepper.scss @@ -38,7 +38,7 @@ } :host([layout="horizontal"]), -:host([layout="single-horizontal"]) { +:host([layout="horizontal-single"]) { .container { display: grid; // grid-templates-columns are dynamically generated @@ -51,14 +51,14 @@ } :host([layout="horizontal"][scale="s"]), -:host([layout="single-horizontal"][scale="s"]) { +:host([layout="horizontal-single"][scale="s"]) { .container { gap: theme("spacing.1") var(--calcite-internal-stepper-item-spacing-unit-s); } } :host([layout="horizontal"][scale="l"]), -:host([layout="single-horizontal"][scale="l"]) { +:host([layout="horizontal-single"][scale="l"]) { .container { gap: theme("spacing.3") var(--calcite-internal-stepper-item-spacing-unit-s); } diff --git a/packages/calcite-components/src/components/stepper/stepper.tsx b/packages/calcite-components/src/components/stepper/stepper.tsx index af6f1b81aa1..d4b4db8e4be 100644 --- a/packages/calcite-components/src/components/stepper/stepper.tsx +++ b/packages/calcite-components/src/components/stepper/stepper.tsx @@ -179,7 +179,7 @@ export class Stepper implements LocalizedComponent, T9nComponent { class={{ container: true, [CSS.singleView]: !this.multipleViewMode }} ref={this.setContainerEl} > - {this.layout === "single-horizontal" && ( + {this.layout === "horizontal-single" && (
{this.items.map((item, index) => (
-
Small single-horizontal
+
Small horizontal-single
complete, active, error, idle + icons
- +
Step 1 Content Goes Here
@@ -86,7 +86,7 @@
no content
- + @@ -101,7 +101,7 @@
numbered
- +
Step 1 Content Goes Here
@@ -131,7 +131,7 @@
Arabic numbering system
- +
الخطوة الأولى للمحتوى هنا
@@ -161,7 +161,7 @@
disabled
- +
Step 1 Content Goes Here
@@ -196,14 +196,14 @@
-
Medium single-horizontal
+
Medium horizontal-single
complete, active, error, idle + icons
- +
Step 1 Content Goes Here
@@ -233,7 +233,7 @@
no content
- + @@ -248,7 +248,7 @@
numbered
- +
Step 1 Content Goes Here
@@ -278,7 +278,7 @@
Arabic numbering system
- +
الخطوة الأولى للمحتوى هنا
@@ -308,7 +308,7 @@
disabled
- +
Step 1 Content Goes Here
@@ -343,14 +343,14 @@
-
Large single-horizontal
+
Large horizontal-single
complete, active, error, idle + icons
- +
Step 1 Content Goes Here
@@ -380,7 +380,7 @@
no content
- + @@ -395,7 +395,7 @@
numbered
- +
Step 1 Content Goes Here
@@ -425,7 +425,7 @@
Arabic numbering system
- +
الخطوة الأولى للمحتوى هنا
@@ -455,7 +455,7 @@
disabled
- +
Step 1 Content Goes Here
From 0ee29db8686298e28342177ee8b3f58311b65c33 Mon Sep 17 00:00:00 2001 From: Erik Harper Date: Tue, 13 Feb 2024 15:00:10 -0800 Subject: [PATCH 06/11] adding new layout mode to story knobs, and a testonly story --- .../src/components/stepper-item/readme.md | 20 ++--- .../src/components/stepper/readme.md | 18 ++--- .../src/components/stepper/stepper.stories.ts | 79 ++++++++++++++++++- 3 files changed, 95 insertions(+), 22 deletions(-) diff --git a/packages/calcite-components/src/components/stepper-item/readme.md b/packages/calcite-components/src/components/stepper-item/readme.md index 3a55874fbed..484c9d6b09e 100644 --- a/packages/calcite-components/src/components/stepper-item/readme.md +++ b/packages/calcite-components/src/components/stepper-item/readme.md @@ -6,16 +6,16 @@ individual `calcite-stepper-item` item ## Properties -| Property | Attribute | Description | Type | Default | -| ------------------ | ------------------- | -------------------------------------------------------------------------------------------- | --------------------- | ----------- | -| `complete` | `complete` | When `true`, the step has been completed. | `boolean` | `false` | -| `description` | `description` | A description for the component. Displays below the header text. | `string` | `undefined` | -| `disabled` | `disabled` | When `true`, interaction is prevented and the component is displayed with lower opacity. | `boolean` | `false` | -| `error` | `error` | When `true`, the component contains an error that requires resolution from the user. | `boolean` | `false` | -| `heading` | `heading` | The component header text. | `string` | `undefined` | -| `iconFlipRtl` | `icon-flip-rtl` | When `true`, the icon will be flipped when the element direction is right-to-left (`"rtl"`). | `boolean` | `false` | -| `messageOverrides` | `message-overrides` | Use this property to override individual strings used by the component. | `StepperItemMessages` | `undefined` | -| `selected` | `selected` | When `true`, the component is selected. | `boolean` | `false` | +| Property | Attribute | Description | Type | Default | +| ------------------ | --------------- | -------------------------------------------------------------------------------------------- | ------------------------------------------------------------------ | ----------- | +| `complete` | `complete` | When `true`, the step has been completed. | `boolean` | `false` | +| `description` | `description` | A description for the component. Displays below the header text. | `string` | `undefined` | +| `disabled` | `disabled` | When `true`, interaction is prevented and the component is displayed with lower opacity. | `boolean` | `false` | +| `error` | `error` | When `true`, the component contains an error that requires resolution from the user. | `boolean` | `false` | +| `heading` | `heading` | The component header text. | `string` | `undefined` | +| `iconFlipRtl` | `icon-flip-rtl` | When `true`, the icon will be flipped when the element direction is right-to-left (`"rtl"`). | `boolean` | `false` | +| `messageOverrides` | -- | Use this property to override individual strings used by the component. | `{ complete?: string; previousStep?: string; nextStep?: string; }` | `undefined` | +| `selected` | `selected` | When `true`, the component is selected. | `boolean` | `false` | ## Methods diff --git a/packages/calcite-components/src/components/stepper/readme.md b/packages/calcite-components/src/components/stepper/readme.md index 1ea934ba9cb..ab18a305cf5 100644 --- a/packages/calcite-components/src/components/stepper/readme.md +++ b/packages/calcite-components/src/components/stepper/readme.md @@ -45,15 +45,15 @@ Calcite stepper can be used to present a stepper workflow to a user. It has conf ## Properties -| Property | Attribute | Description | Type | Default | -| ------------------ | ------------------- | ---------------------------------------------------------------------------- | ------------------------------- | -------------- | -| `icon` | `icon` | When `true`, displays a status icon in the `calcite-stepper-item` heading. | `boolean` | `false` | -| `layout` | `layout` | Defines the layout of the component. | `"horizontal" \| "vertical"` | `"horizontal"` | -| `messageOverrides` | `message-overrides` | Use this property to override individual strings used by the component. | `StepperMessages` | `undefined` | -| `numbered` | `numbered` | When `true`, displays the step number in the `calcite-stepper-item` heading. | `boolean` | `false` | -| `numberingSystem` | `numbering-system` | Specifies the Unicode numeral system used by the component for localization. | `"arab" \| "arabext" \| "latn"` | `undefined` | -| `scale` | `scale` | Specifies the size of the component. | `"l" \| "m" \| "s"` | `"m"` | -| `selectedItem` | -- | Specifies the component's selected item. | `HTMLCalciteStepperItemElement` | `null` | +| Property | Attribute | Description | Type | Default | +| ------------------ | ------------------ | ---------------------------------------------------------------------------- | --------------------------------------------------------------- | -------------- | +| `icon` | `icon` | When `true`, displays a status icon in the `calcite-stepper-item` heading. | `boolean` | `false` | +| `layout` | `layout` | Defines the layout of the component. | `"horizontal" \| "horizontal-single" \| "vertical"` | `"horizontal"` | +| `messageOverrides` | -- | Use this property to override individual strings used by the component. | `{ label?: string; previousStep?: string; nextStep?: string; }` | `undefined` | +| `numbered` | `numbered` | When `true`, displays the step number in the `calcite-stepper-item` heading. | `boolean` | `false` | +| `numberingSystem` | `numbering-system` | Specifies the Unicode numeral system used by the component for localization. | `"arab" \| "arabext" \| "latn"` | `undefined` | +| `scale` | `scale` | Specifies the size of the component. | `"l" \| "m" \| "s"` | `"m"` | +| `selectedItem` | -- | Specifies the component's selected item. | `HTMLCalciteStepperItemElement` | `null` | ## Events diff --git a/packages/calcite-components/src/components/stepper/stepper.stories.ts b/packages/calcite-components/src/components/stepper/stepper.stories.ts index f99a31efc61..084252f10a1 100644 --- a/packages/calcite-components/src/components/stepper/stepper.stories.ts +++ b/packages/calcite-components/src/components/stepper/stepper.stories.ts @@ -20,7 +20,7 @@ export const simple = (): string => html`

Default

html`

No Content

html` > `; +export const horizontalSingleLayout_TestOnly = (): string => html` +
+ + + +
Step 1 Content Goes Here
+
+
+ + +
Step 2 Content Goes Here
+
+
+ + +
Step 3 Content Goes Here
+
+
+ + +
Step 4 Content Goes Here
+
+
+
+ + + + +
Step 1 Content Goes Here
+
+
+ + +
Step 2 Content Goes Here
+
+
+ + +
Step 3 Content Goes Here
+
+
+ + +
Step 4 Content Goes Here
+
+
+
+ + + + +
Step 1 Content Goes Here
+
+
+ + +
Step 2 Content Goes Here
+
+
+ + +
Step 3 Content Goes Here
+
+
+ + +
Step 4 Content Goes Here
+
+
+
+
+`; + const getBreakpointsStoryTemplate = ({ scale, width }: { scale: string; width: number }): string => html` - - - -
Step 1 Content Goes Here
-
-
- - -
Step 2 Content Goes Here
-
-
- - -
Step 3 Content Goes Here
-
-
- - -
Step 4 Content Goes Here
-
-
-
`; - -export const responsiveLayoutScaleS_TestOnly = (): string => getBreakpointsStoryTemplate({ scale: "s", width: 400 }); -export const responsiveLayoutScaleM_TestOnly = (): string => getBreakpointsStoryTemplate({ scale: "m", width: 500 }); -export const responsiveLayoutScaleL_TestOnly = (): string => getBreakpointsStoryTemplate({ scale: "l", width: 600 }); - -export const responsiveLayoutWithDisabledStepperItems_TestOnly = (): string => html` - - - -
Step 1 Content Goes Here
-
-
- - -
Step 2 Content Goes Here
-
-
- -
`; From 82acf8f767e4f88c26487f2078e34ef58d1b6ab1 Mon Sep 17 00:00:00 2001 From: Erik Harper Date: Tue, 13 Feb 2024 17:03:09 -0800 Subject: [PATCH 11/11] fixing rules that tell stepper-item header and content divs to stretch the full width of the parent grid regardless if they're selected or not --- .../src/components/stepper-item/stepper-item.scss | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/calcite-components/src/components/stepper-item/stepper-item.scss b/packages/calcite-components/src/components/stepper-item/stepper-item.scss index 93910dc6785..4a579b06930 100644 --- a/packages/calcite-components/src/components/stepper-item/stepper-item.scss +++ b/packages/calcite-components/src/components/stepper-item/stepper-item.scss @@ -283,14 +283,14 @@ } } -:host([layout="horizontal-single"][selected]) { +:host([layout="horizontal-single"]) { .stepper-item-header { grid-area: 1 / 1 / 1 / -1; } } -:host([layout="horizontal"][selected]), -:host([layout="horizontal-single"][selected]) { +:host([layout="horizontal"]), +:host([layout="horizontal-single"]) { .stepper-item-content { grid-area: 2 / 1 / 2 / -1; }