@snacky/ui 0.1.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.
package/dist/index.js ADDED
@@ -0,0 +1,1024 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __export = (target, all) => {
3
+ for (var name in all)
4
+ __defProp(target, name, { get: all[name], enumerable: true });
5
+ };
6
+
7
+ // src/theme/tokens.ts
8
+ var typography = {
9
+ h1: {
10
+ bold: { fontFamily: "Poppins, sans-serif", fontSize: "32px", fontWeight: 700, lineHeight: "36px", letterSpacing: "0.01em" }
11
+ },
12
+ h2: {
13
+ bold: { fontFamily: "Poppins, sans-serif", fontSize: "20px", fontWeight: 700, lineHeight: "36px", letterSpacing: "0.01em" }
14
+ },
15
+ h3: {
16
+ bold: { fontFamily: "Poppins, sans-serif", fontSize: "16px", fontWeight: 700, lineHeight: "36px", letterSpacing: "0.01em" },
17
+ regular: { fontFamily: "Poppins, sans-serif", fontSize: "16px", fontWeight: 400, lineHeight: "36px", letterSpacing: "normal" }
18
+ },
19
+ body: {
20
+ semibold: { fontFamily: "Poppins, sans-serif", fontSize: "14px", fontWeight: 600, lineHeight: "24px", letterSpacing: "normal" },
21
+ regular: { fontFamily: "Poppins, sans-serif", fontSize: "14px", fontWeight: 400, lineHeight: "24px", letterSpacing: "normal" }
22
+ },
23
+ small: {
24
+ semibold: { fontFamily: "Poppins, sans-serif", fontSize: "12px", fontWeight: 600, lineHeight: "24px", letterSpacing: "normal" },
25
+ bold: { fontFamily: "Poppins, sans-serif", fontSize: "12px", fontWeight: 700, lineHeight: "24px", letterSpacing: "0.01em" },
26
+ regular: { fontFamily: "Poppins, sans-serif", fontSize: "12px", fontWeight: 400, lineHeight: "24px", letterSpacing: "normal" }
27
+ },
28
+ caption: {
29
+ semibold: { fontFamily: "Poppins, sans-serif", fontSize: "10px", fontWeight: 600, lineHeight: "23px", letterSpacing: "0.01em" },
30
+ regular: { fontFamily: "Poppins, sans-serif", fontSize: "10px", fontWeight: 400, lineHeight: "16px", letterSpacing: "0.01em" }
31
+ }
32
+ };
33
+
34
+ // src/components/Button/Button.tsx
35
+ import { forwardRef } from "react";
36
+
37
+ // src/utils/cx.ts
38
+ function cx(...parts) {
39
+ return parts.filter(Boolean).join(" ");
40
+ }
41
+
42
+ // src/components/Button/Button.tsx
43
+ import { jsx, jsxs } from "react/jsx-runtime";
44
+ var Button = forwardRef(function Button2({ variant = "primary", danger = false, size = "default", icon, children, className, disabled, ...rest }, ref) {
45
+ return /* @__PURE__ */ jsxs(
46
+ "button",
47
+ {
48
+ ref,
49
+ type: "button",
50
+ disabled,
51
+ className: cx(
52
+ "snacky-btn",
53
+ `snacky-btn--${variant}`,
54
+ size === "small" && "snacky-btn--small",
55
+ danger && "snacky-btn--danger",
56
+ className
57
+ ),
58
+ ...rest,
59
+ children: [
60
+ icon && /* @__PURE__ */ jsx("span", { className: "snacky-btn__icon", children: icon }),
61
+ children
62
+ ]
63
+ }
64
+ );
65
+ });
66
+
67
+ // src/components/IconButton/IconButton.tsx
68
+ import { forwardRef as forwardRef2 } from "react";
69
+ import { jsx as jsx2 } from "react/jsx-runtime";
70
+ var IconButton = forwardRef2(function IconButton2({ variant = "primary", size = "default", icon, selected = false, ariaLabel, className, disabled, ...rest }, ref) {
71
+ return /* @__PURE__ */ jsx2(
72
+ "button",
73
+ {
74
+ ref,
75
+ type: "button",
76
+ disabled,
77
+ "aria-label": ariaLabel,
78
+ "aria-pressed": selected,
79
+ className: cx(
80
+ "snacky-iconbtn",
81
+ `snacky-iconbtn--${variant}`,
82
+ size === "small" && "snacky-iconbtn--small",
83
+ selected && "snacky-iconbtn--selected",
84
+ className
85
+ ),
86
+ ...rest,
87
+ children: /* @__PURE__ */ jsx2("span", { className: "snacky-iconbtn__icon", children: icon })
88
+ }
89
+ );
90
+ });
91
+
92
+ // src/components/IconButton/UploadButton.tsx
93
+ import { forwardRef as forwardRef3 } from "react";
94
+ import { jsx as jsx3 } from "react/jsx-runtime";
95
+ var UploadButton = forwardRef3(function UploadButton2({ icon, ariaLabel = "Upload image", className, ...rest }, ref) {
96
+ return /* @__PURE__ */ jsx3("button", { ref, type: "button", "aria-label": ariaLabel, className: cx("snacky-upload", className), ...rest, children: icon });
97
+ });
98
+
99
+ // src/components/Input/TextField.tsx
100
+ import { forwardRef as forwardRef4, useId } from "react";
101
+ import { jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
102
+ var TextField = forwardRef4(function TextField2({
103
+ value,
104
+ onChange,
105
+ label,
106
+ leadingIcon,
107
+ trailingIcon,
108
+ trailingIconRotated = false,
109
+ error,
110
+ disabled,
111
+ className,
112
+ id,
113
+ ...rest
114
+ }, ref) {
115
+ const autoId = useId();
116
+ const fieldId = id ?? autoId;
117
+ const errorMessage = typeof error === "string" ? error : void 0;
118
+ return /* @__PURE__ */ jsxs2("div", { className, children: [
119
+ label && /* @__PURE__ */ jsx4("label", { className: "snacky-field-label", htmlFor: fieldId, children: label }),
120
+ /* @__PURE__ */ jsxs2(
121
+ "div",
122
+ {
123
+ className: cx("snacky-field", !!error && "snacky-field--error", disabled && "snacky-field--disabled"),
124
+ children: [
125
+ leadingIcon && /* @__PURE__ */ jsx4("span", { className: "snacky-field__icon", children: leadingIcon }),
126
+ /* @__PURE__ */ jsx4(
127
+ "input",
128
+ {
129
+ ref,
130
+ id: fieldId,
131
+ className: "snacky-field__input",
132
+ value,
133
+ onChange: (e) => onChange(e.target.value),
134
+ disabled,
135
+ ...rest
136
+ }
137
+ ),
138
+ trailingIcon && /* @__PURE__ */ jsx4(
139
+ "span",
140
+ {
141
+ className: "snacky-field__icon",
142
+ style: trailingIconRotated ? { transform: "rotate(180deg)" } : void 0,
143
+ children: trailingIcon
144
+ }
145
+ )
146
+ ]
147
+ }
148
+ ),
149
+ errorMessage && /* @__PURE__ */ jsx4("span", { className: "snacky-field-error", children: errorMessage })
150
+ ] });
151
+ });
152
+
153
+ // src/components/Input/SearchField.tsx
154
+ import { forwardRef as forwardRef5 } from "react";
155
+ import { jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
156
+ var SearchField = forwardRef5(function SearchField2({ value, onChange, searchIcon, onClear, className, placeholder = "Search products...", ...rest }, ref) {
157
+ return /* @__PURE__ */ jsxs3("div", { className: cx("snacky-search", className), children: [
158
+ searchIcon && /* @__PURE__ */ jsx5("span", { className: "snacky-search__icon", children: searchIcon }),
159
+ /* @__PURE__ */ jsx5(
160
+ "input",
161
+ {
162
+ ref,
163
+ className: "snacky-search__input",
164
+ value,
165
+ placeholder,
166
+ onChange: (e) => onChange(e.target.value),
167
+ ...rest
168
+ }
169
+ ),
170
+ value && onClear && /* @__PURE__ */ jsx5("button", { type: "button", className: "snacky-search__clear", onClick: onClear, "aria-label": "Clear search", children: "\u2715" })
171
+ ] });
172
+ });
173
+
174
+ // src/components/Input/OtpField.tsx
175
+ import { useRef } from "react";
176
+ import { jsx as jsx6 } from "react/jsx-runtime";
177
+ function OtpField({ value, onChange, length = 6, disabled }) {
178
+ const cellRefs = useRef([]);
179
+ const digits = Array.from({ length }, (_, i) => value[i] ?? "");
180
+ function setDigit(index, digit) {
181
+ const next = digits.slice();
182
+ next[index] = digit;
183
+ onChange(next.join(""));
184
+ if (digit && index < length - 1) cellRefs.current[index + 1]?.focus();
185
+ }
186
+ function handleKeyDown(index, e) {
187
+ if (e.key === "Backspace" && !digits[index] && index > 0) {
188
+ cellRefs.current[index - 1]?.focus();
189
+ }
190
+ }
191
+ return /* @__PURE__ */ jsx6("div", { className: "snacky-otp", children: digits.map((digit, i) => /* @__PURE__ */ jsx6(
192
+ "input",
193
+ {
194
+ ref: (el) => {
195
+ cellRefs.current[i] = el;
196
+ },
197
+ className: "snacky-otp__cell",
198
+ inputMode: "numeric",
199
+ maxLength: 1,
200
+ value: digit,
201
+ disabled,
202
+ onChange: (e) => setDigit(i, e.target.value.replace(/\D/g, "").slice(-1)),
203
+ onKeyDown: (e) => handleKeyDown(i, e),
204
+ "aria-label": `Digit ${i + 1}`
205
+ },
206
+ i
207
+ )) });
208
+ }
209
+
210
+ // src/components/Input/CopyField.tsx
211
+ import { useState } from "react";
212
+ import { jsx as jsx7, jsxs as jsxs4 } from "react/jsx-runtime";
213
+ function CopyField({ value, onCopy, className }) {
214
+ const [copied, setCopied] = useState(false);
215
+ async function handleCopy() {
216
+ try {
217
+ await navigator.clipboard.writeText(value);
218
+ } catch {
219
+ }
220
+ onCopy?.(value);
221
+ setCopied(true);
222
+ setTimeout(() => setCopied(false), 2e3);
223
+ }
224
+ return /* @__PURE__ */ jsxs4("div", { className: cx("snacky-copy", className), children: [
225
+ /* @__PURE__ */ jsx7("span", { className: "snacky-copy__value", children: value }),
226
+ /* @__PURE__ */ jsx7("button", { type: "button", className: cx("snacky-copy__action", copied && "snacky-copy__action--copied"), onClick: handleCopy, children: copied ? "Copied" : "Copy" })
227
+ ] });
228
+ }
229
+
230
+ // src/components/Input/ChatInput.tsx
231
+ import { jsx as jsx8, jsxs as jsxs5 } from "react/jsx-runtime";
232
+ function ChatInput({ value, onChange, onSend, sendIcon, className, placeholder = "Write your message here", ...rest }) {
233
+ return /* @__PURE__ */ jsxs5("div", { className: cx("snacky-chatfield", className), children: [
234
+ /* @__PURE__ */ jsx8(
235
+ "input",
236
+ {
237
+ className: "snacky-chatfield__input",
238
+ value,
239
+ placeholder,
240
+ onChange: (e) => onChange(e.target.value),
241
+ onKeyDown: (e) => e.key === "Enter" && value && onSend(),
242
+ ...rest
243
+ }
244
+ ),
245
+ /* @__PURE__ */ jsx8(
246
+ "button",
247
+ {
248
+ type: "button",
249
+ className: cx("snacky-chatfield__send", value && "snacky-chatfield__send--active"),
250
+ onClick: onSend,
251
+ disabled: !value,
252
+ "aria-label": "Send",
253
+ children: sendIcon ?? "\u27A4"
254
+ }
255
+ )
256
+ ] });
257
+ }
258
+
259
+ // src/components/Input/AddressResult.tsx
260
+ import { jsx as jsx9, jsxs as jsxs6 } from "react/jsx-runtime";
261
+ function AddressResult({ icon, title, subtitle, onClick, className }) {
262
+ return /* @__PURE__ */ jsxs6("button", { type: "button", className: cx("snacky-address-result", className), onClick, children: [
263
+ icon && /* @__PURE__ */ jsx9("span", { className: "snacky-address-result__icon", children: icon }),
264
+ /* @__PURE__ */ jsxs6("span", { children: [
265
+ /* @__PURE__ */ jsx9("p", { className: "snacky-address-result__title", children: title }),
266
+ /* @__PURE__ */ jsx9("p", { className: "snacky-address-result__subtitle", children: subtitle })
267
+ ] })
268
+ ] });
269
+ }
270
+
271
+ // src/components/Chips/ProductChip.tsx
272
+ import { jsx as jsx10, jsxs as jsxs7 } from "react/jsx-runtime";
273
+ function ProductChip({ label, selected, thumbnail, onClick, className, ...rest }) {
274
+ return /* @__PURE__ */ jsxs7(
275
+ "button",
276
+ {
277
+ type: "button",
278
+ className: cx("snacky-chip", selected && "snacky-chip--selected", className),
279
+ "aria-pressed": selected,
280
+ onClick,
281
+ ...rest,
282
+ children: [
283
+ /* @__PURE__ */ jsx10("span", { className: "snacky-chip__thumb", children: thumbnail }),
284
+ label
285
+ ]
286
+ }
287
+ );
288
+ }
289
+
290
+ // src/components/Chips/FilterChip.tsx
291
+ import { jsx as jsx11 } from "react/jsx-runtime";
292
+ function FilterChip({ label, selected, onClick, className, ...rest }) {
293
+ return /* @__PURE__ */ jsx11(
294
+ "button",
295
+ {
296
+ type: "button",
297
+ className: cx("snacky-chip", selected && "snacky-chip--selected", className),
298
+ "aria-pressed": selected,
299
+ onClick,
300
+ ...rest,
301
+ children: label
302
+ }
303
+ );
304
+ }
305
+
306
+ // src/components/RadioButton/RadioButton.tsx
307
+ import { useId as useId2 } from "react";
308
+ import { jsx as jsx12, jsxs as jsxs8 } from "react/jsx-runtime";
309
+ function RadioOption({ label, selected, onClick, disabled, name, className }) {
310
+ const id = useId2();
311
+ return /* @__PURE__ */ jsxs8(
312
+ "label",
313
+ {
314
+ htmlFor: id,
315
+ className: cx("snacky-radio-option", disabled && "snacky-radio-option--disabled", className),
316
+ children: [
317
+ /* @__PURE__ */ jsx12(
318
+ "input",
319
+ {
320
+ id,
321
+ type: "radio",
322
+ className: "snacky-radio",
323
+ name,
324
+ checked: selected,
325
+ disabled,
326
+ onChange: onClick
327
+ }
328
+ ),
329
+ label
330
+ ]
331
+ }
332
+ );
333
+ }
334
+
335
+ // src/components/Checkbox/Checkbox.tsx
336
+ import { useId as useId3 } from "react";
337
+ import { jsx as jsx13, jsxs as jsxs9 } from "react/jsx-runtime";
338
+ function Checkbox({ label, checked, onChange, disabled, className }) {
339
+ const id = useId3();
340
+ return /* @__PURE__ */ jsxs9("label", { htmlFor: id, className: cx("snacky-checkbox-option", className), children: [
341
+ /* @__PURE__ */ jsx13(
342
+ "input",
343
+ {
344
+ id,
345
+ type: "checkbox",
346
+ className: "snacky-checkbox",
347
+ checked,
348
+ disabled,
349
+ onChange: (e) => onChange(e.target.checked)
350
+ }
351
+ ),
352
+ label
353
+ ] });
354
+ }
355
+
356
+ // src/components/Toggle/Toggle.tsx
357
+ import { jsx as jsx14, jsxs as jsxs10 } from "react/jsx-runtime";
358
+ function Toggle({ checked, onChange, disabled, ariaLabel = "Toggle", className }) {
359
+ return /* @__PURE__ */ jsxs10(
360
+ "button",
361
+ {
362
+ type: "button",
363
+ role: "switch",
364
+ "aria-checked": checked,
365
+ "aria-label": ariaLabel,
366
+ disabled,
367
+ className: cx("snacky-toggle", checked && "snacky-toggle--on", className),
368
+ onClick: () => onChange(!checked),
369
+ children: [
370
+ /* @__PURE__ */ jsx14("span", { className: "snacky-toggle__track" }),
371
+ /* @__PURE__ */ jsx14("span", { className: "snacky-toggle__thumb" })
372
+ ]
373
+ }
374
+ );
375
+ }
376
+
377
+ // src/components/Navbar/Navbar.tsx
378
+ import { jsx as jsx15, jsxs as jsxs11 } from "react/jsx-runtime";
379
+ function NavBar({ items, selected, onSelect, className }) {
380
+ return /* @__PURE__ */ jsx15("nav", { className: cx("snacky-navbar", className), children: items.map((item, i) => {
381
+ const active = i === selected;
382
+ return /* @__PURE__ */ jsxs11(
383
+ "button",
384
+ {
385
+ type: "button",
386
+ className: cx("snacky-navbar__item", active && "snacky-navbar__item--active"),
387
+ "aria-current": active ? "page" : void 0,
388
+ onClick: () => onSelect(i),
389
+ children: [
390
+ /* @__PURE__ */ jsx15("span", { className: "snacky-navbar__icon", children: active && item.activeIcon ? item.activeIcon : item.icon }),
391
+ item.label
392
+ ]
393
+ },
394
+ item.label
395
+ );
396
+ }) });
397
+ }
398
+
399
+ // src/components/Tab/Tab.tsx
400
+ import { jsx as jsx16 } from "react/jsx-runtime";
401
+ function TabRow({ tabs, selected, onSelect, className }) {
402
+ return /* @__PURE__ */ jsx16("div", { className: cx("snacky-tabrow", className), role: "tablist", children: tabs.map((tab, i) => /* @__PURE__ */ jsx16(
403
+ "button",
404
+ {
405
+ type: "button",
406
+ role: "tab",
407
+ "aria-selected": i === selected,
408
+ className: cx("snacky-tab", i === selected && "snacky-tab--active"),
409
+ onClick: () => onSelect(i),
410
+ children: tab
411
+ },
412
+ tab
413
+ )) });
414
+ }
415
+
416
+ // src/icons/outline.tsx
417
+ var outline_exports = {};
418
+ __export(outline_exports, {
419
+ account: () => account,
420
+ back: () => back,
421
+ bell: () => bell,
422
+ calendar: () => calendar,
423
+ camera: () => camera,
424
+ cart: () => cart,
425
+ cartAdd: () => cartAdd,
426
+ cash: () => cash,
427
+ category: () => category,
428
+ chat: () => chat,
429
+ check: () => check,
430
+ chevronDown: () => chevronDown,
431
+ chevronRight: () => chevronRight,
432
+ chevronUp: () => chevronUp,
433
+ clock: () => clock,
434
+ close: () => close,
435
+ closeCircle: () => closeCircle,
436
+ creditCard: () => creditCard,
437
+ document: () => document,
438
+ edit: () => edit,
439
+ eye: () => eye,
440
+ eyeOff: () => eyeOff,
441
+ heart: () => heart,
442
+ help: () => help,
443
+ history: () => history,
444
+ home: () => home,
445
+ key: () => key,
446
+ location: () => location,
447
+ lock: () => lock,
448
+ logout: () => logout,
449
+ messageSquare: () => messageSquare,
450
+ minus: () => minus,
451
+ phone: () => phone,
452
+ pin: () => pin,
453
+ plus: () => plus,
454
+ receipt: () => receipt,
455
+ search: () => search,
456
+ send: () => send,
457
+ share: () => share,
458
+ smartphone: () => smartphone,
459
+ trash: () => trash,
460
+ truck: () => truck
461
+ });
462
+ import { Fragment, jsx as jsx17, jsxs as jsxs12 } from "react/jsx-runtime";
463
+ function base(path) {
464
+ return function OutlineIcon({ width = 24, height = 24, color = "currentColor", ...rest }) {
465
+ return /* @__PURE__ */ jsx17("svg", { width, height, viewBox: "0 0 24 24", fill: "none", stroke: color, strokeWidth: 1.5, strokeLinecap: "round", strokeLinejoin: "round", ...rest, children: path });
466
+ };
467
+ }
468
+ var home = base(/* @__PURE__ */ jsx17("path", { d: "M4 10.5 12 4l8 6.5V19a1 1 0 0 1-1 1h-4v-6H9v6H5a1 1 0 0 1-1-1v-8.5Z" }));
469
+ var category = base(/* @__PURE__ */ jsxs12(Fragment, { children: [
470
+ /* @__PURE__ */ jsx17("rect", { x: "4", y: "4", width: "7", height: "7", rx: "1" }),
471
+ /* @__PURE__ */ jsx17("rect", { x: "13", y: "4", width: "7", height: "7", rx: "1" }),
472
+ /* @__PURE__ */ jsx17("rect", { x: "4", y: "13", width: "7", height: "7", rx: "1" }),
473
+ /* @__PURE__ */ jsx17("rect", { x: "13", y: "13", width: "7", height: "7", rx: "1" })
474
+ ] }));
475
+ var cart = base(/* @__PURE__ */ jsxs12(Fragment, { children: [
476
+ /* @__PURE__ */ jsx17("circle", { cx: "9", cy: "20", r: "1" }),
477
+ /* @__PURE__ */ jsx17("circle", { cx: "17", cy: "20", r: "1" }),
478
+ /* @__PURE__ */ jsx17("path", { d: "M3 4h2l2.4 11.6a1.5 1.5 0 0 0 1.47 1.2h8.06a1.5 1.5 0 0 0 1.47-1.2L20 7H6" })
479
+ ] }));
480
+ var cartAdd = base(/* @__PURE__ */ jsxs12(Fragment, { children: [
481
+ /* @__PURE__ */ jsx17("circle", { cx: "9", cy: "20", r: "1" }),
482
+ /* @__PURE__ */ jsx17("circle", { cx: "17", cy: "20", r: "1" }),
483
+ /* @__PURE__ */ jsx17("path", { d: "M3 4h2l2.4 11.6a1.5 1.5 0 0 0 1.47 1.2h8.06a1.5 1.5 0 0 0 1.47-1.2L20 7H6" }),
484
+ /* @__PURE__ */ jsx17("path", { d: "M18 2v5M15.5 4.5h5" })
485
+ ] }));
486
+ var history = base(/* @__PURE__ */ jsxs12(Fragment, { children: [
487
+ /* @__PURE__ */ jsx17("path", { d: "M3 12a9 9 0 1 0 3-6.7" }),
488
+ /* @__PURE__ */ jsx17("path", { d: "M3 4v4h4" }),
489
+ /* @__PURE__ */ jsx17("path", { d: "M12 8v4l3 2" })
490
+ ] }));
491
+ var account = base(/* @__PURE__ */ jsxs12(Fragment, { children: [
492
+ /* @__PURE__ */ jsx17("circle", { cx: "12", cy: "8", r: "3.5" }),
493
+ /* @__PURE__ */ jsx17("path", { d: "M5 20c0-3.3 3.1-6 7-6s7 2.7 7 6" })
494
+ ] }));
495
+ var eye = base(/* @__PURE__ */ jsxs12(Fragment, { children: [
496
+ /* @__PURE__ */ jsx17("path", { d: "M2 12s3.5-6.5 10-6.5S22 12 22 12s-3.5 6.5-10 6.5S2 12 2 12Z" }),
497
+ /* @__PURE__ */ jsx17("circle", { cx: "12", cy: "12", r: "2.5" })
498
+ ] }));
499
+ var eyeOff = base(/* @__PURE__ */ jsxs12(Fragment, { children: [
500
+ /* @__PURE__ */ jsx17("path", { d: "M3 3l18 18" }),
501
+ /* @__PURE__ */ jsx17("path", { d: "M10.6 5.6A9.9 9.9 0 0 1 12 5.5c6.5 0 10 6.5 10 6.5a15.9 15.9 0 0 1-3.4 4.2M6.5 6.8A16.4 16.4 0 0 0 2 12s3.5 6.5 10 6.5a10 10 0 0 0 4-.8" }),
502
+ /* @__PURE__ */ jsx17("path", { d: "M9.9 9.9a2.5 2.5 0 0 0 3.5 3.5" })
503
+ ] }));
504
+ var chevronDown = base(/* @__PURE__ */ jsx17("path", { d: "M6 9l6 6 6-6" }));
505
+ var chevronUp = base(/* @__PURE__ */ jsx17("path", { d: "M6 15l6-6 6 6" }));
506
+ var chevronRight = base(/* @__PURE__ */ jsx17("path", { d: "M9 6l6 6-6 6" }));
507
+ var back = base(/* @__PURE__ */ jsx17("path", { d: "M15 6l-6 6 6 6" }));
508
+ var close = base(/* @__PURE__ */ jsx17("path", { d: "M6 6l12 12M18 6L6 18" }));
509
+ var closeCircle = base(/* @__PURE__ */ jsxs12(Fragment, { children: [
510
+ /* @__PURE__ */ jsx17("circle", { cx: "12", cy: "12", r: "9" }),
511
+ /* @__PURE__ */ jsx17("path", { d: "M9 9l6 6M15 9l-6 6" })
512
+ ] }));
513
+ var calendar = base(/* @__PURE__ */ jsxs12(Fragment, { children: [
514
+ /* @__PURE__ */ jsx17("rect", { x: "3", y: "5", width: "18", height: "16", rx: "2" }),
515
+ /* @__PURE__ */ jsx17("path", { d: "M3 9h18M8 3v4M16 3v4" })
516
+ ] }));
517
+ var search = base(/* @__PURE__ */ jsxs12(Fragment, { children: [
518
+ /* @__PURE__ */ jsx17("circle", { cx: "11", cy: "11", r: "7" }),
519
+ /* @__PURE__ */ jsx17("path", { d: "M21 21l-4.3-4.3" })
520
+ ] }));
521
+ var location = base(/* @__PURE__ */ jsxs12(Fragment, { children: [
522
+ /* @__PURE__ */ jsx17("path", { d: "M12 21s7-7.2 7-12a7 7 0 0 0-14 0c0 4.8 7 12 7 12Z" }),
523
+ /* @__PURE__ */ jsx17("circle", { cx: "12", cy: "9", r: "2.5" })
524
+ ] }));
525
+ var pin = location;
526
+ var send = base(/* @__PURE__ */ jsx17("path", { d: "M22 2 11 13M22 2l-7 20-4-9-9-4 20-7Z" }));
527
+ var chat = base(/* @__PURE__ */ jsx17("path", { d: "M21 12a8 8 0 1 1-3.3-6.5L21 4l-1 4.7A7.9 7.9 0 0 1 21 12Z" }));
528
+ var messageSquare = base(/* @__PURE__ */ jsx17("path", { d: "M4 4h16v12H8l-4 4V4Z" }));
529
+ var heart = base(/* @__PURE__ */ jsx17("path", { d: "M12 20s-7-4.4-9.3-9A5 5 0 0 1 12 6a5 5 0 0 1 9.3 5c-2.3 4.6-9.3 9-9.3 9Z" }));
530
+ var bell = base(/* @__PURE__ */ jsxs12(Fragment, { children: [
531
+ /* @__PURE__ */ jsx17("path", { d: "M6 9a6 6 0 0 1 12 0c0 5 2 6 2 6H4s2-1 2-6Z" }),
532
+ /* @__PURE__ */ jsx17("path", { d: "M10 19a2 2 0 0 0 4 0" })
533
+ ] }));
534
+ var check = base(/* @__PURE__ */ jsx17("path", { d: "M5 13l4 4 10-10" }));
535
+ var plus = base(/* @__PURE__ */ jsx17("path", { d: "M12 5v14M5 12h14" }));
536
+ var minus = base(/* @__PURE__ */ jsx17("path", { d: "M5 12h14" }));
537
+ var trash = base(/* @__PURE__ */ jsx17(Fragment, { children: /* @__PURE__ */ jsx17("path", { d: "M4 7h16M9 7V5a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2M6 7l1 13a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1l1-13" }) }));
538
+ var edit = base(/* @__PURE__ */ jsx17(Fragment, { children: /* @__PURE__ */ jsx17("path", { d: "M4 20h4L18.5 9.5a2.1 2.1 0 0 0-3-3L5 17v3Z" }) }));
539
+ var share = base(/* @__PURE__ */ jsxs12(Fragment, { children: [
540
+ /* @__PURE__ */ jsx17("circle", { cx: "6", cy: "12", r: "2.5" }),
541
+ /* @__PURE__ */ jsx17("circle", { cx: "18", cy: "6", r: "2.5" }),
542
+ /* @__PURE__ */ jsx17("circle", { cx: "18", cy: "18", r: "2.5" }),
543
+ /* @__PURE__ */ jsx17("path", { d: "M8.3 10.7l7.4-4.4M8.3 13.3l7.4 4.4" })
544
+ ] }));
545
+ var camera = base(/* @__PURE__ */ jsxs12(Fragment, { children: [
546
+ /* @__PURE__ */ jsx17("path", { d: "M4 8h3l2-2h6l2 2h3v11H4V8Z" }),
547
+ /* @__PURE__ */ jsx17("circle", { cx: "12", cy: "13.5", r: "3.5" })
548
+ ] }));
549
+ var phone = base(/* @__PURE__ */ jsx17("path", { d: "M6 3h3l2 5-2.5 1.5a12 12 0 0 0 6 6L16 13l5 2v3a2 2 0 0 1-2 2A16 16 0 0 1 4 5a2 2 0 0 1 2-2Z" }));
550
+ var lock = base(/* @__PURE__ */ jsxs12(Fragment, { children: [
551
+ /* @__PURE__ */ jsx17("rect", { x: "5", y: "11", width: "14", height: "9", rx: "1.5" }),
552
+ /* @__PURE__ */ jsx17("path", { d: "M8 11V8a4 4 0 0 1 8 0v3" })
553
+ ] }));
554
+ var document = base(/* @__PURE__ */ jsxs12(Fragment, { children: [
555
+ /* @__PURE__ */ jsx17("path", { d: "M7 3h7l4 4v14H7V3Z" }),
556
+ /* @__PURE__ */ jsx17("path", { d: "M14 3v4h4" })
557
+ ] }));
558
+ var creditCard = base(/* @__PURE__ */ jsxs12(Fragment, { children: [
559
+ /* @__PURE__ */ jsx17("rect", { x: "3", y: "6", width: "18", height: "12", rx: "2" }),
560
+ /* @__PURE__ */ jsx17("path", { d: "M3 10h18" })
561
+ ] }));
562
+ var receipt = base(/* @__PURE__ */ jsxs12(Fragment, { children: [
563
+ /* @__PURE__ */ jsx17("path", { d: "M6 3h12v18l-2-1.5-2 1.5-2-1.5-2 1.5-2-1.5-2 1.5V3Z" }),
564
+ /* @__PURE__ */ jsx17("path", { d: "M9 8h6M9 12h6" })
565
+ ] }));
566
+ var smartphone = base(/* @__PURE__ */ jsxs12(Fragment, { children: [
567
+ /* @__PURE__ */ jsx17("rect", { x: "7", y: "2", width: "10", height: "20", rx: "2" }),
568
+ /* @__PURE__ */ jsx17("path", { d: "M11 19h2" })
569
+ ] }));
570
+ var key = base(/* @__PURE__ */ jsxs12(Fragment, { children: [
571
+ /* @__PURE__ */ jsx17("circle", { cx: "8", cy: "15", r: "4" }),
572
+ /* @__PURE__ */ jsx17("path", { d: "M11 12l9-9M17 6l3 3M14 9l2 2" })
573
+ ] }));
574
+ var help = base(/* @__PURE__ */ jsxs12(Fragment, { children: [
575
+ /* @__PURE__ */ jsx17("circle", { cx: "12", cy: "12", r: "9" }),
576
+ /* @__PURE__ */ jsx17("path", { d: "M9.5 9.5a2.5 2.5 0 1 1 3.5 2.3c-.9.4-1 1-1 1.7" }),
577
+ /* @__PURE__ */ jsx17("path", { d: "M12 17h.01" })
578
+ ] }));
579
+ var logout = base(/* @__PURE__ */ jsxs12(Fragment, { children: [
580
+ /* @__PURE__ */ jsx17("path", { d: "M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4" }),
581
+ /* @__PURE__ */ jsx17("path", { d: "M16 17l5-5-5-5M21 12H9" })
582
+ ] }));
583
+ var truck = base(/* @__PURE__ */ jsxs12(Fragment, { children: [
584
+ /* @__PURE__ */ jsx17("path", { d: "M2 7h11v10H2V7Z" }),
585
+ /* @__PURE__ */ jsx17("path", { d: "M13 10h4l4 3v4h-8v-7Z" }),
586
+ /* @__PURE__ */ jsx17("circle", { cx: "7", cy: "19", r: "1.5" }),
587
+ /* @__PURE__ */ jsx17("circle", { cx: "17", cy: "19", r: "1.5" })
588
+ ] }));
589
+ var cash = base(/* @__PURE__ */ jsxs12(Fragment, { children: [
590
+ /* @__PURE__ */ jsx17("rect", { x: "2", y: "6", width: "20", height: "12", rx: "2" }),
591
+ /* @__PURE__ */ jsx17("circle", { cx: "12", cy: "12", r: "3" })
592
+ ] }));
593
+ var clock = base(/* @__PURE__ */ jsxs12(Fragment, { children: [
594
+ /* @__PURE__ */ jsx17("circle", { cx: "12", cy: "12", r: "9" }),
595
+ /* @__PURE__ */ jsx17("path", { d: "M12 7v5l3.5 2" })
596
+ ] }));
597
+
598
+ // src/icons/solid.tsx
599
+ var solid_exports = {};
600
+ __export(solid_exports, {
601
+ cart: () => cart2,
602
+ category: () => category2,
603
+ heart: () => heart2,
604
+ home: () => home2
605
+ });
606
+ import { Fragment as Fragment2, jsx as jsx18, jsxs as jsxs13 } from "react/jsx-runtime";
607
+ function base2(path) {
608
+ return function SolidIcon({ width = 24, height = 24, color = "currentColor", ...rest }) {
609
+ return /* @__PURE__ */ jsx18("svg", { width, height, viewBox: "0 0 24 24", fill: color, ...rest, children: path });
610
+ };
611
+ }
612
+ var home2 = base2(/* @__PURE__ */ jsx18("path", { d: "M4 10.5 12 4l8 6.5V19a1 1 0 0 1-1 1h-4v-6H9v6H5a1 1 0 0 1-1-1v-8.5Z" }));
613
+ var category2 = base2(/* @__PURE__ */ jsxs13(Fragment2, { children: [
614
+ /* @__PURE__ */ jsx18("rect", { x: "4", y: "4", width: "7", height: "7", rx: "1" }),
615
+ /* @__PURE__ */ jsx18("rect", { x: "13", y: "4", width: "7", height: "7", rx: "1" }),
616
+ /* @__PURE__ */ jsx18("rect", { x: "4", y: "13", width: "7", height: "7", rx: "1" }),
617
+ /* @__PURE__ */ jsx18("rect", { x: "13", y: "13", width: "7", height: "7", rx: "1" })
618
+ ] }));
619
+ var cart2 = base2(/* @__PURE__ */ jsx18("path", { d: "M3 4h2l2.4 11.6a1.5 1.5 0 0 0 1.47 1.2h8.06a1.5 1.5 0 0 0 1.47-1.2L20 7H6l-.4-2H3v-1Zm6 16a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm8 0a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z" }));
620
+ var heart2 = base2(/* @__PURE__ */ jsx18("path", { d: "M12 20s-7-4.4-9.3-9A5 5 0 0 1 12 6a5 5 0 0 1 9.3 5c-2.3 4.6-9.3 9-9.3 9Z" }));
621
+
622
+ // src/icons/index.ts
623
+ var SnackyIcons = { outline: outline_exports, solid: solid_exports };
624
+
625
+ // src/components/Header/Header.tsx
626
+ import { jsx as jsx19, jsxs as jsxs14 } from "react/jsx-runtime";
627
+ function Header({ title, leadingIcon, onLeadingClick, trailingIcon, onTrailingClick, className }) {
628
+ const LeadingIconEl = leadingIcon === "back" ? SnackyIcons.outline.back : SnackyIcons.outline.close;
629
+ return /* @__PURE__ */ jsxs14("header", { className: cx("snacky-header", className), children: [
630
+ leadingIcon && /* @__PURE__ */ jsx19(
631
+ "button",
632
+ {
633
+ type: "button",
634
+ className: "snacky-header__icon-btn",
635
+ onClick: onLeadingClick,
636
+ "aria-label": leadingIcon === "back" ? "Back" : "Close",
637
+ children: /* @__PURE__ */ jsx19(LeadingIconEl, { width: 24, height: 24 })
638
+ }
639
+ ),
640
+ /* @__PURE__ */ jsx19("div", { className: cx("snacky-header__title-row", leadingIcon && !trailingIcon && "snacky-header__title-row--balance"), children: /* @__PURE__ */ jsx19("span", { className: "snacky-header__title", children: title }) }),
641
+ trailingIcon && /* @__PURE__ */ jsx19("button", { type: "button", className: "snacky-header__icon-btn", onClick: onTrailingClick, "aria-label": "Action", children: trailingIcon })
642
+ ] });
643
+ }
644
+
645
+ // src/components/Banner/Banner.tsx
646
+ import { jsx as jsx20, jsxs as jsxs15 } from "react/jsx-runtime";
647
+ function HeroBanner({ imageUrl, alt, onClick, className }) {
648
+ return /* @__PURE__ */ jsx20("img", { src: imageUrl, alt, onClick, className: cx("snacky-banner-hero", className) });
649
+ }
650
+ function SquareBanner({ imageUrl, alt, onClick, className }) {
651
+ return /* @__PURE__ */ jsx20("img", { src: imageUrl, alt, onClick, className: cx("snacky-banner-square", className) });
652
+ }
653
+ function FullWidthBanner({ imageUrl, alt, onClick, className }) {
654
+ return /* @__PURE__ */ jsx20("img", { src: imageUrl, alt, onClick, className: cx("snacky-banner-full", className) });
655
+ }
656
+ function PointBalanceBanner({ pointsIcon, points, balanceIcon, balance, className }) {
657
+ return /* @__PURE__ */ jsxs15("div", { className: cx("snacky-banner-point-balance", className), children: [
658
+ /* @__PURE__ */ jsxs15("div", { className: "snacky-banner-point-balance__item", children: [
659
+ /* @__PURE__ */ jsx20("span", { className: "snacky-banner-point-balance__icon", children: pointsIcon }),
660
+ /* @__PURE__ */ jsxs15("div", { children: [
661
+ /* @__PURE__ */ jsx20("p", { className: "snacky-banner-point-balance__label", children: "Points" }),
662
+ /* @__PURE__ */ jsx20("p", { className: "snacky-banner-point-balance__value", children: points })
663
+ ] })
664
+ ] }),
665
+ /* @__PURE__ */ jsx20("div", { className: "snacky-banner-point-balance__divider" }),
666
+ /* @__PURE__ */ jsxs15("div", { className: "snacky-banner-point-balance__item", children: [
667
+ /* @__PURE__ */ jsx20("span", { className: "snacky-banner-point-balance__icon", children: balanceIcon }),
668
+ /* @__PURE__ */ jsxs15("div", { children: [
669
+ /* @__PURE__ */ jsx20("p", { className: "snacky-banner-point-balance__label", children: "Balance" }),
670
+ /* @__PURE__ */ jsx20("p", { className: "snacky-banner-point-balance__value", children: balance })
671
+ ] })
672
+ ] })
673
+ ] });
674
+ }
675
+ function AlertBanner({ message, countdown, className }) {
676
+ return /* @__PURE__ */ jsxs15("div", { className: cx("snacky-banner-alert", className), children: [
677
+ /* @__PURE__ */ jsx20("p", { className: "snacky-banner-alert__message", children: message }),
678
+ countdown && /* @__PURE__ */ jsx20("p", { className: "snacky-banner-alert__countdown", children: countdown })
679
+ ] });
680
+ }
681
+
682
+ // src/components/Badge/Badge.tsx
683
+ import { Fragment as Fragment3, jsx as jsx21, jsxs as jsxs16 } from "react/jsx-runtime";
684
+ function NotificationBadge({ count, max = 99, children, className }) {
685
+ if (count <= 0) return /* @__PURE__ */ jsx21(Fragment3, { children });
686
+ return /* @__PURE__ */ jsxs16("span", { className: cx("snacky-badge-wrap", className), children: [
687
+ children,
688
+ /* @__PURE__ */ jsx21("span", { className: "snacky-badge-notification", children: count > max ? `${max}+` : count })
689
+ ] });
690
+ }
691
+ function DiscountTag({ label, className }) {
692
+ return /* @__PURE__ */ jsx21("span", { className: cx("snacky-discount-tag", className), children: label });
693
+ }
694
+ function SoldOutBadge({ className }) {
695
+ return /* @__PURE__ */ jsx21("span", { className: cx("snacky-soldout-badge", className), children: "Sold Out" });
696
+ }
697
+ function VariantBadge({ label, className }) {
698
+ return /* @__PURE__ */ jsx21("span", { className: cx("snacky-variant-badge", className), children: label });
699
+ }
700
+
701
+ // src/components/Callout/Callout.tsx
702
+ import { jsx as jsx22, jsxs as jsxs17 } from "react/jsx-runtime";
703
+ function Callout({ message, timestamp, variant, statusIcon, className }) {
704
+ return /* @__PURE__ */ jsxs17("div", { className: cx("snacky-callout", `snacky-callout--${variant}`, className), children: [
705
+ /* @__PURE__ */ jsx22("p", { className: "snacky-callout__message", children: message }),
706
+ /* @__PURE__ */ jsxs17("span", { className: "snacky-callout__meta", children: [
707
+ timestamp,
708
+ statusIcon && variant !== "received" && /* @__PURE__ */ jsx22("span", { className: "snacky-callout__meta-icon", children: statusIcon })
709
+ ] })
710
+ ] });
711
+ }
712
+
713
+ // src/components/List/List.tsx
714
+ import { jsx as jsx23, jsxs as jsxs18 } from "react/jsx-runtime";
715
+ var STATUS_LABEL = {
716
+ waiting: "Waiting for Payment",
717
+ process: "Order Processing",
718
+ processCod: "Order Processing",
719
+ shipped: "Order Shipped",
720
+ received: "Order Received",
721
+ cancelled: "Order Cancelled"
722
+ };
723
+ var STATUS_ACTION = {
724
+ shipped: "Track Shipment",
725
+ received: "Buy Again",
726
+ cancelled: "Buy Again"
727
+ };
728
+ function OrderListItem({
729
+ productImage,
730
+ productName,
731
+ status,
732
+ itemsSummary,
733
+ total,
734
+ paymentDeadline,
735
+ actionLabel,
736
+ onAction,
737
+ onClick,
738
+ className
739
+ }) {
740
+ const action = actionLabel ?? STATUS_ACTION[status];
741
+ const isCod = status === "processCod";
742
+ return /* @__PURE__ */ jsxs18(
743
+ "div",
744
+ {
745
+ className: cx("snacky-order-item", className),
746
+ role: onClick ? "button" : void 0,
747
+ tabIndex: onClick ? 0 : void 0,
748
+ onClick,
749
+ onKeyDown: onClick ? (e) => (e.key === "Enter" || e.key === " ") && onClick() : void 0,
750
+ children: [
751
+ /* @__PURE__ */ jsxs18("div", { className: "snacky-order-item__top", children: [
752
+ /* @__PURE__ */ jsx23("div", { className: "snacky-order-item__thumb-box", children: /* @__PURE__ */ jsx23("img", { className: "snacky-order-item__thumb", src: productImage, alt: "" }) }),
753
+ /* @__PURE__ */ jsxs18("div", { className: "snacky-order-item__info", children: [
754
+ /* @__PURE__ */ jsx23(
755
+ "span",
756
+ {
757
+ className: cx("snacky-order-item__status", status === "cancelled" && "snacky-order-item__status--cancelled"),
758
+ children: STATUS_LABEL[status]
759
+ }
760
+ ),
761
+ /* @__PURE__ */ jsx23("span", { className: "snacky-order-item__name", children: productName })
762
+ ] })
763
+ ] }),
764
+ /* @__PURE__ */ jsxs18("div", { className: "snacky-order-item__details", children: [
765
+ /* @__PURE__ */ jsx23("span", { className: "snacky-order-item__count", children: itemsSummary }),
766
+ /* @__PURE__ */ jsxs18("span", { className: cx("snacky-order-item__total", isCod && "snacky-order-item__total--cod"), children: [
767
+ "Order Total: ",
768
+ /* @__PURE__ */ jsx23("b", { children: total })
769
+ ] }),
770
+ isCod && /* @__PURE__ */ jsx23("span", { className: "snacky-order-item__cod", children: "COD" })
771
+ ] }),
772
+ status === "waiting" && paymentDeadline && /* @__PURE__ */ jsxs18("div", { className: "snacky-order-item__deadline", children: [
773
+ "Pay before ",
774
+ paymentDeadline
775
+ ] }),
776
+ action && /* @__PURE__ */ jsx23("div", { className: "snacky-order-item__action-row", children: /* @__PURE__ */ jsx23(
777
+ Button,
778
+ {
779
+ variant: "primary",
780
+ onClick: (e) => {
781
+ e.stopPropagation();
782
+ onAction?.();
783
+ },
784
+ children: action
785
+ }
786
+ ) })
787
+ ]
788
+ }
789
+ );
790
+ }
791
+ function NotificationListItem({ title, message, unread = false, onClick, className }) {
792
+ return /* @__PURE__ */ jsxs18(
793
+ "div",
794
+ {
795
+ className: cx("snacky-notif-item", unread && "snacky-notif-item--unread", className),
796
+ role: onClick ? "button" : void 0,
797
+ tabIndex: onClick ? 0 : void 0,
798
+ onClick,
799
+ onKeyDown: onClick ? (e) => (e.key === "Enter" || e.key === " ") && onClick() : void 0,
800
+ children: [
801
+ /* @__PURE__ */ jsx23("span", { className: "snacky-notif-item__title", children: title }),
802
+ /* @__PURE__ */ jsx23("span", { className: "snacky-notif-item__message", children: message })
803
+ ]
804
+ }
805
+ );
806
+ }
807
+
808
+ // src/components/Accordion/Accordion.tsx
809
+ import { useId as useId4, useState as useState2 } from "react";
810
+ import { jsx as jsx24, jsxs as jsxs19 } from "react/jsx-runtime";
811
+ function Accordion({ title, leadingIcon, children, defaultOpen = false, className }) {
812
+ const [open, setOpen] = useState2(defaultOpen);
813
+ const panelId = useId4();
814
+ return /* @__PURE__ */ jsxs19("div", { className: cx("snacky-accordion", !leadingIcon && "snacky-accordion--bordered", !!leadingIcon && "snacky-accordion--icon", className), children: [
815
+ /* @__PURE__ */ jsxs19(
816
+ "button",
817
+ {
818
+ type: "button",
819
+ className: "snacky-accordion__header",
820
+ "aria-expanded": open,
821
+ "aria-controls": panelId,
822
+ onClick: () => setOpen((v) => !v),
823
+ children: [
824
+ leadingIcon && /* @__PURE__ */ jsx24("span", { className: "snacky-accordion__icon", children: leadingIcon }),
825
+ /* @__PURE__ */ jsx24("span", { className: "snacky-accordion__title", children: title }),
826
+ /* @__PURE__ */ jsx24(
827
+ "svg",
828
+ {
829
+ className: cx("snacky-accordion__chevron", open && "snacky-accordion__chevron--open"),
830
+ viewBox: "0 0 20 20",
831
+ fill: "none",
832
+ children: /* @__PURE__ */ jsx24("path", { d: "M5 7.5L10 12.5L15 7.5", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" })
833
+ }
834
+ )
835
+ ]
836
+ }
837
+ ),
838
+ open && /* @__PURE__ */ jsx24("div", { id: panelId, className: "snacky-accordion__panel", children })
839
+ ] });
840
+ }
841
+
842
+ // src/components/Modal/BottomSheet.tsx
843
+ import { useEffect } from "react";
844
+ import { jsx as jsx25, jsxs as jsxs20 } from "react/jsx-runtime";
845
+ function BottomSheet({ open, onDismiss, children, hideHandle = false, className }) {
846
+ useEffect(() => {
847
+ if (!open) return;
848
+ function onKeyDown(e) {
849
+ if (e.key === "Escape") onDismiss();
850
+ }
851
+ window.addEventListener("keydown", onKeyDown);
852
+ return () => window.removeEventListener("keydown", onKeyDown);
853
+ }, [open, onDismiss]);
854
+ if (!open) return null;
855
+ return /* @__PURE__ */ jsx25("div", { className: "snacky-sheet-overlay", onClick: onDismiss, children: /* @__PURE__ */ jsxs20(
856
+ "div",
857
+ {
858
+ className: cx("snacky-sheet", className),
859
+ role: "dialog",
860
+ "aria-modal": "true",
861
+ onClick: (e) => e.stopPropagation(),
862
+ children: [
863
+ !hideHandle && /* @__PURE__ */ jsx25("div", { className: "snacky-sheet__handle" }),
864
+ children
865
+ ]
866
+ }
867
+ ) });
868
+ }
869
+
870
+ // src/components/Section/Section.tsx
871
+ import { jsx as jsx26, jsxs as jsxs21 } from "react/jsx-runtime";
872
+ function Section({ title, onAction, children, className }) {
873
+ return /* @__PURE__ */ jsxs21("section", { className: cx("snacky-section", className), children: [
874
+ /* @__PURE__ */ jsxs21("div", { className: "snacky-section__header", children: [
875
+ /* @__PURE__ */ jsx26("h3", { className: "snacky-section__title", children: title }),
876
+ onAction && /* @__PURE__ */ jsx26("button", { type: "button", className: "snacky-section__action", onClick: onAction, "aria-label": `See more: ${title}`, children: /* @__PURE__ */ jsx26("svg", { viewBox: "0 0 16 16", fill: "none", width: "16", height: "16", children: /* @__PURE__ */ jsx26("path", { d: "M6 3.5L10.5 8L6 12.5", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) }) })
877
+ ] }),
878
+ children
879
+ ] });
880
+ }
881
+
882
+ // src/components/Avatar/Avatar.tsx
883
+ import { jsx as jsx27 } from "react/jsx-runtime";
884
+ function Avatar({ src, alt, size = "md", className }) {
885
+ return /* @__PURE__ */ jsx27("img", { src, alt, className: cx("snacky-avatar", `snacky-avatar--${size}`, className) });
886
+ }
887
+
888
+ // src/components/Illustration/Illustration.tsx
889
+ import { jsx as jsx28 } from "react/jsx-runtime";
890
+ var SIZE = {
891
+ empty: { width: 268, height: 200 },
892
+ createAccount: { width: 360, height: 240 },
893
+ welcome: { width: 200, height: 200 },
894
+ success: { width: 200, height: 200 },
895
+ discountReferral: { width: 268, height: 200 }
896
+ };
897
+ function Illustration({ variant, src, alt, className }) {
898
+ const { width, height } = SIZE[variant];
899
+ return /* @__PURE__ */ jsx28("img", { src, alt, width, height, className: cx("snacky-illustration", className) });
900
+ }
901
+
902
+ // src/components/ProductImage/ProductImage.tsx
903
+ import { jsx as jsx29, jsxs as jsxs22 } from "react/jsx-runtime";
904
+ function ProductImage({ src, alt, usage, sold = false, className }) {
905
+ return /* @__PURE__ */ jsxs22("span", { className: cx("snacky-product-image-wrap", `snacky-product-image-wrap--${usage}`, className), children: [
906
+ /* @__PURE__ */ jsx29("img", { src, alt, className: cx("snacky-product-image", `snacky-product-image--${usage}`) }),
907
+ sold && /* @__PURE__ */ jsx29("span", { className: "snacky-product-image-sold-overlay", children: /* @__PURE__ */ jsx29("span", { className: "snacky-product-image-sold-label", children: "Sold Out" }) })
908
+ ] });
909
+ }
910
+
911
+ // src/components/ProductCard/ProductCard.tsx
912
+ import { jsx as jsx30, jsxs as jsxs23 } from "react/jsx-runtime";
913
+ function ProductCard(props) {
914
+ if (props.variant === "details") {
915
+ const { productName: productName2, imageUrl: imageUrl2, price: price2, rating: rating2, originalPrice: originalPrice2, discountLabel: discountLabel2, ratingCount, favorited, onFavoriteClick, onShareClick, onChatClick, sold, ratingIcon: ratingIcon2, favoriteIcon, shareIcon, chatIcon, onClick: onClick2, className: className2 } = props;
916
+ return /* @__PURE__ */ jsxs23("div", { className: cx("snacky-product-card", "snacky-product-card--details", className2), children: [
917
+ /* @__PURE__ */ jsxs23("div", { className: "snacky-product-card__image-wrap", onClick: onClick2, children: [
918
+ /* @__PURE__ */ jsx30("img", { className: "snacky-product-card__image", src: imageUrl2, alt: productName2 }),
919
+ sold && /* @__PURE__ */ jsx30("span", { className: "snacky-product-card__discount", children: /* @__PURE__ */ jsx30(SoldOutBadge, {}) })
920
+ ] }),
921
+ /* @__PURE__ */ jsx30("p", { className: "snacky-product-card__name", children: productName2 }),
922
+ /* @__PURE__ */ jsxs23("div", { className: "snacky-product-card__price-row", children: [
923
+ /* @__PURE__ */ jsx30("span", { className: "snacky-product-card__price", children: price2 }),
924
+ originalPrice2 && /* @__PURE__ */ jsx30("span", { className: "snacky-product-card__original-price", children: originalPrice2 }),
925
+ discountLabel2 && /* @__PURE__ */ jsx30(DiscountTag, { label: discountLabel2 })
926
+ ] }),
927
+ /* @__PURE__ */ jsxs23("div", { className: "snacky-product-card__footer-row", children: [
928
+ /* @__PURE__ */ jsxs23("span", { className: "snacky-product-card__rating", children: [
929
+ ratingIcon2 && /* @__PURE__ */ jsx30("span", { className: "snacky-product-card__rating-icon", children: ratingIcon2 }),
930
+ rating2,
931
+ " (",
932
+ ratingCount,
933
+ ")"
934
+ ] }),
935
+ /* @__PURE__ */ jsxs23("div", { className: "snacky-product-card__actions snacky-product-card__actions--details", children: [
936
+ /* @__PURE__ */ jsx30(IconButton, { variant: "secondary", icon: favoriteIcon ?? "\u2665", selected: favorited, onClick: onFavoriteClick, ariaLabel: "Favorite" }),
937
+ /* @__PURE__ */ jsx30(IconButton, { variant: "secondary", icon: shareIcon ?? "\u2934", onClick: onShareClick, ariaLabel: "Share" }),
938
+ /* @__PURE__ */ jsx30(IconButton, { variant: "secondary", icon: chatIcon ?? "\u{1F4AC}", onClick: onChatClick, ariaLabel: "Chat with seller" })
939
+ ] })
940
+ ] })
941
+ ] });
942
+ }
943
+ const { productName, imageUrl, price, rating, originalPrice, discountLabel, onAddToCart, cartIcon, ratingIcon, onClick, className } = props;
944
+ return /* @__PURE__ */ jsxs23(
945
+ "div",
946
+ {
947
+ className: cx("snacky-product-card", "snacky-product-card--list", className),
948
+ role: "button",
949
+ tabIndex: 0,
950
+ onClick,
951
+ onKeyDown: (e) => (e.key === "Enter" || e.key === " ") && onClick?.(),
952
+ children: [
953
+ /* @__PURE__ */ jsxs23("div", { className: "snacky-product-card__image-wrap", children: [
954
+ /* @__PURE__ */ jsx30("img", { className: "snacky-product-card__image", src: imageUrl, alt: productName }),
955
+ discountLabel && /* @__PURE__ */ jsx30("span", { className: "snacky-product-card__discount", children: /* @__PURE__ */ jsx30(DiscountTag, { label: discountLabel }) })
956
+ ] }),
957
+ /* @__PURE__ */ jsx30("p", { className: "snacky-product-card__name", children: productName }),
958
+ /* @__PURE__ */ jsxs23("div", { className: "snacky-product-card__price-row", children: [
959
+ /* @__PURE__ */ jsx30("span", { className: "snacky-product-card__price", children: price }),
960
+ originalPrice && /* @__PURE__ */ jsx30("span", { className: "snacky-product-card__original-price", children: originalPrice })
961
+ ] }),
962
+ /* @__PURE__ */ jsxs23("div", { className: "snacky-product-card__footer-row", children: [
963
+ /* @__PURE__ */ jsxs23("span", { className: "snacky-product-card__rating", children: [
964
+ ratingIcon && /* @__PURE__ */ jsx30("span", { className: "snacky-product-card__rating-icon", children: ratingIcon }),
965
+ rating
966
+ ] }),
967
+ /* @__PURE__ */ jsx30(
968
+ IconButton,
969
+ {
970
+ variant: "primary",
971
+ icon: cartIcon ?? "+",
972
+ onClick: (e) => {
973
+ e.stopPropagation();
974
+ onAddToCart();
975
+ },
976
+ ariaLabel: "Add to cart"
977
+ }
978
+ )
979
+ ] })
980
+ ]
981
+ }
982
+ );
983
+ }
984
+ export {
985
+ Accordion,
986
+ AddressResult,
987
+ AlertBanner,
988
+ Avatar,
989
+ BottomSheet,
990
+ Button,
991
+ Callout,
992
+ ChatInput,
993
+ Checkbox,
994
+ CopyField,
995
+ DiscountTag,
996
+ FilterChip,
997
+ FullWidthBanner,
998
+ Header,
999
+ HeroBanner,
1000
+ IconButton,
1001
+ Illustration,
1002
+ NavBar,
1003
+ NotificationBadge,
1004
+ NotificationListItem,
1005
+ OrderListItem,
1006
+ OtpField,
1007
+ PointBalanceBanner,
1008
+ ProductCard,
1009
+ ProductChip,
1010
+ ProductImage,
1011
+ RadioOption,
1012
+ SearchField,
1013
+ Section,
1014
+ SnackyIcons,
1015
+ SoldOutBadge,
1016
+ SquareBanner,
1017
+ TabRow,
1018
+ TextField,
1019
+ Toggle,
1020
+ UploadButton,
1021
+ VariantBadge,
1022
+ typography
1023
+ };
1024
+ //# sourceMappingURL=index.js.map