@festo-ui/react 11.1.0-dev.994 → 11.1.0-dev.997

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.
@@ -1,9 +1,9 @@
1
- .fwe-page-dot {
1
+ .fwe-page-dot, .fwe-page-dot-lg {
2
2
  border: none;
3
3
  padding: 0;
4
4
  }
5
5
 
6
- .fwe-page-dot:focus {
6
+ .fwe-page-dot:focus, .fwe-page-dot-lg:focus {
7
7
  background: var(--fwe-control-border-hover);
8
8
  outline: 0;
9
9
  }
@@ -1,5 +1,5 @@
1
1
  import './Pagination.scss';
2
- export type PaginationType = 'SIMPLE' | 'NUMERIC' | 'DOTS';
2
+ export type PaginationType = 'basic' | 'numeric' | 'dots' | 'dots-lg' | 'SIMPLE' | 'NUMERIC' | 'DOTS';
3
3
  export interface PaginationProps extends Omit<React.ComponentPropsWithoutRef<'div'>, 'onChange'> {
4
4
  readonly type?: PaginationType;
5
5
  readonly onChange?: (page: number, event: React.MouseEvent<HTMLButtonElement>) => void;
@@ -2,7 +2,7 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
2
  import "./Pagination.css";
3
3
  import classnames from "classnames";
4
4
  import { forwardRef, useEffect, useState } from "react";
5
- const Pagination = /*#__PURE__*/ forwardRef(({ pageMax, onChange, pageCurrent, defaultPageCurrent = 1, type = 'NUMERIC', className, ...props }, ref)=>{
5
+ const Pagination = /*#__PURE__*/ forwardRef(({ pageMax, onChange, pageCurrent, defaultPageCurrent = 1, type = 'numeric', className, ...props }, ref)=>{
6
6
  const controlled = void 0 !== pageCurrent;
7
7
  const dotArray = Array.from(new Array(pageMax).keys());
8
8
  const [innerPageCurrent, setInnerPageCurrent] = useState(controlled ? pageCurrent : defaultPageCurrent);
@@ -32,66 +32,63 @@ const Pagination = /*#__PURE__*/ forwardRef(({ pageMax, onChange, pageCurrent, d
32
32
  const newPageCurrent = index + 1;
33
33
  handleChange(newPageCurrent, event);
34
34
  }
35
- return /*#__PURE__*/ jsxs(Fragment, {
36
- children: [
37
- 'DOTS' !== type && /*#__PURE__*/ jsxs("div", {
38
- ...props,
39
- className: classnames('fwe-pagination', {
40
- 'fwe-d-none': pageMax < 2
41
- }, className),
42
- ref: ref,
43
- children: [
44
- /*#__PURE__*/ jsx("button", {
45
- className: classnames('fwe-navigate-btn-down', {
46
- 'fwe-disabled': innerPageCurrent <= 1
47
- }),
48
- onClick: onBtnDown,
35
+ return /*#__PURE__*/ jsx(Fragment, {
36
+ children: 'dots' === type || 'dots-lg' === type || 'DOTS' === type ? /*#__PURE__*/ jsx("div", {
37
+ ...props,
38
+ className: classnames({
39
+ 'fwe-d-none': pageMax < 2
40
+ }, className),
41
+ ref: ref,
42
+ children: /*#__PURE__*/ jsx("div", {
43
+ className: "fwe-pagination",
44
+ children: dotArray.map((index)=>/*#__PURE__*/ jsx("button", {
49
45
  type: "button",
50
- "aria-label": "navigate-btn-down"
51
- }),
52
- 'NUMERIC' === type && /*#__PURE__*/ jsxs(Fragment, {
53
- children: [
54
- /*#__PURE__*/ jsx("span", {
55
- className: "fwe-page-current",
56
- children: innerPageCurrent
57
- }),
58
- /*#__PURE__*/ jsx("span", {
59
- className: "fwe-page-max",
60
- children: pageMax
61
- })
62
- ]
46
+ className: classnames(`fwe-page-dot${'dots-lg' === type ? '-lg' : ''}`, {
47
+ 'fwe-selected': index + 1 === innerPageCurrent
48
+ }),
49
+ onClick: (e)=>onDotClick(index, e),
50
+ "aria-label": `Go to page ${index + 1}`,
51
+ "aria-current": index + 1 === innerPageCurrent ? 'page' : void 0
52
+ }, index))
53
+ })
54
+ }) : /*#__PURE__*/ jsxs("div", {
55
+ ...props,
56
+ className: classnames('fwe-pagination', {
57
+ 'fwe-d-none': pageMax < 2
58
+ }, className),
59
+ ref: ref,
60
+ children: [
61
+ /*#__PURE__*/ jsx("button", {
62
+ className: classnames('fwe-navigate-btn-down', {
63
+ 'fwe-disabled': innerPageCurrent <= 1
63
64
  }),
64
- /*#__PURE__*/ jsx("button", {
65
- className: classnames('fwe-navigate-btn-up', {
66
- 'fwe-disabled': innerPageCurrent >= pageMax,
67
- 'fwe-ml-4': 'SIMPLE' === type
65
+ onClick: onBtnDown,
66
+ type: "button",
67
+ "aria-label": "navigate-btn-down"
68
+ }),
69
+ ('numeric' === type || 'NUMERIC' === type) && /*#__PURE__*/ jsxs(Fragment, {
70
+ children: [
71
+ /*#__PURE__*/ jsx("span", {
72
+ className: "fwe-page-current",
73
+ children: innerPageCurrent
68
74
  }),
69
- onClick: onBtnUp,
70
- type: "button",
71
- "aria-label": "navigate-btn-up"
72
- })
73
- ]
74
- }),
75
- 'DOTS' === type && /*#__PURE__*/ jsx("div", {
76
- ...props,
77
- className: classnames({
78
- 'fwe-d-none': pageMax < 2
79
- }, className),
80
- ref: ref,
81
- children: /*#__PURE__*/ jsx("div", {
82
- className: "fwe-pagination",
83
- children: dotArray.map((index)=>/*#__PURE__*/ jsx("button", {
84
- type: "button",
85
- className: classnames('fwe-page-dot', {
86
- 'fwe-selected': index + 1 === innerPageCurrent
87
- }),
88
- onClick: (e)=>onDotClick(index, e),
89
- "aria-label": `Go to page ${index + 1}`,
90
- "aria-current": index + 1 === innerPageCurrent ? 'page' : void 0
91
- }, index))
75
+ /*#__PURE__*/ jsx("span", {
76
+ className: "fwe-page-max",
77
+ children: pageMax
78
+ })
79
+ ]
80
+ }),
81
+ /*#__PURE__*/ jsx("button", {
82
+ className: classnames('fwe-navigate-btn-up', {
83
+ 'fwe-disabled': innerPageCurrent >= pageMax,
84
+ 'fwe-ml-4': 'SIMPLE' === type
85
+ }),
86
+ onClick: onBtnUp,
87
+ type: "button",
88
+ "aria-label": "navigate-btn-up"
92
89
  })
93
- })
94
- ]
90
+ ]
91
+ })
95
92
  });
96
93
  });
97
94
  Pagination.displayName = 'Pagination';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@festo-ui/react",
3
- "version": "11.1.0-dev.994",
3
+ "version": "11.1.0-dev.997",
4
4
  "author": "Festo UI (styleguide@festo.com)",
5
5
  "copyright": "Copyright (c) 2025 Festo SE & Co. KG. All rights reserved.",
6
6
  "license": "apache-2.0",