@producteca/producteca-ui-kit 1.20.0 → 1.21.1-beta.0
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/components/alert/alert.js +37 -0
- package/dist/components/breadcrumb/breadcrumb.js +33 -0
- package/dist/components/breadcrumb/index.js +2 -0
- package/dist/components/button/button.js +34 -0
- package/dist/components/chip/chip.js +27 -0
- package/dist/components/chip/index.js +1 -0
- package/dist/components/icons/customIcon/customIcon.js +41 -0
- package/dist/components/icons/fileIcon/fileIcon.js +14 -0
- package/dist/components/icons/{index.d.ts → index.js} +1 -1
- package/dist/components/icons/mailIcon/mailIcon.js +14 -0
- package/dist/components/icons/parameters.js +26 -0
- package/dist/components/icons/priceCloseIcon/priceCloseIcon.js +14 -0
- package/dist/components/icons/priceDownIcon/priceDownIcon.js +14 -0
- package/dist/components/icons/searchPublication/searchPublication.js +14 -0
- package/dist/components/image/image.js +26 -0
- package/dist/components/image/index.js +1 -0
- package/dist/components/{index.d.ts → index.js} +1 -0
- package/dist/components/inputs/checkboxInput/checkboxInput.js +35 -0
- package/dist/components/inputs/checkboxInput/checkboxInputGroup.js +58 -0
- package/dist/components/inputs/checkboxInput/{index.d.ts → index.js} +1 -2
- package/dist/components/inputs/datePicker/datePicker.js +143 -0
- package/dist/components/inputs/datePicker/datePickerCustomStyles.js +145 -0
- package/dist/components/inputs/datePicker/datePickerTypes.js +1 -0
- package/dist/components/inputs/datePicker/datePickerUtils.js +109 -0
- package/dist/components/inputs/datePicker/index.js +2 -0
- package/dist/components/inputs/dateRangePicker/dateFormater.js +28 -0
- package/dist/components/inputs/dateRangePicker/dateRangePicker.js +118 -0
- package/dist/components/inputs/dateRangePicker/dateRangePickerTypes.js +1 -0
- package/dist/components/inputs/dateRangePicker/dateRangePickerUtils.js +67 -0
- package/dist/components/inputs/dateRangePicker/index.js +2 -0
- package/dist/components/inputs/formField/formField.js +35 -0
- package/dist/components/inputs/formField/passwordInput.js +22 -0
- package/dist/components/inputs/formField/textInput.js +79 -0
- package/dist/components/inputs/{index.d.ts → index.js} +1 -1
- package/dist/components/inputs/searcher/searcher.js +112 -0
- package/dist/components/inputs/selectField/selectField.js +183 -0
- package/dist/components/inputs/switchInput/index.js +2 -0
- package/dist/components/inputs/switchInput/switchInput.js +77 -0
- package/dist/components/loaders/index.js +2 -0
- package/dist/components/loaders/progressbar/progressbar.js +37 -0
- package/dist/components/loaders/spinner/spinner.js +15 -0
- package/dist/components/menuAction/index.js +1 -0
- package/dist/components/menuAction/menuAction.js +67 -0
- package/dist/components/menuAction/menuActionCustomStyles.js +13 -0
- package/dist/components/modals/index.js +1 -0
- package/dist/components/modals/warningModal/index.js +1 -0
- package/dist/components/modals/warningModal/warningModal.js +41 -0
- package/dist/components/patterns/actionBar/actionBar.js +38 -0
- package/dist/components/patterns/copyButton/copyButton.js +69 -0
- package/dist/components/patterns/copyButton/index.js +1 -0
- package/dist/components/patterns/emptyState/emptyState.js +17 -0
- package/dist/components/patterns/headerSection/headerSection.js +17 -0
- package/dist/components/patterns/headerSection/index.js +1 -0
- package/dist/components/patterns/iconWithIdentifier/iconWithIdentifier.js +12 -0
- package/dist/components/patterns/iconWithIdentifier/index.js +1 -0
- package/dist/components/patterns/{index.d.ts → index.js} +1 -1
- package/dist/components/patterns/linkWithIcon/index.js +1 -0
- package/dist/components/patterns/linkWithIcon/linkWithIcon.js +26 -0
- package/dist/components/tabs/index.js +1 -0
- package/dist/components/tabs/tabs.js +70 -0
- package/dist/components/tooltip/index.js +2 -0
- package/dist/components/tooltip/overflowChecker.js +27 -0
- package/dist/components/tooltip/tooltip.js +97 -0
- package/dist/hooks/useReduxFormField.js +34 -0
- package/dist/{index.d.ts → index.js} +1 -1
- package/dist/locales/description.js +15 -0
- package/dist/locales/es.js +227 -0
- package/dist/locales/index.js +2 -0
- package/dist/locales/translator.js +20 -0
- package/dist/producteca-ui-kit.cjs.js +3 -0
- package/dist/producteca-ui-kit.es.js +3 -53447
- package/dist/producteca-ui-kit.umd.js +9 -604
- package/dist/styles/colors.js +67 -0
- package/dist/styles/styles/colors.tsx +88 -0
- package/dist/styles/styles/global.module.scss +85 -0
- package/dist/styles/styles/theme.tsx +24 -0
- package/dist/styles/styles/variables.module.scss +74 -0
- package/dist/styles/theme.js +22 -0
- package/dist/validators/errorMessage.js +15 -0
- package/dist/validators/index.js +2 -0
- package/dist/validators/validation.js +25 -0
- package/package.json +42 -4
- package/dist/components/alert/alert.d.ts +0 -17
- package/dist/components/breadcrumb/breadcrumb.d.ts +0 -15
- package/dist/components/breadcrumb/index.d.ts +0 -2
- package/dist/components/button/button.d.ts +0 -17
- package/dist/components/chip/chip.d.ts +0 -13
- package/dist/components/chip/index.d.ts +0 -2
- package/dist/components/icons/customIcon/customIcon.d.ts +0 -16
- package/dist/components/icons/fileIcon/fileIcon.d.ts +0 -5
- package/dist/components/icons/mailIcon/mailIcon.d.ts +0 -5
- package/dist/components/icons/parameters.d.ts +0 -51
- package/dist/components/icons/priceCloseIcon/priceCloseIcon.d.ts +0 -5
- package/dist/components/icons/priceDownIcon/priceDownIcon.d.ts +0 -5
- package/dist/components/icons/searchPublication/searchPublication.d.ts +0 -5
- package/dist/components/image/image.d.ts +0 -11
- package/dist/components/image/index.d.ts +0 -1
- package/dist/components/inputs/checkboxInput/checkboxInput.d.ts +0 -9
- package/dist/components/inputs/checkboxInput/checkboxInputGroup.d.ts +0 -22
- package/dist/components/inputs/datePicker/datePicker.d.ts +0 -5
- package/dist/components/inputs/datePicker/datePickerCustomStyles.d.ts +0 -8
- package/dist/components/inputs/datePicker/datePickerTypes.d.ts +0 -14
- package/dist/components/inputs/datePicker/datePickerUtils.d.ts +0 -68
- package/dist/components/inputs/datePicker/index.d.ts +0 -3
- package/dist/components/inputs/dateRangePicker/dateFormater.d.ts +0 -7
- package/dist/components/inputs/dateRangePicker/dateRangePicker.d.ts +0 -5
- package/dist/components/inputs/dateRangePicker/dateRangePickerTypes.d.ts +0 -14
- package/dist/components/inputs/dateRangePicker/dateRangePickerUtils.d.ts +0 -9
- package/dist/components/inputs/dateRangePicker/index.d.ts +0 -4
- package/dist/components/inputs/formField/formField.d.ts +0 -10
- package/dist/components/inputs/formField/passwordInput.d.ts +0 -4
- package/dist/components/inputs/formField/textInput.d.ts +0 -25
- package/dist/components/inputs/searcher/searcher.d.ts +0 -28
- package/dist/components/inputs/selectField/selectField.d.ts +0 -42
- package/dist/components/inputs/switchInput/index.d.ts +0 -4
- package/dist/components/inputs/switchInput/switchInput.d.ts +0 -31
- package/dist/components/loaders/index.d.ts +0 -2
- package/dist/components/loaders/progressbar/progressbar.d.ts +0 -8
- package/dist/components/loaders/spinner/spinner.d.ts +0 -6
- package/dist/components/menuAction/index.d.ts +0 -1
- package/dist/components/menuAction/menuAction.d.ts +0 -18
- package/dist/components/menuAction/menuActionCustomStyles.d.ts +0 -4
- package/dist/components/modals/index.d.ts +0 -1
- package/dist/components/modals/warningModal/index.d.ts +0 -1
- package/dist/components/modals/warningModal/warningModal.d.ts +0 -17
- package/dist/components/patterns/actionBar/actionBar.d.ts +0 -26
- package/dist/components/patterns/copyButton/copyButton.d.ts +0 -11
- package/dist/components/patterns/copyButton/index.d.ts +0 -1
- package/dist/components/patterns/emptyState/emptyState.d.ts +0 -11
- package/dist/components/patterns/headerSection/headerSection.d.ts +0 -14
- package/dist/components/patterns/headerSection/index.d.ts +0 -1
- package/dist/components/patterns/iconWithIdentifier/iconWithIdentifier.d.ts +0 -11
- package/dist/components/patterns/iconWithIdentifier/index.d.ts +0 -1
- package/dist/components/patterns/linkWithIcon/index.d.ts +0 -1
- package/dist/components/patterns/linkWithIcon/linkWithIcon.d.ts +0 -14
- package/dist/components/tooltip/index.d.ts +0 -3
- package/dist/components/tooltip/overflowChecker.d.ts +0 -5
- package/dist/components/tooltip/tooltip.d.ts +0 -20
- package/dist/favicon.svg +0 -43
- package/dist/hooks/useReduxFormField.d.ts +0 -26
- package/dist/locales/description.d.ts +0 -15
- package/dist/locales/es.d.ts +0 -222
- package/dist/locales/index.d.ts +0 -2
- package/dist/locales/translator.d.ts +0 -3
- package/dist/style.css +0 -1
- package/dist/styles/colors.d.ts +0 -25
- package/dist/styles/theme.d.ts +0 -2
- package/dist/validators/errorMessage.d.ts +0 -5
- package/dist/validators/index.d.ts +0 -2
- package/dist/validators/validation.d.ts +0 -21
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import _ from 'lodash';
|
|
2
|
+
export var Colors = {
|
|
3
|
+
grey: {
|
|
4
|
+
'900': '#252525',
|
|
5
|
+
'800': '#404040',
|
|
6
|
+
'733': '#666666',
|
|
7
|
+
'700': '#797979',
|
|
8
|
+
'500': '#ACACAC',
|
|
9
|
+
'400': '#D7D7D7',
|
|
10
|
+
'200': '#EDEDED',
|
|
11
|
+
'100': '#F5F5F5',
|
|
12
|
+
'50': '#FAFAFA'
|
|
13
|
+
},
|
|
14
|
+
error: {
|
|
15
|
+
'900': '#9A1414',
|
|
16
|
+
'700': '#D90C0C',
|
|
17
|
+
'500': '#FF5A5A',
|
|
18
|
+
'300': '#FF8383',
|
|
19
|
+
'100': '#FFC8C8',
|
|
20
|
+
'50': '#FCECEB'
|
|
21
|
+
},
|
|
22
|
+
success: {
|
|
23
|
+
'900': '#136A19',
|
|
24
|
+
'700': '#21962A',
|
|
25
|
+
'500': '#1FB62A',
|
|
26
|
+
'300': '#43DC4E',
|
|
27
|
+
'100': '#85EA8D',
|
|
28
|
+
'50': '#CEF3D1'
|
|
29
|
+
},
|
|
30
|
+
secondary: {
|
|
31
|
+
'900': '#A86501',
|
|
32
|
+
'700': '#DC8400',
|
|
33
|
+
'500': '#FF9900',
|
|
34
|
+
'300': '#FFC56F',
|
|
35
|
+
'100': '#FFE1B4',
|
|
36
|
+
'50': '#FFF3D1'
|
|
37
|
+
},
|
|
38
|
+
primary: {
|
|
39
|
+
'900': '#0045AD',
|
|
40
|
+
'700': '#0058DB',
|
|
41
|
+
'500': '#0066FF',
|
|
42
|
+
'300': '#76ADFF',
|
|
43
|
+
'100': '#A7CAFF',
|
|
44
|
+
'50': '#E6F1FF'
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
export var getColor = function getColor(category, shade) {
|
|
48
|
+
var _a;
|
|
49
|
+
return ((_a = Colors[category]) === null || _a === void 0 ? void 0 : _a[shade]) || '';
|
|
50
|
+
};
|
|
51
|
+
export var allColors = _.flatMap(Colors, function (shades, category) {
|
|
52
|
+
return _.compact(_.map(shades, function (color, shade) {
|
|
53
|
+
return color ? { title: category + ' ' + shade, color: color } : null;
|
|
54
|
+
}));
|
|
55
|
+
});
|
|
56
|
+
export var ColorOptions = _.map(allColors, 'title');
|
|
57
|
+
export var ColorValues = _.map(allColors, 'color');
|
|
58
|
+
export var Shades = _.map(Colors['grey'], function (color, shade) {
|
|
59
|
+
return shade;
|
|
60
|
+
});
|
|
61
|
+
export var Categories = _.map(Colors, function (shades, category) {
|
|
62
|
+
return category;
|
|
63
|
+
});
|
|
64
|
+
export var isValidColor = function isValidColor(color) {
|
|
65
|
+
return _.includes(ColorValues, color);
|
|
66
|
+
};
|
|
67
|
+
export default Colors;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import _ from 'lodash'
|
|
2
|
+
|
|
3
|
+
export type ColorMap = {
|
|
4
|
+
[category: string]: {
|
|
5
|
+
'900'?: string
|
|
6
|
+
'800'?: string
|
|
7
|
+
'733'?: string
|
|
8
|
+
'700'?: string
|
|
9
|
+
'500'?: string
|
|
10
|
+
'400'?: string
|
|
11
|
+
'300'?: string
|
|
12
|
+
'200'?: string
|
|
13
|
+
'100'?: string
|
|
14
|
+
'50'?: string
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export type ColorShade = '900' | '800' | '733' | '700' | '500' | '400' | '300' | '200' | '100' | '50'
|
|
19
|
+
|
|
20
|
+
export const Colors: ColorMap = {
|
|
21
|
+
grey: {
|
|
22
|
+
'900': '#252525',
|
|
23
|
+
'800': '#404040',
|
|
24
|
+
'733': '#666666',
|
|
25
|
+
'700': '#797979',
|
|
26
|
+
'500': '#ACACAC',
|
|
27
|
+
'400': '#D7D7D7',
|
|
28
|
+
'200': '#EDEDED',
|
|
29
|
+
'100': '#F5F5F5',
|
|
30
|
+
'50': '#FAFAFA',
|
|
31
|
+
},
|
|
32
|
+
error: {
|
|
33
|
+
'900': '#9A1414',
|
|
34
|
+
'700': '#D90C0C',
|
|
35
|
+
'500': '#FF5A5A',
|
|
36
|
+
'300': '#FF8383',
|
|
37
|
+
'100': '#FFC8C8',
|
|
38
|
+
'50': '#FCECEB',
|
|
39
|
+
},
|
|
40
|
+
success: {
|
|
41
|
+
'900': '#136A19',
|
|
42
|
+
'700': '#21962A',
|
|
43
|
+
'500': '#1FB62A',
|
|
44
|
+
'300': '#43DC4E',
|
|
45
|
+
'100': '#85EA8D',
|
|
46
|
+
'50': '#CEF3D1',
|
|
47
|
+
},
|
|
48
|
+
secondary: {
|
|
49
|
+
'900': '#A86501',
|
|
50
|
+
'700': '#DC8400',
|
|
51
|
+
'500': '#FF9900',
|
|
52
|
+
'300': '#FFC56F',
|
|
53
|
+
'100': '#FFE1B4',
|
|
54
|
+
'50': '#FFF3D1',
|
|
55
|
+
},
|
|
56
|
+
primary: {
|
|
57
|
+
'900': '#0045AD',
|
|
58
|
+
'700': '#0058DB',
|
|
59
|
+
'500': '#0066FF',
|
|
60
|
+
'300': '#76ADFF',
|
|
61
|
+
'100': '#A7CAFF',
|
|
62
|
+
'50': '#E6F1FF',
|
|
63
|
+
},
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export type ColorCategory = keyof typeof Colors
|
|
67
|
+
|
|
68
|
+
export const getColor = (category: ColorCategory, shade: ColorShade): string => {
|
|
69
|
+
return Colors[category]?.[shade] || ''
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export const allColors = _.flatMap(Colors, (shades: ColorShade, category: ColorCategory) =>
|
|
73
|
+
_.compact(
|
|
74
|
+
_.map(shades, (color: string, shade: ColorShade) => (color ? { title: `${category} ${shade}`, color } : null)),
|
|
75
|
+
),
|
|
76
|
+
)
|
|
77
|
+
|
|
78
|
+
export const ColorOptions = _.map(allColors, 'title')
|
|
79
|
+
|
|
80
|
+
export const ColorValues = _.map(allColors, 'color')
|
|
81
|
+
|
|
82
|
+
export const Shades = _.map(Colors['grey'], (color, shade) => shade)
|
|
83
|
+
|
|
84
|
+
export const Categories = _.map(Colors, (shades, category) => category)
|
|
85
|
+
|
|
86
|
+
export const isValidColor = (color: string): boolean => _.includes(ColorValues, color)
|
|
87
|
+
|
|
88
|
+
export default Colors
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
@import 'variables.module';
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
body {
|
|
5
|
+
font-family: $poppins-font-family;
|
|
6
|
+
:global {
|
|
7
|
+
.producteca-select-field__menu-portal {
|
|
8
|
+
z-index: 9999;
|
|
9
|
+
.producteca-select-field__menu-list {
|
|
10
|
+
max-height: 192px;
|
|
11
|
+
display: flex;
|
|
12
|
+
flex-direction: column;
|
|
13
|
+
&.producteca-select-field__menu-list--is-multi {
|
|
14
|
+
.producteca-select-field__option {
|
|
15
|
+
display: flex;
|
|
16
|
+
align-items: center;
|
|
17
|
+
label {
|
|
18
|
+
margin-left: 8px;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
.producteca-select-field__option {
|
|
23
|
+
cursor: pointer;
|
|
24
|
+
height: 40px;
|
|
25
|
+
min-height: 40px;
|
|
26
|
+
margin: 0;
|
|
27
|
+
padding: 0 16px;
|
|
28
|
+
overflow: visible;
|
|
29
|
+
white-space: nowrap;
|
|
30
|
+
font-size: $body-regular;
|
|
31
|
+
font-weight: 400;
|
|
32
|
+
color: $text-primary;
|
|
33
|
+
line-height: 24px;
|
|
34
|
+
label {
|
|
35
|
+
font-size: $body-regular;
|
|
36
|
+
font-weight: 400;
|
|
37
|
+
color: $text-primary;
|
|
38
|
+
cursor: pointer;
|
|
39
|
+
white-space: nowrap;
|
|
40
|
+
overflow: hidden;
|
|
41
|
+
text-overflow: ellipsis;
|
|
42
|
+
margin-bottom: 0;
|
|
43
|
+
display: block;
|
|
44
|
+
padding: 9.5px 0;
|
|
45
|
+
line-height: 21px;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
.producteca-select-field__menu-notice {
|
|
49
|
+
font-size: $body-regular;
|
|
50
|
+
color: $text-primary;
|
|
51
|
+
padding: 0;
|
|
52
|
+
min-height: 40px;
|
|
53
|
+
display: flex;
|
|
54
|
+
align-items: center;
|
|
55
|
+
justify-content: center;
|
|
56
|
+
}
|
|
57
|
+
.producteca-select-field__option--is-selected {
|
|
58
|
+
background-color: white;
|
|
59
|
+
}
|
|
60
|
+
.producteca-select-field__option--is-focused {
|
|
61
|
+
background-color: $grey-200;
|
|
62
|
+
}
|
|
63
|
+
.producteca-select-field__option--is-disabled {
|
|
64
|
+
opacity: 0.5;
|
|
65
|
+
cursor: default;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
.producteca-select-field__menu {
|
|
69
|
+
margin: 0 0 0 1px;
|
|
70
|
+
max-height: 230px;
|
|
71
|
+
overflow-y: auto;
|
|
72
|
+
width: calc(100% - 2px);
|
|
73
|
+
border-top-right-radius: 0;
|
|
74
|
+
border-top-left-radius: 0;
|
|
75
|
+
z-index: 9999;
|
|
76
|
+
input[type="checkbox"] {
|
|
77
|
+
height: 20px;
|
|
78
|
+
min-width: 20px;
|
|
79
|
+
width: 20px;
|
|
80
|
+
margin: 0;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { createTheme } from '@mui/material/styles'
|
|
2
|
+
import { getColor } from './colors'
|
|
3
|
+
|
|
4
|
+
const theme = createTheme({
|
|
5
|
+
palette: {
|
|
6
|
+
primary: {
|
|
7
|
+
main: getColor('primary', '500'),
|
|
8
|
+
},
|
|
9
|
+
secondary: {
|
|
10
|
+
main: getColor('secondary', '500'),
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
components: {
|
|
14
|
+
MuiSvgIcon: {
|
|
15
|
+
styleOverrides: {
|
|
16
|
+
root: {
|
|
17
|
+
color: getColor('grey', '500'),
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
})
|
|
23
|
+
|
|
24
|
+
export default theme
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
$poppins-font-family: 'Poppins', 'Open Sans', Helvetica, Arial, sans-serif !important;
|
|
2
|
+
|
|
3
|
+
$font-size-base: 12px;
|
|
4
|
+
|
|
5
|
+
$display-large: 60px;
|
|
6
|
+
$display-medium: 46px;
|
|
7
|
+
$display-small: 36px;
|
|
8
|
+
|
|
9
|
+
$title-large: 30px;
|
|
10
|
+
$title-medium: 24px;
|
|
11
|
+
$title-small: 20px;
|
|
12
|
+
$title-xsmall: 16px;
|
|
13
|
+
|
|
14
|
+
$body-large: 16px;
|
|
15
|
+
$body-regular: 14px;
|
|
16
|
+
$body-small: 12px;
|
|
17
|
+
|
|
18
|
+
$font-size-h1: 41px;
|
|
19
|
+
$font-size-h2: 28px;
|
|
20
|
+
$font-size-h3: 22px;
|
|
21
|
+
$font-size-h4: 18px;
|
|
22
|
+
$font-size-h5: 13px;
|
|
23
|
+
$font-size-h6: 12px;
|
|
24
|
+
|
|
25
|
+
$grey-900: #252525;
|
|
26
|
+
$grey-800: #404040;
|
|
27
|
+
$grey-733: #666666;
|
|
28
|
+
$grey-700: #797979;
|
|
29
|
+
$grey-500: #ACACAC;
|
|
30
|
+
$grey-400: #D7D7D7;
|
|
31
|
+
$grey-200: #EDEDED;
|
|
32
|
+
$grey-100: #F5F5F5;
|
|
33
|
+
$grey-50: #FAFAFA;
|
|
34
|
+
|
|
35
|
+
$error-900: #9A1414;
|
|
36
|
+
$error-700: #D90C0C;
|
|
37
|
+
$error-500: #FF6565;
|
|
38
|
+
$error-300: #FF8383;
|
|
39
|
+
$error-100: #FFC8C8;
|
|
40
|
+
$error-50: #FCECEB;
|
|
41
|
+
|
|
42
|
+
$success-900: #136A19;
|
|
43
|
+
$success-700: #21962A;
|
|
44
|
+
$success-500: #1FB62A;
|
|
45
|
+
$success-300: #43DC4E;
|
|
46
|
+
$success-100: #85EA8D;
|
|
47
|
+
$success-50: #CEF3D1;
|
|
48
|
+
|
|
49
|
+
$secondary-900: #A86501;
|
|
50
|
+
$secondary-700: #DC8400;
|
|
51
|
+
$secondary-500: #FF9900;
|
|
52
|
+
$secondary-300: #FFC56F;
|
|
53
|
+
$secondary-100: #FFE1B4;
|
|
54
|
+
$secondary-50: #FFF3D1;
|
|
55
|
+
|
|
56
|
+
$primary-900: #0045AD;
|
|
57
|
+
$primary-700: #0058DB;
|
|
58
|
+
$primary-500: #0066FF;
|
|
59
|
+
$primary-300: #76ADFF;
|
|
60
|
+
$primary-100: #A7CAFF;
|
|
61
|
+
$primary-50: #E6F1FF;
|
|
62
|
+
|
|
63
|
+
$text-primary: $grey-900;
|
|
64
|
+
$text-secondary: $grey-700;
|
|
65
|
+
$text-link: $primary-500;
|
|
66
|
+
$text-disabled: $grey-500;
|
|
67
|
+
|
|
68
|
+
$radius-sm: 4px;
|
|
69
|
+
|
|
70
|
+
$border-disabled: $grey-400;
|
|
71
|
+
$border-default: $grey-400;
|
|
72
|
+
$border-hover: $grey-500;
|
|
73
|
+
$border-dark:$grey-700;
|
|
74
|
+
$border-focus: $grey-900;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { createTheme } from '@mui/material/styles';
|
|
2
|
+
import { getColor } from './colors';
|
|
3
|
+
var theme = createTheme({
|
|
4
|
+
palette: {
|
|
5
|
+
primary: {
|
|
6
|
+
main: getColor('primary', '500')
|
|
7
|
+
},
|
|
8
|
+
secondary: {
|
|
9
|
+
main: getColor('secondary', '500')
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
components: {
|
|
13
|
+
MuiSvgIcon: {
|
|
14
|
+
styleOverrides: {
|
|
15
|
+
root: {
|
|
16
|
+
color: getColor('grey', '500')
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
export default theme;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import styles from './errorMessage.module.scss';
|
|
3
|
+
import { hasError, hasWarning } from './index';
|
|
4
|
+
import clsx from 'clsx';
|
|
5
|
+
export var ErrorMessage = function ErrorMessage(_ref) {
|
|
6
|
+
var validationProps = _ref.validationProps;
|
|
7
|
+
var meta = validationProps.meta;
|
|
8
|
+
|
|
9
|
+
var _ref2 = meta || {},
|
|
10
|
+
error = _ref2.error,
|
|
11
|
+
warning = _ref2.warning;
|
|
12
|
+
|
|
13
|
+
var messageClass = clsx(styles['message'], hasError(validationProps) && styles['error'], hasWarning(validationProps) && styles['warning']);
|
|
14
|
+
return _jsxs("div", { className: messageClass, children: [hasError(validationProps) && (error === null || error === void 0 ? void 0 : error.locale), hasWarning(validationProps) && (warning === null || warning === void 0 ? void 0 : warning.locale)] });
|
|
15
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export var hasError = function hasError(props) {
|
|
2
|
+
var value = props.value,
|
|
3
|
+
isValid = props.isValid,
|
|
4
|
+
required = props.required,
|
|
5
|
+
_props$meta = props.meta;
|
|
6
|
+
_props$meta = _props$meta === undefined ? {} : _props$meta;
|
|
7
|
+
var touched = _props$meta.touched,
|
|
8
|
+
error = _props$meta.error;
|
|
9
|
+
|
|
10
|
+
var hasError = isValid && !isValid(value) || touched && error;
|
|
11
|
+
return !!(required && !value) || !!hasError;
|
|
12
|
+
};
|
|
13
|
+
export var hasWarning = function hasWarning(props) {
|
|
14
|
+
var _props$meta2 = props.meta;
|
|
15
|
+
_props$meta2 = _props$meta2 === undefined ? {} : _props$meta2;
|
|
16
|
+
var touched = _props$meta2.touched,
|
|
17
|
+
warning = _props$meta2.warning;
|
|
18
|
+
|
|
19
|
+
return !!touched && !!warning;
|
|
20
|
+
};
|
|
21
|
+
export var formValidation = function formValidation(props) {
|
|
22
|
+
if (hasWarning(props)) return 'warning';
|
|
23
|
+
if (hasError(props)) return 'error';
|
|
24
|
+
return null;
|
|
25
|
+
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@producteca/producteca-ui-kit",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"main": "./dist/producteca-ui-kit.
|
|
3
|
+
"version": "1.21.1-beta.0",
|
|
4
|
+
"main": "./dist/producteca-ui-kit.cjs.js",
|
|
5
|
+
"module": "./dist/producteca-ui-kit.es.js",
|
|
6
|
+
"unpkg": "./dist/producteca-ui-kit.umd.js",
|
|
7
|
+
"jsdelivr": "./dist/producteca-ui-kit.umd.js",
|
|
5
8
|
"types": "./dist/index.d.ts",
|
|
6
9
|
"repository": {
|
|
7
10
|
"type": "git",
|
|
@@ -19,6 +22,10 @@
|
|
|
19
22
|
"scripts": {
|
|
20
23
|
"dev": "storybook dev -p 6006",
|
|
21
24
|
"build": "rm -rf dist && tsc && vite build",
|
|
25
|
+
"build:babel": "rm -rf dist && tsc -p tsconfig.babel.json && babel temp-ts --out-dir dist --extensions .js,.jsx --ignore '**/*.stories.*','**/*.test.*' && rm -rf temp-ts",
|
|
26
|
+
"build:babel:full": "rm -rf dist && tsc -p tsconfig.babel.json && babel temp-ts --out-dir dist --extensions .js,.jsx --ignore '**/*.stories.*','**/*.test.*' && tsc --declaration --emitDeclarationOnly --outDir dist && rm -rf temp-ts",
|
|
27
|
+
"build:legacy": "node scripts/build-legacy.js",
|
|
28
|
+
"build:es:babel": "node scripts/build-legacy.js",
|
|
22
29
|
"build:storybook": "storybook build",
|
|
23
30
|
"deploy": "make deploy",
|
|
24
31
|
"lint": "node linterteca-lint",
|
|
@@ -32,6 +39,19 @@
|
|
|
32
39
|
"files": [
|
|
33
40
|
"dist"
|
|
34
41
|
],
|
|
42
|
+
"sideEffects": [
|
|
43
|
+
"**/*.css",
|
|
44
|
+
"**/*.scss"
|
|
45
|
+
],
|
|
46
|
+
"exports": {
|
|
47
|
+
".": {
|
|
48
|
+
"types": "./dist/index.d.ts",
|
|
49
|
+
"import": "./dist/producteca-ui-kit.es.js",
|
|
50
|
+
"require": "./dist/producteca-ui-kit.cjs.js",
|
|
51
|
+
"default": "./dist/producteca-ui-kit.es.js"
|
|
52
|
+
},
|
|
53
|
+
"./style.css": "./dist/style.css"
|
|
54
|
+
},
|
|
35
55
|
"lint-staged": {
|
|
36
56
|
"*.{js,jsx}": [
|
|
37
57
|
"linterteca-lint"
|
|
@@ -59,7 +79,6 @@
|
|
|
59
79
|
"react": "^18.2.0",
|
|
60
80
|
"react-dom": "^18.2.0",
|
|
61
81
|
"react-select": "^5.8.3",
|
|
62
|
-
"sass": "^1.77.4",
|
|
63
82
|
"typescript": "^5.2.2",
|
|
64
83
|
"vite": "^5.2.0",
|
|
65
84
|
"vite-plugin-css-modules": "^0.0.1",
|
|
@@ -68,8 +87,23 @@
|
|
|
68
87
|
},
|
|
69
88
|
"devDependencies": {
|
|
70
89
|
"@producteca/linterteca": "^1.3.2",
|
|
90
|
+
"@rollup/plugin-babel": "^6.0.4",
|
|
91
|
+
"@rollup/plugin-commonjs": "^28.0.6",
|
|
92
|
+
"@rollup/plugin-node-resolve": "^16.0.1",
|
|
93
|
+
"@rollup/plugin-typescript": "^12.1.4",
|
|
71
94
|
"@storybook/addon-a11y": "^9.1.2",
|
|
95
|
+
"@storybook/addon-docs": "^9.1.2",
|
|
72
96
|
"autoprefixer": "^10.4.19",
|
|
97
|
+
"babel-cli": "^6.26.0",
|
|
98
|
+
"babel-core": "^6.26.3",
|
|
99
|
+
"babel-plugin-transform-class-properties": "^6.24.1",
|
|
100
|
+
"babel-plugin-transform-decorators-legacy": "^1.3.5",
|
|
101
|
+
"babel-plugin-transform-object-rest-spread": "^6.26.0",
|
|
102
|
+
"babel-plugin-transform-runtime": "^6.23.0",
|
|
103
|
+
"babel-preset-env": "^1.7.0",
|
|
104
|
+
"babel-preset-react": "^6.24.1",
|
|
105
|
+
"babel-preset-stage-0": "^6.24.1",
|
|
106
|
+
"babel-runtime": "^6.26.0",
|
|
73
107
|
"chromatic": "^11.3.0",
|
|
74
108
|
"clsx": "^2.1.1",
|
|
75
109
|
"eslint": "^8.57.0",
|
|
@@ -82,10 +116,14 @@
|
|
|
82
116
|
"prettier": "3.0.1",
|
|
83
117
|
"prop-types": "15.8.1",
|
|
84
118
|
"react-i18next": "^14.1.2",
|
|
119
|
+
"rollup": "^4.50.1",
|
|
120
|
+
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
121
|
+
"rollup-plugin-scss": "^4.0.1",
|
|
122
|
+
"sass": "^1.92.1",
|
|
85
123
|
"storybook": "^9.1.2",
|
|
86
124
|
"storybook-i18n": "^3.0.1",
|
|
87
125
|
"storybook-react-i18next": "^3.1.1",
|
|
88
|
-
"
|
|
126
|
+
"vite-plugin-babel": "^1.3.2"
|
|
89
127
|
},
|
|
90
128
|
"peerDependencies": {
|
|
91
129
|
"@emotion/react": "^11.14.0",
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
|
-
|
|
3
|
-
interface AlertProps {
|
|
4
|
-
message: string;
|
|
5
|
-
variant?: 'success' | 'error' | 'warning' | 'info';
|
|
6
|
-
className?: string;
|
|
7
|
-
icon?: React.ReactNode;
|
|
8
|
-
fullWidth?: boolean;
|
|
9
|
-
link?: {
|
|
10
|
-
text: string;
|
|
11
|
-
href?: string;
|
|
12
|
-
onClick?: (e: React.MouseEvent<HTMLAnchorElement>) => void;
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
export declare const Alert: ({ message, variant, className, icon, fullWidth, link, ...props }: AlertProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
-
export type { AlertProps };
|
|
17
|
-
export default Alert;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
|
-
|
|
3
|
-
interface BreadcrumbItem {
|
|
4
|
-
text: string;
|
|
5
|
-
href?: string;
|
|
6
|
-
onClick?: () => void;
|
|
7
|
-
isActive?: boolean;
|
|
8
|
-
}
|
|
9
|
-
interface BreadcrumbProps {
|
|
10
|
-
items: BreadcrumbItem[];
|
|
11
|
-
className?: string;
|
|
12
|
-
}
|
|
13
|
-
export declare const Breadcrumb: React.FC<BreadcrumbProps>;
|
|
14
|
-
export type { BreadcrumbProps, BreadcrumbItem };
|
|
15
|
-
export default Breadcrumb;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
|
-
|
|
3
|
-
interface ButtonProps {
|
|
4
|
-
label: string;
|
|
5
|
-
outline?: boolean;
|
|
6
|
-
size?: 'sm' | 'md' | 'lg';
|
|
7
|
-
type?: 'submit' | 'button' | 'reset';
|
|
8
|
-
variant?: 'primary' | 'secondary' | 'success' | 'error' | 'link' | 'tooltip-link';
|
|
9
|
-
disabled?: boolean;
|
|
10
|
-
className?: string;
|
|
11
|
-
onClick?: () => void;
|
|
12
|
-
leftAdornment?: React.ReactNode;
|
|
13
|
-
rightAdornment?: React.ReactNode;
|
|
14
|
-
}
|
|
15
|
-
export declare const Button: ({ type, variant, size, label, outline, leftAdornment, rightAdornment, className, ...props }: ButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
-
export type { ButtonProps };
|
|
17
|
-
export default Button;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
type ChipVariant = 'primary' | 'success' | 'error' | 'secondary' | 'grey';
|
|
2
|
-
type ChipSize = 'sm' | 'lg';
|
|
3
|
-
export interface ChipProps {
|
|
4
|
-
text?: string;
|
|
5
|
-
title?: string;
|
|
6
|
-
onRemove?: () => void;
|
|
7
|
-
disabled?: boolean;
|
|
8
|
-
variant?: ChipVariant;
|
|
9
|
-
size?: ChipSize;
|
|
10
|
-
isActive?: boolean;
|
|
11
|
-
}
|
|
12
|
-
export declare const Chip: ({ isActive, title, text, onRemove, disabled, variant, size }: ChipProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
-
export default Chip;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { default as React, ReactElement } from 'react';
|
|
2
|
-
import { SvgIcon, SxProps, Theme } from '@mui/material';
|
|
3
|
-
|
|
4
|
-
export type iconSize = '32' | '24' | '20' | '16' | '12' | '8';
|
|
5
|
-
type BaseSvgIconProps = React.ComponentProps<typeof SvgIcon>;
|
|
6
|
-
interface CustomIconProps extends Omit<BaseSvgIconProps, 'color'> {
|
|
7
|
-
color?: string;
|
|
8
|
-
size?: iconSize;
|
|
9
|
-
sx?: SxProps<Theme>;
|
|
10
|
-
children: ReactElement;
|
|
11
|
-
disabled?: boolean;
|
|
12
|
-
onClick?: () => void;
|
|
13
|
-
className?: string;
|
|
14
|
-
}
|
|
15
|
-
export declare const CustomIcon: React.FC<CustomIconProps>;
|
|
16
|
-
export default CustomIcon;
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
export interface IconInterface {
|
|
2
|
-
size?: number;
|
|
3
|
-
color?: string;
|
|
4
|
-
}
|
|
5
|
-
export declare const argTypes: {
|
|
6
|
-
color: {
|
|
7
|
-
control: {
|
|
8
|
-
type: string;
|
|
9
|
-
presetColors: boolean[];
|
|
10
|
-
};
|
|
11
|
-
description: string;
|
|
12
|
-
};
|
|
13
|
-
size: {
|
|
14
|
-
control: {
|
|
15
|
-
type: string;
|
|
16
|
-
};
|
|
17
|
-
description: string;
|
|
18
|
-
};
|
|
19
|
-
};
|
|
20
|
-
export declare const parameters: {
|
|
21
|
-
layout: string;
|
|
22
|
-
design: {
|
|
23
|
-
type: string;
|
|
24
|
-
url: string;
|
|
25
|
-
};
|
|
26
|
-
};
|
|
27
|
-
export declare const defaultParameters: {
|
|
28
|
-
parameters: {
|
|
29
|
-
layout: string;
|
|
30
|
-
design: {
|
|
31
|
-
type: string;
|
|
32
|
-
url: string;
|
|
33
|
-
};
|
|
34
|
-
};
|
|
35
|
-
argTypes: {
|
|
36
|
-
color: {
|
|
37
|
-
control: {
|
|
38
|
-
type: string;
|
|
39
|
-
presetColors: boolean[];
|
|
40
|
-
};
|
|
41
|
-
description: string;
|
|
42
|
-
};
|
|
43
|
-
size: {
|
|
44
|
-
control: {
|
|
45
|
-
type: string;
|
|
46
|
-
};
|
|
47
|
-
description: string;
|
|
48
|
-
};
|
|
49
|
-
};
|
|
50
|
-
};
|
|
51
|
-
export default defaultParameters;
|