unifyedx-storybook-new 0.1.12 → 0.1.13

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.
@@ -1431,7 +1431,7 @@
1431
1431
  }
1432
1432
 
1433
1433
  .pagination-select {
1434
- padding: 0.375rem 1.75rem 0.375rem 0.75rem;
1434
+ padding: 0.375rem 2rem 0.375rem 0.75rem;
1435
1435
  border: 1px solid #d1d5db;
1436
1436
  border-radius: 0.375rem;
1437
1437
  font-size: 0.875rem;
@@ -1551,6 +1551,35 @@
1551
1551
  }
1552
1552
  }
1553
1553
 
1554
+ .page-input-form {
1555
+ display: flex;
1556
+ align-items: center;
1557
+ gap: 0.5rem;
1558
+ font-size: 0.875rem;
1559
+ color: #6b7280;
1560
+ }
1561
+
1562
+ .page-input {
1563
+ width: 2rem; /* 56px */
1564
+ padding: 0.5rem;
1565
+ border: 1px solid #d1d5db;
1566
+ border-radius: 0.375rem;
1567
+ text-align: center;
1568
+ font-size: 0.875rem;
1569
+ }
1570
+
1571
+ /* Hides the default number input spinners on some browsers */
1572
+
1573
+ .page-input::-webkit-outer-spin-button,
1574
+ .page-input::-webkit-inner-spin-button {
1575
+ -webkit-appearance: none;
1576
+ margin: 0;
1577
+ }
1578
+
1579
+ .page-input[type="number"] {
1580
+ -moz-appearance: textfield;
1581
+ }
1582
+
1554
1583
  .radiogroup-wrapper {
1555
1584
  width: 100%;
1556
1585
  font-family: sans-serif;
@@ -5495,7 +5524,7 @@
5495
5524
  }
5496
5525
 
5497
5526
  .pagination-select {
5498
- padding: 0.375rem 1.75rem 0.375rem 0.75rem;
5527
+ padding: 0.375rem 2rem 0.375rem 0.75rem;
5499
5528
  border: 1px solid #d1d5db;
5500
5529
  border-radius: 0.375rem;
5501
5530
  font-size: 0.875rem;
@@ -5613,6 +5642,33 @@
5613
5642
  justify-content: center;
5614
5643
  }
5615
5644
  }
