norma-library 0.5.10 → 0.5.12

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 (162) hide show
  1. package/.babelrc.json +18 -18
  2. package/.prettierignore +10 -10
  3. package/.prettierrc.json +20 -20
  4. package/.storybook/main.ts +20 -20
  5. package/.storybook/preview.ts +15 -15
  6. package/README.md +43 -43
  7. package/commitlint.config.js +1 -1
  8. package/dist/esm/components/Card.d.ts +2 -2
  9. package/dist/esm/components/ChatMessageBalloon/ChatMessageBalloon.style.d.ts +1 -1
  10. package/dist/esm/components/Icons.d.ts +1 -1
  11. package/dist/esm/components/UncontrolledTable/components/header/index.js +3 -5
  12. package/dist/esm/components/UncontrolledTable/components/header/index.js.map +1 -1
  13. package/dist/esm/components/UncontrolledTable/index.js +9 -6
  14. package/dist/esm/components/UncontrolledTable/index.js.map +1 -1
  15. package/dist/esm/components/UncontrolledTable/interface.d.ts +9 -0
  16. package/docs/index.md +118 -118
  17. package/package.json +136 -136
  18. package/src/components/Accordion.tsx +39 -39
  19. package/src/components/Avatar.tsx +17 -17
  20. package/src/components/Badge.tsx +14 -14
  21. package/src/components/Box/index.tsx +12 -12
  22. package/src/components/Box/interfaces.ts +3 -3
  23. package/src/components/Box/styles.tsx +22 -22
  24. package/src/components/Breadcrumb/index.tsx +27 -27
  25. package/src/components/Breadcrumb/interface.ts +8 -8
  26. package/src/components/Breadcrumb/styles.tsx +32 -32
  27. package/src/components/Button.tsx +26 -26
  28. package/src/components/Card.tsx +37 -37
  29. package/src/components/ChatMessage.tsx +87 -87
  30. package/src/components/ChatMessageBalloon/ChatMessageBalloon.style.ts +56 -56
  31. package/src/components/ChatMessageBalloon/ChatMessageBalloon.tsx +55 -55
  32. package/src/components/CheckBox.tsx +21 -21
  33. package/src/components/DateInput/index.tsx +34 -34
  34. package/src/components/DateInput/interface.ts +13 -13
  35. package/src/components/DateInput/styles.tsx +27 -27
  36. package/src/components/DatePicker.tsx +67 -67
  37. package/src/components/DropDown.tsx +24 -24
  38. package/src/components/IconButton.tsx +37 -37
  39. package/src/components/Icons.tsx +82 -82
  40. package/src/components/Modal.tsx +113 -113
  41. package/src/components/MultiSelectInput/components/MultiValue/index.tsx +44 -44
  42. package/src/components/MultiSelectInput/components/Option/index.tsx +62 -62
  43. package/src/components/MultiSelectInput/components/Option/styles.tsx +8 -8
  44. package/src/components/MultiSelectInput/index.tsx +60 -60
  45. package/src/components/MultiSelectInput/interfaces.ts +15 -15
  46. package/src/components/MultiSelectInput/styles.tsx +43 -43
  47. package/src/components/Paper.tsx +12 -12
  48. package/src/components/ProgressBar.tsx +51 -47
  49. package/src/components/RadioGroup.tsx +40 -40
  50. package/src/components/RangerSlider.tsx +65 -65
  51. package/src/components/Select.tsx +74 -74
  52. package/src/components/SelectInput/components/Option/index.tsx +61 -61
  53. package/src/components/SelectInput/components/Option/styles.tsx +8 -8
  54. package/src/components/SelectInput/index.tsx +45 -45
  55. package/src/components/SelectInput/interfaces.ts +15 -15
  56. package/src/components/SelectInput/styles.tsx +31 -31
  57. package/src/components/Svgs.tsx +506 -506
  58. package/src/components/Table/components/header/index.tsx +86 -86
  59. package/src/components/Table/components/header/styles.tsx +59 -59
  60. package/src/components/Table/components/index.tsx +8 -8
  61. package/src/components/Table/components/pagination/index.tsx +39 -39
  62. package/src/components/Table/components/pagination/styles.tsx +28 -28
  63. package/src/components/Table/components/tbody/index.tsx +30 -30
  64. package/src/components/Table/components/tbody/styles.tsx +4 -4
  65. package/src/components/Table/index.tsx +317 -317
  66. package/src/components/Table/interface.ts +23 -23
  67. package/src/components/Table/styles.tsx +117 -117
  68. package/src/components/Tabs.tsx +106 -106
  69. package/src/components/Tag.tsx +33 -33
  70. package/src/components/TextField.tsx +19 -19
  71. package/src/components/TextInput/index.tsx +37 -37
  72. package/src/components/TextInput/interface.ts +9 -9
  73. package/src/components/TextInput/styles.tsx +23 -23
  74. package/src/components/TimeLine.tsx +89 -89
  75. package/src/components/TimePicker.tsx +78 -78
  76. package/src/components/Typography/Text/index.tsx +20 -20
  77. package/src/components/Typography/Text/interfaces.ts +5 -5
  78. package/src/components/Typography/Text/styles.tsx +40 -40
  79. package/src/components/Typography/Title/index.tsx +22 -22
  80. package/src/components/Typography/Title/interfaces.ts +6 -6
  81. package/src/components/Typography/Title/styles.tsx +40 -40
  82. package/src/components/Typography/index.tsx +6 -6
  83. package/src/components/UncontrolledTable/components/header/index.tsx +63 -51
  84. package/src/components/UncontrolledTable/components/header/styles.tsx +59 -59
  85. package/src/components/UncontrolledTable/components/index.tsx +8 -8
  86. package/src/components/UncontrolledTable/components/pagination/index.tsx +39 -39
  87. package/src/components/UncontrolledTable/components/pagination/styles.tsx +28 -28
  88. package/src/components/UncontrolledTable/components/tbody/index.tsx +30 -30
  89. package/src/components/UncontrolledTable/components/tbody/styles.tsx +4 -4
  90. package/src/components/UncontrolledTable/index.tsx +307 -300
  91. package/src/components/UncontrolledTable/interface.ts +36 -27
  92. package/src/components/UncontrolledTable/styles.tsx +120 -120
  93. package/src/components/index.ts +24 -24
  94. package/src/helpers/alignments.ts +14 -14
  95. package/src/helpers/borders.ts +18 -18
  96. package/src/helpers/colors.ts +206 -206
  97. package/src/helpers/index.ts +5 -5
  98. package/src/helpers/radios.ts +24 -24
  99. package/src/helpers/sizes.ts +72 -72
  100. package/src/index.ts +64 -64
  101. package/src/interfaces/Accordion.ts +12 -12
  102. package/src/interfaces/Avatar.tsx +15 -15
  103. package/src/interfaces/Badge.ts +19 -19
  104. package/src/interfaces/Button.ts +22 -22
  105. package/src/interfaces/Card.ts +11 -11
  106. package/src/interfaces/ChatMessage.ts +12 -12
  107. package/src/interfaces/ChatMessageBalloon.ts +17 -17
  108. package/src/interfaces/CheckBox.ts +27 -27
  109. package/src/interfaces/DatePicker.ts +13 -13
  110. package/src/interfaces/DropDown.ts +14 -14
  111. package/src/interfaces/IconButton.ts +22 -22
  112. package/src/interfaces/Icons.ts +17 -17
  113. package/src/interfaces/Modal.ts +16 -16
  114. package/src/interfaces/Paper.ts +12 -12
  115. package/src/interfaces/ProgressBar.ts +19 -18
  116. package/src/interfaces/RadioGroup.ts +22 -22
  117. package/src/interfaces/RangerSlider.ts +21 -21
  118. package/src/interfaces/Select.ts +17 -17
  119. package/src/interfaces/Tabs.ts +19 -19
  120. package/src/interfaces/Tag.ts +17 -17
  121. package/src/interfaces/TextField.ts +44 -44
  122. package/src/interfaces/TimeLine.ts +11 -11
  123. package/src/interfaces/TimePicker.ts +13 -13
  124. package/src/interfaces/index.ts +23 -23
  125. package/src/providers/NormaProvider.tsx +13 -13
  126. package/src/sample-data-2.json +178 -178
  127. package/src/sample-data.json +177 -177
  128. package/src/stories/Accordion.stories.tsx +65 -65
  129. package/src/stories/Avatar.stories.tsx +123 -123
  130. package/src/stories/Badge.stories.tsx +39 -39
  131. package/src/stories/Box.stories.tsx +35 -35
  132. package/src/stories/Breadcrumb.stories.tsx +44 -44
  133. package/src/stories/Button.stories.tsx +93 -93
  134. package/src/stories/Card.stories.tsx +39 -39
  135. package/src/stories/ChatMessage.stories.tsx +84 -84
  136. package/src/stories/ChatMessageBalloon.stories.tsx +108 -108
  137. package/src/stories/CheckBox.stories.tsx +88 -88
  138. package/src/stories/DateInput.stories.tsx +51 -51
  139. package/src/stories/DatePicker.stories.tsx +50 -50
  140. package/src/stories/DropDown.stories.tsx +57 -57
  141. package/src/stories/IconButton.stories.tsx +78 -78
  142. package/src/stories/Modal.stories.tsx +195 -195
  143. package/src/stories/MultiSelectInput.stories.tsx +90 -90
  144. package/src/stories/Paper.stories.tsx +53 -53
  145. package/src/stories/ProgressBar.stories.tsx +95 -95
  146. package/src/stories/RadioGroup.stories.tsx +87 -87
  147. package/src/stories/RangerSlider.stories.tsx +58 -58
  148. package/src/stories/Select.stories.tsx +100 -100
  149. package/src/stories/SelectInput.stories.tsx +78 -78
  150. package/src/stories/Table.stories.tsx +372 -372
  151. package/src/stories/Tabs.stories.tsx +62 -62
  152. package/src/stories/Tag.stories.tsx +56 -56
  153. package/src/stories/Text.stories.tsx +37 -37
  154. package/src/stories/TextField.stories.tsx +310 -310
  155. package/src/stories/TextInput.stories.tsx +52 -52
  156. package/src/stories/TimeLine.stories.tsx +35 -35
  157. package/src/stories/TimePicker.stories.tsx +87 -87
  158. package/src/stories/Title.stories.tsx +43 -43
  159. package/src/stories/UncontrolledTable.stories.tsx +321 -379
  160. package/src/styles/globals.scss +17 -17
  161. package/src/types/index.ts +204 -204
  162. package/vite.config.ts +15 -15
