@myelmut/design-system 0.1.50 → 0.1.52
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/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.es.js +43 -39
- package/dist/index.es.js.map +1 -1
- package/dist/types/index.d.ts +3 -2
- package/package.json +1 -1
- package/src/components/Base/Text/Text.tsx +2 -0
- package/src/components/Base/Title/Title.tsx +1 -0
- package/src/components/Inputs/WizardTextInput/WizardTextInput.tsx +1 -1
- package/src/components/Navigation/Tabs/Tabs.tsx +3 -2
- package/src/components/Navigation/WizardNavbar/WizardNavbar.tsx +9 -6
package/dist/types/index.d.ts
CHANGED
|
@@ -871,13 +871,14 @@ declare interface WizardDropdownProps {
|
|
|
871
871
|
searchable?: boolean;
|
|
872
872
|
}
|
|
873
873
|
|
|
874
|
-
export declare const WizardNavbar: ({ variant, totalSteps, currentStep, className }: WizardNavbarProps) => JSX.Element;
|
|
874
|
+
export declare const WizardNavbar: ({ variant, totalSteps, currentStep, className, backToPreviousStep }: WizardNavbarProps) => JSX.Element;
|
|
875
875
|
|
|
876
876
|
declare type WizardNavbarProps = {
|
|
877
877
|
variant: 'default' | 'form' | 'payment';
|
|
878
878
|
totalSteps?: number;
|
|
879
879
|
currentStep?: number;
|
|
880
880
|
className?: string;
|
|
881
|
+
backToPreviousStep?: () => void;
|
|
881
882
|
};
|
|
882
883
|
|
|
883
884
|
export declare const WizardTextInput: ({ placeholder, name, disabled, className, hasError, error, ...props }: WizardTextInputProps) => JSX.Element;
|
|
@@ -885,7 +886,7 @@ export declare const WizardTextInput: ({ placeholder, name, disabled, className,
|
|
|
885
886
|
declare interface WizardTextInputProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
886
887
|
placeholder: string;
|
|
887
888
|
name: string;
|
|
888
|
-
disabled
|
|
889
|
+
disabled?: boolean;
|
|
889
890
|
error: string;
|
|
890
891
|
hasError: boolean;
|
|
891
892
|
className?: string;
|
package/package.json
CHANGED
|
@@ -31,6 +31,7 @@ export const Text = ({ variant = 'p', size = 'md', children, className = '', ...
|
|
|
31
31
|
br: <br />,
|
|
32
32
|
b: <b />,
|
|
33
33
|
i: <i />,
|
|
34
|
+
u: <u />,
|
|
34
35
|
}}
|
|
35
36
|
/>
|
|
36
37
|
) : (
|
|
@@ -49,6 +50,7 @@ export const Text = ({ variant = 'p', size = 'md', children, className = '', ...
|
|
|
49
50
|
br: <br />,
|
|
50
51
|
b: <b />,
|
|
51
52
|
i: <i />,
|
|
53
|
+
u: <u />,
|
|
52
54
|
}}
|
|
53
55
|
/>
|
|
54
56
|
) : (
|
|
@@ -5,7 +5,7 @@ import { ErrorMessage } from '../ErrorMessage/ErrorMessage';
|
|
|
5
5
|
export interface WizardTextInputProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
6
6
|
placeholder: string;
|
|
7
7
|
name: string;
|
|
8
|
-
disabled
|
|
8
|
+
disabled?: boolean;
|
|
9
9
|
error: string;
|
|
10
10
|
hasError: boolean;
|
|
11
11
|
className?: string;
|
|
@@ -27,7 +27,8 @@ export interface TabsProps {
|
|
|
27
27
|
export const Tabs = ({ tabs, defaultActiveTab, onTabChange, className = '', tabClassName = '', activeTabClassName = '', contentClassName = '', variant = 'default' }: TabsProps) => {
|
|
28
28
|
const [activeTab, setActiveTab] = useState(defaultActiveTab || tabs[0]?.id);
|
|
29
29
|
|
|
30
|
-
const handleTabClick = (tabId: string) => {
|
|
30
|
+
const handleTabClick = (e: React.MouseEvent<HTMLButtonElement>, tabId: string) => {
|
|
31
|
+
e.preventDefault();
|
|
31
32
|
if (tabs.find((tab) => tab.id === tabId)?.disabled) return;
|
|
32
33
|
|
|
33
34
|
setActiveTab(tabId);
|
|
@@ -61,7 +62,7 @@ export const Tabs = ({ tabs, defaultActiveTab, onTabChange, className = '', tabC
|
|
|
61
62
|
return (
|
|
62
63
|
<button
|
|
63
64
|
key={tab.id}
|
|
64
|
-
onClick={() => handleTabClick(tab.id)}
|
|
65
|
+
onClick={(e) => handleTabClick(e, tab.id)}
|
|
65
66
|
disabled={isDisabled}
|
|
66
67
|
className={clsx(
|
|
67
68
|
"w-full",
|
|
@@ -10,6 +10,7 @@ export type WizardNavbarProps = {
|
|
|
10
10
|
totalSteps?: number;
|
|
11
11
|
currentStep?: number;
|
|
12
12
|
className?: string;
|
|
13
|
+
backToPreviousStep?: () => void;
|
|
13
14
|
};
|
|
14
15
|
|
|
15
16
|
const variantStyles = {
|
|
@@ -59,20 +60,22 @@ const TagMobile = ({ variant, totalSteps, currentStep, className }: { variant: W
|
|
|
59
60
|
};
|
|
60
61
|
|
|
61
62
|
//todo update button actions or links
|
|
62
|
-
export const WizardNavbar = ({ variant = 'default', totalSteps = 8, currentStep = 1, className }: WizardNavbarProps) => {
|
|
63
|
+
export const WizardNavbar = ({ variant = 'default', totalSteps = 8, currentStep = 1, className, backToPreviousStep = () => {} }: WizardNavbarProps) => {
|
|
63
64
|
const { t } = useTranslation('design');
|
|
64
65
|
|
|
65
66
|
return (
|
|
66
|
-
<nav className={clsx('fixed top-0 right-0 left-0 z-
|
|
67
|
-
<div className={clsx('container
|
|
68
|
-
<Button
|
|
67
|
+
<nav className={clsx('fixed top-0 right-0 left-0 z-20', variantStyles[variant], className)}>
|
|
68
|
+
<div className={clsx('container flex items-center', containerStyles[variant])}>
|
|
69
|
+
<Button onClick={backToPreviousStep} as="button" variant="terciary" color={variant === 'payment' ? 'light' : 'dark'} className={clsx(variant === 'default' && 'hidden')}>
|
|
69
70
|
{t('navigation.back')}
|
|
70
71
|
</Button>
|
|
71
|
-
<
|
|
72
|
+
<a href="/" className="mx-auto w-28">
|
|
73
|
+
<Logo variant={variant === 'payment' ? 'secondary' : 'primary'} />
|
|
74
|
+
</a>
|
|
72
75
|
{variant != 'default' && <TagDesktop variant={variant} totalSteps={totalSteps} currentStep={currentStep} />}
|
|
73
76
|
</div>
|
|
74
77
|
{variant != 'default' && (
|
|
75
|
-
<div className="container
|
|
78
|
+
<div className="container">
|
|
76
79
|
<TagMobile variant={variant} totalSteps={totalSteps} currentStep={currentStep} />
|
|
77
80
|
{variant === 'form' && <Stepper totalSteps={totalSteps} currentStep={currentStep} className="mx-auto mt-6 w-full md:mt-3.5 md:w-3/4" />}
|
|
78
81
|
</div>
|