@ark-ui/react 2.2.2 → 2.2.3

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/CHANGELOG.md CHANGED
@@ -6,6 +6,13 @@ description: All notable changes to this project will be documented in this file
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [2.2.3] - 2024-03-05
10
+
11
+ ### Fixed
12
+
13
+ - Resolved an issue with using `Locale` in Next.js projects.
14
+ - Resolved an issue with `Toast` not updating its toasts and count properties when creating one or more toasts.
15
+
9
16
  ## [2.2.2] - 2024-02-27
10
17
 
11
18
  ### Fixed
package/locale/locale.cjs CHANGED
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  'use strict';
2
3
 
3
4
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
package/locale/locale.mjs CHANGED
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  import { jsx } from 'react/jsx-runtime';
2
3
  import { trackLocale, isRTL } from '@zag-js/i18n-utils';
3
4
  import { useState, useEffect } from 'react';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ark-ui/react",
3
- "version": "2.2.2",
3
+ "version": "2.2.3",
4
4
  "description": "A collection of unstyled, accessible UI components for React, utilizing state machines for seamless interaction.",
5
5
  "keywords": [
6
6
  "accordion",
@@ -117,11 +117,11 @@
117
117
  "@testing-library/react": "14.2.1",
118
118
  "@testing-library/user-event": "14.5.2",
119
119
  "@types/jsdom": "21.1.6",
120
- "@types/react": "18.2.58",
120
+ "@types/react": "18.2.61",
121
121
  "@types/react-dom": "18.2.19",
122
122
  "@types/testing-library__jest-dom": "5.14.9",
123
- "@typescript-eslint/eslint-plugin": "7.0.2",
124
- "@typescript-eslint/parser": "7.0.2",
123
+ "@typescript-eslint/eslint-plugin": "7.1.0",
124
+ "@typescript-eslint/parser": "7.1.0",
125
125
  "@vitejs/plugin-react": "4.2.1",
126
126
  "@vitest/coverage-v8": "1.3.1",
127
127
  "eslint": "8.57.0",
@@ -134,7 +134,7 @@
134
134
  "react": "18.2.0",
135
135
  "react-dom": "18.2.0",
136
136
  "react-frame-component": "5.2.6",
137
- "react-hook-form": "7.50.1",
137
+ "react-hook-form": "7.51.0",
138
138
  "release-it": "17.1.1",
139
139
  "resize-observer-polyfill": "1.5.1",
140
140
  "storybook": "7.6.17",
@@ -34,6 +34,9 @@ const createToaster = (props) => {
34
34
  const { placement, ...rest } = props;
35
35
  const service = toast__namespace.group.machine({ id: "1", placement, ...rest }).start();
36
36
  let api = toast__namespace.group.connect(service.getState(), service.send, react.normalizeProps);
37
+ const subscribe = (fn) => {
38
+ return service.subscribe((state) => fn(state.context.toasts));
39
+ };
37
40
  const Toaster = react$1.forwardRef((props2, ref) => {
38
41
  const getRootNode = environmentContext.useEnvironmentContext();
39
42
  const [state, send] = react.useActor(service);
@@ -47,7 +50,7 @@ const createToaster = (props) => {
47
50
  return /* @__PURE__ */ jsxRuntime.jsx(toastGroup.ToastGroup, { ...mergedProps, ref, children: toasts.map((toast2) => /* @__PURE__ */ jsxRuntime.jsx(ToastProviderFactory, { service: toast2 }, toast2.id)) });
48
51
  });
49
52
  Toaster.displayName = "ToastGroup";
50
- return [Toaster, api];
53
+ return [Toaster, Object.assign(api, { subscribe })];
51
54
  };
52
55
  const ToastProviderFactory = (props) => {
53
56
  const [state, send] = react.useActor(props.service);
@@ -11,6 +11,9 @@ const createToaster = (props) => {
11
11
  const { placement, ...rest } = props;
12
12
  const service = toast.group.machine({ id: "1", placement, ...rest }).start();
13
13
  let api = toast.group.connect(service.getState(), service.send, normalizeProps);
14
+ const subscribe = (fn) => {
15
+ return service.subscribe((state) => fn(state.context.toasts));
16
+ };
14
17
  const Toaster = forwardRef((props2, ref) => {
15
18
  const getRootNode = useEnvironmentContext();
16
19
  const [state, send] = useActor(service);
@@ -24,7 +27,7 @@ const createToaster = (props) => {
24
27
  return /* @__PURE__ */ jsx(ToastGroup, { ...mergedProps, ref, children: toasts.map((toast2) => /* @__PURE__ */ jsx(ToastProviderFactory, { service: toast2 }, toast2.id)) });
25
28
  });
26
29
  Toaster.displayName = "ToastGroup";
27
- return [Toaster, api];
30
+ return [Toaster, Object.assign(api, { subscribe })];
28
31
  };
29
32
  const ToastProviderFactory = (props) => {
30
33
  const [state, send] = useActor(props.service);