@julseb-lib/react 0.1.11 → 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 +57 -116
- 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 +57 -116
- 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,64 @@
|
|
|
1
|
+
import { type FC } from "react"
|
|
2
|
+
import { Meta } from "../Meta"
|
|
3
|
+
import { Header } from "../Header"
|
|
4
|
+
import { Wrapper } from "../Wrapper"
|
|
5
|
+
import { Main } from "../Main"
|
|
6
|
+
import { Footer } from "../Footer"
|
|
7
|
+
import type { ILibPageLayout } from "./types"
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* PageLayout component for creating a complete page structure with optional header, footer, wrapper, and meta tags.
|
|
11
|
+
*
|
|
12
|
+
* @component
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* <PageLayout
|
|
16
|
+
* meta={{ title: "My Page", description: "Page description" }}
|
|
17
|
+
* header={{ logo: <Logo />, nav: <Nav /> }}
|
|
18
|
+
* footer={{ logo: <Logo />, items: [<Link href="/privacy">Privacy</Link>] }}
|
|
19
|
+
* wrapperProps={{ maxWidth: "px" }}
|
|
20
|
+
* mainProps={{ className: "large" }}
|
|
21
|
+
* >
|
|
22
|
+
* <h1>Page Content</h1>
|
|
23
|
+
* </PageLayout>
|
|
24
|
+
*
|
|
25
|
+
* @prop {React.ReactNode} [props.children] - The main content to be rendered inside the page layout.
|
|
26
|
+
* @prop {ILibMeta} [props.meta] - Meta component props for HTML head metadata including SEO and social media tags.
|
|
27
|
+
* @prop {ILibHeader} [props.header] - Header component props for displaying the page header with logo and navigation.
|
|
28
|
+
* @prop {ILibWrapper} [props.wrapperProps] - Wrapper component props for controlling the page container styling and layout.
|
|
29
|
+
* @prop {ILibMain} [props.mainProps] - Main component props for styling the main content area.
|
|
30
|
+
* @prop {ILibFooter} [props.footer] - Footer component props for displaying the page footer with links and logo.
|
|
31
|
+
* @prop {boolean} [props.noWrapper] - Whether to skip rendering the Wrapper component around the main content.
|
|
32
|
+
* @prop {boolean} [props.noMain] - Whether to skip rendering the Main component wrapper around children.
|
|
33
|
+
*
|
|
34
|
+
* @returns {JSX.Element} The rendered PageLayout component with complete page structure.
|
|
35
|
+
*
|
|
36
|
+
* @see https://doc-julseb-lib-react.vercel.app/components/page-layout
|
|
37
|
+
*/
|
|
38
|
+
export const PageLayout: FC<ILibPageLayout> = ({
|
|
39
|
+
children,
|
|
40
|
+
meta,
|
|
41
|
+
header,
|
|
42
|
+
wrapperProps,
|
|
43
|
+
mainProps,
|
|
44
|
+
footer,
|
|
45
|
+
noWrapper,
|
|
46
|
+
noMain,
|
|
47
|
+
}) => {
|
|
48
|
+
return (
|
|
49
|
+
<>
|
|
50
|
+
{meta && <Meta {...meta} />}
|
|
51
|
+
{header && <Header {...header} />}
|
|
52
|
+
{!noWrapper && (
|
|
53
|
+
<Wrapper {...wrapperProps}>
|
|
54
|
+
{!noMain ? (
|
|
55
|
+
<Main {...mainProps}>{children}</Main>
|
|
56
|
+
) : (
|
|
57
|
+
children
|
|
58
|
+
)}
|
|
59
|
+
</Wrapper>
|
|
60
|
+
)}
|
|
61
|
+
{footer && <Footer {...footer} />}
|
|
62
|
+
</>
|
|
63
|
+
)
|
|
64
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./PageLayout"
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { ReactChildren } from "../../types"
|
|
2
|
+
import type { ILibMeta } from "../Meta/types"
|
|
3
|
+
import type { ILibHeader } from "../Header/types"
|
|
4
|
+
import type { ILibWrapper } from "../Wrapper/types"
|
|
5
|
+
import type { ILibMain } from "../Main/types"
|
|
6
|
+
import type { ILibFooter } from "../Footer/types"
|
|
7
|
+
|
|
8
|
+
interface ILibPageLayoutBase {
|
|
9
|
+
children?: ReactChildren
|
|
10
|
+
meta?: ILibMeta
|
|
11
|
+
header?: ILibHeader
|
|
12
|
+
footer?: ILibFooter
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
interface PageLayoutWithWrapper extends ILibPageLayoutBase {
|
|
16
|
+
noWrapper?: false | undefined
|
|
17
|
+
wrapperProps?: Omit<ILibWrapper, "children">
|
|
18
|
+
noMain?: boolean
|
|
19
|
+
mainProps?: Omit<ILibMain, "children">
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
interface PageLayoutWithoutWrapper extends ILibPageLayoutBase {
|
|
23
|
+
noWrapper?: true
|
|
24
|
+
wrapperProps?: never
|
|
25
|
+
noMain?: never
|
|
26
|
+
mainProps?: never
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export type ILibPageLayout = PageLayoutWithWrapper | PageLayoutWithoutWrapper
|
|
@@ -21,7 +21,7 @@ import type { ILibPageLoading } from "./types"
|
|
|
21
21
|
*
|
|
22
22
|
* @prop {string} [props.className] - Additional CSS classes to apply to the page loading container.
|
|
23
23
|
* @prop {React.ElementType} [props.element="div"] - HTML element type to render as the container.
|
|
24
|
-
* @prop {React.Ref<
|
|
24
|
+
* @prop {React.Ref<HTMLDivElement>} [props.ref] - Ref to the page loading element.
|
|
25
25
|
* @prop {LibColors} [props.backgroundColor="primary-500"] - Background color for the loading overlay.
|
|
26
26
|
* @prop {LibColorsShort} [props.loaderColor="white"] - Color of the loading spinner.
|
|
27
27
|
* @prop {1 | 2 | 3} [props.loaderVariant=1] - Visual variant of the loading spinner.
|
|
@@ -23,7 +23,7 @@ import type { ILibPagination } from "./types"
|
|
|
23
23
|
*
|
|
24
24
|
* @prop {string} [props.className] - Additional CSS classes to apply to the pagination container.
|
|
25
25
|
* @prop {React.ElementType} [props.element="div"] - HTML element type to render as the container.
|
|
26
|
-
* @prop {React.Ref<
|
|
26
|
+
* @prop {React.Ref<HTMLDivElement>} [props.ref] - Ref to the pagination element.
|
|
27
27
|
* @prop {React.ReactNode} [props.children] - Child components to render when not using totalPages prop.
|
|
28
28
|
* @prop {LibAllColors} [props.accentColor="primary"] - Color theme for active page and hover states.
|
|
29
29
|
* @prop {number} [props.totalPages] - Total number of pages available for navigation.
|
|
@@ -20,7 +20,7 @@ import type { ILibPaginationButton } from "./types"
|
|
|
20
20
|
*
|
|
21
21
|
* @prop {string} [props.className] - Additional CSS classes to apply to the pagination button.
|
|
22
22
|
* @prop {React.ElementType} [props.element="button"] - HTML element type to render as the container.
|
|
23
|
-
* @prop {React.Ref<
|
|
23
|
+
* @prop {React.Ref<HTMLButtonElement>} [props.ref] - Ref to the pagination button element.
|
|
24
24
|
* @prop {React.ReactNode} [props.children] - Content to display inside the button (usually page number).
|
|
25
25
|
* @prop {LibAllColors} [props.accentColor="primary"] - Color theme for active and hover states.
|
|
26
26
|
* @prop {boolean} [props.isActive] - Whether this button represents the current active page.
|
|
@@ -24,7 +24,7 @@ import type { ILibPaginator } from "./types"
|
|
|
24
24
|
*
|
|
25
25
|
* @prop {string} [props.className] - Additional CSS classes to apply to the paginator container.
|
|
26
26
|
* @prop {React.ElementType} [props.element="div"] - HTML element type to render as the container.
|
|
27
|
-
* @prop {React.Ref<
|
|
27
|
+
* @prop {React.Ref<HTMLDivElement>} [props.ref] - Ref to the paginator element.
|
|
28
28
|
* @prop {number} [props.totalPages] - Total number of pages available for navigation.
|
|
29
29
|
* @prop {number} [props.currentPage] - Current active page number.
|
|
30
30
|
* @prop {function} [props.setCurrentPage] - Function to update the current page state.
|
|
@@ -19,8 +19,7 @@ import type { LibColorsShort } from "../../types"
|
|
|
19
19
|
* @extends HTMLMeterElement
|
|
20
20
|
*
|
|
21
21
|
* @prop {string} [props.className] - Additional CSS classes to apply to the progress bar.
|
|
22
|
-
* @prop {React.
|
|
23
|
-
* @prop {React.Ref<any>} [props.ref] - Ref to the progress bar element.
|
|
22
|
+
* @prop {React.Ref<HTMLMeterElement>} [props.ref] - Ref to the progress bar element.
|
|
24
23
|
* @prop {number} [props.value] - Current progress value.
|
|
25
24
|
* @prop {"primary" | "secondary" | "success" | "danger" | "warning" | "gray" | "white"} [props.color="primary"] - Color theme for the progress bar fill.
|
|
26
25
|
* @prop {boolean} [props.noAnimation] - Whether to disable the progress animation.
|
|
@@ -34,7 +33,6 @@ import type { LibColorsShort } from "../../types"
|
|
|
34
33
|
*/
|
|
35
34
|
export const ProgressBar: FC<ILibProgressBar> = ({
|
|
36
35
|
className,
|
|
37
|
-
element = "meter",
|
|
38
36
|
ref,
|
|
39
37
|
value,
|
|
40
38
|
color = "primary",
|
|
@@ -44,12 +42,10 @@ export const ProgressBar: FC<ILibProgressBar> = ({
|
|
|
44
42
|
id,
|
|
45
43
|
...rest
|
|
46
44
|
}) => {
|
|
47
|
-
const Element = element
|
|
48
|
-
|
|
49
45
|
const percent = getPercentage(value, Number(max))
|
|
50
46
|
|
|
51
47
|
return (
|
|
52
|
-
<
|
|
48
|
+
<meter
|
|
53
49
|
ref={ref}
|
|
54
50
|
id={id}
|
|
55
51
|
className={clsx(
|
|
@@ -58,7 +54,8 @@ export const ProgressBar: FC<ILibProgressBar> = ({
|
|
|
58
54
|
"appearance-none [&::-webkit-meter-bar]:bg-none [&::-webkit-meter-bar]:border-none",
|
|
59
55
|
"[&::-webkit-meter-optimum-value]:bg-none [&::-webkit-meter-suboptimum-value]:bg-none [&::-webkit-meter-even-less-good-value]:bg-none",
|
|
60
56
|
"[&::-moz-meter-bar]:bg-none [&::-moz-meter-bar]:border-none",
|
|
61
|
-
!noAnimation &&
|
|
57
|
+
!noAnimation &&
|
|
58
|
+
"before:animate-[progress-bar_calc(var(--progress-speed)*50ms)_ease_forwards]",
|
|
62
59
|
noAnimation && "before:w-(--meter-value)",
|
|
63
60
|
genProgressColor[color],
|
|
64
61
|
"progress-bar",
|
|
@@ -2,7 +2,7 @@ import type { MeterHTMLAttributes } from "react"
|
|
|
2
2
|
import type { LibColorsShort, LibComponentBase } from "../../types"
|
|
3
3
|
|
|
4
4
|
export interface ILibProgressBar
|
|
5
|
-
extends LibComponentBase<HTMLMeterElement>,
|
|
5
|
+
extends Omit<LibComponentBase<HTMLMeterElement>, "element">,
|
|
6
6
|
MeterHTMLAttributes<HTMLMeterElement> {
|
|
7
7
|
value: number
|
|
8
8
|
color?: Exclude<
|
|
@@ -21,7 +21,8 @@ import type { LibColorsShort } from "../../types"
|
|
|
21
21
|
* @extends HTMLDivElement
|
|
22
22
|
*
|
|
23
23
|
* @prop {string} [props.className] - Additional CSS classes to apply to the progress circle.
|
|
24
|
-
* @prop {React.
|
|
24
|
+
* @prop {React.ElementType} [props.element="div"] - HTML element type to render as the container.
|
|
25
|
+
* @prop {React.Ref<HTMLDivElement>} [props.ref] - Ref to the progress circle element.
|
|
25
26
|
* @prop {number} [props.value] - Current progress value (0-100).
|
|
26
27
|
* @prop {number} [props.size=48] - Size of the progress circle in pixels.
|
|
27
28
|
* @prop {number} [props.strokeWidth=4] - Width of the progress stroke.
|
|
@@ -35,6 +36,7 @@ import type { LibColorsShort } from "../../types"
|
|
|
35
36
|
* @see https://doc-julseb-lib-react.vercel.app/components/progress-circle
|
|
36
37
|
*/
|
|
37
38
|
export const ProgressCircle: FC<ILibProgressCircle> = ({
|
|
39
|
+
element = "div",
|
|
38
40
|
className,
|
|
39
41
|
ref,
|
|
40
42
|
value,
|
|
@@ -46,6 +48,8 @@ export const ProgressCircle: FC<ILibProgressCircle> = ({
|
|
|
46
48
|
icon,
|
|
47
49
|
...rest
|
|
48
50
|
}) => {
|
|
51
|
+
const Element = element
|
|
52
|
+
|
|
49
53
|
const [animatedValue, setAnimatedValue] = useState(noAnimation ? value : 0)
|
|
50
54
|
const radius = (size - strokeWidth) / 2
|
|
51
55
|
const circumference = 2 * Math.PI * radius
|
|
@@ -66,7 +70,7 @@ export const ProgressCircle: FC<ILibProgressCircle> = ({
|
|
|
66
70
|
}, [value, noAnimation])
|
|
67
71
|
|
|
68
72
|
return (
|
|
69
|
-
<
|
|
73
|
+
<Element
|
|
70
74
|
ref={ref}
|
|
71
75
|
className={clsx(
|
|
72
76
|
"inline-flex relative justify-center items-center",
|
|
@@ -124,7 +128,7 @@ export const ProgressCircle: FC<ILibProgressCircle> = ({
|
|
|
124
128
|
)}
|
|
125
129
|
</div>
|
|
126
130
|
)}
|
|
127
|
-
</
|
|
131
|
+
</Element>
|
|
128
132
|
)
|
|
129
133
|
}
|
|
130
134
|
|
|
@@ -4,8 +4,7 @@ import type {
|
|
|
4
4
|
ReactElement,
|
|
5
5
|
} from "../../types"
|
|
6
6
|
|
|
7
|
-
interface ILibProgressCircleBase
|
|
8
|
-
extends Omit<LibComponentBase<HTMLDivElement>, "element"> {
|
|
7
|
+
interface ILibProgressCircleBase extends LibComponentBase<HTMLDivElement> {
|
|
9
8
|
value: number
|
|
10
9
|
size?: number
|
|
11
10
|
strokeWidth?: number
|
|
@@ -25,7 +25,7 @@ import type { ILibRating } from "./types"
|
|
|
25
25
|
* @extends HTMLDivElement
|
|
26
26
|
*
|
|
27
27
|
* @prop {string} [props.className] - Additional CSS classes to apply to the rating container.
|
|
28
|
-
* @prop {React.Ref<
|
|
28
|
+
* @prop {React.Ref<HTMLDivElement>} [props.ref] - Ref to the rating container div element.
|
|
29
29
|
* @prop {number} [props.rating] - Current rating value (1-5 stars).
|
|
30
30
|
* @prop {function} [props.setRating] - Function to update the rating value when not in read-only mode.
|
|
31
31
|
* @prop {object} [props.icons] - Icon configuration object with default and checked icon variants.
|
|
@@ -31,7 +31,7 @@ import type { ILibSelect } from "./types"
|
|
|
31
31
|
* @extends HTMLButtonElement
|
|
32
32
|
*
|
|
33
33
|
* @prop {string} [props.className] - Additional CSS classes to apply to the select container.
|
|
34
|
-
* @prop {React.Ref<
|
|
34
|
+
* @prop {React.Ref<HTMLButtonElement>} [props.ref] - Ref to the button element.
|
|
35
35
|
* @prop {string} [props.value] - Currently selected value.
|
|
36
36
|
* @prop {function} [props.setValue] - Function to update the selected value.
|
|
37
37
|
* @prop {string[]} [props.options] - Array of options to display in the dropdown.
|
|
@@ -47,8 +47,11 @@ export const Skeleton: FC<ILibSkeleton> = ({
|
|
|
47
47
|
)
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
const genAnimation: Record<LibSkeletonAnimation, string
|
|
50
|
+
const genAnimation: Record<LibSkeletonAnimation, string | Array<string>> = {
|
|
51
51
|
none: "animate-none",
|
|
52
52
|
pulse: "animate-pulse",
|
|
53
|
-
shine:
|
|
53
|
+
shine: [
|
|
54
|
+
"relative overflow-hidden",
|
|
55
|
+
"before:absolute before:-top-[200px] before:-bottom-[200px] before:bg-white before:opacity-70 before:blur-[20px] before:w-[100px] before:-skew-15 before:animate-[shine_2000ms_ease-in-out_infinite]",
|
|
56
|
+
],
|
|
54
57
|
}
|
|
@@ -43,7 +43,10 @@ export const SkeletonCard: FC<ILibSkeletonCard> = ({
|
|
|
43
43
|
element={element}
|
|
44
44
|
className={clsx(
|
|
45
45
|
"relative overflow-hidden",
|
|
46
|
-
isShiny &&
|
|
46
|
+
isShiny && [
|
|
47
|
+
"relative overflow-hidden",
|
|
48
|
+
"before:absolute before:-top-[200px] before:-bottom-[200px] before:bg-white before:opacity-70 before:blur-[20px] before:w-[100px] before:-skew-15 before:animate-[shine_2000ms_ease-in-out_infinite]",
|
|
49
|
+
],
|
|
47
50
|
genBgAllColors[backgroundColor],
|
|
48
51
|
genBorderRadius[borderRadius],
|
|
49
52
|
"skeleton-card",
|
|
@@ -31,7 +31,7 @@ import type { ILibSlideshow } from "./types"
|
|
|
31
31
|
*
|
|
32
32
|
* @prop {string} [props.className] - Additional CSS classes to apply to the slideshow container.
|
|
33
33
|
* @prop {React.ElementType} [props.element="div"] - HTML element type to render as the container.
|
|
34
|
-
* @prop {React.Ref<
|
|
34
|
+
* @prop {React.Ref<HTMLDivElement>} [props.ref] - Ref to the slideshow element.
|
|
35
35
|
* @prop {React.ReactNode} [props.children] - Child components to display as slides when not using images prop.
|
|
36
36
|
* @prop {"cover" | "contain" | "fill"} [props.imgFit="cover"] - Object fit property for images in the slideshow.
|
|
37
37
|
* @prop {object} [props.controls] - Configuration object for navigation control buttons.
|
|
@@ -21,7 +21,7 @@ export const SlideshowPagination: FC<ILibSlideshowPagination> = ({
|
|
|
21
21
|
return (
|
|
22
22
|
<div
|
|
23
23
|
className={clsx(
|
|
24
|
-
"flex justify-center gap-2 mx-auto
|
|
24
|
+
"flex justify-center gap-2 mx-auto px-2 w-full max-w-[70%]",
|
|
25
25
|
pagination?.position === "outside"
|
|
26
26
|
? ""
|
|
27
27
|
: "absolute bottom-1 left-[50%] -translate-x-[50%]",
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { type FC } from "react"
|
|
2
|
+
import { clsx } from "../../utils"
|
|
3
|
+
import type { ILibSrOnly } from "./types"
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* SrOnly component for creating screen reader only content that is visually hidden but accessible to assistive technologies.
|
|
7
|
+
*
|
|
8
|
+
* @component
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* <SrOnly>
|
|
12
|
+
* This text is only visible to screen readers
|
|
13
|
+
* </SrOnly>
|
|
14
|
+
*
|
|
15
|
+
* @extends ILibSrOnly
|
|
16
|
+
*
|
|
17
|
+
* @prop {React.ElementType} [props.element="div"] - HTML element type to render as the container.
|
|
18
|
+
* @prop {React.Ref<any>} [props.ref] - Ref to the sr-only element.
|
|
19
|
+
* @prop {React.ReactNode} [props.children] - Content to be hidden visually but accessible to screen readers.
|
|
20
|
+
*
|
|
21
|
+
* @returns {JSX.Element} The rendered SrOnly component with screen reader accessible content.
|
|
22
|
+
*
|
|
23
|
+
* @see https://doc-julseb-lib-react.vercel.app/components/sr-only
|
|
24
|
+
*/
|
|
25
|
+
export const SrOnly: FC<ILibSrOnly> = ({ element = "div", ref, children }) => {
|
|
26
|
+
const Element = element
|
|
27
|
+
|
|
28
|
+
return (
|
|
29
|
+
<Element ref={ref} className={clsx("sr-only")}>
|
|
30
|
+
{children}
|
|
31
|
+
</Element>
|
|
32
|
+
)
|
|
33
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./SrOnly"
|
|
@@ -17,7 +17,7 @@ import type { ILibSticky } from "./types"
|
|
|
17
17
|
*
|
|
18
18
|
* @prop {string} [props.className] - Additional CSS classes to apply to the sticky container.
|
|
19
19
|
* @prop {React.ElementType} [props.element="div"] - HTML element type to render as the container.
|
|
20
|
-
* @prop {React.Ref<
|
|
20
|
+
* @prop {React.Ref<HTMLDivElement>} [props.ref] - Ref to the sticky element.
|
|
21
21
|
* @prop {React.ReactNode} [props.children] - Content to be positioned sticky.
|
|
22
22
|
* @prop {"0px" | "2xs" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl"} [props.top="sm"] - Distance from top when sticky positioning is active.
|
|
23
23
|
*
|
|
@@ -48,11 +48,11 @@ export const Sticky: FC<ILibSticky> = ({
|
|
|
48
48
|
|
|
49
49
|
const genTop: Record<LibSpacers, string> = {
|
|
50
50
|
"0px": "top-0",
|
|
51
|
-
"2xs": "top-
|
|
52
|
-
xs: "top-
|
|
53
|
-
sm: "top-
|
|
54
|
-
md: "top-
|
|
55
|
-
lg: "top-
|
|
56
|
-
xl: "top-
|
|
57
|
-
"2xl": "top-
|
|
51
|
+
"2xs": "top-1",
|
|
52
|
+
xs: "top-2",
|
|
53
|
+
sm: "top-3",
|
|
54
|
+
md: "top-4",
|
|
55
|
+
lg: "top-5",
|
|
56
|
+
xl: "top-8",
|
|
57
|
+
"2xl": "top-12",
|
|
58
58
|
}
|
|
@@ -89,10 +89,13 @@ export const Table: FC<ILibTable> = ({
|
|
|
89
89
|
{...rest}
|
|
90
90
|
>
|
|
91
91
|
{headers && (
|
|
92
|
-
<thead>
|
|
93
|
-
<tr>
|
|
92
|
+
<thead className={clsx(genVAlign[vAlign])}>
|
|
93
|
+
<tr className={clsx(genVAlign[vAlign])}>
|
|
94
94
|
{headers.map(header => (
|
|
95
|
-
<th
|
|
95
|
+
<th
|
|
96
|
+
className={clsx(genVAlign[vAlign])}
|
|
97
|
+
key={uuid()}
|
|
98
|
+
>
|
|
96
99
|
{linkify && typeof header === "string"
|
|
97
100
|
? linkifyText(header, blank)
|
|
98
101
|
: header}
|
|
@@ -103,7 +106,7 @@ export const Table: FC<ILibTable> = ({
|
|
|
103
106
|
)}
|
|
104
107
|
|
|
105
108
|
{data ? (
|
|
106
|
-
<tbody>
|
|
109
|
+
<tbody className={clsx(genVAlign[vAlign])}>
|
|
107
110
|
{data.map(row => (
|
|
108
111
|
<tr key={uuid()}>
|
|
109
112
|
{row.map(col => (
|
|
@@ -117,7 +120,7 @@ export const Table: FC<ILibTable> = ({
|
|
|
117
120
|
))}
|
|
118
121
|
</tbody>
|
|
119
122
|
) : (
|
|
120
|
-
children
|
|
123
|
+
<tbody>{children}</tbody>
|
|
121
124
|
)}
|
|
122
125
|
|
|
123
126
|
{footers && (
|
|
@@ -30,7 +30,7 @@ import type { ILibTabs } from "./types"
|
|
|
30
30
|
*
|
|
31
31
|
* @prop {string} [props.className] - Additional CSS classes to apply to the tabs container.
|
|
32
32
|
* @prop {React.ElementType} [props.element="div"] - HTML element type to render as the container.
|
|
33
|
-
* @prop {React.Ref<
|
|
33
|
+
* @prop {React.Ref<HTMLDivElement>} [props.ref] - Ref to the tabs container element.
|
|
34
34
|
* @prop {Array<LibTabItem>} [props.items] - Array of tab items containing title and content for each tab.
|
|
35
35
|
* @prop {"start" | "stretch"} [props.justify="start"] - Justification for positioning tabs within their container.
|
|
36
36
|
* @prop {"basic" | "rounded"} [props.variant="basic"] - Visual variant for styling the tab buttons.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type FC } from "react"
|
|
2
|
-
import { clsx } from "../../utils"
|
|
2
|
+
import { clsx, genRingColor } from "../../utils"
|
|
3
3
|
import type { ILibTabsButton } from "./types"
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -20,7 +20,7 @@ import type { ILibTabsButton } from "./types"
|
|
|
20
20
|
*
|
|
21
21
|
* @prop {string} [props.className] - Additional CSS classes to apply to the tab button.
|
|
22
22
|
* @prop {React.ElementType} [props.element="button"] - HTML element type to render as the container.
|
|
23
|
-
* @prop {React.Ref<
|
|
23
|
+
* @prop {React.Ref<HTMLButtonElement>} [props.ref] - Ref to the tab button element.
|
|
24
24
|
* @prop {React.ReactNode} [props.children] - Content to display inside the tab button.
|
|
25
25
|
* @prop {"start" | "stretch"} [props.justify="start"] - Justification for positioning the button content.
|
|
26
26
|
* @prop {"basic" | "rounded"} [props.variant="basic"] - Visual variant for styling the tab button.
|
|
@@ -48,6 +48,8 @@ export const TabsButton: FC<ILibTabsButton> = ({
|
|
|
48
48
|
<Element
|
|
49
49
|
ref={ref}
|
|
50
50
|
className={clsx(
|
|
51
|
+
"outline-none",
|
|
52
|
+
genRingColor["primary"],
|
|
51
53
|
isActive && "active",
|
|
52
54
|
variant === "basic" && [
|
|
53
55
|
"text-left border-b border-b-transparent translate-y-[1px]",
|
|
@@ -18,7 +18,7 @@ import type { ILibTabsButtonsContainer } from "./types"
|
|
|
18
18
|
*
|
|
19
19
|
* @prop {string} [props.className] - Additional CSS classes to apply to the tabs buttons container.
|
|
20
20
|
* @prop {React.ElementType} [props.element="div"] - HTML element type to render as the container.
|
|
21
|
-
* @prop {React.Ref<
|
|
21
|
+
* @prop {React.Ref<HTMLDivElement>} [props.ref] - Ref to the tabs buttons container element.
|
|
22
22
|
* @prop {React.ReactNode} [props.children] - Child components (typically TabsButton components).
|
|
23
23
|
* @prop {"start" | "stretch"} [props.justify="start"] - Justification for positioning tabs within their container.
|
|
24
24
|
* @prop {"basic" | "rounded"} [props.variant="basic"] - Visual variant for styling the tab buttons.
|
|
@@ -21,7 +21,7 @@ import type { ILibTabsContainer } from "./types"
|
|
|
21
21
|
*
|
|
22
22
|
* @prop {string} [props.className] - Additional CSS classes to apply to the tabs container.
|
|
23
23
|
* @prop {React.ElementType} [props.element="div"] - HTML element type to render as the container.
|
|
24
|
-
* @prop {React.Ref<
|
|
24
|
+
* @prop {React.Ref<HTMLDivElement>} [props.ref] - Ref to the tabs container element.
|
|
25
25
|
* @prop {React.ReactNode} [props.children] - Child components (typically TabsNav and TabsContent).
|
|
26
26
|
*
|
|
27
27
|
* @returns {JSX.Element} The rendered TabsContainer component.
|
|
@@ -18,7 +18,7 @@ import type { ILibTabContent } from "./types"
|
|
|
18
18
|
*
|
|
19
19
|
* @prop {string} [props.className] - Additional CSS classes to apply to the tab content container.
|
|
20
20
|
* @prop {React.ElementType} [props.element] - HTML element type to render as the container. Defaults to Text if children is string, otherwise "div".
|
|
21
|
-
* @prop {React.Ref<
|
|
21
|
+
* @prop {React.Ref<HTMLDivElement>} [props.ref] - Ref to the tab content element.
|
|
22
22
|
* @prop {React.ReactNode} [props.children] - Content to display inside the tab panel.
|
|
23
23
|
* @prop {boolean} [props.isActive] - Whether this tab content is currently active/visible.
|
|
24
24
|
*
|
|
@@ -25,7 +25,7 @@ import type { ILibTag } from "./types"
|
|
|
25
25
|
*
|
|
26
26
|
* @prop {string} [props.className] - Additional CSS classes to apply to the tag container.
|
|
27
27
|
* @prop {React.ElementType} [props.element="span"] - HTML element type to render as the container.
|
|
28
|
-
* @prop {React.Ref<
|
|
28
|
+
* @prop {React.Ref<HTMLSpanElement>} [props.ref] - Ref to the tag element.
|
|
29
29
|
* @prop {React.ReactNode} [props.children] - Content to display inside the tag.
|
|
30
30
|
* @prop {LibAllColors} [props.color="primary"] - Background or border color of the tag.
|
|
31
31
|
* @prop {LibAllColors} [props.contentColor] - Text color of the tag content.
|
|
@@ -25,8 +25,8 @@ export const H1: FC<ILibText> = ({
|
|
|
25
25
|
<Element
|
|
26
26
|
className={clsx(
|
|
27
27
|
display
|
|
28
|
-
? "text-(length:--
|
|
29
|
-
: "text-(length:--
|
|
28
|
+
? "text-(length:--text-display-h1)"
|
|
29
|
+
: "text-(length:--text-h1)",
|
|
30
30
|
TEXT_BASE_CLASSES,
|
|
31
31
|
"font-black",
|
|
32
32
|
(genTextAlign as any)[textAlign],
|
|
@@ -27,8 +27,8 @@ export const H2: FC<ILibText> = ({
|
|
|
27
27
|
TEXT_BASE_CLASSES,
|
|
28
28
|
"font-black",
|
|
29
29
|
display
|
|
30
|
-
? "text-(length:--
|
|
31
|
-
: "text-(length:--
|
|
30
|
+
? "text-(length:--text-display-h2)"
|
|
31
|
+
: "text-(length:--text-h2)",
|
|
32
32
|
(genTextAlign as any)[textAlign],
|
|
33
33
|
(genTextAllColor as any)[color],
|
|
34
34
|
genLinkColor[linkColor],
|
|
@@ -27,8 +27,8 @@ export const H3: FC<ILibText> = ({
|
|
|
27
27
|
TEXT_BASE_CLASSES,
|
|
28
28
|
"font-black",
|
|
29
29
|
display
|
|
30
|
-
? "text-(length:--
|
|
31
|
-
: "text-(length:--
|
|
30
|
+
? "text-(length:--text-display-h3)"
|
|
31
|
+
: "text-(length:--text-h3)",
|
|
32
32
|
(genTextAlign as any)[textAlign],
|
|
33
33
|
(genTextAllColor as any)[color],
|
|
34
34
|
genLinkColor[linkColor],
|
|
@@ -27,8 +27,8 @@ export const H4: FC<ILibText> = ({
|
|
|
27
27
|
TEXT_BASE_CLASSES,
|
|
28
28
|
"font-black",
|
|
29
29
|
display
|
|
30
|
-
? "text-(length:--
|
|
31
|
-
: "text-(length:--
|
|
30
|
+
? "text-(length:--text-display-h4)"
|
|
31
|
+
: "text-(length:--text-h4)",
|
|
32
32
|
(genTextAlign as any)[textAlign],
|
|
33
33
|
(genTextAllColor as any)[color],
|
|
34
34
|
genLinkColor[linkColor],
|
|
@@ -27,8 +27,8 @@ export const H5: FC<ILibText> = ({
|
|
|
27
27
|
TEXT_BASE_CLASSES,
|
|
28
28
|
"font-black",
|
|
29
29
|
display
|
|
30
|
-
? "text-(length:--
|
|
31
|
-
: "text-(length:--
|
|
30
|
+
? "text-(length:--text-display-h5)"
|
|
31
|
+
: "text-(length:--text-h5)",
|
|
32
32
|
(genTextAlign as any)[textAlign],
|
|
33
33
|
(genTextAllColor as any)[color],
|
|
34
34
|
genLinkColor[linkColor],
|
|
@@ -24,7 +24,7 @@ export const Small: FC<ILibText> = ({
|
|
|
24
24
|
<Element
|
|
25
25
|
className={clsx(
|
|
26
26
|
TEXT_BASE_CLASSES,
|
|
27
|
-
"text-(length:--
|
|
27
|
+
"text-(length:--text-small)",
|
|
28
28
|
(genTextAlign as any)[textAlign],
|
|
29
29
|
(genTextAllColor as any)[color],
|
|
30
30
|
genLinkColor[linkColor],
|