5645
+
5646
+ .page-input-form {
5647
+ display: flex;
5648
+ align-items: center;
5649
+ gap: 0.5rem;
5650
+ font-size: 0.875rem;
5651
+ color: #6b7280;
5652
+ }
5653
+
5654
+ .page-input {
5655
+ width: 2rem; /* 56px */
5656
+ padding: 0.5rem;
5657
+ border: 1px solid #d1d5db;
5658
+ border-radius: 0.375rem;
5659
+ text-align: center;
5660
+ font-size: 0.875rem;
5661
+ }
5662
+
5663
+ /* Hides the default number input spinners on some browsers */
5664
+ .page-input::-webkit-outer-spin-button,
5665
+ .page-input::-webkit-inner-spin-button {
5666
+ -webkit-appearance: none;
5667
+ margin: 0;
5668
+ }
5669
+ .page-input[type="number"] {
5670
+ -moz-appearance: textfield;
5671
+ }
5616
5672
  .radiogroup-wrapper {
5617
5673
  width: 100%;
5618
5674
  font-family: sans-serif;
@@ -634,8 +634,11 @@ const ChevronDown = createLucideIcon("chevron-down", __iconNode$j);
634
634
  */
635
635
 
636
636
 
637
- const __iconNode$i = [["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]];
638
- const ChevronLeft = createLucideIcon("chevron-left", __iconNode$i);
637
+ const __iconNode$i = [
638
+ ["path", { d: "m17 18-6-6 6-6", key: "1yerx2" }],
639
+ ["path", { d: "M7 6v12", key: "1p53r6" }]
640
+ ];
641
+ const ChevronFirst = createLucideIcon("chevron-first", __iconNode$i);
639
642
 
640
643
  /**
641
644
  * @license lucide-react v0.525.0 - ISC
@@ -645,8 +648,11 @@ const ChevronLeft = createLucideIcon("chevron-left", __iconNode$i);
645
648
  */
646
649
 
647
650
 
648
- const __iconNode$h = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]];
649
- const ChevronRight = createLucideIcon("chevron-right", __iconNode$h);
651
+ const __iconNode$h = [
652
+ ["path", { d: "m7 18 6-6-6-6", key: "lwmzdw" }],
653
+ ["path", { d: "M17 6v12", key: "1o0aio" }]
654
+ ];
655
+ const ChevronLast = createLucideIcon("chevron-last", __iconNode$h);
650
656
 
651
657
  /**
652
658
  * @license lucide-react v0.525.0 - ISC
@@ -656,11 +662,8 @@ const ChevronRight = createLucideIcon("chevron-right", __iconNode$h);
656
662
  */
657
663
 
658
664
 
659
- const __iconNode$g = [
660
- ["path", { d: "m11 17-5-5 5-5", key: "13zhaf" }],
661
- ["path", { d: "m18 17-5-5 5-5", key: "h8a8et" }]
662
- ];
663
- const ChevronsLeft = createLucideIcon("chevrons-left", __iconNode$g);
665
+ const __iconNode$g = [["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]];
666
+ const ChevronLeft = createLucideIcon("chevron-left", __iconNode$g);
664
667
 
665
668
  /**
666
669
  * @license lucide-react v0.525.0 - ISC
@@ -670,11 +673,8 @@ const ChevronsLeft = createLucideIcon("chevrons-left", __iconNode$g);
670
673
  */
671
674
 
672
675
 
673
- const __iconNode$f = [
674
- ["path", { d: "m6 17 5-5-5-5", key: "xnjwq" }],
675
- ["path", { d: "m13 17 5-5-5-5", key: "17xmmf" }]
676
- ];
677
- const ChevronsRight = createLucideIcon("chevrons-right", __iconNode$f);
676
+ const __iconNode$f = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]];
677
+ const ChevronRight = createLucideIcon("chevron-right", __iconNode$f);
678
678
 
679
679
  /**
680
680
  * @license lucide-react v0.525.0 - ISC
@@ -39670,7 +39670,9 @@ const GenericFilter = ({
39670
39670
  isActive = Array.isArray(filterValue.values) && filterValue.values.length > 0;
39671
39671
  break;
39672
39672
  case "date":
39673
- isActive = filterValue.range && filterValue.range !== "";
39673
+ if (filterValue.range && filterValue.range !== "" || Array.isArray(filterValue.values) && filterValue.values.length > 0) {
39674
+ isActive = true;
39675
+ }
39674
39676
  break;
39675
39677
  }
39676
39678
  }
@@ -40152,98 +40154,100 @@ const Pagination = ({
40152
40154
  itemsPerPageOptions = [10, 15, 20]
40153
40155
  }) => {
40154
40156
  const totalPages = Math.ceil(totalItems / itemsPerPage);
40155
- const getPageNumbers = () => {
40156
- const pages = [];
40157
- pages.push(1);
40158
- const startPage = Math.max(2, currentPage - 1);
40159
- const endPage = Math.min(totalPages - 1, currentPage + 1);
40160
- if (startPage > 2) pages.push("...");
40161
- for (let i = startPage; i <= endPage; i++) {
40162
- pages.push(i);
40163
- }
40164
- if (endPage < totalPages - 1) pages.push("...");
40165
- if (totalPages > 1) pages.push(totalPages);
40166
- return pages;
40167
- };
40168
- const pageNumbers = getPageNumbers();
40157
+ const [pageInput, setPageInput] = useState(currentPage);
40158
+ useEffect(() => {
40159
+ setPageInput(currentPage);
40160
+ }, [currentPage]);
40169
40161
  const startIndex = Math.min((currentPage - 1) * itemsPerPage + 1, totalItems);
40170
40162
  const endIndex = Math.min(currentPage * itemsPerPage, totalItems);
40163
+ const handlePageInput = (e) => {
40164
+ e.preventDefault();
40165
+ let newPage = parseInt(pageInput, 10);
40166
+ if (isNaN(newPage) || newPage < 1) {
40167
+ newPage = 1;
40168
+ } else if (newPage > totalPages) {
40169
+ newPage = totalPages;
40170
+ }
40171
+ setPageInput(newPage);
40172
+ if (newPage !== currentPage) {
40173
+ onPageChange(newPage);
40174
+ }
40175
+ };
40171
40176
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "pagination-container", children: [
40172
40177
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "pagination-left", children: [
40173
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "pagination-select-container", children: [
40174
- /* @__PURE__ */ jsxRuntimeExports.jsx("label", { htmlFor: "items-per-page", className: "pagination-select-label", children: "Rows per page:" }),
40175
- /* @__PURE__ */ jsxRuntimeExports.jsx(
40176
- "select",
40177
- {
40178
- id: "items-per-page",
40179
- className: "pagination-select",
40180
- value: itemsPerPage,
40181
- onChange: (e) => onItemsPerPageChange(Number(e.target.value)),
40182
- "aria-label": "Items per page",
40183
- children: itemsPerPageOptions.map((option) => /* @__PURE__ */ jsxRuntimeExports.jsx("option", { value: option, children: option }, option))
40184
- }
40185
- )
40186
- ] }),
40178
+ /* @__PURE__ */ jsxRuntimeExports.jsx("label", { htmlFor: "items-per-page", className: "pagination-select-label", children: "Items per page:" }),
40179
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
40180
+ "select",
40181
+ {
40182
+ id: "items-per-page",
40183
+ className: "pagination-select",
40184
+ value: itemsPerPage,
40185
+ onChange: (e) => onItemsPerPageChange(Number(e.target.value)),
40186
+ children: itemsPerPageOptions.map((option) => /* @__PURE__ */ jsxRuntimeExports.jsx("option", { value: option, children: option }, option))
40187
+ }
40188
+ ),
40187
40189
  /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "pagination-info", children: [
40188
40190
  startIndex,
40189
40191
  "-",
40190
40192
  endIndex,
40191
40193
  " of ",
40192
- totalItems
40194
+ totalItems,
40195
+ " items"
40193
40196
  ] })
