@monolith-forensics/monolith-ui 1.7.1 → 1.8.1-dev.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 (176) hide show
  1. package/dist/BarChart/BarChart.d.ts +3 -0
  2. package/dist/BarChart/BarChart.js +511 -0
  3. package/dist/BarChart/BarChart.lib.d.ts +31 -0
  4. package/dist/BarChart/BarChart.lib.js +136 -0
  5. package/dist/BarChart/BarChart.styled.d.ts +49 -0
  6. package/dist/BarChart/BarChart.styled.js +111 -0
  7. package/dist/BarChart/BarChart.types.d.ts +170 -0
  8. package/dist/BarChart/BarChart.types.js +1 -0
  9. package/dist/BarChart/index.d.ts +3 -0
  10. package/dist/BarChart/index.js +2 -0
  11. package/dist/Button/Button.js +9 -58
  12. package/dist/Calendar/Calendar.d.ts +3 -1
  13. package/dist/Calendar/Calendar.js +134 -33
  14. package/dist/Calendar/CalendarStyles.d.ts +3 -0
  15. package/dist/Calendar/CalendarStyles.js +92 -14
  16. package/dist/Calendar/calendarHelpers.d.ts +5 -1
  17. package/dist/Calendar/calendarHelpers.js +13 -5
  18. package/dist/ChartPrimitives/chartLegend.styled.d.ts +12 -0
  19. package/dist/ChartPrimitives/chartLegend.styled.js +52 -0
  20. package/dist/ChartPrimitives/chartTooltip.styled.d.ts +19 -0
  21. package/dist/ChartPrimitives/chartTooltip.styled.js +61 -0
  22. package/dist/ChartPrimitives/index.d.ts +2 -0
  23. package/dist/ChartPrimitives/index.js +2 -0
  24. package/dist/ChartUtils/chartColors.d.ts +8 -0
  25. package/dist/ChartUtils/chartColors.js +65 -0
  26. package/dist/ChartUtils/chartMath.d.ts +3 -0
  27. package/dist/ChartUtils/chartMath.js +3 -0
  28. package/dist/ChartUtils/index.d.ts +2 -0
  29. package/dist/ChartUtils/index.js +2 -0
  30. package/dist/Charts/BarChart/BarChart.d.ts +5 -0
  31. package/dist/Charts/BarChart/BarChart.js +549 -0
  32. package/dist/Charts/BarChart/BarChart.lib.d.ts +31 -0
  33. package/dist/Charts/BarChart/BarChart.lib.js +136 -0
  34. package/dist/Charts/BarChart/BarChart.styled.d.ts +51 -0
  35. package/dist/Charts/BarChart/BarChart.styled.js +115 -0
  36. package/dist/Charts/BarChart/BarChart.types.d.ts +171 -0
  37. package/dist/Charts/BarChart/BarChart.types.js +1 -0
  38. package/dist/Charts/BarChart/index.d.ts +3 -0
  39. package/dist/Charts/BarChart/index.js +2 -0
  40. package/dist/Charts/ChartPrimitives/ChartExportControl.d.ts +11 -0
  41. package/dist/Charts/ChartPrimitives/ChartExportControl.js +29 -0
  42. package/dist/Charts/ChartPrimitives/chartActions.styled.d.ts +1 -0
  43. package/dist/Charts/ChartPrimitives/chartActions.styled.js +8 -0
  44. package/dist/Charts/ChartPrimitives/chartLegend.styled.d.ts +12 -0
  45. package/dist/Charts/ChartPrimitives/chartLegend.styled.js +52 -0
  46. package/dist/Charts/ChartPrimitives/chartTooltip.styled.d.ts +19 -0
  47. package/dist/Charts/ChartPrimitives/chartTooltip.styled.js +61 -0
  48. package/dist/Charts/ChartPrimitives/index.d.ts +4 -0
  49. package/dist/Charts/ChartPrimitives/index.js +4 -0
  50. package/dist/Charts/ChartUtils/chartColors.d.ts +8 -0
  51. package/dist/Charts/ChartUtils/chartColors.js +65 -0
  52. package/dist/Charts/ChartUtils/chartExport.d.ts +47 -0
  53. package/dist/Charts/ChartUtils/chartExport.js +311 -0
  54. package/dist/Charts/ChartUtils/chartMath.d.ts +3 -0
  55. package/dist/Charts/ChartUtils/chartMath.js +3 -0
  56. package/dist/Charts/ChartUtils/index.d.ts +3 -0
  57. package/dist/Charts/ChartUtils/index.js +3 -0
  58. package/dist/Charts/HeatMap/HeatMap.d.ts +5 -0
  59. package/dist/Charts/HeatMap/HeatMap.js +212 -0
  60. package/dist/Charts/HeatMap/HeatMap.lib.d.ts +30 -0
  61. package/dist/Charts/HeatMap/HeatMap.lib.js +115 -0
  62. package/dist/Charts/HeatMap/HeatMap.styled.d.ts +37 -0
  63. package/dist/Charts/HeatMap/HeatMap.styled.js +91 -0
  64. package/dist/Charts/HeatMap/HeatMap.types.d.ts +80 -0
  65. package/dist/Charts/HeatMap/HeatMap.types.js +1 -0
  66. package/dist/Charts/HeatMap/index.d.ts +3 -0
  67. package/dist/Charts/HeatMap/index.js +2 -0
  68. package/dist/Charts/LineChart/LineChart.d.ts +5 -0
  69. package/dist/Charts/LineChart/LineChart.js +529 -0
  70. package/dist/Charts/LineChart/LineChart.lib.d.ts +24 -0
  71. package/dist/Charts/LineChart/LineChart.lib.js +132 -0
  72. package/dist/Charts/LineChart/LineChart.styled.d.ts +59 -0
  73. package/dist/Charts/LineChart/LineChart.styled.js +147 -0
  74. package/dist/Charts/LineChart/LineChart.types.d.ts +193 -0
  75. package/dist/Charts/LineChart/LineChart.types.js +1 -0
  76. package/dist/Charts/LineChart/index.d.ts +3 -0
  77. package/dist/Charts/LineChart/index.js +2 -0
  78. package/dist/Charts/PieChart/PieChart.d.ts +4 -0
  79. package/dist/Charts/PieChart/PieChart.js +199 -0
  80. package/dist/Charts/PieChart/PieChart.lib.d.ts +5 -0
  81. package/dist/Charts/PieChart/PieChart.lib.js +19 -0
  82. package/dist/Charts/PieChart/PieChart.styled.d.ts +51 -0
  83. package/dist/Charts/PieChart/PieChart.styled.js +163 -0
  84. package/dist/Charts/PieChart/PieChart.types.d.ts +100 -0
  85. package/dist/Charts/PieChart/PieChart.types.js +1 -0
  86. package/dist/Charts/PieChart/index.d.ts +2 -0
  87. package/dist/Charts/PieChart/index.js +1 -0
  88. package/dist/Charts/index.d.ts +5 -0
  89. package/dist/Charts/index.js +4 -0
  90. package/dist/CheckBox/CheckBox.js +2 -16
  91. package/dist/DateInput/DateInput.js +198 -143
  92. package/dist/DropDownMenu/components/MenuComponent.js +2 -1
  93. package/dist/DropDownMenu/components/MenuItem.js +5 -14
  94. package/dist/DropDownMenu/components/MenuItemList.js +7 -24
  95. package/dist/DropDownMenu/components/StyledFloatContainer.js +1 -1
  96. package/dist/FieldLabel/FieldLabel.js +4 -12
  97. package/dist/FileInputField/FileInputField.js +4 -23
  98. package/dist/FormSection/FormSection.js +5 -25
  99. package/dist/HeatMap/HeatMap.d.ts +3 -0
  100. package/dist/HeatMap/HeatMap.js +174 -0
  101. package/dist/HeatMap/HeatMap.lib.d.ts +30 -0
  102. package/dist/HeatMap/HeatMap.lib.js +115 -0
  103. package/dist/HeatMap/HeatMap.styled.d.ts +34 -0
  104. package/dist/HeatMap/HeatMap.styled.js +83 -0
  105. package/dist/HeatMap/HeatMap.types.d.ts +79 -0
  106. package/dist/HeatMap/HeatMap.types.js +1 -0
  107. package/dist/HeatMap/index.d.ts +3 -0
  108. package/dist/HeatMap/index.js +2 -0
  109. package/dist/IconButton/IconButton.js +2 -16
  110. package/dist/Input/Input.js +7 -56
  111. package/dist/LineChart/LineChart.d.ts +3 -0
  112. package/dist/LineChart/LineChart.js +491 -0
  113. package/dist/LineChart/LineChart.lib.d.ts +24 -0
  114. package/dist/LineChart/LineChart.lib.js +132 -0
  115. package/dist/LineChart/LineChart.styled.d.ts +57 -0
  116. package/dist/LineChart/LineChart.styled.js +150 -0
  117. package/dist/LineChart/LineChart.types.d.ts +192 -0
  118. package/dist/LineChart/LineChart.types.js +1 -0
  119. package/dist/LineChart/index.d.ts +3 -0
  120. package/dist/LineChart/index.js +2 -0
  121. package/dist/PieChart/PieChart.d.ts +2 -0
  122. package/dist/PieChart/PieChart.js +161 -0
  123. package/dist/PieChart/PieChart.lib.d.ts +5 -0
  124. package/dist/PieChart/PieChart.lib.js +19 -0
  125. package/dist/PieChart/PieChart.styled.d.ts +49 -0
  126. package/dist/PieChart/PieChart.styled.js +161 -0
  127. package/dist/PieChart/PieChart.types.d.ts +99 -0
  128. package/dist/PieChart/PieChart.types.js +1 -0
  129. package/dist/PieChart/index.d.ts +2 -0
  130. package/dist/PieChart/index.js +1 -0
  131. package/dist/Pill/Pill.js +8 -79
  132. package/dist/Popover/Popover.context.d.ts +2 -1
  133. package/dist/Popover/Popover.js +5 -2
  134. package/dist/Popover/Popover.styles.d.ts +1 -6
  135. package/dist/Popover/Popover.styles.js +11 -28
  136. package/dist/Popover/Popover.transitions.d.ts +4 -2
  137. package/dist/Popover/Popover.transitions.js +23 -49
  138. package/dist/Popover/PopoverDropdown.js +6 -8
  139. package/dist/Popover/PopoverTarget.js +6 -3
  140. package/dist/SegmentedControl/SegmentedControl.utils.d.ts +2 -2
  141. package/dist/SegmentedControl/SegmentedControl.utils.js +3 -30
  142. package/dist/SelectBox/SelectBox.js +3 -3
  143. package/dist/SelectBox/select-box.styled-components.d.ts +3 -1
  144. package/dist/SelectBox/select-box.styled-components.js +10 -48
  145. package/dist/SuperDatePicker/SuperDatePicker.d.ts +74 -0
  146. package/dist/SuperDatePicker/SuperDatePicker.js +557 -0
  147. package/dist/SuperDatePicker/index.d.ts +2 -0
  148. package/dist/SuperDatePicker/index.js +2 -0
  149. package/dist/Switch/Switch.d.ts +2 -2
  150. package/dist/Switch/Switch.js +18 -83
  151. package/dist/Table/StateStorage.d.ts +4 -0
  152. package/dist/Table/StateStorage.js +13 -0
  153. package/dist/Table/Table.js +160 -12
  154. package/dist/Table/TableComponents.d.ts +10 -0
  155. package/dist/Table/TableComponents.js +57 -0
  156. package/dist/Table/TableDefaults.d.ts +7 -0
  157. package/dist/Table/TableDefaults.js +7 -0
  158. package/dist/Table/TableProvider.js +263 -71
  159. package/dist/Table/TableRow.js +15 -10
  160. package/dist/Table/types.d.ts +64 -0
  161. package/dist/Tabs/Tab.js +8 -0
  162. package/dist/TagBox/TagBox.js +18 -76
  163. package/dist/TextArea/TextArea.js +4 -23
  164. package/dist/TextInput/TextInput.js +12 -6
  165. package/dist/Utilities/parseTimestamp.js +11 -6
  166. package/dist/core/ArrowButton.d.ts +2 -0
  167. package/dist/core/ArrowButton.js +7 -3
  168. package/dist/core/ClearButton.d.ts +2 -0
  169. package/dist/core/ClearButton.js +7 -3
  170. package/dist/core/controlSizes.d.ts +34 -0
  171. package/dist/core/controlSizes.js +190 -0
  172. package/dist/core/index.d.ts +1 -0
  173. package/dist/core/index.js +1 -0
  174. package/dist/index.d.ts +1 -0
  175. package/dist/index.js +1 -0
  176. package/package.json +5 -1
