@monolith-forensics/monolith-ui 1.0.12 → 1.1.1

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 (143) hide show
  1. package/dist/Button/Button.d.ts +19 -0
  2. package/dist/Button/Button.js +332 -0
  3. package/dist/Button/index.d.ts +2 -0
  4. package/dist/Button/index.js +8 -0
  5. package/dist/Calendar/Calendar.d.ts +15 -0
  6. package/dist/Calendar/Calendar.js +232 -0
  7. package/dist/Calendar/CalendarStyles.d.ts +36 -0
  8. package/{src/components → dist}/Calendar/CalendarStyles.js +32 -52
  9. package/dist/Calendar/calendarHelpers.d.ts +53 -0
  10. package/dist/Calendar/calendarHelpers.js +181 -0
  11. package/dist/Calendar/index.d.ts +1 -0
  12. package/dist/Calendar/index.js +8 -0
  13. package/dist/CheckBox/CheckBox.d.ts +11 -0
  14. package/dist/CheckBox/CheckBox.js +34 -0
  15. package/dist/CheckBox/index.d.ts +1 -0
  16. package/dist/CheckBox/index.js +8 -0
  17. package/dist/DateInput/DateInput.d.ts +24 -0
  18. package/dist/DateInput/DateInput.js +511 -0
  19. package/dist/DateInput/index.d.ts +1 -0
  20. package/dist/DateInput/index.js +8 -0
  21. package/dist/DropDownMenu/DropDownMenu.d.ts +36 -0
  22. package/dist/DropDownMenu/DropDownMenu.js +212 -0
  23. package/dist/DropDownMenu/index.d.ts +1 -0
  24. package/dist/DropDownMenu/index.js +8 -0
  25. package/dist/Error/Error.d.ts +4 -0
  26. package/dist/Error/Error.js +38 -0
  27. package/dist/Error/index.d.ts +1 -0
  28. package/dist/Error/index.js +8 -0
  29. package/dist/FieldLabel/FieldLabel.d.ts +19 -0
  30. package/dist/FieldLabel/FieldLabel.js +119 -0
  31. package/dist/FieldLabel/index.js +8 -0
  32. package/dist/FileInputField/FileInputField.d.ts +18 -0
  33. package/dist/FileInputField/FileInputField.js +116 -0
  34. package/dist/FileInputField/index.d.ts +1 -0
  35. package/dist/FileInputField/index.js +8 -0
  36. package/dist/Flyout/Flyout.d.ts +10 -0
  37. package/dist/Flyout/Flyout.js +111 -0
  38. package/dist/Flyout/FlyoutHeader.d.ts +5 -0
  39. package/dist/Flyout/FlyoutHeader.js +12 -0
  40. package/dist/Flyout/FlyoutTitle.d.ts +2 -0
  41. package/dist/Flyout/FlyoutTitle.js +13 -0
  42. package/dist/Flyout/index.d.ts +3 -0
  43. package/dist/Flyout/index.js +12 -0
  44. package/dist/FormSection/FormSection.d.ts +9 -0
  45. package/dist/FormSection/FormSection.js +51 -0
  46. package/dist/FormSection/index.d.ts +1 -0
  47. package/dist/FormSection/index.js +8 -0
  48. package/dist/Grid/Grid.d.ts +6 -0
  49. package/dist/Grid/Grid.js +15 -0
  50. package/dist/Grid/index.d.ts +1 -0
  51. package/dist/Grid/index.js +8 -0
  52. package/dist/IconButton/IconButton.d.ts +5 -0
  53. package/dist/IconButton/IconButton.js +30 -0
  54. package/dist/IconButton/index.d.ts +1 -0
  55. package/dist/IconButton/index.js +8 -0
  56. package/dist/Input/Input.d.ts +21 -0
  57. package/dist/Input/Input.js +148 -0
  58. package/dist/Input/index.js +8 -0
  59. package/dist/Modal/Modal.d.ts +14 -0
  60. package/dist/Modal/Modal.js +134 -0
  61. package/dist/Modal/index.d.ts +1 -0
  62. package/dist/Modal/index.js +8 -0
  63. package/dist/Pill/Pill.d.ts +11 -0
  64. package/dist/Pill/Pill.js +146 -0
  65. package/dist/Pill/index.js +8 -0
  66. package/dist/SelectBox/SelectBox.d.ts +45 -0
  67. package/dist/SelectBox/SelectBox.js +469 -0
  68. package/dist/SelectBox/index.d.ts +1 -0
  69. package/dist/SelectBox/index.js +8 -0
  70. package/dist/Switch/Switch.d.ts +18 -0
  71. package/dist/Switch/Switch.js +157 -0
  72. package/dist/Switch/index.d.ts +1 -0
  73. package/dist/Switch/index.js +8 -0
  74. package/dist/TagBox/TagBox.d.ts +38 -0
  75. package/dist/TagBox/TagBox.js +440 -0
  76. package/dist/TagBox/TagBoxStyles.d.ts +11 -0
  77. package/dist/TagBox/TagBoxStyles.js +113 -0
  78. package/dist/TagBox/index.d.ts +1 -0
  79. package/dist/TagBox/index.js +8 -0
  80. package/dist/TextArea/TextArea.d.ts +16 -0
  81. package/dist/TextArea/TextArea.js +80 -0
  82. package/dist/TextArea/index.js +8 -0
  83. package/dist/TextAreaInput/TextAreaInput.d.ts +12 -0
  84. package/dist/TextAreaInput/TextAreaInput.js +23 -0
  85. package/dist/TextAreaInput/index.js +8 -0
  86. package/dist/TextInput/TextInput.d.ts +12 -0
  87. package/dist/TextInput/TextInput.js +30 -0
  88. package/dist/TextInput/index.js +8 -0
  89. package/dist/Tooltip/Tooltip.d.ts +12 -0
  90. package/dist/Tooltip/Tooltip.js +53 -0
  91. package/dist/Tooltip/index.d.ts +1 -0
  92. package/dist/Tooltip/index.js +8 -0
  93. package/dist/core/ArrowButton.d.ts +6 -0
  94. package/dist/core/ArrowButton.js +48 -0
  95. package/dist/core/ClearButton.d.ts +6 -0
  96. package/dist/core/ClearButton.js +48 -0
  97. package/dist/core/StyledContent.d.ts +7 -0
  98. package/dist/core/StyledContent.js +46 -0
  99. package/dist/core/StyledFloatContainer.d.ts +2 -0
  100. package/dist/core/StyledFloatContainer.js +10 -0
  101. package/dist/core/Types/Size.d.ts +2 -0
  102. package/dist/core/Types/Size.js +2 -0
  103. package/dist/core/Types/Variant.d.ts +2 -0
  104. package/dist/core/Types/Variant.js +2 -0
  105. package/dist/core/index.d.ts +6 -0
  106. package/dist/core/index.js +14 -0
  107. package/dist/index.d.ts +22 -0
  108. package/dist/index.js +51 -0
  109. package/package.json +15 -20
  110. package/.gitattributes +0 -2
  111. package/rollup.config.js +0 -10
  112. package/src/components/ArrowButton/ArrowButton.tsx +0 -54
  113. package/src/components/ArrowButton/index.tsx +0 -1
  114. package/src/components/Button/Button.tsx +0 -278
  115. package/src/components/Button/index.ts +0 -1
  116. package/src/components/Calendar/Calendar.js +0 -365
  117. package/src/components/Calendar/calendarHelpers.js +0 -194
  118. package/src/components/DateInput/DateInput.js +0 -583
  119. package/src/components/FieldLabel/FieldLabel.tsx +0 -152
  120. package/src/components/FileInputField/FileInputField.js +0 -171
  121. package/src/components/Input/Input.tsx +0 -141
  122. package/src/components/Pill/Pill.tsx +0 -144
  123. package/src/components/SelectBox/SelectBox.js +0 -543
  124. package/src/components/TagBox/TagBox.js +0 -563
  125. package/src/components/TextArea/TextArea.tsx +0 -70
  126. package/src/components/TextAreaInput/TextAreaInput.tsx +0 -48
  127. package/src/components/TextInput/TextInput.tsx +0 -50
  128. package/src/components/core/index.js +0 -16
  129. package/src/components/index.ts +0 -7
  130. package/src/components/theme/breakpoints.js +0 -11
  131. package/src/components/theme/components.js +0 -140
  132. package/src/components/theme/index.js +0 -77
  133. package/src/components/theme/shadows.js +0 -33
  134. package/src/components/theme/typography.js +0 -58
  135. package/src/components/theme/variants.js +0 -235
  136. package/src/index.ts +0 -1
  137. package/tsconfig.json +0 -109
  138. /package/{src/components/FieldLabel/index.ts → dist/FieldLabel/index.d.ts} +0 -0
  139. /package/{src/components/Input/index.tsx → dist/Input/index.d.ts} +0 -0
  140. /package/{src/components/Pill/index.ts → dist/Pill/index.d.ts} +0 -0
  141. /package/{src/components/TextArea/index.ts → dist/TextArea/index.d.ts} +0 -0
  142. /package/{src/components/TextAreaInput/index.ts → dist/TextAreaInput/index.d.ts} +0 -0
  143. /package/{src/components/TextInput/index.tsx → dist/TextInput/index.d.ts} +0 -0
