@julseb-lib/react 0.0.13 → 0.0.19
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 +528 -528
- package/dist/index.es.js +5950 -6493
- package/dist/index.umd.js +571 -571
- package/dist/lib/Mixins.tsx +1 -1
- package/dist/lib/components/Accordion/Accordion.tsx +1 -1
- package/dist/lib/components/Accordion/AccordionButton.tsx +3 -3
- package/dist/lib/components/Accordion/AccordionContent.tsx +3 -3
- package/dist/lib/components/Accordion/AccordionItem.tsx +1 -1
- package/dist/lib/components/Alert/Alert.tsx +1 -1
- package/dist/lib/components/Aside/styles.tsx +1 -1
- package/dist/lib/components/Autocomplete/Autocomplete.tsx +2 -2
- package/dist/lib/components/Avatar/Avatar.tsx +1 -1
- package/dist/lib/components/Avatar/AvatarFunction.tsx +1 -1
- package/dist/lib/components/BackToTop/BackToTop.tsx +1 -1
- package/dist/lib/components/Badge/Badge.tsx +1 -1
- package/dist/lib/components/Breadcrumbs/BreadcrumbItem.tsx +3 -3
- package/dist/lib/components/Breadcrumbs/Breadcrumbs.tsx +1 -1
- package/dist/lib/components/Breadcrumbs/BreadcrumbsFn.tsx +1 -1
- package/dist/lib/components/Burger/styles.tsx +1 -1
- package/dist/lib/components/ButtonGroup/ButtonGroup.tsx +1 -1
- package/dist/lib/components/ButtonGroup/ButtonGroupButton.tsx +1 -1
- package/dist/lib/components/ButtonIcon/ButtonIcon.tsx +1 -1
- package/dist/lib/components/ButtonIcon/styles.tsx +1 -1
- package/dist/lib/components/Card/styles.tsx +1 -1
- package/dist/lib/components/Cover/styles.tsx +1 -1
- package/dist/lib/components/Datepicker/Calendar.tsx +3 -3
- package/dist/lib/components/Datepicker/Datepicker.tsx +2 -2
- package/dist/lib/components/DragList/styles.tsx +1 -1
- package/dist/lib/components/Drawer/Drawer.tsx +4 -1
- package/dist/lib/components/Dropdown/Dropdown.tsx +1 -1
- package/dist/lib/components/Dropdown/styles.tsx +1 -1
- package/dist/lib/components/Fallback/Fallback.tsx +1 -1
- package/dist/lib/components/Footer/Footer.tsx +1 -1
- package/dist/lib/components/Footer/FooterLogo.tsx +2 -2
- package/dist/lib/components/Form/styles.tsx +1 -1
- package/dist/lib/components/FullBleed/styles.tsx +1 -1
- package/dist/lib/components/Header/Header.tsx +1 -1
- package/dist/lib/components/Header/HeaderLogo.tsx +2 -2
- package/dist/lib/components/Header/HeaderNav.tsx +14 -19
- package/dist/lib/components/Header/HeaderNavLink.tsx +6 -2
- package/dist/lib/components/Header/HeaderSearch.tsx +2 -2
- package/dist/lib/components/Header/styles.tsx +1 -1
- package/dist/lib/components/Header/types.ts +0 -1
- package/dist/lib/components/Helmet/Helmet.tsx +2 -2
- package/dist/lib/components/Hr/styles.tsx +1 -1
- package/dist/lib/components/Icon/styles.tsx +1 -1
- package/dist/lib/components/Image/styles.tsx +1 -1
- package/dist/lib/components/Input/Input.tsx +1 -1
- package/dist/lib/components/InputCheck/InputCheck.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 +89 -0
- package/dist/lib/components/InputContainer/InputContainer.tsx +12 -90
- package/dist/lib/components/InputContainer/styles.tsx +4 -4
- 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/styles.tsx +1 -1
- 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/InputSlider/styles.tsx +1 -1
- package/dist/lib/components/LibIcon/LibIcon.tsx +2 -2
- package/dist/lib/components/Linkify/Linkify.tsx +1 -1
- package/dist/lib/components/ListGroup/ListGroup.tsx +1 -1
- package/dist/lib/components/ListGroup/styles.tsx +1 -1
- package/dist/lib/components/Loader/styles.tsx +1 -1
- package/dist/lib/components/Main/styles.tsx +1 -1
- 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 +3 -3
- package/dist/lib/components/MarkdownEditor/MdEditorButtons/MarkdownButtons.tsx +1 -1
- package/dist/lib/components/Masonry/Masonry.tsx +1 -1
- package/dist/lib/components/Messaging/Message.tsx +1 -1
- package/dist/lib/components/Messaging/Messaging.tsx +1 -1
- package/dist/lib/components/Modal/Modal.tsx +1 -1
- package/dist/lib/components/PageLayout/PageLayout.tsx +2 -2
- package/dist/lib/components/PageLoading/PageLoading.tsx +1 -1
- package/dist/lib/components/ProgressBar/ProgressBar.tsx +1 -1
- 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 +2 -2
- package/dist/lib/components/ResetScroll/ResetScroll.tsx +1 -1
- package/dist/lib/components/Select/Select.tsx +1 -1
- package/dist/lib/components/Skeleton/styles.tsx +1 -1
- package/dist/lib/components/Slideshow/Slideshow.tsx +1 -1
- package/dist/lib/components/Slideshow/SlideshowButton.tsx +2 -2
- package/dist/lib/components/Slideshow/SlideshowPagination.tsx +3 -3
- package/dist/lib/components/Slideshow/styles.tsx +1 -1
- package/dist/lib/components/Stepper/Stepper.tsx +1 -1
- package/dist/lib/components/Table/Table.tsx +1 -1
- package/dist/lib/components/Tabs/Tabs.tsx +1 -1
- package/dist/lib/components/TextIcon/styles.tsx +1 -1
- package/dist/lib/components/Timepicker/Timepicker.tsx +1 -1
- package/dist/lib/components/Toast/Toast.tsx +1 -1
- package/dist/lib/components/Toast/Toaster.tsx +1 -1
- package/dist/lib/components/Video/styles.tsx +1 -1
- package/dist/lib/components/Youtube/Youtube.tsx +1 -1
- package/dist/lib/components/Youtube/styles.tsx +1 -1
- package/dist/lib/hooks/usePagination.tsx +1 -1
- package/dist/lib/hooks/useTranslation.tsx +1 -1
- package/dist/lib/index.ts +2 -1
- package/dist/lib/lib-utils/get-highlighted-text.tsx +1 -1
- package/dist/lib/types/component-items.ts +28 -0
- package/dist/lib/utils/linkify-text.tsx +1 -1
- package/dist/{styles-DM9qlYpR.js → styles-BCSPldCD.js} +1 -1
- package/dist/{styles-CVN0uFDU.cjs → styles-CtcGw3Gv.cjs} +2 -2
- package/package.json +4 -5
|
@@ -19,7 +19,7 @@ import type { ILibInputButton } from "../types"
|
|
|
19
19
|
* @prop validationStatus: boolean | undefined | undefined
|
|
20
20
|
* @prop className: string | undefined
|
|
21
21
|
*/
|
|
22
|
-
export
|
|
22
|
+
export const InputButton = ({
|
|
23
23
|
"data-testid": testid,
|
|
24
24
|
"aria-label": ariaLabel,
|
|
25
25
|
onClick,
|
|
@@ -31,7 +31,7 @@ export function InputButton({
|
|
|
31
31
|
inputBackground,
|
|
32
32
|
validationStatus,
|
|
33
33
|
className,
|
|
34
|
-
}: ILibInputButton) {
|
|
34
|
+
}: ILibInputButton) => {
|
|
35
35
|
return (
|
|
36
36
|
<StyledInputButton
|
|
37
37
|
aria-label={ariaLabel}
|
|
@@ -20,7 +20,7 @@ import type { ILibInputContainer } from "../../InputContainer/types"
|
|
|
20
20
|
* @prop style: CSSProperties | undefined
|
|
21
21
|
* @prop iconBaseUrl: string | undefined
|
|
22
22
|
*/
|
|
23
|
-
export
|
|
23
|
+
export const InputContainer = ({
|
|
24
24
|
"data-testid": testid,
|
|
25
25
|
id,
|
|
26
26
|
label,
|
|
@@ -36,7 +36,7 @@ export function InputContainer({
|
|
|
36
36
|
hasListOpen,
|
|
37
37
|
iconBaseUrl,
|
|
38
38
|
style,
|
|
39
|
-
}: ILibInputContainer) {
|
|
39
|
+
}: ILibInputContainer) => {
|
|
40
40
|
if (
|
|
41
41
|
!label &&
|
|
42
42
|
!labelComment &&
|
|
@@ -17,7 +17,7 @@ import type { ILibInputIconContainer } from "../types"
|
|
|
17
17
|
* @prop inputBackground: "light" | "dark" | undefined
|
|
18
18
|
* @prop inputVariant: "rounded" | "pill" | undefined
|
|
19
19
|
*/
|
|
20
|
-
export
|
|
20
|
+
export const InputIcon = ({
|
|
21
21
|
"data-testid": testid,
|
|
22
22
|
className,
|
|
23
23
|
icon,
|
|
@@ -27,7 +27,7 @@ export function InputIcon({
|
|
|
27
27
|
inputBackground,
|
|
28
28
|
disabled,
|
|
29
29
|
inputVariant,
|
|
30
|
-
}: ILibInputIconContainer) {
|
|
30
|
+
}: ILibInputIconContainer) => {
|
|
31
31
|
if (!icon) return null
|
|
32
32
|
|
|
33
33
|
return (
|
|
@@ -11,12 +11,12 @@ import type { ILibInputPrefix } from "../types"
|
|
|
11
11
|
* @prop inputBackground: "light" | "dark" | undefined
|
|
12
12
|
* @prop prefix: string | JSX.Element | undefined
|
|
13
13
|
*/
|
|
14
|
-
export
|
|
14
|
+
export const InputPrefix = ({
|
|
15
15
|
"data-testid": testid,
|
|
16
16
|
className,
|
|
17
17
|
prefix,
|
|
18
18
|
inputBackground,
|
|
19
|
-
}: ILibInputPrefix) {
|
|
19
|
+
}: ILibInputPrefix) => {
|
|
20
20
|
if (!prefix) return null
|
|
21
21
|
|
|
22
22
|
return (
|
|
@@ -13,14 +13,14 @@ import type { ILibInputRightContainer } from "../types"
|
|
|
13
13
|
* @prop withBorder: boolean | undefined
|
|
14
14
|
* @prop children?: ReactChildren
|
|
15
15
|
*/
|
|
16
|
-
export
|
|
16
|
+
export const InputRightContainer = ({
|
|
17
17
|
"data-testid": testid,
|
|
18
18
|
className,
|
|
19
19
|
children,
|
|
20
20
|
disabled,
|
|
21
21
|
withPadding,
|
|
22
22
|
withBorder,
|
|
23
|
-
}: ILibInputRightContainer) {
|
|
23
|
+
}: ILibInputRightContainer) => {
|
|
24
24
|
return (
|
|
25
25
|
<StyledInputRightContainer
|
|
26
26
|
data-testid={testid && `${testid}.RightContainer`}
|
|
@@ -11,12 +11,12 @@ import type { ILibInputSuffix } from "../types"
|
|
|
11
11
|
* @prop inputBackground: "light" | "dark" | undefined
|
|
12
12
|
* @prop prefix: string | JSX.Element | undefined
|
|
13
13
|
*/
|
|
14
|
-
export
|
|
14
|
+
export const InputSuffix = ({
|
|
15
15
|
"data-testid": testid,
|
|
16
16
|
className,
|
|
17
17
|
suffix,
|
|
18
18
|
inputBackground,
|
|
19
|
-
}: ILibInputSuffix) {
|
|
19
|
+
}: ILibInputSuffix) => {
|
|
20
20
|
if (!suffix) return null
|
|
21
21
|
|
|
22
22
|
return (
|
|
@@ -6,7 +6,7 @@ import { CloseCircle, CheckCircle } from "../../../icons"
|
|
|
6
6
|
import {
|
|
7
7
|
HelperBottomContainer,
|
|
8
8
|
HelperBottomIconContainer,
|
|
9
|
-
|
|
9
|
+
StyledHelperBottom,
|
|
10
10
|
} from "../../InputContainer/styles"
|
|
11
11
|
import type { ILibInputValidationHelper } from "../types"
|
|
12
12
|
|
|
@@ -17,11 +17,11 @@ import type { ILibInputValidationHelper } from "../types"
|
|
|
17
17
|
* @prop className: string | undefined
|
|
18
18
|
* @prop validation: { status: LibValidationStatus; message?: string; iconNotPassed?: LibIcon; iconNotPassedSize?: number; iconPassed?: LibIcon; iconPassedSize?: number; iconBaseUrl?: string }
|
|
19
19
|
*/
|
|
20
|
-
export
|
|
20
|
+
export const InputValidationHelper = ({
|
|
21
21
|
"data-testid": testid,
|
|
22
22
|
className,
|
|
23
23
|
validation,
|
|
24
|
-
}: ILibInputValidationHelper) {
|
|
24
|
+
}: ILibInputValidationHelper) => {
|
|
25
25
|
const {
|
|
26
26
|
status,
|
|
27
27
|
message,
|
|
@@ -81,7 +81,7 @@ export function InputValidationHelper({
|
|
|
81
81
|
/>
|
|
82
82
|
</HelperBottomIconContainer>
|
|
83
83
|
|
|
84
|
-
<
|
|
84
|
+
<StyledHelperBottom
|
|
85
85
|
data-testid={testid && `${testid}.ValidationHelper.Text`}
|
|
86
86
|
className={className && "ValidationTextBottom"}
|
|
87
87
|
$hasIcon
|
|
@@ -92,7 +92,7 @@ export function InputValidationHelper({
|
|
|
92
92
|
}
|
|
93
93
|
>
|
|
94
94
|
{message}
|
|
95
|
-
</
|
|
95
|
+
</StyledHelperBottom>
|
|
96
96
|
</HelperBottomContainer>
|
|
97
97
|
)
|
|
98
98
|
}
|
|
@@ -15,12 +15,12 @@ const DEFAULT_ICON_SIZE = 16
|
|
|
15
15
|
* @prop inputBackground: "light" | "dark" | undefined
|
|
16
16
|
* @prop validation: { status: LibValidationStatus; message?: string; iconNotPassed?: LibIcon; iconNotPassedSize?: number; iconPassed?: LibIcon; iconPassedSize?: number; iconBaseUrl?: string }
|
|
17
17
|
*/
|
|
18
|
-
export
|
|
18
|
+
export const InputValidationIcon = ({
|
|
19
19
|
"data-testid": testid,
|
|
20
20
|
className,
|
|
21
21
|
validation,
|
|
22
22
|
inputBackground,
|
|
23
|
-
}: ILibInputValidationIcon) {
|
|
23
|
+
}: ILibInputValidationIcon) => {
|
|
24
24
|
const commonIconProps = {
|
|
25
25
|
className: className && "ValidationIcon",
|
|
26
26
|
size: DEFAULT_ICON_SIZE,
|
|
@@ -17,7 +17,7 @@ import type { ILibInputWrapper } from "../types"
|
|
|
17
17
|
* @prop validationStatus: boolean | undefined
|
|
18
18
|
* @prop children?: ReactChildren
|
|
19
19
|
*/
|
|
20
|
-
export
|
|
20
|
+
export const InputWrapper = ({
|
|
21
21
|
"data-testid": testid,
|
|
22
22
|
className,
|
|
23
23
|
hasContainer,
|
|
@@ -27,7 +27,7 @@ export function InputWrapper({
|
|
|
27
27
|
inputBackground,
|
|
28
28
|
inputVariant,
|
|
29
29
|
validationStatus,
|
|
30
|
-
}: ILibInputWrapper) {
|
|
30
|
+
}: ILibInputWrapper) => {
|
|
31
31
|
return (
|
|
32
32
|
<StyledInputWrapper
|
|
33
33
|
data-testid={hasContainer && testid ? `${testid}.Wrapper` : testid}
|
|
@@ -3,15 +3,14 @@
|
|
|
3
3
|
import type { CSSProperties, MouseEventHandler } from "react"
|
|
4
4
|
import type {
|
|
5
5
|
ReactChildren,
|
|
6
|
-
CssFontStyle,
|
|
7
6
|
LibInputListDirection,
|
|
8
|
-
LibAllColors,
|
|
9
7
|
LibIcon,
|
|
10
8
|
LibInputBackground,
|
|
11
9
|
LibInputVariant,
|
|
12
10
|
LibValidationStatus,
|
|
13
11
|
RequireAtLeastOne,
|
|
14
12
|
LibInputPrefixAndSuffix,
|
|
13
|
+
LibHelperBottom,
|
|
15
14
|
} from "../../types"
|
|
16
15
|
|
|
17
16
|
/*====================== Validation ======================*/
|
|
@@ -109,17 +108,7 @@ export interface ILibInputContainer {
|
|
|
109
108
|
label: string | undefined
|
|
110
109
|
labelComment: string | undefined
|
|
111
110
|
helper: string | undefined
|
|
112
|
-
helperBottom:
|
|
113
|
-
| string
|
|
114
|
-
| {
|
|
115
|
-
text: string
|
|
116
|
-
textColor?: LibAllColors
|
|
117
|
-
fontStyle?: CssFontStyle
|
|
118
|
-
icon?: LibIcon
|
|
119
|
-
iconColor?: LibAllColors
|
|
120
|
-
iconSize?: number
|
|
121
|
-
}
|
|
122
|
-
| undefined
|
|
111
|
+
helperBottom: LibHelperBottom | undefined
|
|
123
112
|
validation: LibValidationHelper | undefined
|
|
124
113
|
children?: ReactChildren
|
|
125
114
|
value: any | undefined
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/*=============================================== HelperBottom ===============================================*/
|
|
2
|
+
|
|
3
|
+
import type { FC } from "react"
|
|
4
|
+
import { LibIcon } from "../LibIcon"
|
|
5
|
+
import { getIconSizeFromFont } from "../../lib-utils"
|
|
6
|
+
import {
|
|
7
|
+
StyledHelperBottom,
|
|
8
|
+
HelperBottomContainer,
|
|
9
|
+
HelperBottomIconContainer,
|
|
10
|
+
} from "./styles"
|
|
11
|
+
import type { ILibHelperBottom } from "./subtypes"
|
|
12
|
+
|
|
13
|
+
export const HelperBottom: FC<ILibHelperBottom> = ({
|
|
14
|
+
"data-testid": testid,
|
|
15
|
+
className,
|
|
16
|
+
helperBottom,
|
|
17
|
+
iconBaseUrl,
|
|
18
|
+
}) => {
|
|
19
|
+
if (typeof helperBottom === "string") {
|
|
20
|
+
return <StyledHelperBottom>{helperBottom}</StyledHelperBottom>
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
if (typeof helperBottom === "object") {
|
|
24
|
+
const {
|
|
25
|
+
element,
|
|
26
|
+
text,
|
|
27
|
+
textColor,
|
|
28
|
+
fontStyle,
|
|
29
|
+
icon,
|
|
30
|
+
iconColor = "primary",
|
|
31
|
+
iconSize = getIconSizeFromFont("small") as number,
|
|
32
|
+
} = helperBottom
|
|
33
|
+
|
|
34
|
+
if (element) return <StyledHelperBottom>{element}</StyledHelperBottom>
|
|
35
|
+
|
|
36
|
+
if (icon)
|
|
37
|
+
return (
|
|
38
|
+
<HelperBottomContainer
|
|
39
|
+
data-testid={testid && `${testid}.HelperBottomContainer`}
|
|
40
|
+
className={className && "HelperBottomContainer"}
|
|
41
|
+
>
|
|
42
|
+
<HelperBottomIconContainer
|
|
43
|
+
data-testid={
|
|
44
|
+
testid && `${testid}.HelperBottom.IconContainer`
|
|
45
|
+
}
|
|
46
|
+
className={className && "BottomIconContainer"}
|
|
47
|
+
$iconSize={iconSize}
|
|
48
|
+
>
|
|
49
|
+
<LibIcon
|
|
50
|
+
data-testid={
|
|
51
|
+
testid &&
|
|
52
|
+
`${testid}.HelperBottom.IconContainer.Icon`
|
|
53
|
+
}
|
|
54
|
+
className={className && "HelperBottomIcon"}
|
|
55
|
+
icon={icon}
|
|
56
|
+
color={iconColor}
|
|
57
|
+
size={iconSize || getIconSizeFromFont("small")}
|
|
58
|
+
baseUrl={iconBaseUrl}
|
|
59
|
+
/>
|
|
60
|
+
</HelperBottomIconContainer>
|
|
61
|
+
|
|
62
|
+
<StyledHelperBottom
|
|
63
|
+
data-testid={testid && `${testid}.HelperBottom.Text`}
|
|
64
|
+
className={className && "HelperBottomText"}
|
|
65
|
+
color={textColor}
|
|
66
|
+
$fontStyle={fontStyle}
|
|
67
|
+
$iconSize={iconSize}
|
|
68
|
+
$hasIcon
|
|
69
|
+
>
|
|
70
|
+
{helperBottom.text}
|
|
71
|
+
</StyledHelperBottom>
|
|
72
|
+
</HelperBottomContainer>
|
|
73
|
+
)
|
|
74
|
+
|
|
75
|
+
return (
|
|
76
|
+
<StyledHelperBottom
|
|
77
|
+
data-testid={testid && `${testid}.HelperBottom`}
|
|
78
|
+
className={className && "HelperBottom"}
|
|
79
|
+
color={textColor}
|
|
80
|
+
$fontStyle={fontStyle}
|
|
81
|
+
$hasIcon={false}
|
|
82
|
+
>
|
|
83
|
+
{text}
|
|
84
|
+
</StyledHelperBottom>
|
|
85
|
+
)
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
return null
|
|
89
|
+
}
|
|
@@ -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 && (
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import type { FC } from "react"
|
|
4
4
|
import styled from "styled-components"
|
|
5
|
-
import { stringifyPx } from "
|
|
5
|
+
import { stringifyPx } from "@julseb-lib/utils"
|
|
6
6
|
import {
|
|
7
7
|
setDefaultTheme,
|
|
8
8
|
Mixins,
|
|
@@ -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}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*=============================================== InputImage styles ===============================================*/
|
|
2
2
|
|
|
3
3
|
import styled, { css } from "styled-components"
|
|
4
|
-
import { stringifyPx } from "
|
|
4
|
+
import { stringifyPx } from "@julseb-lib/utils"
|
|
5
5
|
import {
|
|
6
6
|
BREAKPOINTS,
|
|
7
7
|
Image,
|
|
@@ -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"
|