@bailaya/react 1.0.7 → 1.0.9

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/README.md CHANGED
@@ -7,7 +7,7 @@
7
7
  `@bailaya/react` builds on top of **@bailaya/core** to provide:
8
8
 
9
9
  - A **`BailayaProvider`** + **`useBailayaClient`** context
10
- - React Query–powered **hooks** for fetching all core data
10
+ - React **hooks** for fetching all core data (with `loading`, `error`, `data`, and `refetch`)
11
11
  - **Components** with sensible Tailwind defaults (and full styling slots)
12
12
  - Full TypeScript support, including localized text & date formatting
13
13
 
@@ -16,7 +16,7 @@ Whether you need a quick `<StudioProfileCard />` or fine-grained hooks like `use
16
16
  ## Features
17
17
 
18
18
  - **Context + client** (`BailayaProvider` + `useBailayaClient`)
19
- - **Hooks**
19
+ - **Hooks** (all return `{ data, error, loading, refetch }`)
20
20
  - `useStudioProfile(overrideId?)`
21
21
  - `useUserProfile(userId)`
22
22
  - `useInstructors(overrideId?)`
@@ -37,40 +37,34 @@ Whether you need a quick `<StudioProfileCard />` or fine-grained hooks like `use
37
37
  ## Installation
38
38
 
39
39
  ```bash
40
- npm install @bailaya/react @tanstack/react-query
40
+ npm install @bailaya/react
41
41
  ````
42
42
 
43
43
  or with Yarn:
44
44
 
45
45
  ```bash
46
- yarn add @bailaya/react @tanstack/react-query
46
+ yarn add @bailaya/react
47
47
  ```
48
48
 
49
49
  > **Peer Dependencies**
50
50
  >
51
51
  > * `"react": ">=17"`
52
52
  > * `"react-dom": ">=17"`
53
- > * `"@tanstack/react-query": ">=5"`
54
53
 
55
54
  ## Quick Start
56
55
 
57
- First, wrap your app with both **React Query** and **BailayaProvider**:
56
+ First, wrap your app with **BailayaProvider**:
58
57
 
59
58
  ```tsx
60
59
  // App.tsx
61
60
  import React from "react";
62
- import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
63
61
  import { BailayaProvider } from "@bailaya/react";
64
62
 
65
- const queryClient = new QueryClient();
66
-
67
63
  export default function App() {
68
64
  return (
69
- <QueryClientProvider client={queryClient}>
70
- <BailayaProvider config={{ studioId: "YOUR_STUDIO_ID" }}>
71
- {/* ...your app */}
72
- </BailayaProvider>
73
- </QueryClientProvider>
65
+ <BailayaProvider config={{ studioId: "YOUR_STUDIO_ID" }}>
66
+ {/* ...your app */}
67
+ </BailayaProvider>
74
68
  );
75
69
  }
76
70
  ```
@@ -84,17 +78,20 @@ import React from "react";
84
78
  import { useInstructors } from "@bailaya/react";
85
79
 
86
80
  export function TeamSection() {
87
- const { data: instructors, isLoading, error } = useInstructors();
81
+ const { data: instructors, loading, error, refetch } = useInstructors();
88
82
 
89
- if (isLoading) return <p>Loading...</p>;
83
+ if (loading) return <p>Loading...</p>;
90
84
  if (error) return <p>Error: {error.message}</p>;
91
85
 
92
86
  return (
93
- <ul>
94
- {instructors.map((i) => (
95
- <li key={i.id}>{i.name} {i.lastname}</li>
96
- ))}
97
- </ul>
87
+ <>
88
+ <button onClick={refetch}>Refresh</button>
89
+ <ul>
90
+ {instructors?.map((i) => (
91
+ <li key={i.id}>{i.name} {i.lastname}</li>
92
+ ))}
93
+ </ul>
94
+ </>
98
95
  );
99
96
  }
100
97
  ```
@@ -132,15 +129,24 @@ Provides `useBailayaClient()` context.
132
129
 
133
130
  ### Hooks
134
131
 
135
- | Hook | Description |
136
- |--------------------------------------------------| -------------------------------------------------------------------- |
137
- | `useStudioProfile(overrideId?)` | Fetch & parse a studio’s profile. |
138
- | `useUserProfile(userId)` | Fetch & parse a user’s profile / bio. |
139
- | `useInstructors(overrideId?)` | Fetch & parse list of active instructors (owner, admin, instructor). |
140
- | `useClasses(from?, overrideId?)` | Fetch & parse next 7 days of classes (all types). |
141
- | `useClassesByType(typeName, from?, overrideId?)` | Fetch & parse next 7 days of classes filtered by `typeName`. |
132
+ All hooks return:
133
+
134
+ ```ts
135
+ {
136
+ data: T | null;
137
+ error: Error | null;
138
+ loading: boolean;
139
+ refetch: () => Promise<void>;
140
+ }
141
+ ```
142
142
 
