@julseb-lib/react 0.0.16 → 0.0.20
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.
- package/dist/index.cjs.js +87 -87
- package/dist/index.es.js +1831 -1876
- package/dist/index.umd.js +86 -86
- package/dist/lib/components/Accordion/AccordionButton.tsx +2 -2
- package/dist/lib/components/Accordion/AccordionContent.tsx +2 -2
- package/dist/lib/components/Autocomplete/Autocomplete.tsx +1 -1
- package/dist/lib/components/Breadcrumbs/BreadcrumbItem.tsx +2 -2
- package/dist/lib/components/Datepicker/Calendar.tsx +2 -2
- package/dist/lib/components/Datepicker/Datepicker.tsx +1 -1
- package/dist/lib/components/Footer/FooterLogo.tsx +2 -2
- package/dist/lib/components/Header/HeaderLogo.tsx +2 -2
- package/dist/lib/components/Header/HeaderNav.tsx +13 -18
- package/dist/lib/components/Header/HeaderNavLink.tsx +6 -2
- package/dist/lib/components/Header/HeaderSearch.tsx +2 -2
- package/dist/lib/components/Header/types.ts +0 -1
- package/dist/lib/components/Helmet/Helmet.tsx +2 -2
- package/dist/lib/components/Input/Input.tsx +1 -1
- package/dist/lib/components/InputComponents/components/InputButton.tsx +2 -2
- package/dist/lib/components/InputComponents/components/InputContainer.tsx +2 -2
- package/dist/lib/components/InputComponents/components/InputIcon.tsx +2 -2
- package/dist/lib/components/InputComponents/components/InputPrefix.tsx +2 -2
- package/dist/lib/components/InputComponents/components/InputRightContainer.tsx +2 -2
- package/dist/lib/components/InputComponents/components/InputSuffix.tsx +2 -2
- package/dist/lib/components/InputComponents/components/InputValidationHelper.tsx +5 -5
- package/dist/lib/components/InputComponents/components/InputValidationIcon.tsx +2 -2
- package/dist/lib/components/InputComponents/components/InputWrapper.tsx +2 -2
- package/dist/lib/components/InputComponents/types.ts +2 -13
- package/dist/lib/components/InputContainer/HelperBottom.tsx +96 -0
- package/dist/lib/components/InputContainer/InputContainer.tsx +12 -90
- package/dist/lib/components/InputContainer/styles.tsx +3 -3
- package/dist/lib/components/InputContainer/subtypes.ts +10 -0
- package/dist/lib/components/InputContainer/types.ts +2 -13
- package/dist/lib/components/InputCounter/InputCounter.tsx +1 -1
- package/dist/lib/components/InputImage/EmptyContainer.tsx +2 -2
- package/dist/lib/components/InputImage/HoverContainer.tsx +2 -2
- package/dist/lib/components/InputImage/InputImage.tsx +5 -3
- package/dist/lib/components/InputImage/types.ts +1 -0
- package/dist/lib/components/InputPhone/InputPhone.tsx +1 -1
- package/dist/lib/components/InputPin/InputPin.tsx +1 -1
- package/dist/lib/components/InputSlider/InputSlider.tsx +1 -1
- package/dist/lib/components/LibIcon/LibIcon.tsx +2 -2
- package/dist/lib/components/MarkdownEditor/MarkdownEditor.tsx +1 -1
- package/dist/lib/components/MarkdownEditor/MdEditorButtons/EditorButtonTitles.tsx +2 -2
- package/dist/lib/components/MarkdownEditor/MdEditorButtons/EditorButtons.tsx +2 -2
- package/dist/lib/components/PageLayout/PageLayout.tsx +2 -2
- package/dist/lib/components/ProgressCircle/Circle.tsx +2 -2
- package/dist/lib/components/ProgressCircle/Value.tsx +2 -2
- package/dist/lib/components/Rating/Rating.tsx +1 -1
- package/dist/lib/components/ResetScroll/ResetScroll.tsx +1 -1
- package/dist/lib/components/Select/Select.tsx +1 -1
- package/dist/lib/components/Slideshow/SlideshowButton.tsx +2 -2
- package/dist/lib/components/Slideshow/SlideshowPagination.tsx +2 -2
- package/dist/lib/components/Timepicker/Timepicker.tsx +1 -1
- package/dist/lib/types/component-items.ts +31 -0
- package/package.json +1 -1
|
@@ -4,15 +4,12 @@ import { forwardRef } from "react"
|
|
|
4
4
|
import classNames from "classnames"
|
|
5
5
|
import { Text } from "../../"
|
|
6
6
|
import { InputValidationHelper } from "../InputComponents"
|
|
7
|
-
import {
|
|
8
|
-
import { getIconSizeFromFont } from "../../lib-utils"
|
|
7
|
+
import { HelperBottom } from "./HelperBottom"
|
|
9
8
|
import {
|
|
10
9
|
StyledInputContainer,
|
|
11
10
|
Label,
|
|
12
11
|
LabelComment,
|
|
13
|
-
|
|
14
|
-
HelperBottomIconContainer,
|
|
15
|
-
HelperBottom,
|
|
12
|
+
StyledHelperBottom,
|
|
16
13
|
} from "./styles"
|
|
17
14
|
import type { ILibInputContainer } from "./types"
|
|
18
15
|
|
|
@@ -26,7 +23,7 @@ import type { ILibInputContainer } from "./types"
|
|
|
26
23
|
* @prop label?: string
|
|
27
24
|
* @prop labelComment?: string
|
|
28
25
|
* @prop helper?: string
|
|
29
|
-
* @prop helperBottom?: string | { text: string; textColor?: Any color from the library; fontStyle?: CssFontStyle; icon?: string | JSX.Element; iconColor?: Any color from the library; iconSize?: number }
|
|
26
|
+
* @prop helperBottom?: string | { text: string => only if element is not defined; element: ReactChildren => only if text is not defined; textColor?: Any color from the library; fontStyle?: CssFontStyle; icon?: string | JSX.Element; iconColor?: Any color from the library; iconSize?: number }
|
|
30
27
|
* @prop value?: any
|
|
31
28
|
* @prop counter?: boolean
|
|
32
29
|
* @prop maxLength?: number
|
|
@@ -102,91 +99,16 @@ export const InputContainer = forwardRef<HTMLDivElement, ILibInputContainer>(
|
|
|
102
99
|
|
|
103
100
|
{children}
|
|
104
101
|
|
|
105
|
-
{helperBottom &&
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
helperBottom.textColor
|
|
113
|
-
? helperBottom.textColor
|
|
114
|
-
: undefined
|
|
115
|
-
}
|
|
116
|
-
$fontStyle={
|
|
117
|
-
typeof helperBottom === "object" &&
|
|
118
|
-
helperBottom.fontStyle
|
|
119
|
-
? helperBottom.fontStyle
|
|
120
|
-
: undefined
|
|
121
|
-
}
|
|
122
|
-
$hasIcon={false}
|
|
123
|
-
>
|
|
124
|
-
{typeof helperBottom === "string"
|
|
125
|
-
? helperBottom
|
|
126
|
-
: helperBottom.text}
|
|
127
|
-
</HelperBottom>
|
|
128
|
-
) : (
|
|
129
|
-
<HelperBottomContainer
|
|
130
|
-
data-testid={
|
|
131
|
-
testid && `${testid}.HelperBottomContainer`
|
|
132
|
-
}
|
|
133
|
-
className={className && "HelperBottomContainer"}
|
|
134
|
-
>
|
|
135
|
-
<HelperBottomIconContainer
|
|
136
|
-
data-testid={
|
|
137
|
-
testid &&
|
|
138
|
-
`${testid}.HelperBottom.IconContainer`
|
|
139
|
-
}
|
|
140
|
-
className={className && "BottomIconContainer"}
|
|
141
|
-
$iconSize={
|
|
142
|
-
(helperBottom.iconSize ||
|
|
143
|
-
getIconSizeFromFont("small")) as number
|
|
144
|
-
}
|
|
145
|
-
>
|
|
146
|
-
<LibIcon
|
|
147
|
-
data-testid={
|
|
148
|
-
testid &&
|
|
149
|
-
`${testid}.HelperBottom.IconContainer.Icon`
|
|
150
|
-
}
|
|
151
|
-
className={className && "HelperBottomIcon"}
|
|
152
|
-
icon={helperBottom.icon}
|
|
153
|
-
color={helperBottom.iconColor || "primary"}
|
|
154
|
-
size={
|
|
155
|
-
helperBottom.iconSize ||
|
|
156
|
-
getIconSizeFromFont("small")
|
|
157
|
-
}
|
|
158
|
-
baseUrl={iconBaseUrl}
|
|
159
|
-
/>
|
|
160
|
-
</HelperBottomIconContainer>
|
|
161
|
-
|
|
162
|
-
<HelperBottom
|
|
163
|
-
data-testid={
|
|
164
|
-
testid && `${testid}.HelperBottom.Text`
|
|
165
|
-
}
|
|
166
|
-
className={className && "HelperBottomText"}
|
|
167
|
-
color={
|
|
168
|
-
helperBottom.textColor
|
|
169
|
-
? helperBottom.textColor
|
|
170
|
-
: undefined
|
|
171
|
-
}
|
|
172
|
-
$fontStyle={
|
|
173
|
-
helperBottom.fontStyle
|
|
174
|
-
? helperBottom.fontStyle
|
|
175
|
-
: undefined
|
|
176
|
-
}
|
|
177
|
-
$hasIcon
|
|
178
|
-
$iconSize={
|
|
179
|
-
(helperBottom.iconSize ||
|
|
180
|
-
getIconSizeFromFont("small")) as number
|
|
181
|
-
}
|
|
182
|
-
>
|
|
183
|
-
{helperBottom.text}
|
|
184
|
-
</HelperBottom>
|
|
185
|
-
</HelperBottomContainer>
|
|
186
|
-
))}
|
|
102
|
+
{helperBottom && (
|
|
103
|
+
<HelperBottom
|
|
104
|
+
data-testid={testid}
|
|
105
|
+
className={className}
|
|
106
|
+
helperBottom={helperBottom}
|
|
107
|
+
/>
|
|
108
|
+
)}
|
|
187
109
|
|
|
188
110
|
{counter && (
|
|
189
|
-
<
|
|
111
|
+
<StyledHelperBottom
|
|
190
112
|
data-testid={testid && `${testid}.Counter`}
|
|
191
113
|
className={className && "Counter"}
|
|
192
114
|
color="gray"
|
|
@@ -194,7 +116,7 @@ export const InputContainer = forwardRef<HTMLDivElement, ILibInputContainer>(
|
|
|
194
116
|
>
|
|
195
117
|
{value.toString().length}
|
|
196
118
|
{maxLength && `/${maxLength}`}
|
|
197
|
-
</
|
|
119
|
+
</StyledHelperBottom>
|
|
198
120
|
)}
|
|
199
121
|
|
|
200
122
|
{validation && (
|
|
@@ -58,7 +58,7 @@ const HelperBottomIconContainer = styled.span<{ $iconSize: number }>`
|
|
|
58
58
|
})}
|
|
59
59
|
`
|
|
60
60
|
|
|
61
|
-
const
|
|
61
|
+
const StyledHelperBottom = styled(Text).attrs({ tag: "small" })<{
|
|
62
62
|
$fontStyle?: CssFontStyle
|
|
63
63
|
$hasIcon?: boolean
|
|
64
64
|
$iconSize?: number
|
|
@@ -76,7 +76,7 @@ setDefaultTheme([
|
|
|
76
76
|
LabelComment,
|
|
77
77
|
HelperBottomContainer,
|
|
78
78
|
HelperBottomIconContainer,
|
|
79
|
-
|
|
79
|
+
StyledHelperBottom,
|
|
80
80
|
])
|
|
81
81
|
|
|
82
82
|
export {
|
|
@@ -85,5 +85,5 @@ export {
|
|
|
85
85
|
LabelComment,
|
|
86
86
|
HelperBottomContainer,
|
|
87
87
|
HelperBottomIconContainer,
|
|
88
|
-
|
|
88
|
+
StyledHelperBottom,
|
|
89
89
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/*=============================================== Header sub components types ===============================================*/
|
|
2
|
+
|
|
3
|
+
import type { ILibInputContainer } from "./types"
|
|
4
|
+
|
|
5
|
+
// ! DO NOT EXPORT THOSE TYPES, ONLY USE THEM IN THOSE COMPONENTS
|
|
6
|
+
|
|
7
|
+
export type ILibHelperBottom = Pick<
|
|
8
|
+
ILibInputContainer,
|
|
9
|
+
"helperBottom" | "data-testid" | "className" | "iconBaseUrl"
|
|
10
|
+
>
|
|
@@ -2,11 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
import type { CSSProperties } from "react"
|
|
4
4
|
import type {
|
|
5
|
-
CssFontStyle,
|
|
6
|
-
LibAllColors,
|
|
7
5
|
LibComponentBase,
|
|
8
|
-
LibIcon,
|
|
9
6
|
ReactChildren,
|
|
7
|
+
LibHelperBottom,
|
|
10
8
|
} from "../../types"
|
|
11
9
|
import type { LibInputWithValidation } from "../InputComponents/types"
|
|
12
10
|
|
|
@@ -16,16 +14,7 @@ export interface ILibInputContainer
|
|
|
16
14
|
label?: string
|
|
17
15
|
labelComment?: string
|
|
18
16
|
helper?: string
|
|
19
|
-
helperBottom?:
|
|
20
|
-
| string
|
|
21
|
-
| {
|
|
22
|
-
text: string
|
|
23
|
-
textColor?: LibAllColors
|
|
24
|
-
fontStyle?: CssFontStyle
|
|
25
|
-
icon?: LibIcon
|
|
26
|
-
iconColor?: LibAllColors
|
|
27
|
-
iconSize?: number
|
|
28
|
-
}
|
|
17
|
+
helperBottom?: LibHelperBottom
|
|
29
18
|
children?: ReactChildren
|
|
30
19
|
value?: any
|
|
31
20
|
counter?: boolean
|
|
@@ -38,7 +38,7 @@ import type { ILibInputCounter } from "./types"
|
|
|
38
38
|
* @prop label?: string
|
|
39
39
|
* @prop labelComment?: string
|
|
40
40
|
* @prop helper?: string
|
|
41
|
-
* @prop helperBottom?: string | { text: string; textColor?: Any color from the library; fontStyle?: CssFontStyle; icon?: string | JSX.Element; iconColor?: Any color from the library; iconSize?: number }
|
|
41
|
+
* @prop helperBottom?: string | { text: string => only if element is not defined; element: ReactChildren => only if text is not defined; textColor?: Any color from the library; fontStyle?: CssFontStyle; icon?: string | JSX.Element; iconColor?: Any color from the library; iconSize?: number }
|
|
42
42
|
* @prop validation?: { status: LibValidationStatus; message?: string; iconNotPassed?: LibIcon; iconNotPassedSize?: number; iconPassed?: LibIcon; iconPassedSize?: number; iconBaseUrl?: string }
|
|
43
43
|
* @prop iconBaseUrl?: string
|
|
44
44
|
* @prop inputBackground?: "light" | "dark"
|
|
@@ -5,14 +5,14 @@ import { LibIcon } from "../LibIcon"
|
|
|
5
5
|
import { StyledEmptyContainer } from "./styles"
|
|
6
6
|
import type { ILibEmptyContainer } from "./subtypes"
|
|
7
7
|
|
|
8
|
-
export
|
|
8
|
+
export const EmptyContainer = ({
|
|
9
9
|
"data-testid": testid,
|
|
10
10
|
className,
|
|
11
11
|
validation,
|
|
12
12
|
iconSizes,
|
|
13
13
|
icons,
|
|
14
14
|
iconBaseUrl,
|
|
15
|
-
}: ILibEmptyContainer) {
|
|
15
|
+
}: ILibEmptyContainer) => {
|
|
16
16
|
return (
|
|
17
17
|
<StyledEmptyContainer
|
|
18
18
|
data-testid={testid && `${testid}.EmptyContainer`}
|
|
@@ -6,7 +6,7 @@ import { Edit } from "../../icons"
|
|
|
6
6
|
import { StyledHoverContainer } from "./styles"
|
|
7
7
|
import type { ILibHoverContainer } from "./subtypes"
|
|
8
8
|
|
|
9
|
-
export
|
|
9
|
+
export const HoverContainer = ({
|
|
10
10
|
"data-testid": testid,
|
|
11
11
|
className,
|
|
12
12
|
validation,
|
|
@@ -15,7 +15,7 @@ export function HoverContainer({
|
|
|
15
15
|
iconBaseUrl,
|
|
16
16
|
isVisible,
|
|
17
17
|
disabled = false,
|
|
18
|
-
}: ILibHoverContainer) {
|
|
18
|
+
}: ILibHoverContainer) => {
|
|
19
19
|
return (
|
|
20
20
|
<StyledHoverContainer
|
|
21
21
|
data-testid={testid && `${testid}.HoverContainer`}
|
|
@@ -17,6 +17,7 @@ import type { ILibInputImage } from "./types"
|
|
|
17
17
|
* @prop value: string
|
|
18
18
|
* @prop width?: string | number
|
|
19
19
|
* @prop height?: string | number
|
|
20
|
+
* @prop size?: string | number
|
|
20
21
|
* @prop borderRadius?: "xxl" | "xl" | "l" | "m" | "s" | "xs" | "round" | "circle" | number | { topLeft?: LibRadiuses; topRight?: LibRadiuses; bottomLeft?: LibRadiuses; bottomRight?: LibRadiuses }
|
|
21
22
|
* @prop icons?: { empty?: string | JSX.Element; hover?: string | JSX.Element }
|
|
22
23
|
* @prop iconSizes?: { empty?: number; hover?: number }
|
|
@@ -24,7 +25,7 @@ import type { ILibInputImage } from "./types"
|
|
|
24
25
|
* @prop label?: string
|
|
25
26
|
* @prop labelComment?: string
|
|
26
27
|
* @prop helper?: string
|
|
27
|
-
* @prop helperBottom?: string | { text: string; textColor?: Any color from the library; fontStyle?: CssFontStyle; icon?: string | JSX.Element; iconColor?: Any color from the library; iconSize?: number }
|
|
28
|
+
* @prop helperBottom?: string | { text: string => only if element is not defined; element: ReactChildren => only if text is not defined; textColor?: Any color from the library; fontStyle?: CssFontStyle; icon?: string | JSX.Element; iconColor?: Any color from the library; iconSize?: number }
|
|
28
29
|
* @prop validation?: { status: LibValidationStatus; message?: string; iconNotPassed?: LibIcon; iconNotPassedSize?: number; iconPassed?: LibIcon; iconPassedSize?: number; iconBaseUrl?: string }
|
|
29
30
|
* @prop iconBaseUrl?: string
|
|
30
31
|
* @prop containerStyle?: CSSProperties
|
|
@@ -44,6 +45,7 @@ export const InputImage = forwardRef<HTMLInputElement, ILibInputImage>(
|
|
|
44
45
|
icons,
|
|
45
46
|
iconSizes,
|
|
46
47
|
iconBaseUrl,
|
|
48
|
+
size,
|
|
47
49
|
width = 64,
|
|
48
50
|
height = 64,
|
|
49
51
|
borderRadius = "m",
|
|
@@ -95,8 +97,8 @@ export const InputImage = forwardRef<HTMLInputElement, ILibInputImage>(
|
|
|
95
97
|
hasContainer && className ? "InputLabel" : className
|
|
96
98
|
}
|
|
97
99
|
htmlFor={id}
|
|
98
|
-
$width={width}
|
|
99
|
-
$height={height}
|
|
100
|
+
$width={size ?? width}
|
|
101
|
+
$height={size ?? height}
|
|
100
102
|
$borderRadius={borderRadius}
|
|
101
103
|
$disabled={disabled}
|
|
102
104
|
$validationStatus={validation?.status}
|
|
@@ -60,7 +60,7 @@ const DEFAULT_ICONS_SIZES = {
|
|
|
60
60
|
* @prop label?: string
|
|
61
61
|
* @prop labelComment?: string
|
|
62
62
|
* @prop helper?: string
|
|
63
|
-
* @prop helperBottom?: string | { text: string; textColor?: Any color from the library; fontStyle?: CssFontStyle; icon?: string | JSX.Element; iconColor?: Any color from the library; iconSize?: number }
|
|
63
|
+
* @prop helperBottom?: string | { text: string => only if element is not defined; element: ReactChildren => only if text is not defined; textColor?: Any color from the library; fontStyle?: CssFontStyle; icon?: string | JSX.Element; iconColor?: Any color from the library; iconSize?: number }
|
|
64
64
|
* @prop validation?: { status: LibValidationStatus; message?: string; iconNotPassed?: LibIcon; iconNotPassedSize?: number; iconPassed?: LibIcon; iconPassedSize?: number; iconBaseUrl?: string }
|
|
65
65
|
* @prop iconBaseUrl?: string
|
|
66
66
|
* @prop inputBackground?: "light" | "dark"
|
|
@@ -29,7 +29,7 @@ import type { ILibInputPin } from "./types"
|
|
|
29
29
|
* @prop label?: string
|
|
30
30
|
* @prop labelComment?: string
|
|
31
31
|
* @prop helper?: string
|
|
32
|
-
* @prop helperBottom?: string | { text: string; textColor?: Any color from the library; fontStyle?: CssFontStyle; icon?: string | JSX.Element; iconColor?: Any color from the library; iconSize?: number }
|
|
32
|
+
* @prop helperBottom?: string | { text: string => only if element is not defined; element: ReactChildren => only if text is not defined; textColor?: Any color from the library; fontStyle?: CssFontStyle; icon?: string | JSX.Element; iconColor?: Any color from the library; iconSize?: number }
|
|
33
33
|
* @prop validation?: { status: LibValidationStatus; message?: string; iconNotPassed?: LibIcon; iconNotPassedSize?: number; iconPassed?: LibIcon; iconPassedSize?: number; iconBaseUrl?: string }
|
|
34
34
|
* @prop iconBaseUrl?: string
|
|
35
35
|
* @prop inputBackground?: "light" | "dark"
|
|
@@ -23,7 +23,7 @@ import type { ILibInputSlider } from "./types"
|
|
|
23
23
|
* @prop label?: string
|
|
24
24
|
* @prop labelComment?: string
|
|
25
25
|
* @prop helper?: string
|
|
26
|
-
* @prop helperBottom?: string | { text: string; textColor?: Any color from the library; fontStyle?: CssFontStyle; icon?: string | JSX.Element; iconColor?: Any color from the library; iconSize?: number }
|
|
26
|
+
* @prop helperBottom?: string | { text: string => only if element is not defined; element: ReactChildren => only if text is not defined; textColor?: Any color from the library; fontStyle?: CssFontStyle; icon?: string | JSX.Element; iconColor?: Any color from the library; iconSize?: number }
|
|
27
27
|
* @prop validation?: { status: LibValidationStatus; message?: string; iconNotPassed?: LibIcon; iconNotPassedSize?: number; iconPassed?: LibIcon; iconPassedSize?: number; iconBaseUrl?: string }
|
|
28
28
|
* @prop iconBaseUrl?: string
|
|
29
29
|
* @prop inputBackground?: "light" | "dark"
|
|
@@ -12,14 +12,14 @@ import type { ILibLibIcon } from "./types"
|
|
|
12
12
|
* @prop color?: Any color from the library
|
|
13
13
|
* @prop className?: string
|
|
14
14
|
*/
|
|
15
|
-
export
|
|
15
|
+
export const LibIcon = ({
|
|
16
16
|
"data-testid": testid,
|
|
17
17
|
icon,
|
|
18
18
|
size,
|
|
19
19
|
color,
|
|
20
20
|
className,
|
|
21
21
|
baseUrl,
|
|
22
|
-
}: ILibLibIcon) {
|
|
22
|
+
}: ILibLibIcon) => {
|
|
23
23
|
if (typeof icon !== "string") return icon
|
|
24
24
|
|
|
25
25
|
return (
|
|
@@ -29,7 +29,7 @@ import type { ILibMarkdownEditor } from "./types"
|
|
|
29
29
|
* @prop label?: string
|
|
30
30
|
* @prop labelComment?: string
|
|
31
31
|
* @prop helper?: string
|
|
32
|
-
* @prop helperBottom?: string | { text: string; textColor?: Any color from the library; fontStyle?: CssFontStyle; icon?: string | JSX.Element; iconColor?: Any color from the library; iconSize?: number }
|
|
32
|
+
* @prop helperBottom?: string | { text: string => only if element is not defined; element: ReactChildren => only if text is not defined; textColor?: Any color from the library; fontStyle?: CssFontStyle; icon?: string | JSX.Element; iconColor?: Any color from the library; iconSize?: number }
|
|
33
33
|
* @prop validation?: { status: LibValidationStatus; message?: string; iconNotPassed?: LibIcon; iconNotPassedSize?: number; iconPassed?: LibIcon; iconPassedSize?: number; iconBaseUrl?: string }
|
|
34
34
|
* @prop iconBaseUrl?: string
|
|
35
35
|
* @prop inputBackground?: "light" | "dark"
|
|
@@ -6,14 +6,14 @@ import { mdTitlesButtons } from "../markdown-buttons"
|
|
|
6
6
|
import { TitlesDropdown, TitleDropdownItem } from "../styles"
|
|
7
7
|
import type { ILibMarkdownEditorTitles } from "../subtypes"
|
|
8
8
|
|
|
9
|
-
export
|
|
9
|
+
export const EditorButtonTitles = ({
|
|
10
10
|
"data-testid": testid,
|
|
11
11
|
showButtons,
|
|
12
12
|
className,
|
|
13
13
|
textButtonTitles,
|
|
14
14
|
inputRef,
|
|
15
15
|
addCode,
|
|
16
|
-
}: ILibMarkdownEditorTitles) {
|
|
16
|
+
}: ILibMarkdownEditorTitles) => {
|
|
17
17
|
const [isTextOpen, setIsTextOpen] = useState(false)
|
|
18
18
|
|
|
19
19
|
if (showButtons?.titles === false) return null
|
|
@@ -8,7 +8,7 @@ import { mdEditorButtons } from "../markdown-buttons"
|
|
|
8
8
|
import { IconButton } from "../styles"
|
|
9
9
|
import type { ILibMdEditorButtons } from "../subtypes"
|
|
10
10
|
|
|
11
|
-
export
|
|
11
|
+
export const EditorButtons = ({
|
|
12
12
|
"data-testid": testid,
|
|
13
13
|
className,
|
|
14
14
|
showButtons,
|
|
@@ -17,7 +17,7 @@ export function EditorButtons({
|
|
|
17
17
|
iconsBaseUrl,
|
|
18
18
|
editor,
|
|
19
19
|
setEditor,
|
|
20
|
-
}: ILibMdEditorButtons) {
|
|
20
|
+
}: ILibMdEditorButtons) => {
|
|
21
21
|
return (
|
|
22
22
|
<Flexbox
|
|
23
23
|
data-testid={
|
|
@@ -27,7 +27,7 @@ import type { ILibPageLayout } from "./types"
|
|
|
27
27
|
* @prop main?: ILibMain => imported from Main component, only if template is set to single
|
|
28
28
|
* @prop mainMinHeight?: string | number => only if template is set to single
|
|
29
29
|
*/
|
|
30
|
-
export
|
|
30
|
+
export const PageLayout = ({
|
|
31
31
|
children,
|
|
32
32
|
isLoading,
|
|
33
33
|
pageLoading,
|
|
@@ -40,7 +40,7 @@ export function PageLayout({
|
|
|
40
40
|
template = "single",
|
|
41
41
|
main,
|
|
42
42
|
mainMinHeight = "85vh",
|
|
43
|
-
}: ILibPageLayout) {
|
|
43
|
+
}: ILibPageLayout) => {
|
|
44
44
|
return (
|
|
45
45
|
<>
|
|
46
46
|
{helmet && (
|
|
@@ -4,12 +4,12 @@ import classNames from "classnames"
|
|
|
4
4
|
import { StyledCircle } from "./styles"
|
|
5
5
|
import type { ILibProgressCircle } from "./types"
|
|
6
6
|
|
|
7
|
-
export
|
|
7
|
+
export const Circle = ({
|
|
8
8
|
className,
|
|
9
9
|
value,
|
|
10
10
|
color = "primary",
|
|
11
11
|
noAnimation,
|
|
12
|
-
}: ILibProgressCircle) {
|
|
12
|
+
}: ILibProgressCircle) => {
|
|
13
13
|
const r = 70
|
|
14
14
|
const circ = 2 * Math.PI * r
|
|
15
15
|
const strokePct = ((100 - value) * circ) / 100
|
|
@@ -4,12 +4,12 @@ import { SrOnly } from "../../"
|
|
|
4
4
|
import { Value as StyledValue } from "./styles"
|
|
5
5
|
import type { ILibProgressCircleValue } from "./subtypes"
|
|
6
6
|
|
|
7
|
-
export
|
|
7
|
+
export const Value = ({
|
|
8
8
|
"data-testid": testid,
|
|
9
9
|
className,
|
|
10
10
|
showValue,
|
|
11
11
|
value,
|
|
12
|
-
}: ILibProgressCircleValue) {
|
|
12
|
+
}: ILibProgressCircleValue) => {
|
|
13
13
|
if (!showValue)
|
|
14
14
|
return (
|
|
15
15
|
<SrOnly
|
|
@@ -24,7 +24,7 @@ import type { ILibRating } from "./types"
|
|
|
24
24
|
* @prop label?: string
|
|
25
25
|
* @prop labelComment?: string
|
|
26
26
|
* @prop helper?: string
|
|
27
|
-
* @prop helperBottom?: string | { text: string; textColor?: Any color from the library; fontStyle?: CssFontStyle; icon?: string | JSX.Element; iconColor?: Any color from the library; iconSize?: number }
|
|
27
|
+
* @prop helperBottom?: string | { text: string => only if element is not defined; element: ReactChildren => only if text is not defined; textColor?: Any color from the library; fontStyle?: CssFontStyle; icon?: string | JSX.Element; iconColor?: Any color from the library; iconSize?: number }
|
|
28
28
|
* @prop validation?: { status: LibValidationStatus; message?: string; iconNotPassed?: LibIcon; iconNotPassedSize?: number; iconPassed?: LibIcon; iconPassedSize?: number; iconBaseUrl?: string }
|
|
29
29
|
* @prop iconBaseUrl?: string
|
|
30
30
|
* @prop containerStyle?: CSSProperties
|
|
@@ -7,7 +7,7 @@ import { useLocation } from "react-router-dom"
|
|
|
7
7
|
* @description Scrolls to the top of the page every time the path changes, add it in your PageLayout
|
|
8
8
|
* @link https://documentation-components-react.vercel.app/helpers/reset-scroll
|
|
9
9
|
*/
|
|
10
|
-
export
|
|
10
|
+
export const ResetScroll = () => {
|
|
11
11
|
const { pathname, search } = useLocation()
|
|
12
12
|
|
|
13
13
|
useEffect(() => {
|
|
@@ -39,7 +39,7 @@ import type { ILibSelectButton } from "./subtypes"
|
|
|
39
39
|
* @prop label?: string
|
|
40
40
|
* @prop labelComment?: string
|
|
41
41
|
* @prop helper?: string
|
|
42
|
-
* @prop helperBottom?: string | { text: string; textColor?: Any color from the library; fontStyle?: CssFontStyle; icon?: string | JSX.Element; iconColor?: Any color from the library; iconSize?: number }
|
|
42
|
+
* @prop helperBottom?: string | { text: string => only if element is not defined; element: ReactChildren => only if text is not defined; textColor?: Any color from the library; fontStyle?: CssFontStyle; icon?: string | JSX.Element; iconColor?: Any color from the library; iconSize?: number }
|
|
43
43
|
* @prop validation?: { status: LibValidationStatus; message?: string; iconNotPassed?: LibIcon; iconNotPassedSize?: number; iconPassed?: LibIcon; iconPassedSize?: number; iconBaseUrl?: string }
|
|
44
44
|
* @prop iconBaseUrl?: string
|
|
45
45
|
* @prop inputBackground?: "light" | "dark"
|
|
@@ -8,13 +8,13 @@ import type { ILibSlideshowButton } from "./subtypes"
|
|
|
8
8
|
const DEFAULT_ICON_SIZE_SMALL = 24
|
|
9
9
|
const DEFAULT_ICON_SIZE_LARGE = 32
|
|
10
10
|
|
|
11
|
-
export
|
|
11
|
+
export const SlideshowButton = ({
|
|
12
12
|
"data-testid": testid,
|
|
13
13
|
className,
|
|
14
14
|
onClick,
|
|
15
15
|
position,
|
|
16
16
|
controls,
|
|
17
|
-
}: ILibSlideshowButton) {
|
|
17
|
+
}: ILibSlideshowButton) => {
|
|
18
18
|
const {
|
|
19
19
|
"data-testid": controlTestid,
|
|
20
20
|
className: controlClassName,
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
} from "./styles"
|
|
11
11
|
import type { ILibSlideshowPagination } from "./subtypes"
|
|
12
12
|
|
|
13
|
-
export
|
|
13
|
+
export const SlideshowPagination = ({
|
|
14
14
|
"data-testid": testid,
|
|
15
15
|
className,
|
|
16
16
|
pagination,
|
|
@@ -18,7 +18,7 @@ export function SlideshowPagination({
|
|
|
18
18
|
setActive,
|
|
19
19
|
contentLength,
|
|
20
20
|
activeSlide,
|
|
21
|
-
}: ILibSlideshowPagination) {
|
|
21
|
+
}: ILibSlideshowPagination) => {
|
|
22
22
|
const {
|
|
23
23
|
position = "outside",
|
|
24
24
|
hideOnTouch,
|
|
@@ -41,7 +41,7 @@ import type { ILibTimepicker } from "./types"
|
|
|
41
41
|
* @prop label?: string
|
|
42
42
|
* @prop labelComment?: string
|
|
43
43
|
* @prop helper?: string
|
|
44
|
-
* @prop helperBottom?: string | { text: string; textColor?: Any color from the library; fontStyle?: CssFontStyle; icon?: string | JSX.Element; iconColor?: Any color from the library; iconSize?: number }
|
|
44
|
+
* @prop helperBottom?: string | { text: string => only if element is not defined; element: ReactChildren => only if text is not defined; textColor?: Any color from the library; fontStyle?: CssFontStyle; icon?: string | JSX.Element; iconColor?: Any color from the library; iconSize?: number }
|
|
45
45
|
* @prop validation?: { status: LibValidationStatus; message?: string; iconNotPassed?: LibIcon; iconNotPassedSize?: number; iconPassed?: LibIcon; iconPassedSize?: number; iconBaseUrl?: string }
|
|
46
46
|
* @prop iconBaseUrl?: string
|
|
47
47
|
* @prop inputBackground?: "light" | "dark"
|
|
@@ -10,6 +10,8 @@ import type {
|
|
|
10
10
|
LibToastStatus,
|
|
11
11
|
ReactChildren,
|
|
12
12
|
LibMessageType,
|
|
13
|
+
CssFontStyle,
|
|
14
|
+
LibColorsHover,
|
|
13
15
|
} from "./"
|
|
14
16
|
|
|
15
17
|
/*====================== Base ======================*/
|
|
@@ -512,3 +514,32 @@ export type LibDragListItem =
|
|
|
512
514
|
| DragListItemWithContentAndBadge
|
|
513
515
|
| DragListItemWithContentAndDate
|
|
514
516
|
| DragListItemWithElement
|
|
517
|
+
|
|
518
|
+
/*====================== HelperBottom ======================*/
|
|
519
|
+
|
|
520
|
+
interface HelperBottomWithText {
|
|
521
|
+
text: string
|
|
522
|
+
textColor?: LibAllColors
|
|
523
|
+
fontStyle?: CssFontStyle
|
|
524
|
+
icon?: LibIcon
|
|
525
|
+
iconColor?: LibAllColors
|
|
526
|
+
iconSize?: number
|
|
527
|
+
element?: never
|
|
528
|
+
linkColor?: LibColorsHover
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
interface HelperBottomWithElement {
|
|
532
|
+
text?: never
|
|
533
|
+
textColor?: never
|
|
534
|
+
fontStyle?: never
|
|
535
|
+
icon?: never
|
|
536
|
+
iconColor?: never
|
|
537
|
+
iconSize?: never
|
|
538
|
+
element: ReactChildren
|
|
539
|
+
linkColor?: LibColorsHover
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
export type LibHelperBottom =
|
|
543
|
+
| string
|
|
544
|
+
| HelperBottomWithText
|
|
545
|
+
| HelperBottomWithElement
|