@monolith-forensics/monolith-ui 1.0.12 → 1.1.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 (189) hide show
  1. package/Button/Button.tsx +382 -0
  2. package/Button/index.ts +2 -0
  3. package/{src/components/Calendar/Calendar.js → Calendar/Calendar.tsx} +104 -93
  4. package/{src/components/Calendar/CalendarStyles.js → Calendar/CalendarStyles.tsx} +26 -36
  5. package/{src/components/Calendar/calendarHelpers.js → Calendar/calendarHelpers.ts} +10 -8
  6. package/Calendar/index.ts +1 -0
  7. package/CheckBox/CheckBox.tsx +61 -0
  8. package/CheckBox/index.ts +1 -0
  9. package/{src/components/DateInput/DateInput.js → DateInput/DateInput.tsx} +227 -93
  10. package/DateInput/index.ts +1 -0
  11. package/DropDownMenu/DropDownMenu.tsx +402 -0
  12. package/DropDownMenu/index.ts +1 -0
  13. package/Error/Error.tsx +51 -0
  14. package/Error/index.ts +1 -0
  15. package/{src/components/FieldLabel → FieldLabel}/FieldLabel.tsx +25 -22
  16. package/{src/components/FileInputField/FileInputField.js → FileInputField/FileInputField.tsx} +23 -15
  17. package/FileInputField/index.ts +1 -0
  18. package/Flyout/Flyout.tsx +172 -0
  19. package/Flyout/FlyoutHeader.tsx +14 -0
  20. package/Flyout/FlyoutTitle.tsx +10 -0
  21. package/Flyout/index.ts +3 -0
  22. package/FormSection/FormSection.tsx +71 -0
  23. package/FormSection/index.ts +1 -0
  24. package/Grid/Grid.tsx +18 -0
  25. package/Grid/index.ts +1 -0
  26. package/IconButton/IconButton.tsx +27 -0
  27. package/IconButton/index.ts +1 -0
  28. package/{src/components/Input → Input}/Input.tsx +57 -34
  29. package/Modal/Modal.tsx +172 -0
  30. package/Modal/index.ts +1 -0
  31. package/{src/components/Pill → Pill}/Pill.tsx +41 -11
  32. package/SelectBox/SelectBox.tsx +745 -0
  33. package/SelectBox/index.ts +1 -0
  34. package/Switch/Switch.tsx +204 -0
  35. package/Switch/index.ts +1 -0
  36. package/TagBox/TagBox.tsx +694 -0
  37. package/TagBox/TagBoxStyles.tsx +116 -0
  38. package/TagBox/index.ts +1 -0
  39. package/{src/components/TextArea → TextArea}/TextArea.tsx +35 -13
  40. package/{src/components/TextAreaInput → TextAreaInput}/TextAreaInput.tsx +11 -13
  41. package/{src/components/TextInput → TextInput}/TextInput.tsx +11 -13
  42. package/Tooltip/Tooltip.tsx +68 -0
  43. package/Tooltip/index.ts +1 -0
  44. package/{src/components/ArrowButton → core}/ArrowButton.tsx +17 -20
  45. package/core/ClearButton.tsx +51 -0
  46. package/core/StyledContent.tsx +50 -0
  47. package/core/StyledFloatContainer.tsx +7 -0
  48. package/core/Types/Size.ts +3 -0
  49. package/core/Types/Variant.ts +10 -0
  50. package/core/index.ts +6 -0
  51. package/dist/Button/Button.d.ts +19 -0
  52. package/dist/Button/Button.js +332 -0
  53. package/dist/Button/index.d.ts +2 -0
  54. package/dist/Button/index.js +8 -0
  55. package/dist/Calendar/Calendar.d.ts +15 -0
  56. package/dist/Calendar/Calendar.js +232 -0
  57. package/dist/Calendar/CalendarStyles.d.ts +36 -0
  58. package/dist/Calendar/CalendarStyles.js +170 -0
  59. package/dist/Calendar/calendarHelpers.d.ts +53 -0
  60. package/dist/Calendar/calendarHelpers.js +181 -0
  61. package/dist/Calendar/index.d.ts +1 -0
  62. package/dist/Calendar/index.js +8 -0
  63. package/dist/CheckBox/CheckBox.d.ts +11 -0
  64. package/dist/CheckBox/CheckBox.js +34 -0
  65. package/dist/CheckBox/index.d.ts +1 -0
  66. package/dist/CheckBox/index.js +8 -0
  67. package/dist/DateInput/DateInput.d.ts +24 -0
  68. package/dist/DateInput/DateInput.js +511 -0
  69. package/dist/DateInput/index.d.ts +1 -0
  70. package/dist/DateInput/index.js +8 -0
  71. package/dist/DropDownMenu/DropDownMenu.d.ts +36 -0
  72. package/dist/DropDownMenu/DropDownMenu.js +212 -0
  73. package/dist/DropDownMenu/index.d.ts +1 -0
  74. package/dist/DropDownMenu/index.js +8 -0
  75. package/dist/Error/Error.d.ts +4 -0
  76. package/dist/Error/Error.js +38 -0
  77. package/dist/Error/index.d.ts +1 -0
  78. package/dist/Error/index.js +8 -0
  79. package/dist/FieldLabel/FieldLabel.d.ts +19 -0
  80. package/dist/FieldLabel/FieldLabel.js +119 -0
  81. package/dist/FieldLabel/index.d.ts +1 -0
  82. package/dist/FieldLabel/index.js +8 -0
  83. package/dist/FileInputField/FileInputField.d.ts +18 -0
  84. package/dist/FileInputField/FileInputField.js +116 -0
  85. package/dist/FileInputField/index.d.ts +1 -0
  86. package/dist/FileInputField/index.js +8 -0
  87. package/dist/Flyout/Flyout.d.ts +10 -0
  88. package/dist/Flyout/Flyout.js +111 -0
  89. package/dist/Flyout/FlyoutHeader.d.ts +5 -0
  90. package/dist/Flyout/FlyoutHeader.js +12 -0
  91. package/dist/Flyout/FlyoutTitle.d.ts +2 -0
  92. package/dist/Flyout/FlyoutTitle.js +13 -0
  93. package/dist/Flyout/index.d.ts +3 -0
  94. package/dist/Flyout/index.js +12 -0
  95. package/dist/FormSection/FormSection.d.ts +9 -0
  96. package/dist/FormSection/FormSection.js +51 -0
  97. package/dist/FormSection/index.d.ts +1 -0
  98. package/dist/FormSection/index.js +8 -0
  99. package/dist/Grid/Grid.d.ts +6 -0
  100. package/dist/Grid/Grid.js +15 -0
  101. package/dist/Grid/index.d.ts +1 -0
  102. package/dist/Grid/index.js +8 -0
  103. package/dist/IconButton/IconButton.d.ts +5 -0
  104. package/dist/IconButton/IconButton.js +30 -0
  105. package/dist/IconButton/index.d.ts +1 -0
  106. package/dist/IconButton/index.js +8 -0
  107. package/dist/Input/Input.d.ts +21 -0
  108. package/dist/Input/Input.js +148 -0
  109. package/dist/Input/index.d.ts +1 -0
  110. package/dist/Input/index.js +8 -0
  111. package/dist/Modal/Modal.d.ts +14 -0
  112. package/dist/Modal/Modal.js +134 -0
  113. package/dist/Modal/index.d.ts +1 -0
  114. package/dist/Modal/index.js +8 -0
  115. package/dist/Pill/Pill.d.ts +11 -0
  116. package/dist/Pill/Pill.js +146 -0
  117. package/dist/Pill/index.d.ts +1 -0
  118. package/dist/Pill/index.js +8 -0
  119. package/dist/SelectBox/SelectBox.d.ts +45 -0
  120. package/dist/SelectBox/SelectBox.js +469 -0
  121. package/dist/SelectBox/index.d.ts +1 -0
  122. package/dist/SelectBox/index.js +8 -0
  123. package/dist/Switch/Switch.d.ts +18 -0
  124. package/dist/Switch/Switch.js +157 -0
  125. package/dist/Switch/index.d.ts +1 -0
  126. package/dist/Switch/index.js +8 -0
  127. package/dist/TagBox/TagBox.d.ts +38 -0
  128. package/dist/TagBox/TagBox.js +440 -0
  129. package/dist/TagBox/TagBoxStyles.d.ts +11 -0
  130. package/dist/TagBox/TagBoxStyles.js +113 -0
  131. package/dist/TagBox/index.d.ts +1 -0
  132. package/dist/TagBox/index.js +8 -0
  133. package/dist/TextArea/TextArea.d.ts +16 -0
  134. package/dist/TextArea/TextArea.js +80 -0
  135. package/dist/TextArea/index.d.ts +1 -0
  136. package/dist/TextArea/index.js +8 -0
  137. package/dist/TextAreaInput/TextAreaInput.d.ts +12 -0
  138. package/dist/TextAreaInput/TextAreaInput.js +23 -0
  139. package/dist/TextAreaInput/index.d.ts +1 -0
  140. package/dist/TextAreaInput/index.js +8 -0
  141. package/dist/TextInput/TextInput.d.ts +12 -0
  142. package/dist/TextInput/TextInput.js +30 -0
  143. package/dist/TextInput/index.d.ts +1 -0
  144. package/dist/TextInput/index.js +8 -0
  145. package/dist/Tooltip/Tooltip.d.ts +12 -0
  146. package/dist/Tooltip/Tooltip.js +53 -0
  147. package/dist/Tooltip/index.d.ts +1 -0
  148. package/dist/Tooltip/index.js +8 -0
  149. package/dist/core/ArrowButton.d.ts +6 -0
  150. package/dist/core/ArrowButton.js +48 -0
  151. package/dist/core/ClearButton.d.ts +6 -0
  152. package/dist/core/ClearButton.js +48 -0
  153. package/dist/core/StyledContent.d.ts +7 -0
  154. package/dist/core/StyledContent.js +46 -0
  155. package/dist/core/StyledFloatContainer.d.ts +2 -0
  156. package/dist/core/StyledFloatContainer.js +10 -0
  157. package/dist/core/Types/Size.d.ts +2 -0
  158. package/dist/core/Types/Size.js +2 -0
  159. package/dist/core/Types/Variant.d.ts +2 -0
  160. package/dist/core/Types/Variant.js +2 -0
  161. package/dist/core/index.d.ts +6 -0
  162. package/dist/core/index.js +14 -0
  163. package/dist/index.d.ts +22 -0
  164. package/dist/index.js +51 -0
  165. package/index.ts +22 -0
  166. package/package.json +12 -20
  167. package/{src/components/theme → theme}/components.js +0 -2
  168. package/{src/components/theme → theme}/index.js +0 -1
  169. package/{src/components/theme → theme}/variants.js +0 -1
  170. package/tsconfig.json +11 -11
  171. package/.gitattributes +0 -2
  172. package/rollup.config.js +0 -10
  173. package/src/components/ArrowButton/index.tsx +0 -1
  174. package/src/components/Button/Button.tsx +0 -278
  175. package/src/components/Button/index.ts +0 -1
  176. package/src/components/SelectBox/SelectBox.js +0 -543
  177. package/src/components/TagBox/TagBox.js +0 -563
  178. package/src/components/index.ts +0 -7
  179. package/src/index.ts +0 -1
  180. /package/{src/components/FieldLabel → FieldLabel}/index.ts +0 -0
  181. /package/{src/components/Input/index.tsx → Input/index.ts} +0 -0
  182. /package/{src/components/Pill → Pill}/index.ts +0 -0
  183. /package/{src/components/TextArea → TextArea}/index.ts +0 -0
  184. /package/{src/components/TextAreaInput → TextAreaInput}/index.ts +0 -0
  185. /package/{src/components/TextInput/index.tsx → TextInput/index.ts} +0 -0
  186. /package/{src/components/core/index.js → core/MonolithThemeProvider.js} +0 -0
  187. /package/{src/components/theme → theme}/breakpoints.js +0 -0
  188. /package/{src/components/theme → theme}/shadows.js +0 -0
  189. /package/{src/components/theme → theme}/typography.js +0 -0
