@producteca/producteca-ui-kit 1.21.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.
Files changed (152) hide show
  1. package/dist/components/alert/alert.js +37 -0
  2. package/dist/components/breadcrumb/breadcrumb.js +33 -0
  3. package/dist/components/breadcrumb/index.js +2 -0
  4. package/dist/components/button/button.js +34 -0
  5. package/dist/components/chip/chip.js +27 -0
  6. package/dist/components/chip/index.js +1 -0
  7. package/dist/components/icons/customIcon/customIcon.js +41 -0
  8. package/dist/components/icons/fileIcon/fileIcon.js +14 -0
  9. package/dist/components/icons/{index.d.ts → index.js} +1 -1
  10. package/dist/components/icons/mailIcon/mailIcon.js +14 -0
  11. package/dist/components/icons/parameters.js +26 -0
  12. package/dist/components/icons/priceCloseIcon/priceCloseIcon.js +14 -0
  13. package/dist/components/icons/priceDownIcon/priceDownIcon.js +14 -0
  14. package/dist/components/icons/searchPublication/searchPublication.js +14 -0
  15. package/dist/components/image/image.js +26 -0
  16. package/dist/components/image/index.js +1 -0
  17. package/dist/components/{index.d.ts → index.js} +1 -1
  18. package/dist/components/inputs/checkboxInput/checkboxInput.js +35 -0
  19. package/dist/components/inputs/checkboxInput/checkboxInputGroup.js +58 -0
  20. package/dist/components/inputs/checkboxInput/{index.d.ts → index.js} +1 -2
  21. package/dist/components/inputs/datePicker/datePicker.js +143 -0
  22. package/dist/components/inputs/datePicker/datePickerCustomStyles.js +145 -0
  23. package/dist/components/inputs/datePicker/datePickerTypes.js +1 -0
  24. package/dist/components/inputs/datePicker/datePickerUtils.js +109 -0
  25. package/dist/components/inputs/datePicker/index.js +2 -0
  26. package/dist/components/inputs/dateRangePicker/dateFormater.js +28 -0
  27. package/dist/components/inputs/dateRangePicker/dateRangePicker.js +118 -0
  28. package/dist/components/inputs/dateRangePicker/dateRangePickerTypes.js +1 -0
  29. package/dist/components/inputs/dateRangePicker/dateRangePickerUtils.js +67 -0
  30. package/dist/components/inputs/dateRangePicker/index.js +2 -0
  31. package/dist/components/inputs/formField/formField.js +35 -0
  32. package/dist/components/inputs/formField/passwordInput.js +22 -0
  33. package/dist/components/inputs/formField/textInput.js +79 -0
  34. package/dist/components/inputs/{index.d.ts → index.js} +1 -1
  35. package/dist/components/inputs/searcher/searcher.js +112 -0
  36. package/dist/components/inputs/selectField/selectField.js +183 -0
  37. package/dist/components/inputs/switchInput/index.js +2 -0
  38. package/dist/components/inputs/switchInput/switchInput.js +77 -0
  39. package/dist/components/loaders/index.js +2 -0
  40. package/dist/components/loaders/progressbar/progressbar.js +37 -0
  41. package/dist/components/loaders/spinner/spinner.js +15 -0
  42. package/dist/components/menuAction/index.js +1 -0
  43. package/dist/components/menuAction/menuAction.js +67 -0
  44. package/dist/components/menuAction/menuActionCustomStyles.js +13 -0
  45. package/dist/components/modals/index.js +1 -0
  46. package/dist/components/modals/warningModal/index.js +1 -0
  47. package/dist/components/modals/warningModal/warningModal.js +41 -0
  48. package/dist/components/patterns/actionBar/actionBar.js +38 -0
  49. package/dist/components/patterns/copyButton/copyButton.js +69 -0
  50. package/dist/components/patterns/copyButton/index.js +1 -0
  51. package/dist/components/patterns/emptyState/emptyState.js +17 -0
  52. package/dist/components/patterns/headerSection/headerSection.js +17 -0
  53. package/dist/components/patterns/headerSection/index.js +1 -0
  54. package/dist/components/patterns/iconWithIdentifier/iconWithIdentifier.js +12 -0
  55. package/dist/components/patterns/iconWithIdentifier/index.js +1 -0
  56. package/dist/components/patterns/{index.d.ts → index.js} +1 -1
  57. package/dist/components/patterns/linkWithIcon/index.js +1 -0
  58. package/dist/components/patterns/linkWithIcon/linkWithIcon.js +26 -0
  59. package/dist/components/tabs/index.js +1 -0
  60. package/dist/components/tabs/tabs.js +70 -0
  61. package/dist/components/tooltip/index.js +2 -0
  62. package/dist/components/tooltip/overflowChecker.js +27 -0
  63. package/dist/components/tooltip/tooltip.js +97 -0
  64. package/dist/hooks/useReduxFormField.js +34 -0
  65. package/dist/{index.d.ts → index.js} +1 -1
  66. package/dist/locales/description.js +15 -0
  67. package/dist/locales/es.js +227 -0
  68. package/dist/locales/index.js +2 -0
  69. package/dist/locales/translator.js +20 -0
  70. package/dist/producteca-ui-kit.cjs.js +3 -0
  71. package/dist/producteca-ui-kit.es.js +3 -53518
  72. package/dist/producteca-ui-kit.umd.js +9 -604
  73. package/dist/styles/colors.js +67 -0
  74. package/dist/styles/styles/colors.tsx +88 -0
  75. package/dist/styles/styles/global.module.scss +85 -0
  76. package/dist/styles/styles/theme.tsx +24 -0
  77. package/dist/styles/styles/variables.module.scss +74 -0
  78. package/dist/styles/theme.js +22 -0
  79. package/dist/validators/errorMessage.js +15 -0
  80. package/dist/validators/index.js +2 -0
  81. package/dist/validators/validation.js +25 -0
  82. package/package.json +42 -4
  83. package/dist/components/alert/alert.d.ts +0 -17
  84. package/dist/components/breadcrumb/breadcrumb.d.ts +0 -15
  85. package/dist/components/breadcrumb/index.d.ts +0 -2
  86. package/dist/components/button/button.d.ts +0 -17
  87. package/dist/components/chip/chip.d.ts +0 -13
  88. package/dist/components/chip/index.d.ts +0 -2
  89. package/dist/components/icons/customIcon/customIcon.d.ts +0 -16
  90. package/dist/components/icons/fileIcon/fileIcon.d.ts +0 -5
  91. package/dist/components/icons/mailIcon/mailIcon.d.ts +0 -5
  92. package/dist/components/icons/parameters.d.ts +0 -51
  93. package/dist/components/icons/priceCloseIcon/priceCloseIcon.d.ts +0 -5
  94. package/dist/components/icons/priceDownIcon/priceDownIcon.d.ts +0 -5
  95. package/dist/components/icons/searchPublication/searchPublication.d.ts +0 -5
  96. package/dist/components/image/image.d.ts +0 -11
  97. package/dist/components/image/index.d.ts +0 -1
  98. package/dist/components/inputs/checkboxInput/checkboxInput.d.ts +0 -9
  99. package/dist/components/inputs/checkboxInput/checkboxInputGroup.d.ts +0 -22
  100. package/dist/components/inputs/datePicker/datePicker.d.ts +0 -5
  101. package/dist/components/inputs/datePicker/datePickerCustomStyles.d.ts +0 -8
  102. package/dist/components/inputs/datePicker/datePickerTypes.d.ts +0 -14
  103. package/dist/components/inputs/datePicker/datePickerUtils.d.ts +0 -68
  104. package/dist/components/inputs/datePicker/index.d.ts +0 -3
  105. package/dist/components/inputs/dateRangePicker/dateFormater.d.ts +0 -7
  106. package/dist/components/inputs/dateRangePicker/dateRangePicker.d.ts +0 -5
  107. package/dist/components/inputs/dateRangePicker/dateRangePickerTypes.d.ts +0 -14
  108. package/dist/components/inputs/dateRangePicker/dateRangePickerUtils.d.ts +0 -9
  109. package/dist/components/inputs/dateRangePicker/index.d.ts +0 -4
  110. package/dist/components/inputs/formField/formField.d.ts +0 -10
  111. package/dist/components/inputs/formField/passwordInput.d.ts +0 -4
  112. package/dist/components/inputs/formField/textInput.d.ts +0 -25
  113. package/dist/components/inputs/searcher/searcher.d.ts +0 -28
  114. package/dist/components/inputs/selectField/selectField.d.ts +0 -42
  115. package/dist/components/inputs/switchInput/index.d.ts +0 -4
  116. package/dist/components/inputs/switchInput/switchInput.d.ts +0 -31
  117. package/dist/components/loaders/index.d.ts +0 -2
  118. package/dist/components/loaders/progressbar/progressbar.d.ts +0 -8
  119. package/dist/components/loaders/spinner/spinner.d.ts +0 -6
  120. package/dist/components/menuAction/index.d.ts +0 -1
  121. package/dist/components/menuAction/menuAction.d.ts +0 -18
  122. package/dist/components/menuAction/menuActionCustomStyles.d.ts +0 -4
  123. package/dist/components/modals/index.d.ts +0 -1
  124. package/dist/components/modals/warningModal/index.d.ts +0 -1
  125. package/dist/components/modals/warningModal/warningModal.d.ts +0 -17
  126. package/dist/components/patterns/actionBar/actionBar.d.ts +0 -26
  127. package/dist/components/patterns/copyButton/copyButton.d.ts +0 -11
  128. package/dist/components/patterns/copyButton/index.d.ts +0 -1
  129. package/dist/components/patterns/emptyState/emptyState.d.ts +0 -11
  130. package/dist/components/patterns/headerSection/headerSection.d.ts +0 -14
  131. package/dist/components/patterns/headerSection/index.d.ts +0 -1
  132. package/dist/components/patterns/iconWithIdentifier/iconWithIdentifier.d.ts +0 -11
  133. package/dist/components/patterns/iconWithIdentifier/index.d.ts +0 -1
  134. package/dist/components/patterns/linkWithIcon/index.d.ts +0 -1
  135. package/dist/components/patterns/linkWithIcon/linkWithIcon.d.ts +0 -14
  136. package/dist/components/tabs/index.d.ts +0 -2
  137. package/dist/components/tabs/tabs.d.ts +0 -17
  138. package/dist/components/tooltip/index.d.ts +0 -3
  139. package/dist/components/tooltip/overflowChecker.d.ts +0 -5
  140. package/dist/components/tooltip/tooltip.d.ts +0 -20
  141. package/dist/favicon.svg +0 -43
  142. package/dist/hooks/useReduxFormField.d.ts +0 -26
  143. package/dist/locales/description.d.ts +0 -15
  144. package/dist/locales/es.d.ts +0 -227
  145. package/dist/locales/index.d.ts +0 -2
  146. package/dist/locales/translator.d.ts +0 -3
  147. package/dist/style.css +0 -1
  148. package/dist/styles/colors.d.ts +0 -25
  149. package/dist/styles/theme.d.ts +0 -2
  150. package/dist/validators/errorMessage.d.ts +0 -5
  151. package/dist/validators/index.d.ts +0 -2
  152. 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,2 @@
