@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.
Files changed (117) hide show
  1. package/dist/index.css +57 -116
  2. package/dist/julseb-lib-react.cjs.js +12 -12
  3. package/dist/julseb-lib-react.es.js +1868 -1794
  4. package/dist/julseb-lib-react.umd.js +12 -12
  5. package/dist/lib/Variables.ts +20 -19
  6. package/dist/lib/components/Accordion/Accordion.tsx +1 -1
  7. package/dist/lib/components/Accordion/AccordionContent.tsx +2 -2
  8. package/dist/lib/components/Accordion/AccordionTitle.tsx +4 -3
  9. package/dist/lib/components/Alert/Alert.tsx +2 -2
  10. package/dist/lib/components/Autocomplete/Autocomplete.tsx +1 -1
  11. package/dist/lib/components/Avatar/Avatar.tsx +3 -7
  12. package/dist/lib/components/BackToTop/BackToTop.tsx +4 -3
  13. package/dist/lib/components/Badge/Badge.tsx +1 -1
  14. package/dist/lib/components/Breadcrumbs/Breadcrumbs.tsx +1 -1
  15. package/dist/lib/components/Burger/Burger.tsx +11 -4
  16. package/dist/lib/components/Button/Button.tsx +5 -4
  17. package/dist/lib/components/ButtonGroup/ButtonGroup.tsx +4 -2
  18. package/dist/lib/components/ButtonIcon/ButtonFn.tsx +3 -1
  19. package/dist/lib/components/ButtonIcon/ButtonIcon.tsx +9 -2
  20. package/dist/lib/components/CodeContainer/CodeContainer.tsx +5 -5
  21. package/dist/lib/components/Cover/Cover.tsx +1 -1
  22. package/dist/lib/components/DragList/DragList.tsx +1 -1
  23. package/dist/lib/components/DragList/DragListItem.tsx +4 -3
  24. package/dist/lib/components/Drawer/Drawer.tsx +1 -1
  25. package/dist/lib/components/Dropdown/Dropdown.tsx +1 -1
  26. package/dist/lib/components/Fade/Fade.tsx +4 -4
  27. package/dist/lib/components/Fieldset/Fieldset.tsx +2 -2
  28. package/dist/lib/components/Footer/Footer.tsx +103 -0
  29. package/dist/lib/components/Footer/index.ts +1 -0
  30. package/dist/lib/components/Footer/types.ts +54 -0
  31. package/dist/lib/components/Form/Form.tsx +1 -1
  32. package/dist/lib/components/Header/Header.tsx +15 -6
  33. package/dist/lib/components/Header/types.ts +1 -1
  34. package/dist/lib/components/Image/Image.tsx +1 -1
  35. package/dist/lib/components/Input/Input.tsx +2 -2
  36. package/dist/lib/components/Input/templates/ColorInput.tsx +4 -0
  37. package/dist/lib/components/InputCheck/InputCheck.tsx +2 -2
  38. package/dist/lib/components/InputComponents/InputButton.tsx +7 -2
  39. package/dist/lib/components/InputComponents/classes.ts +1 -1
  40. package/dist/lib/components/InputContainer/InputContainer.tsx +1 -1
  41. package/dist/lib/components/InputCounter/InputCounter.tsx +2 -2
  42. package/dist/lib/components/InputImage/InputImage.tsx +1 -1
  43. package/dist/lib/components/InputPhone/InputPhone.tsx +1 -1
  44. package/dist/lib/components/InputPin/InputPin.tsx +3 -1
  45. package/dist/lib/components/InputSlider/InputSlider.tsx +1 -1
  46. package/dist/lib/components/Key/Key.tsx +2 -2
  47. package/dist/lib/components/ListGroup/ListGroup.tsx +1 -1
  48. package/dist/lib/components/ListGroup/ListGroupItem.tsx +1 -1
  49. package/dist/lib/components/ListGroup/ListGroupTitle.tsx +1 -1
  50. package/dist/lib/components/Loader/Loader.tsx +1 -1
  51. package/dist/lib/components/Loader/templates/LoaderOne.tsx +1 -1
  52. package/dist/lib/components/Loader/templates/LoaderThree.tsx +3 -3
  53. package/dist/lib/components/Loader/templates/LoaderTwo.tsx +2 -2
  54. package/dist/lib/components/MarkdownContainer/MarkdownContainer.tsx +2 -2
  55. package/dist/lib/components/Meta/Meta.tsx +125 -0
  56. package/dist/lib/components/Meta/index.ts +1 -0
  57. package/dist/lib/components/Meta/types.ts +35 -0
  58. package/dist/lib/components/Modal/Modal.tsx +1 -1
  59. package/dist/lib/components/PageLayout/PageLayout.tsx +64 -0
  60. package/dist/lib/components/PageLayout/index.ts +1 -0
  61. package/dist/lib/components/PageLayout/types.ts +29 -0
  62. package/dist/lib/components/PageLoading/PageLoading.tsx +1 -1
  63. package/dist/lib/components/Pagination/Pagination.tsx +1 -1
  64. package/dist/lib/components/Pagination/PaginationButton.tsx +1 -1
  65. package/dist/lib/components/Paginator/Paginator.tsx +1 -1
  66. package/dist/lib/components/ProgressBar/ProgressBar.tsx +4 -7
  67. package/dist/lib/components/ProgressBar/types.ts +1 -1
  68. package/dist/lib/components/ProgressCircle/ProgressCircle.tsx +7 -3
  69. package/dist/lib/components/ProgressCircle/types.ts +1 -2
  70. package/dist/lib/components/Rating/Rating.tsx +1 -1
  71. package/dist/lib/components/Select/Select.tsx +1 -1
  72. package/dist/lib/components/Skeleton/Skeleton.tsx +5 -2
  73. package/dist/lib/components/Skeleton/SkeletonCard.tsx +4 -1
  74. package/dist/lib/components/Slideshow/Slideshow.tsx +1 -1
  75. package/dist/lib/components/Slideshow/SlideshowPagination.tsx +1 -1
  76. package/dist/lib/components/SrOnly/SrOnly.tsx +33 -0
  77. package/dist/lib/components/SrOnly/index.ts +1 -0
  78. package/dist/lib/components/SrOnly/types.ts +7 -0
  79. package/dist/lib/components/Sticky/Sticky.tsx +8 -8
  80. package/dist/lib/components/Table/Table.tsx +8 -5
  81. package/dist/lib/components/Tabs/Tabs.tsx +1 -1
  82. package/dist/lib/components/Tabs/TabsButton.tsx +4 -2
  83. package/dist/lib/components/Tabs/TabsButtonsContainer.tsx +1 -1
  84. package/dist/lib/components/Tabs/TabsContainer.tsx +1 -1
  85. package/dist/lib/components/Tabs/TabsContent.tsx +1 -1
  86. package/dist/lib/components/Tag/Tag.tsx +1 -1
  87. package/dist/lib/components/Text/templates/Blockquote.tsx +1 -1
  88. package/dist/lib/components/Text/templates/Dl.tsx +1 -1
  89. package/dist/lib/components/Text/templates/H1.tsx +2 -2
  90. package/dist/lib/components/Text/templates/H2.tsx +2 -2
  91. package/dist/lib/components/Text/templates/H3.tsx +2 -2
  92. package/dist/lib/components/Text/templates/H4.tsx +2 -2
  93. package/dist/lib/components/Text/templates/H5.tsx +2 -2
  94. package/dist/lib/components/Text/templates/H6.tsx +1 -1
  95. package/dist/lib/components/Text/templates/Ol.tsx +1 -1
  96. package/dist/lib/components/Text/templates/P.tsx +1 -1
  97. package/dist/lib/components/Text/templates/Small.tsx +1 -1
  98. package/dist/lib/components/Text/templates/Ul.tsx +1 -1
  99. package/dist/lib/components/Toast/Toast.tsx +5 -4
  100. package/dist/lib/components/Tooltip/Tooltip.tsx +29 -22
  101. package/dist/lib/components/Wrapper/Wrapper.tsx +1 -1
  102. package/dist/lib/index.css +57 -116
  103. package/dist/lib/index.ts +4 -1
  104. package/dist/lib/types/components-items-props.ts +1 -24
  105. package/dist/lib/types/components-props.ts +4 -1
  106. package/dist/lib/types/global.ts +11 -13
  107. package/dist/lib/utils/design-tokens.ts +2 -7
  108. package/dist/lib/utils/gen-gap.ts +21 -21
  109. package/dist/lib/utils/gen-ring-color.ts +21 -0
  110. package/dist/lib/utils/index.ts +1 -0
  111. package/package.json +3 -3
  112. package/dist/lib/components/IconMenu/IconMenu.module.css +0 -239
  113. package/dist/lib/components/IconMenu/IconMenu.tsx +0 -101
  114. package/dist/lib/components/IconMenu/IconMenuItem.tsx +0 -53
  115. package/dist/lib/components/IconMenu/index.ts +0 -1
  116. package/dist/lib/components/IconMenu/types.ts +0 -48
  117. 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<any>} [props.ref] - Ref to the page loading element.
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<any>} [props.ref] - Ref to the pagination element.
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<any>} [props.ref] - Ref to the pagination button element.
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<any>} [props.ref] - Ref to the paginator element.
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.ElementType} [props.element="meter"] - HTML element type to render as the container.
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
- <Element
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 && "progress-bar-animated",
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.Ref<any>} [props.ref] - Ref to the progress circle element.
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
- <div
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
- </div>
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<any>} [props.ref] - Ref to the rating container div element.
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<any>} [props.ref] - Ref to the button element.
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: "animate-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 && "animate-shine",
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<any>} [props.ref] - Ref to the slideshow element.
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 py-2 w-full max-w-[70%]",
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"
@@ -0,0 +1,7 @@
1
+ import type { LibComponentBase } from "../../types"
2
+
3
+ export interface ILibSrOnly
4
+ extends Pick<
5
+ LibComponentBase<HTMLDivElement>,
6
+ "ref" | "element" | "children"
7
+ > {}
@@ -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<any>} [props.ref] - Ref to the sticky element.
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-(--spacer-2xs)",
52
- xs: "top-(--spacer-xs)",
53
- sm: "top-(--spacer-sm)",
54
- md: "top-(--spacer-md)",
55
- lg: "top-(--spacer-lg)",
56
- xl: "top-(--spacer-xl)",
57
- "2xl": "top-(--spacer-2xl)",
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 key={uuid()}>
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<any>} [props.ref] - Ref to the tabs container element.
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<any>} [props.ref] - Ref to the tab button element.
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<any>} [props.ref] - Ref to the tabs buttons container element.
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<any>} [props.ref] - Ref to the tabs container element.
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<any>} [props.ref] - Ref to the tab content element.
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<any>} [props.ref] - Ref to the tag element.
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.
@@ -24,7 +24,7 @@ export const Blockquote: FC<ILibText> = ({
24
24
  <Element
25
25
  className={clsx(
26
26
  TEXT_BASE_CLASSES,
27
- "text-(length:--font-size-h6)",
27
+ "text-(length:--text-h6)",
28
28
  "italic ps-4",
29
29
  genTextAlign[textAlign],
30
30
  (genTextAllColor as any)[color],
@@ -24,7 +24,7 @@ export const Dl: FC<ILibText> = ({
24
24
  <Element
25
25
  className={clsx(
26
26
  TEXT_BASE_CLASSES,
27
- "text-(length:--font-size-body)",
27
+ "text-(length:--text-body)",
28
28
  "[&>dt]:font-bold",
29
29
  "[&>dd]:font-normal [&>dd]:ps-4",
30
30
  genTextAlign[textAlign],
@@ -25,8 +25,8 @@ export const H1: FC<ILibText> = ({
25
25
  <Element
26
26
  className={clsx(
27
27
  display
28
- ? "text-(length:--font-size-display-h1)"
29
- : "text-(length:--font-size-h1)",
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:--font-size-display-h2)"
31
- : "text-(length:--font-size-h2)",
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:--font-size-display-h3)"
31
- : "text-(length:--font-size-h3)",
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:--font-size-display-h4)"
31
- : "text-(length:--font-size-h4)",
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:--font-size-display-h5)"
31
- : "text-(length:--font-size-h5)",
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 H6: FC<ILibText> = ({
24
24
  <Element
25
25
  className={clsx(
26
26
  TEXT_BASE_CLASSES,
27
- "text-(length:--font-size-h6)",
27
+ "text-(length:--text-h6)",
28
28
  "font-black",
29
29
  (genTextAlign as any)[textAlign],
30
30
  (genTextAllColor as any)[color],
@@ -24,7 +24,7 @@ export const Ol: FC<ILibText> = ({
24
24
  <Element
25
25
  className={clsx(
26
26
  TEXT_BASE_CLASSES,
27
- "text-(length:--font-size-body)",
27
+ "text-(length:--text-body)",
28
28
  "list-decimal ps-8",
29
29
  (genTextAlign as any)[textAlign],
30
30
  (genTextAllColor as any)[color],
@@ -24,7 +24,7 @@ export const P: FC<ILibText> = ({
24
24
  <Element
25
25
  className={clsx(
26
26
  TEXT_BASE_CLASSES,
27
- "text-(length:--font-size-body)",
27
+ "text-(length:--text-body)",
28
28
  (genTextAlign as any)[textAlign],
29
29
  (genTextAllColor as any)[color],
30
30
  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:--font-size-small)",
27
+ "text-(length:--text-small)",
28
28
  (genTextAlign as any)[textAlign],
29
29
  (genTextAllColor as any)[color],
30
30
  genLinkColor[linkColor],
@@ -24,7 +24,7 @@ export const Ul: FC<ILibText> = ({
24
24
  <Element
25
25
  className={clsx(
26
26
  TEXT_BASE_CLASSES,
27
- "text-(length:--font-size-body)",
27
+ "text-(length:--text-body)",
28
28
  "list-disc ps-8",
29
29
  (genTextAlign as any)[textAlign],
30
30
  (genTextAllColor as any)[color],