@misebako/ui 0.3.2 → 0.4.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.
Files changed (41) hide show
  1. package/README.md +13 -4
  2. package/dist/checkout/cart.d.ts +85 -0
  3. package/dist/checkout/cart.js +42 -0
  4. package/dist/checkout/cart.js.map +1 -0
  5. package/dist/checkout/payment-unlock.d.ts +52 -0
  6. package/dist/checkout/payment-unlock.js +25 -0
  7. package/dist/checkout/payment-unlock.js.map +1 -0
  8. package/dist/checkout/unlock-intent.d.ts +15 -0
  9. package/dist/checkout/unlock-intent.js +68 -0
  10. package/dist/checkout/unlock-intent.js.map +1 -0
  11. package/dist/index.d.ts +11 -1
  12. package/dist/index.js +11 -1
  13. package/dist/index.js.map +1 -1
  14. package/dist/layout/store-chrome.d.ts +54 -0
  15. package/dist/layout/store-chrome.js +32 -0
  16. package/dist/layout/store-chrome.js.map +1 -0
  17. package/dist/orders/order-table.d.ts +31 -0
  18. package/dist/orders/order-table.js +7 -0
  19. package/dist/orders/order-table.js.map +1 -0
  20. package/dist/orders/pending-checkout-table.d.ts +24 -0
  21. package/dist/orders/pending-checkout-table.js +11 -0
  22. package/dist/orders/pending-checkout-table.js.map +1 -0
  23. package/dist/primitives/email-code-sign-in.d.ts +87 -0
  24. package/dist/primitives/email-code-sign-in.js +166 -0
  25. package/dist/primitives/email-code-sign-in.js.map +1 -0
  26. package/dist/primitives/status-page.d.ts +12 -0
  27. package/dist/primitives/status-page.js +9 -0
  28. package/dist/primitives/status-page.js.map +1 -0
  29. package/dist/storefront/catalog.d.ts +125 -0
  30. package/dist/storefront/catalog.js +55 -0
  31. package/dist/storefront/catalog.js.map +1 -0
  32. package/dist/storefront/delivery-note.d.ts +9 -0
  33. package/dist/storefront/delivery-note.js +10 -0
  34. package/dist/storefront/delivery-note.js.map +1 -0
  35. package/dist/storefront/home-hero.js +1 -1
  36. package/dist/storefront/home-hero.js.map +1 -1
  37. package/dist/styles.css +210 -0
  38. package/dist/theme/index.d.ts +12 -4
  39. package/dist/theme/index.js +38 -6
  40. package/dist/theme/index.js.map +1 -1
  41. package/package.json +41 -1
