norma-library 0.4.1 → 0.4.3

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 (138) hide show
  1. package/dist/components/button/button.d.ts +3 -0
  2. package/dist/components/button/index.d.ts +1 -0
  3. package/dist/components/{Button → button}/types.d.ts +18 -18
  4. package/dist/components/card/card-header.d.ts +3 -0
  5. package/dist/components/card/card.d.ts +3 -0
  6. package/dist/components/card/index.d.ts +1 -0
  7. package/dist/components/card/styles.d.ts +811 -0
  8. package/dist/components/{Card → card}/types.d.ts +12 -12
  9. package/dist/components/checkbox/checkbox.d.ts +3 -0
  10. package/dist/components/checkbox/index.d.ts +1 -0
  11. package/dist/components/{Checkbox → checkbox}/types.d.ts +23 -23
  12. package/dist/components/icon/default.d.ts +210 -0
  13. package/dist/components/icon/defaultIcon.d.ts +5 -0
  14. package/dist/components/icon/icons-ia.d.ts +71 -0
  15. package/dist/components/icon/index.d.ts +234 -0
  16. package/dist/components/icon/norma.d.ts +30 -0
  17. package/dist/components/{Icon/NormaIcon.d.ts → icon/normaIcon.d.ts} +13 -13
  18. package/dist/components/icon/styles.d.ts +481 -0
  19. package/dist/components/{Icon → icon}/svg.d.ts +6 -6
  20. package/dist/components/{Icon → icon}/types.d.ts +12 -12
  21. package/dist/components/index.d.ts +8 -19
  22. package/dist/components/modal/index.d.ts +1 -0
  23. package/dist/components/{Modal/Modal.d.ts → modal/modal.d.ts} +3 -4
  24. package/dist/components/modal/modalFooter.d.ts +3 -0
  25. package/dist/components/modal/modalHeader.d.ts +3 -0
  26. package/dist/components/modal/styles.d.ts +540 -0
  27. package/dist/components/{Modal → modal}/types.d.ts +27 -24
  28. package/dist/components/progress-bar/index.d.ts +1 -0
  29. package/dist/components/{ProgressBar/ProgressBar.d.ts → progress-bar/progress-bar.d.ts} +7 -8
  30. package/dist/components/progress-bar/styles.d.ts +272 -0
  31. package/dist/components/{ProgressBar → progress-bar}/types.d.ts +22 -22
  32. package/dist/components/radio/index.d.ts +1 -0
  33. package/dist/components/radio/radio.d.ts +3 -0
  34. package/dist/components/{Radio → radio}/types.d.ts +16 -16
  35. package/dist/components/tag/index.d.ts +1 -0
  36. package/dist/components/{Tag/Tag.d.ts → tag/tag.d.ts} +3 -4
  37. package/dist/components/{Tag → tag}/types.d.ts +25 -25
  38. package/dist/components/textfield/index.d.ts +1 -0
  39. package/dist/components/textfield/textfield.d.ts +3 -0
  40. package/dist/components/{TextField → textfield}/types.d.ts +42 -42
  41. package/dist/helpers/clients.d.ts +5 -0
  42. package/dist/helpers/colors.d.ts +174 -0
  43. package/dist/helpers/index.d.ts +3 -0
  44. package/dist/helpers/sizes.d.ts +6 -0
  45. package/dist/helpers/variants.d.ts +2 -0
  46. package/dist/index.d.ts +1 -1
  47. package/dist/index.js +8 -0
  48. package/dist/norma-library.cjs.development.js +1286 -0
  49. package/dist/norma-library.cjs.development.js.map +1 -0
  50. package/dist/norma-library.cjs.production.min.js +2 -0
  51. package/dist/norma-library.cjs.production.min.js.map +1 -0
  52. package/dist/norma-library.esm.js +1274 -0
  53. package/dist/norma-library.esm.js.map +1 -0
  54. package/package.json +55 -86
  55. package/src/components/button/button.stories.tsx +44 -0
  56. package/src/components/button/button.tsx +18 -0
  57. package/src/components/button/index.ts +1 -0
  58. package/src/components/button/types.ts +48 -0
  59. package/src/components/card/card-header.tsx +8 -0
  60. package/src/components/card/card.stories.tsx +28 -0
  61. package/src/components/card/card.tsx +13 -0
  62. package/src/components/card/index.ts +1 -0
  63. package/src/components/card/styles.tsx +29 -0
  64. package/src/components/card/types.ts +14 -0
  65. package/src/components/checkbox/checkbox.stories.tsx +66 -0
  66. package/src/components/checkbox/checkbox.tsx +13 -0
  67. package/src/components/checkbox/index.ts +1 -0
  68. package/src/components/checkbox/types.ts +30 -0
  69. package/src/components/icon/default.tsx +1459 -0
  70. package/src/components/icon/defaultIcon.tsx +82 -0
  71. package/src/components/icon/icon.stories.tsx +44 -0
  72. package/src/components/icon/icons-ia.tsx +107 -0
  73. package/src/components/icon/index.ts +11 -0
  74. package/src/components/icon/norma.tsx +523 -0
  75. package/src/components/icon/normaIcon.tsx +94 -0
  76. package/src/components/icon/styles.ts +11 -0
  77. package/src/components/icon/svg.tsx +24 -0
  78. package/src/components/icon/types.ts +14 -0
  79. package/src/components/index.ts +8 -0
  80. package/src/components/modal/index.ts +1 -0
  81. package/src/components/modal/modal.stories.tsx +55 -0
  82. package/src/components/modal/modal.tsx +42 -0
  83. package/src/components/modal/modalFooter.tsx +32 -0
  84. package/src/components/modal/modalHeader.tsx +46 -0
  85. package/src/components/modal/styles.tsx +13 -0
  86. package/src/components/modal/types.ts +47 -0
  87. package/src/components/progress-bar/index.ts +1 -0
  88. package/src/components/progress-bar/progress-bar.stories.tsx +68 -0
  89. package/src/components/progress-bar/progress-bar.tsx +38 -0
  90. package/src/components/progress-bar/styles.tsx +27 -0
  91. package/src/components/progress-bar/types.ts +35 -0
  92. package/src/components/radio/index.ts +1 -0
  93. package/src/components/radio/radio.stories.tsx +150 -0
  94. package/src/components/radio/radio.tsx +13 -0
  95. package/src/components/radio/types.ts +27 -0
  96. package/src/components/tag/index.ts +1 -0
  97. package/src/components/tag/tag.stories.tsx +80 -0
  98. package/src/components/tag/tag.tsx +13 -0
  99. package/src/components/tag/types.ts +47 -0
  100. package/src/components/textfield/index.ts +1 -0
  101. package/src/components/textfield/textfield.stories.tsx +376 -0
  102. package/src/components/textfield/textfield.tsx +23 -0
  103. package/src/components/textfield/types.ts +93 -0
  104. package/src/helpers/clients.ts +6 -0
  105. package/src/helpers/colors.ts +209 -0
  106. package/src/helpers/index.ts +3 -0
  107. package/src/helpers/sizes.ts +26 -0
  108. package/src/helpers/variants.ts +3 -0
  109. package/src/index.tsx +1 -0
  110. package/dist/components/Button/Button.d.ts +0 -4
  111. package/dist/components/Button/index.d.ts +0 -2
  112. package/dist/components/Card/Card.d.ts +0 -4
  113. package/dist/components/Card/CardHeader.d.ts +0 -4
  114. package/dist/components/Card/index.d.ts +0 -4
  115. package/dist/components/Card/styles.d.ts +0 -818
  116. package/dist/components/Checkbox/Checkbox.d.ts +0 -4
  117. package/dist/components/Checkbox/index.d.ts +0 -2
  118. package/dist/components/Icon/DefaultIcon.d.ts +0 -5
  119. package/dist/components/Icon/default.d.ts +0 -209
  120. package/dist/components/Icon/index.d.ts +0 -233
  121. package/dist/components/Icon/norma.d.ts +0 -29
  122. package/dist/components/Icon/styles.d.ts +0 -485
  123. package/dist/components/Modal/ModalFooter.d.ts +0 -4
  124. package/dist/components/Modal/ModalHeader.d.ts +0 -4
  125. package/dist/components/Modal/index.d.ts +0 -2
  126. package/dist/components/Modal/styles.d.ts +0 -274
  127. package/dist/components/ProgressBar/index.d.ts +0 -2
  128. package/dist/components/ProgressBar/styles.d.ts +0 -276
  129. package/dist/components/Radio/Radio.d.ts +0 -4
  130. package/dist/components/Radio/index.d.ts +0 -2
  131. package/dist/components/Tag/index.d.ts +0 -2
  132. package/dist/components/TextField/TextField.d.ts +0 -4
  133. package/dist/components/TextField/index.d.ts +0 -2
  134. package/dist/index.es.js +0 -15023
  135. package/dist/index.es.js.map +0 -1
  136. package/dist/index.umd.js +0 -419
  137. package/dist/index.umd.js.map +0 -1
  138. package/dist/vite.svg +0 -1