@@ -1,25 +1,29 @@
1
- import styled from "styled-components";
2
-
3
- export const MainContainer = styled.div`
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.NoValueButton = exports.TimeItemActive = exports.TimeItem = exports.TimeMinuteSelect = exports.TimeHourSelect = exports.TimeHeader = exports.TimePickerContainer = exports.TimeContainer = exports.TodayCalendarDate = exports.HighlightedCalendarDate = exports.CalendarDate = exports.CalendarDay = exports.CalendarCell = exports.CalendarMonth = exports.CalendarGrid = exports.CalendarHeader = exports.CalendarContainer = exports.MainContainer = void 0;
7
+ const styled_components_1 = __importDefault(require("styled-components"));
8
+ exports.MainContainer = styled_components_1.default.div `
4
9
  display: flex;
5
10
  `;
6
- export const CalendarContainer = styled.div`
11
+ exports.CalendarContainer = styled_components_1.default.div `
7
12
  font-size: 5px;
8
13
  width: 250px;
9
- // border: 1px solid ${(props) => props.theme.palette.divider};
10
14
  border-radius: 4px;
11
15
  overflow: hidden;
12
16
  `;
13
- export const CalendarHeader = styled.div`
17
+ exports.CalendarHeader = styled_components_1.default.div `
14
18
  display: flex;