@@ -14,7 +14,7 @@ import styled from "styled-components";
14
14
  import { useFloating, flip, offset, autoUpdate, FloatingPortal, } from "@floating-ui/react";
15
15
  import { useCallback, useEffect, useRef, useState, } from "react";
16
16
  import { Input, Tooltip, FieldLabel, Pill, Loader } from "..";
17
- import { ArrowButton, ClearButton, StyledFloatContainer, StyledContent, } from "../core";
17
+ import { ArrowButton, ClearButton, StyledFloatContainer, StyledContent, getControlSizeTokens, } from "../core";
18
18
  const StyledInputContainer = styled.div `
19
19
  position: relative;
20
20
  cursor: pointer;
@@ -29,17 +29,7 @@ const StyledInputContainer = styled.div `
29
29
  pointer-events: all;
30
30
  outline: none;
31
31
 
32
- padding: ${({ size }) => size === "xs"
33
- ? "2px 8px"
34
- : size === "sm"
35
- ? "4px 10px"
36
- : size === "md"
37
- ? "6px 12px"
38
- : size === "lg"
39
- ? "7px 14px"
40
- : size === "xl"
41
- ? "8px 16px"
42
- : "4px 10px"};
32
+ padding: ${({ size }) => `0px ${getControlSizeTokens(size).inputPaddingX}px`};
43
33
 