@@ -0,0 +1,209 @@
1
+ import { createTheme } from '@mui/material/styles';
2
+
3
+ export type IconsColors =
4
+ | 'inherit'
5
+ | 'primary'
6
+ | 'secondary'
7
+ | 'error'
8
+ | 'info'
9
+ | 'success'
10
+ | 'warning'
11
+ | 'white'
12
+ | 'black';
13
+
14
+ export type BtnColors =
15
+ | 'inherit'
16
+ | 'primary'
17
+ | 'secondary'
18
+ | 'success'
19
+ | 'error'
20
+ | 'info'
21
+ | 'warning';
22
+
23
+ export const getPalette = () => {
24
+ // const storedColor = localStorage.getItem('primaryColor') || '#FF7F11';
25
+ // const primaryColors = storedColor ? JSON.parse(storedColor) : false;
26
+
27
+ return {
28
+ primary: '#FF7F11',
29
+ primaryLight: '#FFDB9F',
30
+ primaryMedium: '#FFA84C',
31
+ primaryDark: '#B74608',
32
+
33
+ inherit: '#000000',
34
+ secondary: '#43BBF2',
35
+ error: '#D63643',
36
+ warning: '#FFC300',
37
+ info: '#71D5F7',
38
+ success: '#6BC235',
39
+ white: '#ffffff',
40
+ black: '#666666',
41
+ helper: '#5A2A79',
42
+ secondaryLight: '#D9FCFE',
43
+ secondaryMedium: '#71D5F7',
44
+ secondaryDark: '#154F8C',
45
+ inheritLight: '#A3A3A3',
46
+ inheritMedium: '#666666',
47
+ inheritDark: '#292929',
48
+ whiteLight: '#F5F5F5',
49
+ whiteMedium: '#E0E0E0',
50
+ whiteDark: '#CCCCCC',
51
+ successLight: '#D9F8B0',
52
+ successMedium: '#B9EC85',
53
+ successDark: '#247010',
54
+ errorLight: '#FABEAF',
55
+ errorMedium: '#F29085',
56
+ errorDark: '#F29085',
57
+ warningLight: '#FFF7CC',
58
+ warningMedium: '#FFE266',
59
+ warningDark: '#936600',
60
+ helperLight: '#F3D7F8',
61
+ helperMedium: '#BF82D6',
62
+ helperDark: '#250D46',
63
+ };
64
+ };
65
+
66
+ export const palette = getPalette();
67
+
68
+ export const textColors = {
69
+ inherit: palette.inherit,
70
+ primary: palette.primary,
71
+ secondary: palette.secondary,
72
+ error: palette.error,
73
+ warning: palette.warning,
74
+ info: palette.info,
75
+ success: palette.success,
76
+ white: palette.white,
77
+ black: palette.black,
78
+ helper: palette.helper,
79
+ primaryLight: palette.primaryLight,
80
+ primaryMedium: palette.primaryMedium,
81
+ primaryDark: palette.primaryDark,
82
+ secondaryLight: palette.secondaryLight,
83
+ secondaryMedium: palette.secondaryMedium,
84
+ secondaryDark: palette.secondaryDark,
85
+ inheritLight: palette.inheritLight,
86
+ inheritMedium: palette.inheritMedium,
87
+ inheritDark: palette.inheritDark,
88
+ whiteLight: palette.whiteLight,
89
+ whiteMedium: palette.whiteMedium,
90
+ whiteDark: palette.whiteDark,
91
+ successLight: palette.successLight,
92
+ successMedium: palette.successMedium,
93
+ successDark: palette.successDark,
94
+ errorLight: palette.errorLight,
95
+ errorMedium: palette.errorMedium,
96
+ errorDark: palette.errorDark,
97
+ warningLight: palette.warningLight,
98
+ warningMedium: palette.warningMedium,
99
+ warningDark: palette.warningDark,
100
+ helperLight: palette.helperLight,
101
+ helperMedium: palette.helperMedium,
102
+ helperDark: palette.helperDark,
103
+ };
104
+
105
+ export const backgroundColors = {
106
+ inherit: palette.inherit,
107
+ primary: palette.primary,
108
+ secondary: palette.secondary,
109
+ error: palette.error,
110
+ warning: palette.warning,
111
+ info: palette.info,
112
+ success: palette.success,
113
+ white: palette.white,
114
+ black: palette.black,
115
+ primaryLight: palette.primaryLight,
116
+ primaryMedium: palette.primaryMedium,
117
+ primaryDark: palette.primaryDark,
118
+ secondaryLight: palette.secondaryLight,
119
+ secondaryMedium: palette.secondaryMedium,
120
+ secondaryDark: palette.secondaryDark,
121
+ inheritLight: palette.inheritLight,
122
+ inheritMedium: palette.inheritMedium,
123
+ inheritDark: palette.inheritDark,
124
+ whiteLight: palette.whiteLight,
125
+ whiteMedium: palette.whiteMedium,
126
+ whiteDark: palette.whiteDark,
127
+ successLight: palette.successLight,
128
+ successMedium: palette.successMedium,
129
+ successDark: palette.successDark,
130
+ errorLight: palette.errorLight,
131
+ errorMedium: palette.errorMedium,
132
+ errorDark: palette.errorDark,
133
+ warningLight: palette.warningLight,
134
+ warningMedium: palette.warningMedium,
135
+ warningDark: palette.warningDark,
136
+ helperLight: palette.helperLight,
137
+ helperMedium: palette.helperMedium,
138
+ helperDark: palette.helperDark,
139
+ };
140
+
141
+ export const colors: Record<IconsColors, string> = {
142
+ inherit: palette.inherit,
143
+ primary: palette.primary,
144
+ secondary: palette.secondary,
145
+ error: palette.error,
146
+ warning: palette.warning,
147
+ info: palette.info,
148
+ success: palette.success,
149
+ white: palette.white,
150
+ black: palette.black,
151
+ };
152
+
153
+ export const olosPalette = {
154
+ primary: {
155
+ main: palette.primary,
156
+ },
157
+ secondary: {
158
+ main: palette.secondary,
159
+ },
160
+ error: {
161
+ main: palette.error,
162
+ },
163
+ warning: {
164
+ main: palette.warning,
165
+ },
166
+ info: {
167
+ main: palette.info,
168
+ },
169
+ success: {
170
+ main: palette.success,
171
+ },
172
+ };
173
+
174
+ export const lightTheme = createTheme({
175
+ palette: {
176
+ mode: 'light',
177
+ ...olosPalette,
178
+ },
179
+ });
180
+
181
+ export const darkTheme = createTheme({
182
+ palette: {
183
+ mode: 'dark',
184
+ ...olosPalette,
185
+ background: {
186
+ default: palette.inheritLight,
187
+ paper: palette.inheritDark,
188
+ },
189
+ },
190
+ });
191
+
192
+ export const themes = {
193
+ light: lightTheme,
194
+ dark: darkTheme,
195
+ };
196
+
197
+ export function getIconsColorsArray(): IconsColors[] {
198
+ return Object.keys(colors) as IconsColors[];
199
+ }
200
+
201
+ export const getBtnColorsArray: BtnColors[] = [
202
+ 'inherit',
203
+ 'primary',
204
+ 'secondary',
205
+ 'success',
206
+ 'error',
207
+ 'info',
208
+ 'warning',
209
+ ];
@@ -0,0 +1,3 @@
1
+ export * from './colors'
2
+ export * from './sizes'
3
+ export * from './variants'
@@ -0,0 +1,26 @@
1
+ export type IconsSizes = 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | '2xlarge' | '3xlarge'
2
+ export type BtnSizes = 'small' | 'medium' | 'large'
3
+
4
+ export const iconsSizes: Record<IconsSizes, number> = {
5
+ xsmall: 14,
6
+ small: 20,
7
+ medium: 24,
8
+ large: 28,
9
+ xlarge: 32,
10
+ '2xlarge': 36,
11
+ '3xlarge': 40,
12
+ }
13
+
14
+ export const btnSizes: Record<BtnSizes, string> = {
15
+ small: 'small',
16
+ medium: 'medium',
17
+ large: 'large',
18
+ }
19
+
20
+ export function getIconsSizesArray(): IconsSizes[] {
21
+ return Object.keys(iconsSizes) as IconsSizes[]
22
+ }
23
+
24
+ export function getBtnSizesArray(): BtnSizes[] {
25
+ return Object.keys(btnSizes) as BtnSizes[]
26
+ }
@@ -0,0 +1,3 @@
1
+ export type BtnVariants = 'text' | 'outlined' | 'contained'
2
+
3
+ export const getBtnVariantsArray: BtnVariants[] = ['text', 'outlined', 'contained']
package/src/index.tsx ADDED
@@ -0,0 +1 @@
1
+ export * from './components';
@@ -1,4 +0,0 @@
1
- /// <reference types="react" />
2
- import { ButtonBaseProps } from './types';
3
- declare const Button: React.FC<ButtonBaseProps>;
4
- export default Button;
@@ -1,2 +0,0 @@
1
- export * from './Button';
2
- export { default } from './Button';
@@ -1,4 +0,0 @@
1
- /// <reference types="react" />
2
- import { CardBaseProps } from './types';
3
- declare const Card: React.FC<CardBaseProps>;
4
- export default Card;
@@ -1,4 +0,0 @@
1
- import React from 'react';
2
- import { CardHeaderProps } from './types';
3
- declare const CardHeader: React.FC<CardHeaderProps>;
4
- export default CardHeader;
@@ -1,4 +0,0 @@
1
- export * from './Card';
2
- export { default as Card } from './Card';
3
- export * from './CardHeader';
4
- export { default as CardHeader } from './CardHeader';