@mohasinac/appkit 3.3.5 → 3.3.6
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/features/about/components/AboutView.js +1 -1
- package/dist/features/about/components/TrackOrderView.js +1 -1
- package/dist/features/account/components/AddressesIndexListing.js +1 -1
- package/dist/features/admin/components/AdminBlogEditorView.js +1 -1
- package/dist/features/admin/components/AdminProductsView.js +2 -2
- package/dist/features/admin/components/AdminSiteSettingsView.js +1 -1
- package/dist/features/auctions/components/AuctionBidsTable.js +1 -1
- package/dist/features/cart/components/CartDrawer.js +1 -1
- package/dist/features/events/components/EventLeaderboard.js +1 -1
- package/dist/features/forms/Slider.js +1 -1
- package/dist/features/homepage/components/AdSlot.js +1 -1
- package/dist/features/homepage/components/BeforeAfterCard.js +1 -1
- package/dist/features/homepage/components/HowItWorksInfoView.js +1 -1
- package/dist/features/homepage/components/SiteFeaturesSection.js +1 -1
- package/dist/features/homepage/components/TrustIndicatorsSection.js +1 -1
- package/dist/features/orders/components/MarketplaceOrderCard.js +7 -4
- package/dist/features/products/components/BidHistory.js +1 -1
- package/dist/features/products/components/ProductGalleryClient.js +1 -1
- package/dist/features/products/components/ShowGroupSection.js +1 -1
- package/dist/features/products/components/SublistingCarouselSection.js +1 -1
- package/dist/features/scams/components/ScamAwarenessModal.js +1 -1
- package/dist/features/search/components/Search.js +1 -1
- package/dist/features/seller/components/SellerGoogleReviewsView.js +1 -1
- package/dist/features/seller/components/SellerPayoutMethodsView.js +1 -1
- package/dist/features/shell/QuickFormDrawer.js +1 -1
- package/dist/next/ErrorBoundary.js +2 -2
- package/dist/styles.css +1 -1
- package/dist/tailwind-utilities.css +1 -1
- package/dist/ui/components/Anchor.d.ts +9 -2
- package/dist/ui/components/Anchor.js +17 -2
- package/dist/ui/components/Div.d.ts +1 -1
- package/dist/ui/components/Div.js +2 -0
- package/dist/ui/components/Typography.d.ts +1 -1
- package/dist/ui/components/Typography.js +1 -0
- package/dist/ui/components/surface-tokens.d.ts +1 -1
- package/dist/ui/components/surface-tokens.js +4 -0
- package/package.json +1 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { AnchorHTMLAttributes, ReactNode } from "react";
|
|
2
|
-
import { type RoundedKey, type ShadowKey } from "./surface-tokens";
|
|
2
|
+
import { type PaddingKey, type RoundedKey, type ShadowKey } from "./surface-tokens";
|
|
3
|
+
export type AnchorGap = "none" | "2xs" | "xs" | "sm" | "md" | "lg";
|
|
3
4
|
/**
|
|
4
5
|
* Anchor — primitive for **external** links, `mailto:`, and `tel:` URLs.
|
|
5
6
|
*
|
|
@@ -37,6 +38,12 @@ export interface AnchorProps extends AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
|
37
38
|
shadow?: ShadowKey;
|
|
38
39
|
/** Display layout. `"inline-flex"` and `"flex"` include `items-center` automatically. */
|
|
39
40
|
layout?: "inline-flex" | "flex";
|
|
41
|
+
/** Padding — for card/banner-style anchors. Replaces consumer `p*-*` className. */
|
|
42
|
+
padding?: PaddingKey;
|
|
43
|
+
/** Gap between flex children — only meaningful with `layout`. Replaces consumer `gap-*` className. */
|
|
44
|
+
gap?: AnchorGap;
|
|
45
|
+
/** Themed hover background — replaces consumer `hover:bg-*` className on card-style anchors. */
|
|
46
|
+
hoverSurface?: "none" | "subtle";
|
|
40
47
|
/**
|
|
41
48
|
* Escape hatch for behaviour-coupled utility classes (layout overrides,
|
|
42
49
|
* state-driven classes like `group`, structural card-link styling).
|
|
@@ -44,4 +51,4 @@ export interface AnchorProps extends AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
|
44
51
|
*/
|
|
45
52
|
className?: string;
|
|
46
53
|
}
|
|
47
|
-
export declare function Anchor({ href, children, tone, underline, size, rounded, shadow, layout, external, rel, target, className, ...rest }: AnchorProps): import("react").JSX.Element;
|
|
54
|
+
export declare function Anchor({ href, children, tone, underline, size, rounded, shadow, layout, padding, gap, hoverSurface, external, rel, target, className, ...rest }: AnchorProps): import("react").JSX.Element;
|
|
@@ -1,11 +1,23 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { ROUNDED_MAP, SHADOW_MAP } from "./surface-tokens";
|
|
2
|
+
import { PADDING_MAP, ROUNDED_MAP, SHADOW_MAP } from "./surface-tokens";
|
|
3
|
+
const ANCHOR_GAP_CLS = {
|
|
4
|
+
none: "",
|
|
5
|
+
"2xs": "gap-0.5",
|
|
6
|
+
xs: "gap-1",
|
|
7
|
+
sm: "gap-1.5",
|
|
8
|
+
md: "gap-2",
|
|
9
|
+
lg: "gap-3",
|
|
10
|
+
};
|
|
3
11
|
const ANCHOR_SIZE_CLS = {
|
|
4
12
|
xs: "text-xs",
|
|
5
13
|
sm: "text-sm",
|
|
6
14
|
base: "text-base",
|
|
7
15
|
lg: "text-lg",
|
|
8
16
|
};
|
|
17
|
+
const ANCHOR_HOVER_SURFACE_CLS = {
|
|
18
|
+
none: "",
|
|
19
|
+
subtle: "hover:bg-[var(--appkit-color-border-subtle)]",
|
|
20
|
+
};
|
|
9
21
|
const TONE_CLS = {
|
|
10
22
|
default: "text-[var(--appkit-color-text)]",
|
|
11
23
|
muted: "text-[var(--appkit-color-text-muted)]",
|
|
@@ -31,7 +43,7 @@ const ANCHOR_LAYOUT_CLS = {
|
|
|
31
43
|
"inline-flex": "inline-flex items-center",
|
|
32
44
|
flex: "flex items-center",
|
|
33
45
|
};
|
|
34
|
-
export function Anchor({ href, children, tone = "brand", underline = "hover", size, rounded, shadow, layout, external, rel, target, className, ...rest }) {
|
|
46
|
+
export function Anchor({ href, children, tone = "brand", underline = "hover", size, rounded, shadow, layout, padding, gap, hoverSurface, external, rel, target, className, ...rest }) {
|
|
35
47
|
const resolvedExternal = external ?? isExternalShape(href);
|
|
36
48
|
const isHttp = isHttpProtocol(href);
|
|
37
49
|
const computedTarget = target ?? (resolvedExternal && isHttp ? "_blank" : undefined);
|
|
@@ -47,6 +59,9 @@ export function Anchor({ href, children, tone = "brand", underline = "hover", si
|
|
|
47
59
|
rounded ? ROUNDED_MAP[rounded] : "",
|
|
48
60
|
shadow ? SHADOW_MAP[shadow] : "",
|
|
49
61
|
layout ? ANCHOR_LAYOUT_CLS[layout] : "",
|
|
62
|
+
padding ? PADDING_MAP[padding] : "",
|
|
63
|
+
gap ? ANCHOR_GAP_CLS[gap] : "",
|
|
64
|
+
hoverSurface ? ANCHOR_HOVER_SURFACE_CLS[hoverSurface] : "",
|
|
50
65
|
"transition-colors",
|
|
51
66
|
className ?? "",
|
|
52
67
|
].filter(Boolean).join(" "), ...rest, children: children }));
|
|
@@ -3,7 +3,7 @@ import type { SurfaceProps } from "./surface-tokens";
|
|
|
3
3
|
type DivColor = "default" | "primary" | "muted" | "faint" | "success" | "warning" | "error" | "info" | "inverse";
|
|
4
4
|
type DivTextSize = "xs" | "sm" | "base" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl";
|
|
5
5
|
type DivTextWeight = "normal" | "medium" | "semibold" | "bold";
|
|
6
|
-
type DivLayout = "block" | "flex" | "inline-flex" | "grid" | "inline-block" | "inline";
|
|
6
|
+
type DivLayout = "block" | "flex" | "flex-col" | "inline-flex" | "grid" | "inline-block" | "inline";
|
|
7
7
|
type DivGap = "none" | "1" | "2" | "3" | "4" | "5" | "6" | "8";
|
|
8
8
|
type DivAlign = "start" | "center" | "end" | "baseline" | "stretch";
|
|
9
9
|
type DivJustify = "start" | "center" | "end" | "between" | "around" | "evenly";
|
|
@@ -34,6 +34,8 @@ const DIV_TEXT_WEIGHT_MAP = {
|
|
|
34
34
|
const DIV_LAYOUT_MAP = {
|
|
35
35
|
block: "block",
|
|
36
36
|
flex: "flex",
|
|
37
|
+
/** `flex flex-col` — for one-off Divs that need a ref Stack can't forward. */
|
|
38
|
+
"flex-col": "flex flex-col",
|
|
37
39
|
"inline-flex": "inline-flex",
|
|
38
40
|
grid: "grid",
|
|
39
41
|
"inline-block": "inline-block",
|
|
@@ -175,7 +175,7 @@ export declare function Caption({ variant, color, weight, className, children, .
|
|
|
175
175
|
/** Inline-decorations allowed on Span (pill chips, code-like wraps, etc). */
|
|
176
176
|
type SpanRounded = "none" | "default" | "sm" | "md" | "lg" | "xl" | "2xl" | "full";
|
|
177
177
|
type SpanBorder = "none" | "default" | "subtle" | "strong";
|
|
178
|
-
type SpanPadding = "none" | "2xs" | "x-xs" | "x-sm" | "x-md" | "y-2xs" | "y-xs" | "y-sm" | "inline-sm" | "inline" | "pill-2xs" | "pill-xs" | "pill-sm" | "pill-sm-tall" | "pill-md" | "pill-lg";
|
|
178
|
+
type SpanPadding = "none" | "1" | "2xs" | "x-xs" | "x-sm" | "x-md" | "y-2xs" | "y-xs" | "y-sm" | "inline-sm" | "inline" | "pill-2xs" | "pill-xs" | "pill-sm" | "pill-sm-tall" | "pill-md" | "pill-lg";
|
|
179
179
|
type SpanBg = "none" | "muted" | "subtle" | "default" | "success-surface" | "danger-surface" | "warning-surface" | "info-surface" | "overlay-xs" | "overlay-sm" | "overlay-md" | "overlay-lg" | "overlay-xl";
|
|
180
180
|
type SpanLayout = "inline" | "inline-flex" | "flex" | "inline-flex-center" | "flex-center" | "inline-block" | "block";
|
|
181
181
|
type SpanGap = "none" | "2xs" | "xs" | "sm" | "md" | "lg";
|
|
@@ -216,7 +216,7 @@ export declare const PADDING_PRESETS: {
|
|
|
216
216
|
readonly "content-banner": "py-10 md:py-12 lg:py-16";
|
|
217
217
|
};
|
|
218
218
|
export type PaddingPresetKey = PaddingKey;
|
|
219
|
-
export type XPaddingKey = "none" | "x-xs" | "x-sm" | "x-md" | "x-5" | "x-lg" | "x-xl" | "x-sm-md" | "x-sm-lg-md" | "x-md-lg" | "x-md-xl" | "x-md-2xl" | "x-page";
|
|
219
|
+
export type XPaddingKey = "none" | "x-xs" | "x-sm" | "x-md" | "x-5" | "x-lg" | "x-xl" | "x-sm-md" | "x-sm-lg-md" | "x-md-lg" | "x-md-xl" | "x-md-2xl" | "x-page" | "l-xl";
|
|
220
220
|
type YPaddingKey = "none" | "y-2xs" | "y-2xs-tall" | "y-xs" | "y-xs-tall" | "y-sm" | "y-sm-tall" | "y-md" | "y-md-lg" | "y-lg" | "y-xl" | "y-2xl" | "y-3xl" | "y-4xl" | "y-5xl" | "y-6xl" | "y-2-5xl" | "t-2xs" | "b-2xs" | "t-xs" | "b-xs" | "t-sm" | "b-sm" | "t-md" | "b-md" | "b-md-lg" | "b-lg" | "t-md-b-lg";
|
|
221
221
|
export declare const X_ONLY_MAP: Record<XPaddingKey, string>;
|
|
222
222
|
export type OverflowKey = "auto" | "hidden" | "scroll" | "visible" | "x-auto" | "x-hidden" | "y-auto" | "y-hidden";
|
|
@@ -210,6 +210,10 @@ export const X_ONLY_MAP = {
|
|
|
210
210
|
"x-md-2xl": "px-4 sm:px-8",
|
|
211
211
|
/** Responsive: `px-4 sm:px-6 lg:px-8` — canonical page-container horizontal padding. */
|
|
212
212
|
"x-page": "px-4 sm:px-6 lg:px-8",
|
|
213
|
+
// Asymmetric left one-sided value (for sites that pad just one edge, e.g. a
|
|
214
|
+
// selection-checkbox gutter).
|
|
215
|
+
/** Asymmetric: `pl-8` — reserves a left gutter (e.g. for an overlaid selection checkbox). */
|
|
216
|
+
"l-xl": "pl-8",
|
|
213
217
|
};
|
|
214
218
|
const Y_ONLY_MAP = {
|
|
215
219
|
none: "",
|