15
19
  align-items: center;
16
20
  justify-content: space-between;
17
21
  `;
18
- export const CalendarGrid = styled.div`
22
+ exports.CalendarGrid = styled_components_1.default.div `
19
23
  display: grid;
20
24
  grid-template: repeat(7, auto) / repeat(7, auto);
21
25
  `;
22
- export const CalendarMonth = styled.div`
26
+ exports.CalendarMonth = styled_components_1.default.div `
23
27
  font-weight: 500;
24
28
  font-size: 12px;
25
29
  color: ${(props) => props.theme.palette.text.primary};
@@ -28,7 +32,7 @@ export const CalendarMonth = styled.div`
28
32
  word-spacing: 5px;
29
33
  user-select: none;
30
34
  `;
31
- export const CalendarCell = styled.div`
35
+ exports.CalendarCell = styled_components_1.default.div `
32
36
  text-align: center;
33
37
  align-self: center;
34
38
  letter-spacing: 0.1rem;
@@ -36,53 +40,33 @@ export const CalendarCell = styled.div`
36
40
  user-select: none;
37
41
  border-radius: 5px;
38
42
  border: 1px solid transparent;
39
- grid-column: ${(props) => (props.index % 7) + 1} / span 1;
43
+ grid-column: ${({ index = 0 }) => (index % 7) + 1} / span 1;
40
44
  `;
41
- export const CalendarDay = styled(CalendarCell)`
45
+ exports.CalendarDay = (0, styled_components_1.default)(exports.CalendarCell) `
42
46
  font-weight: bold;
43
47
  font-size: 10px;
44
48
  border-radius: 0px;
45
49
  color: ${(props) => props.theme.palette.text.secondary};
46
- // border-top: 1px solid ${(props) => props.theme.palette.divider};
47
- // border-bottom: 1px solid ${(props) => props.theme.palette.divider};
48
- border-right: ${(props) =>
49
- (props.index % 7) + 1 === 7
50
- ? `none`
51
- : `2px solid ${(props) => props.theme.palette.divider}`};
52
- `;
53
- export const CalendarDate = styled(CalendarCell)`
50
+ `;
51
+ exports.CalendarDate = (0, styled_components_1.default)(exports.CalendarCell) `
54
52
  font-weight: ${(props) => (props.inMonth ? 500 : 300)};
55
53
  font-size: 10px;
56
54
  cursor: pointer;