1
+ export * from './validation';
2
+ export { ErrorMessage } from './errorMessage';
@@ -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.21.0",
4
- "main": "./dist/producteca-ui-kit.umd.js",
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
- "@storybook/addon-docs": "^9.1.2"
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,2 +0,0 @@
1
- export { Breadcrumb, type BreadcrumbProps, type BreadcrumbItem } from './breadcrumb';
2
- export { Breadcrumb as default } from './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' | 'tab';
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,2 +0,0 @@
1
- export { Chip } from './chip';
2
- export type { ChipProps } from './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,5 +0,0 @@
1
- import { IconInterface } from '../parameters';
2
-
3
- export declare const FileIcon: ({ size, color }: IconInterface) => import("react/jsx-runtime").JSX.Element;
4
- export type { IconInterface };
5
- export default FileIcon;
@@ -1,5 +0,0 @@
1
- import { IconInterface } from '../parameters';
2
-
3
- export declare const MailIcon: ({ size, color }: IconInterface) => import("react/jsx-runtime").JSX.Element;
4
- export type { IconInterface };
5
- export default MailIcon;
@@ -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;
@@ -1,5 +0,0 @@
1
- import { IconInterface } from '../parameters';
2
-
3
- export declare const PriceCloseIcon: ({ size, color }: IconInterface) => import("react/jsx-runtime").JSX.Element;
4
- export type { IconInterface };
5
- export default PriceCloseIcon;
@@ -1,5 +0,0 @@
1
- import { IconInterface } from '../parameters';
2
-
3
- export declare const PriceDownIcon: ({ size, color }: IconInterface) => import("react/jsx-runtime").JSX.Element;
4
- export type { IconInterface };
5
- export default PriceDownIcon;
@@ -1,5 +0,0 @@
1
- import { IconInterface } from '../parameters';
2
-
3
- export declare const SearchPublication: ({ size, color }: IconInterface) => import("react/jsx-runtime").JSX.Element;
4
- export type { IconInterface };
5
- export default SearchPublication;