@mohasinac/appkit 3.3.3 → 3.3.4
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/_internal/client/features/lottery/LotteryAdminSlotView.js +1 -1
- package/dist/_internal/server/features/cart/actions.js +1 -1
- package/dist/_internal/server/features/lottery/data.d.ts +2 -3
- package/dist/_internal/server/features/products/actions.js +1 -1
- package/dist/features/admin/components/AdminSectionsView.js +7 -4
- package/dist/features/admin/constants/filter-tabs.js +11 -0
- package/dist/features/auctions/columns/index.js +1 -1
- package/dist/features/auctions/schemas/index.d.ts +2 -2
- package/dist/features/auth/hooks/useRBAC.js +6 -1
- package/dist/features/blog/columns/index.js +1 -1
- package/dist/features/categories/schemas/firestore.d.ts +1 -1
- package/dist/features/contact/email.js +0 -1
- package/dist/features/forms/Slider.js +4 -1
- package/dist/features/forms/Toggle.js +4 -1
- package/dist/features/homepage/components/NewsletterBanner.js +1 -1
- package/dist/features/layout/BottomActions.js +27 -0
- package/dist/features/layout/BottomActionsContext.d.ts +36 -0
- package/dist/features/layout/BottomActionsContext.js +36 -0
- package/dist/features/orders/schemas/index.d.ts +2 -2
- package/dist/features/payments/schemas/index.d.ts +4 -4
- package/dist/features/products/repository/products.repository.js +1 -1
- package/dist/features/products/schemas/product-features.validators.d.ts +6 -6
- package/dist/features/promotions/repository/claimed-coupons.repository.js +1 -1
- package/dist/features/reviews/columns/index.js +1 -1
- package/dist/features/search/schemas/index.d.ts +2 -2
- package/dist/features/seller/actions/seller-actions.d.ts +2 -2
- package/dist/features/seller/components/SellerOrdersView.js +4 -1
- package/dist/features/seller/components/SellerProductsView.js +35 -31
- package/dist/features/seller/components/SellerReviewsView.js +1 -1
- package/dist/features/seller/schemas/index.d.ts +2 -2
- package/dist/features/stores/columns/index.js +1 -1
- package/dist/features/stores/components/StoresIndexListing.js +20 -15
- package/dist/features/wishlist/actions/wishlist-actions.js +1 -1
- package/dist/next/components/NotFoundView.js +17 -0
- package/dist/next/components/UnauthorizedView.js +13 -0
- package/dist/schemas/registry.d.ts +93 -94
- package/dist/schemas/webhooks/razorpay.d.ts +86 -86
- package/dist/ui/columns/column-renderers.js +1 -1
- package/dist/ui/components/Accordion.js +10 -6
- package/dist/ui/components/ListingLayout.js +6 -2
- package/package.json +1 -1
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* For JSX renderers (badge, thumbnail, action buttons) see `column-renderers.tsx`.
|
|
8
8
|
*/
|
|
9
9
|
import { formatCurrency } from "../../utils/number.formatter";
|
|
10
|
-
import { getDefaultCurrency
|
|
10
|
+
import { getDefaultCurrency } from "../../core/baseline-resolver";
|
|
11
11
|
/** Render a boolean as "Yes" / "No" (or custom labels). */
|
|
12
12
|
export function renderBoolean(value, opts) {
|
|
13
13
|
const trueLabel = opts?.trueLabel ?? "Yes";
|
|
@@ -15,6 +15,16 @@ function renderLegacyAccordion({ title, children, open, className = "", titleCla
|
|
|
15
15
|
return (_jsxs("details", { open: open, className: `appkit-accordion appkit-accordion--legacy ${className}`, children: [_jsxs("summary", { className: `appkit-accordion__summary ${titleClassName}`, children: [title, _jsx("span", { className: "appkit-accordion__chevron", "aria-hidden": "true", children: "\u25BE" })] }), _jsx("div", { className: `appkit-accordion__content ${contentClassName}`, "data-section": "accordion-div-447", children: children })] }));
|
|
16
16
|
}
|
|
17
17
|
export function Accordion({ title, children, open = false, className = "", titleClassName = "", contentClassName = "", type = "single", defaultValue, value, onChange, }) {
|
|
18
|
+
// useMemo/useState must run unconditionally on every render — they were
|
|
19
|
+
// previously declared after the legacy-mode early return below, which
|
|
20
|
+
// skipped both hook calls whenever `title` was passed, violating the
|
|
21
|
+
// Rules of Hooks. Their result is simply unused in legacy mode.
|
|
22
|
+
const initialOpen = useMemo(() => {
|
|
23
|
+
if (value !== undefined)
|
|
24
|
+
return toArray(value);
|
|
25
|
+
return toArray(defaultValue);
|
|
26
|
+
}, [defaultValue, value]);
|
|
27
|
+
const [internalOpenValues, setInternalOpenValues] = useState(initialOpen);
|
|
18
28
|
// Backward-compatible simple details mode.
|
|
19
29
|
if (title !== undefined) {
|
|
20
30
|
return renderLegacyAccordion({
|
|
@@ -26,12 +36,6 @@ export function Accordion({ title, children, open = false, className = "", title
|
|
|
26
36
|
contentClassName,
|
|
27
37
|
});
|
|
28
38
|
}
|
|
29
|
-
const initialOpen = useMemo(() => {
|
|
30
|
-
if (value !== undefined)
|
|
31
|
-
return toArray(value);
|
|
32
|
-
return toArray(defaultValue);
|
|
33
|
-
}, [defaultValue, value]);
|
|
34
|
-
const [internalOpenValues, setInternalOpenValues] = useState(initialOpen);
|
|
35
39
|
const activeOpenValues = value !== undefined ? toArray(value) : internalOpenValues;
|
|
36
40
|
const toggle = (itemValue) => {
|
|
37
41
|
const nextOpenValues = type === "single"
|
|
@@ -36,6 +36,12 @@ const DEFAULT_LABELS = {
|
|
|
36
36
|
filterActiveCount: (count) => `${count} active`,
|
|
37
37
|
};
|
|
38
38
|
export function ListingLayout({ headerSlot, statusTabsSlot, filterContent, filterActiveCount = 0, onFilterApply, onFilterClear, filterTitle, activeFiltersSlot, resultCountSlot, searchSlot, sortSlot, viewToggleSlot, actionsSlot, selectedCount = 0, onClearSelection, bulkActionItems, toolbarPaginationSlot, paginationSlot, children, isDashboard, defaultSidebarOpen = false, filterPendingCount, className = "", loading = false, errorSlot, labels, portal, overlays, detailView, }) {
|
|
39
|
+
// useState must run unconditionally on every render — these were
|
|
40
|
+
// previously declared after the detail-view early return below, which
|
|
41
|
+
// skipped both hook calls whenever `detailView` was passed, violating the
|
|
42
|
+
// Rules of Hooks.
|
|
43
|
+
const [sidebarOpen, setSidebarOpen] = useState(defaultSidebarOpen);
|
|
44
|
+
const [mobileFilterOpen, setMobileFilterOpen] = useState(false);
|
|
39
45
|
// Detail view short-circuit (folded from ListingViewShell)
|
|
40
46
|
if (detailView) {
|
|
41
47
|
return _jsx(_Fragment, { children: detailView });
|
|
@@ -43,8 +49,6 @@ export function ListingLayout({ headerSlot, statusTabsSlot, filterContent, filte
|
|
|
43
49
|
// Portal-derived isDashboard default (folded from ListingViewShell)
|
|
44
50
|
const effectiveIsDashboard = isDashboard ?? (portal === "admin" || portal === "seller");
|
|
45
51
|
const l = { ...DEFAULT_LABELS, ...labels };
|
|
46
|
-
const [sidebarOpen, setSidebarOpen] = useState(defaultSidebarOpen);
|
|
47
|
-
const [mobileFilterOpen, setMobileFilterOpen] = useState(false);
|
|
48
52
|
const hasFilter = Boolean(filterContent);
|
|
49
53
|
const panelTitle = filterTitle ?? l.filtersTitle;
|
|
50
54
|
const handleMobileApply = () => {
|