57
- border-bottom: ${(props) =>
58
- (props.index + 1) / 7 <= 5
59
- ? `1px solid ${(props) => props.theme.palette.divider}`
60
- : `1px solid transparent`};
61
- border-right: ${(props) =>
62
- (props.index % 7) + 1 === 7
63
- ? `1px solid transparent`
64
- : `1px solid ${(props) => props.theme.palette.divider}`};
65
- border-left: 1px solid transparent;
66
- border-top: 1px solid transparent;
67
- color: ${(props) =>
68
- props.inMonth
69
- ? props.theme.palette.text.primary
70
- : props.theme.palette.text.secondary};
71
- grid-row: ${(props) => Math.floor(props.index / 7) + 2} / span 1;
55
+
56
+ color: ${({ inMonth, theme }) => inMonth ? theme.palette.text.primary : theme.palette.text.secondary};
57
+ grid-row: ${({ index }) => Math.floor((index || 0) / 7) + 2} / span 1;
72
58
  transition: all 0.2s ease-out;
73
59
  border-radius: 5px;
74
60
  :hover {
75
- // color: ${(props) => props.theme.palette.primary.main};
76
- background: ${(props) => props.theme.palette.action.hover};
61
+ background: ${({ theme }) => theme.palette.action.hover};
77
62
  }
78
63
 
79
64
  &[data-disabled="true"] {
80
65
  pointer-events: none;
81
- color: ${(props) => props.theme.palette.text.disabled};
66
+ color: ${({ theme }) => theme.palette.text.disabled};
82
67
  }
83
68
  `;
84
- export const HighlightedCalendarDate = styled(CalendarDate)`
85
- // color: ${(props) => props.theme.palette.primary.main} !important;
69
+ exports.HighlightedCalendarDate = (0, styled_components_1.default)(exports.CalendarDate) `
86
70
  color: white !important;
87
71
  background: ${(props) => props.theme.palette.primary.main} !important;
88
72
  border: 1px solid ${(props) => props.theme.palette.primary.main} !important;
@@ -94,10 +78,9 @@ export const HighlightedCalendarDate = styled(CalendarDate)`
94
78
  left: -1px;
95
79
  width: calc(100% + 2px);
96
80
  height: calc(100% + 2px);
97
- // border: 2px solid #06c;
98
81
  }
99
82
  `;
100
- export const TodayCalendarDate = styled(HighlightedCalendarDate)`
83
+ exports.TodayCalendarDate = (0, styled_components_1.default)(exports.HighlightedCalendarDate) `
101
84
  color: ${(props) => props.theme.palette.text.primary} !important;
102
85
  background: transparent !important;
103
86
  ::after {
@@ -114,7 +97,7 @@ export const TodayCalendarDate = styled(HighlightedCalendarDate)`
114
97
  background: ${(props) => props.theme.palette.action.hover} !important;
115
98
  }
116
99
  `;
117
- export const TimeContainer = styled.div`
100
+ exports.TimeContainer = styled_components_1.default.div `
118
101
  font-size: 12px;
119
102
  width: 150px;
120
103
  height: 100%;
@@ -123,11 +106,11 @@ export const TimeContainer = styled.div`
123
106
  border-radius: 4px;
124
107
  overflow: hidden;
125
108
  `;
126
- export const TimePickerContainer = styled.div`
109
+ exports.TimePickerContainer = styled_components_1.default.div `
127
110
  display: flex;
128
111
  height: 100%;
129
112
  `;
130
- export const TimeHeader = styled.div`
113
+ exports.TimeHeader = styled_components_1.default.div `
131
114
  font-weight: 500;
132
115
  font-size: 12px;
133
116
  color: ${(props) => props.theme.palette.text.primary};
@@ -136,27 +119,25 @@ export const TimeHeader = styled.div`
136
119
  padding: 5px;
137
120
  line-height: 2.3;
138
121
  height: 40px;
139
- // word-spacing: 5px;
140
122
  user-select: none;
141
123
  `;
142
- export const TimeHourSelect = styled.div`
124
+ exports.TimeHourSelect = styled_components_1.default.div `
143
125
  border-right: 1px solid ${(props) => props.theme.palette.divider};
144
126
  width: 50%;
145
127
  height: 250px;
146
128
  overflow-y: auto;