40194
40197
  ] }),
40195
40198
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "pagination-right", children: [
40196
40199
  /* @__PURE__ */ jsxRuntimeExports.jsx(
40197
40200
  "button",
40198
40201
  {
40199
- className: "pagination-button pagination-nav-button",
40202
+ className: "pagination-button",
40200
40203
  onClick: () => onPageChange(1),
40201
40204
  disabled: currentPage === 1,
40202
- "aria-label": "First page",
40203
- children: /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronsLeft, { size: 16 })
40205
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronFirst, { size: 16 })
40204
40206
  }
40205
40207
  ),
40206
40208
  /* @__PURE__ */ jsxRuntimeExports.jsx(
40207
40209
  "button",
40208
40210
  {
40209
- className: "pagination-button pagination-nav-button",
40211
+ className: "pagination-button",
40210
40212
  onClick: () => onPageChange(currentPage - 1),
40211
40213
  disabled: currentPage === 1,
40212
- "aria-label": "Previous page",
40213
40214
  children: /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronLeft, { size: 16 })
40214
40215
  }
40215
40216
  ),
40216
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "pagination-numbers", children: pageNumbers.map(
40217
- (page, index) => page === "..." ? /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "pagination-ellipsis", children: "..." }, `ellipsis-${index}`) : /* @__PURE__ */ jsxRuntimeExports.jsx(
40218
- "button",
40217
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("form", { onSubmit: handlePageInput, className: "page-input-form", children: [
40218
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "page-input-label", children: "Page" }),
40219
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
40220
+ "input",
40219
40221
  {
40220
- className: `pagination-number-button ${currentPage === page ? "active" : ""}`,
40221
- onClick: () => onPageChange(page),
40222
- "aria-current": currentPage === page ? "page" : void 0,
40223
- "aria-label": `Page ${page}`,
40224
- children: page
40225
- },
40226
- page
40227
- )
40228
- ) }),
40222
+ type: "number",
40223
+ className: "page-input",
40224
+ value: pageInput,
40225
+ onChange: (e) => setPageInput(e.target.value),
40226
+ onBlur: handlePageInput,
40227
+ "aria-label": `Current page, Page ${currentPage}`
40228
+ }
40229
+ ),
40230
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "page-input-total", children: [
40231
+ "of ",
40232
+ totalPages
40233
+ ] })
40234
+ ] }),
40229
40235
  /* @__PURE__ */ jsxRuntimeExports.jsx(
40230
40236
  "button",
40231
40237
  {
40232
- className: "pagination-button pagination-nav-button",
40238
+ className: "pagination-button",
40233
40239
  onClick: () => onPageChange(currentPage + 1),
40234
40240
  disabled: currentPage === totalPages,
40235
- "aria-label": "Next page",
40236
40241
  children: /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronRight, { size: 16 })
40237
40242
  }
40238
40243
  ),
40239
40244
  /* @__PURE__ */ jsxRuntimeExports.jsx(
40240
40245
  "button",
40241
40246
  {
40242
- className: "pagination-button pagination-nav-button",
40247
+ className: "pagination-button",
40243
40248
  onClick: () => onPageChange(totalPages),
40244
40249
  disabled: currentPage === totalPages,
40245
- "aria-label": "Last page",
40246
- children: /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronsRight, { size: 16 })
40250
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronLast, { size: 16 })
40247
40251
  }
40248
40252
  )
40249
40253
  ] })
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "unifyedx-storybook-new",
3
3
  "private": false,
4
- "version": "0.1.12",
4
+ "version": "0.1.13",
5
5
  "type": "module",
6
6
  "main": "dist/unifyedx-storybook-new.es.js",
7
7
  "module": "dist/unifyedx-storybook-new.es.js",