@planetaexo/design-system 0.22.2 → 0.23.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.cjs +18 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +21 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.js +18 -9
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -2801,8 +2801,15 @@ function AdventureSection({
|
|
|
2801
2801
|
] })
|
|
2802
2802
|
] }),
|
|
2803
2803
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col divide-y divide-border", children: adventure.travellers.map((t) => {
|
|
2804
|
-
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2;
|
|
2805
|
-
const canRemoveTraveller = adventure.travellers.length > 1;
|
|
2804
|
+
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2, _l2, _m2;
|
|
2805
|
+
const canRemoveTraveller = adventure.travellers.length > 1 || adventure.allowEmptyAdventure === true;
|
|
2806
|
+
const isRemovingLastTraveller = adventure.allowEmptyAdventure === true && adventure.travellers.length === 1;
|
|
2807
|
+
const confirmRemoveLastMessage = (_b2 = (_a2 = labels == null ? void 0 : labels.confirmRemoveLastTraveller) == null ? void 0 : _a2.message) != null ? _b2 : "The adventure will be empty. Continue?";
|
|
2808
|
+
const confirmIfLast = () => {
|
|
2809
|
+
if (!isRemovingLastTraveller) return true;
|
|
2810
|
+
if (typeof window === "undefined") return true;
|
|
2811
|
+
return window.confirm(confirmRemoveLastMessage);
|
|
2812
|
+
};
|
|
2806
2813
|
const disabledRemoveTitle = canRemoveTraveller ? void 0 : cannotRemoveLastTravellerLabel != null ? cannotRemoveLastTravellerLabel : "Cannot remove last traveller";
|
|
2807
2814
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2808
2815
|
"div",
|
|
@@ -2816,7 +2823,7 @@ function AdventureSection({
|
|
|
2816
2823
|
" ",
|
|
2817
2824
|
t.lastName
|
|
2818
2825
|
] }),
|
|
2819
|
-
t.isChild && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs font-semibold font-heading rounded-full px-2 py-0.5 bg-orange-100 text-orange-700 dark:bg-orange-900/30 dark:text-orange-400 shrink-0", children: (
|
|
2826
|
+
t.isChild && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs font-semibold font-heading rounded-full px-2 py-0.5 bg-orange-100 text-orange-700 dark:bg-orange-900/30 dark:text-orange-400 shrink-0", children: (_c2 = labels == null ? void 0 : labels.childBadge) != null ? _c2 : "Child" })
|
|
2820
2827
|
] }),
|
|
2821
2828
|
t.formUrl && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
2822
2829
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -2828,7 +2835,7 @@ function AdventureSection({
|
|
|
2828
2835
|
className: "flex items-center gap-1 text-xs text-primary hover:text-primary/80 transition-colors font-ui",
|
|
2829
2836
|
children: [
|
|
2830
2837
|
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.ExternalLinkIcon, { className: "w-3 h-3" }),
|
|
2831
|
-
(
|
|
2838
|
+
(_d2 = labels == null ? void 0 : labels.openFormLink) != null ? _d2 : "Open"
|
|
2832
2839
|
]
|
|
2833
2840
|
}
|
|
2834
2841
|
),
|
|
@@ -2838,7 +2845,7 @@ function AdventureSection({
|
|
|
2838
2845
|
type: "button",
|
|
2839
2846
|
onClick: () => handleCopyUrl(t.formUrl),
|
|
2840
2847
|
className: "flex items-center text-xs text-muted-foreground hover:text-primary transition-colors font-ui",
|
|
2841
|
-
"aria-label": (
|
|
2848
|
+
"aria-label": (_e2 = labels == null ? void 0 : labels.copyFormUrlAria) != null ? _e2 : "Copy form URL",
|
|
2842
2849
|
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CopyIcon, { className: "w-3 h-3" })
|
|
2843
2850
|
}
|
|
2844
2851
|
)
|
|
@@ -2852,7 +2859,7 @@ function AdventureSection({
|
|
|
2852
2859
|
"inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-bold font-heading uppercase tracking-wider shrink-0",
|
|
2853
2860
|
t.status === "completed" ? "bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-400" : "bg-yellow-100 text-yellow-800 dark:bg-yellow-900/30 dark:text-yellow-400"
|
|
2854
2861
|
),
|
|
2855
|
-
children: t.status === "completed" ? (
|
|
2862
|
+
children: t.status === "completed" ? (_f2 = labels == null ? void 0 : labels.travellerStatusCompleted) != null ? _f2 : t.status : (_g2 = labels == null ? void 0 : labels.travellerStatusPending) != null ? _g2 : t.status
|
|
2856
2863
|
}
|
|
2857
2864
|
),
|
|
2858
2865
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-0.5 shrink-0", children: [
|
|
@@ -2868,7 +2875,7 @@ function AdventureSection({
|
|
|
2868
2875
|
}
|
|
2869
2876
|
},
|
|
2870
2877
|
className: "flex h-8 w-8 sm:h-7 sm:w-7 items-center justify-center rounded-lg text-muted-foreground hover:text-primary hover:bg-primary/10 transition-colors",
|
|
2871
|
-
"aria-label": (
|
|
2878
|
+
"aria-label": (_i2 = (_h2 = labels == null ? void 0 : labels.editTravellerAria) == null ? void 0 : _h2.call(labels, t.firstName)) != null ? _i2 : `Edit ${t.firstName}`,
|
|
2872
2879
|
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.PencilIcon, { className: "w-3.5 h-3.5" })
|
|
2873
2880
|
}
|
|
2874
2881
|
),
|
|
@@ -2878,6 +2885,7 @@ function AdventureSection({
|
|
|
2878
2885
|
type: "button",
|
|
2879
2886
|
onClick: () => {
|
|
2880
2887
|
if (!canRemoveTraveller) return;
|
|
2888
|
+
if (!confirmIfLast()) return;
|
|
2881
2889
|
if (onRemoveTraveller) {
|
|
2882
2890
|
onRemoveTraveller(adventure.id, t.id);
|
|
2883
2891
|
} else {
|
|
@@ -2891,7 +2899,7 @@ function AdventureSection({
|
|
|
2891
2899
|
"flex h-8 w-8 sm:h-7 sm:w-7 items-center justify-center rounded-lg text-muted-foreground hover:text-destructive hover:bg-destructive/10 transition-colors",
|
|
2892
2900
|
"disabled:opacity-40 disabled:cursor-not-allowed disabled:pointer-events-none disabled:hover:text-muted-foreground disabled:hover:bg-transparent"
|
|
2893
2901
|
),
|
|
2894
|
-
"aria-label": (
|
|
2902
|
+
"aria-label": (_k2 = (_j2 = labels == null ? void 0 : labels.deleteTravellerAria) == null ? void 0 : _j2.call(labels, t.firstName)) != null ? _k2 : `Delete ${t.firstName}`,
|
|
2895
2903
|
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Trash2Icon, { className: "w-3.5 h-3.5" })
|
|
2896
2904
|
}
|
|
2897
2905
|
),
|
|
@@ -2901,6 +2909,7 @@ function AdventureSection({
|
|
|
2901
2909
|
type: "button",
|
|
2902
2910
|
onClick: () => {
|
|
2903
2911
|
if (!canRemoveTraveller) return;
|
|
2912
|
+
if (!confirmIfLast()) return;
|
|
2904
2913
|
if (onUnassignFromAdventure) {
|
|
2905
2914
|
onUnassignFromAdventure(adventure.id, t.id);
|
|
2906
2915
|
} else if (onRemoveTraveller) {
|
|
@@ -2916,7 +2925,7 @@ function AdventureSection({
|
|
|
2916
2925
|
"flex h-8 w-8 sm:h-7 sm:w-7 items-center justify-center rounded-lg text-muted-foreground hover:text-amber-500 hover:bg-amber-500/10 transition-colors",
|
|
2917
2926
|
"disabled:opacity-40 disabled:cursor-not-allowed disabled:pointer-events-none disabled:hover:text-muted-foreground disabled:hover:bg-transparent"
|
|
2918
2927
|
),
|
|
2919
|
-
"aria-label": (
|
|
2928
|
+
"aria-label": (_m2 = (_l2 = labels == null ? void 0 : labels.removeFromAdventureAria) == null ? void 0 : _l2.call(labels, t.firstName)) != null ? _m2 : `Remove ${t.firstName} from adventure`,
|
|
2920
2929
|
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.UserMinusIcon, { className: "w-3.5 h-3.5" })
|
|
2921
2930
|
}
|
|
2922
2931
|
)
|