@marigold/components 10.1.3 → 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);
@@ -4143,12 +4151,26 @@ _Tooltip.Trigger = _TooltipTrigger;
4143
4151
  var import_visually_hidden = require("@react-aria/visually-hidden");
4144
4152
 
4145
4153
  // src/XLoader/XLoader.tsx
4154
+ var import_react64 = require("react");
4146
4155
  var import_react_aria_components57 = require("react-aria-components");
4147
4156
  var import_system90 = require("@marigold/system");
4148
4157
 
4149
4158
  // src/XLoader/BaseLoader.tsx
4150
4159
  var import_react_aria_components56 = require("react-aria-components");
4160
+ var import_i18n6 = require("@react-aria/i18n");
4151
4161
  var import_system89 = require("@marigold/system");
4162
+
4163
+ // src/intl/messages.ts
4164
+ var intlMessages2 = {
4165
+ "de-DE": {
4166
+ loadingMessage: "Lade..."
4167
+ },
4168
+ "en-US": {
4169
+ loadingMessage: "Loading..."
4170
+ }
4171
+ };
4172
+
4173
+ // src/XLoader/BaseLoader.tsx
4152
4174
  var import_jsx_runtime108 = require("react/jsx-runtime");
4153
4175
  var BaseLoader = ({
4154
4176
  variant,
@@ -4157,13 +4179,14 @@ var BaseLoader = ({
4157
4179
  "aria-label": ariaLabel,
4158
4180
  ...props
4159
4181
  }) => {
4182
+ const stringFormatter = (0, import_i18n6.useLocalizedStringFormatter)(intlMessages2, "marigold");
4160
4183
  const className = (0, import_system89.useClassNames)({ component: "XLoader", variant, size });
4161
4184
  return /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)(
4162
4185
  import_react_aria_components56.ProgressBar,
4163
4186
  {
4164
4187
  className: className.container,
4165
4188
  isIndeterminate: true,
4166
- "aria-label": ariaLabel || children ? ariaLabel : "Loading...",
4189
+ "aria-label": ariaLabel || children ? ariaLabel : stringFormatter.format("loadingMessage"),
4167
4190
  ...props,
4168
4191
  children: [
4169
4192
  /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)(
@@ -4385,12 +4408,8 @@ var BaseLoader = ({
4385
4408
  // src/XLoader/XLoader.tsx
4386
4409
  var import_jsx_runtime109 = require("react/jsx-runtime");
4387
4410
  var LoaderFullSize = (props) => {
4388
- const className = (0, import_system90.useClassNames)({
4389
- component: "Underlay",
4390
- variant: "modal",
4391
- className: "fixed left-0 top-0 z-10 h-[--visual-viewport-height] w-screen"
4392
- });
4393
- return /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(import_react_aria_components57.ModalOverlay, { defaultOpen: true, className, isKeyboardDismissDisabled: true, children: /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(import_react_aria_components57.Modal, { className: "grid h-[--visual-viewport-height] cursor-progress place-items-center", children: /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(import_react_aria_components57.Dialog, { className: "outline-0", "aria-label": "Fullscreen Loader", children: /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(BaseLoader, { ...props }) }) }) });
4411
+ const id = (0, import_react64.useId)();
4412
+ return /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(Underlay, { defaultOpen: true, keyboardDismissable: true, variant: "modal", children: /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(import_react_aria_components57.Modal, { className: "grid h-[--visual-viewport-height] cursor-progress place-items-center", children: /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(import_react_aria_components57.Dialog, { className: "outline-0", "aria-labelledby": id, children: /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(BaseLoader, { id, ...props }) }) }) });
4394
4413
  };
4395
4414
  var LoaderInline = (props) => {
4396
4415
  const className = (0, import_system90.useClassNames)({
@@ -4407,9 +4426,9 @@ var import_react_aria_components61 = require("react-aria-components");
4407
4426
  var import_system93 = require("@marigold/system");
4408
4427
 
4409
4428
  // src/Tabs/Context.ts
4410
- var import_react64 = require("react");
4411
- var TabContext = (0, import_react64.createContext)({});
4412
- var useTabContext = () => (0, import_react64.useContext)(TabContext);
4429
+ var import_react65 = require("react");
4430
+ var TabContext = (0, import_react65.createContext)({});
4431
+ var useTabContext = () => (0, import_react65.useContext)(TabContext);
4413
4432
 
4414
4433
  // src/Tabs/Tab.tsx
4415
4434
  var import_react_aria_components58 = require("react-aria-components");
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,
@@ -4128,12 +4136,26 @@ _Tooltip.Trigger = _TooltipTrigger;
4128
4136
  import { VisuallyHidden } from "@react-aria/visually-hidden";
4129
4137
 
4130
4138
  // src/XLoader/XLoader.tsx
4131
- import { Dialog as Dialog2, Modal as Modal2, ModalOverlay as ModalOverlay2 } from "react-aria-components";
4139
+ import { useId as useId2 } from "react";
4140
+ import { Dialog as Dialog2, Modal as Modal2 } from "react-aria-components";
4132
4141
  import { useClassNames as useClassNames58 } from "@marigold/system";
4133
4142
 
4134
4143
  // src/XLoader/BaseLoader.tsx
4135
4144
  import { Label as Label2, ProgressBar as ProgressBar2 } from "react-aria-components";
4145
+ import { useLocalizedStringFormatter as useLocalizedStringFormatter2 } from "@react-aria/i18n";
4136
4146
  import { useClassNames as useClassNames57 } from "@marigold/system";
4147
+
4148
+ // src/intl/messages.ts
4149
+ var intlMessages2 = {
4150
+ "de-DE": {
4151
+ loadingMessage: "Lade..."
4152
+ },
4153
+ "en-US": {
4154
+ loadingMessage: "Loading..."
4155
+ }
4156
+ };
4157
+
4158
+ // src/XLoader/BaseLoader.tsx
4137
4159
  import { jsx as jsx107, jsxs as jsxs41 } from "react/jsx-runtime";
4138
4160
  var BaseLoader = ({
4139
4161
  variant,
@@ -4142,13 +4164,14 @@ var BaseLoader = ({
4142
4164
  "aria-label": ariaLabel,
4143
4165
  ...props
4144
4166
  }) => {
4167
+ const stringFormatter = useLocalizedStringFormatter2(intlMessages2, "marigold");
4145
4168
  const className = useClassNames57({ component: "XLoader", variant, size });
4146
4169
  return /* @__PURE__ */ jsxs41(
4147
4170
  ProgressBar2,
4148
4171
  {
4149
4172
  className: className.container,
4150
4173
  isIndeterminate: true,
4151
- "aria-label": ariaLabel || children ? ariaLabel : "Loading...",
4174
+ "aria-label": ariaLabel || children ? ariaLabel : stringFormatter.format("loadingMessage"),
4152
4175
  ...props,
4153
4176
  children: [
4154
4177
  /* @__PURE__ */ jsxs41(
@@ -4370,12 +4393,8 @@ var BaseLoader = ({
4370
4393
  // src/XLoader/XLoader.tsx
4371
4394
  import { jsx as jsx108 } from "react/jsx-runtime";
4372
4395
  var LoaderFullSize = (props) => {
4373
- const className = useClassNames58({
4374
- component: "Underlay",
4375
- variant: "modal",
4376
- className: "fixed left-0 top-0 z-10 h-[--visual-viewport-height] w-screen"
4377
- });
4378
- return /* @__PURE__ */ jsx108(ModalOverlay2, { defaultOpen: true, className, isKeyboardDismissDisabled: true, children: /* @__PURE__ */ jsx108(Modal2, { className: "grid h-[--visual-viewport-height] cursor-progress place-items-center", children: /* @__PURE__ */ jsx108(Dialog2, { className: "outline-0", "aria-label": "Fullscreen Loader", children: /* @__PURE__ */ jsx108(BaseLoader, { ...props }) }) }) });
4396
+ const id = useId2();
4397
+ return /* @__PURE__ */ jsx108(Underlay, { defaultOpen: true, keyboardDismissable: true, variant: "modal", children: /* @__PURE__ */ jsx108(Modal2, { className: "grid h-[--visual-viewport-height] cursor-progress place-items-center", children: /* @__PURE__ */ jsx108(Dialog2, { className: "outline-0", "aria-labelledby": id, children: /* @__PURE__ */ jsx108(BaseLoader, { id, ...props }) }) }) });
4379
4398
  };
4380
4399
  var LoaderInline = (props) => {
4381
4400
  const className = useClassNames58({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@marigold/components",
3
- "version": "10.1.3",
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.1.3",
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.62",
58
+ "@marigold/icons": "1.2.64",
59
59
  "@marigold/tsconfig": "0.4.0"
60
60
  },
61
61
  "scripts": {