@mohasinac/appkit 3.2.4 → 3.2.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/_internal/client/features/layout/SidebarCollapseToggle.js +1 -1
- package/dist/_internal/client/features/lottery/LotteryAdminEditView.js +3 -3
- package/dist/_internal/server/features/homepage/data.d.ts +2 -2
- package/dist/_internal/server/features/homepage/data.js +34 -3
- package/dist/_internal/server/features/products/data.d.ts +2 -1
- package/dist/_internal/server/jobs/core/countersReconcile.js +2 -1
- package/dist/_internal/shared/features/products/types.d.ts +3 -2
- package/dist/client.d.ts +2 -0
- package/dist/client.js +1 -0
- package/dist/constants/field-names.d.ts +2 -0
- package/dist/constants/field-names.js +2 -0
- package/dist/features/account/components/UserOffersPanel.js +0 -1
- package/dist/features/admin/components/AdminCarouselEditorView.js +1 -4
- package/dist/features/admin/components/AdminFulfillmentView.js +2 -3
- package/dist/features/admin/components/AdminOrderEditorView.js +1 -3
- package/dist/features/admin/components/AdminSiteSettingsView.js +2 -2
- package/dist/features/admin/schemas/firestore.d.ts +3 -5
- package/dist/features/admin/types/product.types.d.ts +2 -1
- package/dist/features/auth/schemas/firestore.d.ts +8 -10
- package/dist/features/categories/components/CategoryBundlesListing.js +1 -3
- package/dist/features/checkout/schemas/firestore.d.ts +4 -4
- package/dist/features/copilot/components/AdminCopilotView.js +4 -4
- package/dist/features/events/schemas/firestore.d.ts +2 -2
- package/dist/features/grouped/schemas/firestore.d.ts +2 -4
- package/dist/features/history/hooks/useHistory.js +3 -2
- package/dist/features/homepage/actions/homepage-section-actions.d.ts +6 -6
- package/dist/features/homepage/actions/homepage-section-actions.js +2 -2
- package/dist/features/homepage/components/PromoGrid.js +1 -1
- package/dist/features/homepage/schemas/firestore.d.ts +15 -14
- package/dist/features/layout/AppLayoutShell.js +3 -18
- package/dist/features/layout/background-seed-defaults.d.ts +19 -0
- package/dist/features/layout/background-seed-defaults.js +14 -0
- package/dist/features/lottery/schemas/firestore.d.ts +2 -2
- package/dist/features/messages/hooks/useConversation.js +5 -13
- package/dist/features/messages/hooks/useConversations.js +0 -1
- package/dist/features/messages/schemas/firestore.d.ts +2 -2
- package/dist/features/orders/components/RefundHistoryTable.js +1 -3
- package/dist/features/orders/schemas/firestore.d.ts +2 -1
- package/dist/features/orders/schemas/index.d.ts +7 -3
- package/dist/features/orders/schemas/index.js +1 -1
- package/dist/features/products/actions/product-actions.d.ts +2 -1
- package/dist/features/products/api/[id]/route.js +1 -1
- package/dist/features/products/api/route.js +1 -1
- package/dist/features/products/components/CompareOverlay.d.ts +18 -1
- package/dist/features/products/components/CompareOverlay.js +0 -16
- package/dist/features/products/components/ProductDetailActions.js +2 -1
- package/dist/features/products/components/ShowGroupSection.js +1 -3
- package/dist/features/products/repository/product-features.repository.js +1 -1
- package/dist/features/products/schemas/firestore.d.ts +3 -6
- package/dist/features/promotions/actions/coupon-actions.d.ts +2 -1
- package/dist/features/promotions/hooks/useCouponValidate.d.ts +2 -1
- package/dist/features/promotions/repository/coupons.repository.d.ts +2 -1
- package/dist/features/promotions/schemas/firestore.d.ts +4 -4
- package/dist/features/scams/components/ScamRegistryView.js +2 -2
- package/dist/features/scams/schemas/firestore.d.ts +6 -6
- package/dist/features/search/types/index.d.ts +3 -2
- package/dist/features/search/types/index.js +0 -1
- package/dist/features/seller/components/FulfillmentView.js +2 -3
- package/dist/features/seller/components/PrintCenterView.js +1 -3
- package/dist/features/seller/components/SellerAddressesView.js +0 -1
- package/dist/features/seller/components/SellerOffersPanel.js +0 -1
- package/dist/features/seller/components/SellerReviewsView.js +0 -1
- package/dist/features/seller/schemas/firestore.d.ts +2 -4
- package/dist/features/server-errors/schemas/firestore.d.ts +2 -2
- package/dist/features/store-extensions/schemas/firestore.d.ts +2 -2
- package/dist/features/stores/components/StoreScopedSearch.js +2 -4
- package/dist/features/stores/repository/store.repository.js +3 -1
- package/dist/features/stores/types/index.d.ts +2 -1
- package/dist/features/stores/types/index.js +0 -1
- package/dist/features/support/schemas/firestore.d.ts +2 -2
- package/dist/features/wishlist/types/index.d.ts +2 -1
- package/dist/providers/auth-firebase/provider.js +3 -1
- package/dist/providers/auth-firebase/session.js +3 -1
- package/dist/seo/json-ld.d.ts +2 -1
- package/dist/styles.css +1 -1
- package/dist/tailwind-utilities.css +1 -1
- package/dist/ui/components/Form.d.ts +3 -1
- package/dist/ui/components/Form.js +2 -1
- package/dist/ui/components/Radio.d.ts +7 -0
- package/dist/ui/components/Radio.js +7 -0
- package/dist/ui/components/surface-tokens.d.ts +4 -0
- package/dist/ui/components/surface-tokens.js +24 -0
- package/dist/ui/index.d.ts +2 -2
- package/dist/ui/index.js +1 -1
- package/dist/ui/rich-text/RichText.js +0 -1
- package/package.json +5 -1
|
@@ -21,9 +21,11 @@ export interface FormProps extends Omit<React.FormHTMLAttributes<HTMLFormElement
|
|
|
21
21
|
schema?: ZodTypeAny;
|
|
22
22
|
/** Cross-axis alignment of flex/grid children. Replaces raw `items-*` className. */
|
|
23
23
|
align?: "start" | "center" | "end" | "stretch";
|
|
24
|
+
/** Gap between children — use instead of raw `gap-*` className. */
|
|
25
|
+
gap?: GapToken;
|
|
24
26
|
}
|
|
25
27
|
export type GapToken = "none" | "xs" | "sm" | "md" | "lg" | "xl";
|
|
26
|
-
export declare function Form({ children, spacing, schema, align, surface, padding, rounded, border, shadow, className, ...props }: FormProps): import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
export declare function Form({ children, spacing, schema, align, gap, surface, padding, rounded, border, shadow, className, ...props }: FormProps): import("react/jsx-runtime").JSX.Element;
|
|
27
29
|
export interface FormGroupProps {
|
|
28
30
|
children: React.ReactNode;
|
|
29
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, surface, padding, rounded, border, shadow, className = "", ...props }) {
|
|
46
|
+
export function Form({ children, spacing, schema, align, gap, surface, padding, rounded, border, shadow, className = "", ...props }) {
|
|
47
47
|
const helpers = useFormShellState(schema);
|
|
48
48
|
const content = typeof children === "function"
|
|
49
49
|
? children(helpers)
|
|
@@ -52,6 +52,7 @@ export function Form({ children, spacing, schema, align, surface, padding, round
|
|
|
52
52
|
"appkit-form",
|
|
53
53
|
spacing ? FORM_SPACING_MAP[spacing] : "",
|
|
54
54
|
align ? FORM_ALIGN_MAP[align] : "",
|
|
55
|
+
gap ? GAP_MAP[gap] : "",
|
|
55
56
|
buildSurfaceClasses({ surface, padding, rounded, border, shadow }),
|
|
56
57
|
className,
|
|
57
58
|
].filter(Boolean).join(" "), ...props, children: content }) }));
|
|
@@ -16,3 +16,10 @@ export interface RadioGroupProps {
|
|
|
16
16
|
required?: boolean;
|
|
17
17
|
}
|
|
18
18
|
export declare function RadioGroup({ name, options, value, onChange, label, error, orientation, variant, required, }: RadioGroupProps): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
/** Standalone single radio button — mirrors the `Checkbox` API. Use `RadioGroup` when all options are known upfront. */
|
|
20
|
+
export interface RadioItemProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "type"> {
|
|
21
|
+
label?: React.ReactNode;
|
|
22
|
+
suffix?: React.ReactNode;
|
|
23
|
+
error?: React.ReactNode;
|
|
24
|
+
}
|
|
25
|
+
export declare function RadioItem({ label, suffix, error, className, checked, disabled, id, ...props }: RadioItemProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import React from "react";
|
|
2
4
|
import { Label, Span, Text } from "./Typography";
|
|
3
5
|
const UI_RADIO = {
|
|
4
6
|
group: "appkit-radio-group",
|
|
@@ -61,3 +63,8 @@ export function RadioGroup({ name, options, value, onChange, label, error, orien
|
|
|
61
63
|
].join(" "), children: _jsx("span", { className: selected ? UI_RADIO.toggle.dotInner : "hidden" }) }), _jsx(Span, { children: option.label })] })] }, option.value));
|
|
62
64
|
}) }), error && (_jsx(Text, { size: "sm", variant: "error", className: "mt-1.5", role: "alert", children: error }))] }));
|
|
63
65
|
}
|
|
66
|
+
export function RadioItem({ label, suffix, error, className = "", checked, disabled, id, ...props }) {
|
|
67
|
+
const generatedId = React.useId();
|
|
68
|
+
const inputId = id ?? generatedId;
|
|
69
|
+
return (_jsxs("div", { className: "appkit-radio-item", "data-section": "radio-item-div", children: [_jsxs(Label, { htmlFor: inputId, className: ["appkit-radio-item__label", disabled ? "appkit-radio-item__label--disabled" : ""].filter(Boolean).join(" "), children: [_jsx("span", { className: "appkit-radio-item__box-wrap", children: _jsx("input", { ...props, id: inputId, type: "radio", checked: checked, disabled: disabled, "aria-invalid": error ? "true" : undefined, className: ["appkit-radio-item__input", error ? "appkit-radio-item__input--error" : "", className].filter(Boolean).join(" ") }) }), (label || suffix) && (_jsxs("span", { className: "appkit-radio-item__content", children: [label ? _jsx(Span, { className: "appkit-radio-item__text", children: label }) : _jsx("span", {}), suffix] }))] }), error && (_jsx(Text, { size: "sm", variant: "error", className: "appkit-radio-item__error", role: "alert", children: error }))] }));
|
|
70
|
+
}
|
|
@@ -228,6 +228,10 @@ export interface SurfaceProps {
|
|
|
228
228
|
/** Independent vertical padding. Use with `paddingX` when you need different x/y padding without authoring raw className. */
|
|
229
229
|
paddingY?: YPaddingKey;
|
|
230
230
|
rounded?: RoundedKey;
|
|
231
|
+
/** Round only the top two corners — replaces raw `rounded-t-*` className on primitives. */
|
|
232
|
+
roundedTop?: RoundedKey;
|
|
233
|
+
/** Round only the bottom two corners — replaces raw `rounded-b-*` className on primitives. */
|
|
234
|
+
roundedBottom?: RoundedKey;
|
|
231
235
|
border?: BorderKey;
|
|
232
236
|
shadow?: ShadowKey;
|
|
233
237
|
/** Overflow behaviour — replaces consumer `overflow-*` className. */
|
|
@@ -108,6 +108,28 @@ export const ROUNDED_MAP = {
|
|
|
108
108
|
"3xl": "rounded-3xl",
|
|
109
109
|
full: "rounded-full",
|
|
110
110
|
};
|
|
111
|
+
const ROUNDED_TOP_MAP = {
|
|
112
|
+
none: "",
|
|
113
|
+
default: "rounded-t",
|
|
114
|
+
sm: "rounded-t-sm",
|
|
115
|
+
md: "rounded-t-md",
|
|
116
|
+
lg: "rounded-t-lg",
|
|
117
|
+
xl: "rounded-t-xl",
|
|
118
|
+
"2xl": "rounded-t-2xl",
|
|
119
|
+
"3xl": "rounded-t-3xl",
|
|
120
|
+
full: "rounded-t-full",
|
|
121
|
+
};
|
|
122
|
+
const ROUNDED_BOTTOM_MAP = {
|
|
123
|
+
none: "",
|
|
124
|
+
default: "rounded-b",
|
|
125
|
+
sm: "rounded-b-sm",
|
|
126
|
+
md: "rounded-b-md",
|
|
127
|
+
lg: "rounded-b-lg",
|
|
128
|
+
xl: "rounded-b-xl",
|
|
129
|
+
"2xl": "rounded-b-2xl",
|
|
130
|
+
"3xl": "rounded-b-3xl",
|
|
131
|
+
full: "rounded-b-full",
|
|
132
|
+
};
|
|
111
133
|
export const BORDER_MAP = {
|
|
112
134
|
none: "",
|
|
113
135
|
default: "border border-zinc-200 dark:border-slate-700",
|
|
@@ -238,6 +260,8 @@ export function buildSurfaceClasses(props) {
|
|
|
238
260
|
props.paddingX ? X_ONLY_MAP[props.paddingX] : "",
|
|
239
261
|
props.paddingY ? Y_ONLY_MAP[props.paddingY] : "",
|
|
240
262
|
props.rounded ? ROUNDED_MAP[props.rounded] : "",
|
|
263
|
+
props.roundedTop ? ROUNDED_TOP_MAP[props.roundedTop] : "",
|
|
264
|
+
props.roundedBottom ? ROUNDED_BOTTOM_MAP[props.roundedBottom] : "",
|
|
241
265
|
props.border ? BORDER_MAP[props.border] : "",
|
|
242
266
|
props.shadow ? SHADOW_MAP[props.shadow] : "",
|
|
243
267
|
props.overflow ? OVERFLOW_MAP[props.overflow] : "",
|
package/dist/ui/index.d.ts
CHANGED
|
@@ -79,8 +79,8 @@ export type { SliderProps } from "./components/Slider";
|
|
|
79
79
|
export { Slider } from "./components/Slider";
|
|
80
80
|
export type { CheckboxProps } from "./components/Checkbox";
|
|
81
81
|
export { Checkbox } from "./components/Checkbox";
|
|
82
|
-
export type { RadioGroupProps, RadioOption } from "./components/Radio";
|
|
83
|
-
export { RadioGroup } from "./components/Radio";
|
|
82
|
+
export type { RadioGroupProps, RadioOption, RadioItemProps } from "./components/Radio";
|
|
83
|
+
export { RadioGroup, RadioItem } from "./components/Radio";
|
|
84
84
|
export type { ToggleProps } from "./components/Toggle";
|
|
85
85
|
export { Toggle } from "./components/Toggle";
|
|
86
86
|
export type { ToastVariant, ToastPosition, ToastProviderProps, } from "./components/Toast";
|
package/dist/ui/index.js
CHANGED
|
@@ -42,7 +42,7 @@ export { DateInput, DateRangeInput } from "./components/DateInput";
|
|
|
42
42
|
export { Textarea } from "./components/Textarea";
|
|
43
43
|
export { Slider } from "./components/Slider";
|
|
44
44
|
export { Checkbox } from "./components/Checkbox";
|
|
45
|
-
export { RadioGroup } from "./components/Radio";
|
|
45
|
+
export { RadioGroup, RadioItem } from "./components/Radio";
|
|
46
46
|
export { Toggle } from "./components/Toggle";
|
|
47
47
|
export { ToastProvider, useToast } from "./components/Toast";
|
|
48
48
|
export { StarRating } from "./components/StarRating";
|
|
@@ -137,7 +137,6 @@ function attachCopyButtons(container) {
|
|
|
137
137
|
btn.style.cssText =
|
|
138
138
|
"position:absolute;top:8px;right:8px;padding:2px 10px;font-size:11px;font-family:inherit;" +
|
|
139
139
|
"border-radius:6px;border:1px solid rgba(148,163,184,.4);background:rgba(30,41,59,.75);" +
|
|
140
|
-
// audit-hex-tokens-ok: copy-button text colour for code blocks (slate-200)
|
|
141
140
|
"color:#e2e8f0;cursor:pointer;line-height:1.6;user-select:none;transition:background .15s;";
|
|
142
141
|
btn.addEventListener("click", () => {
|
|
143
142
|
const code = pre.querySelector("code")?.textContent ?? pre.textContent ?? "";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mohasinac/appkit",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.6",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -103,6 +103,10 @@
|
|
|
103
103
|
"style": "./dist/tokens/tokens.css",
|
|
104
104
|
"default": "./dist/tokens/tokens.css"
|
|
105
105
|
},
|
|
106
|
+
"./constants": {
|
|
107
|
+
"types": "./dist/constants/index.d.ts",
|
|
108
|
+
"import": "./dist/constants/index.js"
|
|
109
|
+
},
|
|
106
110
|
"./configs": {
|
|
107
111
|
"types": "./dist/configs/index.d.ts",
|
|
108
112
|
"import": "./dist/configs/index.js",
|