Skip to content

Commit 6e609e7

Browse files
authored
feat: redesign base components (#3289)
redesign AccordionItem, Badge & Checkbox remove unnecessary ring-1 class move to rounded-xl for input redesign quantitySelector fixup hero styling removed spinbutton role from elements with type="number" docs update input examples redesign productCard details unify badge placements with the designs add missing mt-0.5 to input example components
1 parent d71d35f commit 6e609e7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+290
-182
lines changed

.changeset/giant-geckos-perform.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@storefront-ui/react': major
3+
'@storefront-ui/vue': major
4+
---
5+
6+
- **[CHANGED]** default badge background color. Add className `!bg-secondary-700` explicitly in order to migrate.

.changeset/sharp-pets-beam.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@storefront-ui/react': major
3+
'@storefront-ui/vue': major
4+
---
5+
6+
**[BREAKING][CHANGED]** Moved from `rounded-md` to `rounded-xl` as a default styling for `SfInput`.

.changeset/slimy-zoos-carry.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@storefront-ui/react': major
3+
'@storefront-ui/vue': major
4+
---
5+
6+
- **[BREAKING][CHANGED]** Changed `SfCheckbox` default text color. To brind the previous behaviour back, apply `!text-gray !disabled:text-gray-300 !hover:text-gray-300` to your `SfCheckbox` element.

apps/docs/components/content/_blocks/Banners.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ Mobile Background Images:
8989
Aspect ratio: 2:5
9090
Example size: 420 x 1050px
9191

92-
<Showcase showcase-name="Banners/Hero" style="min-height:620px">
92+
<Showcase showcase-name="Banners/Hero" style="min-height:620px" no-paddings>
9393

9494
::vue-only
9595
<<<../../../../preview/nuxt/pages/showcases/Banners/Hero.vue
@@ -104,7 +104,7 @@ Example size: 420 x 1050px
104104

105105
Enhance your Hero section with a contextual image on the side.
106106

107-
<Showcase showcase-name="Banners/HeroWithImage" style="min-height:620px">
107+
<Showcase showcase-name="Banners/HeroWithImage" style="min-height:620px" no-paddings>
108108

109109
::vue-only
110110
<<<../../../../preview/nuxt/pages/showcases/Banners/HeroWithImage.vue

apps/preview/next/pages/examples/SfAccordionItem.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ function Example() {
2424
open={state.get.open}
2525
onToggle={(open: boolean) => state.set({ open })}
2626
summary={
27-
<div className="flex justify-between p-2 bg-gray-100">
27+
<div className="flex justify-between p-4 font-medium hover:bg-neutral-100 active:neutral-100">
2828
<p>Click me to see the content</p>
29-
<SfIconChevronLeft className={`${state.get.open ? 'rotate-90' : '-rotate-90'}`} />
29+
<SfIconChevronLeft className={`text-neutral-500 ${state.get.open ? 'rotate-90' : '-rotate-90'}`} />
3030
</div>
3131
}
32-
className="rounded border"
32+
className="border border-neutral-200 rounded-md divide-y text-neutral-900"
3333
>
3434
<p className="p-2">
3535
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore

apps/preview/next/pages/examples/SfInput.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ function Example() {
160160
slotPrefix={prefixSlotOptions.getValue(state.get.slotPrefix)}
161161
slotSuffix={suffixSlotOptions.getValue(state.get.slotSuffix)}
162162
onChange={onChange}
163-
wrapperClassName={classNames({
163+
wrapperClassName={classNames('mt-0.5', {
164164
'peer !bg-disabled-100 !ring-disabled-300 !ring-1 !text-disabled-500':
165165
state.get.disabled || state.get.readonly,
166166
})}

apps/preview/next/pages/showcases/Badge/BadgeAvatar.tsx

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,16 @@ import { SfBadge } from '@storefront-ui/react';
44

55
export default function BadgeAvatar() {
66
return (
7-
<ul>
8-
<li className="flex items-center mb-2">
9-
<div className="relative">
10-
<img src="http://localhost:3100/@assets/woman_avatar.png" alt="Avatar of a woman" width="36" height="36" />
11-
<SfBadge variant="dot" placement="bottom-right" className="!bg-primary-600 outline outline-white" />
12-
</div>
13-
</li>
14-
<li className="flex items-center">
15-
<div className="relative">
16-
<img src="http://localhost:3100/@assets/woman_avatar.png" alt="Avatar of a woman" width="36" height="36" />
17-
<SfBadge variant="dot" placement="bottom-right" className="!bg-neutral-600 outline outline-white" />
18-
</div>
19-
</li>
20-
</ul>
7+
<div className="flex gap-3">
8+
<div className="relative">
9+
<img src="http://localhost:3100/@assets/woman_avatar.png" alt="Avatar of a woman" width="36" height="36" />
10+
<SfBadge variant="dot" placement="bottom-left" className="outline outline-white" />
11+
</div>
12+
<div className="relative">
13+
<img src="http://localhost:3100/@assets/woman_avatar.png" alt="Avatar of a woman" width="36" height="36" />
14+
<SfBadge variant="dot" placement="bottom-left" className="!bg-secondary-700 outline outline-white" />
15+
</div>
16+
</div>
2117
);
2218
}
2319

apps/preview/next/pages/showcases/Badge/BadgeOutline.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import { ShowcasePageLayout } from '../../showcases';
22
// #region source
3-
import { SfBadge, SfButton, SfIconShoppingCart } from '@storefront-ui/react';
3+
import { SfBadge, SfButton, SfIconFavoriteFilled } from '@storefront-ui/react';
44

55
export default function BadgeOutline() {
66
return (
77
<div className="flex gap-3">
88
<div className="p-3 bg-white">
99
<SfButton className="group relative" square variant="tertiary">
10-
<SfIconShoppingCart />
10+
<SfIconFavoriteFilled />
1111
<SfBadge
1212
content={100}
1313
max={99}
@@ -18,7 +18,7 @@ export default function BadgeOutline() {
1818

1919
<div className="p-3 bg-primary-700">
2020
<SfButton className="group relative hover:bg-primary-800 active:bg-primary-900" square variant="tertiary">
21-
<SfIconShoppingCart className="text-white" />
21+
<SfIconFavoriteFilled className="text-white" />
2222
<SfBadge
2323
content={100}
2424
max={99}

apps/preview/next/pages/showcases/Badge/BadgePlacement.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export default function BadgePlacement() {
1212

1313
<SfButton className="relative" square variant="tertiary">
1414
<SfIconShoppingCart />
15-
<SfBadge content={100} max={99} placement="bottom-right" />
15+
<SfBadge content={100} max={99} placement="bottom-left" />
1616
</SfButton>
1717

1818
<SfButton className="relative" square variant="tertiary">
@@ -22,7 +22,7 @@ export default function BadgePlacement() {
2222

2323
<SfButton className="relative" square variant="tertiary">
2424
<SfIconShoppingCart />
25-
<SfBadge content={100} max={99} placement="bottom-left" />
25+
<SfBadge content={100} max={99} placement="bottom-right" />
2626
</SfButton>
2727
</div>
2828
);

apps/preview/next/pages/showcases/Banners/Hero.tsx

Lines changed: 48 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,59 @@
11
/* eslint-disable jsx-a11y/alt-text */
22
import { ShowcasePageLayout } from '../../showcases';
33
// #region source
4+
import classNames from 'classnames';
45
import { SfButton } from '@storefront-ui/react';
56

7+
const heroDetails = {
8+
headline: 'New collection',
9+
title: 'Made to move. Built to win.',
10+
description: 'The new sport collection is now in store.',
11+
callToAction: 'Order now',
12+
callToActionSecondary: 'Show more',
13+
backgroundImage: 'http://localhost:3100/@assets/hero-bg-2.png',
14+
backgroundImageMobile: 'http://localhost:3100/@assets/hero-bg-mobile-2.png',
15+
image: undefined,
16+
imageAlt: undefined,
17+
variant: 'dark',
18+
};
19+
620
export default function Hero() {
21+
const {
22+
title,
23+
headline,
24+
description,
25+
callToAction,
26+
callToActionSecondary,
27+
backgroundImage,
28+
backgroundImageMobile,
29+
image,
30+
imageAlt,
31+
variant,
32+
} = heroDetails;
733
return (
8-
<div className="relative h-dvh w-dvh">
9-
<picture className="before:absolute before:inset-0 before:bg-primary-900 before:-z-10">
10-
<source srcSet="http://localhost:3100/@assets/hero-bg-2.png" media="(min-width: 768px)" />
11-
<img
12-
src="http://localhost:3100/@assets/hero-bg-mobile-2.png"
13-
className="absolute w-full h-full z-[-1] object-cover opacity-50"
14-
alt="hero"
15-
/>
34+
<div className="relative h-dvh w-dvh shrink-0">
35+
<picture>
36+
<source srcSet={backgroundImage} media="(min-width: 768px)" />
37+
<img src={backgroundImageMobile} className="absolute w-full h-full z-[-1] object-cover" alt="hero" />
1638
</picture>
17-
<div className="h-full w-full max-w-[1536px] mx-auto p-4 md:px-10 flex flex-col justify-end md:justify-center text-white">
18-
<p className="typography-text-xs md:typography-text-sm font-bold tracking-widest uppercase">New collection</p>
19-
<h1 className="typography-display-2 md:typography-display-1 md:leading-[67.5px] font-bold mt-2 mb-4">
20-
Made to move. Built to win.
21-
</h1>
22-
<p className="typography-text-base md:typography-text-lg">The new sport collection is now in store.</p>
23-
<div className="flex flex-col md:flex-row gap-4 mt-6">
24-
<SfButton size="lg" className="bg-white" variant="secondary">
25-
Order now
26-
</SfButton>
27-
<SfButton size="lg">Show more</SfButton>
39+
<div
40+
className={classNames(
41+
'h-full w-full max-w-[1536px] mx-auto flex flex-col justify-end md:justify-center',
42+
variant === 'dark' ? 'text-white' : 'text-neutral-900',
43+
)}
44+
>
45+
<div className="p-4 md:p-10 flex flex-col">
46+
<p className="typography-text-xs md:typography-text-sm font-bold tracking-widest uppercase">{headline}</p>
47+
<h1 className="mt-2 mb-4 typography-display-2 md:typography-display-1 md:leading-[67.5px] font-bold">
48+
{title}
49+
</h1>
50+
<p className="typography-text-base md:typography-text-lg">{description}</p>
51+
<div className="mt-6 flex flex-col md:flex-row gap-4">
52+
<SfButton size="lg" className="bg-white" variant="secondary">
53+
{callToAction}
54+
</SfButton>
55+
<SfButton size="lg">{callToActionSecondary}</SfButton>
56+
</div>
2857
</div>
2958
</div>
3059
</div>

0 commit comments

Comments
 (0)