@@ -0,0 +1,116 @@
1
+ import styled from "styled-components";
2
+ import { XIcon } from "lucide-react";
3
+
4
+ export const TagBoxContainer = styled.div`
5
+ width: 100%;
6
+ `;
7
+
8
+ export const TagBoxInner = styled.div`
9
+ height: 33px;
10
+ display: flex;
11
+ border: 1px solid ${(props) => props.theme.palette.input.border};
12
+ color: ${(props) => props.theme.palette.text.primary};
13
+ outline: none;
14
+ padding: 8px 8px;
15
+ width: 100%;
16
+ background-color: ${(props) => props.theme.palette.input.background};
17
+ border-radius: 5px;
18
+ transition: border 0.1s ease-in-out;
19
+ overflow-x: hidden;
20
+ &:focus {
21
+ border: 1px solid ${(props) => props.theme.palette.primary.main};
22
+ }
23
+ `;
24
+
25
+ export const TagsContainer = styled.div`
26
+ display: flex;
27
+ -webkit-box-align: center;
28
+ align-items: center;
29
+ flex-wrap: nowrap;
30
+ margin-left: calc(-5px);
31
+ box-sizing: border-box;
32
+ `;
33
+
34
+ export const TagBoxInput = styled.input`
35
+ border: none;
36
+ outline: none;
37
+ width: 100%;
38
+ min-width: 50px;
39
+ background-color: transparent;
40
+ color: ${(props) => props.theme.palette.text.primary};
41
+ &:focus {
42
+ border: none;
43
+ outline: none;
44
+ }
45
+ `;
46
+
47
+ export const Tag = styled.div`
48
+ display: flex;
49
+ -webkit-box-align: center;
50
+ align-items: center;
51
+ background-color: rgb(26, 27, 30);
52
+ color: rgb(193, 194, 197);
53
+ height: 22px;
54
+ padding-left: 10px;
55
+ padding-right: 0px;
56
+ font-weight: 500;
57
+ font-size: 12px;
58
+ border-radius: 4px;
59
+ cursor: default;
60
+ user-select: none;
61
+ max-width: 120px;
62
+ margin: calc(3px) calc(5px);
63
+ `;
64
+
65
+ export const TagText = styled.div`
66
+ display: flex;
67
+ -webkit-box-align: center;
68
+ align-items: center;
69
+ background-color: rgb(26, 27, 30);
70
+ color: rgb(193, 194, 197);
71
+ height: 22px;
72
+ padding-right: 0px;
73
+ font-weight: 500;
74
+ font-size: 12px;
75
+ border-radius: 4px;
76
+ cursor: default;
77
+ user-select: none;
78
+ max-width: 75px;
79
+ white-space: nowrap;
80
+ overflow: hidden;
81
+ text-overflow: ellipsis;
82
+ `;
83
+
84
+ export const TagKillButton = styled(XIcon)`
85
+ -webkit-tap-highlight-color: transparent;
86
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
87
+ Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
88
+ cursor: pointer;
89
+ appearance: none;
90
+ text-align: left;
91
+ text-decoration: none;
92
+ box-sizing: border-box;
93
+ border: 1px solid transparent;
94
+ background-color: transparent;
95
+ position: relative;
96
+ height: 19px;
97
+ min-height: 19px;
98
+ width: 22px;
99
+ min-width: 19px;
100
+ border-radius: 2px;
101
+ line-height: 1;
102
+ display: flex;
103
+ -webkit-box-align: center;
104
+ align-items: center;
105
+ -webkit-box-pack: center;
106
+ justify-content: center;
107
+ color: rgb(193, 194, 197);
108
+ padding: 0px 3px;
109
+ &:hover {
110
+ color: rgb(255, 255, 255);
111
+ }
112
+ `;
113
+
114
+ export const TagBoxOptions = styled.div``;
115
+
116
+ export const TagBoxOption = styled.div``;
@@ -0,0 +1 @@
1
+ export { default } from "./TagBox";
@@ -1,16 +1,23 @@
1
- import React from "react";
2
1
  import styled from "styled-components";
