@julseb-lib/react 0.1.10 → 0.1.12
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.css +61 -117
- package/dist/julseb-lib-react.cjs.js +12 -12
- package/dist/julseb-lib-react.es.js +1868 -1794
- package/dist/julseb-lib-react.umd.js +12 -12
- package/dist/lib/Variables.ts +20 -19
- package/dist/lib/components/Accordion/Accordion.tsx +1 -1
- package/dist/lib/components/Accordion/AccordionContent.tsx +2 -2
- package/dist/lib/components/Accordion/AccordionTitle.tsx +4 -3
- package/dist/lib/components/Alert/Alert.tsx +2 -2
- package/dist/lib/components/Autocomplete/Autocomplete.tsx +1 -1
- package/dist/lib/components/Avatar/Avatar.tsx +3 -7
- package/dist/lib/components/BackToTop/BackToTop.tsx +4 -3
- package/dist/lib/components/Badge/Badge.tsx +1 -1
- package/dist/lib/components/Breadcrumbs/Breadcrumbs.tsx +1 -1
- package/dist/lib/components/Burger/Burger.tsx +11 -4
- package/dist/lib/components/Button/Button.tsx +5 -4
- package/dist/lib/components/ButtonGroup/ButtonGroup.tsx +4 -2
- package/dist/lib/components/ButtonIcon/ButtonFn.tsx +3 -1
- package/dist/lib/components/ButtonIcon/ButtonIcon.tsx +9 -2
- package/dist/lib/components/CodeContainer/CodeContainer.tsx +5 -5
- package/dist/lib/components/Cover/Cover.tsx +1 -1
- package/dist/lib/components/DragList/DragList.tsx +1 -1
- package/dist/lib/components/DragList/DragListItem.tsx +4 -3
- package/dist/lib/components/Drawer/Drawer.tsx +1 -1
- package/dist/lib/components/Dropdown/Dropdown.tsx +1 -1
- package/dist/lib/components/Fade/Fade.tsx +4 -4
- package/dist/lib/components/Fieldset/Fieldset.tsx +2 -2
- package/dist/lib/components/Footer/Footer.tsx +103 -0
- package/dist/lib/components/Footer/index.ts +1 -0
- package/dist/lib/components/Footer/types.ts +54 -0
- package/dist/lib/components/Form/Form.tsx +1 -1
- package/dist/lib/components/Header/Header.tsx +15 -6
- package/dist/lib/components/Header/types.ts +1 -1
- package/dist/lib/components/Image/Image.tsx +1 -1
- package/dist/lib/components/Input/Input.tsx +2 -2
- package/dist/lib/components/Input/templates/ColorInput.tsx +4 -0
- package/dist/lib/components/InputCheck/InputCheck.tsx +2 -2
- package/dist/lib/components/InputComponents/InputButton.tsx +7 -2
- package/dist/lib/components/InputComponents/classes.ts +1 -1
- package/dist/lib/components/InputContainer/InputContainer.tsx +1 -1
- package/dist/lib/components/InputCounter/InputCounter.tsx +2 -2
- package/dist/lib/components/InputImage/InputImage.tsx +1 -1
- package/dist/lib/components/InputPhone/InputPhone.tsx +1 -1
- package/dist/lib/components/InputPin/InputPin.tsx +3 -1
- package/dist/lib/components/InputSlider/InputSlider.tsx +1 -1
- package/dist/lib/components/Key/Key.tsx +2 -2
- package/dist/lib/components/ListGroup/ListGroup.tsx +1 -1
- package/dist/lib/components/ListGroup/ListGroupItem.tsx +1 -1
- package/dist/lib/components/ListGroup/ListGroupTitle.tsx +1 -1
- package/dist/lib/components/Loader/Loader.tsx +1 -1
- package/dist/lib/components/Loader/templates/LoaderOne.tsx +1 -1
- package/dist/lib/components/Loader/templates/LoaderThree.tsx +3 -3
- package/dist/lib/components/Loader/templates/LoaderTwo.tsx +2 -2
- package/dist/lib/components/MarkdownContainer/MarkdownContainer.tsx +2 -2
- package/dist/lib/components/Meta/Meta.tsx +125 -0
- package/dist/lib/components/Meta/index.ts +1 -0
- package/dist/lib/components/Meta/types.ts +35 -0
- package/dist/lib/components/Modal/Modal.tsx +1 -1
- package/dist/lib/components/PageLayout/PageLayout.tsx +64 -0
- package/dist/lib/components/PageLayout/index.ts +1 -0
- package/dist/lib/components/PageLayout/types.ts +29 -0
- package/dist/lib/components/PageLoading/PageLoading.tsx +1 -1
- package/dist/lib/components/Pagination/Pagination.tsx +1 -1
- package/dist/lib/components/Pagination/PaginationButton.tsx +1 -1
- package/dist/lib/components/Paginator/Paginator.tsx +1 -1
- package/dist/lib/components/ProgressBar/ProgressBar.tsx +4 -7
- package/dist/lib/components/ProgressBar/types.ts +1 -1
- package/dist/lib/components/ProgressCircle/ProgressCircle.tsx +7 -3
- package/dist/lib/components/ProgressCircle/types.ts +1 -2
- package/dist/lib/components/Rating/Rating.tsx +1 -1
- package/dist/lib/components/Select/Select.tsx +1 -1
- package/dist/lib/components/Skeleton/Skeleton.tsx +5 -2
- package/dist/lib/components/Skeleton/SkeletonCard.tsx +4 -1
- package/dist/lib/components/Slideshow/Slideshow.tsx +1 -1
- package/dist/lib/components/Slideshow/SlideshowPagination.tsx +1 -1
- package/dist/lib/components/SrOnly/SrOnly.tsx +33 -0
- package/dist/lib/components/SrOnly/index.ts +1 -0
- package/dist/lib/components/SrOnly/types.ts +7 -0
- package/dist/lib/components/Sticky/Sticky.tsx +8 -8
- package/dist/lib/components/Table/Table.tsx +8 -5
- package/dist/lib/components/Tabs/Tabs.tsx +1 -1
- package/dist/lib/components/Tabs/TabsButton.tsx +4 -2
- package/dist/lib/components/Tabs/TabsButtonsContainer.tsx +1 -1
- package/dist/lib/components/Tabs/TabsContainer.tsx +1 -1
- package/dist/lib/components/Tabs/TabsContent.tsx +1 -1
- package/dist/lib/components/Tag/Tag.tsx +1 -1
- package/dist/lib/components/Text/templates/Blockquote.tsx +1 -1
- package/dist/lib/components/Text/templates/Dl.tsx +1 -1
- package/dist/lib/components/Text/templates/H1.tsx +2 -2
- package/dist/lib/components/Text/templates/H2.tsx +2 -2
- package/dist/lib/components/Text/templates/H3.tsx +2 -2
- package/dist/lib/components/Text/templates/H4.tsx +2 -2
- package/dist/lib/components/Text/templates/H5.tsx +2 -2
- package/dist/lib/components/Text/templates/H6.tsx +1 -1
- package/dist/lib/components/Text/templates/Ol.tsx +1 -1
- package/dist/lib/components/Text/templates/P.tsx +1 -1
- package/dist/lib/components/Text/templates/Small.tsx +1 -1
- package/dist/lib/components/Text/templates/Ul.tsx +1 -1
- package/dist/lib/components/Toast/Toast.tsx +5 -4
- package/dist/lib/components/Tooltip/Tooltip.tsx +29 -22
- package/dist/lib/components/Wrapper/Wrapper.tsx +1 -1
- package/dist/lib/index.css +61 -117
- package/dist/lib/index.ts +4 -1
- package/dist/lib/types/components-items-props.ts +1 -24
- package/dist/lib/types/components-props.ts +4 -1
- package/dist/lib/types/global.ts +11 -13
- package/dist/lib/utils/design-tokens.ts +2 -7
- package/dist/lib/utils/gen-gap.ts +21 -21
- package/dist/lib/utils/gen-ring-color.ts +21 -0
- package/dist/lib/utils/index.ts +1 -0
- package/package.json +3 -3
- package/dist/lib/components/IconMenu/IconMenu.module.css +0 -239
- package/dist/lib/components/IconMenu/IconMenu.tsx +0 -101
- package/dist/lib/components/IconMenu/IconMenuItem.tsx +0 -53
- package/dist/lib/components/IconMenu/index.ts +0 -1
- package/dist/lib/components/IconMenu/types.ts +0 -48
- package/dist/react.css +0 -1
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
LibAllColors,
|
|
3
|
+
LibComponentBase,
|
|
4
|
+
LibFooterDirection,
|
|
5
|
+
LibFooterLinksSeparator,
|
|
6
|
+
ReactChildren,
|
|
7
|
+
RequireAtLeastOne,
|
|
8
|
+
} from "../../types"
|
|
9
|
+
|
|
10
|
+
interface ILibFooterBase extends LibComponentBase<HTMLDivElement> {
|
|
11
|
+
hideSeparator?: boolean
|
|
12
|
+
hideLinksSeparator?: boolean
|
|
13
|
+
linksSeparator?: LibFooterLinksSeparator
|
|
14
|
+
linksSeparatorColor?: LibAllColors
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
interface FooterHorizontalWithItems extends ILibFooterBase {
|
|
18
|
+
items: Array<ReactChildren>
|
|
19
|
+
logo: ReactChildren
|
|
20
|
+
direction?: Extract<LibFooterDirection, "horizontal">
|
|
21
|
+
children?: never
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
interface FooterHorizontalWithChildren extends ILibFooterBase {
|
|
25
|
+
items?: never
|
|
26
|
+
logo: ReactChildren
|
|
27
|
+
direction?: Extract<LibFooterDirection, "horizontal">
|
|
28
|
+
children?: ReactChildren
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
type ILibFooterHorizontal =
|
|
32
|
+
| FooterHorizontalWithItems
|
|
33
|
+
| FooterHorizontalWithChildren
|
|
34
|
+
|
|
35
|
+
interface FooterVerticalWithItems extends ILibFooterBase {
|
|
36
|
+
items?: Array<ReactChildren>
|
|
37
|
+
logo?: ReactChildren
|
|
38
|
+
direction?: Extract<LibFooterDirection, "vertical">
|
|
39
|
+
children?: never
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
interface FooterVerticalWithChildren extends ILibFooterBase {
|
|
43
|
+
items?: never
|
|
44
|
+
logo?: ReactChildren
|
|
45
|
+
direction?: Extract<LibFooterDirection, "vertical">
|
|
46
|
+
children?: ReactChildren
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
type ILibFooterVertical = RequireAtLeastOne<
|
|
50
|
+
FooterVerticalWithItems | FooterVerticalWithChildren,
|
|
51
|
+
"items" | "children" | "logo"
|
|
52
|
+
>
|
|
53
|
+
|
|
54
|
+
export type ILibFooter = ILibFooterHorizontal | ILibFooterVertical
|
|
@@ -22,7 +22,7 @@ import type { ILibForm } from "./types"
|
|
|
22
22
|
* @extends HTMLFormElement
|
|
23
23
|
*
|
|
24
24
|
* @prop {string} [props.className] - Additional CSS classes to apply to the form container.
|
|
25
|
-
* @prop {React.Ref<
|
|
25
|
+
* @prop {React.Ref<HTMLFormElement>} [props.ref] - Ref to the form element.
|
|
26
26
|
* @prop {React.ReactNode} [props.children] - Form fields and content to display inside the form.
|
|
27
27
|
* @prop {boolean} [props.isLoading] - Whether the form is in a loading state (shows loader on primary button).
|
|
28
28
|
* @prop {boolean} [props.disabled] - Whether the form and its primary button are disabled.
|
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
clsx,
|
|
8
8
|
genBgAllColors,
|
|
9
9
|
genLinkColor,
|
|
10
|
+
genRingColorChildren,
|
|
10
11
|
genTextAllColor,
|
|
11
12
|
} from "../../utils"
|
|
12
13
|
import type { ILibHeader } from "./types"
|
|
@@ -35,7 +36,7 @@ import type { ILibHeader } from "./types"
|
|
|
35
36
|
*
|
|
36
37
|
* @prop {string} [props.className] - Additional CSS classes to apply to the header container.
|
|
37
38
|
* @prop {React.ElementType} [props.element="header"] - HTML element type to render as the container.
|
|
38
|
-
* @prop {React.Ref<
|
|
39
|
+
* @prop {React.Ref<HTMLDivElement>} [props.ref] - Ref to the header element.
|
|
39
40
|
* @prop {React.ReactNode} [props.logo] - Logo content to display in the header.
|
|
40
41
|
* @prop {"left" | "right"} [props.burgerPosition="right"] - Position of the burger menu button.
|
|
41
42
|
* @prop {LibColorsHover | object} [props.burgerColor="white"] - Color for the burger menu button, can be a single color or object with open/closed states.
|
|
@@ -139,9 +140,10 @@ export const Header: FC<ILibHeader> = ({
|
|
|
139
140
|
</>
|
|
140
141
|
),
|
|
141
142
|
className: clsx(
|
|
142
|
-
"z-999 flex gap-
|
|
143
|
+
"z-999 flex gap-2 [&>a]:outline-none transition-all duration-200 ease-in-out",
|
|
143
144
|
"fixed md:relative",
|
|
144
145
|
"flex-col md:flex-row px-[5%] md:px-0",
|
|
146
|
+
genRingColorChildren[linkColor],
|
|
145
147
|
navDesktopPosition === "left" && "grow",
|
|
146
148
|
genBgAllColors[backgroundColor],
|
|
147
149
|
navMobileVariant === "drawer" && [
|
|
@@ -165,7 +167,7 @@ export const Header: FC<ILibHeader> = ({
|
|
|
165
167
|
: "right-[-100%] md:right-[unset]",
|
|
166
168
|
],
|
|
167
169
|
navMobileVariant === "top" && [
|
|
168
|
-
"md:top-[unset] w-[100%] md:w-fit h-fit md:h-[unset] left-0 md:left-[unset] py-
|
|
170
|
+
"md:top-[unset] w-[100%] md:w-fit h-fit md:h-[unset] left-0 md:left-[unset] py-4 md:py-0",
|
|
169
171
|
isOpen ? "top-[56px] " : "top-[calc((160px+56px)*-1)]",
|
|
170
172
|
],
|
|
171
173
|
"nav",
|
|
@@ -184,10 +186,10 @@ export const Header: FC<ILibHeader> = ({
|
|
|
184
186
|
className={clsx(
|
|
185
187
|
"z-999 flex items-center px-[5%] py-4 w-full transition-all duration-200 ease-in-out",
|
|
186
188
|
navDesktopPosition === "left"
|
|
187
|
-
? "justify-between md:justify-start gap-
|
|
189
|
+
? "justify-between md:justify-start gap-8"
|
|
188
190
|
: "justify-between",
|
|
189
191
|
burgerPosition === "left" &&
|
|
190
|
-
"justify-start gap-
|
|
192
|
+
"justify-start gap-4 md:justify-between",
|
|
191
193
|
position,
|
|
192
194
|
genBgAllColors[backgroundColor],
|
|
193
195
|
genTextAllColor[textColor],
|
|
@@ -200,7 +202,14 @@ export const Header: FC<ILibHeader> = ({
|
|
|
200
202
|
>
|
|
201
203
|
{burgerPosition === "left" && <Burger {...burgerProps} />}
|
|
202
204
|
|
|
203
|
-
<span
|
|
205
|
+
<span
|
|
206
|
+
className={clsx(
|
|
207
|
+
"z-999 outline-none [&>a]:outline-none",
|
|
208
|
+
genRingColorChildren[linkColor],
|
|
209
|
+
)}
|
|
210
|
+
>
|
|
211
|
+
{logo}
|
|
212
|
+
</span>
|
|
204
213
|
|
|
205
214
|
{navDesktopPosition === "left" && <nav {...navProps} />}
|
|
206
215
|
|
|
@@ -10,7 +10,7 @@ import type {
|
|
|
10
10
|
import type { LibHeaderSearch } from "./subtypes"
|
|
11
11
|
|
|
12
12
|
interface ILibHeaderBase extends LibComponentBase<HTMLDivElement> {
|
|
13
|
-
logo:
|
|
13
|
+
logo: ReactChildren
|
|
14
14
|
burgerPosition?: LibNavBurgerPosition
|
|
15
15
|
burgerColor?:
|
|
16
16
|
| LibColorsHover
|
|
@@ -60,7 +60,7 @@ export const Image: FC<ILibImage> = ({
|
|
|
60
60
|
|
|
61
61
|
<figcaption
|
|
62
62
|
className={clsx(
|
|
63
|
-
"bottom-0 left-0 z-10 absolute bg-overlay-black-80 px-
|
|
63
|
+
"bottom-0 left-0 z-10 absolute bg-overlay-black-80 px-2 px-4 w-full text-white",
|
|
64
64
|
typeof caption === "object" &&
|
|
65
65
|
caption.backgroundColor &&
|
|
66
66
|
genBgAllColorsAndOverlays[caption.backgroundColor],
|
|
@@ -60,10 +60,10 @@ const InputFunction: FC<ILibInput> = ({ type, ...rest }) =>
|
|
|
60
60
|
* <option value="ca">Canada</option>
|
|
61
61
|
* </Input>
|
|
62
62
|
*
|
|
63
|
-
* @extends
|
|
63
|
+
* @extends HTMLInputElement
|
|
64
64
|
*
|
|
65
65
|
* @prop {string} [props.className] - Additional CSS classes to apply to the input.
|
|
66
|
-
* @prop {React.Ref<
|
|
66
|
+
* @prop {React.Ref<HTMLInputElement>} [props.ref] - Ref to the input element.
|
|
67
67
|
* @prop {string} [props.id] - Unique identifier for the input element.
|
|
68
68
|
* @prop {string} [props.label] - Label text to display above the input.
|
|
69
69
|
* @prop {string} [props.labelComment] - Additional comment text next to the label.
|
|
@@ -13,6 +13,7 @@ export const ColorInput: FC<ILibColorInput> = ({
|
|
|
13
13
|
validation,
|
|
14
14
|
inputBackground,
|
|
15
15
|
inputVariant,
|
|
16
|
+
value,
|
|
16
17
|
...rest
|
|
17
18
|
}) => {
|
|
18
19
|
return (
|
|
@@ -22,6 +23,8 @@ export const ColorInput: FC<ILibColorInput> = ({
|
|
|
22
23
|
inputBackground={inputBackground}
|
|
23
24
|
inputVariant={inputVariant}
|
|
24
25
|
>
|
|
26
|
+
{value && <span className="pl-2">{value}</span>}
|
|
27
|
+
|
|
25
28
|
<input
|
|
26
29
|
{...rest}
|
|
27
30
|
type={type}
|
|
@@ -32,6 +35,7 @@ export const ColorInput: FC<ILibColorInput> = ({
|
|
|
32
35
|
}),
|
|
33
36
|
"input-color",
|
|
34
37
|
)}
|
|
38
|
+
value={value}
|
|
35
39
|
/>
|
|
36
40
|
|
|
37
41
|
<InputValidation validation={validation} />
|
|
@@ -23,7 +23,7 @@ import type { ILibInputCheck } from "./types"
|
|
|
23
23
|
* @extends HTMLInputElement
|
|
24
24
|
*
|
|
25
25
|
* @prop {string} [props.className] - Additional CSS classes to apply to the input check container.
|
|
26
|
-
* @prop {React.Ref<
|
|
26
|
+
* @prop {React.Ref<HTMLInputElement>} [props.ref] - Ref to the label element.
|
|
27
27
|
* @prop {React.ReactNode} [props.children] - Content to display next to the input check.
|
|
28
28
|
* @prop {string} [props.id] - Unique identifier for the input element.
|
|
29
29
|
* @prop {"checkbox" | "radio"} [props.type="checkbox"] - Type of input check to render.
|
|
@@ -58,7 +58,7 @@ export const InputCheck: FC<ILibInputCheck> = ({
|
|
|
58
58
|
ref={ref}
|
|
59
59
|
htmlFor={id}
|
|
60
60
|
className={clsx(
|
|
61
|
-
"inline-flex items-start gap-1 cursor-pointer",
|
|
61
|
+
"inline-flex items-start gap-1 outline-none cursor-pointer",
|
|
62
62
|
variant === "tile" && [
|
|
63
63
|
"w-full border-gray-200 border p-2 rounded-lg",
|
|
64
64
|
"has-[input:checked]:border-primary-500",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { FC, MouseEventHandler } from "react"
|
|
2
|
-
import { clsx } from "../../utils"
|
|
2
|
+
import { clsx, genRingColor } from "../../utils"
|
|
3
3
|
import { INPUT_BUTTON_CLASSES } from "./classes"
|
|
4
4
|
import type { ClassNames, ReactChildren } from "../../types"
|
|
5
5
|
|
|
@@ -11,7 +11,12 @@ export const InputButton: FC<IInputButton> = ({
|
|
|
11
11
|
return (
|
|
12
12
|
<button
|
|
13
13
|
onClick={onClick}
|
|
14
|
-
className={clsx(
|
|
14
|
+
className={clsx(
|
|
15
|
+
INPUT_BUTTON_CLASSES,
|
|
16
|
+
genRingColor["primary"],
|
|
17
|
+
"input-button",
|
|
18
|
+
className,
|
|
19
|
+
)}
|
|
15
20
|
type="button"
|
|
16
21
|
>
|
|
17
22
|
{children}
|
|
@@ -42,7 +42,7 @@ export const SUFFIX_CLASSES = [
|
|
|
42
42
|
]
|
|
43
43
|
|
|
44
44
|
export const INPUT_ICON_CONTAINER_CLASSES = [
|
|
45
|
-
"
|
|
45
|
+
"size-8 inline-flex items-center justify-center border-e-1 border-e-gray-200",
|
|
46
46
|
]
|
|
47
47
|
|
|
48
48
|
export const INPUT_CONTAINER_CLASSES = ({
|
|
@@ -22,7 +22,7 @@ import type { ILibInputContainer } from "./types"
|
|
|
22
22
|
*
|
|
23
23
|
* @prop {string} [props.className] - Additional CSS classes to apply to the container.
|
|
24
24
|
* @prop {React.ComponentType | string} [props.element="div"] - The HTML element or component to render as the container.
|
|
25
|
-
* @prop {React.Ref<
|
|
25
|
+
* @prop {React.Ref<HTMLDivElement>} [props.ref] - Ref to the container element.
|
|
26
26
|
* @prop {React.ReactNode} [props.children] - Input elements or other content to display inside the container.
|
|
27
27
|
* @prop {string} [props.label] - Label text to display above the input.
|
|
28
28
|
* @prop {string} [props.labelComment] - Additional comment text next to the label in gray italic text.
|
|
@@ -25,10 +25,10 @@ import type { ILibInputCounter } from "./types"
|
|
|
25
25
|
* buttonsColor="secondary"
|
|
26
26
|
* />
|
|
27
27
|
*
|
|
28
|
-
* @extends
|
|
28
|
+
* @extends HTMLInputElement
|
|
29
29
|
*
|
|
30
30
|
* @prop {string} [props.className] - Additional CSS classes to apply to the counter container.
|
|
31
|
-
* @prop {React.Ref<
|
|
31
|
+
* @prop {React.Ref<HTMLInputElement>} [props.ref] - Ref to the input or span element.
|
|
32
32
|
* @prop {number} [props.value] - Current numeric value of the counter.
|
|
33
33
|
* @prop {function} [props.setValue] - Function to update the counter value.
|
|
34
34
|
* @prop {"plain" | "ghost" | "outline" | "transparent"} [props.buttonVariant] - Visual variant style of the increment/decrement buttons.
|
|
@@ -21,7 +21,7 @@ import type { ILibInputImage } from "./types"
|
|
|
21
21
|
* @extends HTMLInputElement
|
|
22
22
|
*
|
|
23
23
|
* @prop {string} [props.className] - Additional CSS classes to apply to the input image container.
|
|
24
|
-
* @prop {React.Ref<
|
|
24
|
+
* @prop {React.Ref<HTMLInputElement>} [props.ref] - Ref to the label element.
|
|
25
25
|
* @prop {string} [props.label] - Label text to display above the input.
|
|
26
26
|
* @prop {string} [props.labelComment] - Additional comment text next to the label.
|
|
27
27
|
* @prop {string} [props.helper] - Helper text to display below the label.
|
|
@@ -32,7 +32,7 @@ import type { ILibInputPhone } from "./types"
|
|
|
32
32
|
* @extends HTMLInputElement
|
|
33
33
|
*
|
|
34
34
|
* @prop {string} [props.className] - Additional CSS classes to apply to the input phone container.
|
|
35
|
-
* @prop {React.Ref<
|
|
35
|
+
* @prop {React.Ref<HTMLInputElement>} [props.ref] - Ref to the input element.
|
|
36
36
|
* @prop {object} [props.selectedCountry] - Currently selected country object with code, name, flag, and dial_code.
|
|
37
37
|
* @prop {function} [props.setSelectedCountry] - Function to update the selected country state.
|
|
38
38
|
* @prop {string} [props.defaultCountry="fr"] - Default country code to display when no country is selected.
|
|
@@ -20,7 +20,7 @@ import type { ILibInputPin } from "./types"
|
|
|
20
20
|
* @extends HTMLDivElement
|
|
21
21
|
*
|
|
22
22
|
* @prop {string} [props.className] - Additional CSS classes to apply to the pin input container.
|
|
23
|
-
* @prop {React.Ref<
|
|
23
|
+
* @prop {React.Ref<HTMLDivElement>} [props.ref] - Ref to the pin input container div element.
|
|
24
24
|
* @prop {string} [props.label] - Label text to display above the pin inputs.
|
|
25
25
|
* @prop {string} [props.labelComment] - Additional comment text next to the label.
|
|
26
26
|
* @prop {string} [props.helper] - Helper text to display below the label.
|
|
@@ -54,6 +54,7 @@ export const InputPin: FC<ILibInputPin> = ({
|
|
|
54
54
|
hideValues,
|
|
55
55
|
disabled,
|
|
56
56
|
inputBackground,
|
|
57
|
+
autoFocus,
|
|
57
58
|
...rest
|
|
58
59
|
}) => {
|
|
59
60
|
const [inputsRefsArr] = useState<Array<Ref<HTMLInputElement>>>(() =>
|
|
@@ -98,6 +99,7 @@ export const InputPin: FC<ILibInputPin> = ({
|
|
|
98
99
|
type={hideValues ? "password" : "text"}
|
|
99
100
|
maxLength={1}
|
|
100
101
|
disabled={disabled}
|
|
102
|
+
autoFocus={autoFocus && i === 0}
|
|
101
103
|
className={clsx(
|
|
102
104
|
INPUT_COMMON_CLASSES({
|
|
103
105
|
inputBackground,
|
|
@@ -22,7 +22,7 @@ import type { ILibInputSlider } from "./types"
|
|
|
22
22
|
* @extends HTMLInputElement
|
|
23
23
|
*
|
|
24
24
|
* @prop {string} [props.className] - Additional CSS classes to apply to the slider container.
|
|
25
|
-
* @prop {React.Ref<
|
|
25
|
+
* @prop {React.Ref<HTMLInputElement>} [props.ref] - Ref to the input element.
|
|
26
26
|
* @prop {string} [props.label] - Label text to display above the slider.
|
|
27
27
|
* @prop {string} [props.labelComment] - Additional comment text next to the label.
|
|
28
28
|
* @prop {string} [props.helper] - Helper text to display below the label.
|
|
@@ -25,7 +25,7 @@ import type { ILibListGroup } from "./types"
|
|
|
25
25
|
*
|
|
26
26
|
* @prop {string} [props.className] - Additional CSS classes to apply to the list group container.
|
|
27
27
|
* @prop {React.ElementType} [props.element="div"] - HTML element type to render as the container.
|
|
28
|
-
* @prop {React.Ref<
|
|
28
|
+
* @prop {React.Ref<HTMLDivElement>} [props.ref] - Ref to the list group container element.
|
|
29
29
|
* @prop {React.ReactNode} [props.children] - Child components to render inside the list group.
|
|
30
30
|
* @prop {string | object} [props.title] - Title text or configuration object for the list group header.
|
|
31
31
|
* @prop {boolean} [props.noSeparator] - Whether to hide separators between list items.
|
|
@@ -20,7 +20,7 @@ import type { ILibListGroupItem } from "./types"
|
|
|
20
20
|
*
|
|
21
21
|
* @prop {string} [props.className] - Additional CSS classes to apply to the list item container.
|
|
22
22
|
* @prop {React.ElementType} [props.element="div"] - HTML element type to render as the container.
|
|
23
|
-
* @prop {React.Ref<
|
|
23
|
+
* @prop {React.Ref<HTMLDivElement>} [props.ref] - Ref to the list item container element.
|
|
24
24
|
* @prop {React.ReactNode} [props.children] - Child components to render inside the list item.
|
|
25
25
|
* @prop {string} [props.title] - Title text to display for the list item.
|
|
26
26
|
* @prop {string} [props.body] - Body text or description to display below the title.
|
|
@@ -21,7 +21,7 @@ import type { ILibListGroupTitle } from "./types"
|
|
|
21
21
|
*
|
|
22
22
|
* @prop {string} [props.className] - Additional CSS classes to apply to the title container.
|
|
23
23
|
* @prop {React.ElementType} [props.element=Text] - HTML element type to render as the container.
|
|
24
|
-
* @prop {React.Ref<
|
|
24
|
+
* @prop {React.Ref<HTMLDivElement>} [props.ref] - Ref to the title element.
|
|
25
25
|
* @prop {React.ReactNode} [props.children] - Content to display inside the title.
|
|
26
26
|
* @prop {boolean} [props.isFixed] - Whether the title should be sticky positioned at the top.
|
|
27
27
|
* @prop {"xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "inner" | "none"} [props.shadow] - Shadow variant to apply when scrolled.
|
|
@@ -18,7 +18,7 @@ import type { ILibLoader } from "./types"
|
|
|
18
18
|
* @prop {string} [props.color="primary"] Any color from the library. - Loader color.
|
|
19
19
|
* @prop {string} [props.className] - Additional CSS classes to apply to the loader.
|
|
20
20
|
* @prop {keyof JSX.IntrinsicElements} [props.element="span"] - The HTML element to render as the loader.
|
|
21
|
-
* @prop {React.Ref<
|
|
21
|
+
* @prop {React.Ref<HTMLSpanElement>} [props.ref] - Ref to the loader element.
|
|
22
22
|
* @prop {any} [props.rest] - Additional props spread to the loader element.
|
|
23
23
|
*
|
|
24
24
|
* @returns {JSX.Element} The rendered Loader component.
|
|
@@ -16,7 +16,7 @@ export const LoaderOne: FC<Omit<ILibLoader, "variant">> = ({
|
|
|
16
16
|
<Element
|
|
17
17
|
ref={ref}
|
|
18
18
|
className={clsx(
|
|
19
|
-
"inline-block relative border-8 border-transparent rounded-full size-12 animate-
|
|
19
|
+
"inline-block relative border-8 border-transparent rounded-full size-12 animate-[spin_1200ms_linear_infinite]",
|
|
20
20
|
genBorderBottomColor[color],
|
|
21
21
|
"loader loader-1",
|
|
22
22
|
className,
|
|
@@ -23,21 +23,21 @@ export const LoaderThree: FC<Omit<ILibLoader, "variant">> = ({
|
|
|
23
23
|
>
|
|
24
24
|
<span
|
|
25
25
|
className={clsx(
|
|
26
|
-
"block rounded-full size-4 dot [--dot-delay:100ms]",
|
|
26
|
+
"block rounded-full size-4 animate-[loader-pulse_1200ms_linear_infinite_100ms] dot [--dot-delay:100ms]",
|
|
27
27
|
genBgAllColors[color],
|
|
28
28
|
"loader-3-dot",
|
|
29
29
|
)}
|
|
30
30
|
/>
|
|
31
31
|
<span
|
|
32
32
|
className={clsx(
|
|
33
|
-
"block rounded-full size-4 dot [--dot-delay:300ms]",
|
|
33
|
+
"block rounded-full size-4 animate-[loader-pulse_1200ms_linear_infinite_300ms] dot [--dot-delay:300ms]",
|
|
34
34
|
genBgAllColors[color],
|
|
35
35
|
"loader-3-dot",
|
|
36
36
|
)}
|
|
37
37
|
/>
|
|
38
38
|
<span
|
|
39
39
|
className={clsx(
|
|
40
|
-
"block rounded-full size-4 dot [--dot-delay:500ms]",
|
|
40
|
+
"block rounded-full size-4 animate-[loader-pulse_1200ms_linear_infinite_500ms] dot [--dot-delay:500ms]",
|
|
41
41
|
genBgAllColors[color],
|
|
42
42
|
"loader-3-dot",
|
|
43
43
|
)}
|
|
@@ -4,7 +4,7 @@ import { genBorderBottomColor } from "../utils/gen-border-bottom"
|
|
|
4
4
|
import type { ILibLoader } from "../types"
|
|
5
5
|
|
|
6
6
|
const SPAN_COMMON =
|
|
7
|
-
"block absolute w-full h-full border-8 border-transparent rounded-full animate-bezier"
|
|
7
|
+
"block absolute w-full h-full border-8 border-transparent rounded-full animate-[spin_1200ms_var(--animate-cubic-bezier)_infinite_var(--spinner-delay)]"
|
|
8
8
|
|
|
9
9
|
export const LoaderTwo: FC<Omit<ILibLoader, "variant">> = ({
|
|
10
10
|
className,
|
|
@@ -19,7 +19,7 @@ export const LoaderTwo: FC<Omit<ILibLoader, "variant">> = ({
|
|
|
19
19
|
<Element
|
|
20
20
|
ref={ref}
|
|
21
21
|
className={clsx(
|
|
22
|
-
"inline-block relative rounded-full size-12 animate-
|
|
22
|
+
"inline-block relative rounded-full size-12 animate-[spin_1200ms_linear_infinite]",
|
|
23
23
|
"loader loader-2",
|
|
24
24
|
className,
|
|
25
25
|
)}
|
|
@@ -14,10 +14,10 @@ import type { ILibMarkdownContainer } from "./types"
|
|
|
14
14
|
* This is **bold** and *italic* text.
|
|
15
15
|
* </MarkdownContainer>
|
|
16
16
|
*
|
|
17
|
-
* @extends
|
|
17
|
+
* @extends HTMLDivElement
|
|
18
18
|
*
|
|
19
19
|
* @prop {string} [props.className] - Additional CSS classes to apply to the markdown container.
|
|
20
|
-
* @prop {React.Ref<
|
|
20
|
+
* @prop {React.Ref<HTMLDivElement>} [props.ref] - Ref to the markdown container element.
|
|
21
21
|
* @prop {string} [props.children] - Markdown content to parse and render.
|
|
22
22
|
* @prop {object} [props.options=libOptionsMarkdown] - Markdown parsing options and configurations.
|
|
23
23
|
*
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { type FC } from "react"
|
|
2
|
+
import type { ILibMeta } from "./types"
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Meta component for managing HTML head metadata including SEO, Open Graph, and Twitter Card properties.
|
|
6
|
+
*
|
|
7
|
+
* @component
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* <Meta
|
|
11
|
+
* title="My Website"
|
|
12
|
+
* description="A description of my website"
|
|
13
|
+
* favicon="/favicon.ico"
|
|
14
|
+
* cover="/og-image.jpg"
|
|
15
|
+
* siteName="My Site"
|
|
16
|
+
* author="John Doe"
|
|
17
|
+
* url="https://mywebsite.com"
|
|
18
|
+
* />
|
|
19
|
+
*
|
|
20
|
+
* @prop {React.ReactNode} [props.children] - Additional meta tags or head elements to include.
|
|
21
|
+
* @prop {string} [props.title] - Page title for the document and social media.
|
|
22
|
+
* @prop {string} [props.favicon] - URL path to the favicon icon file.
|
|
23
|
+
* @prop {string} [props.description] - Page description for SEO and social media.
|
|
24
|
+
* @prop {string} [props.generator] - Name of the generator used to create the page.
|
|
25
|
+
* @prop {string[]} [props.keywords] - Array of keywords for SEO purposes.
|
|
26
|
+
* @prop {string} [props.author] - Author name for the page content.
|
|
27
|
+
* @prop {string} [props.authorUrl] - URL to the author's profile or website.
|
|
28
|
+
* @prop {string} [props.publisher] - Publisher name for the content.
|
|
29
|
+
* @prop {string} [props.type] - Open Graph type (e.g., "website", "article").
|
|
30
|
+
* @prop {string} [props.cover] - URL to the cover image for social media sharing.
|
|
31
|
+
* @prop {string} [props.siteName] - Name of the website or application.
|
|
32
|
+
* @prop {string} [props.language] - Language locale code (e.g., "en-US").
|
|
33
|
+
* @prop {string} [props.url] - Canonical URL of the page.
|
|
34
|
+
* @prop {string} [props.email] - Contact email address.
|
|
35
|
+
* @prop {string} [props.creator] - Creator name for the content.
|
|
36
|
+
* @prop {string} [props.manifest] - URL path to the web app manifest file.
|
|
37
|
+
* @prop {string} [props.category] - Category classification for the content.
|
|
38
|
+
* @prop {string} [props.twitterCard] - Twitter Card type (e.g., "summary", "summary_large_image").
|
|
39
|
+
*
|
|
40
|
+
* @returns {JSX.Element} The rendered Meta component with HTML head elements.
|
|
41
|
+
*
|
|
42
|
+
* @see https://doc-julseb-lib-react.vercel.app/components/meta
|
|
43
|
+
*/
|
|
44
|
+
export const Meta: FC<ILibMeta> = ({
|
|
45
|
+
children,
|
|
46
|
+
title,
|
|
47
|
+
favicon,
|
|
48
|
+
description,
|
|
49
|
+
generator,
|
|
50
|
+
keywords,
|
|
51
|
+
author,
|
|
52
|
+
authorUrl,
|
|
53
|
+
publisher,
|
|
54
|
+
type = "website",
|
|
55
|
+
cover,
|
|
56
|
+
siteName,
|
|
57
|
+
language,
|
|
58
|
+
url,
|
|
59
|
+
email,
|
|
60
|
+
creator,
|
|
61
|
+
manifest,
|
|
62
|
+
category,
|
|
63
|
+
twitterCard = "summary",
|
|
64
|
+
}) => {
|
|
65
|
+
return (
|
|
66
|
+
<>
|
|
67
|
+
<meta charSet="utf-8" />
|
|
68
|
+
<meta
|
|
69
|
+
name="viewport"
|
|
70
|
+
content="width=device-width, initial-scale=1"
|
|
71
|
+
/>
|
|
72
|
+
{title && (
|
|
73
|
+
<>
|
|
74
|
+
<title>{title}</title>
|
|
75
|
+
<meta property="og:title" content={title} />
|
|
76
|
+
<meta name="twitter:title" content={title} />
|
|
77
|
+
</>
|
|
78
|
+
)}
|
|
79
|
+
{description && (
|
|
80
|
+
<>
|
|
81
|
+
<meta name="description" content={description} />
|
|
82
|
+
<meta property="og:description" content={description} />
|
|
83
|
+
<meta name="twitter:description" content={description} />
|
|
84
|
+
</>
|
|
85
|
+
)}
|
|
86
|
+
{siteName && (
|
|
87
|
+
<>
|
|
88
|
+
<meta name="application-name" content={siteName} />
|
|
89
|
+
<meta property="og:site_name" content={siteName} />
|
|
90
|
+
</>
|
|
91
|
+
)}
|
|
92
|
+
{author && (
|
|
93
|
+
<>
|
|
94
|
+
<meta name="author" content={author} />
|
|
95
|
+
<meta name="twitter:creator" content={author} />
|
|
96
|
+
</>
|
|
97
|
+
)}
|
|
98
|
+
{url && (
|
|
99
|
+
<>
|
|
100
|
+
<meta property="og:url" content={url} />
|
|
101
|
+
<meta name="twitter:site" content={url} />
|
|
102
|
+
</>
|
|
103
|
+
)}
|
|
104
|
+
{cover && (
|
|
105
|
+
<>
|
|
106
|
+
<meta property="og:image" content={cover} />
|
|
107
|
+
<meta name="twitter:image" content={cover} />
|
|
108
|
+
</>
|
|
109
|
+
)}
|
|
110
|
+
{authorUrl && <link rel="author" href={authorUrl} />}
|
|
111
|
+
{manifest && <link rel="manifest" href={manifest} />}
|
|
112
|
+
{generator && <meta name="generator" content={generator} />}
|
|
113
|
+
{keywords && <meta name="keywords" content={keywords?.join(",")} />}
|
|
114
|
+
{creator && <meta name="creator" content={creator} />}
|
|
115
|
+
{publisher && <meta name="publisher" content={publisher} />}
|
|
116
|
+
{category && <meta name="category" content={category} />}
|
|
117
|
+
{language && <meta property="og:locale" content={language} />}
|
|
118
|
+
{email && <meta property="og:email" content={email} />}
|
|
119
|
+
{type && <meta property="og:type" content={type} />}
|
|
120
|
+
{twitterCard && <meta name="twitter:card" content={twitterCard} />}
|
|
121
|
+
{favicon && <link rel="icon" href={favicon} />}
|
|
122
|
+
{children}
|
|
123
|
+
</>
|
|
124
|
+
)
|
|
125
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Meta"
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { ReactChildren } from "../../types"
|
|
2
|
+
|
|
3
|
+
export interface ILibMeta {
|
|
4
|
+
title: string
|
|
5
|
+
favicon?: string
|
|
6
|
+
description?: string
|
|
7
|
+
generator?: string
|
|
8
|
+
keywords?: Array<string>
|
|
9
|
+
author?: string
|
|
10
|
+
authorUrl?: string
|
|
11
|
+
publisher?: string
|
|
12
|
+
type?:
|
|
13
|
+
| "article"
|
|
14
|
+
| "book"
|
|
15
|
+
| "music.album"
|
|
16
|
+
| "music.playlist"
|
|
17
|
+
| "music.radio_station"
|
|
18
|
+
| "music.song"
|
|
19
|
+
| "profile"
|
|
20
|
+
| "video.episode"
|
|
21
|
+
| "video.movie"
|
|
22
|
+
| "video.other"
|
|
23
|
+
| "video. tv_show"
|
|
24
|
+
| "website"
|
|
25
|
+
cover?: string
|
|
26
|
+
siteName?: string
|
|
27
|
+
language?: string
|
|
28
|
+
url?: string
|
|
29
|
+
email?: string
|
|
30
|
+
creator?: string
|
|
31
|
+
manifest?: string
|
|
32
|
+
category?: string
|
|
33
|
+
twitterCard?: "app" | "player" | "summary" | "summary_large_image"
|
|
34
|
+
children?: ReactChildren
|
|
35
|
+
}
|
|
@@ -26,7 +26,7 @@ import type { ILibModal } from "./types"
|
|
|
26
26
|
*
|
|
27
27
|
* @prop {string} [props.className] - Additional CSS classes to apply to the modal container.
|
|
28
28
|
* @prop {React.ElementType} [props.element="div"] - HTML element type to render as the container.
|
|
29
|
-
* @prop {React.Ref<
|
|
29
|
+
* @prop {React.Ref<HTMLDivElement>} [props.ref] - Ref to the modal element.
|
|
30
30
|
* @prop {React.ReactNode} [props.children] - Content to display inside the modal.
|
|
31
31
|
* @prop {boolean} [props.isOpen] - Whether the modal is currently visible.
|
|
32
32
|
* @prop {function} [props.setIsOpen] - Function to control the modal open/closed state.
|