143
- Each returns a **`UseQueryResult<..., Error>`**.
143
+ | Hook | Description |
144
+ | ------------------------------------------------ | ------------------------------------------------------------ |
145
+ | `useStudioProfile(overrideId?)` | Fetch a studio’s profile. |
146
+ | `useUserProfile(userId)` | Fetch a user’s profile / bio. |
147
+ | `useInstructors(overrideId?)` | Fetch list of active instructors (owner, admin, instructor). |
148
+ | `useClasses(from?, overrideId?)` | Fetch next 7 days of classes (all types). |
149
+ | `useClassesByType(typeName, from?, overrideId?)` | Fetch next 7 days of classes filtered by `typeName`. |
144
150
 
145
151
  ### Components
146
152
 
@@ -152,7 +158,7 @@ All components share:
152
158
  * **`renderItem`** for full JSX override
153
159
 
154
160
  | Component | Props |
155
- |---------------------------|-----------------------------------------------------------------------------------------------------------------------------------|
161
+ | ------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
156
162
  | `<StudioProfileCard />` | `overrideId?`, `locale?`, `labels?`, `className?`, `nameClassName?`, `descriptionClassName?`, `labelClassName?`, `renderProfile?` |
157
163
  | `<UserProfileCard />` | `userId`, `locale?`, `labels?`, `className?`, `nameClassName?`, `bioClassName?`, `renderProfile?` |
158
164
  | `<InstructorList />` | `overrideId?`, `renderItem?`, plus styling slots: `className?`, `itemClassName?`, `imageWrapperClassName?`, etc. |
@@ -19,7 +19,7 @@ const LoadingIcon_1 = require("./ui/LoadingIcon");
19
19
  */
