@availity/mui-favorites 0.3.2 → 1.0.0-alpha.0
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 +14 -0
- package/dist/index.js +12 -21
- package/dist/index.mjs +9 -18
- package/package.json +11 -11
- /package/{introduction.stories.mdx → introduction.mdx} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
|
4
4
|
|
|
5
|
+
## [1.0.0-alpha.0](https://github.com/Availity/element/compare/@availity/mui-favorites@0.3.2...@availity/mui-favorites@1.0.0-alpha.0) (2025-02-24)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### ⚠ BREAKING CHANGES
|
|
9
|
+
|
|
10
|
+
* upgraded to @mui/material v6
|
|
11
|
+
* **element:** upgraded to @mui/material v6
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
* **element:** upgrade to @mui/material v6 ([cb958bb](https://github.com/Availity/element/commit/cb958bba99a4f1ee6dab323f0ff54b69e6fd3493))
|
|
16
|
+
* upgrade @mui/material ([571453a](https://github.com/Availity/element/commit/571453a34b21c344594ab4c03bc497d19aba942b))
|
|
17
|
+
* upgrade to MUI v6 ([7febd6f](https://github.com/Availity/element/commit/7febd6fd4fd58e87e1c97a832cea3b4595a35d58))
|
|
18
|
+
|
|
5
19
|
## [0.3.2](https://github.com/Availity/element/compare/@availity/mui-favorites@0.3.1...@availity/mui-favorites@0.3.2) (2025-02-19)
|
|
6
20
|
|
|
7
21
|
### Dependency Updates
|
package/dist/index.js
CHANGED
|
@@ -74,13 +74,13 @@ var __async = (__this, __arguments, generator) => {
|
|
|
74
74
|
};
|
|
75
75
|
|
|
76
76
|
// src/index.ts
|
|
77
|
-
var
|
|
78
|
-
__export(
|
|
77
|
+
var index_exports = {};
|
|
78
|
+
__export(index_exports, {
|
|
79
79
|
FavoriteHeart: () => FavoriteHeart,
|
|
80
80
|
FavoritesProvider: () => FavoritesProvider,
|
|
81
81
|
useFavorites: () => useFavorites
|
|
82
82
|
});
|
|
83
|
-
module.exports = __toCommonJS(
|
|
83
|
+
module.exports = __toCommonJS(index_exports);
|
|
84
84
|
|
|
85
85
|
// src/lib/Favorites.tsx
|
|
86
86
|
var import_react = require("react");
|
|
@@ -191,8 +191,7 @@ var FavoritesProvider = ({
|
|
|
191
191
|
}
|
|
192
192
|
});
|
|
193
193
|
const addFavorite = (id) => __async(void 0, null, function* () {
|
|
194
|
-
if (!favorites)
|
|
195
|
-
return false;
|
|
194
|
+
if (!favorites) return false;
|
|
196
195
|
if (favorites.length >= MAX_FAVORITES) {
|
|
197
196
|
openMaxModal();
|
|
198
197
|
return false;
|
|
@@ -244,16 +243,11 @@ var useFavorites = (id) => {
|
|
|
244
243
|
const toggleFavorite = () => isFavorited ? deleteFavorite(id) : addFavorite(id);
|
|
245
244
|
const isDisabled = queryStatus === "loading" || queryStatus === "idle" || mutationStatus === "loading";
|
|
246
245
|
let status = "initLoading";
|
|
247
|
-
if (queryStatus === "loading")
|
|
248
|
-
|
|
249
|
-
if (
|
|
250
|
-
|
|
251
|
-
if (mutationStatus === "
|
|
252
|
-
status = "reloading";
|
|
253
|
-
if (queryStatus === "error" || mutationStatus === "error")
|
|
254
|
-
status = "error";
|
|
255
|
-
if (queryStatus === "success" && (mutationStatus === "success" || mutationStatus === "idle"))
|
|
256
|
-
status = "success";
|
|
246
|
+
if (queryStatus === "loading") status = "initLoading";
|
|
247
|
+
if (queryStatus === "reloading") status = "reloading";
|
|
248
|
+
if (mutationStatus === "loading") status = "reloading";
|
|
249
|
+
if (queryStatus === "error" || mutationStatus === "error") status = "error";
|
|
250
|
+
if (queryStatus === "success" && (mutationStatus === "success" || mutationStatus === "idle")) status = "success";
|
|
257
251
|
return {
|
|
258
252
|
isFavorited,
|
|
259
253
|
status,
|
|
@@ -342,18 +336,15 @@ var FavoriteHeart = ({
|
|
|
342
336
|
}
|
|
343
337
|
};
|
|
344
338
|
const iconKey = (() => {
|
|
345
|
-
if (status === "initLoading")
|
|
346
|
-
return "unknownDisabledHeart";
|
|
339
|
+
if (status === "initLoading") return "unknownDisabledHeart";
|
|
347
340
|
if (status === "reloading") {
|
|
348
|
-
if (isLastClickedFavorite)
|
|
349
|
-
return "spinner";
|
|
341
|
+
if (isLastClickedFavorite) return "spinner";
|
|
350
342
|
return isFavorited ? "favoritedDisabledHeart" : "unfavoritedDisabledHeart";
|
|
351
343
|
}
|
|
352
344
|
if (disabled) {
|
|
353
345
|
return isFavorited ? "favoritedDisabledHeart" : "unfavoritedDisabledHeart";
|
|
354
346
|
}
|
|
355
|
-
if (isFavorited)
|
|
356
|
-
return "favoritedHeart";
|
|
347
|
+
if (isFavorited) return "favoritedHeart";
|
|
357
348
|
return "unfavoritedHeart";
|
|
358
349
|
})();
|
|
359
350
|
const cursor = disabled || !isLastClickedFavorite && (status === "initLoading" || status === "reloading") ? "not-allowed" : void 0;
|
package/dist/index.mjs
CHANGED
|
@@ -156,8 +156,7 @@ var FavoritesProvider = ({
|
|
|
156
156
|
}
|
|
157
157
|
});
|
|
158
158
|
const addFavorite = (id) => __async(void 0, null, function* () {
|
|
159
|
-
if (!favorites)
|
|
160
|
-
return false;
|
|
159
|
+
if (!favorites) return false;
|
|
161
160
|
if (favorites.length >= MAX_FAVORITES) {
|
|
162
161
|
openMaxModal();
|
|
163
162
|
return false;
|
|
@@ -209,16 +208,11 @@ var useFavorites = (id) => {
|
|
|
209
208
|
const toggleFavorite = () => isFavorited ? deleteFavorite(id) : addFavorite(id);
|
|
210
209
|
const isDisabled = queryStatus === "loading" || queryStatus === "idle" || mutationStatus === "loading";
|
|
211
210
|
let status = "initLoading";
|
|
212
|
-
if (queryStatus === "loading")
|
|
213
|
-
|
|
214
|
-
if (
|
|
215
|
-
|
|
216
|
-
if (mutationStatus === "
|
|
217
|
-
status = "reloading";
|
|
218
|
-
if (queryStatus === "error" || mutationStatus === "error")
|
|
219
|
-
status = "error";
|
|
220
|
-
if (queryStatus === "success" && (mutationStatus === "success" || mutationStatus === "idle"))
|
|
221
|
-
status = "success";
|
|
211
|
+
if (queryStatus === "loading") status = "initLoading";
|
|
212
|
+
if (queryStatus === "reloading") status = "reloading";
|
|
213
|
+
if (mutationStatus === "loading") status = "reloading";
|
|
214
|
+
if (queryStatus === "error" || mutationStatus === "error") status = "error";
|
|
215
|
+
if (queryStatus === "success" && (mutationStatus === "success" || mutationStatus === "idle")) status = "success";
|
|
222
216
|
return {
|
|
223
217
|
isFavorited,
|
|
224
218
|
status,
|
|
@@ -307,18 +301,15 @@ var FavoriteHeart = ({
|
|
|
307
301
|
}
|
|
308
302
|
};
|
|
309
303
|
const iconKey = (() => {
|
|
310
|
-
if (status === "initLoading")
|
|
311
|
-
return "unknownDisabledHeart";
|
|
304
|
+
if (status === "initLoading") return "unknownDisabledHeart";
|
|
312
305
|
if (status === "reloading") {
|
|
313
|
-
if (isLastClickedFavorite)
|
|
314
|
-
return "spinner";
|
|
306
|
+
if (isLastClickedFavorite) return "spinner";
|
|
315
307
|
return isFavorited ? "favoritedDisabledHeart" : "unfavoritedDisabledHeart";
|
|
316
308
|
}
|
|
317
309
|
if (disabled) {
|
|
318
310
|
return isFavorited ? "favoritedDisabledHeart" : "unfavoritedDisabledHeart";
|
|
319
311
|
}
|
|
320
|
-
if (isFavorited)
|
|
321
|
-
return "favoritedHeart";
|
|
312
|
+
if (isFavorited) return "favoritedHeart";
|
|
322
313
|
return "unfavoritedHeart";
|
|
323
314
|
})();
|
|
324
315
|
const cursor = disabled || !isLastClickedFavorite && (status === "initLoading" || status === "reloading") ? "not-allowed" : void 0;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@availity/mui-favorites",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0-alpha.0",
|
|
4
4
|
"description": "Availity MUI Favorites Component - part of the @availity/element design system",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -40,25 +40,25 @@
|
|
|
40
40
|
"publish:canary": "yarn npm publish --access public --tag canary"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@availity/api-axios": "^
|
|
43
|
+
"@availity/api-axios": "^10.0.0",
|
|
44
44
|
"@availity/message-core": "^7.0.2",
|
|
45
45
|
"@tanstack/react-query": "^4.36.1"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
|
-
"@availity/mui-icon": "^0.
|
|
49
|
-
"@availity/mui-progress": "^0.
|
|
50
|
-
"@availity/mui-tooltip": "^0.
|
|
51
|
-
"@mui/material": "^
|
|
48
|
+
"@availity/mui-icon": "^1.0.0-alpha.0",
|
|
49
|
+
"@availity/mui-progress": "^1.0.0-alpha.0",
|
|
50
|
+
"@availity/mui-tooltip": "^1.0.0-alpha.0",
|
|
51
|
+
"@mui/material": "^6.4.5",
|
|
52
52
|
"react": "18.2.0",
|
|
53
53
|
"react-dom": "18.2.0",
|
|
54
|
-
"tsup": "^8.
|
|
54
|
+
"tsup": "^8.3.6",
|
|
55
55
|
"typescript": "^5.4.5"
|
|
56
56
|
},
|
|
57
57
|
"peerDependencies": {
|
|
58
|
-
"@availity/mui-icon": "^0.
|
|
59
|
-
"@availity/mui-progress": "^0.
|
|
60
|
-
"@availity/mui-tooltip": "^0.
|
|
61
|
-
"@mui/material": "^
|
|
58
|
+
"@availity/mui-icon": "^1.0.0-alpha.0",
|
|
59
|
+
"@availity/mui-progress": "^1.0.0-alpha.0",
|
|
60
|
+
"@availity/mui-tooltip": "^1.0.0-alpha.0",
|
|
61
|
+
"@mui/material": "^6.4.5",
|
|
62
62
|
"react": ">=16.3.0"
|
|
63
63
|
},
|
|
64
64
|
"publishConfig": {
|
|
File without changes
|