147
129
  `;
148
- export const TimeMinuteSelect = styled.div`
130
+ exports.TimeMinuteSelect = styled_components_1.default.div `
149
131
  width: 50%;
150
132
  height: 250px;
151
133
  overflow-y: auto;
152
134
  `;
153
- export const TimeItem = styled.div`
135
+ exports.TimeItem = styled_components_1.default.div `
154
136
  font-weight: 500;
155
137
  font-size: 10px;
156
138
  color: ${(props) => props.theme.palette.text.primary};
157
139
  text-align: center;
158
140
  padding: 5px;
159
- // word-spacing: 5px;
160
141
  user-select: none;
161
142
  cursor: pointer;
162
143
  transition: all 0.2s ease-out;
@@ -164,15 +145,14 @@ export const TimeItem = styled.div`
164
145
  background: ${(props) => props.theme.palette.action.hover};
165
146
  }
166
147
  `;
167
- export const TimeItemActive = styled(TimeItem)`
148
+ exports.TimeItemActive = (0, styled_components_1.default)(exports.TimeItem) `
168
149
  background: ${(props) => props.theme.palette.primary.main};
169
150
  color: white;
170
151
  &:hover {
171
152
  background: ${(props) => props.theme.palette.primary.main};
172
153
  }
173
154
  `;
174
-
175
- export const NoValueButton = styled.button`
155
+ exports.NoValueButton = styled_components_1.default.button `
176
156
  font-weight: normal;
177
157
  font-size: 12px;
178
158
  color: ${(props) => props.theme.palette.text.secondary};
@@ -0,0 +1,53 @@
1
+ export declare const THIS_YEAR: number;
2
+ export declare const THIS_MONTH: number;
3
+ export declare const HOURS24: {
4
+ value: number;
5
+ label: string;
6
+ }[];
7
+ export declare const HOURS12: {
8
+ value: number;
9
+ label: string;
10
+ }[];
11
+ export declare const MINUTES: (string | number)[];
12
+ export declare const WEEK_DAYS: {
13
+ Sunday: string;
14
+ Monday: string;
15
+ Tuesday: string;
16
+ Wednesday: string;
17
+ Thursday: string;
18
+ Friday: string;
19
+ Saturday: string;
20
+ };
21
+ export type WeekDay = keyof typeof WEEK_DAYS;
22
+ export declare const CALENDAR_MONTHS: {
23
+ January: string;
24
+ February: string;
25
+ March: string;
26
+ April: string;
27
+ May: string;
28
+ June: string;
29
+ July: string;
30
+ August: string;
31
+ September: string;
32
+ October: string;
33
+ November: string;
34
+ December: string;
35
+ };
36
+ export declare const CALENDAR_WEEKS = 6;
37
+ export declare const zeroPad: (value: number, length: number) => string;
38
+ export declare const getMonthDays: (month?: number, year?: number) => 29 | 28 | 30 | 31;
39
+ export declare const getMonthFirstDay: (month?: number, year?: number) => number;
40
+ export declare const isDate: (date: Date) => boolean;
41
+ export declare const isSameMonth: (date: Date, basedate?: Date) => boolean;
42
+ export declare const isSameDay: (date: Date, basedate?: Date) => boolean;
43
+ export declare const getDateISO: (date: Date) => string | null;
44
+ export declare const getPreviousMonth: (month: number, year: number) => {
45
+ month: number;
46
+ year: number;
47
+ };
48
+ export declare const getNextMonth: (month: number, year: number) => {
49
+ month: number;
50
+ year: number;
51
+ };
52
+ declare const calendarBuilder: (month?: number, year?: number) => (string | number)[][];
53
+ export default calendarBuilder;
@@ -0,0 +1,181 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getNextMonth = exports.getPreviousMonth = exports.getDateISO = exports.isSameDay = exports.isSameMonth = exports.isDate = exports.getMonthFirstDay = exports.getMonthDays = exports.zeroPad = exports.CALENDAR_WEEKS = exports.CALENDAR_MONTHS = exports.WEEK_DAYS = exports.MINUTES = exports.HOURS12 = exports.HOURS24 = exports.THIS_MONTH = exports.THIS_YEAR = void 0;
4
+ // (int) The current year
5
+ exports.THIS_YEAR = +new Date().getFullYear();
6
+ // (int) The current month starting from 1 - 12
7
+ // 1 => January, 12 => December
8
+ exports.THIS_MONTH = +new Date().getMonth() + 1;
9
+ // Week days names and shortnames
10
+ exports.HOURS24 = [...new Array(24)].map((n, index) => {
11
+ return {
12
+ value: index,
13
+ label: index < 10 ? `0${index}` : `${index}`,
14
+ };
15
+ });
16
+ exports.HOURS12 = [
17
+ ...[...new Array(12)].map((n, index) => {
18
+ return {
19
+ value: index,
20
+ label: index < 10 ? `0${index} AM` : `${index} AM`,
21
+ };
22
+ }),
23
+ ...[...new Array(12)].map((n, index) => {
24
+ return {
25
+ value: index + 12,
26
+ label: index < 10 ? `0${index} PM` : `${index} PM`,
27
+ };
28
+ }),
29
+ ];
30
+ exports.MINUTES = new Array(60).fill(0).map((n, index) => {
31
+ return index < 10 ? `0${index}` : index;
32
+ });
33
+ exports.WEEK_DAYS = {
34
+ Sunday: "Su",
35
+ Monday: "Mo",
36
+ Tuesday: "Tu",
37
+ Wednesday: "We",
38
+ Thursday: "Th",
39
+ Friday: "Fr",
40
+ Saturday: "Sa",
41
+ };
42
+ // Calendar months names and short names
43
+ exports.CALENDAR_MONTHS = {
44
+ January: "Jan",
45
+ February: "Feb",
46
+ March: "Mar",
47
+ April: "Apr",
48
+ May: "May",
49
+ June: "Jun",
50
+ July: "Jul",
51
+ August: "Aug",
52
+ September: "Sep",
53
+ October: "Oct",
54
+ November: "Nov",
55
+ December: "Dec",
56
+ };
57
+ // Weeks displayed on calendar
58
+ exports.CALENDAR_WEEKS = 6;
59
+ // Pads a string value with leading zeroes(0) until length is reached
60
+ // For example: zeroPad(5, 2) => "05"
61
+ const zeroPad = (value, length) => {
62
+ return `${value}`.padStart(length, "0");
63
+ };
64
+ exports.zeroPad = zeroPad;
65
+ // (int) Number days in a month for a given year from 28 - 31
66
+ const getMonthDays = (month = exports.THIS_MONTH, year = exports.THIS_YEAR) => {
67
+ const months30 = [4, 6, 9, 11];
68
+ const leapYear = year % 4 === 0;
69
+ return month === 2
70
+ ? leapYear
71
+ ? 29
72
+ : 28
73
+ : months30.includes(month)
74
+ ? 30
75
+ : 31;
76
+ };
77
+ exports.getMonthDays = getMonthDays;
78
+ // (int) First day of the month for a given year from 1 - 7
79
+ // 1 => Sunday, 7 => Saturday
80
+ const getMonthFirstDay = (month = exports.THIS_MONTH, year = exports.THIS_YEAR) => {
81
+ return +new Date(`${year}-${(0, exports.zeroPad)(month, 2)}-01`).getDay() + 1;
82
+ };
83
+ exports.getMonthFirstDay = getMonthFirstDay;
84
+ // (bool) Checks if a value is a date - this is just a simple check
85
+ const isDate = (date) => {
86
+ const isDate = Object.prototype.toString.call(date) === "[object Date]";
87
+ const isValidDate = date && !Number.isNaN(date.valueOf());
88
+ return isDate && isValidDate;
89
+ };
90
+ exports.isDate = isDate;
91
+ // (bool) Checks if two date values are of the same month and year
92
+ const isSameMonth = (date, basedate = new Date()) => {
93
+ if (!((0, exports.isDate)(date) && (0, exports.isDate)(basedate)))
94
+ return false;
95
+ const basedateMonth = +basedate.getMonth() + 1;
96
+ const basedateYear = basedate.getFullYear();
97
+ const dateMonth = +date.getMonth() + 1;
98
+ const dateYear = date.getFullYear();
99
+ return +basedateMonth === +dateMonth && +basedateYear === +dateYear;
100
+ };
101
+ exports.isSameMonth = isSameMonth;
102
+ // (bool) Checks if two date values are the same day
103
+ const isSameDay = (date, basedate = new Date()) => {
104
+ if (!((0, exports.isDate)(date) && (0, exports.isDate)(basedate)))
105
+ return false;
106
+ const basedateDate = basedate.getDate();
107
+ const basedateMonth = +basedate.getMonth() + 1;
108
+ const basedateYear = basedate.getFullYear();
109
+ const dateDate = date.getDate();
110
+ const dateMonth = +date.getMonth() + 1;
111
+ const dateYear = date.getFullYear();
112
+ return (+basedateDate === +dateDate &&
113
+ +basedateMonth === +dateMonth &&
114
+ +basedateYear === +dateYear);
115
+ };
116
+ exports.isSameDay = isSameDay;
117
+ // (string) Formats the given date as YYYY-MM-DD
118
+ // Months and Days are zero padded
119
+ const getDateISO = (date) => {
120
+ if (!(0, exports.isDate)(date))
121
+ return null;
122
+ return [
123
+ date.getFullYear(),
124
+ (0, exports.zeroPad)(+date.getMonth() + 1, 2),
125
+ (0, exports.zeroPad)(+date.getDate(), 2),
126
+ ].join("-");
127
+ };
128
+ exports.getDateISO = getDateISO;
129
+ // ({month, year}) Gets the month and year before the given month and year
130
+ // For example: getPreviousMonth(1, 2000) => {month: 12, year: 1999}
131
+ // while: getPreviousMonth(12, 2000) => {month: 11, year: 2000}
132
+ const getPreviousMonth = (month, year) => {
133
+ const prevMonth = month > 1 ? month - 1 : 12;
134
+ const prevMonthYear = month > 1 ? year : year - 1;
135
+ return { month: prevMonth, year: prevMonthYear };
136
+ };
137
+ exports.getPreviousMonth = getPreviousMonth;
138
+ // ({month, year}) Gets the month and year after the given month and year
139
+ // For example: getNextMonth(1, 2000) => {month: 2, year: 2000}
140
+ // while: getNextMonth(12, 2000) => {month: 1, year: 2001}
141
+ const getNextMonth = (month, year) => {
142
+ const nextMonth = month < 12 ? month + 1 : 1;
143
+ const nextMonthYear = month < 12 ? year : year + 1;
144
+ return { month: nextMonth, year: nextMonthYear };
145
+ };
146
+ exports.getNextMonth = getNextMonth;
147
+ // Calendar builder for a month in the specified year
148
+ // Returns an array of the calendar dates.
149
+ // Each calendar date is represented as an array => [YYYY, MM, DD]
150
+ const calendarBuilder = (month = exports.THIS_MONTH, year = exports.THIS_YEAR) => {
151
+ // Get number of days in the month and the month's first day
152
+ const monthDays = (0, exports.getMonthDays)(month, year);
153
+ const monthFirstDay = (0, exports.getMonthFirstDay)(month, year);
154
+ // Get number of days to be displayed from previous and next months
155
+ // These ensure a total of 42 days (6 weeks) displayed on the calendar
156
+ const daysFromPrevMonth = monthFirstDay - 1;
157
+ const daysFromNextMonth = exports.CALENDAR_WEEKS * 7 - (daysFromPrevMonth + monthDays);
158
+ // Get the previous and next months and years
159
+ const { month: prevMonth, year: prevMonthYear } = (0, exports.getPreviousMonth)(month, year);
160
+ const { month: nextMonth, year: nextMonthYear } = (0, exports.getNextMonth)(month, year);
161
+ // Get number of days in previous month
162
+ const prevMonthDays = (0, exports.getMonthDays)(prevMonth, prevMonthYear);
163
+ // Builds dates to be displayed from previous month
164
+ const prevMonthDates = [...new Array(daysFromPrevMonth)].map((n, index) => {
165
+ const day = index + 1 + (prevMonthDays - daysFromPrevMonth);
166
+ return [prevMonthYear, (0, exports.zeroPad)(prevMonth, 2), (0, exports.zeroPad)(day, 2)];
167
+ });
168
+ // Builds dates to be displayed from current month
169
+ const thisMonthDates = [...new Array(monthDays)].map((n, index) => {
170
+ const day = index + 1;
171
+ return [year, (0, exports.zeroPad)(month, 2), (0, exports.zeroPad)(day, 2)];
172
+ });
173
+ // Builds dates to be displayed from next month
174
+ const nextMonthDates = [...new Array(daysFromNextMonth)].map((n, index) => {
175
+ const day = index + 1;
176
+ return [nextMonthYear, (0, exports.zeroPad)(nextMonth, 2), (0, exports.zeroPad)(day, 2)];
177
+ });
178
+ // Combines all dates from previous, current and next months
179
+ return [...prevMonthDates, ...thisMonthDates, ...nextMonthDates];
180
+ };
181
+ exports.default = calendarBuilder;
@@ -0,0 +1 @@
1
+ export { default } from "./Calendar";
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.default = void 0;
7
+ var Calendar_1 = require("./Calendar");
8
+ Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(Calendar_1).default; } });
@@ -0,0 +1,11 @@
1
+ import { CSSProperties } from "react";
2
+ interface CheckBoxProps {
3
+ className?: string;
4
+ defaultValue?: boolean;
5
+ value?: boolean;
6
+ partialCheck?: boolean;
7
+ onChange?: (value: boolean) => void;
8
+ style?: CSSProperties;
9
+ }
10
+ declare const CheckBox: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<CheckBoxProps, never>> & string & Omit<({ className, defaultValue, value, partialCheck, onChange, }: CheckBoxProps) => import("react/jsx-runtime").JSX.Element, keyof import("react").Component<any, {}, any>>;
11
+ export default CheckBox;
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const jsx_runtime_1 = require("react/jsx-runtime");
7
+ const styled_components_1 = __importDefault(require("styled-components"));
8
+ const react_1 = require("react");
9
+ const CheckBoxOutlineBlankOutlined_1 = __importDefault(require("@mui/icons-material/CheckBoxOutlineBlankOutlined"));
10
+ const IndeterminateCheckBox_1 = __importDefault(require("@mui/icons-material/IndeterminateCheckBox"));
11
+ const CheckBox_1 = __importDefault(require("@mui/icons-material/CheckBox"));
12
+ const CheckBox = (0, styled_components_1.default)(({ className, defaultValue = false, value = false, partialCheck = false, onChange = () => { }, }) => {
13
+ const [checkedState, setCheckedState] = (0, react_1.useState)(defaultValue);
14
+ const handleChange = (e) => {
15
+ e.stopPropagation();
16
+ setCheckedState(!checkedState);
17
+ onChange(!checkedState);
18
+ };
19
+ (0, react_1.useEffect)(() => {
20
+ setCheckedState(value);
21
+ }, [value]);
22
+ const _checked = value === undefined ? checkedState : value;
23
+ return ((0, jsx_runtime_1.jsx)("div", { className: className, onClick: handleChange, children: partialCheck === true ? ((0, jsx_runtime_1.jsx)(IndeterminateCheckBox_1.default, { className: "checkbox partial" })) : _checked === true ? ((0, jsx_runtime_1.jsx)(CheckBox_1.default, { className: "checkbox checked" })) : ((0, jsx_runtime_1.jsx)(CheckBoxOutlineBlankOutlined_1.default, { className: "checkbox unchecked" })) }));
24
+ }) `
25
+ display: flex;
26
+ align-items: center;
27
+ cursor: pointer;
28
+
29
+ .checkbox {
30
+ color: ${(props) => props.theme.palette.primary.main};
31
+ font-size: 16px;
32
+ }
33
+ `;
34
+ exports.default = CheckBox;
@@ -0,0 +1 @@
1
+ export { default } from "./CheckBox";
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.default = void 0;
7
+ var CheckBox_1 = require("./CheckBox");
8
+ Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(CheckBox_1).default; } });
@@ -0,0 +1,24 @@
1
+ import React from "react";
2
+ import { Size, Variant } from "../core";
3
+ interface DateInputProps {
4
+ className?: string;
5
+ defaultValue?: string | null;
6
+ format?: string;
7
+ label?: string;
8
+ description?: string;
9
+ arrow?: boolean;
10
+ size?: Size;
11
+ variant?: Variant;
12
+ clearable?: boolean;
13
+ required?: boolean;
14
+ onChange?: (value: string | null) => void;
15
+ min?: Date;
16
+ max?: Date;
17
+ error?: string;
18
+ width?: string;
19
+ enableCalendar?: boolean;
20
+ utc?: boolean;
21
+ closeOnSelect?: boolean;
22
+ }
23
+ declare const DateInput: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<DateInputProps, never>> & string & Omit<({ className, defaultValue, format, label, description, arrow, size, variant, clearable, required, onChange, min, max, error, enableCalendar, utc, closeOnSelect, }: DateInputProps) => import("react/jsx-runtime").JSX.Element, keyof React.Component<any, {}, any>>;
24
+ export default DateInput;