44
34
  border-radius: 5px;
45
35
  transition: border 0.1s ease-in-out;
@@ -58,33 +48,13 @@ const StyledInputContainer = styled.div `
58
48
  }};
59
49
  font-weight: 500;
60
50
  color: ${(props) => props.theme.palette.text.primary};
61
- font-size: ${({ size }) => size === "xs"
62
- ? "12px"
63
- : size === "sm"
64
- ? "14px"
65
- : size === "md"
66
- ? "16px"
67
- : size === "lg"
68
- ? "18px"
69
- : size === "xl"
70
- ? "20px"
71
- : "12px"};
51
+ font-size: ${({ size }) => `${getControlSizeTokens(size).fontSize}px`};
72
52
 
73
53
  width: 100%;
74
- min-height: ${({ size }) => size === "xs"
75
- ? "26px"
76
- : size === "sm"
77
- ? "30px"
78
- : size === "md"
79
- ? "36px"
80
- : size === "lg"
81
- ? "42px"
82
- : size === "xl"
83
- ? "50px"
84
- : "26px"};
54
+ min-height: ${({ size }) => `${getControlSizeTokens(size).height}px`};
85
55
 
86
56
  &[data-button-right="true"] {
87
- padding-right: 36px;
57
+ padding-right: ${({ size }) => `${getControlSizeTokens(size).adornmentWidth}px`};
88
58
  }
89
59
 
90
60
  background-color: ${({ theme, variant }) => {
@@ -199,17 +169,8 @@ const GroupTitle = styled((_a) => {
199
169
 
200
170
  color: ${(props) => props.theme.palette.text.secondary};
201
171
 
202
- padding: ${({ size }) => size === "xs"
203
- ? "2px 8px"
204
- : size === "sm"
205
- ? "4px 10px"
206
- : size === "md"
207
- ? "4px 12px"
208
- : size === "lg"
209
- ? "5px 14px"
210
- : size === "xl"
211
- ? "6px 16px"
212
- : "2px 8px"};
172
+ min-height: ${({ size }) => `${getControlSizeTokens(size).menuRowHeight}px`};
173
+ padding: ${({ size }) => `0px ${getControlSizeTokens(size).menuItemPaddingX}px`};
213
174
 
214
175
  .group-label {
215
176
  white-space: nowrap;
@@ -220,17 +181,7 @@ const GroupTitle = styled((_a) => {
220
181
 
221
182
  font-weight: 500;
222
183
 
223
- font-size: ${({ size }) => size === "xs"
224
- ? "11px"
225
- : size === "sm"
226
- ? "13px"
227
- : size === "md"
228
- ? "15px"
229
- : size === "lg"
230
- ? "17px"
231
- : size === "xl"
232
- ? "19px"
233
- : "11px"};
184
+ font-size: ${({ size }) => `${getControlSizeTokens(size).menuGroupFontSize}px`};
234
185
  }
235
186
 
236
187
  .group-line {
@@ -241,7 +192,7 @@ const GroupTitle = styled((_a) => {
241
192
  const PillContainer = styled.div `
242
193
  display: flex;
243
194
  align-items: center;
244
- gap: 5px;
195
+ gap: ${({ size }) => `${getControlSizeTokens(size).iconGap}px`};
245
196
  flex-wrap: wrap;
