@mohasinac/appkit 3.5.5 → 3.5.7
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/layout/DashboardLayoutClient.js +24 -3
- package/dist/_internal/client/features/tour/TourProvider.d.ts +11 -3
- package/dist/_internal/client/features/tour/TourProvider.js +93 -4
- package/dist/_internal/client/scaffolds/index.d.ts +0 -2
- package/dist/_internal/client/scaffolds/index.js +0 -1
- package/dist/_internal/server/features/checkout/actions.js +65 -11
- package/dist/_internal/server/features/orders/adapters.js +3 -0
- package/dist/_internal/shared/actions/action-registry.js +20 -0
- package/dist/_internal/shared/checkout/order-math.d.ts +21 -0
- package/dist/_internal/shared/checkout/order-math.js +24 -0
- package/dist/_internal/shared/features/orders/config.d.ts +1 -1
- package/dist/_internal/shared/features/orders/config.js +1 -1
- package/dist/_internal/shared/fees/calculator.d.ts +13 -0
- package/dist/_internal/shared/fees/calculator.js +8 -0
- package/dist/client-entry.d.ts +2 -2
- package/dist/client-entry.js +2 -2
- package/dist/client.d.ts +8 -0
- package/dist/client.js +8 -0
- package/dist/constants/api-endpoints.d.ts +9 -0
- package/dist/constants/api-endpoints.js +3 -0
- package/dist/features/account/components/UserSidebar.js +1 -1
- package/dist/features/admin/components/AdminBundleEditorView.d.ts +8 -1
- package/dist/features/admin/components/AdminBundleEditorView.js +15 -11
- package/dist/features/admin/components/AdminFeaturesView.js +1 -1
- package/dist/features/admin/components/AdminPayoutsView.js +41 -4
- package/dist/features/admin/components/AdminSidebar.js +1 -1
- package/dist/features/admin/components/AdminSiteSettingsView.js +49 -1
- package/dist/features/admin/components/DataTable.js +1 -1
- package/dist/features/admin/components/index.d.ts +0 -2
- package/dist/features/admin/components/index.js +0 -1
- package/dist/features/admin/schemas/firestore.d.ts +8 -0
- package/dist/features/admin/schemas/firestore.js +6 -0
- package/dist/features/auctions/components/MarketplaceAuctionCard.js +1 -1
- package/dist/features/before-after/components/BeforeAfterSlider.js +4 -0
- package/dist/features/blog/components/BlogFeaturedCard.js +1 -1
- package/dist/features/categories/components/BundleDynamicRuleEditor.js +2 -9
- package/dist/features/events/components/EventCard.js +1 -1
- package/dist/features/events/components/EventRafflesSection.d.ts +1 -1
- package/dist/features/events/components/EventRafflesSection.js +3 -3
- package/dist/features/homepage/components/BeforeAfterCard.js +5 -0
- package/dist/features/homepage/components/FeaturedBundlesSection.d.ts +1 -1
- package/dist/features/homepage/components/FeaturedBundlesSection.js +3 -1
- package/dist/features/homepage/components/GoogleReviewsSection.js +2 -2
- package/dist/features/homepage/components/HeroCarousel.js +1 -1
- package/dist/features/layout/NavbarLayout.js +1 -1
- package/dist/features/layout/TitleBarLayout.js +5 -5
- package/dist/features/media/MediaLightbox.js +7 -1
- package/dist/features/media/components/MediaSlider.js +4 -1
- package/dist/features/media/modals/ImageCropModal.js +1 -1
- package/dist/features/media/upload/ImageUpload.js +24 -12
- package/dist/features/messages/hooks/useConversations.d.ts +7 -1
- package/dist/features/messages/hooks/useConversations.js +7 -6
- package/dist/features/orders/actions/order-actions.d.ts +10 -0
- package/dist/features/orders/actions/order-actions.js +57 -4
- package/dist/features/orders/components/MarketplaceOrderCard.js +1 -1
- package/dist/features/orders/schemas/firestore.d.ts +16 -0
- package/dist/features/orders/types/index.d.ts +2 -0
- package/dist/features/pre-orders/components/MarketplacePreorderCard.js +1 -1
- package/dist/features/products/components/MarketplaceBundleCard.js +1 -1
- package/dist/features/products/components/MarketplacePrizeDrawCard.js +1 -1
- package/dist/features/products/components/PrizeDrawsSection.d.ts +1 -1
- package/dist/features/products/components/PrizeDrawsSection.js +3 -2
- package/dist/features/products/components/ProductForm.js +4 -9
- package/dist/features/products/components/ProductGrid.js +1 -1
- package/dist/features/products/schemas/firestore.d.ts +4 -0
- package/dist/features/promotions/components/CouponCard.js +1 -1
- package/dist/features/scams/actions/scam-actions.d.ts +12 -0
- package/dist/features/scams/actions/scam-actions.js +31 -0
- package/dist/features/scams/components/SellerTrustBadge.d.ts +16 -0
- package/dist/features/scams/components/SellerTrustBadge.js +21 -0
- package/dist/features/scams/components/index.d.ts +2 -0
- package/dist/features/scams/components/index.js +1 -0
- package/dist/features/seller/components/SellerBundlesView.d.ts +5 -5
- package/dist/features/seller/components/SellerBundlesView.js +81 -84
- package/dist/features/seller/components/SellerProductShell.d.ts +2 -0
- package/dist/features/seller/components/SellerProductShell.js +11 -5
- package/dist/features/seller/components/SellerSidebar.js +1 -1
- package/dist/features/shipments/components/ShipmentItemLinkModal.js +5 -5
- package/dist/features/stores/components/InteractiveStoreCard.js +1 -1
- package/dist/features/stores/components/StoreDetailLayoutView.d.ts +8 -1
- package/dist/features/stores/components/StoreDetailLayoutView.js +9 -3
- package/dist/features/stores/components/StoreHeader.d.ts +4 -1
- package/dist/features/stores/components/StoreHeader.js +3 -2
- package/dist/index.d.ts +7 -6
- package/dist/index.js +6 -5
- package/dist/jobs.d.ts +2 -0
- package/dist/jobs.js +6 -0
- package/dist/next/routing/route-map.d.ts +3 -0
- package/dist/next/routing/route-map.js +1 -0
- package/dist/react/hooks/useClickOutside.js +3 -0
- package/dist/security/rate-limit.d.ts +5 -0
- package/dist/security/rate-limit.js +2 -0
- package/dist/seed/categories-seed-data.js +180 -1
- package/dist/seed/grouped-listings-seed-data.d.ts +2 -0
- package/dist/seed/products-preorders-seed-data.d.ts +2 -0
- package/dist/seed/site-settings-seed-data.js +9 -2
- package/dist/server-entry.d.ts +2 -2
- package/dist/server-entry.js +1 -1
- package/dist/server.d.ts +4 -0
- package/dist/server.js +5 -0
- package/dist/styles.css +11 -4
- package/dist/tailwind-utilities.css +1 -1
- package/dist/tokens/themes/cobalt-night.d.ts +17 -0
- package/dist/tokens/themes/cobalt-night.js +50 -0
- package/dist/tokens/themes/index.d.ts +9 -1
- package/dist/tokens/themes/index.js +12 -1
- package/dist/tokens/themes/sunset.d.ts +18 -0
- package/dist/tokens/themes/sunset.js +51 -0
- package/dist/tokens/tokens.css +10 -3
- package/dist/ui/components/BaseListingCard.d.ts +2 -1
- package/dist/ui/components/BaseListingCard.js +4 -4
- package/dist/ui/components/Card.d.ts +1 -1
- package/dist/ui/components/Card.js +2 -2
- package/dist/ui/components/Div.js +2 -2
- package/dist/ui/components/Form.d.ts +1 -1
- package/dist/ui/components/Form.js +2 -2
- package/dist/ui/components/Input.js +1 -0
- package/dist/ui/components/ListingToolbar.js +1 -1
- package/dist/ui/components/QuickCreateModal.style.css +1 -1
- package/dist/ui/components/Slider.js +5 -1
- package/package.json +3 -2
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ThemeRecord } from "./types";
|
|
2
|
+
/**
|
|
3
|
+
* Theme template — Cobalt Night. Keeps the cobalt primary but pairs it with
|
|
4
|
+
* a deep-blue dark surface instead of hot pink. Mirrors the
|
|
5
|
+
* `[data-theme="cobalt-night"]` block in `appkit/src/tokens/tokens.css`.
|
|
6
|
+
*
|
|
7
|
+
* Not a built-in (`builtIn: false`) — seeded into `siteSettings.theme.themes`
|
|
8
|
+
* as a selectable starting point admins can assign as the default dark theme
|
|
9
|
+
* or clone from `ThemeManagerView`. Only overrides the tokens the CSS block
|
|
10
|
+
* itself overrides; every other token (spacing, fonts, unredefined gradients)
|
|
11
|
+
* falls back to `DEFAULT_DARK_THEME`'s values, same pattern the CSS block uses
|
|
12
|
+
* against `:root`.
|
|
13
|
+
*
|
|
14
|
+
* Drift between this file and `tokens.css` is detected by
|
|
15
|
+
* `scripts/audit-theme-drift.mjs`.
|
|
16
|
+
*/
|
|
17
|
+
export declare const COBALT_NIGHT_THEME: ThemeRecord;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { DEFAULT_DARK_THEME } from "./default-dark";
|
|
2
|
+
/**
|
|
3
|
+
* Theme template — Cobalt Night. Keeps the cobalt primary but pairs it with
|
|
4
|
+
* a deep-blue dark surface instead of hot pink. Mirrors the
|
|
5
|
+
* `[data-theme="cobalt-night"]` block in `appkit/src/tokens/tokens.css`.
|
|
6
|
+
*
|
|
7
|
+
* Not a built-in (`builtIn: false`) — seeded into `siteSettings.theme.themes`
|
|
8
|
+
* as a selectable starting point admins can assign as the default dark theme
|
|
9
|
+
* or clone from `ThemeManagerView`. Only overrides the tokens the CSS block
|
|
10
|
+
* itself overrides; every other token (spacing, fonts, unredefined gradients)
|
|
11
|
+
* falls back to `DEFAULT_DARK_THEME`'s values, same pattern the CSS block uses
|
|
12
|
+
* against `:root`.
|
|
13
|
+
*
|
|
14
|
+
* Drift between this file and `tokens.css` is detected by
|
|
15
|
+
* `scripts/audit-theme-drift.mjs`.
|
|
16
|
+
*/
|
|
17
|
+
export const COBALT_NIGHT_THEME = {
|
|
18
|
+
id: "cobalt-night",
|
|
19
|
+
name: "Cobalt Night",
|
|
20
|
+
mode: "dark",
|
|
21
|
+
builtIn: false,
|
|
22
|
+
tokens: {
|
|
23
|
+
"appkit-color-primary": "#5992ff",
|
|
24
|
+
"appkit-color-primary-500": "#5992ff",
|
|
25
|
+
"appkit-color-primary-600": "#3570fc",
|
|
26
|
+
"appkit-color-secondary": "#84e122",
|
|
27
|
+
"appkit-color-secondary-500": "#84e122",
|
|
28
|
+
"appkit-color-bg": "#111e58",
|
|
29
|
+
"appkit-color-surface": "#1536b4",
|
|
30
|
+
"appkit-color-surface-elevated": "rgba(21, 54, 180, 0.9)",
|
|
31
|
+
"appkit-color-surface-input": "rgba(24, 49, 142, 0.6)",
|
|
32
|
+
"appkit-color-border": "#1343de",
|
|
33
|
+
"appkit-color-border-subtle": "rgba(24, 49, 142, 0.6)",
|
|
34
|
+
"appkit-color-text": "#eef5ff",
|
|
35
|
+
"appkit-color-text-muted": "#bcd4ff",
|
|
36
|
+
"appkit-color-text-faint": "#8eb9ff",
|
|
37
|
+
"appkit-color-success": "#4ade80",
|
|
38
|
+
"appkit-color-success-surface": "rgba(20, 83, 45, 0.3)",
|
|
39
|
+
"appkit-color-warning": "#fbbf24",
|
|
40
|
+
"appkit-color-warning-surface": "rgba(120, 53, 15, 0.3)",
|
|
41
|
+
"appkit-color-error": "#f87171",
|
|
42
|
+
"appkit-color-error-surface": "rgba(127, 29, 29, 0.3)",
|
|
43
|
+
"appkit-color-info": "#38bdf8",
|
|
44
|
+
"appkit-color-info-surface": "rgba(12, 74, 110, 0.3)",
|
|
45
|
+
"appkit-color-focus-ring": "#8eb9ff",
|
|
46
|
+
"appkit-shadow-glow": "0 0 0 1px rgba(89,146,255,0.18), 0 4px 16px -4px rgba(89,146,255,0.30)",
|
|
47
|
+
"appkit-shadow-glow-pink": "0 0 0 1px rgba(89,146,255,0.18), 0 4px 20px -4px rgba(89,146,255,0.30)",
|
|
48
|
+
},
|
|
49
|
+
gradients: { ...DEFAULT_DARK_THEME.gradients },
|
|
50
|
+
};
|
|
@@ -1,12 +1,20 @@
|
|
|
1
1
|
import { DEFAULT_DARK_THEME } from "./default-dark";
|
|
2
2
|
import { DEFAULT_LIGHT_THEME } from "./default-light";
|
|
3
|
+
import { COBALT_NIGHT_THEME } from "./cobalt-night";
|
|
4
|
+
import { SUNSET_THEME } from "./sunset";
|
|
3
5
|
import type { ThemeMode, ThemeRecord } from "./types";
|
|
4
|
-
export { DEFAULT_LIGHT_THEME, DEFAULT_DARK_THEME };
|
|
6
|
+
export { DEFAULT_LIGHT_THEME, DEFAULT_DARK_THEME, COBALT_NIGHT_THEME, SUNSET_THEME };
|
|
5
7
|
export { REQUIRED_GRADIENT_KEYS, REQUIRED_THEME_TOKENS } from "./required";
|
|
6
8
|
export type { RequiredThemeToken } from "./required";
|
|
7
9
|
export type { GradientKey, ThemeMode, ThemeRecord } from "./types";
|
|
8
10
|
/** Built-in themes that ship with appkit; admin cannot delete these. */
|
|
9
11
|
export declare const BUILT_IN_THEMES: readonly ThemeRecord[];
|
|
12
|
+
/**
|
|
13
|
+
* Selectable theme templates — not built-in (admin can delete/edit them),
|
|
14
|
+
* but shipped pre-defined so they're available immediately in
|
|
15
|
+
* `ThemeManagerView` without an admin hand-building a palette from scratch.
|
|
16
|
+
*/
|
|
17
|
+
export declare const THEME_TEMPLATES: readonly ThemeRecord[];
|
|
10
18
|
/**
|
|
11
19
|
* Find the default built-in theme for a given mode.
|
|
12
20
|
* Used as a fallback when `siteSettings.theme.default{Light,Dark}ThemeId`
|
|
@@ -1,12 +1,23 @@
|
|
|
1
1
|
import { DEFAULT_DARK_THEME } from "./default-dark";
|
|
2
2
|
import { DEFAULT_LIGHT_THEME } from "./default-light";
|
|
3
|
-
|
|
3
|
+
import { COBALT_NIGHT_THEME } from "./cobalt-night";
|
|
4
|
+
import { SUNSET_THEME } from "./sunset";
|
|
5
|
+
export { DEFAULT_LIGHT_THEME, DEFAULT_DARK_THEME, COBALT_NIGHT_THEME, SUNSET_THEME };
|
|
4
6
|
export { REQUIRED_GRADIENT_KEYS, REQUIRED_THEME_TOKENS } from "./required";
|
|
5
7
|
/** Built-in themes that ship with appkit; admin cannot delete these. */
|
|
6
8
|
export const BUILT_IN_THEMES = [
|
|
7
9
|
DEFAULT_LIGHT_THEME,
|
|
8
10
|
DEFAULT_DARK_THEME,
|
|
9
11
|
];
|
|
12
|
+
/**
|
|
13
|
+
* Selectable theme templates — not built-in (admin can delete/edit them),
|
|
14
|
+
* but shipped pre-defined so they're available immediately in
|
|
15
|
+
* `ThemeManagerView` without an admin hand-building a palette from scratch.
|
|
16
|
+
*/
|
|
17
|
+
export const THEME_TEMPLATES = [
|
|
18
|
+
COBALT_NIGHT_THEME,
|
|
19
|
+
SUNSET_THEME,
|
|
20
|
+
];
|
|
10
21
|
/**
|
|
11
22
|
* Find the default built-in theme for a given mode.
|
|
12
23
|
* Used as a fallback when `siteSettings.theme.default{Light,Dark}ThemeId`
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ThemeRecord } from "./types";
|
|
2
|
+
/**
|
|
3
|
+
* Theme template — Sunset. Warm amber primary + rose secondary on a
|
|
4
|
+
* deep-rose-tinted light body — a daytime warm palette alternative to the
|
|
5
|
+
* default cobalt+lime. Mirrors the `[data-theme="sunset"]` block in
|
|
6
|
+
* `appkit/src/tokens/tokens.css`.
|
|
7
|
+
*
|
|
8
|
+
* Not a built-in (`builtIn: false`) — seeded into `siteSettings.theme.themes`
|
|
9
|
+
* as a selectable starting point admins can assign as the default light
|
|
10
|
+
* theme or clone from `ThemeManagerView`. Only overrides the tokens the CSS
|
|
11
|
+
* block itself overrides; every other token (spacing, fonts, unredefined
|
|
12
|
+
* gradients) falls back to `DEFAULT_LIGHT_THEME`'s values, same pattern the
|
|
13
|
+
* CSS block uses against `:root`.
|
|
14
|
+
*
|
|
15
|
+
* Drift between this file and `tokens.css` is detected by
|
|
16
|
+
* `scripts/audit-theme-drift.mjs`.
|
|
17
|
+
*/
|
|
18
|
+
export declare const SUNSET_THEME: ThemeRecord;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { DEFAULT_LIGHT_THEME } from "./default-light";
|
|
2
|
+
/**
|
|
3
|
+
* Theme template — Sunset. Warm amber primary + rose secondary on a
|
|
4
|
+
* deep-rose-tinted light body — a daytime warm palette alternative to the
|
|
5
|
+
* default cobalt+lime. Mirrors the `[data-theme="sunset"]` block in
|
|
6
|
+
* `appkit/src/tokens/tokens.css`.
|
|
7
|
+
*
|
|
8
|
+
* Not a built-in (`builtIn: false`) — seeded into `siteSettings.theme.themes`
|
|
9
|
+
* as a selectable starting point admins can assign as the default light
|
|
10
|
+
* theme or clone from `ThemeManagerView`. Only overrides the tokens the CSS
|
|
11
|
+
* block itself overrides; every other token (spacing, fonts, unredefined
|
|
12
|
+
* gradients) falls back to `DEFAULT_LIGHT_THEME`'s values, same pattern the
|
|
13
|
+
* CSS block uses against `:root`.
|
|
14
|
+
*
|
|
15
|
+
* Drift between this file and `tokens.css` is detected by
|
|
16
|
+
* `scripts/audit-theme-drift.mjs`.
|
|
17
|
+
*/
|
|
18
|
+
export const SUNSET_THEME = {
|
|
19
|
+
id: "sunset",
|
|
20
|
+
name: "Sunset",
|
|
21
|
+
mode: "light",
|
|
22
|
+
builtIn: false,
|
|
23
|
+
tokens: {
|
|
24
|
+
"appkit-color-primary": "#f59e0b",
|
|
25
|
+
"appkit-color-primary-500": "#f59e0b",
|
|
26
|
+
"appkit-color-primary-600": "#d97706",
|
|
27
|
+
"appkit-color-secondary": "#f43f5e",
|
|
28
|
+
"appkit-color-secondary-500": "#f43f5e",
|
|
29
|
+
"appkit-color-bg": "#fff7ed",
|
|
30
|
+
"appkit-color-surface": "#ffffff",
|
|
31
|
+
"appkit-color-surface-elevated": "#ffffff",
|
|
32
|
+
"appkit-color-surface-input": "#fffbeb",
|
|
33
|
+
"appkit-color-border": "#fed7aa",
|
|
34
|
+
"appkit-color-border-subtle": "#ffedd5",
|
|
35
|
+
"appkit-color-text": "#431407",
|
|
36
|
+
"appkit-color-text-muted": "#9a3412",
|
|
37
|
+
"appkit-color-text-faint": "#c2410c",
|
|
38
|
+
"appkit-color-success": "#16a34a",
|
|
39
|
+
"appkit-color-success-surface": "#f0fdf4",
|
|
40
|
+
"appkit-color-warning": "#d97706",
|
|
41
|
+
"appkit-color-warning-surface": "#fef3c7",
|
|
42
|
+
"appkit-color-error": "#dc2626",
|
|
43
|
+
"appkit-color-error-surface": "#fef2f2",
|
|
44
|
+
"appkit-color-info": "#0284c7",
|
|
45
|
+
"appkit-color-info-surface": "#f0f9ff",
|
|
46
|
+
"appkit-color-focus-ring": "#f59e0b",
|
|
47
|
+
"appkit-shadow-glow": "0 0 0 1px rgba(245,158,11,0.18), 0 4px 16px -4px rgba(245,158,11,0.30)",
|
|
48
|
+
"appkit-shadow-glow-pink": "0 0 0 1px rgba(244,63,94,0.18), 0 4px 20px -4px rgba(244,63,94,0.30)",
|
|
49
|
+
},
|
|
50
|
+
gradients: { ...DEFAULT_LIGHT_THEME.gradients },
|
|
51
|
+
};
|
package/dist/tokens/tokens.css
CHANGED
|
@@ -311,9 +311,16 @@
|
|
|
311
311
|
--appkit-logo-stop-to: var(--appkit-color-secondary-400);
|
|
312
312
|
}
|
|
313
313
|
|
|
314
|
-
/* --- Theme — Dark ([data-theme="dark"])
|
|
315
|
-
/* Dark mode: both primary & secondary become Hot Pink (Beyblade 2 dominant colour)
|
|
316
|
-
|
|
314
|
+
/* --- Theme — Dark ([data-theme="default-dark"]) ---------------------------- */
|
|
315
|
+
/* Dark mode: both primary & secondary become Hot Pink (Beyblade 2 dominant colour).
|
|
316
|
+
Selector MUST match ThemeRecord.id ("default-dark"), not the ThemeMode ("dark") —
|
|
317
|
+
ThemeProvider.applyTheme() sets data-theme to the record id, never "dark" literally.
|
|
318
|
+
A prior mismatch here left this whole block unreachable (dead CSS), which also
|
|
319
|
+
caused a "swamp green" FOUC flash: the anti-FOUC script sets .dark + the correct
|
|
320
|
+
data-theme id before hydration, but with no matching CSS selector the page kept
|
|
321
|
+
painting :root's light-mode secondary (lime green) until React's inline styles
|
|
322
|
+
landed a moment later. */
|
|
323
|
+
[data-theme="default-dark"] {
|
|
317
324
|
--appkit-color-primary: #e91e8c;
|
|
318
325
|
--appkit-color-primary-50: #fdf0f8;
|
|
319
326
|
--appkit-color-primary-100: #fce2f2;
|
|
@@ -19,6 +19,7 @@ export interface BaseListingCardRootProps {
|
|
|
19
19
|
onMouseLeave?: () => void;
|
|
20
20
|
onTouchStart?: () => void;
|
|
21
21
|
onTouchEnd?: () => void;
|
|
22
|
+
onTouchCancel?: () => void;
|
|
22
23
|
}
|
|
23
24
|
export interface BaseListingCardHeroProps {
|
|
24
25
|
/** Aspect ratio for the hero image — only these two produce a real CSS rule (Tailwind's static scanner can't see a dynamically-interpolated `aspect-[${var}]`). Defaults to `"4/3"`. */
|
|
@@ -41,7 +42,7 @@ export interface BaseListingCardCheckboxProps {
|
|
|
41
42
|
position?: string;
|
|
42
43
|
className?: string;
|
|
43
44
|
}
|
|
44
|
-
declare function BaseListingCardRoot({ className, isSelected, isDisabled, variant, onClick, onMouseDown, onMouseUp, onMouseLeave, onTouchStart, onTouchEnd, children, }: BaseListingCardRootProps): import("react").JSX.Element;
|
|
45
|
+
declare function BaseListingCardRoot({ className, isSelected, isDisabled, variant, onClick, onMouseDown, onMouseUp, onMouseLeave, onTouchStart, onTouchEnd, onTouchCancel, children, }: BaseListingCardRootProps): import("react").JSX.Element;
|
|
45
46
|
declare function BaseListingCardHero({ aspect, variant, className, children, onMouseEnter, onMouseLeave, }: BaseListingCardHeroProps): import("react").JSX.Element;
|
|
46
47
|
declare function BaseListingCardInfo({ variant, className, children, }: BaseListingCardInfoProps): import("react").JSX.Element;
|
|
47
48
|
declare function BaseListingCardCheckbox({ selected, onSelect, label, position, className, }: BaseListingCardCheckboxProps): import("react").JSX.Element;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { MediaImage } from "../../features/media/MediaImage";
|
|
3
3
|
import { Span } from "./Typography";
|
|
4
|
-
function BaseListingCardRoot({ className = "", isSelected, isDisabled, variant = "grid", onClick, onMouseDown, onMouseUp, onMouseLeave, onTouchStart, onTouchEnd, children, }) {
|
|
5
|
-
return (_jsx("div", { onClick: onClick, onMouseDown: onMouseDown, onMouseUp: onMouseUp, onMouseLeave: onMouseLeave, onTouchStart: onTouchStart, onTouchEnd: onTouchEnd, className: [
|
|
4
|
+
function BaseListingCardRoot({ className = "", isSelected, isDisabled, variant = "grid", onClick, onMouseDown, onMouseUp, onMouseLeave, onTouchStart, onTouchEnd, onTouchCancel, children, }) {
|
|
5
|
+
return (_jsx("div", { onClick: onClick, onMouseDown: onMouseDown, onMouseUp: onMouseUp, onMouseLeave: onMouseLeave, onTouchStart: onTouchStart, onTouchEnd: onTouchEnd, onTouchCancel: onTouchCancel, className: [
|
|
6
6
|
"group relative w-full min-w-0 overflow-hidden rounded-xl border bg-[var(--appkit-color-surface)] transition-shadow",
|
|
7
7
|
variant === "list" ? "flex flex-row items-stretch" : "flex flex-col",
|
|
8
8
|
isSelected
|
|
@@ -56,7 +56,7 @@ function BaseListingCardCheckbox({ selected, onSelect, label, position = "top-2
|
|
|
56
56
|
"focus-visible:ring-2 focus-visible:ring-primary/50",
|
|
57
57
|
selected
|
|
58
58
|
? "bg-primary border-primary shadow-sm"
|
|
59
|
-
: "bg-white/80
|
|
59
|
+
: "bg-white/80 hover:border-primary/60 hover:bg-[var(--appkit-color-surface)]/80 border-[var(--appkit-color-border)]",
|
|
60
60
|
position,
|
|
61
61
|
className,
|
|
62
62
|
]
|
|
@@ -71,7 +71,7 @@ function BaseListingCardIconOverlay({ groupIcon, sublistingIcon, position = "top
|
|
|
71
71
|
if (isMediaUrl) {
|
|
72
72
|
return (_jsx("div", { className: "relative w-5 h-5 overflow-hidden rounded-full border border-white/80 shadow-sm bg-[var(--appkit-color-surface)]", children: _jsx(MediaImage, { src: icon, alt: "", size: "thumbnail" }) }, key));
|
|
73
73
|
}
|
|
74
|
-
return (_jsx(Span, { size: "sm", className: "inline-flex items-center justify-center w-5 h-5 rounded-full border border-white/80 bg-
|
|
74
|
+
return (_jsx(Span, { size: "sm", className: "inline-flex items-center justify-center w-5 h-5 rounded-full border border-white/80 bg-[var(--appkit-color-surface)]/95 shadow-sm leading-none", children: icon }, key));
|
|
75
75
|
};
|
|
76
76
|
return (_jsxs("div", { className: `absolute z-10 flex items-center gap-1 ${position}`, "aria-hidden": "true", children: [groupIcon && renderOne(groupIcon, "group"), sublistingIcon && renderOne(sublistingIcon, "sublisting")] }));
|
|
77
77
|
}
|
|
@@ -16,7 +16,7 @@ export interface CardProps extends SurfaceProps {
|
|
|
16
16
|
style?: React.CSSProperties;
|
|
17
17
|
onClick?: React.MouseEventHandler<HTMLDivElement>;
|
|
18
18
|
}
|
|
19
|
-
export declare function Card({ children, variant, padding, spacing, hover, animate, surface, rounded, border, shadow, className, style, onClick, }: CardProps): React.JSX.Element;
|
|
19
|
+
export declare function Card({ children, variant, padding, spacing, hover, animate, surface, paddingX, paddingY, rounded, roundedTop, roundedBottom, border, shadow, overflow, className, style, onClick, }: CardProps): React.JSX.Element;
|
|
20
20
|
export interface CardSectionProps {
|
|
21
21
|
children: React.ReactNode;
|
|
22
22
|
className?: string;
|
|
@@ -42,7 +42,7 @@ const CARD_SPACING_MAP = {
|
|
|
42
42
|
lg: "space-y-6",
|
|
43
43
|
xl: "space-y-8",
|
|
44
44
|
};
|
|
45
|
-
export function Card({ children, variant = "flat", padding = "md", spacing, hover = false, animate, surface, rounded, border, shadow, className = "", style, onClick, }) {
|
|
45
|
+
export function Card({ children, variant = "flat", padding = "md", spacing, hover = false, animate, surface, paddingX, paddingY, rounded, roundedTop, roundedBottom, border, shadow, overflow, className = "", style, onClick, }) {
|
|
46
46
|
const reduced = useReducedMotion();
|
|
47
47
|
const cls = [
|
|
48
48
|
UI_CARD.base,
|
|
@@ -51,7 +51,7 @@ export function Card({ children, variant = "flat", padding = "md", spacing, hove
|
|
|
51
51
|
spacing ? CARD_SPACING_MAP[spacing] : "",
|
|
52
52
|
hover ? "appkit-card--hoverable" : "",
|
|
53
53
|
onClick ? "appkit-card--clickable" : "",
|
|
54
|
-
buildSurfaceClasses({ surface, rounded, border, shadow }),
|
|
54
|
+
buildSurfaceClasses({ surface, paddingX, paddingY, rounded, roundedTop, roundedBottom, border, shadow, overflow }),
|
|
55
55
|
className,
|
|
56
56
|
]
|
|
57
57
|
.filter(Boolean)
|
|
@@ -83,8 +83,8 @@ const DIV_LG_ALIGN_MAP = {
|
|
|
83
83
|
baseline: "lg:items-baseline",
|
|
84
84
|
stretch: "lg:items-stretch",
|
|
85
85
|
};
|
|
86
|
-
export const Div = React.forwardRef(({ className = "", surface, padding, paddingX, paddingY, rounded, border, shadow, color, textSize, textWeight, layout, gap, align, lgAlign, justify, overflow, children, ...props }, ref) => (_jsx("div", { ref: ref, className: [
|
|
87
|
-
buildSurfaceClasses({ surface, padding, paddingX, paddingY, rounded, border, shadow }),
|
|
86
|
+
export const Div = React.forwardRef(({ className = "", surface, padding, paddingX, paddingY, rounded, roundedTop, roundedBottom, border, shadow, color, textSize, textWeight, layout, gap, align, lgAlign, justify, overflow, children, ...props }, ref) => (_jsx("div", { ref: ref, className: [
|
|
87
|
+
buildSurfaceClasses({ surface, padding, paddingX, paddingY, rounded, roundedTop, roundedBottom, border, shadow }),
|
|
88
88
|
color ? DIV_COLOR_MAP[color] : "",
|
|
89
89
|
textSize ? DIV_TEXT_SIZE_MAP[textSize] : "",
|
|
90
90
|
textWeight ? DIV_TEXT_WEIGHT_MAP[textWeight] : "",
|
|
@@ -25,7 +25,7 @@ export interface FormProps extends Omit<React.FormHTMLAttributes<HTMLFormElement
|
|
|
25
25
|
gap?: GapToken;
|
|
26
26
|
}
|
|
27
27
|
export type GapToken = "none" | "xs" | "sm" | "md" | "lg" | "xl";
|
|
28
|
-
export declare function Form({ children, spacing, schema, align, gap, surface, padding, paddingX, paddingY, rounded, border, shadow, overflow, className, ...props }: FormProps): React.JSX.Element;
|
|
28
|
+
export declare function Form({ children, spacing, schema, align, gap, surface, padding, paddingX, paddingY, rounded, roundedTop, roundedBottom, border, shadow, overflow, className, ...props }: FormProps): React.JSX.Element;
|
|
29
29
|
export interface FormGroupProps {
|
|
30
30
|
children: React.ReactNode;
|
|
31
31
|
columns?: 1 | 2 | 3 | 4;
|
|
@@ -43,7 +43,7 @@ const FORM_ALIGN_MAP = {
|
|
|
43
43
|
end: "items-end",
|
|
44
44
|
stretch: "items-stretch",
|
|
45
45
|
};
|
|
46
|
-
export function Form({ children, spacing, schema, align, gap, surface, padding, paddingX, paddingY, rounded, border, shadow, overflow, className = "", ...props }) {
|
|
46
|
+
export function Form({ children, spacing, schema, align, gap, surface, padding, paddingX, paddingY, rounded, roundedTop, roundedBottom, border, shadow, overflow, className = "", ...props }) {
|
|
47
47
|
const helpers = useFormShellState(schema);
|
|
48
48
|
const content = typeof children === "function"
|
|
49
49
|
? children(helpers)
|
|
@@ -53,7 +53,7 @@ export function Form({ children, spacing, schema, align, gap, surface, padding,
|
|
|
53
53
|
spacing ? FORM_SPACING_MAP[spacing] : "",
|
|
54
54
|
align ? FORM_ALIGN_MAP[align] : "",
|
|
55
55
|
gap ? GAP_MAP[gap] : "",
|
|
56
|
-
buildSurfaceClasses({ surface, padding, paddingX, paddingY, rounded, border, shadow, overflow }),
|
|
56
|
+
buildSurfaceClasses({ surface, padding, paddingX, paddingY, rounded, roundedTop, roundedBottom, border, shadow, overflow }),
|
|
57
57
|
className,
|
|
58
58
|
].filter(Boolean).join(" "), ...props, children: content }) }));
|
|
59
59
|
}
|
|
@@ -33,7 +33,7 @@ export function ListingToolbar({ filterCount = 0, onFiltersClick, searchValue =
|
|
|
33
33
|
}
|
|
34
34
|
};
|
|
35
35
|
const allSelected = bulkTotalCount > 0 && bulkSelectedCount === bulkTotalCount;
|
|
36
|
-
return (_jsx("div", { "data-testid": "listing-toolbar", className: `sticky top-[var(--header-height,0px)] z-20 border-b border-[var(--appkit-color-border)] bg-
|
|
36
|
+
return (_jsx("div", { "data-testid": "listing-toolbar", className: `sticky top-[var(--header-height,0px)] z-20 border-b border-[var(--appkit-color-border)] bg-[var(--appkit-color-surface)]/95 backdrop-blur-sm py-2 px-3 sm:py-2.5 sm:px-4 ${className}`, children: _jsxs("div", { className: "flex flex-col sm:flex-row sm:items-center gap-2 sm:gap-2.5", children: [bulkMode ? (_jsxs("div", { className: "flex flex-1 items-center gap-2", children: [_jsxs("button", { type: "button", onClick: onBulkSelectAll, className: "flex items-center gap-1.5 rounded-lg border border-[var(--appkit-color-border)] px-3 py-1.5 text-sm font-medium text-[var(--appkit-color-text-muted)] hover:bg-zinc-50 hover:bg-[var(--appkit-color-surface-elevated)] transition-colors", children: [allSelected
|
|
37
37
|
? _jsx(CheckSquare, { className: "h-4 w-4 text-[var(--appkit-color-primary)]" })
|
|
38
38
|
: _jsx(Square, { className: "h-4 w-4" }), allSelected ? l.deselectAll : l.selectAll(bulkTotalCount)] }), _jsx(Span, { size: "sm", color: "muted", children: l.selected(bulkSelectedCount) }), _jsx("button", { type: "button", onClick: onBulkClear, className: CLS_CLEAR_LINK, children: l.clearSelection })] })) : onSearchChange ? (_jsxs("div", { className: "flex flex-1 items-center overflow-hidden rounded-lg border border-[var(--appkit-color-border)] bg-[var(--appkit-color-surface)] min-w-0", children: [_jsx("input", { type: "text", value: searchValue, onChange: (e) => onSearchChange(e.target.value), onKeyDown: handleKeyDown, placeholder: searchPlaceholder, className: "min-w-0 flex-1 bg-transparent px-3 py-2 text-sm text-[var(--appkit-color-text)] placeholder-zinc-400 outline-none" }), _jsx("button", { type: "button", onClick: onSearchCommit, className: "flex shrink-0 items-center justify-center px-2.5 py-2 text-zinc-400 hover:text-[var(--appkit-color-primary)] transition-colors", "aria-label": l.search, children: _jsx(Search, { className: "h-4 w-4" }) })] })) : null, _jsxs("div", { className: "flex items-center gap-1.5 sm:gap-2 shrink-0", children: [onFiltersClick && (_jsxs("button", { type: "button", onClick: onFiltersClick, className: "relative flex shrink-0 items-center gap-1.5 rounded-lg border border-[var(--appkit-color-border)] px-2.5 py-1.5 sm:px-3.5 sm:py-2 text-sm font-medium text-[var(--appkit-color-text-muted)] hover:bg-zinc-50 hover:bg-[var(--appkit-color-surface-elevated)] transition-colors", children: [_jsx(SlidersHorizontal, { className: "h-4 w-4" }), _jsx("span", { className: "hidden sm:inline", children: l.filters }), filterCount > 0 && (_jsx(Span, { weight: "bold", className: "absolute -top-1.5 -right-1.5 flex h-4 w-4 items-center justify-center rounded-full bg-[var(--appkit-color-primary)] text-[10px] text-white", children: filterCount }))] })), sortOptions && sortValue !== undefined && onSortChange && (_jsxs(Div, { className: "flex items-center gap-1.5 text-[var(--appkit-color-text-muted)]", children: [_jsx(Span, { size: "xs", className: "hidden md:inline whitespace-nowrap", children: l.sort }), _jsx(SortDropdown, { value: sortValue, onChange: onSortChange, options: sortOptions })] })), !hideViewToggle && onViewChange && (_jsxs("div", { className: "flex items-center rounded-lg border border-[var(--appkit-color-border)] overflow-hidden", children: [_jsx("button", { type: "button", onClick: () => onViewChange("grid"), "aria-label": l.gridView, className: `${VIEW_BTN_BASE} ${view === "grid" ? VIEW_BTN_ACTIVE : VIEW_BTN_INACTIVE}`, children: _jsx(LayoutGrid, { className: "h-4 w-4" }) }), _jsx("button", { type: "button", onClick: () => onViewChange("list"), "aria-label": l.listView, className: `${VIEW_BTN_BASE} ${view === "list" ? VIEW_BTN_ACTIVE : VIEW_BTN_INACTIVE}`, children: _jsx(List, { className: "h-4 w-4" }) }), showTableView && (_jsx("button", { type: "button", onClick: () => onViewChange("table"), "aria-label": l.tableView, className: `${VIEW_BTN_BASE} ${view === "table" ? VIEW_BTN_ACTIVE : VIEW_BTN_INACTIVE}`, children: _jsx(Table2, { className: "h-4 w-4" }) }))] })), onResetAll && hasActiveState && (_jsx("button", { type: "button", onClick: onResetAll, "aria-label": l.resetAll, title: l.resetAll, className: CLS_CLEAR_ICON_BTN, children: _jsx(RotateCcw, { className: "h-4 w-4" }) })), toggles && toggles.length > 0 && (_jsx("div", { className: "flex items-center gap-1", children: toggles.map((t) => (_jsx("button", { type: "button", role: "switch", "aria-checked": t.active, onClick: () => t.onChange(!t.active), className: `rounded-full border px-2.5 py-1 text-xs font-medium transition-colors whitespace-nowrap ${t.active
|
|
39
39
|
? "border-transparent bg-[var(--appkit-color-primary)] text-white"
|
|
@@ -30,7 +30,11 @@ export function Slider({ value: controlledValue, defaultValue = 0, min = 0, max
|
|
|
30
30
|
].join(" "), "data-section": "slider-div-610", children: _jsx("div", { className: [
|
|
31
31
|
"h-full rounded-full bg-lime-600 dark:bg-pink-500",
|
|
32
32
|
SIZE_CLASSES[size],
|
|
33
|
-
].join(" "), style: { width: `${Math.max(0, Math.min(100, percentage))}%` } }) }), _jsx("input", { id: inputId, type: "range", min: min, max: max, step: step, value: value, disabled: disabled, onChange: handleChange, onMouseUp: handleChangeEnd,
|
|
33
|
+
].join(" "), style: { width: `${Math.max(0, Math.min(100, percentage))}%` } }) }), _jsx("input", { id: inputId, type: "range", min: min, max: max, step: step, value: value, disabled: disabled, onChange: handleChange, onMouseUp: handleChangeEnd,
|
|
34
|
+
// audit-touch-handler-ok: native <input type="range"> owns its own
|
|
35
|
+
// drag/cancel state; no persisted React state here to leak on a
|
|
36
|
+
// cancelled touch, onChangeEnd simply not firing is acceptable.
|
|
37
|
+
onTouchEnd: handleChangeEnd, className: [
|
|
34
38
|
"appkit-slider relative z-10 bg-transparent",
|
|
35
39
|
disabled ? "appkit-slider--disabled" : "cursor-pointer",
|
|
36
40
|
SIZE_CLASSES[size],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mohasinac/appkit",
|
|
3
|
-
"version": "3.5.
|
|
3
|
+
"version": "3.5.7",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -165,13 +165,14 @@
|
|
|
165
165
|
"audit:paginated-select": "node scripts/audit-paginated-select.mjs",
|
|
166
166
|
"audit:sieve-views": "node scripts/audit-sieve-constants-views.mjs",
|
|
167
167
|
"check:types": "tsc -p tsconfig.build.json --noEmit",
|
|
168
|
-
"check:audits": "node scripts/audit-violations.mjs && node scripts/verify-entries.mjs && node scripts/verify-css-build.mjs && node scripts/audit-use-client.mjs && node scripts/audit-double-navigation.mjs && node scripts/audit-repository-fields.mjs && node scripts/audit-query-provider.mjs && node scripts/audit-export-paths.mjs && node scripts/audit-listing-indices.mjs && node scripts/audit-listing-type-reads.mjs && node scripts/audit-create-with-id.mjs && node scripts/audit-css-imports.mjs && node scripts/audit-appkit-reexports.mjs && node scripts/audit-action-confirmation.mjs && node scripts/audit-route-strings.mjs && node scripts/audit-paginated-select.mjs && node scripts/audit-sieve-constants-views.mjs && node scripts/audit-schema-registry-completeness.mjs && node scripts/audit-firestore-schema-coverage.mjs && node scripts/audit-catch-normalize.mjs && node scripts/audit-route-schema-registry.mjs && node scripts/audit-z-any-z-unknown.mjs",
|
|
168
|
+
"check:audits": "node scripts/audit-violations.mjs && node scripts/verify-entries.mjs && node scripts/verify-css-build.mjs && node scripts/audit-use-client.mjs && node scripts/audit-double-navigation.mjs && node scripts/audit-repository-fields.mjs && node scripts/audit-query-provider.mjs && node scripts/audit-export-paths.mjs && node scripts/audit-listing-indices.mjs && node scripts/audit-listing-type-reads.mjs && node scripts/audit-create-with-id.mjs && node scripts/audit-css-imports.mjs && node scripts/audit-appkit-reexports.mjs && node scripts/audit-action-confirmation.mjs && node scripts/audit-route-strings.mjs && node scripts/audit-paginated-select.mjs && node scripts/audit-sieve-constants-views.mjs && node scripts/audit-schema-registry-completeness.mjs && node scripts/audit-firestore-schema-coverage.mjs && node scripts/audit-catch-normalize.mjs && node scripts/audit-route-schema-registry.mjs && node scripts/audit-z-any-z-unknown.mjs && node scripts/audit-dynamic-tailwind-arbitrary.mjs && node scripts/audit-surface-props-completeness.mjs && node scripts/audit-touch-handler-completeness.mjs && node scripts/audit-field-primitive-contract.mjs && node scripts/audit-innerhtml-sanitization.mjs",
|
|
169
169
|
"test": "vitest run --passWithNoTests",
|
|
170
170
|
"test:watch": "vitest",
|
|
171
171
|
"check": "npm run check:types && npm run check:audits"
|
|
172
172
|
},
|
|
173
173
|
"dependencies": {
|
|
174
174
|
"@mohasinac/sievejs": "^1.0.0",
|
|
175
|
+
"driver.js": "^1.8.0",
|
|
175
176
|
"jsbarcode": "^3.12.3",
|
|
176
177
|
"motion": "^12.40.0",
|
|
177
178
|
"react-advanced-cropper": "^0.20.1",
|