@myelmut/design-system 0.1.69 → 0.1.71
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.
- package/assets/illustrations/sport-2.webp +0 -0
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.es.js +42 -41
- package/dist/index.es.js.map +1 -1
- package/dist/types/index.d.ts +3 -1
- package/package.json +1 -1
- package/src/assets/illustrations/sport-2.webp +0 -0
- package/src/components/Buttons/IllustratedCardButton/IllustratedCardButton.stories.tsx +8 -0
- package/src/components/Buttons/IllustratedCardButton/IllustratedCardButton.tsx +11 -6
- /package/assets/illustrations/{basket-light.webp → bowl-3-light.webp} +0 -0
- /package/assets/illustrations/{basket.webp → bowl-3.webp} +0 -0
- /package/src/assets/illustrations/{basket-light.webp → bowl-3-light.webp} +0 -0
- /package/src/assets/illustrations/{basket.webp → bowl-3.webp} +0 -0
package/dist/types/index.d.ts
CHANGED
|
@@ -375,7 +375,7 @@ export { HomeHeroShapeSmall }
|
|
|
375
375
|
|
|
376
376
|
export declare const IllustratedCard: ForwardRefExoticComponent<IllustratedCardProps & RefAttributes<HTMLDivElement>>;
|
|
377
377
|
|
|
378
|
-
export declare const IllustratedCardButton: ({ label, layout, description, illustration, disabled, className, ...props }: IllustratedCardButtonProps) => JSX.Element;
|
|
378
|
+
export declare const IllustratedCardButton: ({ label, layout, description, illustration, disabled, className, isActive, illustrationClassName, ...props }: IllustratedCardButtonProps) => JSX.Element;
|
|
379
379
|
|
|
380
380
|
declare type IllustratedCardButtonProps = React.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
381
381
|
label: string;
|
|
@@ -383,6 +383,8 @@ declare type IllustratedCardButtonProps = React.ButtonHTMLAttributes<HTMLButtonE
|
|
|
383
383
|
description: string;
|
|
384
384
|
layout?: 'vertical' | 'horizontal';
|
|
385
385
|
className?: string;
|
|
386
|
+
isActive?: boolean;
|
|
387
|
+
illustrationClassName?: string;
|
|
386
388
|
};
|
|
387
389
|
|
|
388
390
|
declare interface IllustratedCardProps {
|
package/package.json
CHANGED
|
Binary file
|
|
@@ -37,6 +37,14 @@ const meta = {
|
|
|
37
37
|
control: 'text',
|
|
38
38
|
description: 'Additional class name',
|
|
39
39
|
},
|
|
40
|
+
isActive: {
|
|
41
|
+
control: 'boolean',
|
|
42
|
+
description: 'Whether the button is active',
|
|
43
|
+
},
|
|
44
|
+
illustrationClassName: {
|
|
45
|
+
control: 'text',
|
|
46
|
+
description: 'Additional class name for the illustration',
|
|
47
|
+
},
|
|
40
48
|
},
|
|
41
49
|
globals: {
|
|
42
50
|
backgrounds: {
|
|
@@ -6,6 +6,8 @@ export type IllustratedCardButtonProps = React.ButtonHTMLAttributes<HTMLButtonEl
|
|
|
6
6
|
description: string;
|
|
7
7
|
layout?: 'vertical' | 'horizontal';
|
|
8
8
|
className?: string;
|
|
9
|
+
isActive?: boolean;
|
|
10
|
+
illustrationClassName?: string;
|
|
9
11
|
};
|
|
10
12
|
|
|
11
13
|
const layoutStyles = {
|
|
@@ -20,25 +22,28 @@ const textLayoutStyles = {
|
|
|
20
22
|
|
|
21
23
|
const illustrationLayoutStyles = {
|
|
22
24
|
vertical: 'mb-2 w-18',
|
|
23
|
-
horizontal: 'w-
|
|
25
|
+
horizontal: 'w-16.5',
|
|
24
26
|
};
|
|
25
27
|
|
|
26
|
-
export const IllustratedCardButton = ({ label, layout = 'vertical', description, illustration, disabled, className = '', ...props }: IllustratedCardButtonProps) => {
|
|
28
|
+
export const IllustratedCardButton = ({ label, layout = 'vertical', description, illustration, disabled, className = '', isActive = false, illustrationClassName = '', ...props }: IllustratedCardButtonProps) => {
|
|
27
29
|
// prettier-ignore
|
|
28
30
|
const buttonClasses = clsx(
|
|
29
|
-
"relative md:px-5 md:py-6 flex md:flex-col items-center overflow-hidden rounded-input bg-beige-dark text-claret-violet-dark transition-all duration-300 focus:outline-none cursor-pointer disabled:cursor-not-allowed disabled:pointer-events-none disabled:opacity-50",
|
|
31
|
+
"relative md:px-5 md:py-6 flex md:flex-col items-center md:justify-center overflow-hidden rounded-input bg-beige-dark text-claret-violet-dark transition-all duration-300 focus:outline-none cursor-pointer disabled:cursor-not-allowed disabled:pointer-events-none disabled:opacity-50",
|
|
30
32
|
"after:absolute after:content-[''] after:border after:rounded-input after:border-beige-ultra-dark after:inset-0 after:z-0 hover:after:border-claret-violet-dark after:transition-colors after:duration-300 focus-visible:after:border-claret-violet-dark",
|
|
31
33
|
"md:rounded-card md:after:rounded-card gap-3 md:p-6 justify-center md:aspect-5/6 md:w-70.5",
|
|
34
|
+
isActive && "after:border-claret-violet-dark",
|
|
32
35
|
layoutStyles[layout],
|
|
33
36
|
className,
|
|
34
37
|
);
|
|
35
38
|
|
|
36
39
|
return (
|
|
37
40
|
<button className={buttonClasses} disabled={disabled} {...props} tabIndex={disabled ? -1 : 0}>
|
|
38
|
-
<
|
|
41
|
+
<div className={clsx('md:mb-6 md:h-25 md:w-auto', illustrationLayoutStyles[layout], illustrationClassName)}>
|
|
42
|
+
<img src={illustration} alt={label} className="h-full object-contain" loading="lazy" decoding="async" />
|
|
43
|
+
</div>
|
|
39
44
|
<span className={clsx('flex flex-col gap-2.5', textLayoutStyles[layout])}>
|
|
40
|
-
<span className="text-
|
|
41
|
-
<span className="text-
|
|
45
|
+
<span className="text-md-mobile w-full font-semibold md:text-xl">{label}</span>
|
|
46
|
+
<span className="text-md-mobile md:text-md w-full">{description}</span>
|
|
42
47
|
</span>
|
|
43
48
|
</button>
|
|
44
49
|
);
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|