246
197
  flex-grow: 1;
247
198
 
@@ -255,7 +206,7 @@ const StyledInnerContainer = styled.div `
255
206
  width: 100%;
256
207
 
257
208
  &[data-button-right="true"] {
258
- padding-right: 30px;
209
+ padding-right: ${({ size }) => `${getControlSizeTokens(size).adornmentWidth}px`};
259
210
  }
260
211
  `;
261
212
  const StyledItem = styled.div `
@@ -264,26 +215,17 @@ const StyledItem = styled.div `
264
215
  border-radius: 3px;
265
216
  display: flex;
266
217
  align-items: center;
267
- min-height: 25px;
268
- padding: 7px 10px;
218
+ min-height: ${({ size }) => `${getControlSizeTokens(size).menuRowHeight}px`};
219
+ height: ${({ size }) => `${getControlSizeTokens(size).menuRowHeight}px`};
269
220
  position: relative;
270
221
  user-select: none;
271
222
  outline: none;
272
223
 
273
224
  cursor: pointer;
274
225
 
275
- font-family: "Arial", sans-serif;
276
- font-size: ${({ size }) => size === "xs"
277
- ? "11px"
278
- : size === "sm"
279
- ? "13px"
280
- : size === "md"
281
- ? "15px"
282
- : size === "lg"
283
- ? "17px"
284
- : size === "xl"
285
- ? "19px"
286
- : "11px"};
226
+ font-family: ${({ theme }) => theme.typography.fontFamily};
227
+ font-size: ${({ size }) => `${getControlSizeTokens(size).fontSize}px`};
228
+ padding: ${({ size }) => `0px ${getControlSizeTokens(size).menuItemPaddingX}px`};
287
229
 
