diff --git a/web-wallet/CHANGELOG.md b/web-wallet/CHANGELOG.md index f7f7b5cf0..668778813 100644 --- a/web-wallet/CHANGELOG.md +++ b/web-wallet/CHANGELOG.md @@ -17,10 +17,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Update anchor colors to ensure better accessibility [#1765] - Update Transactions list design [#1922] - Update Buttons to match the design system [#1606] +- Update `Stepper` component to new design [#2071] ### Fixed - Fix Receive tab content overflows [#1901] +- Add missing "Soehne Mono" and its `@font-face` definition [#2071] + +Resolves #2071 ## [0.5.0] - 2024-03-27 @@ -232,6 +236,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 [#1922]: https://github.com/dusk-network/rusk/issues/1922 [#2026]: https://github.com/dusk-network/rusk/issues/2026 [#2000]: https://github.com/dusk-network/rusk/issues/2000 +[#2071]: https://github.com/dusk-network/rusk/issues/2071 diff --git a/web-wallet/src/lib/dusk/components/Stepper/Stepper.svelte b/web-wallet/src/lib/dusk/components/Stepper/Stepper.svelte index 33804cf27..bfd7a940d 100644 --- a/web-wallet/src/lib/dusk/components/Stepper/Stepper.svelte +++ b/web-wallet/src/lib/dusk/components/Stepper/Stepper.svelte @@ -1,43 +1,89 @@ -
-
-
-
- - {#if steps >= 2} -
- {#each Array(steps).keys() as currentStep (currentStep)} -
= 2} +
+ {#if Array.isArray(steps)} + {#each steps as currentStep, idx (currentStep)} + {@const id = `step-${randomUUID()}`} + + {#if currentStep.iconPath} + + {:else} + {showStepNumbers ? idx + 1 : ""} + {/if} + + {currentStep.label} + {/each} + {:else} + {#each Array(steps).keys() as idx (idx)} + + class:dusk-stepper__step--processed={idx <= activeStep} + aria-current={idx === activeStep ? "step" : undefined} + >{showStepNumbers ? idx + 1 : ""} {/each} -
- {/if} -
+ {/if} +
+{/if} diff --git a/web-wallet/src/lib/dusk/components/dusk.components.d.ts b/web-wallet/src/lib/dusk/components/dusk.components.d.ts index 6ef80fece..048101cfd 100644 --- a/web-wallet/src/lib/dusk/components/dusk.components.d.ts +++ b/web-wallet/src/lib/dusk/components/dusk.components.d.ts @@ -34,6 +34,11 @@ type SelectOption = { value: string; }; +type StepperStep = { + iconPath?: string; + label: string; +}; + type SuspenseErrorVariant = "alert" | "details"; type TabItem = { diff --git a/web-wallet/src/routes/components-showcase/Steppers.svelte b/web-wallet/src/routes/components-showcase/Steppers.svelte index dad9ce886..7e8d96ce2 100644 --- a/web-wallet/src/routes/components-showcase/Steppers.svelte +++ b/web-wallet/src/routes/components-showcase/Steppers.svelte @@ -1,8 +1,130 @@ + + -
- - +
+
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ +
+ + diff --git a/web-wallet/src/style/dusk-components/stepper.css b/web-wallet/src/style/dusk-components/stepper.css index 9318fe414..698c5edef 100644 --- a/web-wallet/src/style/dusk-components/stepper.css +++ b/web-wallet/src/style/dusk-components/stepper.css @@ -1,38 +1,65 @@ .dusk-stepper { + --step-size: 1.5em; + position: relative; width: 100%; + display: grid; + row-gap: var(--default-gap); + grid-template-columns: repeat(var(--columns), 1fr); + justify-content: space-between; } -.dusk-stepper__progress-bar { +.dusk-stepper::before, +.dusk-stepper::after { + --left-offset: calc(50% / var(--columns)); + + content: ""; + display: block; position: absolute; - top: 50%; + top: calc(var(--step-size) / 2); + left: var(--left-offset); transform: translateY(-50%); - width: 100%; - height: var(--progress-bar-height); - background-color: var(--progress-bg-color); + height: var(--stepper-bar-height); + background-color: var(--stepper-bg-color); border-radius: var(--control-border-radius-size); - overflow: hidden; } -.dusk-stepper__progress-filler { - height: 100%; - background-color: var(--progress-filler-color); +.dusk-stepper::before { + width: calc(100% - var(--left-offset) * 2); + background-color: var(--stepper-bg-color); } -.dusk-stepper__steps { - display: flex; - justify-content: space-between; - width: 100%; +.dusk-stepper::after { + width: var(--progress-width); + background-color: var(--stepper-filler-color); } .dusk-stepper__step { - width: 0.625em; - height: 0.625em; - background-color: var(--progress-bg-color); + grid-row: 1; + display: inline-flex; + align-items: center; + justify-content: center; + width: var(--step-size); + height: var(--step-size); + font-family: var(--mono-font-family); + line-height: 1; + background-color: var(--stepper-bg-color); border-radius: 50%; z-index: 1; + margin: 0 auto; } .dusk-stepper__step--processed { - background-color: var(--progress-filler-color); + background-color: var(--stepper-filler-color); +} + +.dusk-stepper__step-label { + grid-row: 2; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + font-family: var(--mono-font-family); + font-size: 0.5em; + text-transform: uppercase; + text-align: center; } diff --git a/web-wallet/src/style/dusk/language.css b/web-wallet/src/style/dusk/language.css index 00c49de72..6434d72e7 100644 --- a/web-wallet/src/style/dusk/language.css +++ b/web-wallet/src/style/dusk/language.css @@ -84,12 +84,18 @@ --anchor-color-hover: var(--secondary-color-variant-light); --anchor-color-active: var(--secondary-color-variant-light); - /* Progress-related components (Stepper, Progress Bar, etc */ + /* Progress bars */ --progress-bar-height: 0.3125em; --progress-bg-color: var(--primary-color); --progress-filler-color: var(--success-color); + /* Steppers */ + + --stepper-bar-height: 0.3125em; + --stepper-bg-color: var(--light-grey); + --stepper-filler-color: var(--success-color); + /* Checkbox control */ --checkbox-control-size: 1.2em; diff --git a/web-wallet/src/style/main.css b/web-wallet/src/style/main.css index ff620c413..3e99a04f9 100644 --- a/web-wallet/src/style/main.css +++ b/web-wallet/src/style/main.css @@ -32,17 +32,33 @@ @font-face { font-family: "Soehne"; font-style: normal; + font-display: swap; font-weight: 400; src: url("/fonts/soehne-buch.woff2") format("woff2"); - font-display: swap; } @font-face { font-family: "Soehne"; font-style: normal; + font-display: swap; font-weight: 500; src: url("/fonts/soehne-kraftig.woff2") format("woff2"); +} + +@font-face { + font-family: "Soehne Mono"; + font-style: normal; font-display: swap; + font-weight: 400; + src: url("/fonts/soehne-mono-buch.woff2") format("woff2"); +} + +@font-face { + font-family: "Soehne Mono"; + font-style: normal; + font-display: swap; + font-weight: 500; + src: url("/fonts/soehne-mono-kraftig.woff2") format("woff2"); } * { diff --git a/web-wallet/static/fonts/soehne-mono-buch.woff2 b/web-wallet/static/fonts/soehne-mono-buch.woff2 new file mode 100644 index 000000000..4fc6eb90b Binary files /dev/null and b/web-wallet/static/fonts/soehne-mono-buch.woff2 differ diff --git a/web-wallet/static/fonts/soehne-mono-kraftig.woff2 b/web-wallet/static/fonts/soehne-mono-kraftig.woff2 new file mode 100644 index 000000000..f17feb528 Binary files /dev/null and b/web-wallet/static/fonts/soehne-mono-kraftig.woff2 differ