@omniumretail/component-library 0.1.10 → 0.1.13
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/bundle.js +1170 -479
- package/dist/main.css +45 -10
- package/dist/types/components/DatePicker/DatePicker.stories.d.ts +5 -0
- package/dist/types/components/DatePicker/index.d.ts +5 -0
- package/dist/types/components/Header/index.d.ts +2 -0
- package/dist/types/components/Input/index.d.ts +4 -1
- package/dist/types/components/Label/index.d.ts +2 -0
- package/dist/types/components/Radio/Radio.stories.d.ts +5 -0
- package/dist/types/components/Radio/index.d.ts +5 -0
- package/dist/types/components/index.d.ts +2 -0
- package/package.json +1 -1
- package/src/components/DatePicker/DatePicker.stories.tsx +13 -0
- package/src/components/DatePicker/index.tsx +32 -0
- package/src/components/DatePicker/styles.module.scss +4 -0
- package/src/components/Header/index.tsx +8 -5
- package/src/components/Header/styles.module.scss +15 -7
- package/src/components/Input/index.tsx +11 -5
- package/src/components/Label/index.tsx +10 -2
- package/src/components/Label/styles.module.scss +4 -4
- package/src/components/Radio/Radio.stories.tsx +14 -0
- package/src/components/Radio/index.tsx +15 -0
- package/src/components/Radio/styles.module.scss +24 -0
- package/src/components/index.tsx +2 -0
- package/src/locales/en.json +5 -0
- package/src/locales/es.json +5 -0
- package/src/locales/pt.json +5 -0
- package/webpack.config.js +5 -5
package/dist/main.css
CHANGED
|
@@ -56,10 +56,10 @@
|
|
|
56
56
|
!*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[0].use[1]!./node_modules/sass-loader/dist/cjs.js!./src/components/Header/styles.module.scss ***!
|
|
57
57
|
\***************************************************************************************************************************************************************/
|
|
58
58
|
.SF5f_Q_Ggz_4JHUHS2Xa {
|
|
59
|
-
display:
|
|
59
|
+
display: grid;
|
|
60
|
+
grid-template-columns: repeat(3, 1fr);
|
|
61
|
+
justify-items: center;
|
|
60
62
|
align-items: center;
|
|
61
|
-
justify-content: space-between;
|
|
62
|
-
padding: 0 24px;
|
|
63
63
|
height: 75px;
|
|
64
64
|
gap: 0 24px;
|
|
65
65
|
position: relative;
|
|
@@ -67,11 +67,9 @@
|
|
|
67
67
|
@media (max-width: 767px) {
|
|
68
68
|
.SF5f_Q_Ggz_4JHUHS2Xa {
|
|
69
69
|
padding-top: 32px;
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
.SF5f_Q_Ggz_4JHUHS2Xa {
|
|
74
|
-
padding: 0 40px;
|
|
70
|
+
display: flex;
|
|
71
|
+
align-items: center;
|
|
72
|
+
justify-content: space-between;
|
|
75
73
|
}
|
|
76
74
|
}
|
|
77
75
|
.SF5f_Q_Ggz_4JHUHS2Xa .fVSt3bSZBcJGsOdA5nIN {
|
|
@@ -79,6 +77,9 @@
|
|
|
79
77
|
font-weight: var(--font-weight-semibold);
|
|
80
78
|
text-transform: uppercase;
|
|
81
79
|
}
|
|
80
|
+
.SF5f_Q_Ggz_4JHUHS2Xa .yVW6IeVCSAwXxdRW9PIK {
|
|
81
|
+
align-self: center;
|
|
82
|
+
}
|
|
82
83
|
@media (max-width: 767px) {
|
|
83
84
|
.SF5f_Q_Ggz_4JHUHS2Xa .yVW6IeVCSAwXxdRW9PIK {
|
|
84
85
|
position: absolute;
|
|
@@ -89,6 +90,12 @@
|
|
|
89
90
|
text-align: center;
|
|
90
91
|
}
|
|
91
92
|
}
|
|
93
|
+
.SF5f_Q_Ggz_4JHUHS2Xa .zpR1xIlHnIvOAGtMYHMN {
|
|
94
|
+
justify-self: start;
|
|
95
|
+
}
|
|
96
|
+
.SF5f_Q_Ggz_4JHUHS2Xa .cZ7HbAWj4tgAgHB3UcVg {
|
|
97
|
+
justify-self: end;
|
|
98
|
+
}
|
|
92
99
|
/*!*************************************************************************************************************************************************************!*\
|
|
93
100
|
!*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[0].use[1]!./node_modules/sass-loader/dist/cjs.js!./src/components/Link/styles.module.scss ***!
|
|
94
101
|
\*************************************************************************************************************************************************************/
|
|
@@ -156,8 +163,9 @@
|
|
|
156
163
|
.YPXf1KvhUKPvYzjuCpbK:not(:first-child) {
|
|
157
164
|
margin-top: 8px;
|
|
158
165
|
}
|
|
159
|
-
|
|
160
|
-
|
|
166
|
+
|
|
167
|
+
.ExPJyFK95xTcgtx9cRbg {
|
|
168
|
+
text-transform: uppercase;
|
|
161
169
|
}
|
|
162
170
|
/*!******************************************************************************************************************************************************************!*\
|
|
163
171
|
!*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[0].use[1]!./node_modules/sass-loader/dist/cjs.js!./src/components/Separator/styles.module.scss ***!
|
|
@@ -261,3 +269,30 @@
|
|
|
261
269
|
.Hfh5KLg4Y_g44Ajhx9aV .anticon-close:hover {
|
|
262
270
|
color: var(--color-black);
|
|
263
271
|
}
|
|
272
|
+
/*!*******************************************************************************************************************************************************************!*\
|
|
273
|
+
!*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[0].use[1]!./node_modules/sass-loader/dist/cjs.js!./src/components/DatePicker/styles.module.scss ***!
|
|
274
|
+
\*******************************************************************************************************************************************************************/
|
|
275
|
+
.vdTO5pKaLXA2FdyblLq5 {
|
|
276
|
+
border: 1px solid var(--button-border-color) !important;
|
|
277
|
+
}
|
|
278
|
+
/*!**************************************************************************************************************************************************************!*\
|
|
279
|
+
!*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[0].use[1]!./node_modules/sass-loader/dist/cjs.js!./src/components/Radio/styles.module.scss ***!
|
|
280
|
+
\**************************************************************************************************************************************************************/
|
|
281
|
+
.e3BZiSKkbgvekUOREMi6 {
|
|
282
|
+
font-weight: var(--font-weight-medium);
|
|
283
|
+
font-size: var(--font-size-body-3);
|
|
284
|
+
margin-right: 44px;
|
|
285
|
+
margin-top: 18px;
|
|
286
|
+
}
|
|
287
|
+
.e3BZiSKkbgvekUOREMi6 .ant-radio-checked .ant-radio-inner {
|
|
288
|
+
border-color: var(--color-black);
|
|
289
|
+
}
|
|
290
|
+
.e3BZiSKkbgvekUOREMi6 .ant-radio-checked .ant-radio-inner:after {
|
|
291
|
+
background-color: var(--color-black);
|
|
292
|
+
}
|
|
293
|
+
.e3BZiSKkbgvekUOREMi6 .ant-radio-checked:hover .ant-radio-inner:after {
|
|
294
|
+
background-color: var(--color-orange);
|
|
295
|
+
}
|
|
296
|
+
.e3BZiSKkbgvekUOREMi6 .ant-radio:hover .ant-radio-inner {
|
|
297
|
+
border-color: var(--color-orange);
|
|
298
|
+
}
|
|
@@ -3,5 +3,8 @@ export interface FormInputFieldProps extends Omit<FormItemProps, "name"> {
|
|
|
3
3
|
name: string;
|
|
4
4
|
inputProps?: InputProps;
|
|
5
5
|
}
|
|
6
|
-
export
|
|
6
|
+
export interface inputPropsCustom extends InputProps {
|
|
7
|
+
customClass?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const InputField: (inputProps: inputPropsCustom) => JSX.Element;
|
|
7
10
|
export declare const FormInputField: ({ inputProps, ...itemProps }: FormInputFieldProps) => JSX.Element;
|
package/package.json
CHANGED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Meta, Story } from "@storybook/react";
|
|
2
|
+
import { CustomDatePicker, CustomDatePickerProps } from '.';
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
title: 'DatePicker',
|
|
6
|
+
component: CustomDatePicker,
|
|
7
|
+
} as Meta;
|
|
8
|
+
|
|
9
|
+
const Template: Story<CustomDatePickerProps> = (args) => <CustomDatePicker {...args}></CustomDatePicker>;
|
|
10
|
+
|
|
11
|
+
export const Primary = Template.bind({});
|
|
12
|
+
Primary.args = {
|
|
13
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import styles from './styles.module.scss';
|
|
2
|
+
import { DatePicker, DatePickerProps } from 'antd';
|
|
3
|
+
|
|
4
|
+
export type CustomDatePickerProps = DatePickerProps & {
|
|
5
|
+
isRangePicker?: boolean;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
const { RangePicker } = DatePicker;
|
|
9
|
+
|
|
10
|
+
export const CustomDatePicker = ({
|
|
11
|
+
className, onChange, value, isRangePicker, ...rest
|
|
12
|
+
}: CustomDatePickerProps) => {
|
|
13
|
+
|
|
14
|
+
return (
|
|
15
|
+
<>
|
|
16
|
+
{ isRangePicker
|
|
17
|
+
?
|
|
18
|
+
<RangePicker
|
|
19
|
+
className={ `${styles.sitooDatePicker} ${className}` }
|
|
20
|
+
/>
|
|
21
|
+
|
|
22
|
+
:
|
|
23
|
+
<DatePicker
|
|
24
|
+
{ ...rest }
|
|
25
|
+
value={ value }
|
|
26
|
+
onChange={ onChange }
|
|
27
|
+
className={ `${styles.sitooDatePicker} ${className}` }
|
|
28
|
+
/>
|
|
29
|
+
}
|
|
30
|
+
</>
|
|
31
|
+
);
|
|
32
|
+
}
|
|
@@ -1,27 +1,30 @@
|
|
|
1
1
|
import styles from './styles.module.scss';
|
|
2
2
|
import { Link } from '../Link';
|
|
3
3
|
import { ArrowLeftOutlined, HomeOutlined, LogoutOutlined } from '@ant-design/icons';
|
|
4
|
-
|
|
4
|
+
import { useTranslation } from 'react-i18next';
|
|
5
5
|
export interface HeaderProps {
|
|
6
6
|
backLink?: boolean;
|
|
7
7
|
title: string;
|
|
8
8
|
homeLink?: boolean;
|
|
9
|
+
loginLink?: boolean;
|
|
10
|
+
onClickFunction?: () => void;
|
|
9
11
|
}
|
|
10
12
|
|
|
11
13
|
export const Header = (props: HeaderProps) => {
|
|
12
|
-
const { backLink, title, homeLink } = props;
|
|
14
|
+
const { backLink, title, homeLink, onClickFunction, loginLink } = props;
|
|
15
|
+
const { t } = useTranslation();
|
|
13
16
|
|
|
14
17
|
return (
|
|
15
18
|
<div className={styles.header}>
|
|
16
19
|
<div className={styles.columnLeft}>
|
|
17
|
-
{ backLink && <Link href="#" icon={<ArrowLeftOutlined />} linkSecondary>
|
|
20
|
+
{ backLink && <Link href="#" icon={<ArrowLeftOutlined />} linkSecondary> {t('navigation.back')} </Link> }
|
|
18
21
|
</div>
|
|
19
22
|
<div className={styles.columnCenter}>
|
|
20
23
|
<h1 className={styles.title}>{title}</h1>
|
|
21
24
|
</div>
|
|
22
25
|
<div className={styles.columnRight}>
|
|
23
|
-
{homeLink && <Link href="#" icon={<HomeOutlined />} linkSecondary iconAlignRight>
|
|
24
|
-
<Link href="#" icon={<LogoutOutlined />} linkSecondary iconAlignRight>
|
|
26
|
+
{homeLink && <Link href="#" icon={<HomeOutlined />} linkSecondary iconAlignRight> {t('navigation.home')} </Link>}
|
|
27
|
+
{loginLink && <Link href="#" onClick={onClickFunction} icon={<LogoutOutlined />} linkSecondary iconAlignRight> {t('navigation.logout')} </Link>}
|
|
25
28
|
</div>
|
|
26
29
|
</div>
|
|
27
30
|
)
|
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
.header {
|
|
2
|
-
display:
|
|
2
|
+
display: grid;
|
|
3
|
+
grid-template-columns: repeat(3, 1fr);
|
|
4
|
+
justify-items: center;
|
|
3
5
|
align-items: center;
|
|
4
|
-
justify-content: space-between;
|
|
5
|
-
padding: 0 24px;
|
|
6
6
|
height: 75px;
|
|
7
7
|
gap: 0 24px;
|
|
8
8
|
position: relative;
|
|
9
9
|
|
|
10
10
|
@media(max-width: 767px) {
|
|
11
11
|
padding-top: 32px;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
padding: 0 40px;
|
|
12
|
+
display: flex;
|
|
13
|
+
align-items: center;
|
|
14
|
+
justify-content: space-between;
|
|
16
15
|
}
|
|
17
16
|
|
|
18
17
|
.title {
|
|
@@ -22,6 +21,7 @@
|
|
|
22
21
|
}
|
|
23
22
|
|
|
24
23
|
.columnCenter {
|
|
24
|
+
align-self: center;
|
|
25
25
|
@media(max-width: 767px) {
|
|
26
26
|
position: absolute;
|
|
27
27
|
top: 0;
|
|
@@ -31,4 +31,12 @@
|
|
|
31
31
|
text-align: center;
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
|
+
|
|
35
|
+
.columnLeft {
|
|
36
|
+
justify-self: start;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.columnRight {
|
|
40
|
+
justify-self: end;
|
|
41
|
+
}
|
|
34
42
|
}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { Form, FormItemProps, Input, InputProps } from 'antd';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { RefAttributes } from 'react';
|
|
4
2
|
import styles from './styles.module.scss';
|
|
5
3
|
|
|
6
4
|
export interface FormInputFieldProps extends Omit<FormItemProps, "name"> {
|
|
@@ -8,9 +6,17 @@ export interface FormInputFieldProps extends Omit<FormItemProps, "name"> {
|
|
|
8
6
|
inputProps?: InputProps;
|
|
9
7
|
}
|
|
10
8
|
|
|
11
|
-
export
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
export interface inputPropsCustom extends InputProps {
|
|
10
|
+
customClass?: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const InputField = (inputProps: inputPropsCustom) => {
|
|
14
|
+
const { customClass } = inputProps;
|
|
15
|
+
|
|
16
|
+
return (
|
|
17
|
+
<Input className={`${styles.input} ${customClass}`} {...inputProps} />
|
|
18
|
+
);
|
|
19
|
+
}
|
|
14
20
|
|
|
15
21
|
export const FormInputField = ({ inputProps, ...itemProps }: FormInputFieldProps) => {
|
|
16
22
|
return (
|
|
@@ -1,11 +1,19 @@
|
|
|
1
|
+
import classNames from 'classnames';
|
|
1
2
|
import styles from './styles.module.scss';
|
|
2
3
|
export interface LabelProps {
|
|
3
4
|
forAttribute?: string;
|
|
4
5
|
children?: any;
|
|
6
|
+
customStyle?: string;
|
|
7
|
+
isUppercase?: boolean;
|
|
5
8
|
}
|
|
6
9
|
|
|
7
10
|
export const Label = (props: LabelProps) => {
|
|
8
|
-
const { forAttribute, children } = props;
|
|
11
|
+
const { forAttribute, children, customStyle, isUppercase } = props;
|
|
9
12
|
|
|
10
|
-
|
|
13
|
+
const labelClasses = classNames({
|
|
14
|
+
[styles.label]: true,
|
|
15
|
+
[styles.uppercase]: isUppercase,
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
return <label className={ classNames(labelClasses, customStyle) } htmlFor={ forAttribute }>{ children }</label>
|
|
11
19
|
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Meta, Story } from "@storybook/react";
|
|
2
|
+
import { CustomRadio, CustomRadioProps } from '.';
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
title: 'Radio',
|
|
6
|
+
component: CustomRadio,
|
|
7
|
+
} as Meta;
|
|
8
|
+
|
|
9
|
+
const Template: Story<CustomRadioProps> = (args) => <CustomRadio {...args}></CustomRadio>;
|
|
10
|
+
|
|
11
|
+
export const Primary = Template.bind({});
|
|
12
|
+
Primary.args = {
|
|
13
|
+
description: 'Permanente',
|
|
14
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Radio as RadioAntd } from 'antd';
|
|
2
|
+
import type { RadioProps } from 'antd';
|
|
3
|
+
import styles from './styles.module.scss';
|
|
4
|
+
|
|
5
|
+
export interface CustomRadioProps extends RadioProps {
|
|
6
|
+
description: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export const CustomRadio = (props: CustomRadioProps) => {
|
|
10
|
+
const { description } = props;
|
|
11
|
+
|
|
12
|
+
return (
|
|
13
|
+
<RadioAntd className={ styles.radio } { ...props } value={ description }> { description } </RadioAntd>
|
|
14
|
+
)
|
|
15
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
.radio {
|
|
2
|
+
:global {
|
|
3
|
+
.ant-radio-checked .ant-radio-inner{
|
|
4
|
+
border-color: var(--color-black);
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.ant-radio-checked .ant-radio-inner:after{
|
|
8
|
+
background-color: var(--color-black);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.ant-radio-checked:hover .ant-radio-inner:after{
|
|
12
|
+
background-color: var(--color-orange);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.ant-radio:hover .ant-radio-inner {
|
|
16
|
+
border-color: var(--color-orange);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
font-weight: var(--font-weight-medium);
|
|
21
|
+
font-size: var(--font-size-body-3);
|
|
22
|
+
margin-right: 44px;
|
|
23
|
+
margin-top: 18px;
|
|
24
|
+
}
|
package/src/components/index.tsx
CHANGED
package/src/locales/en.json
CHANGED
package/src/locales/es.json
CHANGED
package/src/locales/pt.json
CHANGED
package/webpack.config.js
CHANGED
|
@@ -40,9 +40,9 @@ module.exports = {
|
|
|
40
40
|
],
|
|
41
41
|
},
|
|
42
42
|
plugins: [new MiniCssExtractPlugin()],
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
43
|
+
externals: {
|
|
44
|
+
react: "react",
|
|
45
|
+
"react-dom": "react-dom",
|
|
46
|
+
"react-router-dom": "react-router-dom",
|
|
47
|
+
},
|
|
48
48
|
};
|