288
230
  &:hover {
289
231
  background-color: ${(props) => props.theme.palette.action.hover};
@@ -642,7 +584,7 @@ const TagBox = styled(({ className, data = [], placeholder = "Select tags", arro
642
584
  return (_jsxs("div", { className: className + " mfTagBox", children: [label && (_jsx(FieldLabel, { error: error, asterisk: required, size: size, description: description, children: label })), _jsxs(StyledInputContainer, { className: "styledInputContainer", ref: refs.setReference, onMouseDown: () => {
643
585
  setIsOpen(true);
644
586
  handleFocus();
645
- }, onFocus: handleFocus, size: size, variant: variant, onKeyDown: handleKeyDown, "data-open": isOpen, "data-disabled": disabled, tabIndex: 0, children: [_jsx(StyledInnerContainer, { size: size, "data-button-right": arrow || clearable, children: _jsxs(PillContainer, { size: size, children: [_value === null || _value === void 0 ? void 0 : _value.map((item, index) => (_jsx(Pill, { size: "xs", onRemove: () => handleRemoveItem(item), children: (renderTag === null || renderTag === void 0 ? void 0 : renderTag(item)) || _jsx(_Fragment, { children: item === null || item === void 0 ? void 0 : item.label }) }, index))), (searchable || allowCustomValue || (_value === null || _value === void 0 ? void 0 : _value.length) === 0) && (_jsx(StyledInput, { inputRef: inputRef, onChange: (e) => {
587
+ }, onFocus: handleFocus, size: size, variant: variant, onKeyDown: handleKeyDown, "data-open": isOpen, "data-disabled": disabled, tabIndex: 0, children: [_jsx(StyledInnerContainer, { size: size, "data-button-right": arrow || clearable, children: _jsxs(PillContainer, { size: size, children: [_value === null || _value === void 0 ? void 0 : _value.map((item, index) => (_jsx(Pill, { size: size, onRemove: () => handleRemoveItem(item), children: (renderTag === null || renderTag === void 0 ? void 0 : renderTag(item)) || _jsx(_Fragment, { children: item === null || item === void 0 ? void 0 : item.label }) }, index))), (searchable || allowCustomValue || (_value === null || _value === void 0 ? void 0 : _value.length) === 0) && (_jsx(StyledInput, { inputRef: inputRef, onChange: (e) => {
646
588
  if (searchFn !== undefined) {
647
589
  searchFn === null || searchFn === void 0 ? void 0 : searchFn(e.target.value);
648
590
  }
@@ -651,10 +593,10 @@ const TagBox = styled(({ className, data = [], placeholder = "Select tags", arro
651
593
  }
652
594
  update();
653
595
  }, placeholder: placeholder, size: size, readOnly: !(searchable || allowCustomValue), "data-disabled": disabled }))] }) }), clearable &&
654
- (((_f = _value === null || _value === void 0 ? void 0 : _value.length) !== null && _f !== void 0 ? _f : 0) > 0 || !!((_g = inputRef === null || inputRef === void 0 ? void 0 : inputRef.current) === null || _g === void 0 ? void 0 : _g.value)) ? (_jsx(ClearButton, { onClick: handleClear, onMouseDown: (e) => {
596
+ (((_f = _value === null || _value === void 0 ? void 0 : _value.length) !== null && _f !== void 0 ? _f : 0) > 0 || !!((_g = inputRef === null || inputRef === void 0 ? void 0 : inputRef.current) === null || _g === void 0 ? void 0 : _g.value)) ? (_jsx(ClearButton, { size: size, onClick: handleClear, onMouseDown: (e) => {
655
597
  e.preventDefault();
656
598
  e.stopPropagation();
657
- } })) : arrow ? (_jsx(ArrowButton, { onClick: (e) => {
599
+ } })) : arrow ? (_jsx(ArrowButton, { size: size, onClick: (e) => {
658
600
  e.preventDefault();
659
601
  }, onMouseDown: (e) => {
660
602
  e.preventDefault();
@@ -1,26 +1,17 @@
1
1
  import styled from "styled-components";
2
2
  import TextareaAutosize from "react-textarea-autosize";
3
+ import { getControlSizeTokens } from "../core";
3
4
  const TextArea = styled(TextareaAutosize) `
4
5
  outline: none;
5
6
  resize: none;
6
- padding: 10px;
7
+ padding: ${({ size }) => `${getControlSizeTokens(size).inputPaddingX}px`};
7
8
  width: 100%;
8
9
  height: 100%;
9
10
  box-sizing: border-box;
10
11
 
11
12
  font-family: ${({ theme }) => theme.typography.fontFamily};
12
13
  color: ${(props) => props.theme.palette.text.primary};
13
- font-size: ${({ size }) => size === "xs"
14
- ? "11px"
15
- : size === "sm"
16
- ? "13px"
17
- : size === "md"
18
- ? "15px"
19
- : size === "lg"
20
- ? "17px"
21
- : size === "xl"
22
- ? "19px"
23
- : "13px"};
14
+ font-size: ${({ size }) => `${getControlSizeTokens(size).fontSize}px`};
24
15
 
25
16
  background-color: ${({ theme, variant }) => {
26
17
  switch (variant) {
@@ -60,17 +51,7 @@ const TextArea = styled(TextareaAutosize) `
60
51
  }
61
52
 
62
53
  ::placeholder {
63
- font-size: ${({ size }) => size === "xs"
64
- ? "10px"
65
- : size === "sm"
66
- ? "12px"
67
- : size === "md"
68
- ? "14px"
69
- : size === "lg"
70
- ? "16px"
71
- : size === "xl"
72
- ? "18px"
73
- : "12px"};
54
+ font-size: ${({ size }) => `${getControlSizeTokens(size).placeholderFontSize}px`};
74
55
  }
75
56
  `;
76
57
  export default TextArea;
@@ -13,6 +13,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
13
  import styled from "styled-components";
14
14
  import { FieldLabel } from "..";
15
15
  import Input from "../Input/Input";
16
+ import { getControlSizeTokens } from "../core";
16
17
  import { forwardRef, useState } from "react";
17
18
  import { Eye, EyeOff, X } from "lucide-react";
18
19
  const StyledContainer = styled.div `
@@ -35,7 +36,9 @@ const InputContainer = styled.div `
35
36
  `;
36
37
  const InputButton = styled.button `
37
38
  position: absolute;
38
- right: 8px;
39
+ right: 0;
40
+ width: ${({ size }) => `${getControlSizeTokens(size).adornmentWidth}px`};
41
+ height: 100%;
39
42
  background: none;
40
43
  border: none;
41
44
  cursor: pointer;
@@ -58,8 +61,8 @@ const InputButton = styled.button `
58
61
  }
59
62
 
60
63
  svg {
61
- width: 16px;
62
- height: 16px;
64
+ width: ${({ size }) => `${getControlSizeTokens(size).iconSize}px`};
65
+ height: ${({ size }) => `${getControlSizeTokens(size).iconSize}px`};
63
66
  }
64
67
  `;
65
68
  export const TextInput = forwardRef((_a, ref) => {
@@ -77,11 +80,14 @@ export const TextInput = forwardRef((_a, ref) => {
77
80
  };
78
81
  // Enhanced features: password or clearable functionality
79
82
  const inputType = password && !passwordVisible ? "password" : type || "text";
80
- const inputStyle = Object.assign(Object.assign({}, style), (password || (clearable && value) ? { paddingRight: "36px" } : {}));
81
- return (_jsxs(StyledContainer, { className: className, colSpan: colSpan, children: [label && (_jsx(FieldLabel, { error: error, asterisk: required, size: size, description: description, children: label })), _jsxs(InputContainer, { children: [_jsx(Input, Object.assign({ ref: ref, value: value, size: size, type: inputType, style: inputStyle }, inputProps, rest)), password ? (_jsx(InputButton, { onClick: handlePasswordToggle, onMouseDown: (e) => {
83
+ const adornmentWidth = getControlSizeTokens(size).adornmentWidth;
84
+ const inputStyle = Object.assign(Object.assign({}, style), (password || (clearable && value)
85
+ ? { paddingRight: `${adornmentWidth}px` }
86
+ : {}));
87
+ return (_jsxs(StyledContainer, { className: className, colSpan: colSpan, children: [label && (_jsx(FieldLabel, { error: error, asterisk: required, size: size, description: description, children: label })), _jsxs(InputContainer, { children: [_jsx(Input, Object.assign({ ref: ref, value: value, size: size, type: inputType, style: inputStyle }, inputProps, rest)), password ? (_jsx(InputButton, { size: size, onClick: handlePasswordToggle, onMouseDown: (e) => {
82
88
  e.preventDefault();
83
89
  e.stopPropagation();
84
- }, tabIndex: -1, type: "button", children: passwordVisible ? _jsx(Eye, {}) : _jsx(EyeOff, {}) })) : clearable && value ? (_jsx(InputButton, { onClick: handleClear, onMouseDown: (e) => {
90
+ }, tabIndex: -1, type: "button", children: passwordVisible ? _jsx(Eye, {}) : _jsx(EyeOff, {}) })) : clearable && value ? (_jsx(InputButton, { size: size, onClick: handleClear, onMouseDown: (e) => {
85
91
  e.preventDefault();
86
92
  e.stopPropagation();
87
93
  }, tabIndex: -1, type: "button", children: _jsx(X, {}) })) : null] })] }));
@@ -7,6 +7,7 @@ import moment from "moment";
7
7
  // When `timestamp` is empty, segment values fall back to placeholders so the
8
8
  // DateInput can still render an editable structure.
9
9
  export default function parseTimestamp(timestamp, format, utc = false) {
10
+ var _a;
10
11
  // Supported format tokens and how each token maps to a segment type.
11
12
  // `momentType` is used by consumers that need to know which unit the
12
13
  // segment represents in Moment's terminology.
@@ -40,7 +41,7 @@ export default function parseTimestamp(timestamp, format, utc = false) {
40
41
  // Break the format into ordered parts while keeping separators.
41
42
  // Example: "MM/DD/YYYY HH:mm" => ["MM", "/", "DD", "/", "YYYY", " ", "HH", ":", "mm"]
42
43
  function splitFormat(format) {
43
- return format.split(/(YYYY|MM|DD|HH|h|mm|ss|SSS|Z)/).filter((s) => s);
44
+ return format.split(/(YYYY|MM|DD|HH|h|mm|ss|SSS|A|Z)/).filter((s) => s);
44
45
  }
45
46
  // Convert each format part into a known token descriptor.
46
47
  // Unknown parts are treated as literal separators.
@@ -57,15 +58,19 @@ export default function parseTimestamp(timestamp, format, utc = false) {
57
58
  index: -1,
58
59
  };
59
60
  }
61
+ const parsedTimestamp = timestamp
62
+ ? utc === true
63
+ ? moment.utc(timestamp)
64
+ : moment(timestamp)
65
+ : null;
66
+ const hasValidTimestamp = (_a = parsedTimestamp === null || parsedTimestamp === void 0 ? void 0 : parsedTimestamp.isValid()) !== null && _a !== void 0 ? _a : false;
60
67
  // Build the final Segment[] in format order.
61
68
  // For date/time tokens, format the timestamp using local or UTC mode.
62
- // For separators (or empty timestamp), use the placeholder as the value.
69
+ // For separators (or empty/invalid timestamps), use the placeholder as the value.
63
70
  const segments = splitFormat(format).map((segment, i) => {
64
71
  const { pattern, placeholder, type, momentType } = matchSegment(segment);
65
- const value = timestamp
66
- ? utc === true
67
- ? moment.utc(timestamp).format(pattern)
68
- : moment(timestamp).format(pattern)
72
+ const value = hasValidTimestamp && parsedTimestamp
73
+ ? parsedTimestamp.format(pattern)
69
74
  : placeholder;
70
75
  return {
71
76
  value,
@@ -1,5 +1,7 @@
1
+ import Size from "./Types/Size";
1
2
  interface ArrowButtonProps {
2
3
  className?: string;
4
+ size?: Size;
3
5
  [key: string]: React.ButtonHTMLAttributes<HTMLButtonElement> | any;
4
6
  }
5
7
  declare const ArrowButton: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<ArrowButtonProps, never>> & string & Omit<({ className, ...props }: ArrowButtonProps) => import("react/jsx-runtime").JSX.Element, keyof import("react").Component<any, {}, any>>;
@@ -12,9 +12,10 @@ var __rest = (this && this.__rest) || function (s, e) {
12
12
  import { jsx as _jsx } from "react/jsx-runtime";
13
13
  import { ChevronDownIcon } from "lucide-react";
14
14
  import styled from "styled-components";
15
+ import { DEFAULT_CONTROL_SIZE, getControlSizeTokens } from "./controlSizes";
15
16
  const ArrowIcon = styled((_a) => {
16
17
  var { className } = _a, props = __rest(_a, ["className"]);
17
- return (_jsx("div", Object.assign({ className: className }, props, { children: _jsx(ChevronDownIcon, { size: 16 }) })));
18
+ return (_jsx("div", Object.assign({ className: className }, props, { children: _jsx(ChevronDownIcon, { size: getControlSizeTokens(props.size).iconSize }) })));
18
19
  }) `
19
20
  color: ${(props) => props.theme.palette.text.secondary};
20
21
  transition: transform 0.2s ease-in-out;
@@ -28,16 +29,19 @@ const ArrowIcon = styled((_a) => {
28
29
  `;
29
30
  const ArrowButton = styled((_a) => {
30
31
  var { className } = _a, props = __rest(_a, ["className"]);
31
- return (_jsx("button", Object.assign({ className: className }, props, { tabIndex: -1, "data-default-btn": true, children: _jsx(ArrowIcon, {}) })));
32
+ return (_jsx("button", Object.assign({ className: className }, props, { tabIndex: -1, "data-default-btn": true, children: _jsx(ArrowIcon, { size: props.size }) })));
32
33
  }) `
33
34
  position: absolute;
34
35
  right: 0;
35
36
  height: 100%;
36
- padding-inline: 10px;
37
+ width: ${({ size = DEFAULT_CONTROL_SIZE }) => `${getControlSizeTokens(size).adornmentWidth}px`};
37
38
  background: none;
38
39
  border: none;
39
40
  cursor: pointer;
40
41
  margin: 0;
41
42
  outline: none;
43
+ display: flex;
44
+ align-items: center;
45
+ justify-content: center;
42
46
  `;
43
47
  export default ArrowButton;
@@ -1,5 +1,7 @@
1
+ import Size from "./Types/Size";
1
2
  interface ClearButtonProps {
2
3
  className?: string;
4
+ size?: Size;
3
5
  [key: string]: React.ButtonHTMLAttributes<HTMLButtonElement> | any;
4
6
  }
5
7
  declare const ClearButton: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<ClearButtonProps, never>> & string & Omit<({ className, ...props }: ClearButtonProps) => import("react/jsx-runtime").JSX.Element, keyof import("react").Component<any, {}, any>>;
@@ -12,9 +12,10 @@ var __rest = (this && this.__rest) || function (s, e) {
12
12
  import { jsx as _jsx } from "react/jsx-runtime";
13
13
  import { X } from "lucide-react";
14
14
  import styled from "styled-components";
15
+ import { DEFAULT_CONTROL_SIZE, getControlSizeTokens } from "./controlSizes";
15
16
  const ClearIcon = styled((_a) => {
16
17
  var { className } = _a, props = __rest(_a, ["className"]);
17
- return (_jsx("div", Object.assign({ className: className }, props, { children: _jsx(X, { size: 16 }) })));
18
+ return (_jsx("div", Object.assign({ className: className }, props, { children: _jsx(X, { size: getControlSizeTokens(props.size).iconSize }) })));
18
19
  }) `
19
20
  color: ${(props) => props.theme.palette.text.secondary};
20
21
  transition: transform 0.2s ease-in-out;
@@ -28,16 +29,19 @@ const ClearIcon = styled((_a) => {
28
29
  `;
29
30
  const ClearButton = styled((_a) => {
30
31
  var { className } = _a, props = __rest(_a, ["className"]);
31
- return (_jsx("button", Object.assign({ className: className }, props, { tabIndex: -1, "data-default-btn": true, children: _jsx(ClearIcon, {}) })));
32
+ return (_jsx("button", Object.assign({ className: className }, props, { tabIndex: -1, "data-default-btn": true, children: _jsx(ClearIcon, { size: props.size }) })));
32
33
  }) `
33
34
  position: absolute;
34
35
  right: 0;
35
36
  height: 100%;
36
- padding-inline: 10px;
37
+ width: ${({ size = DEFAULT_CONTROL_SIZE }) => `${getControlSizeTokens(size).adornmentWidth}px`};
37
38
  background: none;
38
39
  border: none;
39
40
  cursor: pointer;
40
41
  margin: 0;
41
42
  outline: none;
43
+ display: flex;
44
+ align-items: center;
45
+ justify-content: center;
42
46
  `;
43
47
  export default ClearButton;
@@ -0,0 +1,34 @@
1
+ import Size from "./Types/Size";
2
+ export declare const DEFAULT_CONTROL_SIZE: Size;
3
+ export type ControlSizeTokens = {
4
+ height: number;
5
+ fontSize: number;
6
+ labelFontSize: number;
7
+ supportingFontSize: number;
8
+ placeholderFontSize: number;
9
+ inputPaddingX: number;
10
+ buttonPaddingX: number;
11
+ iconSize: number;
12
+ iconGap: number;
13
+ adornmentWidth: number;
14
+ menuRowHeight: number;
15
+ menuItemPaddingX: number;
16
+ menuGroupFontSize: number;
17
+ switchTrackWidth: number;
18
+ switchTrackHeight: number;
19
+ switchThumbSize: number;
20
+ switchPadding: number;
21
+ switchGap: number;
22
+ checkboxIconSize: number;
23
+ iconButtonPaddingX: number;
24
+ pillHeight: number;
25
+ pillFontSize: number;
26
+ pillPaddingX: number;
27
+ pillIconSize: number;
28
+ pillGap: number;
29
+ segmentedHeight: number;
30
+ segmentedFontSize: number;
31
+ sectionTitleFontSize: number;
32
+ sectionIconSize: number;
33
+ };
34
+ export declare const getControlSizeTokens: (size?: Size) => ControlSizeTokens;
@@ -0,0 +1,190 @@
1
+ export const DEFAULT_CONTROL_SIZE = "sm";
2
+ const CONTROL_SIZE_TOKENS = {
3
+ xxs: {
4
+ height: 24,
5
+ fontSize: 11,
6
+ labelFontSize: 11,
7
+ supportingFontSize: 10,
8
+ placeholderFontSize: 10,
9
+ inputPaddingX: 8,
10
+ buttonPaddingX: 8,
11
+ iconSize: 14,
12
+ iconGap: 4,
13
+ adornmentWidth: 24,
14
+ menuRowHeight: 24,
15
+ menuItemPaddingX: 8,
16
+ menuGroupFontSize: 10,
17
+ switchTrackWidth: 24,
18
+ switchTrackHeight: 14,
19
+ switchThumbSize: 10,
20
+ switchPadding: 2,
21
+ switchGap: 6,
22
+ checkboxIconSize: 12,
23
+ iconButtonPaddingX: 4,
24
+ pillHeight: 18,
25
+ pillFontSize: 9,
26
+ pillPaddingX: 6,
27
+ pillIconSize: 10,
28
+ pillGap: 4,
29
+ segmentedHeight: 22,
30
+ segmentedFontSize: 11,
31
+ sectionTitleFontSize: 12,
32
+ sectionIconSize: 12,
33
+ },
34
+ xs: {
35
+ height: 28,
36
+ fontSize: 12,
37
+ labelFontSize: 12,
38
+ supportingFontSize: 11,
39
+ placeholderFontSize: 11,
40
+ inputPaddingX: 10,
41
+ buttonPaddingX: 12,
42
+ iconSize: 14,
43
+ iconGap: 6,
44
+ adornmentWidth: 28,
45
+ menuRowHeight: 28,
46
+ menuItemPaddingX: 10,
47
+ menuGroupFontSize: 11,
48
+ switchTrackWidth: 28,
49
+ switchTrackHeight: 16,
50
+ switchThumbSize: 12,
51
+ switchPadding: 2,
52
+ switchGap: 8,
53
+ checkboxIconSize: 14,
54
+ iconButtonPaddingX: 4,
55
+ pillHeight: 20,
56
+ pillFontSize: 10,
57
+ pillPaddingX: 8,
58
+ pillIconSize: 12,
59
+ pillGap: 5,
60
+ segmentedHeight: 26,
61
+ segmentedFontSize: 12,
62
+ sectionTitleFontSize: 13,
63
+ sectionIconSize: 12,
64
+ },
65
+ sm: {
66
+ height: 32,
67
+ fontSize: 13,
68
+ labelFontSize: 12,
69
+ supportingFontSize: 11,
70
+ placeholderFontSize: 12,
71
+ inputPaddingX: 12,
72
+ buttonPaddingX: 14,
73
+ iconSize: 16,
74
+ iconGap: 6,
75
+ adornmentWidth: 32,
76
+ menuRowHeight: 32,
77
+ menuItemPaddingX: 12,
78
+ menuGroupFontSize: 11,
79
+ switchTrackWidth: 32,
80
+ switchTrackHeight: 18,
81
+ switchThumbSize: 14,
82
+ switchPadding: 2,
83
+ switchGap: 8,
84
+ checkboxIconSize: 16,
85
+ iconButtonPaddingX: 6,
86
+ pillHeight: 22,
87
+ pillFontSize: 12,
88
+ pillPaddingX: 10,
89
+ pillIconSize: 14,
90
+ pillGap: 5,
91
+ segmentedHeight: 32,
92
+ segmentedFontSize: 14,
93
+ sectionTitleFontSize: 14,
94
+ sectionIconSize: 14,
95
+ },
96
+ md: {
97
+ height: 36,
98
+ fontSize: 14,
99
+ labelFontSize: 13,
100
+ supportingFontSize: 12,
101
+ placeholderFontSize: 13,
102
+ inputPaddingX: 12,
103
+ buttonPaddingX: 16,
104
+ iconSize: 16,
105
+ iconGap: 8,
106
+ adornmentWidth: 36,
107
+ menuRowHeight: 36,
108
+ menuItemPaddingX: 12,
109
+ menuGroupFontSize: 12,
110
+ switchTrackWidth: 36,
111
+ switchTrackHeight: 20,
112
+ switchThumbSize: 16,
113
+ switchPadding: 2,
114
+ switchGap: 10,
115
+ checkboxIconSize: 18,
116
+ iconButtonPaddingX: 8,
117
+ pillHeight: 24,
118
+ pillFontSize: 14,
119
+ pillPaddingX: 12,
120
+ pillIconSize: 16,
121
+ pillGap: 5,
122
+ segmentedHeight: 38,
123
+ segmentedFontSize: 16,
124
+ sectionTitleFontSize: 16,
125
+ sectionIconSize: 18,
126
+ },
127
+ lg: {
128
+ height: 44,
129
+ fontSize: 15,
130
+ labelFontSize: 14,
131
+ supportingFontSize: 13,
132
+ placeholderFontSize: 14,
133
+ inputPaddingX: 14,
134
+ buttonPaddingX: 18,
135
+ iconSize: 18,
136
+ iconGap: 8,
137
+ adornmentWidth: 44,
138
+ menuRowHeight: 44,
139
+ menuItemPaddingX: 14,
140
+ menuGroupFontSize: 13,
141
+ switchTrackWidth: 44,
142
+ switchTrackHeight: 24,
143
+ switchThumbSize: 20,
144
+ switchPadding: 2,
145
+ switchGap: 12,
146
+ checkboxIconSize: 20,
147
+ iconButtonPaddingX: 10,
148
+ pillHeight: 26,
149
+ pillFontSize: 16,
150
+ pillPaddingX: 14,
151
+ pillIconSize: 18,
152
+ pillGap: 5,
153
+ segmentedHeight: 46,
154
+ segmentedFontSize: 18,
155
+ sectionTitleFontSize: 18,
156
+ sectionIconSize: 24,
157
+ },
158
+ xl: {
159
+ height: 52,
160
+ fontSize: 16,
161
+ labelFontSize: 15,
162
+ supportingFontSize: 14,
163
+ placeholderFontSize: 15,
164
+ inputPaddingX: 16,
165
+ buttonPaddingX: 22,
166
+ iconSize: 18,
167
+ iconGap: 10,
168
+ adornmentWidth: 52,
169
+ menuRowHeight: 52,
170
+ menuItemPaddingX: 16,
171
+ menuGroupFontSize: 14,
172
+ switchTrackWidth: 52,
173
+ switchTrackHeight: 28,
174
+ switchThumbSize: 24,
175
+ switchPadding: 2,
176
+ switchGap: 12,
177
+ checkboxIconSize: 22,
178
+ iconButtonPaddingX: 12,
179
+ pillHeight: 28,
180
+ pillFontSize: 18,
181
+ pillPaddingX: 16,
182
+ pillIconSize: 20,
183
+ pillGap: 5,
184
+ segmentedHeight: 56,
185
+ segmentedFontSize: 20,
186
+ sectionTitleFontSize: 20,
187
+ sectionIconSize: 28,
188
+ },
189
+ };
190
+ export const getControlSizeTokens = (size = DEFAULT_CONTROL_SIZE) => CONTROL_SIZE_TOKENS[size];
@@ -2,5 +2,6 @@ export { default as StyledContent } from "./StyledContent";
2
2
  export { default as StyledFloatContainer } from "./StyledFloatContainer";
3
3
  export { default as ArrowButton } from "./ArrowButton";
4
4
  export { default as ClearButton } from "./ClearButton";
5
+ export * from "./controlSizes";
5
6
  export type { default as Size } from "./Types/Size";
6
7
  export type { default as Variant } from "./Types/Variant";
@@ -2,3 +2,4 @@ export { default as StyledContent } from "./StyledContent";
2
2
  export { default as StyledFloatContainer } from "./StyledFloatContainer";
3
3
  export { default as ArrowButton } from "./ArrowButton";
4
4
  export { default as ClearButton } from "./ClearButton";
5
+ export * from "./controlSizes";
package/dist/index.d.ts CHANGED
@@ -44,4 +44,5 @@ export * from "./Tabs";
44
44
  export * from "./Divider";
45
45
  export * from "./SegmentedControl";
46
46
  export * from "./Popover";
47
+ export * from "./Charts";
47
48
  export * from "./Utilities";
package/dist/index.js CHANGED
@@ -35,4 +35,5 @@ export * from "./Tabs";
35
35
  export * from "./Divider";
36
36
  export * from "./SegmentedControl";
37
37
  export * from "./Popover";
38
+ export * from "./Charts";
38
39
  export * from "./Utilities";