20
20
  const ClassSchedule = ({ from, overrideId, locale, labels = {}, className = 'mt-6 md:mt-12 space-y-4', itemClassName = 'p-4 bg-white rounded-lg shadow', nameClassName = 'font-semibold text-lg', detailsClassName = 'text-sm text-gray-600', instructorClassName = 'text-sm text-gray-800 mt-1', renderItem, }) => {
21
21
  var _a;
22
- const { data: classes, isLoading, error } = (0, useClasses_1.useClasses)(from, overrideId);
22
+ const { data: classes, loading: isLoading, error } = (0, useClasses_1.useClasses)(from, overrideId);
23
23
  const weekdayFmt = new Intl.DateTimeFormat(locale !== null && locale !== void 0 ? locale : 'en', { weekday: 'long' });
24
24
  const dateFmt = new Intl.DateTimeFormat(locale !== null && locale !== void 0 ? locale : 'en', { month: 'short', day: 'numeric' });
25
25
  const instructorLabel = (_a = labels === null || labels === void 0 ? void 0 : labels.instructor) !== null && _a !== void 0 ? _a : 'Instructor:';
@@ -18,7 +18,7 @@ const useClassesByType_1 = require("../hooks/useClassesByType");
18
18
  */
19
19
  const ClassScheduleByType = ({ typeName, from, overrideId, locale, labels = {}, className = 'mt-6 md:mt-12 space-y-4', itemClassName = 'p-4 bg-white rounded-lg shadow', nameClassName = 'font-semibold text-lg', detailsClassName = 'text-sm text-gray-600', instructorClassName = 'text-sm text-gray-800 mt-1', renderItem, }) => {
20
20
  var _a;
21
- const { data: classes, isLoading, error } = (0, useClassesByType_1.useClassesByType)(typeName, from, overrideId);
21
+ const { data: classes, loading: isLoading, error } = (0, useClassesByType_1.useClassesByType)(typeName, from, overrideId);
22
22
  const weekdayFmt = new Intl.DateTimeFormat(locale !== null && locale !== void 0 ? locale : 'en', { weekday: 'long' });
23
23
  const dateFmt = new Intl.DateTimeFormat(locale !== null && locale !== void 0 ? locale : 'en', { month: 'short', day: 'numeric' });
24
24
  const instructorLabel = (_a = labels === null || labels === void 0 ? void 0 : labels.instructor) !== null && _a !== void 0 ? _a : 'Instructor:';
@@ -16,7 +16,7 @@ const LoadingIcon_1 = require("./ui/LoadingIcon");
16
16
  * or completely replace the layout with `renderItem`.
17
17
  */
18
18
  const InstructorList = ({ overrideId, className = 'mt-6 md:mt-12 space-y-8', itemClassName = 'flex flex-col md:flex-row items-center rounded-lg border border-[#DCDCDC] shadow-lg overflow-hidden', imageWrapperClassName = 'w-full p-4 pb-0 md:pb-4 md:w-1/3 aspect-square', imageClassName = 'w-full h-full rounded-xl object-cover', bodyClassName = 'p-6 flex-1 text-left', nameClassName = 'text-xl md:text-3xl font-geologica font-semibold text-[#2A2343]', bioClassName = 'mt-2 text-xs md:text-xl font-sourcesans font-semibold text-[#464646]', renderItem, }) => {
19
- const { data: instructors, isLoading, error } = (0, useInstructors_1.useInstructors)(overrideId);
19
+ const { data: instructors, loading: isLoading, error } = (0, useInstructors_1.useInstructors)(overrideId);
20
20
  if (isLoading) {
21
21
  return react_1.default.createElement("div", { className: className },
22
22
  react_1.default.createElement(LoadingIcon_1.LoadingIcon, null));
@@ -5,7 +5,7 @@ export interface StudioDescriptionProps {
5
5
  overrideId?: string;
6
6
  /** Locale code (e.g., "en", "es") for picking the description */
7
7
  locale?: string;
8
- /** Wrapper element class (defaults to spacing-neutral container) */
8
+ /** Wrapper element class (defaults to small spacing container) */
9
9
  className?: string;
10
10
  /** Paragraph class for each line */
11
11
  paragraphClassName?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"StudioDescription.d.ts","sourceRoot":"","sources":["../../src/components/StudioDescription.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAGnD,MAAM,WAAW,sBAAsB;IACnC,+DAA+D;IAC/D,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,iEAAiE;IACjE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,oEAAoE;IACpE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oCAAoC;IACpC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B;;;OAGG;IACH,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,aAAa,KAAK,KAAK,CAAC,SAAS,CAAC;CACzE;AAED;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CAsC9D,CAAC"}
1
+ {"version":3,"file":"StudioDescription.d.ts","sourceRoot":"","sources":["../../src/components/StudioDescription.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAGnD,MAAM,WAAW,sBAAsB;IACnC,+DAA+D;IAC/D,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,iEAAiE;IACjE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,kEAAkE;IAClE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oCAAoC;IACpC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B;;;OAGG;IACH,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,aAAa,KAAK,KAAK,CAAC,SAAS,CAAC;CACzE;AAED;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CAsC9D,CAAC"}
@@ -15,8 +15,8 @@ const LoadingIcon_1 = require("./ui/LoadingIcon");
15
15
  * - Trims empty lines.
16
16
  * - Safe text rendering (no HTML injection).
17
17
  */
18
- const StudioDescription = ({ overrideId, locale, className = '', paragraphClassName = 'text-xs md:text-2xl font-geologica text-[#464646]', render, }) => {
19
- const { data: profile, isLoading, error } = (0, useStudioProfile_1.useStudioProfile)(overrideId);
18
+ const StudioDescription = ({ overrideId, locale, className = 'flex-1 space-y-6', paragraphClassName = 'text-xs md:text-2xl font-geologica text-[#464646]', render, }) => {
19
+ const { data: profile, loading: isLoading, error } = (0, useStudioProfile_1.useStudioProfile)(overrideId);
20
20
  if (isLoading)
21
21
  return react_1.default.createElement("div", { className: className },
22
22
  react_1.default.createElement(LoadingIcon_1.LoadingIcon, null));
@@ -18,7 +18,7 @@ const LoadingIcon_1 = require("./ui/LoadingIcon");
18
18
  */
19
19
  const StudioProfileCard = ({ overrideId, locale, className = 'mt-6 md:mt-12 space-y-8', itemClassName = 'flex flex-col md:flex-row items-center rounded-lg border border-[#DCDCDC] shadow-lg overflow-hidden', imageWrapperClassName = 'w-full p-4 pb-0 md:pb-4 md:w-1/3 aspect-square', imageClassName = 'w-full h-full rounded-xl object-cover', bodyClassName = 'p-6 flex-1 text-left', nameClassName = 'text-xl md:text-3xl font-geologica font-semibold text-[#2A2343]', descriptionClassName = 'mt-2 text-xs md:text-lg font-sourcesans text-[#464646]', labelClassName = 'mt-1 text-sm text-gray-600', renderProfile, labels = {}, }) => {
20
20
  var _a, _b;
21
- const { data: profile, isLoading, error } = (0, useStudioProfile_1.useStudioProfile)(overrideId);
21
+ const { data: profile, loading: isLoading, error } = (0, useStudioProfile_1.useStudioProfile)(overrideId);
22
22
  if (isLoading) {
23
23
  return react_1.default.createElement("div", { className: className },
24
24
  react_1.default.createElement(LoadingIcon_1.LoadingIcon, null));
@@ -18,7 +18,7 @@ const LoadingIcon_1 = require("./ui/LoadingIcon");
18
18
  */
19
19
  const UserProfileCard = ({ userId, locale, className = 'mt-6 md:mt-12 space-y-8', itemClassName = 'flex flex-col md:flex-row items-center rounded-lg border border-[#DCDCDC] shadow-lg overflow-hidden', imageWrapperClassName = 'w-full p-4 pb-0 md:pb-4 md:w-1/3 aspect-square', imageClassName = 'w-full h-full rounded-xl object-cover', bodyClassName = 'p-6 flex-1 text-left', nameClassName = 'text-xl md:text-3xl font-geologica font-semibold text-[#2A2343]', bioClassName = 'mt-2 text-xs md:text-xl font-sourcesans font-semibold text-[#464646]', labelClassName = 'mt-1 text-sm text-gray-600', renderProfile, labels = {}, }) => {
20
20
  var _a, _b;
21
- const { data: profile, isLoading, error } = (0, useUserProfile_1.useUserProfile)(userId);
21
+ const { data: profile, loading: isLoading, error } = (0, useUserProfile_1.useUserProfile)(userId);
22
22
  if (isLoading) {
23
23
  return react_1.default.createElement("div", { className: className },
24
24
  react_1.default.createElement(LoadingIcon_1.LoadingIcon, null));
@@ -1,15 +1,16 @@
1
- import { UseQueryResult } from '@tanstack/react-query';
2
1
  import type { StudioClass } from '@bailaya/core';
2
+ type UseClassesResult = {
3
+ data: StudioClass[] | null;
4
+ error: Error | null;
5
+ loading: boolean;
6
+ refetch: () => Promise<void>;
7
+ };
3
8
  /**
4
9
  * Hook to fetch upcoming classes for a studio within a 7-day window.
5
10
  *
6
- * Utilizes the Bailaya API client from context and caches results with React Query.
7
- *
8
- * @param from - Optional Date object to start the 7-day window; defaults to today.
11
+ * @param from - Optional Date to start the 7-day window; defaults to today.
9
12
  * @param overrideId - Optional studio ID to override the default configured ID.
10
- * @returns A React Query result with an array of `StudioClass` objects,
11
- * or an error if the fetch fails.
12
- * @throws If used outside of a `BailayaProvider`.
13
13
  */
14
- export declare function useClasses(from?: Date, overrideId?: string): UseQueryResult<StudioClass[], Error>;
14
+ export declare function useClasses(from?: Date, overrideId?: string): UseClassesResult;
15
+ export {};
15
16
  //# sourceMappingURL=useClasses.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useClasses.d.ts","sourceRoot":"","sources":["../../src/hooks/useClasses.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEjE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEjD;;;;;;;;;;GAUG;AACH,wBAAgB,UAAU,CACxB,IAAI,CAAC,EAAE,IAAI,EACX,UAAU,CAAC,EAAE,MAAM,GAClB,cAAc,CAAC,WAAW,EAAE,EAAE,KAAK,CAAC,CAUtC"}
1
+ {"version":3,"file":"useClasses.d.ts","sourceRoot":"","sources":["../../src/hooks/useClasses.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEjD,KAAK,gBAAgB,GAAG;IACtB,IAAI,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC;IAC3B,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IACpB,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC9B,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,gBAAgB,CA+C7E"}
@@ -1,25 +1,60 @@
1
1
  "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
2
11
  Object.defineProperty(exports, "__esModule", { value: true });
3
12
  exports.useClasses = useClasses;
4
- const react_query_1 = require("@tanstack/react-query");
13
+ const react_1 = require("react");
5
14
  const BailayaProvider_1 = require("../context/BailayaProvider");
6
15
  /**
7
16
  * Hook to fetch upcoming classes for a studio within a 7-day window.
8
17
  *
9
- * Utilizes the Bailaya API client from context and caches results with React Query.
10
- *
11
- * @param from - Optional Date object to start the 7-day window; defaults to today.
18
+ * @param from - Optional Date to start the 7-day window; defaults to today.
12
19
  * @param overrideId - Optional studio ID to override the default configured ID.
13
- * @returns A React Query result with an array of `StudioClass` objects,
14
- * or an error if the fetch fails.
15
- * @throws If used outside of a `BailayaProvider`.
16
20
  */
17
21
  function useClasses(from, overrideId) {
18
22
  const client = (0, BailayaProvider_1.useBailayaClient)();
19
- // Convert `from` to YYYY-MM-DD for the query key
20
- const fromKey = from ? from.toISOString().split('T')[0] : 'today';
21
- return (0, react_query_1.useQuery)({
22
- queryKey: ['classes', fromKey],
23
- queryFn: () => client.getClasses(from),
23
+ // Normalize `from` to a day key so the effect only re-runs when the day changes
24
+ const fromKey = (0, react_1.useMemo)(() => (from ? from.toISOString().split('T')[0] : 'today'), [from]);
25
+ const [data, setData] = (0, react_1.useState)(null);
26
+ const [error, setError] = (0, react_1.useState)(null);
27
+ const [loading, setLoading] = (0, react_1.useState)(false);
28
+ // Prevent race conditions when params change quickly
29
+ const seqRef = (0, react_1.useRef)(0);
30
+ const doFetch = () => __awaiter(this, void 0, void 0, function* () {
31
+ const seq = ++seqRef.current;
32
+ setLoading(true);
33
+ setError(null);
34
+ try {
35
+ const classes = yield client.getClasses(from, overrideId);
36
+ if (seq === seqRef.current) {
37
+ setData(classes);
38
+ }
39
+ }
40
+ catch (err) {
41
+ if (seq === seqRef.current) {
42
+ setError(err);
43
+ }
44
+ }
45
+ finally {
46
+ if (seq === seqRef.current) {
47
+ setLoading(false);
48
+ }
49
+ }
24
50
  });
51
+ (0, react_1.useEffect)(() => {
52
+ doFetch();
53
+ // cleanup just bumps the sequence so late resolves are ignored
54
+ return () => {
55
+ seqRef.current++;
56
+ };
57
+ // Depend on the normalized key + overrideId + client
58
+ }, [client, fromKey, overrideId]);
59
+ return { data, error, loading, refetch: doFetch };
25
60
  }
@@ -1,16 +1,17 @@
1
- import { UseQueryResult } from '@tanstack/react-query';
2
1
  import type { StudioClass } from '@bailaya/core';
2
+ type UseClassesByTypeResult = {
3
+ data: StudioClass[] | null;
4
+ error: Error | null;
5
+ loading: boolean;
6
+ refetch: () => Promise<void>;
7
+ };
3
8
  /**
4
9
  * Hook to fetch upcoming classes of a specific dance type for a studio within a 7-day window.
5
10
  *
6
- * Utilizes the Bailaya API client from context and caches results with React Query.
7
- *
8
- * @param typeName - Name of the dance type to filter by (e.g., "Salsa").
9
- * @param from - Optional start `Date` for the 7-day window; defaults to today.
11
+ * @param typeName - Name of the dance type (e.g., "Salsa").
12
+ * @param from - Optional start Date for the 7-day window; defaults to today.
10
13
  * @param overrideId - Optional studio ID to override the default configured ID.
11
- * @returns A React Query result with an array of `StudioClass` objects,
12
- * or an error if the fetch fails.
13
- * @throws If used outside of a `BailayaProvider` or if `typeName` is missing.
14
14
  */
15
- export declare function useClassesByType(typeName: string, from?: Date, overrideId?: string): UseQueryResult<StudioClass[], Error>;
15
+ export declare function useClassesByType(typeName: string, from?: Date, overrideId?: string): UseClassesByTypeResult;
16
+ export {};
16
17
  //# sourceMappingURL=useClassesByType.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useClassesByType.d.ts","sourceRoot":"","sources":["../../src/hooks/useClassesByType.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEjE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEjD;;;;;;;;;;;GAWG;AACH,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,MAAM,EAChB,IAAI,CAAC,EAAE,IAAI,EACX,UAAU,CAAC,EAAE,MAAM,GAClB,cAAc,CAAC,WAAW,EAAE,EAAE,KAAK,CAAC,CAatC"}
1
+ {"version":3,"file":"useClassesByType.d.ts","sourceRoot":"","sources":["../../src/hooks/useClassesByType.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEjD,KAAK,sBAAsB,GAAG;IAC5B,IAAI,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC;IAC3B,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IACpB,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC9B,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAC5B,QAAQ,EAAE,MAAM,EAChB,IAAI,CAAC,EAAE,IAAI,EACX,UAAU,CAAC,EAAE,MAAM,GACpB,sBAAsB,CA6CxB"}
@@ -1,28 +1,61 @@
1
1
  "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
2
11
  Object.defineProperty(exports, "__esModule", { value: true });
3
12
  exports.useClassesByType = useClassesByType;
4
- const react_query_1 = require("@tanstack/react-query");
13
+ const react_1 = require("react");
5
14
  const BailayaProvider_1 = require("../context/BailayaProvider");
6
15
  /**
7
16
  * Hook to fetch upcoming classes of a specific dance type for a studio within a 7-day window.
8
17
  *
9
- * Utilizes the Bailaya API client from context and caches results with React Query.
10
- *
11
- * @param typeName - Name of the dance type to filter by (e.g., "Salsa").
12
- * @param from - Optional start `Date` for the 7-day window; defaults to today.
18
+ * @param typeName - Name of the dance type (e.g., "Salsa").
19
+ * @param from - Optional start Date for the 7-day window; defaults to today.
13
20
  * @param overrideId - Optional studio ID to override the default configured ID.
14
- * @returns A React Query result with an array of `StudioClass` objects,
15
- * or an error if the fetch fails.
16
- * @throws If used outside of a `BailayaProvider` or if `typeName` is missing.
17
21
  */
18
22
  function useClassesByType(typeName, from, overrideId) {
19
- const client = (0, BailayaProvider_1.useBailayaClient)();
20
23
  if (!typeName) {
21
24
  throw new Error('useClassesByType requires a typeName argument');
22
25
  }
23
- const fromKey = from ? from.toISOString().split('T')[0] : 'today';
24
- return (0, react_query_1.useQuery)({
25
- queryKey: ['classesByType', typeName, overrideId !== null && overrideId !== void 0 ? overrideId : 'default', fromKey],
26
- queryFn: () => client.getClasses(from),
26
+ const client = (0, BailayaProvider_1.useBailayaClient)();
27
+ // Normalize keys so effect only re-runs when they *meaningfully* change.
28
+ const fromKey = (0, react_1.useMemo)(() => (from ? from.toISOString().split('T')[0] : 'today'), [from]);
29
+ const normType = (0, react_1.useMemo)(() => typeName.trim().toLowerCase(), [typeName]);
30
+ const [data, setData] = (0, react_1.useState)(null);
31
+ const [error, setError] = (0, react_1.useState)(null);
32
+ const [loading, setLoading] = (0, react_1.useState)(false);
33
+ // Prevent stale updates when inputs change quickly or on unmount.
34
+ const seqRef = (0, react_1.useRef)(0);
35
+ const doFetch = () => __awaiter(this, void 0, void 0, function* () {
36
+ const seq = ++seqRef.current;
37
+ setLoading(true);
38
+ setError(null);
39
+ try {
40
+ const classes = yield client.getClassesByType(normType, from, overrideId);
41
+ if (seq === seqRef.current)
42
+ setData(classes);
43
+ }
44
+ catch (err) {
45
+ if (seq === seqRef.current)
46
+ setError(err);
47
+ }
48
+ finally {
49
+ if (seq === seqRef.current)
50
+ setLoading(false);
51
+ }
27
52
  });
53
+ (0, react_1.useEffect)(() => {
54
+ doFetch();
55
+ return () => {
56
+ // invalidate any in-flight requests
57
+ seqRef.current++;
58
+ };
59
+ }, [client, fromKey, normType, overrideId]);
60
+ return { data, error, loading, refetch: doFetch };
28
61
  }
@@ -1,15 +1,15 @@
1
- import { UseQueryResult } from '@tanstack/react-query';
2
1
  import type { Instructor } from '@bailaya/core';
2
+ type UseInstructorsResult = {
3
+ data: Instructor[] | null;
4
+ error: Error | null;
5
+ loading: boolean;
6
+ refetch: () => Promise<void>;
7
+ };
3
8
  /**
4
9
  * Hook to fetch the list of instructors for a studio.
5
10
  *
6
- * Utilizes the Bailaya API client from context to retrieve instructor data
7
- * and caches results using React Query.
8
- *
9
11
  * @param overrideId - Optional studio ID to override the default configured ID.
10
- * @returns A React Query result containing an array of `Instructor` objects,
11
- * or an error if the fetch fails.
12
- * @throws If used outside of a `BailayaProvider`.
13
12
  */
14
- export declare function useInstructors(overrideId?: string): UseQueryResult<Instructor[], Error>;
13
+ export declare function useInstructors(overrideId?: string): UseInstructorsResult;
14
+ export {};
15
15
  //# sourceMappingURL=useInstructors.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useInstructors.d.ts","sourceRoot":"","sources":["../../src/hooks/useInstructors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEjE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAEhD;;;;;;;;;;GAUG;AACH,wBAAgB,cAAc,CAC5B,UAAU,CAAC,EAAE,MAAM,GAClB,cAAc,CAAC,UAAU,EAAE,EAAE,KAAK,CAAC,CAOrC"}
1
+ {"version":3,"file":"useInstructors.d.ts","sourceRoot":"","sources":["../../src/hooks/useInstructors.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAEhD,KAAK,oBAAoB,GAAG;IAC1B,IAAI,EAAE,UAAU,EAAE,GAAG,IAAI,CAAC;IAC1B,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IACpB,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC9B,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,oBAAoB,CAqCxE"}
@@ -1,23 +1,55 @@
1
1
  "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
2
11
  Object.defineProperty(exports, "__esModule", { value: true });
3
12
  exports.useInstructors = useInstructors;
4
- const react_query_1 = require("@tanstack/react-query");
13
+ const react_1 = require("react");
5
14
  const BailayaProvider_1 = require("../context/BailayaProvider");
6
15
  /**
7
16
  * Hook to fetch the list of instructors for a studio.
8
17
  *
9
- * Utilizes the Bailaya API client from context to retrieve instructor data
10
- * and caches results using React Query.
11
- *
12
18
  * @param overrideId - Optional studio ID to override the default configured ID.
13
- * @returns A React Query result containing an array of `Instructor` objects,
14
- * or an error if the fetch fails.
15
- * @throws If used outside of a `BailayaProvider`.
16
19
  */
17
20
  function useInstructors(overrideId) {
18
21
  const client = (0, BailayaProvider_1.useBailayaClient)();
19
- return (0, react_query_1.useQuery)({
20
- queryKey: ['instructors', overrideId !== null && overrideId !== void 0 ? overrideId : 'default'],
21
- queryFn: () => client.getInstructors(overrideId),
22
+ // Normalize to a stable key so effect only fires on meaningful changes
23
+ const idKey = (0, react_1.useMemo)(() => overrideId !== null && overrideId !== void 0 ? overrideId : 'default', [overrideId]);
24
+ const [data, setData] = (0, react_1.useState)(null);
25
+ const [error, setError] = (0, react_1.useState)(null);
26
+ const [loading, setLoading] = (0, react_1.useState)(false);
27
+ // Sequence guard to avoid race conditions on quick prop changes / unmount
28
+ const seqRef = (0, react_1.useRef)(0);
29
+ const doFetch = () => __awaiter(this, void 0, void 0, function* () {
30
+ const seq = ++seqRef.current;
31
+ setLoading(true);
32
+ setError(null);
33
+ try {
34
+ const instructors = yield client.getInstructors(overrideId);
35
+ if (seq === seqRef.current)
36
+ setData(instructors);
37
+ }
38
+ catch (err) {
39
+ if (seq === seqRef.current)
40
+ setError(err);
41
+ }
42
+ finally {
43
+ if (seq === seqRef.current)
44
+ setLoading(false);
45
+ }
22
46
  });
47
+ (0, react_1.useEffect)(() => {
48
+ doFetch();
49
+ return () => {
50
+ // invalidate any in-flight request
51
+ seqRef.current++;
52
+ };
53
+ }, [client, idKey]);
54
+ return { data, error, loading, refetch: doFetch };
23
55
  }
@@ -1,10 +1,15 @@
1
- import { UseQueryResult } from '@tanstack/react-query';
2
1
  import type { StudioProfile } from '@bailaya/core';
2
+ type UseStudioProfileResult = {
3
+ data: StudioProfile | null;
4
+ error: Error | null;
5
+ loading: boolean;
6
+ refetch: () => Promise<void>;
7
+ };
3
8
  /**
4
9
  * Hook to fetch the studio profile.
5
10
  *
6
11
  * @param overrideId - Optional studio ID to override the default configured ID.
7
- * @returns A React Query result with the `StudioProfile` object.
8
12
  */
9
- export declare function useStudioProfile(overrideId?: string): UseQueryResult<StudioProfile, Error>;
13
+ export declare function useStudioProfile(overrideId?: string): UseStudioProfileResult;
14
+ export {};
10
15
  //# sourceMappingURL=useStudioProfile.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useStudioProfile.d.ts","sourceRoot":"","sources":["../../src/hooks/useStudioProfile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEjE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAEnD;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAC9B,UAAU,CAAC,EAAE,MAAM,GAClB,cAAc,CAAC,aAAa,EAAE,KAAK,CAAC,CAOtC"}
1
+ {"version":3,"file":"useStudioProfile.d.ts","sourceRoot":"","sources":["../../src/hooks/useStudioProfile.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAEnD,KAAK,sBAAsB,GAAG;IAC5B,IAAI,EAAE,aAAa,GAAG,IAAI,CAAC;IAC3B,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IACpB,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC9B,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,sBAAsB,CAqC5E"}
@@ -1,18 +1,55 @@
1
1
  "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
2
11
  Object.defineProperty(exports, "__esModule", { value: true });
3
12
  exports.useStudioProfile = useStudioProfile;
4
- const react_query_1 = require("@tanstack/react-query");
13
+ const react_1 = require("react");
5
14
  const BailayaProvider_1 = require("../context/BailayaProvider");
6
15
  /**
7
16
  * Hook to fetch the studio profile.
8
17
  *
9
18
  * @param overrideId - Optional studio ID to override the default configured ID.
10
- * @returns A React Query result with the `StudioProfile` object.
11
19
  */
12
20
  function useStudioProfile(overrideId) {
13
21
  const client = (0, BailayaProvider_1.useBailayaClient)();
14
- return (0, react_query_1.useQuery)({
15
- queryKey: ['instructors', overrideId !== null && overrideId !== void 0 ? overrideId : 'default'],
16
- queryFn: () => client.getStudioProfile(overrideId),
22
+ // Stable dependency key so effect only fires on meaningful changes
23
+ const idKey = (0, react_1.useMemo)(() => overrideId !== null && overrideId !== void 0 ? overrideId : 'default', [overrideId]);
24
+ const [data, setData] = (0, react_1.useState)(null);
25
+ const [error, setError] = (0, react_1.useState)(null);
26
+ const [loading, setLoading] = (0, react_1.useState)(false);
27
+ // Prevent stale state updates if inputs change quickly or on unmount
28
+ const seqRef = (0, react_1.useRef)(0);
29
+ const doFetch = () => __awaiter(this, void 0, void 0, function* () {
30
+ const seq = ++seqRef.current;
31
+ setLoading(true);
32
+ setError(null);
33
+ try {
34
+ const profile = yield client.getStudioProfile(overrideId);
35
+ if (seq === seqRef.current)
36
+ setData(profile);
37
+ }
38
+ catch (err) {
39
+ if (seq === seqRef.current)
40
+ setError(err);
41
+ }
42
+ finally {
43
+ if (seq === seqRef.current)
44
+ setLoading(false);
45
+ }
17
46
  });
47
+ (0, react_1.useEffect)(() => {
48
+ doFetch();
49
+ return () => {
50
+ // invalidate any in-flight promise
51
+ seqRef.current++;
52
+ };
53
+ }, [client, idKey]);
54
+ return { data, error, loading, refetch: doFetch };
18
55
  }
@@ -1,12 +1,16 @@
1
- import { UseQueryResult } from '@tanstack/react-query';
2
1
  import type { UserProfile } from '@bailaya/core';
2
+ type UseUserProfileResult = {
3
+ data: UserProfile | null;
4
+ error: Error | null;
5
+ loading: boolean;
6
+ refetch: () => Promise<void>;
7
+ };
3
8
  /**
4
9
  * Hook to fetch a user’s profile by their ID.
5
10
  *
6
- * Wraps the BailayaClient.getUserProfile call in React Query.
7
- *
8
11
  * @param userId - The ID of the user to fetch.
9
- * @returns A React Query result containing a `UserProfile` or an error.
12
+ * @returns { data, error, loading, refetch }
10
13
  */
11
- export declare function useUserProfile(userId: string): UseQueryResult<UserProfile, Error>;
14
+ export declare function useUserProfile(userId: string): UseUserProfileResult;
15
+ export {};
12
16
  //# sourceMappingURL=useUserProfile.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useUserProfile.d.ts","sourceRoot":"","sources":["../../src/hooks/useUserProfile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEjE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEjD;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,MAAM,GACb,cAAc,CAAC,WAAW,EAAE,KAAK,CAAC,CAOpC"}
1
+ {"version":3,"file":"useUserProfile.d.ts","sourceRoot":"","sources":["../../src/hooks/useUserProfile.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEjD,KAAK,oBAAoB,GAAG;IAC1B,IAAI,EAAE,WAAW,GAAG,IAAI,CAAC;IACzB,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IACpB,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC9B,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,oBAAoB,CA6CnE"}
@@ -1,20 +1,62 @@
1
1
  "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
2
11
  Object.defineProperty(exports, "__esModule", { value: true });
3
12
  exports.useUserProfile = useUserProfile;
4
- const react_query_1 = require("@tanstack/react-query");
13
+ const react_1 = require("react");
5
14
  const BailayaProvider_1 = require("../context/BailayaProvider");
6
15
  /**
7
16
  * Hook to fetch a user’s profile by their ID.
8
17
  *
9
- * Wraps the BailayaClient.getUserProfile call in React Query.
10
- *
11
18
  * @param userId - The ID of the user to fetch.
12
- * @returns A React Query result containing a `UserProfile` or an error.
19
+ * @returns { data, error, loading, refetch }
13
20
  */
14
21
  function useUserProfile(userId) {
15
22
  const client = (0, BailayaProvider_1.useBailayaClient)();
16
- return (0, react_query_1.useQuery)({
17
- queryKey: ['userProfile', userId],
18
- queryFn: () => client.getUserProfile(userId),
23
+ // Stable key so the effect only re-runs on meaningful change
24
+ const idKey = (0, react_1.useMemo)(() => userId || 'missing', [userId]);
25
+ const [data, setData] = (0, react_1.useState)(null);
26
+ const [error, setError] = (0, react_1.useState)(null);
27
+ const [loading, setLoading] = (0, react_1.useState)(false);
28
+ // Prevent race conditions on quick param changes / unmount
29
+ const seqRef = (0, react_1.useRef)(0);
30
+ const doFetch = () => __awaiter(this, void 0, void 0, function* () {
31
+ const seq = ++seqRef.current;
32
+ if (!userId) {
33
+ setData(null);
34
+ setError(new Error('useUserProfile requires a userId'));
35
+ setLoading(false);
36
+ return;
37
+ }
38
+ setLoading(true);
39
+ setError(null);
40
+ try {
41
+ const profile = yield client.getUserProfile(userId);
42
+ if (seq === seqRef.current)
43
+ setData(profile);
44
+ }
45
+ catch (err) {
46
+ if (seq === seqRef.current)
47
+ setError(err);
48
+ }
49
+ finally {
50
+ if (seq === seqRef.current)
51
+ setLoading(false);
52
+ }
19
53
  });
54
+ (0, react_1.useEffect)(() => {
55
+ doFetch();
56
+ return () => {
57
+ // invalidate any in-flight request
58
+ seqRef.current++;
59
+ };
60
+ }, [client, idKey]);
61
+ return { data, error, loading, refetch: doFetch };
20
62
  }
package/dist/types.d.ts CHANGED
@@ -2,8 +2,4 @@
2
2
  * Core API data structures re-exported from @bailaya/core for convenience.
3
3
  */
4
4
  export type { RawStudioProfile, StudioProfile, RawStudioType, StudioType, RawUserProfile, UserProfile, RawInstructor, Instructor, RawStudioClass, StudioClass, } from '@bailaya/core';
5
- /**
6
- * React Query result types for library hooks.
7
- */
8
- export type { UseQueryResult, } from '@tanstack/react-query';
9
5
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,YAAY,EACV,gBAAgB,EAChB,aAAa,EACb,aAAa,EACb,UAAU,EACV,cAAc,EACd,WAAW,EACX,aAAa,EACb,UAAU,EACV,cAAc,EACd,WAAW,GACZ,MAAM,eAAe,CAAC;AAEvB;;GAEG;AACH,YAAY,EACV,cAAc,GACf,MAAM,uBAAuB,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,YAAY,EACV,gBAAgB,EAChB,aAAa,EACb,aAAa,EACb,UAAU,EACV,cAAc,EACd,WAAW,EACX,aAAa,EACb,UAAU,EACV,cAAc,EACd,WAAW,GACZ,MAAM,eAAe,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bailaya/react",
3
- "version": "1.0.7",
3
+ "version": "1.0.9",
4
4
  "description": "A React component library for the BailaYa public API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -13,11 +13,9 @@
13
13
  },
14
14
  "peerDependencies": {
15
15
  "react": ">=17.0.0 <20.0.0",
16
- "react-dom": ">=17.0.0 <20.0.0",
17
- "@tanstack/react-query": ">=5"
16
+ "react-dom": ">=17.0.0 <20.0.0"
18
17
  },
19
18
  "devDependencies": {
20
- "@tanstack/react-query": "^5.84.1",
21
19
  "@types/jest": "^30.0.0",
22
20
  "@types/react": "^18.0.0",
23
21
  "@types/react-dom": "^18.0.0",