@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/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: flex;
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
- @media (min-width: 767px) {
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
- .YPXf1KvhUKPvYzjuCpbK.FpsgzNaIkKnxuWthvj1T {
160
- margin-top: 24px;
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
+ }
@@ -0,0 +1,5 @@
1
+ import { Meta, Story } from "@storybook/react";
2
+ import { CustomDatePickerProps } from '.';
3
+ declare const _default: Meta<import("@storybook/react").Args>;
4
+ export default _default;
5
+ export declare const Primary: Story<CustomDatePickerProps>;
@@ -0,0 +1,5 @@
1
+ import { DatePickerProps } from 'antd';
2
+ export type CustomDatePickerProps = DatePickerProps & {
3
+ isRangePicker?: boolean;
4
+ };
5
+ export declare const CustomDatePicker: ({ className, onChange, value, isRangePicker, ...rest }: CustomDatePickerProps) => JSX.Element;
@@ -2,5 +2,7 @@ export interface HeaderProps {
2
2
  backLink?: boolean;
3
3
  title: string;
4
4
  homeLink?: boolean;
5
+ loginLink?: boolean;
6
+ onClickFunction?: () => void;
5
7
  }
6
8
  export declare const Header: (props: HeaderProps) => JSX.Element;
@@ -3,5 +3,8 @@ export interface FormInputFieldProps extends Omit<FormItemProps, "name"> {
3
3
  name: string;
4
4
  inputProps?: InputProps;
5
5
  }
6
- export declare const InputField: (inputProps: InputProps) => JSX.Element;
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;
@@ -1,5 +1,7 @@
1
1
  export interface LabelProps {
2
2
  forAttribute?: string;
3
3
  children?: any;
4
+ customStyle?: string;
5
+ isUppercase?: boolean;
4
6
  }
5
7
  export declare const Label: (props: LabelProps) => JSX.Element;
@@ -0,0 +1,5 @@
1
+ import { Meta, Story } from "@storybook/react";
2
+ import { CustomRadioProps } from '.';
3
+ declare const _default: Meta<import("@storybook/react").Args>;
4
+ export default _default;
5
+ export declare const Primary: Story<CustomRadioProps>;
@@ -0,0 +1,5 @@
1
+ import type { RadioProps } from 'antd';
2
+ export interface CustomRadioProps extends RadioProps {
3
+ description: string;
4
+ }
5
+ export declare const CustomRadio: (props: CustomRadioProps) => JSX.Element;
@@ -8,3 +8,5 @@ export * from './Select';
8
8
  export * from './Separator';
9
9
  export * from './Table';
10
10
  export * from './Tag';
11
+ export * from './DatePicker';
12
+ export * from './Radio';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@omniumretail/component-library",
3
- "version": "0.1.10",
3
+ "version": "0.1.13",
4
4
  "private": false,
5
5
  "main": "dist/bundle.js",
6
6
  "typings": "./dist/types/index",
@@ -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
+ }
@@ -0,0 +1,4 @@
1
+ .sitooDatePicker {
2
+ border: 1px solid var(--button-border-color) !important;
3
+ }
4
+
@@ -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> Voltar </Link> }
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> Home </Link>}
24
- <Link href="#" icon={<LogoutOutlined />} linkSecondary iconAlignRight> Log Out</Link>
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: flex;
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
- @media(min-width: 767px) {
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 const InputField = (inputProps: InputProps) => (
12
- <Input className={styles.input} {...inputProps} />
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
- return <label className={ styles.label } htmlFor={ forAttribute }>{ children }</label>
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
  };
@@ -10,8 +10,8 @@
10
10
  &:not(:first-child) {
11
11
  margin-top: 8px;
12
12
  }
13
-
14
- &.foo {
15
- margin-top: 24px;
16
- }
17
13
  }
14
+
15
+ .uppercase {
16
+ text-transform: uppercase;
17
+ }
@@ -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
+ }
@@ -8,3 +8,5 @@ export * from './Select';
8
8
  export * from './Separator';
9
9
  export * from './Table';
10
10
  export * from './Tag';
11
+ export * from './DatePicker';
12
+ export * from './Radio';
@@ -6,5 +6,10 @@
6
6
  "store": "Store",
7
7
  "role": "Role",
8
8
  "type": "Type"
9
+ },
10
+ "navigation": {
11
+ "back": "Go Back",
12
+ "logout": "Log Out",
13
+ "home": "Home"
9
14
  }
10
15
  }
@@ -6,5 +6,10 @@
6
6
  "store": "StoreES",
7
7
  "role": "RoleES",
8
8
  "type": "TypeES"
9
+ },
10
+ "navigation": {
11
+ "back": "Go Back ES",
12
+ "logout": "Log Out ES",
13
+ "home": "Home ES"
9
14
  }
10
15
  }
@@ -6,5 +6,10 @@
6
6
  "store": "Loja",
7
7
  "role": "Posição",
8
8
  "type": "Tipo"
9
+ },
10
+ "navigation": {
11
+ "back": "Go Back PT",
12
+ "logout": "Log Out PT",
13
+ "home": "Home PT"
9
14
  }
10
15
  }
package/webpack.config.js CHANGED
@@ -40,9 +40,9 @@ module.exports = {
40
40
  ],
41
41
  },
42
42
  plugins: [new MiniCssExtractPlugin()],
43
- // externals: {
44
- // react: "react",
45
- // "react-dom": "react-dom",
46
- // "react-router-dom": "react-router-dom",
47
- // },
43
+ externals: {
44
+ react: "react",
45
+ "react-dom": "react-dom",
46
+ "react-router-dom": "react-router-dom",
47
+ },
48
48
  };