3
2
  import TextareaAutosize from "react-textarea-autosize";
3
+ import { Size, Variant } from "../core";
4
4
 
5
- interface StyledTextAreaProps {
6
- variant?: "contained" | "filled" | "outlined" | "text";
7
- size?: "xs" | "sm" | "md" | "lg" | "xl";
5
+ interface TextAreaProps {
6
+ ref?: React.Ref<HTMLTextAreaElement>;
7
+ className?: string;
8
+ size?: Size;
9
+ variant?: Variant;
10
+ width?: string | number | null | undefined;
11
+ style?: React.CSSProperties;
12
+ placeholder?: string;
13
+ onChange?: (e: React.ChangeEvent<HTMLTextAreaElement>) => void;
14
+ onKeyUp?: (e: React.KeyboardEvent<HTMLTextAreaElement>) => void;
8
15
  }
9
16
 
10
- const StyledTextArea = styled(TextareaAutosize)<StyledTextAreaProps>`
17
+ const TextArea = styled(TextareaAutosize)<TextAreaProps>`
11
18
  outline: none;
12
19
  resize: none;
13
- padding: 8px 8px;
20
+ padding: 10px;
14
21
  width: 100%;
15
22
  height: 100%;
16
23
 
@@ -18,16 +25,16 @@ const StyledTextArea = styled(TextareaAutosize)<StyledTextAreaProps>`
18
25
  color: ${(props) => props.theme.palette.text.primary};
19
26
  font-size: ${({ size }) =>
20
27
  size === "xs"
21
- ? "12px"
28
+ ? "11px"
22
29
  : size === "sm"
23
- ? "14px"
30
+ ? "13px"
24
31
  : size === "md"
25
- ? "16px"
32
+ ? "15px"
26
33
  : size === "lg"
27
- ? "18px"
34
+ ? "17px"
28
35
  : size === "xl"
29
- ? "20px"
30
- : "12px"};
36
+ ? "19px"
37
+ : "11px"};
31
38
 
32
39
  background-color: ${({ theme, variant }) => {
33
40
  switch (variant) {
@@ -65,6 +72,21 @@ const StyledTextArea = styled(TextareaAutosize)<StyledTextAreaProps>`
65
72
  &:focus {
66
73
  border: 1px solid ${(props) => props.theme.palette.primary.main};
67
74
  }
75
+
76
+ ::placeholder {
77
+ font-size: ${({ size }) =>
78
+ size === "xs"
79
+ ? "10px"
80
+ : size === "sm"
81
+ ? "12px"
82
+ : size === "md"
83
+ ? "14px"
84
+ : size === "lg"
85
+ ? "16px"
86
+ : size === "xl"
87
+ ? "18px"
88
+ : "10px"};
89
+ }
68
90
  `;
69
91
 
70
- export default StyledTextArea;
92
+ export default TextArea;
@@ -1,27 +1,26 @@
1
- import React from "react";
2
- import FieldLabel from "../FieldLabel";
3
- import StyledTextArea from "../TextArea";
1
+ import { Size } from "../core";
2
+ import { TextArea, FieldLabel } from "..";
4
3
 
5
4
  interface TextAreaInputProps {
6
5
  label?: string;
7
- error?: boolean;
8
- errorMessage?: string;
6
+ error?: string;
9
7
  required?: boolean;
10
8
  colSpan?: number;
11
- size?: "xs" | "sm" | "md" | "lg" | "xl";
12
- description?: string | null;
9
+ size?: Size;
10
+ description?: string;
11
+ inputRef?: React.RefObject<HTMLTextAreaElement> | null;
13
12
  }
14
13
 
15
- const TextAreaInput: React.FC<TextAreaInputProps> = ({
14
+ const TextAreaInput = ({
16
15
  label,
17
16
  error,
18
- errorMessage,
19
17
  required,
20
18
  colSpan = 1,
21
- size,
19
+ size = "sm",
22
20
  description,
21
+ inputRef = null,
23
22
  ...other
24
- }) => {
23
+ }: TextAreaInputProps) => {
25
24
  return (
26
25
  <div
27
26
  style={{
@@ -32,7 +31,6 @@ const TextAreaInput: React.FC<TextAreaInputProps> = ({
32
31
  {label && (
33
32
  <FieldLabel
34
33
  error={error}
35
- errorMessage={errorMessage}
36
34
  asterisk={required}
37
35
  size={size}
38
36
  description={description}
@@ -40,7 +38,7 @@ const TextAreaInput: React.FC<TextAreaInputProps> = ({
40
38
  {label}
41
39
  </FieldLabel>
42
40
  )}
43
- <StyledTextArea {...other} />
41
+ <TextArea ref={inputRef} size={size} {...other} />
44
42
  </div>
45
43
  );
46
44
  };
@@ -1,26 +1,24 @@
1
- import React from "react";
2
- import FieldLabel from "../FieldLabel";
3
- import StyledInput from "../Input";
1
+ import { FieldLabel } from "..";
2
+ import Input, { InputProps } from "../Input/Input";
3
+ import { Size } from "../core";
4
4
 
5
- interface TextInputProps {
5
+ interface TextInputProps extends InputProps {
6
6
  label?: string;
7
- error?: boolean;
8
- errorMessage?: string;
7
+ error?: string;
9
8
  required?: boolean;
9
+ size?: Size;
10
10
  colSpan?: number;
11
- size?: "xs" | "sm" | "md" | "lg" | "xl";
12
- description?: string | null;
11
+ description?: string;
13
12
  }
14
13
 
15
14
  const TextInput: React.FC<TextInputProps> = ({
16
15
  label,
17
16
  error,
18
- errorMessage,
19
17
  required,
20
18
  colSpan = 1,
21
- size,
22
19
  description,
23
- ...other
20
+ size,
21
+ ...rest
24
22
  }) => {
25
23
  return (
26
24
  <div
@@ -29,12 +27,12 @@ const TextInput: React.FC<TextInputProps> = ({
29
27
  display: "flex",
30
28
  flexDirection: "column",
31
29
  justifyContent: "space-between",
30
+ width: "100%",
32
31
  }}
33
32
  >
34
33
  {label && (
35
34
  <FieldLabel
36
35
  error={error}
37
- errorMessage={errorMessage}
38
36
  asterisk={required}
39
37
  size={size}
40
38
  description={description}
@@ -42,7 +40,7 @@ const TextInput: React.FC<TextInputProps> = ({
42
40
  {label}
43
41
  </FieldLabel>
44
42
  )}
45
- <StyledInput error={error} {...other} />
43
+ <Input size={size} {...rest} />
46
44
  </div>
47
45
  );
48
46
  };
@@ -0,0 +1,68 @@
1
+ import styled from "styled-components";
2
+ import * as RadixTooltip from "@radix-ui/react-tooltip";
3
+ import { ReactNode } from "react";
4
+
5
+ interface TooltipProps {
6
+ className?: string;
7
+ children?: ReactNode;
8
+ content?: ReactNode;
9
+ side?: "top" | "right" | "bottom" | "left";
10
+ sideOffset?: number;
11
+ align?: "start" | "center" | "end";
12
+ delayDuration?: number;
13
+ }
14
+
15
+ const Tooltip = styled(
16
+ ({
17
+ className,
18
+ children,
19
+ content,
20
+ side = "right",
21
+ sideOffset = 15,
22
+ align = "start",
23
+ delayDuration = 800,
24
+ }: TooltipProps) => {
25
+ if (!content) return children;
26
+
27
+ return (
28
+ <RadixTooltip.Provider
29
+ delayDuration={delayDuration || 800}
30
+ skipDelayDuration={0}
31
+ disableHoverableContent
32
+ >
33
+ <RadixTooltip.Root>
34
+ <RadixTooltip.Trigger asChild>{children}</RadixTooltip.Trigger>
35
+ <RadixTooltip.Portal>
36
+ <RadixTooltip.Content
37
+ className={className}
38
+ side={side || "right"}
39
+ sideOffset={sideOffset || 15}
40
+ align={align || "start"}
41
+ onClick={(e) => e.stopPropagation()}
42
+ >
43
+ {content}
44
+ </RadixTooltip.Content>
45
+ </RadixTooltip.Portal>
46
+ </RadixTooltip.Root>
47
+ </RadixTooltip.Provider>
48
+ );
49
+ }
50
+ )`
51
+ pointer-events: none;
52
+ z-index: 999999;
53
+ background-color: ${({ theme }) => theme.palette.background.default};
54
+ padding: 15px;
55
+ border-radius: 5px;
56
+ border: 1px solid ${({ theme }) => theme.palette.divider};
57
+ font-size: 0.75rem;
58
+
59
+ white-space: pre-wrap;
60
+
61
+ .title {
62
+ font-size: 0.85rem;
63
+ font-weight: 600;
64
+ margin-bottom: 5px;
65
+ }
66
+ `;
67
+
68
+ export default Tooltip;
@@ -0,0 +1 @@
1
+ export { default } from "./Tooltip";
@@ -1,18 +1,16 @@
1
- import React from "react";
2
1
  import { ChevronDownIcon } from "lucide-react";
3
2
  import styled from "styled-components";
4
3
 
5
4
  interface ArrowIconProps {
6
5
  className?: string;
6
+ [key: string]: React.SVGAttributes<SVGSVGElement> | any;
7
7
  }
8
8
 
9
- const ArrowIcon: React.FC<ArrowIconProps> = styled(
10
- ({ className, ...props }: ArrowIconProps) => (
11
- <div className={className} {...props}>
12
- <ChevronDownIcon size={16} />
13
- </div>
14
- )
15
- )`
9
+ const ArrowIcon = styled(({ className, ...props }: ArrowIconProps) => (
10
+ <div className={className} {...props}>
11
+ <ChevronDownIcon size={16} />
12
+ </div>
13
+ ))`
16
14
  color: ${(props) => props.theme.palette.text.secondary};
17
15
  transition: transform 0.2s ease-in-out;
18
16
  transform: rotate(0deg);
@@ -26,20 +24,19 @@ const ArrowIcon: React.FC<ArrowIconProps> = styled(
26
24
 
27
25
  interface ArrowButtonProps {
28
26
  className?: string;
27
+ [key: string]: React.ButtonHTMLAttributes<HTMLButtonElement> | any;
29
28
  }
30
29
 
31
- const ArrowButton: React.FC<ArrowButtonProps> = styled(
32
- ({ className, ...props }: ArrowButtonProps) => (
33
- <button
34
- className={className}
35
- {...props}
36
- tabIndex={-1}
37
- data-default-btn={true}
38
- >
39
- <ArrowIcon />
40
- </button>
41
- )
42
- )`
30
+ const ArrowButton = styled(({ className, ...props }: ArrowButtonProps) => (
31
+ <button
32
+ className={className}
33
+ {...props}
34
+ tabIndex={-1}
35
+ data-default-btn={true}
36
+ >
37
+ <ArrowIcon />
38
+ </button>
39
+ ))`
43
40
  position: absolute;
44
41
  right: 0;
45
42
  height: 100%;
@@ -0,0 +1,51 @@
1
+ import { X } from "lucide-react";
2
+ import styled from "styled-components";
3
+
4
+ interface ClearIconProps {
5
+ className?: string;
6
+ [key: string]: React.SVGAttributes<SVGSVGElement> | any;
7
+ }
8
+
9
+ const ClearIcon = styled(({ className, ...props }: ClearIconProps) => (
10
+ <div className={className} {...props}>
11
+ <X size={16} />
12
+ </div>
13
+ ))`
14
+ color: ${(props) => props.theme.palette.text.secondary};
15
+ transition: transform 0.2s ease-in-out;
16
+ transform: rotate(0deg);
17
+ will-change: transform;
18
+
19
+ display: flex;
20
+ flex-direction: column;
21
+ align-items: center;
22
+ justify-content: center;
23
+ `;
24
+
25
+ interface ClearButtonProps {
26
+ className?: string;
27
+ [key: string]: React.ButtonHTMLAttributes<HTMLButtonElement> | any;
28
+ }
29
+
30
+ const ClearButton = styled(({ className, ...props }: ClearButtonProps) => (
31
+ <button
32
+ className={className}
33
+ {...props}
34
+ tabIndex={-1}
35
+ data-default-btn={true}
36
+ >
37
+ <ClearIcon />
38
+ </button>
39
+ ))`
40
+ position: absolute;
41
+ right: 0;
42
+ height: 100%;
43
+ padding-inline: 10px;
44
+ background: none;
45
+ border: none;
46
+ cursor: pointer;
47
+ margin: 0;
48
+ outline: none;
49
+ `;
50
+
51
+ export default ClearButton;
@@ -0,0 +1,50 @@
1
+ import styled from "styled-components";
2
+ import Variant from "./Types/Variant";
3
+
4
+ interface StyledContentProps {
5
+ maxDropdownHeight?: number | string;
6
+ variant?: Variant;
7
+ }
8
+
9
+ const StyledContent = styled.div<StyledContentProps>`
10
+ position: relative;
11
+ display: flex;
12
+ flex-direction: column;
13
+ overflow-y: hidden;
14
+ overflow-x: hidden;
15
+
16
+ max-height: ${({ maxDropdownHeight }) =>
17
+ Number.isInteger(maxDropdownHeight)
18
+ ? `${maxDropdownHeight}px`
19
+ : maxDropdownHeight || "250px"};
20
+
21
+ background-color: ${({ theme, variant }) => {
22
+ switch (variant) {
23
+ case "filled":
24
+ return theme.palette.input.background;
25
+ case "outlined":
26
+ return theme.palette.input.background;
27
+ case "text":
28
+ return "transparent";
29
+ default:
30
+ return theme.palette.input.background;
31
+ }
32
+ }};
33
+
34
+ border-radius: 5px;
35
+ border: 1px solid ${(props) => props.theme.palette.divider};
36
+ padding: 5px;
37
+ animation-duration: 400ms;
38
+ animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
39
+ will-change: transform, opacity;
40
+
41
+ &[data-empty="true"] {
42
+ display: none;
43
+ }
44
+
45
+ &[data-scroll-active="true"] {
46
+ padding-right: 5px;
47
+ }
48
+ `;
49
+
50
+ export default StyledContent;
@@ -0,0 +1,7 @@
1
+ import styled from "styled-components";
2
+
3
+ const StyledFloatContainer = styled.div`
4
+ z-index: 100001;
5
+ `;
6
+
7
+ export default StyledFloatContainer;
@@ -0,0 +1,3 @@
1
+ type Size = "xxs" | "xs" | "sm" | "md" | "lg" | "xl";
2
+
3
+ export default Size;
@@ -0,0 +1,10 @@
1
+ type Variant =
2
+ | "default"
3
+ | "contained"
4
+ | "filled"
5
+ | "light"
6
+ | "outlined"
7
+ | "text"
8
+ | "subtle";
9
+
10
+ export default Variant;
package/core/index.ts ADDED
@@ -0,0 +1,6 @@
1
+ export { default as StyledContent } from "./StyledContent";
2
+ export { default as StyledFloatContainer } from "./StyledFloatContainer";
3
+ export { default as ArrowButton } from "./ArrowButton";
4
+ export { default as ClearButton } from "./ClearButton";
5
+ export type { default as Size } from "./Types/Size";
6
+ export type { default as Variant } from "./Types/Variant";
@@ -0,0 +1,19 @@
1
+ import { ButtonHTMLAttributes, ReactNode } from "react";
2
+ import { Size, Variant } from "../core";
3
+ export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
4
+ children?: ReactNode | string;
5
+ className?: string;
6
+ loading?: boolean;
7
+ leftSection?: ReactNode;
8
+ rightSection?: ReactNode;
9
+ href?: string | null;
10
+ download?: string | null;
11
+ fullWidth?: boolean;
12
+ size?: Size;
13
+ variant?: Variant;
14
+ color?: string;
15
+ disabled?: boolean;
16
+ onClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;
17
+ }
18
+ declare const Button: import("react").ForwardRefExoticComponent<ButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
19
+ export default Button;