@marigold/components 10.2.0 → 10.2.1

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.js CHANGED
@@ -1290,7 +1290,7 @@ var _CheckboxGroup = ({
1290
1290
 
1291
1291
  // src/Checkbox/Checkbox.tsx
1292
1292
  var import_jsx_runtime34 = require("react/jsx-runtime");
1293
- var CheckMark = () => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("svg", { viewBox: "0 0 12 10", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
1293
+ var CheckMark = () => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("svg", { width: "12px", height: "10px", viewBox: "0 0 12 10", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
1294
1294
  "path",
1295
1295
  {
1296
1296
  fill: "currentColor",
@@ -1298,7 +1298,7 @@ var CheckMark = () => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("svg", { vie
1298
1298
  d: "M11.915 1.548 10.367 0 4.045 6.315 1.557 3.827 0 5.373l4.045 4.046 7.87-7.871Z"
1299
1299
  }
1300
1300
  ) });
1301
- var IndeterminateMark = () => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("svg", { width: "12", height: "3", viewBox: "0 0 12 3", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
1301
+ var IndeterminateMark = () => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("svg", { width: "12px", height: "3px", viewBox: "0 0 12 3", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
1302
1302
  "path",
1303
1303
  {
1304
1304
  fill: "currentColor",
@@ -3039,6 +3039,14 @@ var _Pagination = ({
3039
3039
  }) => {
3040
3040
  const [currentPage, setCurrentPage] = (0, import_react44.useState)(page != null ? page : defaultPage);
3041
3041
  const totalPages = Math.ceil(totalItems / pageSize);
3042
+ const isFirstRender = (0, import_react44.useRef)(true);
3043
+ (0, import_react44.useEffect)(() => {
3044
+ if (isFirstRender.current) {
3045
+ isFirstRender.current = false;
3046
+ return;
3047
+ }
3048
+ handlePageChange(1);
3049
+ }, [pageSize]);
3042
3050
  const handlePageChange = (newPage) => {
3043
3051
  setCurrentPage(newPage);
3044
3052
  onChange(newPage);
package/dist/index.mjs CHANGED
@@ -1198,7 +1198,7 @@ var _CheckboxGroup = ({
1198
1198
 
1199
1199
  // src/Checkbox/Checkbox.tsx
1200
1200
  import { Fragment as Fragment3, jsx as jsx34, jsxs as jsxs14 } from "react/jsx-runtime";
1201
- var CheckMark = () => /* @__PURE__ */ jsx34("svg", { viewBox: "0 0 12 10", children: /* @__PURE__ */ jsx34(
1201
+ var CheckMark = () => /* @__PURE__ */ jsx34("svg", { width: "12px", height: "10px", viewBox: "0 0 12 10", children: /* @__PURE__ */ jsx34(
1202
1202
  "path",
1203
1203
  {
1204
1204
  fill: "currentColor",
@@ -1206,7 +1206,7 @@ var CheckMark = () => /* @__PURE__ */ jsx34("svg", { viewBox: "0 0 12 10", child
1206
1206
  d: "M11.915 1.548 10.367 0 4.045 6.315 1.557 3.827 0 5.373l4.045 4.046 7.87-7.871Z"
1207
1207
  }
1208
1208
  ) });
1209
- var IndeterminateMark = () => /* @__PURE__ */ jsx34("svg", { width: "12", height: "3", viewBox: "0 0 12 3", children: /* @__PURE__ */ jsx34(
1209
+ var IndeterminateMark = () => /* @__PURE__ */ jsx34("svg", { width: "12px", height: "3px", viewBox: "0 0 12 3", children: /* @__PURE__ */ jsx34(
1210
1210
  "path",
1211
1211
  {
1212
1212
  fill: "currentColor",
@@ -2726,7 +2726,7 @@ var _NumberField = forwardRef19(
2726
2726
  );
2727
2727
 
2728
2728
  // src/Pagination/Pagination.tsx
2729
- import { useEffect as useEffect5, useState as useState5 } from "react";
2729
+ import { useEffect as useEffect5, useRef as useRef7, useState as useState5 } from "react";
2730
2730
 
2731
2731
  // src/Pagination/Ellipsis.tsx
2732
2732
  import { jsx as jsx78 } from "react/jsx-runtime";
@@ -2978,6 +2978,14 @@ var _Pagination = ({
2978
2978
  }) => {
2979
2979
  const [currentPage, setCurrentPage] = useState5(page != null ? page : defaultPage);
2980
2980
  const totalPages = Math.ceil(totalItems / pageSize);
2981
+ const isFirstRender = useRef7(true);
2982
+ useEffect5(() => {
2983
+ if (isFirstRender.current) {
2984
+ isFirstRender.current = false;
2985
+ return;
2986
+ }
2987
+ handlePageChange(1);
2988
+ }, [pageSize]);
2981
2989
  const handlePageChange = (newPage) => {
2982
2990
  setCurrentPage(newPage);
2983
2991
  onChange(newPage);
@@ -3531,7 +3539,7 @@ var _Switch = forwardRef26(
3531
3539
  );
3532
3540
 
3533
3541
  // src/Table/Table.tsx
3534
- import { useRef as useRef13 } from "react";
3542
+ import { useRef as useRef14 } from "react";
3535
3543
  import { useTable } from "@react-aria/table";
3536
3544
  import {
3537
3545
  TableBody as Body2,
@@ -3569,14 +3577,14 @@ var TableBody = ({ children, emptyState }) => {
3569
3577
  };
3570
3578
 
3571
3579
  // src/Table/TableCell.tsx
3572
- import { useRef as useRef7 } from "react";
3580
+ import { useRef as useRef8 } from "react";
3573
3581
  import { useFocusRing as useFocusRing2 } from "@react-aria/focus";
3574
3582
  import { useTableCell } from "@react-aria/table";
3575
3583
  import { mergeProps as mergeProps3 } from "@react-aria/utils";
3576
3584
  import { cn as cn53, useStateProps as useStateProps2 } from "@marigold/system";
3577
3585
  import { jsx as jsx93 } from "react/jsx-runtime";
3578
3586
  var TableCell = ({ cell, align = "left" }) => {
3579
- const ref = useRef7(null);
3587
+ const ref = useRef8(null);
3580
3588
  const { interactive, state, classNames: classNames2 } = useTableContext();
3581
3589
  const disabled = state.disabledKeys.has(cell.parentKey);
3582
3590
  const { gridCellProps } = useTableCell(
@@ -3611,7 +3619,7 @@ var TableCell = ({ cell, align = "left" }) => {
3611
3619
  };
3612
3620
 
3613
3621
  // src/Table/TableCheckboxCell.tsx
3614
- import { useRef as useRef8 } from "react";
3622
+ import { useRef as useRef9 } from "react";
3615
3623
  import { useFocusRing as useFocusRing3 } from "@react-aria/focus";
3616
3624
  import { useTableCell as useTableCell2, useTableSelectionCheckbox } from "@react-aria/table";
3617
3625
  import { mergeProps as mergeProps4 } from "@react-aria/utils";
@@ -3640,7 +3648,7 @@ var mapCheckboxProps = ({
3640
3648
  // src/Table/TableCheckboxCell.tsx
3641
3649
  import { jsx as jsx94 } from "react/jsx-runtime";
3642
3650
  var TableCheckboxCell = ({ cell }) => {
3643
- const ref = useRef8(null);
3651
+ const ref = useRef9(null);
3644
3652
  const { state, classNames: classNames2 } = useTableContext();
3645
3653
  const disabled = state.disabledKeys.has(cell.parentKey);
3646
3654
  const { gridCellProps } = useTableCell2(
@@ -3668,7 +3676,7 @@ var TableCheckboxCell = ({ cell }) => {
3668
3676
  };
3669
3677
 
3670
3678
  // src/Table/TableColumnHeader.tsx
3671
- import { useRef as useRef9 } from "react";
3679
+ import { useRef as useRef10 } from "react";
3672
3680
  import { useFocusRing as useFocusRing4 } from "@react-aria/focus";
3673
3681
  import { useHover } from "@react-aria/interactions";
3674
3682
  import { useTableColumnHeader } from "@react-aria/table";
@@ -3681,7 +3689,7 @@ var TableColumnHeader = ({
3681
3689
  align = "left"
3682
3690
  }) => {
3683
3691
  var _a, _b;
3684
- const ref = useRef9(null);
3692
+ const ref = useRef10(null);
3685
3693
  const { state, classNames: classNames2 } = useTableContext();
3686
3694
  const { columnHeaderProps } = useTableColumnHeader(
3687
3695
  {
@@ -3729,18 +3737,18 @@ var TableHeader = ({ stickyHeader, children }) => {
3729
3737
  };
3730
3738
 
3731
3739
  // src/Table/TableHeaderRow.tsx
3732
- import { useRef as useRef10 } from "react";
3740
+ import { useRef as useRef11 } from "react";
3733
3741
  import { useTableHeaderRow } from "@react-aria/table";
3734
3742
  import { jsx as jsx97 } from "react/jsx-runtime";
3735
3743
  var TableHeaderRow = ({ item, children }) => {
3736
3744
  const { state } = useTableContext();
3737
- const ref = useRef10(null);
3745
+ const ref = useRef11(null);
3738
3746
  const { rowProps } = useTableHeaderRow({ node: item }, state, ref);
3739
3747
  return /* @__PURE__ */ jsx97("tr", { ...rowProps, ref, children });
3740
3748
  };
3741
3749
 
3742
3750
  // src/Table/TableRow.tsx
3743
- import { useRef as useRef11 } from "react";
3751
+ import { useRef as useRef12 } from "react";
3744
3752
  import { useFocusRing as useFocusRing5 } from "@react-aria/focus";
3745
3753
  import { useHover as useHover2 } from "@react-aria/interactions";
3746
3754
  import { useTableRow } from "@react-aria/table";
@@ -3748,7 +3756,7 @@ import { mergeProps as mergeProps6 } from "@react-aria/utils";
3748
3756
  import { cn as cn56, useClassNames as useClassNames52, useStateProps as useStateProps5 } from "@marigold/system";
3749
3757
  import { jsx as jsx98 } from "react/jsx-runtime";
3750
3758
  var TableRow = ({ children, row }) => {
3751
- const ref = useRef11(null);
3759
+ const ref = useRef12(null);
3752
3760
  const { interactive, state, ...ctx } = useTableContext();
3753
3761
  const { variant, size } = row.props;
3754
3762
  const classNames2 = useClassNames52({
@@ -3794,7 +3802,7 @@ var TableRow = ({ children, row }) => {
3794
3802
  };
3795
3803
 
3796
3804
  // src/Table/TableSelectAllCell.tsx
3797
- import { useRef as useRef12 } from "react";
3805
+ import { useRef as useRef13 } from "react";
3798
3806
  import { useFocusRing as useFocusRing6 } from "@react-aria/focus";
3799
3807
  import { useHover as useHover3 } from "@react-aria/interactions";
3800
3808
  import {
@@ -3813,7 +3821,7 @@ var TableSelectAllCell = ({
3813
3821
  width = "auto",
3814
3822
  align = "left"
3815
3823
  }) => {
3816
- const ref = useRef12(null);
3824
+ const ref = useRef13(null);
3817
3825
  const { state, classNames: classNames2 } = useTableContext();
3818
3826
  const { columnHeaderProps } = useTableColumnHeader2(
3819
3827
  {
@@ -3855,7 +3863,7 @@ var Table = ({
3855
3863
  ...props
3856
3864
  }) => {
3857
3865
  const interactive = selectionMode !== "none";
3858
- const tableRef = useRef13(null);
3866
+ const tableRef = useRef14(null);
3859
3867
  const state = useTableState({
3860
3868
  ...props,
3861
3869
  selectionMode,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@marigold/components",
3
- "version": "10.2.0",
3
+ "version": "10.2.1",
4
4
  "description": "Components for the Marigold Design System",
5
5
  "license": "MIT",
6
6
  "keywords": [
@@ -43,7 +43,7 @@
43
43
  "@react-types/shared": "3.27.0",
44
44
  "@react-types/table": "3.10.4",
45
45
  "react-aria-components": "1.6.0",
46
- "@marigold/system": "10.2.0",
46
+ "@marigold/system": "10.2.1",
47
47
  "@marigold/types": "1.2.1"
48
48
  },
49
49
  "peerDependencies": {
@@ -55,7 +55,7 @@
55
55
  "react": "19.0.0",
56
56
  "react-dom": "19.0.0",
57
57
  "tsup": "8.3.5",
58
- "@marigold/icons": "1.2.63",
58
+ "@marigold/icons": "1.2.64",
59
59
  "@marigold/tsconfig": "0.4.0"
60
60
  },
61
61
  "scripts": {