@@ -0,0 +1,24 @@
1
+ import type { ReactNode } from 'react';
2
+ export declare function CheckoutLink({ href, children }: {
3
+ href: string;
4
+ children: ReactNode;
5
+ }): import("react").JSX.Element;
6
+ export interface PendingCheckoutRow {
7
+ id: string;
8
+ title: string;
9
+ description: string;
10
+ amount: string;
11
+ status: string;
12
+ color: string;
13
+ actions: ReactNode;
14
+ }
15
+ export declare function PendingCheckoutTable({ rows, labels }: {
16
+ rows: PendingCheckoutRow[];
17
+ labels: {
18
+ heading: string;
19
+ product: string;
20
+ amount: string;
21
+ status: string;
22
+ actions: string;
23
+ };
24
+ }): import("react").JSX.Element;
@@ -0,0 +1,11 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { Badge, Button, Group, Paper, Table, Text } from '@mantine/core';
4
+ import { ExternalLink } from 'lucide-react';
5
+ export function CheckoutLink({ href, children }) {
6
+ return _jsx(Button, { component: "a", href: href, target: "_blank", rel: "noopener noreferrer", size: "xs", variant: "light", rightSection: _jsx(ExternalLink, { size: 13, "aria-hidden": true }), children: children });
7
+ }
8
+ export function PendingCheckoutTable({ rows, labels }) {
9
+ return (_jsx(Paper, { withBorder: true, children: _jsx(Table.ScrollContainer, { minWidth: 260, children: _jsxs(Table, { "aria-label": labels.heading, horizontalSpacing: "sm", verticalSpacing: "sm", children: [_jsx(Table.Thead, { children: _jsxs(Table.Tr, { children: [_jsx(Table.Th, { children: labels.product }), _jsx(Table.Th, { visibleFrom: "sm", children: labels.amount }), _jsx(Table.Th, { visibleFrom: "sm", children: labels.status }), _jsx(Table.Th, { ta: "end", children: labels.actions })] }) }), _jsx(Table.Tbody, { children: rows.map(row => (_jsxs(Table.Tr, { children: [_jsxs(Table.Td, { style: { overflowWrap: 'anywhere' }, children: [_jsx(Text, { fw: 600, size: "sm", children: row.title }), _jsx(Text, { size: "xs", c: "dimmed", children: row.description }), _jsxs(Group, { gap: 6, mt: 2, hiddenFrom: "sm", children: [_jsx(Text, { size: "sm", children: row.amount }), _jsx(Badge, { size: "xs", variant: "light", color: row.color, children: row.status })] })] }), _jsx(Table.Td, { visibleFrom: "sm", style: { fontVariantNumeric: 'tabular-nums' }, children: row.amount }), _jsx(Table.Td, { visibleFrom: "sm", children: _jsx(Badge, { variant: "light", color: row.color, children: row.status }) }), _jsx(Table.Td, { ta: "end", children: _jsx(Group, { justify: "flex-end", gap: "xs", children: row.actions }) })] }, row.id))) })] }) }) }));
10
+ }
11
+ //# sourceMappingURL=pending-checkout-table.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pending-checkout-table.js","sourceRoot":"","sources":["../../src/orders/pending-checkout-table.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAGZ,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAA;AACxE,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAE3C,MAAM,UAAU,YAAY,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAyC;IACpF,OAAO,KAAC,MAAM,IAAC,SAAS,EAAC,GAAG,EAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAC,QAAQ,EAAC,GAAG,EAAC,qBAAqB,EAAC,IAAI,EAAC,IAAI,EAAC,OAAO,EAAC,OAAO,EAC1G,YAAY,EAAE,KAAC,YAAY,IAAC,IAAI,EAAE,EAAE,wBAAgB,YAAG,QAAQ,GAAU,CAAA;AAC7E,CAAC;AAYD,MAAM,UAAU,oBAAoB,CAAC,EAAE,IAAI,EAAE,MAAM,EAGlD;IACC,OAAO,CACL,KAAC,KAAK,IAAC,UAAU,kBACf,KAAC,KAAK,CAAC,eAAe,IAAC,QAAQ,EAAE,GAAG,YAClC,MAAC,KAAK,kBAAa,MAAM,CA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,EAAE,YAAG,GAAG,CAAC,MAAM,GAAY,EACjG,KAAC,KAAK,CAAC,EAAE,IAAC,WAAW,EAAC,IAAI,YAAC,KAAC,KAAK,IAAC,OAAO,EAAC,OAAO,EAAC,KAAK,EAAE,GAAG,CAAC,KAAK,YAAG,GAAG,CAAC,MAAM,GAAS,GAAW,EACnG,KAAC,KAAK,CAAC,EAAE,IAAC,EAAE,EAAC,KAAK,YAAC,KAAC,KAAK,IAAC,OAAO,EAAC,UAAU,EAAC,GAAG,EAAC,IAAI,YAAE,GAAG,CAAC,OAAO,GAAS,GAAW,KAXzE,GAAG,CAAC,EAAE,CAYV,CACZ,CAAC,GACU,IACR,GACc,GAClB,CACT,CAAA;AACH,CAAC"}
@@ -0,0 +1,87 @@
1
+ import type { BotCheckScene, PublicBotCheck } from '@misebako/sdk/schemas';
2
+ import { type UseBotCheckOptions } from './bot-check.js';
3
+ /**
4
+ * What the server wants after the buyer enters their email. Email codes are only used for
5
+ * accounts without stronger credentials; anything else is a passkey here or a hand-off to
6
+ * the full sign-in page, which owns password, authenticator and recovery steps.
7
+ */
8
+ export type EmailSignInStartResult = {
9
+ kind: 'code';
10
+ } | {
11
+ kind: 'passkey';
12
+ } | {
13
+ kind: 'redirect';
14
+ href: string;
15
+ };
16
+ /** What happens after a correct code. */
17
+ export type EmailSignInVerifyResult = {
18
+ kind: 'signed_in';
19
+ }
20
+ /** The email has no account yet; the buyer confirms before one is created. */
21
+ | {
22
+ kind: 'register';
23
+ } | {
24
+ kind: 'passkey';
25
+ } | {
26
+ kind: 'redirect';
27
+ href: string;
28
+ };
29
+ export interface EmailCodeSignInLabels {
30
+ emailLabel: string;
31
+ emailPlaceholder: string;
32
+ continue: string;
33
+ checkingEmail: string;
34
+ codeLabel: string;
35
+ codeSent: (email: string) => string;
36
+ verify: string;
37
+ verifying: string;
38
+ resend: string;
39
+ resendIn: (seconds: number) => string;
40
+ startOver: string;
41
+ invalidCodeLength: string;
42
+ /** Shown while the browser moves to the full sign-in page. */
43
+ redirecting: string;
44
+ passkeyHint?: string;
45
+ usePasskey?: string;
46
+ registerHint?: (email: string) => string;
47
+ register?: string;
48
+ botCheck: UseBotCheckOptions['labels'];
49
+ }
50
+ export interface EmailCodeSignInProps {
51
+ locale: string;
52
+ botCheck: PublicBotCheck;
53
+ /** Bot-check scene for sending codes and passkey sign-in, or null when none is needed. */
54
+ botScene: BotCheckScene | null;
55
+ /** Ask for the bot check only before the first request (the server then trusts a receipt). */
56
+ botCheckOnce?: boolean;
57
+ initialEmail?: string;
58
+ labels: EmailCodeSignInLabels;
59
+ formatError: (code: string) => string;
60
+ onStart: (input: {
61
+ email: string;
62
+ botCheckToken?: string;
63
+ }) => Promise<EmailSignInStartResult>;
64
+ onVerify: (input: {
65
+ email: string;
66
+ code: string;
67
+ }) => Promise<EmailSignInVerifyResult>;
68
+ /** Creates the account after a new email is verified. Required when `onVerify` can return `register`. */
69
+ onRegister?: () => Promise<void>;
70
+ /** Signs in with a passkey. Required when the server can answer `passkey`. */
71
+ onPasskey?: (input: {
72
+ botCheckToken?: string;
73
+ }) => Promise<void>;
74
+ onSignedIn: () => void;
75
+ /** Leaves for the full sign-in page. */
76
+ onRedirect: (href: string) => void;
77
+ /** Called whenever the step changes, e.g. to update a surrounding dialog. */
78
+ onStepChange?: (step: EmailSignInStep) => void;
79
+ autoFocus?: boolean;
80
+ }
81
+ export type EmailSignInStep = 'email' | 'code' | 'passkey' | 'register' | 'redirecting';
82
+ /**
83
+ * Email-code sign-in that fits inside a dialog or card. It runs the short path (email,
84
+ * six-digit code, optional passkey or account creation) and hands every stronger
85
+ * credential to the full sign-in page through `onRedirect`.
86
+ */
87
+ export declare function EmailCodeSignIn({ locale, botCheck, botScene, botCheckOnce, initialEmail, labels, formatError, onStart, onVerify, onRegister, onPasskey, onSignedIn, onRedirect, onStepChange, autoFocus, }: EmailCodeSignInProps): import("react").JSX.Element;
@@ -0,0 +1,166 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { useEffect, useRef, useState } from 'react';
4
+ import { Alert, Button, Group, Loader, Stack, Text, TextInput } from '@mantine/core';
5
+ import { KeyRound, Mail } from 'lucide-react';
6
+ import { BotCheckError, useBotCheck } from './bot-check.js';
7
+ import { OtpCodeInput } from './otp-input.js';
8
+ function errorCode(cause) {
9
+ if (cause instanceof BotCheckError)
10
+ return cause.code;
11
+ if (cause && typeof cause === 'object' && 'code' in cause && typeof cause.code === 'string') {
12
+ return cause.code;
13
+ }
14
+ if (cause instanceof Error && cause.message)
15
+ return cause.message;
16
+ return 'network';
17
+ }
18
+ /**
19
+ * Email-code sign-in that fits inside a dialog or card. It runs the short path (email,
20
+ * six-digit code, optional passkey or account creation) and hands every stronger
21
+ * credential to the full sign-in page through `onRedirect`.
22
+ */
23
+ export function EmailCodeSignIn({ locale, botCheck, botScene, botCheckOnce = false, initialEmail = '', labels, formatError, onStart, onVerify, onRegister, onPasskey, onSignedIn, onRedirect, onStepChange, autoFocus, }) {
24
+ const [step, setStepState] = useState('email');
25
+ const [email, setEmail] = useState(initialEmail);
26
+ const [code, setCode] = useState('');
27
+ const [cooldown, setCooldown] = useState(0);
28
+ const [busy, setBusy] = useState(false);
29
+ const [error, setError] = useState('');
30
+ const [codeError, setCodeError] = useState('');
31
+ const [checked, setChecked] = useState(false);
32
+ const inFlight = useRef(false);
33
+ const setStep = (next) => {
34
+ setStepState(next);
35
+ onStepChange?.(next);
36
+ };
37
+ const wantsCheck = step === 'email' || step === 'code' || step === 'passkey';
38
+ const check = useBotCheck(botCheck, wantsCheck && !(botCheckOnce && checked) ? botScene : null, { locale, labels: labels.botCheck });
39
+ useEffect(() => {
40
+ if (cooldown <= 0)
41
+ return;
42
+ const timer = setTimeout(() => setCooldown(value => Math.max(0, value - 1)), 1000);
43
+ return () => clearTimeout(timer);
44
+ }, [cooldown]);
45
+ function follow(result) {
46
+ if (result.kind === 'redirect') {
47
+ setStep('redirecting');
48
+ onRedirect(result.href);
49
+ }
50
+ else if (result.kind === 'passkey') {
51
+ setStep('passkey');
52
+ }
53
+ else if (result.kind === 'register') {
54
+ setStep('register');
55
+ }
56
+ else if (result.kind === 'signed_in') {
57
+ onSignedIn();
58
+ }
59
+ else {
60
+ setCode('');
61
+ setCodeError('');
62
+ setCooldown(60);
63
+ setStep('code');
64
+ }
65
+ }
66
+ async function run(task, onError) {
67
+ if (inFlight.current)
68
+ return;
69
+ inFlight.current = true;
70
+ setBusy(true);
71
+ setError('');
72
+ try {
73
+ await task();
74
+ }
75
+ catch (cause) {
76
+ onError(errorCode(cause));
77
+ }
78
+ finally {
79
+ inFlight.current = false;
80
+ setBusy(false);
81
+ }
82
+ }
83
+ async function withBotToken(task) {
84
+ let used = false;
85
+ try {
86
+ const token = await check.verify();
87
+ used = Boolean(token);
88
+ const result = await task(token);
89
+ setChecked(true);
90
+ return result;
91
+ }
92
+ finally {
93
+ if (used || check.response)
94
+ check.reset();
95
+ }
96
+ }
97
+ function start(event) {
98
+ event?.preventDefault();
99
+ const trimmed = email.trim();
100
+ if (!trimmed || check.blocked)
101
+ return;
102
+ if (step === 'code' && cooldown > 0)
103
+ return;
104
+ void run(async () => {
105
+ follow(await withBotToken(token => onStart({ email: trimmed, ...(token ? { botCheckToken: token } : {}) })));
106
+ }, code => setError(formatError(code)));
107
+ }
108
+ function verify(value = code, event) {
109
+ event?.preventDefault();
110
+ if (!/^\d{6}$/.test(value.trim())) {
111
+ setCodeError(labels.invalidCodeLength);
112
+ return;
113
+ }
114
+ setCodeError('');
115
+ void run(async () => {
116
+ follow(await onVerify({ email: email.trim(), code: value.trim() }));
117
+ }, code => setCodeError(formatError(code)));
118
+ }
119
+ function passkey() {
120
+ if (!onPasskey || check.blocked)
121
+ return;
122
+ void run(async () => {
123
+ await withBotToken(token => onPasskey(token ? { botCheckToken: token } : {}));
124
+ onSignedIn();
125
+ }, code => setError(formatError(code)));
126
+ }
127
+ function register() {
128
+ if (!onRegister)
129
+ return;
130
+ void run(async () => {
131
+ await onRegister();
132
+ onSignedIn();
133
+ }, code => setError(formatError(code)));
134
+ }
135
+ function startOver() {
136
+ if (busy)
137
+ return;
138
+ setCode('');
139
+ setCodeError('');
140
+ setError('');
141
+ setCooldown(0);
142
+ check.reset();
143
+ setStep('email');
144
+ }
145
+ if (step === 'redirecting') {
146
+ return (_jsxs(Group, { gap: "sm", role: "status", children: [_jsx(Loader, { size: "sm" }), _jsx(Text, { size: "sm", children: labels.redirecting })] }));
147
+ }
148
+ const errorAlert = error ? _jsx(Alert, { color: "red", variant: "light", role: "alert", children: error }) : null;
149
+ const emailField = (_jsx(TextInput, { type: "email", required: true, autoComplete: "email", label: labels.emailLabel, placeholder: labels.emailPlaceholder, leftSection: _jsx(Mail, { size: 16, "aria-hidden": "true" }), value: email, onChange: event => setEmail(event.currentTarget.value), disabled: busy || step !== 'email', autoFocus: autoFocus && step === 'email' }));
150
+ const startOverButton = (_jsx(Button, { type: "button", variant: "subtle", color: "gray", size: "xs", onClick: startOver, disabled: busy, children: labels.startOver }));
151
+ if (step === 'passkey') {
152
+ return (_jsxs(Stack, { gap: "sm", children: [errorAlert, emailField, labels.passkeyHint && _jsx(Text, { size: "sm", c: "dimmed", children: labels.passkeyHint }), check.field, _jsx(Button, { type: "button", leftSection: _jsx(KeyRound, { size: 16, "aria-hidden": "true" }), loading: busy, disabled: check.blocked || !onPasskey, onClick: passkey, children: labels.usePasskey }), _jsx(Group, { justify: "flex-start", children: startOverButton })] }));
153
+ }
154
+ if (step === 'register') {
155
+ return (_jsxs(Stack, { gap: "sm", children: [errorAlert, labels.registerHint && _jsx(Text, { size: "sm", children: labels.registerHint(email.trim()) }), _jsx(Button, { type: "button", loading: busy, disabled: !onRegister, onClick: register, children: labels.register }), _jsx(Group, { justify: "flex-start", children: startOverButton })] }));
156
+ }
157
+ if (step === 'code') {
158
+ return (_jsx("form", { onSubmit: event => verify(code, event), children: _jsxs(Stack, { gap: "sm", children: [errorAlert, emailField, _jsx(Text, { size: "sm", c: "dimmed", role: "status", children: labels.codeSent(email.trim()) }), _jsx(OtpCodeInput, { required: true, label: labels.codeLabel, value: code, onChange: next => {
159
+ setCode(next);
160
+ if (codeError)
161
+ setCodeError('');
162
+ }, onComplete: value => verify(value), error: codeError || undefined, disabled: busy, autoFocus: true }), check.field, _jsxs(Group, { justify: "space-between", gap: "xs", wrap: "wrap", children: [_jsxs(Group, { gap: "xs", children: [_jsx(Button, { type: "button", variant: "subtle", size: "xs", onClick: () => start(), disabled: busy || cooldown > 0 || check.blocked, children: cooldown > 0 ? labels.resendIn(cooldown) : labels.resend }), startOverButton] }), _jsx(Button, { type: "submit", loading: busy, disabled: code.trim().length !== 6, children: busy ? labels.verifying : labels.verify })] })] }) }));
163
+ }
164
+ return (_jsx("form", { onSubmit: start, children: _jsxs(Stack, { gap: "sm", children: [errorAlert, emailField, check.field, _jsx(Button, { type: "submit", loading: busy, disabled: check.blocked || !email.trim(), children: busy ? labels.checkingEmail : labels.continue })] }) }));
165
+ }
166
+ //# sourceMappingURL=email-code-sign-in.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"email-code-sign-in.js","sourceRoot":"","sources":["../../src/primitives/email-code-sign-in.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAkB,MAAM,OAAO,CAAA;AACnE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAEpF,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAC7C,OAAO,EAAE,aAAa,EAAE,WAAW,EAA2B,MAAM,gBAAgB,CAAA;AACpF,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAoE7C,SAAS,SAAS,CAAC,KAAc;IAC/B,IAAI,KAAK,YAAY,aAAa;QAAE,OAAO,KAAK,CAAC,IAAI,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AC,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,GACvC,IACH,GACH,CACR,CAAA;AACH,CAAC"}
@@ -0,0 +1,12 @@
1
+ import type { ReactNode } from 'react';
2
+ export interface StatusPageProps {
3
+ /** `not-found` and `error` pick the matching icon; pass a node for anything else. */
4
+ kind?: 'not-found' | 'error';
5
+ icon?: ReactNode;
6
+ title: string;
7
+ description: string;
8
+ /** Primary action first, then secondary ones with `variant="default"`. */
9
+ actions?: ReactNode;
10
+ }
11
+ /** Full-page message for not-found and error routes; the title is the page's `h1`. */
12
+ export declare function StatusPage({ kind, icon, title, description, actions }: StatusPageProps): import("react").JSX.Element;
@@ -0,0 +1,9 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { EmptyState, EmptyStateActions, EmptyStateDescription, EmptyStateTitle } from '@mantine/core';
3
+ import { CircleAlert, FileQuestionMark } from 'lucide-react';
4
+ /** Full-page message for not-found and error routes; the title is the page's `h1`. */
5
+ export function StatusPage({ kind = 'not-found', icon, title, description, actions }) {
6
+ const fallback = kind === 'error' ? _jsx(CircleAlert, { "aria-hidden": "true" }) : _jsx(FileQuestionMark, { "aria-hidden": "true" });
7
+ return (_jsxs(EmptyState, { py: "xl", icon: icon ?? fallback, children: [_jsx(EmptyStateTitle, { order: 1, children: title }), _jsx(EmptyStateDescription, { children: description }), actions && _jsx(EmptyStateActions, { children: actions })] }));
8
+ }
9
+ //# sourceMappingURL=status-page.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"status-page.js","sourceRoot":"","sources":["../../src/primitives/status-page.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AACrG,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAY5D,sFAAsF;AACtF,MAAM,UAAU,UAAU,CAAC,EAAE,IAAI,GAAG,WAAW,EAAE,IAAI,EAAE,KAAK,EAAE,WAAW,EAAE,OAAO,EAAmB;IACnG,MAAM,QAAQ,GAAG,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,KAAC,WAAW,mBAAa,MAAM,GAAG,CAAC,CAAC,CAAC,KAAC,gBAAgB,mBAAa,MAAM,GAAG,CAAA;IAChH,OAAO,CACL,MAAC,UAAU,IAAC,EAAE,EAAC,IAAI,EAAC,IAAI,EAAE,IAAI,IAAI,QAAQ,aACxC,KAAC,eAAe,IAAC,KAAK,EAAE,CAAC,YAAG,KAAK,GAAmB,EACpD,KAAC,qBAAqB,cAAE,WAAW,GAAyB,EAC3D,OAAO,IAAI,KAAC,iBAAiB,cAAE,OAAO,GAAqB,IACjD,CACd,CAAA;AACH,CAAC"}
@@ -0,0 +1,125 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { StoreLinkComponent } from '../primitives/link.js';
3
+ import { type ProductGalleryImage } from './product-gallery.js';
4
+ export type StockBadgeTone = 'available' | 'unavailable' | 'stale';
5
+ export interface StockBadgeProps {
6
+ /** `available` uses the primary color, `unavailable` gray (sold out, backorder) and `stale` orange (price expired). */
7
+ tone?: StockBadgeTone;
8
+ children: ReactNode;
9
+ }
10
+ export declare function StockBadge({ tone, children }: StockBadgeProps): import("react").JSX.Element;
11
+ export interface ProductCardGridProps {
12
+ /** Three columns from `lg` instead of `md`, for grids that sit beside the category sidebar. */
13
+ compact?: boolean;
14
+ children: ReactNode;
15
+ }
16
+ export declare function ProductCardGrid({ compact, children }: ProductCardGridProps): import("react").JSX.Element;
17
+ export interface ProductCardPriceProps {
18
+ children: ReactNode;
19
+ /** Secondary line, such as the base-currency amount. The line is always reserved so prices align across cards. */
20
+ reference?: string | null;
21
+ }
22
+ export declare function ProductCardPrice({ children, reference }: ProductCardPriceProps): import("react").JSX.Element;
23
+ export interface ProductCardProps {
24
+ LinkComponent?: StoreLinkComponent;
25
+ href: string;
26
+ title: string;
27
+ titleLang?: string;
28
+ /** Option name, shown when it differs from the product name. */
29
+ subtitle?: string | null;
30
+ description?: string | null;
31
+ descriptionLang?: string;
32
+ image?: ProductGalleryImage;
33
+ /** Usually a `StockBadge`, overlaid on the cover. */
34
+ stock?: ReactNode;
35
+ /** Usually a `ProductCardPrice`, pinned to the bottom of the card. */
36
+ price: ReactNode;
37
+ headingOrder?: 2 | 3;
38
+ }
39
+ export declare function ProductCard({ LinkComponent, href, title, titleLang, subtitle, description, descriptionLang, image, stock, price, headingOrder, }: ProductCardProps): import("react").JSX.Element;
40
+ export interface EmptyStatePanelProps {
41
+ icon: ReactNode;
42
+ title: ReactNode;
43
+ description?: ReactNode;
44
+ /** Buttons rendered in `EmptyState.Actions`. */
45
+ actions?: ReactNode;
46
+ withIndicatorBackground?: boolean;
47
+ }
48
+ /** Bordered empty state used for empty catalogs, carts and order lists. */
49
+ export declare function EmptyStatePanel({ icon, title, description, actions, withIndicatorBackground }: EmptyStatePanelProps): import("react").JSX.Element;
50
+ export interface FeaturedSectionProps {
51
+ LinkComponent?: StoreLinkComponent;
52
+ id: string;
53
+ title: string;
54
+ viewAllHref: string;
55
+ viewAllLabel: string;
56
+ children: ReactNode;
57
+ }
58
+ /** Home page section with a heading and a "View All" link, such as featured products. */
59
+ export declare function FeaturedSection({ LinkComponent, id, title, viewAllHref, viewAllLabel, children }: FeaturedSectionProps): import("react").JSX.Element;
60
+ export interface CategoryLinkItem {
61
+ key: string;
62
+ label: string;
63
+ href: string;
64
+ active: boolean;
65
+ onClick?: () => void;
66
+ }
67
+ export interface CategorySidebarProps {
68
+ LinkComponent?: StoreLinkComponent;
69
+ title: string;
70
+ links: readonly CategoryLinkItem[];
71
+ /** Extra props for every link, such as `{ scroll: false }` for Next.js links. */
72
+ linkProps?: Record<string, unknown>;
73
+ }
74
+ /** Sticky category list: a scrolling row on phones, a column beside the grid from `sm`. */
75
+ export declare function CategorySidebar({ LinkComponent, title, links, linkProps }: CategorySidebarProps): import("react").JSX.Element;
76
+ export interface CatalogLayoutProps {
77
+ /** Usually a `CategorySidebar`; the grid takes the full width without one. */
78
+ sidebar?: ReactNode;
79
+ children: ReactNode;
80
+ }
81
+ export declare function CatalogLayout({ sidebar, children }: CatalogLayoutProps): import("react").JSX.Element;
82
+ export interface CatalogHeaderProps {
83
+ title: string;
84
+ /** Result count, announced politely when it changes. */
85
+ resultText: string;
86
+ /** Filters and sort controls shown next to the title. */
87
+ controls?: ReactNode;
88
+ /** The search form, usually wrapping a `CatalogSearchInput`. Give it the `misebako-catalog-search` class. */
89
+ search: ReactNode;
90
+ }
91
+ export declare function CatalogHeader({ title, resultText, controls, search }: CatalogHeaderProps): import("react").JSX.Element;
92
+ export interface CatalogSearchInputProps {
93
+ value: string;
94
+ onChange: (value: string) => void;
95
+ label: string;
96
+ placeholder: string;
97
+ clearLabel: string;
98
+ name?: string;
99
+ }
100
+ export declare function CatalogSearchInput({ value, onChange, label, placeholder, clearLabel, name }: CatalogSearchInputProps): import("react").JSX.Element;
101
+ export interface HelpArticleCardItem {
102
+ slug: string;
103
+ locale?: string | null;
104
+ title: string;
105
+ summary?: string | null;
106
+ updatedAt: string;
107
+ featuredRank: number | null;
108
+ category?: {
109
+ name: string;
110
+ } | null;
111
+ }
112
+ export interface HelpArticleCardsProps {
113
+ LinkComponent?: StoreLinkComponent;
114
+ articles: readonly HelpArticleCardItem[];
115
+ locale: string;
116
+ labels: {
117
+ featuredBadge: string;
118
+ readMore: string;
119
+ };
120
+ /** Home page layout: three columns and no featured badge. */
121
+ home?: boolean;
122
+ headingOrder?: 2 | 3;
123
+ basePath?: string;
124
+ }
125
+ export declare function HelpArticleCards({ LinkComponent, articles, locale, labels, home, headingOrder, basePath, }: HelpArticleCardsProps): import("react").JSX.Element | null;
@@ -0,0 +1,55 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Badge, Box, Button, Card, CardSection, CloseButton, EmptyState, EmptyStateActions, Flex, Grid, GridCol, Group, NavLink, Paper, SimpleGrid, Stack, Text, TextInput, Title, } from '@mantine/core';
3
+ import { ArrowRight, LayoutGrid, Search, Star } from 'lucide-react';
4
+ import { ProductCover } from './product-gallery.js';
5
+ /*
6
+ * Storefront catalog building blocks shared by Misebako and Noren.
7
+ * No hooks, no 'use client' and no dot-style compound parts (`Card.Section`), so server components can render
8
+ * them too. Pass the framework link as `LinkComponent` (it falls back to a plain anchor).
9
+ */
10
+ // Typed as 'a' so Mantine's polymorphic props accept `href`; the link component renders an anchor too.
11
+ const linkOrAnchor = (LinkComponent) => (LinkComponent ?? 'a');
12
+ export function StockBadge({ tone = 'available', children }) {
13
+ const color = tone === 'stale' ? 'orange' : tone === 'unavailable' ? 'gray' : undefined;
14
+ return _jsx(Badge, { size: "sm", variant: "light", color: color, children: children });
15
+ }
16
+ export function ProductCardGrid({ compact = false, children }) {
17
+ return _jsx(SimpleGrid, { cols: { base: 1, xs: 2, [compact ? 'lg' : 'md']: 3 }, spacing: "lg", children: children });
18
+ }
19
+ export function ProductCardPrice({ children, reference }) {
20
+ return (_jsxs(Stack, { gap: 4, className: "misebako-product-card-price", children: [children, _jsx(Text, { size: "xs", c: "dimmed", truncate: true, title: reference ?? undefined, "aria-hidden": reference ? undefined : true, children: reference ?? ' ' })] }));
21
+ }
22
+ export function ProductCard({ LinkComponent, href, title, titleLang, subtitle, description, descriptionLang, image, stock, price, headingOrder = 2, }) {
23
+ return (_jsx(Box, { component: "article", miw: 0, children: _jsxs(Card, { component: linkOrAnchor(LinkComponent), href: href, "aria-label": title, className: "catalog-card misebako-product-card", withBorder: true, radius: "md", h: "100%", p: "md", children: [_jsxs(CardSection, { className: "misebako-product-card-cover", children: [_jsx(ProductCover, { image: image }), stock && _jsx("span", { className: "misebako-product-card-stock", children: stock })] }), _jsxs(Stack, { gap: "xs", pt: "md", flex: 1, children: [_jsxs(Group, { align: "flex-start", justify: "space-between", gap: "xs", wrap: "nowrap", children: [_jsx(Title, { order: headingOrder, size: "h4", lang: titleLang, children: title }), _jsx(ArrowRight, { className: "misebako-product-card-arrow", size: 16, "aria-hidden": true })] }), subtitle && subtitle.trim().toLowerCase() !== title.trim().toLowerCase() && _jsx(Text, { size: "sm", children: subtitle }), description && _jsx(Text, { size: "sm", c: "dimmed", lineClamp: 2, lang: descriptionLang, children: description }), price] })] }) }));
24
+ }
25
+ /** Bordered empty state used for empty catalogs, carts and order lists. */
26
+ export function EmptyStatePanel({ icon, title, description, actions, withIndicatorBackground }) {
27
+ return (_jsx(Paper, { withBorder: true, radius: "md", p: "xl", children: _jsx(EmptyState, { icon: icon, title: title, description: description || undefined, withIndicatorBackground: withIndicatorBackground, children: actions && _jsx(EmptyStateActions, { children: actions }) }) }));
28
+ }
29
+ /** Home page section with a heading and a "View All" link, such as featured products. */
30
+ export function FeaturedSection({ LinkComponent, id, title, viewAllHref, viewAllLabel, children }) {
31
+ return (_jsxs(Stack, { component: "section", "aria-labelledby": id, gap: "lg", children: [_jsxs(Group, { justify: "space-between", align: "center", children: [_jsx(Title, { order: 2, id: id, children: title }), _jsx(Button, { component: linkOrAnchor(LinkComponent), href: viewAllHref, variant: "subtle", rightSection: _jsx(ArrowRight, { size: 16, "aria-hidden": "true" }), children: viewAllLabel })] }), children] }));
32
+ }
33
+ /** Sticky category list: a scrolling row on phones, a column beside the grid from `sm`. */
34
+ export function CategorySidebar({ LinkComponent, title, links, linkProps }) {
35
+ return (_jsxs(Paper, { component: "aside", withBorder: true, radius: "md", p: "sm", "aria-labelledby": "category-title", pos: { sm: 'sticky' }, top: "var(--mantine-spacing-lg)", children: [_jsxs(Group, { gap: "xs", px: "xs", pb: "xs", wrap: "nowrap", children: [_jsx(LayoutGrid, { size: 16, "aria-hidden": true }), _jsx(Text, { id: "category-title", size: "sm", fw: 600, children: title })] }), _jsx(Flex, { component: "nav", "aria-label": title, gap: 4, direction: { base: 'row', sm: 'column' }, className: "misebako-category-nav", mah: { sm: '75dvh' }, children: links.map(link => (_jsx(NavLink, { component: linkOrAnchor(LinkComponent), href: link.href, ...linkProps, label: link.label, active: link.active, "aria-current": link.active ? 'page' : undefined, w: { base: 'max-content', sm: '100%' }, bdrs: "sm", className: "misebako-category-link", onClick: link.onClick }, link.key))) })] }));
36
+ }
37
+ export function CatalogLayout({ sidebar, children }) {
38
+ return (_jsxs(Grid, { gap: { base: 'lg', sm: 'xl' }, children: [sidebar && _jsx(GridCol, { span: { base: 12, sm: 3 }, children: sidebar }), _jsx(GridCol, { span: { base: 12, sm: sidebar ? 9 : 12 }, children: _jsx(Stack, { component: "section", "aria-labelledby": "products-title", gap: "lg", children: children }) })] }));
39
+ }
40
+ export function CatalogHeader({ title, resultText, controls, search }) {
41
+ return (_jsxs("header", { className: "misebako-catalog-header", children: [_jsxs(Stack, { gap: 4, miw: 0, children: [_jsx(Title, { order: 1, id: "products-title", children: title }), _jsx(Text, { size: "sm", c: "dimmed", role: "status", children: resultText })] }), controls && _jsx(Group, { gap: "sm", align: "center", wrap: "wrap", children: controls }), search] }));
42
+ }
43
+ export function CatalogSearchInput({ value, onChange, label, placeholder, clearLabel, name = 'q' }) {
44
+ return (_jsx(TextInput, { type: "search", name: name, "aria-label": label, placeholder: placeholder, maxLength: 120, value: value, leftSection: _jsx(Search, { size: 16, "aria-hidden": "true" }), rightSection: value ? _jsx(CloseButton, { "aria-label": clearLabel, onClick: () => onChange('') }) : null, onChange: event => onChange(event.currentTarget.value) }));
45
+ }
46
+ export function HelpArticleCards({ LinkComponent, articles, locale, labels, home = false, headingOrder = 3, basePath = '/help', }) {
47
+ if (!articles.length)
48
+ return null;
49
+ const dateFmt = new Intl.DateTimeFormat(locale, { dateStyle: 'medium', timeZone: 'UTC' });
50
+ return (_jsx(SimpleGrid, { cols: { base: 1, sm: 2, md: home ? 3 : 2 }, spacing: "md", children: articles.map(article => {
51
+ const featured = article.featuredRank !== null && !home;
52
+ return (_jsx(Card, { component: linkOrAnchor(LinkComponent), href: `${basePath}/${encodeURIComponent(article.slug)}`, lang: article.locale ?? undefined, withBorder: true, radius: "md", p: "lg", className: "catalog-card", children: _jsxs(Stack, { gap: "xs", h: "100%", justify: "space-between", children: [_jsxs(Stack, { gap: "xs", children: [(article.category || featured) && (_jsxs(Group, { gap: "xs", justify: "space-between", wrap: "nowrap", children: [article.category ? _jsx(Badge, { size: "sm", variant: "light", color: "teal", children: article.category.name }) : _jsx("span", {}), featured && (_jsx(Badge, { size: "xs", variant: "outline", color: "blue", leftSection: _jsx(Star, { size: 12, "aria-hidden": true }), children: labels.featuredBadge }))] })), _jsx(Title, { order: headingOrder, size: "h5", lineClamp: 2, children: article.title }), article.summary && _jsx(Text, { size: "sm", c: "dimmed", lineClamp: 3, lh: 1.6, children: article.summary })] }), _jsxs(Group, { justify: "space-between", align: "center", mt: "xs", pt: "xs", style: { borderTop: '1px solid var(--mantine-color-default-border)' }, children: [_jsx(Text, { size: "xs", c: "dimmed", style: { fontVariantNumeric: 'tabular-nums' }, children: _jsx("time", { dateTime: article.updatedAt, children: dateFmt.format(new Date(article.updatedAt)) }) }), _jsxs(Group, { gap: 4, c: "var(--mantine-primary-color-text)", children: [_jsx(Text, { size: "xs", fw: 600, children: labels.readMore }), _jsx(ArrowRight, { size: 13, "aria-hidden": true })] })] })] }) }, article.slug));
53
+ }) }));
54
+ }
55
+ //# sourceMappingURL=catalog.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"catalog.js","sourceRoot":"","sources":["../../src/storefront/catalog.tsx"],"names":[],"mappings":";AACA,OAAO,EACL,KAAK,EACL,GAAG,EACH,MAAM,EACN,IAAI,EACJ,WAAW,EACX,WAAW,EACX,UAAU,EACV,iBAAiB,EACjB,IAAI,EACJ,IAAI,EACJ,OAAO,EACP,KAAK,EACL,OAAO,EACP,KAAK,EACL,UAAU,EACV,KAAK,EACL,IAAI,EACJ,SAAS,EACT,KAAK,GACN,MAAM,eAAe,CAAA;AACtB,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAEnE,OAAO,EAAE,YAAY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AC,EAAC,QAAQ,EAAC,SAAS,EAAE,CAAC,EAAE,EAAE,EAAE,GAAG,YAAG,OAAO,CAAC,OAAO,GAAQ,IACxF,EACR,MAAC,KAAK,IAAC,OAAO,EAAC,eAAe,EAAC,KAAK,EAAC,QAAQ,EAAC,EAAE,EAAC,IAAI,EAAC,EAAE,EAAC,IAAI,EAAC,KAAK,EAAE,EAAE,SAAS,EAAE,+CAA+C,EAAE,aACjI,KAAC,IAAI,IAAC,IAAI,EAAC,IAAI,EAAC,CAAC,EAAC,QAAQ,EAAC,KAAK,EAAE,EAAE,kBAAkB,EAAE,cAAc,EAAE,YACtE,eAAM,QAAQ,EAAE,OAAO,CAAC,SAAS,YAAG,OAAO,CAAC,MAAM,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,GAAQ,GAClF,EACP,MAAC,KAAK,IAAC,GAAG,EAAE,CAAC,EAAE,CAAC,EAAC,mCAAmC,aAClD,KAAC,IAAI,IAAC,IAAI,EAAC,IAAI,EAAC,EAAE,EAAE,GAAG,YAAG,MAAM,CAAC,QAAQ,GAAQ,EACjD,KAAC,UAAU,IAAC,IAAI,EAAE,EAAE,wBAAgB,IAC9B,IACF,IACF,IA/BH,OAAO,CAAC,IAAI,CAgCZ,CACR,CAAA;QACH,CAAC,CAAC,GACS,CACd,CAAA;AACH,CAAC"}
@@ -0,0 +1,9 @@
1
+ import type { ReactNode } from 'react';
2
+ export type DeliveryKind = 'instant' | 'manual' | 'supplier' | 'backorder';
3
+ export interface DeliveryNoteProps {
4
+ kind: DeliveryKind;
5
+ /** One plain sentence such as "Instant Delivery After Payment". */
6
+ children: ReactNode;
7
+ }
8
+ /** One plain sentence telling the buyer how and when the item arrives, with a matching icon. */
9
+ export declare function DeliveryNote({ kind, children }: DeliveryNoteProps): import("react").JSX.Element;
@@ -0,0 +1,10 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Group, Text } from '@mantine/core';
3
+ import { PackageCheck, Truck, UserRound, Zap } from 'lucide-react';
4
+ const icons = { instant: Zap, manual: UserRound, supplier: Truck, backorder: PackageCheck };
5
+ /** One plain sentence telling the buyer how and when the item arrives, with a matching icon. */
6
+ export function DeliveryNote({ kind, children }) {
7
+ const Icon = icons[kind];
8
+ return (_jsxs(Group, { gap: 8, wrap: "nowrap", align: "flex-start", className: "misebako-delivery-note", children: [_jsx(Icon, { size: 16, "aria-hidden": "true", className: "misebako-delivery-note-icon" }), _jsx(Text, { size: "sm", children: children })] }));
9
+ }
10
+ //# sourceMappingURL=delivery-note.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delivery-note.js","sourceRoot":"","sources":["../../src/storefront/delivery-note.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,cAAc,CAAA;AAUlE,MAAM,KAAK,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,EAAE,YAAY,EAAW,CAAA;AAEpG,gGAAgG;AAChG,MAAM,UAAU,YAAY,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAqB;IAChE,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,CAAA;IACxB,OAAO,CACL,MAAC,KAAK,IAAC,GAAG,EAAE,CAAC,EAAE,IAAI,EAAC,QAAQ,EAAC,KAAK,EAAC,YAAY,EAAC,SAAS,EAAC,wBAAwB,aAChF,KAAC,IAAI,IAAC,IAAI,EAAE,EAAE,iBAAc,MAAM,EAAC,SAAS,EAAC,6BAA6B,GAAG,EAC7E,KAAC,IAAI,IAAC,IAAI,EAAC,IAAI,YAAE,QAAQ,GAAQ,IAC3B,CACT,CAAA;AACH,CAAC"}
@@ -8,6 +8,6 @@ export function HomeHero({ LinkComponent, FormComponent, eyebrow, title, highlig
8
8
  const FormEl = FormComponent ?? 'form';
9
9
  const visibleCategories = categories.slice(0, 6);
10
10
  const highlights = (_jsx(List, { mt: "xs", spacing: "sm", size: "sm", center: true, icon: _jsx(ThemeIcon, { size: 22, radius: "xl", variant: "light", children: _jsx(Check, { size: 13, "aria-hidden": "true" }) }), children: bullets.map((bullet, index) => (_jsxs(List.Item, { children: [_jsx(Text, { component: "span", fw: 600, children: bullet.strong }), ' — ', _jsx(Text, { component: "span", c: "dimmed", children: bullet.detail })] }, `${bullet.strong}-${index}`))) }));
11
- return (_jsx(Box, { component: "section", "aria-labelledby": "home-hero-title", className: "misebako-hero-wrapper", py: { base: 'md', md: 'xl' }, children: _jsxs("div", { className: "misebako-hero-inner", children: [_jsxs(Stack, { gap: "md", align: "flex-start", className: "misebako-hero-heading", children: [_jsx(Badge, { variant: "light", radius: "xl", size: "md", leftSection: _jsx(Sparkles, { size: 13, "aria-hidden": "true" }), children: eyebrow }), _jsxs(Title, { id: "home-hero-title", order: 1, className: "misebako-hero-title", children: [_jsx(Text, { component: "span", display: "block", inherit: true, children: title }), _jsx(Text, { component: "span", display: "block", inherit: true, className: "misebako-hero-highlight", children: highlight })] })] }), _jsx(Paper, { withBorder: true, radius: "md", p: { base: 'md', md: 'lg' }, className: "misebako-hero-panel", children: _jsxs(Stack, { gap: "md", children: [_jsx(Title, { order: 2, fz: "sm", fw: 600, children: panelTitle }), _jsx(FormEl, { action: searchFormAction, role: "search", children: _jsxs(Group, { gap: "xs", wrap: "nowrap", align: "stretch", children: [_jsx(TextInput, { name: "q", type: "search", maxLength: 120, flex: 1, miw: 0, "aria-label": searchLabel ?? panelTitle, placeholder: searchPlaceholder, leftSection: _jsx(Search, { size: 15, "aria-hidden": "true" }) }), _jsx(Button, { type: "submit", variant: "light", px: "md", style: { flexShrink: 0 }, children: searchButtonLabel })] }) }), visibleCategories.length > 0 && (_jsxs(Stack, { gap: "xs", children: [_jsx(Title, { order: 3, fz: "xs", c: "dimmed", fw: 500, children: categoriesHeading }), _jsxs(Group, { gap: "xs", wrap: "wrap", children: [_jsx(Button, { component: NavLink, href: "/products", size: "xs", variant: "default", radius: "xl", children: allProductsChip }), visibleCategories.map(category => (_jsx(Button, { component: NavLink, href: `/products?category=${encodeURIComponent(category.slug)}`, size: "xs", variant: "default", radius: "xl", children: category.name }, category.slug)))] })] }))] }) }), _jsxs(Stack, { gap: "md", align: "flex-start", className: "misebako-hero-copy", children: [_jsx(Text, { size: "md", c: "dimmed", maw: 560, lh: 1.6, children: description }), bullets.length > 0 && _jsxs(_Fragment, { children: [_jsx("div", { className: "misebako-hero-highlights-wide", children: highlights }), _jsxs("details", { className: "misebako-hero-disclosure", children: [_jsx("summary", { children: bulletsHeading }), highlights] })] }), _jsxs(Group, { mt: { base: 0, md: 'md' }, gap: "sm", wrap: "wrap", children: [_jsx(Button, { component: NavLink, href: "/products", size: "md", radius: "xl", rightSection: _jsx(ArrowRight, { size: 16, "aria-hidden": "true" }), children: primaryCta }), _jsx(Button, { component: NavLink, href: "/help", size: "md", radius: "xl", variant: "default", leftSection: _jsx(BookOpen, { size: 16, "aria-hidden": "true" }), children: secondaryCta })] })] })] }) }));
11
+ return (_jsx(Box, { component: "section", "aria-labelledby": "home-hero-title", className: "misebako-hero-wrapper", children: _jsxs("div", { className: "misebako-hero-inner", children: [_jsxs(Stack, { gap: "md", align: "flex-start", className: "misebako-hero-heading", children: [_jsx(Badge, { variant: "light", radius: "xl", size: "md", leftSection: _jsx(Sparkles, { size: 13, "aria-hidden": "true" }), children: eyebrow }), _jsxs(Title, { id: "home-hero-title", order: 1, className: "misebako-hero-title", children: [_jsx(Text, { component: "span", display: "block", inherit: true, children: title }), _jsx(Text, { component: "span", display: "block", inherit: true, className: "misebako-hero-highlight", children: highlight })] })] }), _jsx(Paper, { withBorder: true, radius: "md", p: { base: 'md', md: 'lg' }, className: "misebako-hero-panel", children: _jsxs(Stack, { gap: "md", children: [_jsx(Title, { order: 2, fz: "sm", fw: 600, children: panelTitle }), _jsx(FormEl, { action: searchFormAction, role: "search", children: _jsxs(Group, { gap: "xs", wrap: "nowrap", align: "stretch", children: [_jsx(TextInput, { name: "q", type: "search", maxLength: 120, flex: 1, miw: 0, "aria-label": searchLabel ?? panelTitle, placeholder: searchPlaceholder, leftSection: _jsx(Search, { size: 15, "aria-hidden": "true" }) }), _jsx(Button, { type: "submit", variant: "light", px: "md", style: { flexShrink: 0 }, children: searchButtonLabel })] }) }), visibleCategories.length > 0 && (_jsxs(Stack, { gap: "xs", children: [_jsx(Title, { order: 3, fz: "xs", c: "dimmed", fw: 500, children: categoriesHeading }), _jsxs(Group, { gap: "xs", wrap: "wrap", children: [_jsx(Button, { component: NavLink, href: "/products", size: "xs", variant: "default", radius: "xl", children: allProductsChip }), visibleCategories.map(category => (_jsx(Button, { component: NavLink, href: `/products?category=${encodeURIComponent(category.slug)}`, size: "xs", variant: "default", radius: "xl", children: category.name }, category.slug)))] })] }))] }) }), _jsxs(Stack, { gap: "md", align: "flex-start", className: "misebako-hero-copy", children: [_jsx(Text, { size: "md", c: "dimmed", maw: 560, lh: 1.6, children: description }), bullets.length > 0 && _jsxs(_Fragment, { children: [_jsx("div", { className: "misebako-hero-highlights-wide", children: highlights }), _jsxs("details", { className: "misebako-hero-disclosure", children: [_jsx("summary", { children: bulletsHeading }), highlights] })] }), _jsxs(Group, { mt: { base: 0, md: 'md' }, gap: "sm", wrap: "wrap", children: [_jsx(Button, { component: NavLink, href: "/products", size: "md", radius: "xl", rightSection: _jsx(ArrowRight, { size: 16, "aria-hidden": "true" }), children: primaryCta }), _jsx(Button, { component: NavLink, href: "/help", size: "md", radius: "xl", variant: "default", leftSection: _jsx(BookOpen, { size: 16, "aria-hidden": "true" }), children: secondaryCta })] })] })] }) }));
12
12
  }
13
13
  //# sourceMappingURL=home-hero.js.map