@julseb-lib/react 0.0.9 → 0.0.11
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 +1128 -1128
- package/dist/index.es.js +5443 -5111
- package/dist/index.umd.js +653 -653
- package/dist/lib/Mixins.tsx +2 -2
- package/dist/lib/components/Header/Header.tsx +11 -2
- package/dist/lib/components/Header/HeaderNav.tsx +14 -9
- package/dist/lib/components/Header/subtypes.ts +2 -2
- package/dist/lib/components/Header/types.ts +11 -2
- package/dist/lib/context/Theme.context.tsx +3 -5
- package/dist/lib/context/Toaster/Toaster.context.tsx +4 -6
- package/dist/lib/context/Toaster/toast.reducer.ts +2 -2
- package/dist/lib/hooks/useClickOutside.tsx +2 -2
- package/dist/lib/hooks/useCopyToClipboard.tsx +1 -1
- package/dist/lib/hooks/useDebounce.tsx +1 -1
- package/dist/lib/hooks/useExportData.tsx +7 -2
- package/dist/lib/hooks/useFetch.tsx +1 -1
- package/dist/lib/hooks/useForm.tsx +2 -2
- package/dist/lib/hooks/useKeyPress.tsx +2 -2
- package/dist/lib/hooks/useMaxWidth.tsx +1 -1
- package/dist/lib/hooks/useMergeRefs.ts +2 -2
- package/dist/lib/hooks/useMinWidth.tsx +1 -1
- package/dist/lib/hooks/usePaginatedData.tsx +7 -2
- package/dist/lib/hooks/usePagination.tsx +2 -2
- package/dist/lib/hooks/useTouchScreen.tsx +1 -1
- package/dist/lib/hooks/useTranslation.tsx +1 -1
- package/dist/lib/icons/ArrowUp.tsx +2 -2
- package/dist/lib/icons/Bold.tsx +2 -2
- package/dist/lib/icons/Calendar.tsx +2 -2
- package/dist/lib/icons/CaretDown.tsx +2 -2
- package/dist/lib/icons/Check.tsx +2 -2
- package/dist/lib/icons/CheckCircle.tsx +2 -2
- package/dist/lib/icons/ChevronDown.tsx +2 -2
- package/dist/lib/icons/ChevronLeft.tsx +2 -2
- package/dist/lib/icons/ChevronRight.tsx +2 -2
- package/dist/lib/icons/ChevronUp.tsx +2 -2
- package/dist/lib/icons/Clipboard.tsx +2 -2
- package/dist/lib/icons/Clock.tsx +2 -2
- package/dist/lib/icons/Close.tsx +2 -2
- package/dist/lib/icons/CloseCircle.tsx +2 -2
- package/dist/lib/icons/Code.tsx +2 -2
- package/dist/lib/icons/CodeBlock.tsx +2 -2
- package/dist/lib/icons/Comment.tsx +2 -2
- package/dist/lib/icons/Drag.tsx +2 -2
- package/dist/lib/icons/Edit.tsx +2 -2
- package/dist/lib/icons/EditorCode.tsx +2 -2
- package/dist/lib/icons/EditorLive.tsx +2 -2
- package/dist/lib/icons/EditorPreview.tsx +2 -2
- package/dist/lib/icons/Hide.tsx +2 -2
- package/dist/lib/icons/Image.tsx +2 -2
- package/dist/lib/icons/Italic.tsx +2 -2
- package/dist/lib/icons/Link.tsx +2 -2
- package/dist/lib/icons/Minus.tsx +2 -2
- package/dist/lib/icons/OrderedList.tsx +2 -2
- package/dist/lib/icons/Plus.tsx +2 -2
- package/dist/lib/icons/Quote.tsx +2 -2
- package/dist/lib/icons/Search.tsx +2 -2
- package/dist/lib/icons/Send.tsx +2 -2
- package/dist/lib/icons/Separator.tsx +2 -2
- package/dist/lib/icons/Show.tsx +2 -2
- package/dist/lib/icons/Star.tsx +2 -2
- package/dist/lib/icons/StarFull.tsx +2 -2
- package/dist/lib/icons/Strikethrough.tsx +2 -2
- package/dist/lib/icons/Underline.tsx +2 -2
- package/dist/lib/icons/UnorderedList.tsx +2 -2
- package/dist/lib/lib-utils/append-styles.ts +1 -1
- package/dist/lib/lib-utils/get-icon-size-from-font.ts +1 -1
- package/dist/lib/lib-utils/round-icon-size.ts +1 -1
- package/dist/lib/lib-utils/transfom-search-keys.ts +1 -1
- package/dist/lib/utils/StyleSheetManager.tsx +4 -3
- package/dist/lib/utils/linkify-text.tsx +1 -1
- package/dist/lib/utils/set-default-theme.ts +1 -1
- package/package.json +2 -1
package/dist/lib/Mixins.tsx
CHANGED
|
@@ -51,10 +51,10 @@ type ILibIconMixin = {
|
|
|
51
51
|
$isLibIcon?: boolean
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
|
|
54
|
+
const getColorMixinFromTheme = (
|
|
55
55
|
theme: DefaultTheme | null = COLORS_LIGHT,
|
|
56
56
|
themeName?: LibThemeNames
|
|
57
|
-
) {
|
|
57
|
+
) => {
|
|
58
58
|
let THEME: DefaultTheme
|
|
59
59
|
|
|
60
60
|
if (themeName) {
|
|
@@ -52,6 +52,7 @@ export const Header = forwardRef<HTMLDivElement, ILibHeader>(
|
|
|
52
52
|
position = "relative",
|
|
53
53
|
hideOnScroll,
|
|
54
54
|
links,
|
|
55
|
+
nav,
|
|
55
56
|
enableScrollingOpen,
|
|
56
57
|
...rest
|
|
57
58
|
},
|
|
@@ -171,7 +172,11 @@ export const Header = forwardRef<HTMLDivElement, ILibHeader>(
|
|
|
171
172
|
{typeof logo === "object" ? logo.text : logo}
|
|
172
173
|
</HeaderLogo>
|
|
173
174
|
|
|
174
|
-
{navDesktopVariant === "left" &&
|
|
175
|
+
{navDesktopVariant === "left" && nav ? (
|
|
176
|
+
nav
|
|
177
|
+
) : (
|
|
178
|
+
<HeaderNav {...navProps} />
|
|
179
|
+
)}
|
|
175
180
|
|
|
176
181
|
{!isMobile && navDesktopVariant === "right" && (
|
|
177
182
|
<HeaderSearch {...searchProps} />
|
|
@@ -181,7 +186,11 @@ export const Header = forwardRef<HTMLDivElement, ILibHeader>(
|
|
|
181
186
|
<HeaderBurger {...burgerProps} />
|
|
182
187
|
)}
|
|
183
188
|
|
|
184
|
-
{navDesktopVariant === "right" &&
|
|
189
|
+
{navDesktopVariant === "right" && nav ? (
|
|
190
|
+
nav
|
|
191
|
+
) : (
|
|
192
|
+
<HeaderNav {...navProps} />
|
|
193
|
+
)}
|
|
185
194
|
|
|
186
195
|
{isMobile && navMobileVariant === "drawer" && (
|
|
187
196
|
<Overlay
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*=============================================== HeaderNav ===============================================*/
|
|
2
2
|
|
|
3
|
-
import { useRef, type ReactNode } from "react"
|
|
3
|
+
import { useRef, isValidElement, type ReactNode, Fragment } from "react"
|
|
4
4
|
import classNames from "classnames"
|
|
5
5
|
import { uuid } from "ts-utils-julseb"
|
|
6
6
|
import { useMaxWidth, useClickOutside } from "../../"
|
|
@@ -8,6 +8,7 @@ import { HeaderNavLink } from "./HeaderNavLink"
|
|
|
8
8
|
import { HeaderSearch } from "./HeaderSearch"
|
|
9
9
|
import { Nav } from "./styles"
|
|
10
10
|
import type { ILibHeaderNav } from "./subtypes"
|
|
11
|
+
import { LibHeaderLink } from "../../types"
|
|
11
12
|
|
|
12
13
|
export function HeaderNav({
|
|
13
14
|
"data-testid": testid,
|
|
@@ -63,14 +64,18 @@ export function HeaderNav({
|
|
|
63
64
|
)}
|
|
64
65
|
|
|
65
66
|
{links
|
|
66
|
-
? links.map(link =>
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
67
|
+
? links.map(link =>
|
|
68
|
+
isValidElement(link) ? (
|
|
69
|
+
<Fragment>{link}</Fragment>
|
|
70
|
+
) : (
|
|
71
|
+
<HeaderNavLink
|
|
72
|
+
data-testid={testid}
|
|
73
|
+
className={className}
|
|
74
|
+
link={link as LibHeaderLink | JSX.Element}
|
|
75
|
+
key={uuid()}
|
|
76
|
+
/>
|
|
77
|
+
)
|
|
78
|
+
)
|
|
74
79
|
: null}
|
|
75
80
|
|
|
76
81
|
{children && children}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*=============================================== Header sub components types ===============================================*/
|
|
2
2
|
|
|
3
|
-
import type { RefObject } from "react"
|
|
3
|
+
import type { FC, RefObject } from "react"
|
|
4
4
|
import type { LibHeaderLink, LibLink } from "../../types"
|
|
5
5
|
import type { ILibHeader } from "./types"
|
|
6
6
|
|
|
@@ -53,7 +53,7 @@ export interface ILibHeaderLogo
|
|
|
53
53
|
export interface ILibHeaderNavLink {
|
|
54
54
|
"data-testid": string | undefined
|
|
55
55
|
className: string | undefined
|
|
56
|
-
link: LibHeaderLink
|
|
56
|
+
link: LibHeaderLink | JSX.Element | FC
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
/*====================== HeaderSearch ======================*/
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/*=============================================== Header types ===============================================*/
|
|
2
2
|
|
|
3
|
+
import type { FC } from "react"
|
|
3
4
|
import type {
|
|
4
5
|
LibComponentBase,
|
|
5
6
|
LibHeaderPosition,
|
|
@@ -55,13 +56,21 @@ interface HeaderFixed extends ILibHeaderBase {
|
|
|
55
56
|
type HeaderPosition = HeaderNotFixed | HeaderFixed
|
|
56
57
|
|
|
57
58
|
type HeaderWithLinks = HeaderPosition & {
|
|
58
|
-
links: Array<LibHeaderLink>
|
|
59
|
+
links: Array<LibHeaderLink | JSX.Element>
|
|
60
|
+
nav?: never
|
|
61
|
+
children?: never
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
type HeaderWithNav = HeaderPosition & {
|
|
65
|
+
links: Array<LibHeaderLink | JSX.Element>
|
|
66
|
+
nav?: JSX.Element | FC
|
|
59
67
|
children?: never
|
|
60
68
|
}
|
|
61
69
|
|
|
62
70
|
type HeaderWithChildren = HeaderPosition & {
|
|
63
71
|
links?: never
|
|
72
|
+
nav?: never
|
|
64
73
|
children?: ReactChildren
|
|
65
74
|
}
|
|
66
75
|
|
|
67
|
-
export type ILibHeader = HeaderWithLinks | HeaderWithChildren
|
|
76
|
+
export type ILibHeader = HeaderWithLinks | HeaderWithNav | HeaderWithChildren
|
|
@@ -19,10 +19,10 @@ interface ILibThemeProvider {
|
|
|
19
19
|
* @prop stylesheetManager?: boolean | IStyleSheetManager => import IStyleSheetManager from "styled-components"
|
|
20
20
|
* @prop children?: ReactChildren
|
|
21
21
|
*/
|
|
22
|
-
export
|
|
22
|
+
export const ThemeProviderWrapper = ({
|
|
23
23
|
children,
|
|
24
24
|
stylesheetManager,
|
|
25
|
-
}: ILibThemeProvider) {
|
|
25
|
+
}: ILibThemeProvider) => {
|
|
26
26
|
const [selectedTheme, setSelectedTheme] = useState<
|
|
27
27
|
LibThemeNames | undefined
|
|
28
28
|
>(undefined)
|
|
@@ -91,6 +91,4 @@ export function ThemeProviderWrapper({
|
|
|
91
91
|
* @prop selectedTheme: "light" | "dark" | undefined
|
|
92
92
|
* @prop toggleTheme: () => void
|
|
93
93
|
*/
|
|
94
|
-
export
|
|
95
|
-
return useContext(ThemeContext) as ILibThemeContext
|
|
96
|
-
}
|
|
94
|
+
export const useLibTheme = () => useContext(ThemeContext) as ILibThemeContext
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*=============================================== Toaster context ===============================================*/
|
|
2
2
|
|
|
3
3
|
import { createContext, useReducer, useContext } from "react"
|
|
4
|
-
import { uuid } from "
|
|
4
|
+
import { uuid } from "@julseb-lib/utils"
|
|
5
5
|
import { Toaster } from "../../components/Toast/Toaster"
|
|
6
6
|
import { toastReducer } from "./toast.reducer"
|
|
7
7
|
import type {
|
|
@@ -47,13 +47,13 @@ const initialState = {
|
|
|
47
47
|
* @prop toastOptions?: { duration?: number; labelClose?: string; withTimer?: boolean }
|
|
48
48
|
* @prop position?: "top-left" | "top-right" | "bottom-left" | "bottom-right"
|
|
49
49
|
*/
|
|
50
|
-
export
|
|
50
|
+
export const ToasterProviderWrapper = ({
|
|
51
51
|
"data-testid": testid,
|
|
52
52
|
className,
|
|
53
53
|
children,
|
|
54
54
|
toastOptions,
|
|
55
55
|
position,
|
|
56
|
-
}: ILibToasterProvider) {
|
|
56
|
+
}: ILibToasterProvider) => {
|
|
57
57
|
const [state, dispatch] = useReducer(toastReducer, initialState)
|
|
58
58
|
|
|
59
59
|
const addToast = (
|
|
@@ -127,6 +127,4 @@ export function ToasterProviderWrapper({
|
|
|
127
127
|
* @function loading
|
|
128
128
|
* @function remove
|
|
129
129
|
*/
|
|
130
|
-
export
|
|
131
|
-
return useContext(ToastContext) as ILibToasterContext
|
|
132
|
-
}
|
|
130
|
+
export const useToast = () => useContext(ToastContext) as ILibToasterContext
|
|
@@ -4,13 +4,13 @@ import type { LibToast } from "../../types"
|
|
|
4
4
|
|
|
5
5
|
type ToastAction = "ADD_TOAST" | "DELETE_TOAST"
|
|
6
6
|
|
|
7
|
-
export
|
|
7
|
+
export const toastReducer = (
|
|
8
8
|
state: { toasts: Array<LibToast> },
|
|
9
9
|
action: {
|
|
10
10
|
type: ToastAction
|
|
11
11
|
payload: any
|
|
12
12
|
}
|
|
13
|
-
) {
|
|
13
|
+
) => {
|
|
14
14
|
switch (action.type) {
|
|
15
15
|
case "ADD_TOAST":
|
|
16
16
|
return {
|
|
@@ -10,10 +10,10 @@ type Event = MouseEvent | TouchEvent
|
|
|
10
10
|
* @argument ref: RefObject<T>,
|
|
11
11
|
* @argument handler: (event: Event) => void
|
|
12
12
|
*/
|
|
13
|
-
export
|
|
13
|
+
export const useClickOutside = <T extends HTMLElement = HTMLElement>(
|
|
14
14
|
ref: RefObject<T>,
|
|
15
15
|
handler: (event: Event) => void
|
|
16
|
-
) {
|
|
16
|
+
) => {
|
|
17
17
|
useEffect(() => {
|
|
18
18
|
const listener = (e: Event) => {
|
|
19
19
|
const target = e.target as HTMLElement
|
|
@@ -9,7 +9,7 @@ type CopyFn = (text: string) => Promise<boolean>
|
|
|
9
9
|
* @description Hook to trigger a function to copy content
|
|
10
10
|
* @link https://documentation-components-react.vercel.app/helpers/hooks#useCopyToClipboard
|
|
11
11
|
*/
|
|
12
|
-
export
|
|
12
|
+
export const useCopyToClipboard = (): [CopiedValue, CopyFn] => {
|
|
13
13
|
const [copiedText, setCopiedText] = useState<CopiedValue>(null)
|
|
14
14
|
|
|
15
15
|
const copy: CopyFn = async text => {
|
|
@@ -8,7 +8,7 @@ import { useState, useEffect } from "react"
|
|
|
8
8
|
* @argument value: <T> => type to define
|
|
9
9
|
* @argument delay?: number
|
|
10
10
|
*/
|
|
11
|
-
export
|
|
11
|
+
export const useDebounce = <T,>(value: T, delay: number = 1000) => {
|
|
12
12
|
const [debouncedValue, setDebouncedValue] = useState<T>(value)
|
|
13
13
|
|
|
14
14
|
useEffect(() => {
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
/*=============================================== useTableSorting ===============================================*/
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
interface IDownloadFile {
|
|
4
|
+
blob: Blob
|
|
5
|
+
fileName: string
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
const downloadFile = ({ blob, fileName }: IDownloadFile) => {
|
|
4
9
|
const a = document.createElement("a")
|
|
5
10
|
a.download = fileName
|
|
6
11
|
a.href = window.URL.createObjectURL(blob)
|
|
@@ -17,7 +22,7 @@ function downloadFile({ blob, fileName }: { blob: Blob; fileName: string }) {
|
|
|
17
22
|
* @description Hook to export data to JSON or CSV
|
|
18
23
|
* @link https://documentation-components-react.vercel.app/helpers/hooks#useExportData
|
|
19
24
|
*/
|
|
20
|
-
export
|
|
25
|
+
export const useExportData = <T,>() => {
|
|
21
26
|
const exportToJson = (data: Array<T>, fileName: string) =>
|
|
22
27
|
downloadFile({
|
|
23
28
|
blob: new Blob([JSON.stringify(data)], {
|
|
@@ -8,7 +8,7 @@ import { useEffect, useState } from "react"
|
|
|
8
8
|
* @argument fetchFunction: Promise<T> => to define
|
|
9
9
|
* @argument dependencies?: any
|
|
10
10
|
*/
|
|
11
|
-
export
|
|
11
|
+
export const useFetch = <T,>(fetchFunction: Promise<T>, dependencies?: any) => {
|
|
12
12
|
const [response, setResponse] = useState<T | null>(null)
|
|
13
13
|
const [loading, setLoading] = useState(true)
|
|
14
14
|
const [error, setError] = useState<any>(undefined)
|
|
@@ -8,10 +8,10 @@ import { useState, type ChangeEvent } from "react"
|
|
|
8
8
|
* @argument initialState = {} as T => type to define
|
|
9
9
|
* @argument onSubmit?: (formData: T) => void
|
|
10
10
|
*/
|
|
11
|
-
export
|
|
11
|
+
export const useForm = <T,>(
|
|
12
12
|
initialState = {} as T,
|
|
13
13
|
onSubmit?: (formData: T) => void
|
|
14
|
-
) {
|
|
14
|
+
) => {
|
|
15
15
|
const [formData, setFormData] = useState(initialState)
|
|
16
16
|
|
|
17
17
|
const handleInputs = (e: ChangeEvent<HTMLInputElement>) =>
|
|
@@ -8,11 +8,11 @@ import { useEffect } from "react"
|
|
|
8
8
|
* @argument keyCodes: string | Array<string>
|
|
9
9
|
* @argument callback: () => void
|
|
10
10
|
*/
|
|
11
|
-
export
|
|
11
|
+
export const useKeyPress = (
|
|
12
12
|
keyCodes: string | Array<string>,
|
|
13
13
|
callback: () => void,
|
|
14
14
|
excludeKeys?: Array<string>
|
|
15
|
-
): void {
|
|
15
|
+
): void => {
|
|
16
16
|
useEffect(() => {
|
|
17
17
|
const singleHandler = ({ code }: KeyboardEvent) => {
|
|
18
18
|
if (keyCodes.includes(code)) {
|
|
@@ -7,7 +7,7 @@ import { useState, useEffect } from "react"
|
|
|
7
7
|
* @link https://documentation-components-react.vercel.app/helpers/hooks#useMaxWidth
|
|
8
8
|
* @argument width: number
|
|
9
9
|
*/
|
|
10
|
-
export
|
|
10
|
+
export const useMaxWidth = (width: number): boolean => {
|
|
11
11
|
const [isMax, setIsMax] = useState<boolean>(false)
|
|
12
12
|
|
|
13
13
|
useEffect(() => {
|
|
@@ -12,9 +12,9 @@ import {
|
|
|
12
12
|
* @link https://documentation-components-react.vercel.app/helpers/hooks#useMergeRefs
|
|
13
13
|
* @argument refs: Array<Ref<Instance> | undefined>
|
|
14
14
|
*/
|
|
15
|
-
export
|
|
15
|
+
export const useMergeRefs = <Instance>(
|
|
16
16
|
refs: Array<Ref<Instance> | undefined>
|
|
17
|
-
): RefCallback<Instance> | null {
|
|
17
|
+
): RefCallback<Instance> | null => {
|
|
18
18
|
return useMemo(() => {
|
|
19
19
|
if (refs.every(ref => ref == null)) {
|
|
20
20
|
return null
|
|
@@ -7,7 +7,7 @@ import { useState, useEffect } from "react"
|
|
|
7
7
|
* @link https://documentation-components-react.vercel.app/helpers/hooks#useMinWidth
|
|
8
8
|
* @argument width: number
|
|
9
9
|
*/
|
|
10
|
-
export
|
|
10
|
+
export const useMinWidth = (width: number): boolean => {
|
|
11
11
|
const [isMin, setIsMin] = useState<boolean>(false)
|
|
12
12
|
|
|
13
13
|
useEffect(() => {
|
|
@@ -2,16 +2,21 @@
|
|
|
2
2
|
|
|
3
3
|
import { useSearchParams } from "react-router-dom"
|
|
4
4
|
|
|
5
|
+
interface IUsePaginatedData<T> {
|
|
6
|
+
paginatedData: Array<T>
|
|
7
|
+
totalPages: number
|
|
8
|
+
}
|
|
9
|
+
|
|
5
10
|
/**
|
|
6
11
|
* @description Hook to use with Pagination or Paginator components
|
|
7
12
|
* @link https://documentation-components-react.vercel.app/helpers/hooks#usePaginatedData
|
|
8
13
|
* @argument data: Array<T> => to define
|
|
9
14
|
* @argument defaultLimit?: number
|
|
10
15
|
*/
|
|
11
|
-
export
|
|
16
|
+
export const usePaginatedData = <T,>(
|
|
12
17
|
data: Array<T>,
|
|
13
18
|
defaultLimit = 20
|
|
14
|
-
):
|
|
19
|
+
): IUsePaginatedData<T> => {
|
|
15
20
|
const [query] = useSearchParams()
|
|
16
21
|
const page = query.get("page") || 1
|
|
17
22
|
const currentPage: number =
|
|
@@ -20,12 +20,12 @@ interface ILibUsePaginationNavigation {
|
|
|
20
20
|
* @prop queries?: Array<Array<string>>
|
|
21
21
|
* @prop totalPages?: number
|
|
22
22
|
*/
|
|
23
|
-
export
|
|
23
|
+
export const usePagination = ({
|
|
24
24
|
currentPage,
|
|
25
25
|
setCurrentPage,
|
|
26
26
|
queries,
|
|
27
27
|
totalPages,
|
|
28
|
-
}: ILibUsePaginationNavigation) {
|
|
28
|
+
}: ILibUsePaginationNavigation) => {
|
|
29
29
|
const [_, setSearchParams] = useSearchParams()
|
|
30
30
|
|
|
31
31
|
const handlePrev = useCallback(() => {
|
|
@@ -6,7 +6,7 @@ import { useState, useLayoutEffect } from "react"
|
|
|
6
6
|
* @description Hook to detect if the device is a touch screen
|
|
7
7
|
* @link https://documentation-components-react.vercel.app/helpers/hooks#useTouchScreen
|
|
8
8
|
*/
|
|
9
|
-
export
|
|
9
|
+
export const useTouchScreen = (): boolean => {
|
|
10
10
|
const [isTouchScreen, setIsTouchScreen] = useState<boolean>(false)
|
|
11
11
|
|
|
12
12
|
useLayoutEffect(() => {
|
|
@@ -11,7 +11,7 @@ let currentLanguage = detectLanguage() || "en"
|
|
|
11
11
|
* @link https://documentation-components-react.vercel.app/helpers/hooks#useTranslation
|
|
12
12
|
* @argument translations: [language: string]: { [key: string]: string }
|
|
13
13
|
*/
|
|
14
|
-
export
|
|
14
|
+
export const useTranslation = (translations: TranslateLang) => {
|
|
15
15
|
const [language, setLanguage] = useState<string>(currentLanguage)
|
|
16
16
|
const languages = Object.keys(translations)
|
|
17
17
|
|
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
import { StyledIcon } from "./styles"
|
|
4
4
|
import type { ILibIcon } from "./types"
|
|
5
5
|
|
|
6
|
-
export
|
|
6
|
+
export const ArrowUp = ({
|
|
7
7
|
"data-testid": testid,
|
|
8
8
|
className,
|
|
9
9
|
size = 64,
|
|
10
10
|
color = "currentColor",
|
|
11
11
|
...rest
|
|
12
|
-
}: ILibIcon) {
|
|
12
|
+
}: ILibIcon) => {
|
|
13
13
|
return (
|
|
14
14
|
<StyledIcon
|
|
15
15
|
data-testid={testid}
|
package/dist/lib/icons/Bold.tsx
CHANGED
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
import { StyledIcon } from "./styles"
|
|
4
4
|
import type { ILibIcon } from "./types"
|
|
5
5
|
|
|
6
|
-
export
|
|
6
|
+
export const Bold = ({
|
|
7
7
|
"data-testid": testid,
|
|
8
8
|
className,
|
|
9
9
|
size = 64,
|
|
10
10
|
color = "currentColor",
|
|
11
11
|
...rest
|
|
12
|
-
}: ILibIcon) {
|
|
12
|
+
}: ILibIcon) => {
|
|
13
13
|
return (
|
|
14
14
|
<StyledIcon
|
|
15
15
|
data-testid={testid}
|
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
import { StyledIcon } from "./styles"
|
|
4
4
|
import type { ILibIcon } from "./types"
|
|
5
5
|
|
|
6
|
-
export
|
|
6
|
+
export const Calendar = ({
|
|
7
7
|
"data-testid": testid,
|
|
8
8
|
className,
|
|
9
9
|
size = 64,
|
|
10
10
|
color = "currentColor",
|
|
11
11
|
...rest
|
|
12
|
-
}: ILibIcon) {
|
|
12
|
+
}: ILibIcon) => {
|
|
13
13
|
return (
|
|
14
14
|
<StyledIcon
|
|
15
15
|
data-testid={testid}
|
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
import { StyledIcon } from "./styles"
|
|
4
4
|
import type { ILibIcon } from "./types"
|
|
5
5
|
|
|
6
|
-
export
|
|
6
|
+
export const CaretDown = ({
|
|
7
7
|
"data-testid": testid,
|
|
8
8
|
className,
|
|
9
9
|
size = 64,
|
|
10
10
|
color = "currentColor",
|
|
11
11
|
...rest
|
|
12
|
-
}: ILibIcon) {
|
|
12
|
+
}: ILibIcon) => {
|
|
13
13
|
return (
|
|
14
14
|
<StyledIcon
|
|
15
15
|
data-testid={testid}
|
package/dist/lib/icons/Check.tsx
CHANGED
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
import { StyledIcon } from "./styles"
|
|
4
4
|
import type { ILibIcon } from "./types"
|
|
5
5
|
|
|
6
|
-
export
|
|
6
|
+
export const Check = ({
|
|
7
7
|
"data-testid": testid,
|
|
8
8
|
className,
|
|
9
9
|
size = 64,
|
|
10
10
|
color = "currentColor",
|
|
11
11
|
...rest
|
|
12
|
-
}: ILibIcon) {
|
|
12
|
+
}: ILibIcon) => {
|
|
13
13
|
return (
|
|
14
14
|
<StyledIcon
|
|
15
15
|
data-testid={testid}
|
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
import { StyledIcon } from "./styles"
|
|
4
4
|
import type { ILibIcon } from "./types"
|
|
5
5
|
|
|
6
|
-
export
|
|
6
|
+
export const CheckCircle = ({
|
|
7
7
|
"data-testid": testid,
|
|
8
8
|
className,
|
|
9
9
|
size = 64,
|
|
10
10
|
color = "currentColor",
|
|
11
11
|
...rest
|
|
12
|
-
}: ILibIcon) {
|
|
12
|
+
}: ILibIcon) => {
|
|
13
13
|
return (
|
|
14
14
|
<StyledIcon
|
|
15
15
|
data-testid={testid}
|
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
import { StyledIcon } from "./styles"
|
|
4
4
|
import type { ILibIcon } from "./types"
|
|
5
5
|
|
|
6
|
-
export
|
|
6
|
+
export const ChevronDown = ({
|
|
7
7
|
"data-testid": testid,
|
|
8
8
|
className,
|
|
9
9
|
size = 64,
|
|
10
10
|
color = "currentColor",
|
|
11
11
|
...rest
|
|
12
|
-
}: ILibIcon) {
|
|
12
|
+
}: ILibIcon) => {
|
|
13
13
|
return (
|
|
14
14
|
<StyledIcon
|
|
15
15
|
data-testid={testid}
|
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
import { StyledIcon } from "./styles"
|
|
4
4
|
import type { ILibIcon } from "./types"
|
|
5
5
|
|
|
6
|
-
export
|
|
6
|
+
export const ChevronLeft = ({
|
|
7
7
|
"data-testid": testid,
|
|
8
8
|
className,
|
|
9
9
|
size = 64,
|
|
10
10
|
color = "currentColor",
|
|
11
11
|
...rest
|
|
12
|
-
}: ILibIcon) {
|
|
12
|
+
}: ILibIcon) => {
|
|
13
13
|
return (
|
|
14
14
|
<StyledIcon
|
|
15
15
|
data-testid={testid}
|
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
import { StyledIcon } from "./styles"
|
|
4
4
|
import type { ILibIcon } from "./types"
|
|
5
5
|
|
|
6
|
-
export
|
|
6
|
+
export const ChevronRight = ({
|
|
7
7
|
"data-testid": testid,
|
|
8
8
|
className,
|
|
9
9
|
size = 64,
|
|
10
10
|
color = "currentColor",
|
|
11
11
|
...rest
|
|
12
|
-
}: ILibIcon) {
|
|
12
|
+
}: ILibIcon) => {
|
|
13
13
|
return (
|
|
14
14
|
<StyledIcon
|
|
15
15
|
data-testid={testid}
|
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
import { StyledIcon } from "./styles"
|
|
4
4
|
import type { ILibIcon } from "./types"
|
|
5
5
|
|
|
6
|
-
export
|
|
6
|
+
export const ChevronUp = ({
|
|
7
7
|
"data-testid": testid,
|
|
8
8
|
className,
|
|
9
9
|
size = 64,
|
|
10
10
|
color = "currentColor",
|
|
11
11
|
...rest
|
|
12
|
-
}: ILibIcon) {
|
|
12
|
+
}: ILibIcon) => {
|
|
13
13
|
return (
|
|
14
14
|
<StyledIcon
|
|
15
15
|
data-testid={testid}
|
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
import { StyledIcon } from "./styles"
|
|
4
4
|
import type { ILibIcon } from "./types"
|
|
5
5
|
|
|
6
|
-
export
|
|
6
|
+
export const Clipboard = ({
|
|
7
7
|
"data-testid": testid,
|
|
8
8
|
className,
|
|
9
9
|
size = 64,
|
|
10
10
|
color = "currentColor",
|
|
11
11
|
...rest
|
|
12
|
-
}: ILibIcon) {
|
|
12
|
+
}: ILibIcon) => {
|
|
13
13
|
return (
|
|
14
14
|
<StyledIcon
|
|
15
15
|
data-testid={testid}
|
package/dist/lib/icons/Clock.tsx
CHANGED
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
import { StyledIcon } from "./styles"
|
|
4
4
|
import type { ILibIcon } from "./types"
|
|
5
5
|
|
|
6
|
-
export
|
|
6
|
+
export const Clock = ({
|
|
7
7
|
"data-testid": testid,
|
|
8
8
|
className,
|
|
9
9
|
size = 64,
|
|
10
10
|
color = "currentColor",
|
|
11
11
|
...rest
|
|
12
|
-
}: ILibIcon) {
|
|
12
|
+
}: ILibIcon) => {
|
|
13
13
|
return (
|
|
14
14
|
<StyledIcon
|
|
15
15
|
data-testid={testid}
|
package/dist/lib/icons/Close.tsx
CHANGED
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
import { StyledIcon } from "./styles"
|
|
4
4
|
import type { ILibIcon } from "./types"
|
|
5
5
|
|
|
6
|
-
export
|
|
6
|
+
export const Close = ({
|
|
7
7
|
"data-testid": testid,
|
|
8
8
|
className,
|
|
9
9
|
size = 64,
|
|
10
10
|
color = "currentColor",
|
|
11
11
|
...rest
|
|
12
|
-
}: ILibIcon) {
|
|
12
|
+
}: ILibIcon) => {
|
|
13
13
|
return (
|
|
14
14
|
<StyledIcon
|
|
15
15
|
data-testid={testid}
|
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
import { StyledIcon } from "./styles"
|
|
4
4
|
import type { ILibIcon } from "./types"
|
|
5
5
|
|
|
6
|
-
export
|
|
6
|
+
export const CloseCircle = ({
|
|
7
7
|
"data-testid": testid,
|
|
8
8
|
className,
|
|
9
9
|
size = 64,
|
|
10
10
|
color = "currentColor",
|
|
11
11
|
...rest
|
|
12
|
-
}: ILibIcon) {
|
|
12
|
+
}: ILibIcon) => {
|
|
13
13
|
return (
|
|
14
14
|
<StyledIcon
|
|
15
15
|
data-testid={testid}
|