From 6484d010a1eee6f5d86968e4701b945953089b17 Mon Sep 17 00:00:00 2001 From: Romain Hamel Date: Thu, 5 Dec 2024 12:20:45 +0100 Subject: [PATCH] feat(Stepper): new component (#2733) Co-authored-by: Benjamin Canac --- .../stepper/StepperContentSlotExample.vue | 26 + .../stepper/StepperCustomSlotExample.vue | 41 + .../stepper/StepperModelValueExample.vue | 37 + .../stepper/StepperWithControlsExample.vue | 51 + docs/content/3.components/stepper.md | 232 ++++ playground/app/app.vue | 1 + playground/app/pages/components/stepper.vue | 96 ++ .../runtime/examples/StepperExample.vue | 44 + src/runtime/components/Stepper.vue | 170 +++ src/runtime/types/index.ts | 1 + src/theme/index.ts | 1 + src/theme/stepper.ts | 131 +++ test/components/Stepper.spec.ts | 50 + .../__snapshots__/Stepper-vue.spec.ts.snap | 1009 +++++++++++++++++ .../__snapshots__/Stepper.spec.ts.snap | 1009 +++++++++++++++++ 15 files changed, 2899 insertions(+) create mode 100644 docs/app/components/content/examples/stepper/StepperContentSlotExample.vue create mode 100644 docs/app/components/content/examples/stepper/StepperCustomSlotExample.vue create mode 100644 docs/app/components/content/examples/stepper/StepperModelValueExample.vue create mode 100644 docs/app/components/content/examples/stepper/StepperWithControlsExample.vue create mode 100644 docs/content/3.components/stepper.md create mode 100644 playground/app/pages/components/stepper.vue create mode 100644 src/devtools/runtime/examples/StepperExample.vue create mode 100644 src/runtime/components/Stepper.vue create mode 100644 src/theme/stepper.ts create mode 100644 test/components/Stepper.spec.ts create mode 100644 test/components/__snapshots__/Stepper-vue.spec.ts.snap create mode 100644 test/components/__snapshots__/Stepper.spec.ts.snap diff --git a/docs/app/components/content/examples/stepper/StepperContentSlotExample.vue b/docs/app/components/content/examples/stepper/StepperContentSlotExample.vue new file mode 100644 index 00000000..2836a63f --- /dev/null +++ b/docs/app/components/content/examples/stepper/StepperContentSlotExample.vue @@ -0,0 +1,26 @@ + + + diff --git a/docs/app/components/content/examples/stepper/StepperCustomSlotExample.vue b/docs/app/components/content/examples/stepper/StepperCustomSlotExample.vue new file mode 100644 index 00000000..a16ae362 --- /dev/null +++ b/docs/app/components/content/examples/stepper/StepperCustomSlotExample.vue @@ -0,0 +1,41 @@ + + + diff --git a/docs/app/components/content/examples/stepper/StepperModelValueExample.vue b/docs/app/components/content/examples/stepper/StepperModelValueExample.vue new file mode 100644 index 00000000..cfd921cf --- /dev/null +++ b/docs/app/components/content/examples/stepper/StepperModelValueExample.vue @@ -0,0 +1,37 @@ + + + diff --git a/docs/app/components/content/examples/stepper/StepperWithControlsExample.vue b/docs/app/components/content/examples/stepper/StepperWithControlsExample.vue new file mode 100644 index 00000000..faee67c7 --- /dev/null +++ b/docs/app/components/content/examples/stepper/StepperWithControlsExample.vue @@ -0,0 +1,51 @@ + + + diff --git a/docs/content/3.components/stepper.md b/docs/content/3.components/stepper.md new file mode 100644 index 00000000..8ef2f480 --- /dev/null +++ b/docs/content/3.components/stepper.md @@ -0,0 +1,232 @@ +--- +description: A set of steps that are used to indicate progress through a multi-step process. +links: + - label: Stepper + icon: i-custom-reka-ui + to: https://reka-ui.com/docs/components/stepper + - label: GitHub + icon: i-simple-icons-github + to: https://github.com/nuxt/ui/tree/v3/src/runtime/components/Stepper.vue +navigation.badge: New +--- + +## Usage + +### Items + +Use the `items` prop as an array of objects with the following properties: + +- `title?: string`{lang="ts-type"} +- `description?: AvatarProps`{lang="ts-type"} +- `content?: string`{lang="ts-type"} +- `icon?: string`{lang="ts-type"} +- `value?: string | number`{lang="ts-type"} +- `disabled?: boolean`{lang="ts-type"} +- [`slot?: string`{lang="ts-type"}](#with-custom-slot) + +::component-code +--- +ignore: + - items + - class +external: + - items +props: + items: + - title: 'Address' + description: 'Add your address here' + icon: 'i-lucide-house' + - title: 'Shipping' + description: 'Set your preferred shipping method' + icon: 'i-lucide-truck' + - title: 'Checkout' + description: 'Confirm your order' + class: 'w-full' +--- +:: + +::note +Click on the items to navigate through the steps. +:: + +### Color + +Use the `color` prop to change the color of the Stepper. + +::component-code +--- +ignore: + - content + - items + - class +external: + - items +props: + color: neutral + items: + - title: 'Address' + description: 'Add your address here' + icon: 'i-lucide-house' + - title: 'Shipping' + description: 'Set your preferred shipping method' + icon: 'i-lucide-truck' + - title: 'Checkout' + description: 'Confirm your order' + class: 'w-full' +--- +:: + +### Size + +Use the `size` prop to change the size of the Stepper. + +::component-code +--- +ignore: + - content + - items + - class +external: + - items +props: + size: xl + items: + - title: 'Address' + description: 'Add your address here' + icon: 'i-lucide-house' + - title: 'Shipping' + description: 'Set your preferred shipping method' + icon: 'i-lucide-truck' + - title: 'Checkout' + description: 'Confirm your order' + class: 'w-full' +--- +:: + +### Orientation + +Use the `orientation` prop to change the orientation of the Stepper. Defaults to `horizontal`. + +::component-code +--- +ignore: + - content + - items + - class +external: + - items +props: + orientation: vertical + items: + - title: 'Address' + description: 'Add your address here' + icon: 'i-lucide-house' + - title: 'Shipping' + description: 'Set your preferred shipping method' + icon: 'i-lucide-truck' + - title: 'Checkout' + description: 'Confirm your order' + class: 'w-full' +--- +:: + +### Disabled + +Use the `disabled` prop to disable navigation through the steps. + +::component-code +--- +ignore: + - content + - items + - class +external: + - items +props: + disabled: true + items: + - title: 'Address' + description: 'Add your address here' + icon: 'i-lucide-house' + - title: 'Shipping' + description: 'Set your preferred shipping method' + icon: 'i-lucide-truck' + - title: 'Checkout' + description: 'Confirm your order' +--- +:: + +::note{to="#with-controls"} +This can be useful when you want to force navigation with controls. +:: + +## Examples + +### With controls + +You can add additional controls for the stepper using buttons. + +:component-example{name="stepper-with-controls-example"} + +### Control active item + +You can control the active item by using the `default-value` prop or the `v-model` directive with the index of the item. + +:component-example{name="stepper-model-value-example"} + +::tip +You can also pass the `value` of one of the items if provided. +:: + +### With content slot + +Use the `#content` slot to customize the content of each item. + +:component-example{name="stepper-content-slot-example"} + +### With custom slot + +Use the `slot` property to customize a specific item. + +:component-example{name="stepper-custom-slot-example"} + +## API + +### Props + +:component-props + +### Slots + +:component-slots + +### Emits + +:component-emits + +### Expose + +You can access the typed component instance using [`useTemplateRef`](https://vuejs.org/api/composition-api-helpers.html#usetemplateref). + +```vue + + + +``` + +This will give you access to the following: + +| Name | Type | +| ---- | ---- | +| `next`{lang="ts-type"} | `() => void`{lang="ts-type"} | +| `prev`{lang="ts-type"} | `() => void`{lang="ts-type"} | +| `hasNext`{lang="ts-type"} | `Ref`{lang="ts-type"} | +| `hasPrev`{lang="ts-type"} | `Ref`{lang="ts-type"} | + +## Theme + +:component-theme diff --git a/playground/app/app.vue b/playground/app/app.vue index 172a3ab9..cd2ff605 100644 --- a/playground/app/app.vue +++ b/playground/app/app.vue @@ -54,6 +54,7 @@ const components = [ 'skeleton', 'slideover', 'slider', + 'stepper', 'switch', 'tabs', 'table', diff --git a/playground/app/pages/components/stepper.vue b/playground/app/pages/components/stepper.vue new file mode 100644 index 00000000..d526fa5c --- /dev/null +++ b/playground/app/pages/components/stepper.vue @@ -0,0 +1,96 @@ + + + diff --git a/src/devtools/runtime/examples/StepperExample.vue b/src/devtools/runtime/examples/StepperExample.vue new file mode 100644 index 00000000..e92d4df8 --- /dev/null +++ b/src/devtools/runtime/examples/StepperExample.vue @@ -0,0 +1,44 @@ + + + diff --git a/src/runtime/components/Stepper.vue b/src/runtime/components/Stepper.vue new file mode 100644 index 00000000..f588ef80 --- /dev/null +++ b/src/runtime/components/Stepper.vue @@ -0,0 +1,170 @@ + + + + + diff --git a/src/runtime/types/index.ts b/src/runtime/types/index.ts index aa067d6b..e89e0824 100644 --- a/src/runtime/types/index.ts +++ b/src/runtime/types/index.ts @@ -37,6 +37,7 @@ export * from '../components/Separator.vue' export * from '../components/Skeleton.vue' export * from '../components/Slideover.vue' export * from '../components/Slider.vue' +export * from '../components/Stepper.vue' export * from '../components/Switch.vue' export * from '../components/Table.vue' export * from '../components/Tabs.vue' diff --git a/src/theme/index.ts b/src/theme/index.ts index 7bbbdf93..c5af513a 100644 --- a/src/theme/index.ts +++ b/src/theme/index.ts @@ -37,6 +37,7 @@ export { default as separator } from './separator' export { default as skeleton } from './skeleton' export { default as slideover } from './slideover' export { default as slider } from './slider' +export { default as stepper } from './stepper' export { default as switch } from './switch' export { default as table } from './table' export { default as tabs } from './tabs' diff --git a/src/theme/stepper.ts b/src/theme/stepper.ts new file mode 100644 index 00000000..b5038935 --- /dev/null +++ b/src/theme/stepper.ts @@ -0,0 +1,131 @@ +import type { ModuleOptions } from '../module' + +export default (options: Required) => ({ + slots: { + root: 'flex gap-4', + header: 'flex', + item: 'group text-center relative w-full', + container: 'relative', + trigger: 'rounded-full font-medium text-center align-middle flex items-center justify-center font-semibold group-data-[state=completed]:text-[var(--ui-bg)] group-data-[state=active]:text-[var(--ui-bg)] text-[var(--ui-text-muted)] bg-[var(--ui-bg-elevated)] focus-visible:outline-2 focus-visible:outline-offset-2', + indicator: 'flex items-center justify-center size-full', + icon: 'shrink-0', + separator: 'absolute rounded-full group-data-[disabled]:opacity-75 bg-[var(--ui-border-accented)]', + wrapper: '', + title: 'font-medium text-[var(--ui-text)]', + description: 'text-[var(--ui-text-muted)] text-wrap', + content: 'size-full' + }, + + variants: { + orientation: { + horizontal: { + root: 'flex-col', + container: 'flex justify-center', + separator: 'top-[calc(50%-2px)] h-0.5', + wrapper: 'mt-1' + }, + vertical: { + header: 'flex-col gap-4', + item: 'flex text-left', + separator: 'left-[calc(50%-1px)] -bottom-[10px] w-0.5' + } + }, + + size: { + xs: { + trigger: 'size-6 text-xs', + icon: 'size-3', + title: 'text-xs', + description: 'text-xs', + wrapper: 'mt-1.5' + }, + sm: { + trigger: 'size-8 text-sm', + icon: 'size-4', + title: 'text-xs', + description: 'text-xs', + wrapper: 'mt-2' + }, + md: { + trigger: 'size-10 text-base', + icon: 'size-5', + title: 'text-sm', + description: 'text-sm', + wrapper: 'mt-2.5' + }, + lg: { + trigger: 'size-12 text-lg', + icon: 'size-6', + title: 'text-base', + description: 'text-base', + wrapper: 'mt-3' + }, + xl: { + trigger: 'size-14 text-xl', + icon: 'size-7', + title: 'text-lg', + description: 'text-lg', + wrapper: 'mt-3.5' + } + }, + + color: { + ...Object.fromEntries((options.theme.colors || []).map((color: string) => [color, { + trigger: `group-data-[state=completed]:bg-[var(--ui-${color})] group-data-[state=active]:bg-[var(--ui-${color})] focus-visible:outline-[var(--ui-${color})]`, + separator: `group-data-[state=completed]:bg-[var(--ui-${color})]` + }])), + neutral: { + trigger: `group-data-[state=completed]:bg-[var(--ui-bg-inverted)] group-data-[state=active]:bg-[var(--ui-bg-inverted)] focus-visible:outline-[var(--ui-border-inverted)]`, + separator: `group-data-[state=completed]:bg-[var(--ui-bg-inverted)]` + } + } + }, + + compoundVariants: [{ + orientation: 'horizontal', + size: 'xs', + class: { separator: 'left-[calc(50%+16px)] right-[calc(-50%+16px)]' } + }, { + orientation: 'horizontal', + size: 'sm', + class: { separator: 'left-[calc(50%+20px)] right-[calc(-50%+20px)]' } + }, { + orientation: 'horizontal', + size: 'md', + class: { separator: 'left-[calc(50%+28px)] right-[calc(-50%+28px)]' } + }, { + orientation: 'horizontal', + size: 'lg', + class: { separator: 'left-[calc(50%+32px)] right-[calc(-50%+32px)]' } + }, { + orientation: 'horizontal', + size: 'xl', + class: { separator: 'left-[calc(50%+36px)] right-[calc(-50%+36px)]' } + }, { + orientation: 'vertical', + size: 'xs', + class: { separator: 'top-[30px]', item: 'gap-1.5' } + }, { + orientation: 'vertical', + size: 'sm', + class: { separator: 'top-[38px]', item: 'gap-2' } + }, { + orientation: 'vertical', + size: 'md', + class: { separator: 'top-[46px]', item: 'gap-2.5' } + }, { + orientation: 'vertical', + size: 'lg', + class: { separator: 'top-[54px]', item: 'gap-3' } + }, { + orientation: 'vertical', + size: 'xl', + class: { separator: 'top-[62px]', item: 'gap-3.5' } + }], + + defaultVariants: { + orientation: 'horizontal', + size: 'md', + color: 'primary' + } +}) diff --git a/test/components/Stepper.spec.ts b/test/components/Stepper.spec.ts new file mode 100644 index 00000000..295ddb00 --- /dev/null +++ b/test/components/Stepper.spec.ts @@ -0,0 +1,50 @@ +import { describe, it, expect } from 'vitest' +import Stepper, { type StepperProps, type StepperSlots } from '../../src/runtime/components/Stepper.vue' +import ComponentRender from '../component-render' +import theme from '#build/ui/stepper' + +describe('Stepper', () => { + const sizes = Object.keys(theme.variants.size) as any + + const items = [ + { + title: 'Address', + description: 'Add your address here', + icon: 'i-lucide-house' + }, { + title: 'Shipping', + description: 'Set your preferred shipping method', + icon: 'i-lucide-truck' + }, { + slot: 'custom', + title: 'Checkout', + description: 'Confirm your order' + } + ] + + const props = { items } + + it.each([ + // Props + ['with items', { props }], + ['with defaultValue', { props: { ...props, defaultValue: 1 } }], + ['with modelValue', { props: { ...props, modelValue: 1 } }], + ['with neutral color', { props: { ...props, color: 'neutral' } }], + ...sizes.map((size: string) => [`with size ${size} horizontal`, { props: { ...props, size } }]), + ...sizes.map((size: string) => [`with size ${size} vertical`, { props: { ...props, size, orientation: 'vertical' } }]), + ['without linear', { props: { ...props, linear: false } }], + ['with as', { props: { ...props, as: 'section' } }], + ['with class', { props: { ...props, class: 'gap-8' } }], + ['with ui', { props: { ...props, ui: { title: 'font-bold' } } }], + // Slots + ['with default slot', { props, slots: { default: () => 'Default slot' } }], + ['with indicator slot', { props, slots: { indicator: () => 'Indicator slot' } }], + ['with title slot', { props, slots: { title: () => 'Title slot' } }], + ['with description slot', { props, slots: { description: () => 'Description slot' } }], + ['with content slot', { props, slots: { content: () => 'Content slot' } }], + ['with custom slot', { props, slots: { custom: () => 'Custom slot' } }] + ])('renders %s correctly', async (nameOrHtml: string, options: { props?: StepperProps, slots?: Partial> }) => { + const html = await ComponentRender(nameOrHtml, options, Stepper) + expect(html).toMatchSnapshot() + }) +}) diff --git a/test/components/__snapshots__/Stepper-vue.spec.ts.snap b/test/components/__snapshots__/Stepper-vue.spec.ts.snap new file mode 100644 index 00000000..2cbe2a65 --- /dev/null +++ b/test/components/__snapshots__/Stepper-vue.spec.ts.snap @@ -0,0 +1,1009 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`Stepper > renders with as correctly 1`] = ` +"
+
+
+
+
+
+
+

Address

+

Add your address here

+
+
+
+
+
+
+
+

Shipping

+

Set your preferred shipping method

+
+
+
+
+ +
+
+

Checkout

+

Confirm your order

+
+
+
+ +
Step 0 of 3
+
" +`; + +exports[`Stepper > renders with class correctly 1`] = ` +"
+
+
+
+
+
+
+

Address

+

Add your address here

+
+
+
+
+
+
+
+

Shipping

+

Set your preferred shipping method

+
+
+
+
+ +
+
+

Checkout

+

Confirm your order

+
+
+
+ +
Step 0 of 3
+
" +`; + +exports[`Stepper > renders with content slot correctly 1`] = ` +"
+
+
+
+
+
+
+

Address

+

Add your address here

+
+
+
+
+
+
+
+

Shipping

+

Set your preferred shipping method

+
+
+
+
+ +
+
+

Checkout

+

Confirm your order

+
+
+
+
Content slot
+
Step 0 of 3
+
" +`; + +exports[`Stepper > renders with custom slot correctly 1`] = ` +"
+
+
+
+
+
+
+

Address

+

Add your address here

+
+
+
+
+
+
+
+

Shipping

+

Set your preferred shipping method

+
+
+
+
+ +
+
+

Checkout

+

Confirm your order

+
+
+
+ +
Step 0 of 3
+
" +`; + +exports[`Stepper > renders with default slot correctly 1`] = ` +"
+
+
+
+
+
+
+

Address

+

Add your address here

+
+
+
+
+
+
+
+

Shipping

+

Set your preferred shipping method

+
+
+
+
+ +
+
+

Checkout

+

Confirm your order

+
+
+
+ +
Step 0 of 3
+
" +`; + +exports[`Stepper > renders with defaultValue correctly 1`] = ` +"
+
+
+
+
+
+
+

Address

+

Add your address here

+
+
+
+
+
+
+
+

Shipping

+

Set your preferred shipping method

+
+
+
+
+ +
+
+

Checkout

+

Confirm your order

+
+
+
+ +
Step 1 of 3
+
" +`; + +exports[`Stepper > renders with description slot correctly 1`] = ` +"
+
+
+
+
+
+
+

Address

+

Description slot

+
+
+
+
+
+
+
+

Shipping

+

Description slot

+
+
+
+
+ +
+
+

Checkout

+

Description slot

+
+
+
+ +
Step 0 of 3
+
" +`; + +exports[`Stepper > renders with indicator slot correctly 1`] = ` +"
+
+
+
+
+
+
+

Address

+

Add your address here

+
+
+
+
+
+
+
+

Shipping

+

Set your preferred shipping method

+
+
+
+
+ +
+
+

Checkout

+

Confirm your order

+
+
+
+ +
Step 0 of 3
+
" +`; + +exports[`Stepper > renders with items correctly 1`] = ` +"
+
+
+
+
+
+
+

Address

+

Add your address here

+
+
+
+
+
+
+
+

Shipping

+

Set your preferred shipping method

+
+
+
+
+ +
+
+

Checkout

+

Confirm your order

+
+
+
+ +
Step 0 of 3
+
" +`; + +exports[`Stepper > renders with modelValue correctly 1`] = ` +"
+
+
+
+
+
+
+

Address

+

Add your address here

+
+
+
+
+
+
+
+

Shipping

+

Set your preferred shipping method

+
+
+
+
+ +
+
+

Checkout

+

Confirm your order

+
+
+
+ +
Step 1 of 3
+
" +`; + +exports[`Stepper > renders with neutral color correctly 1`] = ` +"
+
+
+
+
+
+
+

Address

+

Add your address here

+
+
+
+
+
+
+
+

Shipping

+

Set your preferred shipping method

+
+
+
+
+ +
+
+

Checkout

+

Confirm your order

+
+
+
+ +
Step 0 of 3
+
" +`; + +exports[`Stepper > renders with size lg horizontal correctly 1`] = ` +"
+
+
+
+
+
+
+

Address

+

Add your address here

+
+
+
+
+
+
+
+

Shipping

+

Set your preferred shipping method

+
+
+
+
+ +
+
+

Checkout

+

Confirm your order

+
+
+
+ +
Step 0 of 3
+
" +`; + +exports[`Stepper > renders with size lg vertical correctly 1`] = ` +"
+
+
+
+
+
+
+

Address

+

Add your address here

+
+
+
+
+
+
+
+

Shipping

+

Set your preferred shipping method

+
+
+
+
+ +
+
+

Checkout

+

Confirm your order

+
+
+
+ +
Step 0 of 3
+
" +`; + +exports[`Stepper > renders with size md horizontal correctly 1`] = ` +"
+
+
+
+
+
+
+

Address

+

Add your address here

+
+
+
+
+
+
+
+

Shipping

+

Set your preferred shipping method

+
+
+
+
+ +
+
+

Checkout

+

Confirm your order

+
+
+
+ +
Step 0 of 3
+
" +`; + +exports[`Stepper > renders with size md vertical correctly 1`] = ` +"
+
+
+
+
+
+
+

Address

+

Add your address here

+
+
+
+
+
+
+
+

Shipping

+

Set your preferred shipping method

+
+
+
+
+ +
+
+

Checkout

+

Confirm your order

+
+
+
+ +
Step 0 of 3
+
" +`; + +exports[`Stepper > renders with size sm horizontal correctly 1`] = ` +"
+
+
+
+
+
+
+

Address

+

Add your address here

+
+
+
+
+
+
+
+

Shipping

+

Set your preferred shipping method

+
+
+
+
+ +
+
+

Checkout

+

Confirm your order

+
+
+
+ +
Step 0 of 3
+
" +`; + +exports[`Stepper > renders with size sm vertical correctly 1`] = ` +"
+
+
+
+
+
+
+

Address

+

Add your address here

+
+
+
+
+
+
+
+

Shipping

+

Set your preferred shipping method

+
+
+
+
+ +
+
+

Checkout

+

Confirm your order

+
+
+
+ +
Step 0 of 3
+
" +`; + +exports[`Stepper > renders with size xl horizontal correctly 1`] = ` +"
+
+
+
+
+
+
+

Address

+

Add your address here

+
+
+
+
+
+
+
+

Shipping

+

Set your preferred shipping method

+
+
+
+
+ +
+
+

Checkout

+

Confirm your order

+
+
+
+ +
Step 0 of 3
+
" +`; + +exports[`Stepper > renders with size xl vertical correctly 1`] = ` +"
+
+
+
+
+
+
+

Address

+

Add your address here

+
+
+
+
+
+
+
+

Shipping

+

Set your preferred shipping method

+
+
+
+
+ +
+
+

Checkout

+

Confirm your order

+
+
+
+ +
Step 0 of 3
+
" +`; + +exports[`Stepper > renders with size xs horizontal correctly 1`] = ` +"
+
+
+
+
+
+
+

Address

+

Add your address here

+
+
+
+
+
+
+
+

Shipping

+

Set your preferred shipping method

+
+
+
+
+ +
+
+

Checkout

+

Confirm your order

+
+
+
+ +
Step 0 of 3
+
" +`; + +exports[`Stepper > renders with size xs vertical correctly 1`] = ` +"
+
+
+
+
+
+
+

Address

+

Add your address here

+
+
+
+
+
+
+
+

Shipping

+

Set your preferred shipping method

+
+
+
+
+ +
+
+

Checkout

+

Confirm your order

+
+
+
+ +
Step 0 of 3
+
" +`; + +exports[`Stepper > renders with title slot correctly 1`] = ` +"
+
+
+
+
+
+
+

Title slot

+

Add your address here

+
+
+
+
+
+
+
+

Title slot

+

Set your preferred shipping method

+
+
+
+
+ +
+
+

Title slot

+

Confirm your order

+
+
+
+ +
Step 0 of 3
+
" +`; + +exports[`Stepper > renders with ui correctly 1`] = ` +"
+
+
+
+
+
+
+

Address

+

Add your address here

+
+
+
+
+
+
+
+

Shipping

+

Set your preferred shipping method

+
+
+
+
+ +
+
+

Checkout

+

Confirm your order

+
+
+
+ +
Step 0 of 3
+
" +`; + +exports[`Stepper > renders without linear correctly 1`] = ` +"
+
+
+
+
+
+
+

Address

+

Add your address here

+
+
+
+
+
+
+
+

Shipping

+

Set your preferred shipping method

+
+
+
+
+ +
+
+

Checkout

+

Confirm your order

+
+
+
+ +
Step 0 of 3
+
" +`; diff --git a/test/components/__snapshots__/Stepper.spec.ts.snap b/test/components/__snapshots__/Stepper.spec.ts.snap new file mode 100644 index 00000000..a1ef1d49 --- /dev/null +++ b/test/components/__snapshots__/Stepper.spec.ts.snap @@ -0,0 +1,1009 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`Stepper > renders with as correctly 1`] = ` +"
+
+
+
+
+
+
+

Address

+

Add your address here

+
+
+
+
+
+
+
+

Shipping

+

Set your preferred shipping method

+
+
+
+
+ +
+
+

Checkout

+

Confirm your order

+
+
+
+ +
Step 0 of 3
+
" +`; + +exports[`Stepper > renders with class correctly 1`] = ` +"
+
+
+
+
+
+
+

Address

+

Add your address here

+
+
+
+
+
+
+
+

Shipping

+

Set your preferred shipping method

+
+
+
+
+ +
+
+

Checkout

+

Confirm your order

+
+
+
+ +
Step 0 of 3
+
" +`; + +exports[`Stepper > renders with content slot correctly 1`] = ` +"
+
+
+
+
+
+
+

Address

+

Add your address here

+
+
+
+
+
+
+
+

Shipping

+

Set your preferred shipping method

+
+
+
+
+ +
+
+

Checkout

+

Confirm your order

+
+
+
+
Content slot
+
Step 0 of 3
+
" +`; + +exports[`Stepper > renders with custom slot correctly 1`] = ` +"
+
+
+
+
+
+
+

Address

+

Add your address here

+
+
+
+
+
+
+
+

Shipping

+

Set your preferred shipping method

+
+
+
+
+ +
+
+

Checkout

+

Confirm your order

+
+
+
+ +
Step 0 of 3
+
" +`; + +exports[`Stepper > renders with default slot correctly 1`] = ` +"
+
+
+
+
+
+
+

Address

+

Add your address here

+
+
+
+
+
+
+
+

Shipping

+

Set your preferred shipping method

+
+
+
+
+ +
+
+

Checkout

+

Confirm your order

+
+
+
+ +
Step 0 of 3
+
" +`; + +exports[`Stepper > renders with defaultValue correctly 1`] = ` +"
+
+
+
+
+
+
+

Address

+

Add your address here

+
+
+
+
+
+
+
+

Shipping

+

Set your preferred shipping method

+
+
+
+
+ +
+
+

Checkout

+

Confirm your order

+
+
+
+ +
Step 1 of 3
+
" +`; + +exports[`Stepper > renders with description slot correctly 1`] = ` +"
+
+
+
+
+
+
+

Address

+

Description slot

+
+
+
+
+
+
+
+

Shipping

+

Description slot

+
+
+
+
+ +
+
+

Checkout

+

Description slot

+
+
+
+ +
Step 0 of 3
+
" +`; + +exports[`Stepper > renders with indicator slot correctly 1`] = ` +"
+
+
+
+
+
+
+

Address

+

Add your address here

+
+
+
+
+
+
+
+

Shipping

+

Set your preferred shipping method

+
+
+
+
+ +
+
+

Checkout

+

Confirm your order

+
+
+
+ +
Step 0 of 3
+
" +`; + +exports[`Stepper > renders with items correctly 1`] = ` +"
+
+
+
+
+
+
+

Address

+

Add your address here

+
+
+
+
+
+
+
+

Shipping

+

Set your preferred shipping method

+
+
+
+
+ +
+
+

Checkout

+

Confirm your order

+
+
+
+ +
Step 0 of 3
+
" +`; + +exports[`Stepper > renders with modelValue correctly 1`] = ` +"
+
+
+
+
+
+
+

Address

+

Add your address here

+
+
+
+
+
+
+
+

Shipping

+

Set your preferred shipping method

+
+
+
+
+ +
+
+

Checkout

+

Confirm your order

+
+
+
+ +
Step 1 of 3
+
" +`; + +exports[`Stepper > renders with neutral color correctly 1`] = ` +"
+
+
+
+
+
+
+

Address

+

Add your address here

+
+
+
+
+
+
+
+

Shipping

+

Set your preferred shipping method

+
+
+
+
+ +
+
+

Checkout

+

Confirm your order

+
+
+
+ +
Step 0 of 3
+
" +`; + +exports[`Stepper > renders with size lg horizontal correctly 1`] = ` +"
+
+
+
+
+
+
+

Address

+

Add your address here

+
+
+
+
+
+
+
+

Shipping

+

Set your preferred shipping method

+
+
+
+
+ +
+
+

Checkout

+

Confirm your order

+
+
+
+ +
Step 0 of 3
+
" +`; + +exports[`Stepper > renders with size lg vertical correctly 1`] = ` +"
+
+
+
+
+
+
+

Address

+

Add your address here

+
+
+
+
+
+
+
+

Shipping

+

Set your preferred shipping method

+
+
+
+
+ +
+
+

Checkout

+

Confirm your order

+
+
+
+ +
Step 0 of 3
+
" +`; + +exports[`Stepper > renders with size md horizontal correctly 1`] = ` +"
+
+
+
+
+
+
+

Address

+

Add your address here

+
+
+
+
+
+
+
+

Shipping

+

Set your preferred shipping method

+
+
+
+
+ +
+
+

Checkout

+

Confirm your order

+
+
+
+ +
Step 0 of 3
+
" +`; + +exports[`Stepper > renders with size md vertical correctly 1`] = ` +"
+
+
+
+
+
+
+

Address

+

Add your address here

+
+
+
+
+
+
+
+

Shipping

+

Set your preferred shipping method

+
+
+
+
+ +
+
+

Checkout

+

Confirm your order

+
+
+
+ +
Step 0 of 3
+
" +`; + +exports[`Stepper > renders with size sm horizontal correctly 1`] = ` +"
+
+
+
+
+
+
+

Address

+

Add your address here

+
+
+
+
+
+
+
+

Shipping

+

Set your preferred shipping method

+
+
+
+
+ +
+
+

Checkout

+

Confirm your order

+
+
+
+ +
Step 0 of 3
+
" +`; + +exports[`Stepper > renders with size sm vertical correctly 1`] = ` +"
+
+
+
+
+
+
+

Address

+

Add your address here

+
+
+
+
+
+
+
+

Shipping

+

Set your preferred shipping method

+
+
+
+
+ +
+
+

Checkout

+

Confirm your order

+
+
+
+ +
Step 0 of 3
+
" +`; + +exports[`Stepper > renders with size xl horizontal correctly 1`] = ` +"
+
+
+
+
+
+
+

Address

+

Add your address here

+
+
+
+
+
+
+
+

Shipping

+

Set your preferred shipping method

+
+
+
+
+ +
+
+

Checkout

+

Confirm your order

+
+
+
+ +
Step 0 of 3
+
" +`; + +exports[`Stepper > renders with size xl vertical correctly 1`] = ` +"
+
+
+
+
+
+
+

Address

+

Add your address here

+
+
+
+
+
+
+
+

Shipping

+

Set your preferred shipping method

+
+
+
+
+ +
+
+

Checkout

+

Confirm your order

+
+
+
+ +
Step 0 of 3
+
" +`; + +exports[`Stepper > renders with size xs horizontal correctly 1`] = ` +"
+
+
+
+
+
+
+

Address

+

Add your address here

+
+
+
+
+
+
+
+

Shipping

+

Set your preferred shipping method

+
+
+
+
+ +
+
+

Checkout

+

Confirm your order

+
+
+
+ +
Step 0 of 3
+
" +`; + +exports[`Stepper > renders with size xs vertical correctly 1`] = ` +"
+
+
+
+
+
+
+

Address

+

Add your address here

+
+
+
+
+
+
+
+

Shipping

+

Set your preferred shipping method

+
+
+
+
+ +
+
+

Checkout

+

Confirm your order

+
+
+
+ +
Step 0 of 3
+
" +`; + +exports[`Stepper > renders with title slot correctly 1`] = ` +"
+
+
+
+
+
+
+

Title slot

+

Add your address here

+
+
+
+
+
+
+
+

Title slot

+

Set your preferred shipping method

+
+
+
+
+ +
+
+

Title slot

+

Confirm your order

+
+
+
+ +
Step 0 of 3
+
" +`; + +exports[`Stepper > renders with ui correctly 1`] = ` +"
+
+
+
+
+
+
+

Address

+

Add your address here

+
+
+
+
+
+
+
+

Shipping

+

Set your preferred shipping method

+
+
+
+
+ +
+
+

Checkout

+

Confirm your order

+
+
+
+ +
Step 0 of 3
+
" +`; + +exports[`Stepper > renders without linear correctly 1`] = ` +"
+
+
+
+
+
+
+

Address

+

Add your address here

+
+
+
+
+
+
+
+

Shipping

+

Set your preferred shipping method

+
+
+
+
+ +
+
+

Checkout

+

Confirm your order

+
+
+
+ +
Step 0 of 3
+
" +`;