@@ -1,27 +1,36 @@
1
- import { ColumnDef } from '@tanstack/react-table';
2
-
3
- export interface UncontrolledTableProps {
4
- data: any;
5
- columns: ColumnDef<ColumnsTable>[];
6
- onClick: any;
7
- onMouseOver: any;
8
- onMouseOut: any;
9
- showTotalResults: boolean;
10
- showSettings: boolean;
11
- rowCount: number;
12
- pagination?: { pageIndex: number; pageSize: number; totalPages: number };
13
- showClearFields?: boolean;
14
- onChangePage?: (page: number) => void;
15
- onClearFieldsClick?: () => void;
16
- onFilterClick?: (column: string) => void;
17
- onSortClick?: (column: string, direction: string) => void;
18
- }
19
-
20
- export interface ColumnsTable {
21
- header: string;
22
- accessorKey: string;
23
- type: string;
24
- enableColumnFilter: boolean;
25
- filterFn: string;
26
- nofilter?: boolean;
27
- }
1
+ import { ColumnDef } from '@tanstack/react-table';
2
+
3
+ type Labels = {
4
+ orderAsc: string;
5
+ orderDesc: string;
6
+ filter: string;
7
+ clearFilter: string;
8
+ }
9
+
10
+ export interface UncontrolledTableProps {
11
+ data: any;
12
+ columns: ColumnDef<ColumnsTable>[];
13
+ onClick: any;
14
+ onMouseOver: any;
15
+ onMouseOut: any;
16
+ showTotalResults: boolean;
17
+ showSettings: boolean;
18
+ rowCount: number;
19
+ pagination?: { pageIndex: number; pageSize: number; totalPages: number };
20
+ showClearFields?: boolean;
21
+ customTotalResults?: string;
22
+ onChangePage?: (page: number) => void;
23
+ onClearFieldsClick?: () => void;
24
+ onFilterClick?: (column: string) => void;
25
+ onSortClick?: (column: string, direction: string) => void;
26
+ labels?: Labels;
27
+ }
28
+
29
+ export interface ColumnsTable {
30
+ header: string;
31
+ accessorKey: string;
32
+ type: string;
33
+ enableColumnFilter: boolean;
34
+ filterFn: string;
35
+ nofilter?: boolean;
36
+ }
@@ -1,120 +1,120 @@
1
- import styled from 'styled-components';
2
-
3
- export const Container = styled.div`
4
- width: 100%;
5
- background: #fff;
6
- `;
7
-
8
- export const Content = styled.div<any>`
9
- min-height: ${props => (props.minHeight ? props.minHeight : 'auto')};
10
- `;
11
-
12
- export const Table = styled.table`
13
- border-collapse: collapse;
14
- width: 100%;
15
- thead {
16
- tr {
17
- border-bottom: 1px solid #e0e0e0;
18
- th {
19
- padding: 12px 24px;
20
- }
21
- }
22
- }
23
- tbody {
24
- tr {
25
- td {
26
- padding: 16px 24px;
27
- color: #666666;
28
- font-size: 14px;
29
- }
30
- }
31
- tr:nth-child(even) {
32
- background: #fafafa;
33
- border-bottom: 1px solid #f1f1f1;
34
- border-top: 1px solid #f1f1f1;
35
- }
36
- }
37
- `;
38
-
39
- export const TextColumn = styled.span<any>`
40
- color: #666666;
41
- font-size: 14px;
42
- width: ${props => (props.$alone ? '100%' : 'auto')};
43
- text-align: ${props => (props.$alone ? 'center' : 'initial')};
44
- `;
45
-
46
- export const ColumnContent = styled.div`
47
- gap: 2px;
48
- align-items: center;
49
- display: flex;
50
- cursor: pointer;
51
- `;
52
-
53
- export const IconFilterDialog = styled.div`
54
- width: 20px;
55
- height: 20px;
56
- cursor: pointer;
57
- `;
58
-
59
- export const backgroundDialog = styled.div`
60
- width: 100%;
61
- position: absolute;
62
- height: 100vh;
63
- background: transparent;
64
- top: 0;
65
- left: 0;
66
- `;
67
-
68
- export const FilterDialog = styled.div`
69
- padding: 10px 0;
70
- margin: 6px 0px 0 0;
71
- position: absolute;
72
- width: max-content;
73
- background: #fff;
74
- box-shadow: 0px 3px 6px #00000029;
75
- border: 1px solid #e0e0e0;
76
- z-index: 99;
77
- `;
78
-
79
- export const ListFilterDialog = styled.div`
80
- display: flex;
81
- flex-direction: column;
82
- .label {
83
- margin: 0 0 8px 0;
84
- color: #666666;
85
- font-size: 14px;
86
- font-weight: 400;
87
- text-align: left;
88
- }
89
- .select {
90
- border: 1px solid #e0e0e0;
91
- padding: 8px 12px;
92
- }
93
- `;
94
-
95
- export const OptionFilterDialog = styled.div`
96
- display: flex;
97
- gap: 16px;
98
- align-items: center;
99
- padding: 6px 15px;
100
- cursor: pointer;
101
- &:hover {
102
- background: rgba(0, 0, 0, 0.04);
103
- }
104
- .icon {
105
- color: #666;
106
- }
107
- .rotate {
108
- rotate: 180deg;
109
- }
110
- div {
111
- width: 20px;
112
- height: 20px;
113
- }
114
- p {
115
- margin: 0;
116
- color: #666666;
117
- font-size: 16px;
118
- font-weight: 400;
119
- }
120
- `;
1
+ import styled from 'styled-components';
2
+
3
+ export const Container = styled.div`
4
+ width: 100%;
5
+ background: #fff;
6
+ `;
7
+
8
+ export const Content = styled.div<any>`
9
+ min-height: ${props => (props.minHeight ? props.minHeight : 'auto')};
10
+ `;
11
+
12
+ export const Table = styled.table`
13
+ border-collapse: collapse;
14
+ width: 100%;
15
+ thead {
16
+ tr {
17
+ border-bottom: 1px solid #e0e0e0;
18
+ th {
19
+ padding: 12px 24px;
20
+ }
21
+ }
22
+ }
23
+ tbody {
24
+ tr {
25
+ td {
26
+ padding: 16px 24px;
27
+ color: #666666;
28
+ font-size: 14px;
29
+ }
30
+ }
31
+ tr:nth-child(even) {
32
+ background: #fafafa;
33
+ border-bottom: 1px solid #f1f1f1;
34
+ border-top: 1px solid #f1f1f1;
35
+ }
36
+ }
37
+ `;
38
+
39
+ export const TextColumn = styled.span<any>`
40
+ color: #666666;
41
+ font-size: 14px;
42
+ width: ${props => (props.$alone ? '100%' : 'auto')};
43
+ text-align: ${props => (props.$alone ? 'center' : 'initial')};
44
+ `;
45
+
46
+ export const ColumnContent = styled.div`
47
+ gap: 2px;
48
+ align-items: center;
49
+ display: flex;
50
+ cursor: pointer;
51
+ `;
52
+
53
+ export const IconFilterDialog = styled.div`
54
+ width: 20px;
55
+ height: 20px;
56
+ cursor: pointer;
57
+ `;
58
+
59
+ export const backgroundDialog = styled.div`
60
+ width: 100%;
61
+ position: absolute;
62
+ height: 100vh;
63
+ background: transparent;
64
+ top: 0;
65
+ left: 0;
66
+ `;
67
+
68
+ export const FilterDialog = styled.div`
69
+ padding: 10px 0;
70
+ margin: 6px 0px 0 0;
71
+ position: absolute;
72
+ width: max-content;
73
+ background: #fff;
74
+ box-shadow: 0px 3px 6px #00000029;
75
+ border: 1px solid #e0e0e0;
76
+ z-index: 99;
77
+ `;
78
+
79
+ export const ListFilterDialog = styled.div`
80
+ display: flex;
81
+ flex-direction: column;
82
+ .label {
83
+ margin: 0 0 8px 0;
84
+ color: #666666;
85
+ font-size: 14px;
86
+ font-weight: 400;
87
+ text-align: left;
88
+ }
89
+ .select {
90
+ border: 1px solid #e0e0e0;
91
+ padding: 8px 12px;
92
+ }
93
+ `;
94
+
95
+ export const OptionFilterDialog = styled.div`
96
+ display: flex;
97
+ gap: 16px;
98
+ align-items: center;
99
+ padding: 6px 15px;
100
+ cursor: pointer;
101
+ &:hover {
102
+ background: rgba(0, 0, 0, 0.04);
103
+ }
104
+ .icon {
105
+ color: #666;
106
+ }
107
+ .rotate {
108
+ rotate: 180deg;
109
+ }
110
+ div {
111
+ width: 20px;
112
+ height: 20px;
113
+ }
114
+ p {
115
+ margin: 0;
116
+ color: #666666;
117
+ font-size: 16px;
118
+ font-weight: 400;
119
+ }
120
+ `;
@@ -1,24 +1,24 @@
1
- export * from './Accordion';
2
- export * from './Avatar';
3
- export * from './Badge';
4
- export * from './Button';
5
- export * from './Card';
6
- export * from './ChatMessage';
7
- export * from './ChatMessageBalloon/ChatMessageBalloon';
8
- export * from './CheckBox';
9
- export * from './DatePicker';
10
- export * from './DropDown';
11
- export * from './IconButton';
12
- export * from './Icons';
13
- export * from './Modal';
14
- export * from './Paper';
15
- export * from './ProgressBar';
16
- export * from './RadioGroup';
17
- export * from './RangerSlider';
18
- export * from './Select';
19
- export * from './Tabs';
20
- export * from './Tag';
21
- export * from './Table';
22
- export * from './TextField';
23
- export * from './TimeLine';
24
- export * from './TimePicker';
1
+ export * from './Accordion';
2
+ export * from './Avatar';
3
+ export * from './Badge';
4
+ export * from './Button';
5
+ export * from './Card';
6
+ export * from './ChatMessage';
7
+ export * from './ChatMessageBalloon/ChatMessageBalloon';
8
+ export * from './CheckBox';
9
+ export * from './DatePicker';
10
+ export * from './DropDown';
11
+ export * from './IconButton';
12
+ export * from './Icons';
13
+ export * from './Modal';
14
+ export * from './Paper';
15
+ export * from './ProgressBar';
16
+ export * from './RadioGroup';
17
+ export * from './RangerSlider';
18
+ export * from './Select';
19
+ export * from './Tabs';
20
+ export * from './Tag';
21
+ export * from './Table';
22
+ export * from './TextField';
23
+ export * from './TimeLine';
24
+ export * from './TimePicker';
@@ -1,14 +1,14 @@
1
- function getAlign(border: string) {
2
- switch (border) {
3
- case 'left':
4
- return 'text-start justify-items-start';
5
- case 'center':
6
- return 'justify-items-center';
7
- case 'right':
8
- return 'text-end justify-items-end';
9
- default:
10
- return 'text-center inline-flex';
11
- }
12
- }
13
-
14
- export { getAlign };
1
+ function getAlign(border: string) {
2
+ switch (border) {
3
+ case 'left':
4
+ return 'text-start justify-items-start';
5
+ case 'center':
6
+ return 'justify-items-center';
7
+ case 'right':
8
+ return 'text-end justify-items-end';
9
+ default:
10
+ return 'text-center inline-flex';
11
+ }
12
+ }
13
+
14
+ export { getAlign };
@@ -1,18 +1,18 @@
1
- function getBorderSize(size: number) {
2
- switch (size.toString()) {
3
- case '0':
4
- return 'border-0';
5
- case '1':
6
- return 'border border-[0.05rem]';
7
- case '2':
8
- return 'border border-2';
9
- case '4':
10
- return 'border border-4';
11
- case '8':
12
- return 'border border-8';
13
- default:
14
- return 'border border-2';
15
- }
16
- }
17
-
18
- export { getBorderSize };
1
+ function getBorderSize(size: number) {
2
+ switch (size.toString()) {
3
+ case '0':
4
+ return 'border-0';
5
+ case '1':
6
+ return 'border border-[0.05rem]';
7
+ case '2':
8
+ return 'border border-2';
9
+ case '4':
10
+ return 'border border-4';
11
+ case '8':
12
+ return 'border border-8';
13
+ default:
14
+ return 'border border-2';
15
+ }
16
+ }
17
+
18
+ export { getBorderSize };