@snacky/ui 0.10.0 → 0.12.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/CHANGELOG.md +61 -0
- package/README.md +4 -3
- package/dist/index.cjs +138 -111
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +22 -2
- package/dist/index.css.map +1 -1
- package/dist/index.d.cts +29 -5
- package/dist/index.d.ts +29 -5
- package/dist/index.js +103 -77
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -643,6 +643,7 @@ function TabRow({ tabs, selected, onSelect, className }) {
|
|
|
643
643
|
var solid_exports = {};
|
|
644
644
|
__export(solid_exports, {
|
|
645
645
|
account: () => account2,
|
|
646
|
+
address: () => address2,
|
|
646
647
|
angleSmallRight: () => angleSmallRight,
|
|
647
648
|
balance: () => balance2,
|
|
648
649
|
bell: () => bell2,
|
|
@@ -674,6 +675,9 @@ var account2 = icon2(20, [
|
|
|
674
675
|
["M10 10C12.7614 10 15 7.76142 15 5C15 2.23858 12.7614 0 10 0C7.23858 0 5 2.23858 5 5C5 7.76142 7.23858 10 10 10Z", "nonzero"],
|
|
675
676
|
["M10 11.6659C5.85977 11.6705 2.50461 15.0257 2.5 19.1659C2.5 19.6261 2.87309 19.9992 3.33332 19.9992H16.6666C17.1269 19.9992 17.5 19.6261 17.5 19.1659C17.4954 15.0257 14.1402 11.6705 10 11.6659Z", "nonzero"]
|
|
676
677
|
]);
|
|
678
|
+
var address2 = icon2(16, [
|
|
679
|
+
["M8.00001 0.0283203C6.23597 0.030261 4.54473 0.731837 3.2973 1.97914C2.04987 3.22644 1.34813 4.91762 1.34601 6.68165C1.34601 8.39499 2.67268 11.0763 5.28934 14.651C5.60085 15.0777 6.00871 15.4249 6.47974 15.6643C6.95077 15.9036 7.47166 16.0283 8.00001 16.0283C8.52836 16.0283 9.04924 15.9036 9.52027 15.6643C9.9913 15.4249 10.3992 15.0777 10.7107 14.651C13.3273 11.0763 14.654 8.39499 14.654 6.68165C14.6519 4.91762 13.9501 3.22644 12.7027 1.97914C11.4553 0.731837 9.76405 0.030261 8.00001 0.0283203V0.0283203ZM8.00001 9.33365C7.47259 9.33365 6.95702 9.17726 6.51849 8.88424C6.07996 8.59122 5.73816 8.17475 5.53633 7.68748C5.3345 7.20021 5.28169 6.66403 5.38458 6.14675C5.48747 5.62946 5.74145 5.15431 6.11439 4.78137C6.48733 4.40843 6.96248 4.15445 7.47977 4.05156C7.99705 3.94867 8.53323 4.00148 9.0205 4.20331C9.50777 4.40514 9.92424 4.74694 10.2173 5.18547C10.5103 5.624 10.6667 6.13957 10.6667 6.66699C10.6667 7.37423 10.3857 8.05251 9.88563 8.55261C9.38553 9.0527 8.70725 9.33365 8.00001 9.33365Z", "nonzero"]
|
|
680
|
+
]);
|
|
677
681
|
var angleSmallRight = icon2(24, [
|
|
678
682
|
["M15.75 9.525L11.164 4.939C10.8827 4.65774 10.5011 4.49978 10.1032 4.49988C9.70534 4.49997 9.32381 4.65811 9.04255 4.9395C8.76129 5.2209 8.60333 5.6025 8.60342 6.00036C8.60352 6.39822 8.76166 6.77974 9.04305 7.061L13.629 11.646C13.6756 11.6925 13.7125 11.7476 13.7378 11.8084C13.763 11.8691 13.7759 11.9342 13.7759 12C13.7759 12.0658 13.763 12.1309 13.7378 12.1916C13.7125 12.2524 13.6756 12.3076 13.629 12.354L9.04305 16.939C8.76166 17.2203 8.60352 17.6018 8.60342 17.9997C8.60333 18.3975 8.76129 18.7791 9.04255 19.0605C9.32381 19.3419 9.70534 19.5 10.1032 19.5001C10.5011 19.5002 10.8827 19.3423 11.164 19.061L15.75 14.475C16.4053 13.818 16.7732 12.9279 16.7732 12C16.7732 11.0721 16.4053 10.182 15.75 9.525Z", "nonzero"]
|
|
679
683
|
]);
|
|
@@ -776,43 +780,64 @@ function AlertBanner({ message, countdown, className }) {
|
|
|
776
780
|
] });
|
|
777
781
|
}
|
|
778
782
|
|
|
783
|
+
// src/components/PageIndicator/PageIndicator.tsx
|
|
784
|
+
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
785
|
+
function PageIndicator({ count, activeIndex, ariaLabel, className }) {
|
|
786
|
+
return /* @__PURE__ */ jsx21(
|
|
787
|
+
"div",
|
|
788
|
+
{
|
|
789
|
+
className: cx("snacky-page-indicator", className),
|
|
790
|
+
role: "status",
|
|
791
|
+
"aria-label": ariaLabel ?? `Page ${activeIndex + 1} of ${count}`,
|
|
792
|
+
children: Array.from({ length: count }, (_, i) => /* @__PURE__ */ jsx21(
|
|
793
|
+
"span",
|
|
794
|
+
{
|
|
795
|
+
"aria-hidden": "true",
|
|
796
|
+
className: cx("snacky-page-indicator__dot", i === activeIndex && "snacky-page-indicator__dot--active")
|
|
797
|
+
},
|
|
798
|
+
i
|
|
799
|
+
))
|
|
800
|
+
}
|
|
801
|
+
);
|
|
802
|
+
}
|
|
803
|
+
|
|
779
804
|
// src/components/Badge/Badge.tsx
|
|
780
|
-
import { Fragment, jsx as
|
|
805
|
+
import { Fragment, jsx as jsx22, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
781
806
|
function NotificationBadge({ count, max = 99, children, className }) {
|
|
782
|
-
if (count <= 0) return /* @__PURE__ */
|
|
807
|
+
if (count <= 0) return /* @__PURE__ */ jsx22(Fragment, { children });
|
|
783
808
|
return /* @__PURE__ */ jsxs14("span", { className: cx("snacky-badge-wrap", className), children: [
|
|
784
809
|
children,
|
|
785
|
-
/* @__PURE__ */
|
|
810
|
+
/* @__PURE__ */ jsx22("span", { className: "snacky-badge-notification", children: count > max ? `${max}+` : count })
|
|
786
811
|
] });
|
|
787
812
|
}
|
|
788
813
|
function DiscountTag({ label, className }) {
|
|
789
|
-
return /* @__PURE__ */
|
|
814
|
+
return /* @__PURE__ */ jsx22("span", { className: cx("snacky-discount-tag", className), children: label });
|
|
790
815
|
}
|
|
791
816
|
function SoldOutBadge({ className }) {
|
|
792
|
-
return /* @__PURE__ */
|
|
817
|
+
return /* @__PURE__ */ jsx22("span", { className: cx("snacky-soldout-badge", className), children: "Sold Out" });
|
|
793
818
|
}
|
|
794
819
|
function InfoBadge({ label, icon: icon3, className }) {
|
|
795
820
|
return /* @__PURE__ */ jsxs14("span", { className: cx("snacky-info-badge", className), children: [
|
|
796
|
-
icon3 && /* @__PURE__ */
|
|
821
|
+
icon3 && /* @__PURE__ */ jsx22("span", { className: "snacky-info-badge__icon", children: icon3 }),
|
|
797
822
|
label
|
|
798
823
|
] });
|
|
799
824
|
}
|
|
800
825
|
var VariantBadge = InfoBadge;
|
|
801
826
|
|
|
802
827
|
// src/components/Callout/Callout.tsx
|
|
803
|
-
import { jsx as
|
|
828
|
+
import { jsx as jsx23, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
804
829
|
function Callout({ message, timestamp, variant, statusIcon, className }) {
|
|
805
830
|
return /* @__PURE__ */ jsxs15("div", { className: cx("snacky-callout", `snacky-callout--${variant}`, className), children: [
|
|
806
|
-
/* @__PURE__ */
|
|
831
|
+
/* @__PURE__ */ jsx23("p", { className: "snacky-callout__message", children: message }),
|
|
807
832
|
/* @__PURE__ */ jsxs15("span", { className: "snacky-callout__meta", children: [
|
|
808
833
|
timestamp,
|
|
809
|
-
statusIcon && variant !== "received" && /* @__PURE__ */
|
|
834
|
+
statusIcon && variant !== "received" && /* @__PURE__ */ jsx23("span", { className: "snacky-callout__meta-icon", children: statusIcon })
|
|
810
835
|
] })
|
|
811
836
|
] });
|
|
812
837
|
}
|
|
813
838
|
|
|
814
839
|
// src/components/List/List.tsx
|
|
815
|
-
import { jsx as
|
|
840
|
+
import { jsx as jsx24, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
816
841
|
var STATUS_LABEL = {
|
|
817
842
|
waiting: "Waiting for Payment",
|
|
818
843
|
process: "Order Processing",
|
|
@@ -850,31 +875,31 @@ function OrderListItem({
|
|
|
850
875
|
onKeyDown: onClick ? (e) => (e.key === "Enter" || e.key === " ") && onClick() : void 0,
|
|
851
876
|
children: [
|
|
852
877
|
/* @__PURE__ */ jsxs16("div", { className: "snacky-order-item__top", children: [
|
|
853
|
-
/* @__PURE__ */
|
|
878
|
+
/* @__PURE__ */ jsx24("div", { className: "snacky-order-item__thumb-box", children: /* @__PURE__ */ jsx24("img", { className: "snacky-order-item__thumb", src: productImage, alt: "" }) }),
|
|
854
879
|
/* @__PURE__ */ jsxs16("div", { className: "snacky-order-item__info", children: [
|
|
855
|
-
/* @__PURE__ */
|
|
880
|
+
/* @__PURE__ */ jsx24(
|
|
856
881
|
"span",
|
|
857
882
|
{
|
|
858
883
|
className: cx("snacky-order-item__status", status === "cancelled" && "snacky-order-item__status--cancelled"),
|
|
859
884
|
children: STATUS_LABEL[status]
|
|
860
885
|
}
|
|
861
886
|
),
|
|
862
|
-
/* @__PURE__ */
|
|
887
|
+
/* @__PURE__ */ jsx24("span", { className: "snacky-order-item__name", children: productName })
|
|
863
888
|
] })
|
|
864
889
|
] }),
|
|
865
890
|
/* @__PURE__ */ jsxs16("div", { className: "snacky-order-item__details", children: [
|
|
866
|
-
/* @__PURE__ */
|
|
891
|
+
/* @__PURE__ */ jsx24("span", { className: "snacky-order-item__count", children: itemsSummary }),
|
|
867
892
|
/* @__PURE__ */ jsxs16("span", { className: cx("snacky-order-item__total", isCod && "snacky-order-item__total--cod"), children: [
|
|
868
893
|
"Order Total: ",
|
|
869
|
-
/* @__PURE__ */
|
|
894
|
+
/* @__PURE__ */ jsx24("b", { children: total })
|
|
870
895
|
] }),
|
|
871
|
-
isCod && /* @__PURE__ */
|
|
896
|
+
isCod && /* @__PURE__ */ jsx24("span", { className: "snacky-order-item__cod", children: "COD" })
|
|
872
897
|
] }),
|
|
873
898
|
status === "waiting" && paymentDeadline && /* @__PURE__ */ jsxs16("div", { className: "snacky-order-item__deadline", children: [
|
|
874
899
|
"Pay before ",
|
|
875
900
|
paymentDeadline
|
|
876
901
|
] }),
|
|
877
|
-
action && /* @__PURE__ */
|
|
902
|
+
action && /* @__PURE__ */ jsx24("div", { className: "snacky-order-item__action-row", children: /* @__PURE__ */ jsx24(
|
|
878
903
|
Button,
|
|
879
904
|
{
|
|
880
905
|
variant: "primary",
|
|
@@ -899,8 +924,8 @@ function NotificationListItem({ title, message, unread = false, onClick, classNa
|
|
|
899
924
|
onClick,
|
|
900
925
|
onKeyDown: onClick ? (e) => (e.key === "Enter" || e.key === " ") && onClick() : void 0,
|
|
901
926
|
children: [
|
|
902
|
-
/* @__PURE__ */
|
|
903
|
-
/* @__PURE__ */
|
|
927
|
+
/* @__PURE__ */ jsx24("span", { className: "snacky-notif-item__title", children: title }),
|
|
928
|
+
/* @__PURE__ */ jsx24("span", { className: "snacky-notif-item__message", children: message })
|
|
904
929
|
]
|
|
905
930
|
}
|
|
906
931
|
);
|
|
@@ -908,7 +933,7 @@ function NotificationListItem({ title, message, unread = false, onClick, classNa
|
|
|
908
933
|
|
|
909
934
|
// src/components/Accordion/Accordion.tsx
|
|
910
935
|
import { useId as useId4, useState as useState2 } from "react";
|
|
911
|
-
import { jsx as
|
|
936
|
+
import { jsx as jsx25, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
912
937
|
function Accordion({ title, leadingIcon, children, defaultOpen = false, className }) {
|
|
913
938
|
const [open, setOpen] = useState2(defaultOpen);
|
|
914
939
|
const panelId = useId4();
|
|
@@ -922,27 +947,27 @@ function Accordion({ title, leadingIcon, children, defaultOpen = false, classNam
|
|
|
922
947
|
"aria-controls": panelId,
|
|
923
948
|
onClick: () => setOpen((v) => !v),
|
|
924
949
|
children: [
|
|
925
|
-
leadingIcon && /* @__PURE__ */
|
|
926
|
-
/* @__PURE__ */
|
|
927
|
-
/* @__PURE__ */
|
|
950
|
+
leadingIcon && /* @__PURE__ */ jsx25("span", { className: "snacky-accordion__icon", children: leadingIcon }),
|
|
951
|
+
/* @__PURE__ */ jsx25("span", { className: "snacky-accordion__title", children: title }),
|
|
952
|
+
/* @__PURE__ */ jsx25(
|
|
928
953
|
"svg",
|
|
929
954
|
{
|
|
930
955
|
className: cx("snacky-accordion__chevron", open && "snacky-accordion__chevron--open"),
|
|
931
956
|
viewBox: "0 0 20 20",
|
|
932
957
|
fill: "none",
|
|
933
|
-
children: /* @__PURE__ */
|
|
958
|
+
children: /* @__PURE__ */ jsx25("path", { d: "M5 7.5L10 12.5L15 7.5", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" })
|
|
934
959
|
}
|
|
935
960
|
)
|
|
936
961
|
]
|
|
937
962
|
}
|
|
938
963
|
),
|
|
939
|
-
open && /* @__PURE__ */
|
|
964
|
+
open && /* @__PURE__ */ jsx25("div", { id: panelId, className: "snacky-accordion__panel", children })
|
|
940
965
|
] });
|
|
941
966
|
}
|
|
942
967
|
|
|
943
968
|
// src/components/Modal/BottomSheet.tsx
|
|
944
969
|
import { useEffect } from "react";
|
|
945
|
-
import { jsx as
|
|
970
|
+
import { jsx as jsx26, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
946
971
|
function BottomSheet({ open, onDismiss, children, showHandle = false, className }) {
|
|
947
972
|
useEffect(() => {
|
|
948
973
|
if (!open) return;
|
|
@@ -953,7 +978,7 @@ function BottomSheet({ open, onDismiss, children, showHandle = false, className
|
|
|
953
978
|
return () => window.removeEventListener("keydown", onKeyDown);
|
|
954
979
|
}, [open, onDismiss]);
|
|
955
980
|
if (!open) return null;
|
|
956
|
-
return /* @__PURE__ */
|
|
981
|
+
return /* @__PURE__ */ jsx26("div", { className: "snacky-sheet-overlay", onClick: onDismiss, children: /* @__PURE__ */ jsxs18(
|
|
957
982
|
"div",
|
|
958
983
|
{
|
|
959
984
|
className: cx("snacky-sheet", className),
|
|
@@ -961,7 +986,7 @@ function BottomSheet({ open, onDismiss, children, showHandle = false, className
|
|
|
961
986
|
"aria-modal": "true",
|
|
962
987
|
onClick: (e) => e.stopPropagation(),
|
|
963
988
|
children: [
|
|
964
|
-
showHandle && /* @__PURE__ */
|
|
989
|
+
showHandle && /* @__PURE__ */ jsx26("div", { className: "snacky-sheet__handle" }),
|
|
965
990
|
children
|
|
966
991
|
]
|
|
967
992
|
}
|
|
@@ -969,29 +994,29 @@ function BottomSheet({ open, onDismiss, children, showHandle = false, className
|
|
|
969
994
|
}
|
|
970
995
|
|
|
971
996
|
// src/components/Section/Section.tsx
|
|
972
|
-
import { jsx as
|
|
997
|
+
import { jsx as jsx27, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
973
998
|
function Section({ title, onAction, children, className }) {
|
|
974
999
|
return /* @__PURE__ */ jsxs19("section", { className: cx("snacky-section", className), children: [
|
|
975
1000
|
/* @__PURE__ */ jsxs19("div", { className: "snacky-section__header", children: [
|
|
976
|
-
/* @__PURE__ */
|
|
977
|
-
onAction && /* @__PURE__ */
|
|
1001
|
+
/* @__PURE__ */ jsx27("h3", { className: "snacky-section__title", children: title }),
|
|
1002
|
+
onAction && /* @__PURE__ */ jsx27(IconButton, { size: "small", icon: /* @__PURE__ */ jsx27(angleSmallRight, {}), onClick: onAction, ariaLabel: `See more: ${title}` })
|
|
978
1003
|
] }),
|
|
979
1004
|
children
|
|
980
1005
|
] });
|
|
981
1006
|
}
|
|
982
1007
|
|
|
983
1008
|
// src/components/Stepper/Stepper.tsx
|
|
984
|
-
import { jsx as
|
|
1009
|
+
import { jsx as jsx28, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
985
1010
|
function Stepper({ steps, className }) {
|
|
986
|
-
return /* @__PURE__ */
|
|
1011
|
+
return /* @__PURE__ */ jsx28("ol", { className: cx("snacky-stepper", className), children: steps.map((step, i) => /* @__PURE__ */ jsxs20(
|
|
987
1012
|
"li",
|
|
988
1013
|
{
|
|
989
1014
|
className: cx("snacky-stepper__step", i === steps.length - 1 && "snacky-stepper__step--last"),
|
|
990
1015
|
children: [
|
|
991
|
-
/* @__PURE__ */
|
|
1016
|
+
/* @__PURE__ */ jsx28("span", { className: cx("snacky-stepper__dot", `snacky-stepper__dot--${step.state}`), children: step.state === "cancelled" && /* @__PURE__ */ jsx28(close, { width: 12, height: 12 }) }),
|
|
992
1017
|
/* @__PURE__ */ jsxs20("span", { className: "snacky-stepper__body", children: [
|
|
993
|
-
/* @__PURE__ */
|
|
994
|
-
step.timestamp && /* @__PURE__ */
|
|
1018
|
+
/* @__PURE__ */ jsx28("span", { className: cx("snacky-stepper__label", `snacky-stepper__label--${step.state}`), children: step.label }),
|
|
1019
|
+
step.timestamp && /* @__PURE__ */ jsx28("span", { className: "snacky-stepper__time", children: step.timestamp })
|
|
995
1020
|
] })
|
|
996
1021
|
]
|
|
997
1022
|
},
|
|
@@ -1000,7 +1025,7 @@ function Stepper({ steps, className }) {
|
|
|
1000
1025
|
}
|
|
1001
1026
|
|
|
1002
1027
|
// src/components/Calendar/Calendar.tsx
|
|
1003
|
-
import { jsx as
|
|
1028
|
+
import { jsx as jsx29, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
1004
1029
|
var WEEKDAYS = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
|
|
1005
1030
|
var MONTHS = [
|
|
1006
1031
|
"January",
|
|
@@ -1049,14 +1074,14 @@ function Calendar({
|
|
|
1049
1074
|
const isInRange = (d) => lo && hi && d > lo && d < hi;
|
|
1050
1075
|
return /* @__PURE__ */ jsxs21("div", { className: cx("snacky-calendar", className), children: [
|
|
1051
1076
|
/* @__PURE__ */ jsxs21("div", { className: "snacky-calendar__header", children: [
|
|
1052
|
-
/* @__PURE__ */
|
|
1077
|
+
/* @__PURE__ */ jsx29(
|
|
1053
1078
|
"button",
|
|
1054
1079
|
{
|
|
1055
1080
|
type: "button",
|
|
1056
1081
|
className: "snacky-calendar__nav",
|
|
1057
1082
|
onClick: onPrevMonth,
|
|
1058
1083
|
"aria-label": "Previous month",
|
|
1059
|
-
children: /* @__PURE__ */
|
|
1084
|
+
children: /* @__PURE__ */ jsx29(back, { width: 24, height: 24 })
|
|
1060
1085
|
}
|
|
1061
1086
|
),
|
|
1062
1087
|
/* @__PURE__ */ jsxs21("span", { className: "snacky-calendar__label", children: [
|
|
@@ -1064,19 +1089,19 @@ function Calendar({
|
|
|
1064
1089
|
" ",
|
|
1065
1090
|
month.getFullYear()
|
|
1066
1091
|
] }),
|
|
1067
|
-
/* @__PURE__ */
|
|
1092
|
+
/* @__PURE__ */ jsx29(
|
|
1068
1093
|
"button",
|
|
1069
1094
|
{
|
|
1070
1095
|
type: "button",
|
|
1071
1096
|
className: "snacky-calendar__nav snacky-calendar__nav--next",
|
|
1072
1097
|
onClick: onNextMonth,
|
|
1073
1098
|
"aria-label": "Next month",
|
|
1074
|
-
children: /* @__PURE__ */
|
|
1099
|
+
children: /* @__PURE__ */ jsx29(back, { width: 24, height: 24 })
|
|
1075
1100
|
}
|
|
1076
1101
|
)
|
|
1077
1102
|
] }),
|
|
1078
1103
|
/* @__PURE__ */ jsxs21("div", { className: "snacky-calendar__grid", children: [
|
|
1079
|
-
WEEKDAYS.map((d) => /* @__PURE__ */
|
|
1104
|
+
WEEKDAYS.map((d) => /* @__PURE__ */ jsx29("span", { className: "snacky-calendar__weekday", children: d }, d)),
|
|
1080
1105
|
days.map((d, i) => {
|
|
1081
1106
|
const outside = d.getMonth() !== month.getMonth();
|
|
1082
1107
|
return /* @__PURE__ */ jsxs21(
|
|
@@ -1093,26 +1118,26 @@ function Calendar({
|
|
|
1093
1118
|
disabled: outside,
|
|
1094
1119
|
"aria-current": isEnd(d) ? "date" : void 0,
|
|
1095
1120
|
children: [
|
|
1096
|
-
/* @__PURE__ */
|
|
1097
|
-
marked.some((m) => sameDay(m, d)) && /* @__PURE__ */
|
|
1121
|
+
/* @__PURE__ */ jsx29("span", { className: "snacky-calendar__day-number", children: d.getDate() }),
|
|
1122
|
+
marked.some((m) => sameDay(m, d)) && /* @__PURE__ */ jsx29("span", { className: "snacky-calendar__marker" })
|
|
1098
1123
|
]
|
|
1099
1124
|
},
|
|
1100
1125
|
i
|
|
1101
1126
|
);
|
|
1102
1127
|
})
|
|
1103
1128
|
] }),
|
|
1104
|
-
onAction && /* @__PURE__ */
|
|
1129
|
+
onAction && /* @__PURE__ */ jsx29(Button, { onClick: onAction, style: { width: "100%" }, children: actionLabel })
|
|
1105
1130
|
] });
|
|
1106
1131
|
}
|
|
1107
1132
|
|
|
1108
1133
|
// src/components/Avatar/Avatar.tsx
|
|
1109
|
-
import { jsx as
|
|
1134
|
+
import { jsx as jsx30 } from "react/jsx-runtime";
|
|
1110
1135
|
function Avatar({ src, alt, size = "md", className }) {
|
|
1111
|
-
return /* @__PURE__ */
|
|
1136
|
+
return /* @__PURE__ */ jsx30("img", { src, alt, className: cx("snacky-avatar", `snacky-avatar--${size}`, className) });
|
|
1112
1137
|
}
|
|
1113
1138
|
|
|
1114
1139
|
// src/components/Illustration/Illustration.tsx
|
|
1115
|
-
import { jsx as
|
|
1140
|
+
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
1116
1141
|
var SIZE = {
|
|
1117
1142
|
empty: { width: 268, height: 200 },
|
|
1118
1143
|
createAccount: { width: 360, height: 240 },
|
|
@@ -1122,47 +1147,47 @@ var SIZE = {
|
|
|
1122
1147
|
};
|
|
1123
1148
|
function Illustration({ variant, src, alt, className }) {
|
|
1124
1149
|
const { width, height } = SIZE[variant];
|
|
1125
|
-
return /* @__PURE__ */
|
|
1150
|
+
return /* @__PURE__ */ jsx31("img", { src, alt, width, height, className: cx("snacky-illustration", className) });
|
|
1126
1151
|
}
|
|
1127
1152
|
|
|
1128
1153
|
// src/components/ProductImage/ProductImage.tsx
|
|
1129
|
-
import { jsx as
|
|
1154
|
+
import { jsx as jsx32, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
1130
1155
|
function ProductImage({ src, alt, usage, sold = false, className }) {
|
|
1131
1156
|
return /* @__PURE__ */ jsxs22("span", { className: cx("snacky-product-image-wrap", `snacky-product-image-wrap--${usage}`, className), children: [
|
|
1132
|
-
/* @__PURE__ */
|
|
1133
|
-
sold && /* @__PURE__ */
|
|
1157
|
+
/* @__PURE__ */ jsx32("img", { src, alt, className: cx("snacky-product-image", `snacky-product-image--${usage}`) }),
|
|
1158
|
+
sold && /* @__PURE__ */ jsx32("span", { className: "snacky-product-image-sold-overlay", children: /* @__PURE__ */ jsx32("span", { className: "snacky-product-image-sold-label", children: "Sold Out" }) })
|
|
1134
1159
|
] });
|
|
1135
1160
|
}
|
|
1136
1161
|
|
|
1137
1162
|
// src/components/ProductCard/ProductCard.tsx
|
|
1138
|
-
import { jsx as
|
|
1163
|
+
import { jsx as jsx33, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
1139
1164
|
function ProductCard(props) {
|
|
1140
1165
|
if (props.variant === "details") {
|
|
1141
1166
|
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;
|
|
1142
1167
|
return /* @__PURE__ */ jsxs23("div", { className: cx("snacky-product-card", "snacky-product-card--details", className2), children: [
|
|
1143
|
-
/* @__PURE__ */
|
|
1144
|
-
/* @__PURE__ */
|
|
1145
|
-
sold && /* @__PURE__ */
|
|
1168
|
+
/* @__PURE__ */ jsx33("div", { className: "snacky-product-card__image-block", children: /* @__PURE__ */ jsxs23("div", { className: "snacky-product-card__image-wrap", onClick: onClick2, children: [
|
|
1169
|
+
/* @__PURE__ */ jsx33("img", { className: "snacky-product-card__image", src: imageUrl2, alt: productName2 }),
|
|
1170
|
+
sold && /* @__PURE__ */ jsx33("span", { className: "snacky-product-card__sold-overlay", children: /* @__PURE__ */ jsx33(SoldOutBadge, {}) })
|
|
1146
1171
|
] }) }),
|
|
1147
1172
|
/* @__PURE__ */ jsxs23("div", { className: "snacky-product-card__details-body", children: [
|
|
1148
|
-
/* @__PURE__ */
|
|
1173
|
+
/* @__PURE__ */ jsx33("p", { className: "snacky-product-card__name", children: productName2 }),
|
|
1149
1174
|
/* @__PURE__ */ jsxs23("div", { className: "snacky-product-card__price-row", children: [
|
|
1150
|
-
/* @__PURE__ */
|
|
1151
|
-
originalPrice2 && /* @__PURE__ */
|
|
1152
|
-
discountLabel2 && /* @__PURE__ */
|
|
1175
|
+
/* @__PURE__ */ jsx33("span", { className: "snacky-product-card__price", children: price2 }),
|
|
1176
|
+
originalPrice2 && /* @__PURE__ */ jsx33("span", { className: "snacky-product-card__original-price", children: originalPrice2 }),
|
|
1177
|
+
discountLabel2 && /* @__PURE__ */ jsx33(DiscountTag, { label: discountLabel2 })
|
|
1153
1178
|
] }),
|
|
1154
1179
|
/* @__PURE__ */ jsxs23("div", { className: "snacky-product-card__footer-row", children: [
|
|
1155
1180
|
/* @__PURE__ */ jsxs23("span", { className: "snacky-product-card__rating", children: [
|
|
1156
|
-
/* @__PURE__ */
|
|
1181
|
+
/* @__PURE__ */ jsx33("span", { className: "snacky-product-card__rating-icon", children: ratingIcon2 ?? /* @__PURE__ */ jsx33(star, { width: 16, height: 16 }) }),
|
|
1157
1182
|
rating2,
|
|
1158
1183
|
" (",
|
|
1159
1184
|
ratingCount,
|
|
1160
1185
|
")"
|
|
1161
1186
|
] }),
|
|
1162
1187
|
/* @__PURE__ */ jsxs23("div", { className: "snacky-product-card__actions snacky-product-card__actions--details", children: [
|
|
1163
|
-
/* @__PURE__ */
|
|
1164
|
-
/* @__PURE__ */
|
|
1165
|
-
/* @__PURE__ */
|
|
1188
|
+
/* @__PURE__ */ jsx33(IconButton, { variant: "secondary", icon: favoriteIcon ?? (favorited ? /* @__PURE__ */ jsx33(heart2, { width: 20, height: 20 }) : /* @__PURE__ */ jsx33(heart, { width: 20, height: 20 })), selected: favorited, onClick: onFavoriteClick, ariaLabel: "Favorite" }),
|
|
1189
|
+
/* @__PURE__ */ jsx33(IconButton, { variant: "secondary", icon: shareIcon ?? /* @__PURE__ */ jsx33(share, { width: 20, height: 20 }), onClick: onShareClick, ariaLabel: "Share" }),
|
|
1190
|
+
/* @__PURE__ */ jsx33(IconButton, { variant: "secondary", icon: chatIcon ?? /* @__PURE__ */ jsx33(chat, { width: 20, height: 20 }), onClick: onChatClick, ariaLabel: "Chat with seller" })
|
|
1166
1191
|
] })
|
|
1167
1192
|
] })
|
|
1168
1193
|
] })
|
|
@@ -1179,24 +1204,24 @@ function ProductCard(props) {
|
|
|
1179
1204
|
onKeyDown: (e) => (e.key === "Enter" || e.key === " ") && onClick?.(),
|
|
1180
1205
|
children: [
|
|
1181
1206
|
/* @__PURE__ */ jsxs23("div", { className: "snacky-product-card__image-wrap", children: [
|
|
1182
|
-
/* @__PURE__ */
|
|
1183
|
-
discountLabel && /* @__PURE__ */
|
|
1207
|
+
/* @__PURE__ */ jsx33("img", { className: "snacky-product-card__image", src: imageUrl, alt: productName }),
|
|
1208
|
+
discountLabel && /* @__PURE__ */ jsx33("span", { className: "snacky-product-card__discount", children: /* @__PURE__ */ jsx33(DiscountTag, { label: discountLabel }) })
|
|
1184
1209
|
] }),
|
|
1185
|
-
/* @__PURE__ */
|
|
1210
|
+
/* @__PURE__ */ jsx33("p", { className: "snacky-product-card__name", children: productName }),
|
|
1186
1211
|
/* @__PURE__ */ jsxs23("div", { className: "snacky-product-card__price-row", children: [
|
|
1187
|
-
/* @__PURE__ */
|
|
1188
|
-
originalPrice && /* @__PURE__ */
|
|
1212
|
+
/* @__PURE__ */ jsx33("span", { className: "snacky-product-card__price", children: price }),
|
|
1213
|
+
originalPrice && /* @__PURE__ */ jsx33("span", { className: "snacky-product-card__original-price", children: originalPrice })
|
|
1189
1214
|
] }),
|
|
1190
1215
|
/* @__PURE__ */ jsxs23("div", { className: "snacky-product-card__footer-row", children: [
|
|
1191
1216
|
/* @__PURE__ */ jsxs23("span", { className: "snacky-product-card__rating", children: [
|
|
1192
|
-
/* @__PURE__ */
|
|
1217
|
+
/* @__PURE__ */ jsx33("span", { className: "snacky-product-card__rating-icon", children: ratingIcon ?? /* @__PURE__ */ jsx33(star, { width: 16, height: 16 }) }),
|
|
1193
1218
|
rating
|
|
1194
1219
|
] }),
|
|
1195
|
-
/* @__PURE__ */
|
|
1220
|
+
/* @__PURE__ */ jsx33(
|
|
1196
1221
|
IconButton,
|
|
1197
1222
|
{
|
|
1198
1223
|
variant: "primary",
|
|
1199
|
-
icon: cartIcon ?? /* @__PURE__ */
|
|
1224
|
+
icon: cartIcon ?? /* @__PURE__ */ jsx33(cartAdd, { width: 16, height: 16 }),
|
|
1200
1225
|
onClick: (e) => {
|
|
1201
1226
|
e.stopPropagation();
|
|
1202
1227
|
onAddToCart();
|
|
@@ -1211,10 +1236,10 @@ function ProductCard(props) {
|
|
|
1211
1236
|
}
|
|
1212
1237
|
|
|
1213
1238
|
// src/components/ImagePlaceholder/ImagePlaceholder.tsx
|
|
1214
|
-
import { jsx as
|
|
1239
|
+
import { jsx as jsx34, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
1215
1240
|
function ImagePlaceholder({ width, height, className }) {
|
|
1216
1241
|
const iconSize = Math.round(Math.min(width, height) * 0.32);
|
|
1217
|
-
return /* @__PURE__ */
|
|
1242
|
+
return /* @__PURE__ */ jsx34(
|
|
1218
1243
|
"div",
|
|
1219
1244
|
{
|
|
1220
1245
|
className: cx("snacky-image-placeholder", className),
|
|
@@ -1233,9 +1258,9 @@ function ImagePlaceholder({ width, height, className }) {
|
|
|
1233
1258
|
strokeLinecap: "round",
|
|
1234
1259
|
strokeLinejoin: "round",
|
|
1235
1260
|
children: [
|
|
1236
|
-
/* @__PURE__ */
|
|
1237
|
-
/* @__PURE__ */
|
|
1238
|
-
/* @__PURE__ */
|
|
1261
|
+
/* @__PURE__ */ jsx34("rect", { x: "3", y: "3", width: "18", height: "18", rx: "2" }),
|
|
1262
|
+
/* @__PURE__ */ jsx34("circle", { cx: "8.5", cy: "8.5", r: "1.5", fill: "currentColor", stroke: "none" }),
|
|
1263
|
+
/* @__PURE__ */ jsx34("polyline", { points: "21 15 16 10 5 21" })
|
|
1239
1264
|
]
|
|
1240
1265
|
}
|
|
1241
1266
|
)
|
|
@@ -1268,6 +1293,7 @@ export {
|
|
|
1268
1293
|
NotificationListItem,
|
|
1269
1294
|
OrderListItem,
|
|
1270
1295
|
OtpField,
|
|
1296
|
+
PageIndicator,
|
|
1271
1297
|
PointBalanceBanner,
|
|
1272
1298
|
ProductCard,
|
|
1273
1299
|
ProductChip,
|