qaema-ui 0.0.61 → 0.0.63

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.
@@ -38,7 +38,7 @@ const u = i.div`
38
38
  const t = g(d ?? "default");
39
39
  return /* @__PURE__ */ e.jsxs(u, { bgColor: r, $variantStyles: t, children: [
40
40
  n && /* @__PURE__ */ e.jsx(f, { src: n, alt: "badge-image" }),
41
- s && /* @__PURE__ */ e.jsx(m, { variant: "span", color: o ?? t.color, weight: c, children: s }),
41
+ s && /* @__PURE__ */ e.jsx(m, { variant: "span", color: o ?? t.color, weight: c ?? "semiBold", children: s }),
42
42
  l,
43
43
  a && /* @__PURE__ */ e.jsx(h, { onClick: a, $variantStyles: t, children: /* @__PURE__ */ e.jsx(p, { color: o ?? t.color, size: "0.75rem" }) })
44
44
  ] });
@@ -1,10 +1,32 @@
1
1
  export type PackageCardProps = {
2
2
  planTitle: string;
3
3
  planDescription: string;
4
+ variant?: PackageCardVariant;
4
5
  offerBadgLabel?: string;
5
6
  isPopular?: boolean;
7
+ isPersonalTier?: boolean;
6
8
  popularBadgLabel?: string;
9
+ recommendeBadgLabel?: string;
7
10
  bulletsList: string[];
11
+ features?: PackageCardFeature[];
12
+ showFeatures?: boolean;
13
+ featuresTitle?: string;
14
+ featuresDescription?: string;
15
+ hintComponent?: React.ReactNode;
16
+ showTabs?: boolean;
17
+ selectedTabId?: string;
18
+ tabs?: {
19
+ id: string;
20
+ label: string;
21
+ amount?: string;
22
+ period?: string;
23
+ }[];
24
+ onTabChange?: (tabId: string) => void;
25
+ showAddons?: boolean;
26
+ selectedAddon?: string;
27
+ setSelectedAddon?: (addonId: string) => void;
28
+ addOnsData?: PackageCardAddon[];
29
+ addonsMonthlyLabel?: string;
8
30
  primaryAction?: {
9
31
  label: string;
10
32
  onClick: () => void;
@@ -17,5 +39,17 @@ export type PackageCardProps = {
17
39
  period?: string;
18
40
  backgroundColor?: string;
19
41
  };
42
+ export type PackageCardAddon = {
43
+ id: string;
44
+ titleEn: string;
45
+ baseFare: number;
46
+ color?: string;
47
+ };
48
+ export type PackageCardFeatureVariant = 'included' | 'excluded';
49
+ export type PackageCardFeature = {
50
+ label: string;
51
+ variant?: PackageCardFeatureVariant;
52
+ };
53
+ export type PackageCardVariant = 'transparent' | 'purple';
20
54
  declare const PackageCard: (props: PackageCardProps) => import("react/jsx-runtime").JSX.Element;
21
55
  export default PackageCard;
@@ -1,13 +1,35 @@
1
- import { j as e } from "../_virtual/jsx-runtime.js";
2
- import { LuLayoutDashboard as b } from "../node_modules/react-icons/lu/index.js";
3
- import o, { useTheme as C } from "styled-components";
4
- import m from "./Badge.js";
5
- import w from "./BulletItem.js";
6
- import p from "./Button.js";
7
- import { Card as k } from "./Card.js";
8
- import v from "./PriceAmount.js";
9
- import x from "./Typography.js";
10
- const $ = o.div`
1
+ import { j as r } from "../_virtual/jsx-runtime.js";
2
+ import { FiCheck as G, FiX as J } from "../node_modules/react-icons/fi/index.js";
3
+ import { LuLayoutDashboard as K } from "../node_modules/react-icons/lu/index.js";
4
+ import n, { useTheme as N, css as w } from "styled-components";
5
+ import Q from "../assets/icons/RiyalIcon.js";
6
+ import k from "./Badge.js";
7
+ import C from "./Button.js";
8
+ import { Card as U } from "./Card.js";
9
+ import Y from "./PriceAmount.js";
10
+ import s from "./Typography.js";
11
+ const Z = {
12
+ transparent: w`
13
+ background: rgba(255, 255, 255, 0.72);
14
+ border: 1px solid ${({ theme: e }) => e.colors.grey.n200};
15
+ box-shadow: 0 8px 24px rgba(16, 24, 40, 0.06);
16
+ `,
17
+ purple: w`
18
+ background: linear-gradient(360deg, #ffffff 63.12%, #f1eeff 100%);
19
+ border: 1px solid #e3deff;
20
+ box-shadow:
21
+ 0px 4px 6px -2px #10182808,
22
+ 0px 12px 16px -4px #10182814;
23
+ `
24
+ }, _ = n(U)`
25
+ ${({ $variant: e }) => Z[e]};
26
+
27
+ ${(e) => e.$isPersonalTier && `
28
+ position: relative;
29
+
30
+
31
+ `}
32
+ `, ee = n.div`
11
33
  display: flex;
12
34
  align-items: center;
13
35
  gap: 1rem;
@@ -16,85 +38,287 @@ const $ = o.div`
16
38
  @media (max-width: 480px) {
17
39
  gap: 0.5rem;
18
40
  }
19
- `, B = o.div`
20
- border: 1px solid ${(r) => r.theme.colors.grey.n300};
21
- padding: ${(r) => r.theme.spacing.xs};
22
- border-radius: ${(r) => r.theme.borderRadius.md};
41
+ `, re = n.div`
42
+ border: 1px solid ${(e) => e.theme.colors.grey.n300};
43
+ padding: ${(e) => e.theme.spacing.xs};
44
+ border-radius: ${(e) => e.theme.borderRadius.md};
23
45
  width: 2rem;
24
46
  height: 2rem;
25
47
  display: flex;
26
48
  justify-content: center;
27
49
  align-items: center;
28
- margin-bottom: ${(r) => r.theme.spacing.s};
50
+ margin-bottom: ${(e) => e.theme.spacing.s};
29
51
  svg {
30
52
  width: 1.3rem;
31
53
  height: 1.3rem;
32
- color: ${(r) => r.theme.colors.primary.purple.n450};
54
+ color: ${(e) => e.theme.colors.primary.purple.n450};
33
55
  }
34
- `, P = o.div`
56
+ `, ie = n.div`
57
+ padding: 0.75rem 0 0 0;
58
+ display: flex;
59
+ flex-direction: column;
60
+ gap: ${({ theme: e }) => e.spacing.s};
61
+ `, ne = n.div`
35
62
  display: flex;
36
63
  flex-direction: column;
37
- margin-bottom: ${(r) => r.theme.spacing.sm};
38
64
  gap: 0.5rem;
39
- `, T = o.div`
65
+ align-items: center;
66
+ text-align: center;
67
+ `, te = n(s)`
68
+ font-family: ${({ theme: e }) => e.fonts.arabic};
69
+ font-weight: 500;
70
+ font-size: ${({ theme: e }) => {
71
+ var o;
72
+ return (o = e.typography.sizes) == null ? void 0 : o.s4;
73
+ }};
74
+ line-height: ${({ theme: e }) => e.typography.lineHeights.m};
75
+ color: ${({ theme: e }) => e.colors.grey.n400};
76
+ text-align: center;
77
+ `, oe = n.div`
78
+ display: flex;
79
+ justify-content: center;
80
+ `, se = n.ul`
81
+ display: grid;
82
+ grid-template-columns: repeat(3, minmax(0, 1fr));
83
+ margin: 0;
84
+ padding: 0;
85
+ list-style: none;
86
+ gap: ${({ theme: e }) => e.spacing.s};
87
+
88
+ @media (max-width: 900px) {
89
+ grid-template-columns: repeat(2, minmax(0, 1fr));
90
+ }
91
+
92
+ @media (max-width: 560px) {
93
+ grid-template-columns: 1fr;
94
+ }
95
+ `, ae = n.li`
96
+ display: flex;
97
+ align-items: center;
98
+ gap: ${({ theme: e }) => e.spacing.xs};
99
+ min-width: 0;
100
+ `, le = n.span`
101
+ width: 1rem;
102
+ height: 1rem;
103
+ border-radius: 50%;
104
+ display: inline-flex;
105
+ align-items: center;
106
+ justify-content: center;
107
+ flex-shrink: 0;
108
+
109
+ svg {
110
+ width: 0.7rem;
111
+ height: 0.7rem;
112
+ }
113
+
114
+ ${({ theme: e, $variant: o }) => o === "included" ? `
115
+ border: 1px solid ${e.colors.secondary.green.n450};
116
+ color: ${e.colors.secondary.green.n450};
117
+ ` : `
118
+ border: 1px solid ${e.colors.secondary.pink.n450};
119
+ color: ${e.colors.secondary.pink.n450};
120
+ `}
121
+ `, ce = n(s)`
122
+ color: ${({ theme: e }) => e.colors.grey.n400};
123
+ white-space: nowrap;
124
+ overflow: hidden;
125
+ text-overflow: ellipsis;
126
+ `, de = n.div`
127
+ margin: 0 0 ${(e) => e.theme.spacing.s} 0;
128
+ padding: 0.25rem;
129
+ background-color: ${(e) => e.theme.colors.grey.n100};
130
+ border-radius: ${(e) => e.theme.borderRadius.md};
131
+ display: grid;
132
+ grid-template-columns: repeat(2, minmax(0, 1fr));
133
+ gap: 0.25rem;
134
+ `, pe = n.button`
135
+ border: 1px solid ${(e) => e.$isActive ? e.theme.colors.grey.n200 : "transparent"};
136
+ background-color: ${(e) => e.$isActive ? e.theme.colors.grey.n50 : "transparent"};
137
+ border-radius: ${(e) => e.theme.borderRadius.sm};
138
+ padding: 0.45rem 0.35rem;
139
+ cursor: pointer;
140
+ display: flex;
141
+ flex-direction: column;
142
+ align-items: center;
143
+ justify-content: center;
144
+ gap: 0.1rem;
145
+ box-shadow: ${(e) => e.$isActive ? "0 1px 2px rgba(16, 24, 40, 0.08)" : "none"};
146
+ `, me = n(s)`
147
+ color: ${(e) => e.$isActive ? e.theme.colors.grey.n800 : e.theme.colors.grey.n400};
148
+ font-size: 12px;
149
+ font-weight: ${(e) => e.$isActive ? 600 : 400};
150
+ line-height: 1;
151
+ `, he = n(s)`
152
+ color: ${(e) => e.$isActive ? e.theme.colors.grey.n800 : e.theme.colors.grey.n500};
153
+ font-size: 12px;
154
+ font-weight: 600;
155
+ line-height: 1;
156
+ `, xe = n.div`
40
157
  display: flex;
41
158
  width: 100%;
42
159
  gap: 0.5rem;
43
- `, h = o.div`
160
+ `, T = n.div`
44
161
  display: flex;
45
162
  width: 50%;
46
163
 
47
164
  button {
48
165
  width: 100%;
49
166
  }
50
- `, A = o.div`
167
+ `, ge = n.div`
51
168
  display: flex;
52
169
  justify-content: flex-end;
53
- margin-bottom: ${(r) => r.theme.spacing.xs};
54
- `, L = o(x)`
55
- color: ${(r) => r.theme.colors.grey.n400};
56
- margin: ${(r) => r.theme.spacing.xs} 0rem ${(r) => r.theme.spacing.s} 0;
170
+ margin-bottom: ${(e) => e.theme.spacing.xs};
171
+ `, ue = n(s)`
172
+ color: ${(e) => e.theme.colors.grey.n400};
173
+ margin: ${(e) => e.theme.spacing.xs} 0rem ${(e) => e.theme.spacing.s} 0;
57
174
  display: inline-block;
58
175
  text-align: start;
59
176
 
60
177
  @media (max-width: 480px) {
61
178
  width: 100%;
62
179
  }
63
- `, G = (r) => {
180
+ `, Ae = (e) => {
64
181
  const {
65
- planTitle: g,
66
- planDescription: s,
67
- offerBadgLabel: l,
68
- popularBadgLabel: c,
69
- isPopular: u,
70
- bulletsList: n,
71
- primaryAction: t,
72
- secondaryAction: a,
73
- period: y,
74
- amount: f,
75
- backgroundColor: j = ""
76
- } = r, i = C();
77
- return /* @__PURE__ */ e.jsxs(k, { width: "100%", backgroundColor: u ? i.colors.primary.purple.n100 : j, children: [
78
- /* @__PURE__ */ e.jsx(B, { children: /* @__PURE__ */ e.jsx(b, {}) }),
79
- /* @__PURE__ */ e.jsxs("div", { children: [
80
- /* @__PURE__ */ e.jsxs($, { children: [
81
- /* @__PURE__ */ e.jsxs(x, { variant: "h6", weight: "bold", children: [
182
+ planTitle: o,
183
+ planDescription: u,
184
+ variant: A,
185
+ offerBadgLabel: f,
186
+ popularBadgLabel: y,
187
+ recommendeBadgLabel: b,
188
+ isPopular: F,
189
+ isPersonalTier: B,
190
+ bulletsList: L,
191
+ features: d,
192
+ showFeatures: S = !0,
193
+ featuresDescription: P = "Everything in this plan plus...",
194
+ hintComponent: $,
195
+ showTabs: R = !1,
196
+ selectedTabId: z,
197
+ tabs: p = [],
198
+ onTabChange: m,
199
+ showAddons: I = !1,
200
+ selectedAddon: D = "Without",
201
+ setSelectedAddon: h,
202
+ addOnsData: j = [],
203
+ addonsMonthlyLabel: H = "monthly",
204
+ primaryAction: x,
205
+ secondaryAction: g,
206
+ period: W,
207
+ amount: E,
208
+ backgroundColor: V = ""
209
+ } = e, c = N(), a = B ?? o.trim().toLowerCase() === "personal account", M = A ?? (a || F ? "purple" : "transparent"), O = a && S, X = a && R && p.length > 0, q = a && I && j.length > 0, v = d && d.length > 0 ? d : (L ?? []).map((i) => ({
210
+ label: i,
211
+ variant: "included"
212
+ }));
213
+ return /* @__PURE__ */ r.jsxs(_, { width: "100%", backgroundColor: V, $isPersonalTier: a, $variant: M, children: [
214
+ /* @__PURE__ */ r.jsx(re, { children: /* @__PURE__ */ r.jsx(K, {}) }),
215
+ /* @__PURE__ */ r.jsxs("div", { children: [
216
+ /* @__PURE__ */ r.jsxs(ee, { children: [
217
+ /* @__PURE__ */ r.jsxs(s, { variant: "h6", weight: "bold", children: [
82
218
  " ",
83
- g
219
+ o
84
220
  ] }),
85
- c && /* @__PURE__ */ e.jsx(m, { bgColor: i.colors.secondary.green.n100, color: i.colors.secondary.green.n550, label: c ?? "" }),
86
- l && /* @__PURE__ */ e.jsx(m, { bgColor: i.colors.secondary.pink.n100, color: i.colors.secondary.pink.n450, label: l ?? "" })
221
+ b && /* @__PURE__ */ r.jsx("span", { children: b }),
222
+ y && /* @__PURE__ */ r.jsx(k, { bgColor: c.colors.secondary.green.n100, color: c.colors.secondary.green.n550, label: y ?? "" }),
223
+ f && /* @__PURE__ */ r.jsx(k, { bgColor: c.colors.secondary.pink.n100, color: c.colors.secondary.pink.n450, label: f ?? "" })
87
224
  ] }),
88
- s && /* @__PURE__ */ e.jsx(L, { variant: "caption", children: s }),
89
- n && /* @__PURE__ */ e.jsx(P, { children: n == null ? void 0 : n.map((d) => /* @__PURE__ */ e.jsx(w, { title: d }, d)) })
225
+ u && /* @__PURE__ */ r.jsx(ue, { variant: "caption", children: u }),
226
+ X && /* @__PURE__ */ r.jsx(de, { children: p.map((i) => {
227
+ var l;
228
+ const t = (z ?? ((l = p[0]) == null ? void 0 : l.id)) === i.id;
229
+ return /* @__PURE__ */ r.jsxs(pe, { type: "button", $isActive: t, onClick: () => m == null ? void 0 : m(i.id), children: [
230
+ /* @__PURE__ */ r.jsx(me, { variant: "caption", $isActive: t, children: i.label }),
231
+ (i.amount || i.period) && /* @__PURE__ */ r.jsxs(he, { variant: "caption", $isActive: t, children: [
232
+ i.amount ? `${i.amount} ` : "",
233
+ i.period ?? ""
234
+ ] })
235
+ ] }, i.id);
236
+ }) }),
237
+ q && /* @__PURE__ */ r.jsx("div", { style: { marginTop: "0.50rem" }, children: /* @__PURE__ */ r.jsx(
238
+ "div",
239
+ {
240
+ style: {
241
+ backgroundColor: "#f5f7fb",
242
+ borderRadius: "9px",
243
+ padding: "4px",
244
+ display: "grid",
245
+ gridTemplateColumns: "repeat(2, minmax(0, 1fr))",
246
+ gap: "4px"
247
+ },
248
+ children: j.map((i) => {
249
+ const t = D === i.id;
250
+ return /* @__PURE__ */ r.jsxs(
251
+ "button",
252
+ {
253
+ type: "button",
254
+ onClick: () => h == null ? void 0 : h(i.id),
255
+ style: {
256
+ padding: "8px 6px 7px",
257
+ border: t ? "1px solid #e4e7ec" : "1px solid transparent",
258
+ backgroundColor: t ? "#ffffff" : "transparent",
259
+ color: t ? "#16181c" : "#72788e",
260
+ borderRadius: "6px",
261
+ cursor: "pointer",
262
+ fontWeight: 600,
263
+ fontSize: "12.78px",
264
+ lineHeight: 1.1,
265
+ transition: "all 0.18s ease",
266
+ display: "flex",
267
+ flexDirection: "column",
268
+ alignItems: "center",
269
+ justifyContent: "center",
270
+ gap: "2px",
271
+ minHeight: "42px",
272
+ boxShadow: t ? "0 1px 2px rgba(16, 24, 40, 0.08)" : "none"
273
+ },
274
+ children: [
275
+ /* @__PURE__ */ r.jsx("span", { children: i.titleEn }),
276
+ /* @__PURE__ */ r.jsxs(
277
+ "span",
278
+ {
279
+ style: {
280
+ fontSize: "11px",
281
+ marginTop: "2px",
282
+ color: "#16181c",
283
+ fontWeight: 600,
284
+ display: "inline-flex",
285
+ alignItems: "center",
286
+ gap: "2px"
287
+ },
288
+ children: [
289
+ /* @__PURE__ */ r.jsx(Q, { width: "9", height: "9", color: "#16181c" }),
290
+ i.baseFare,
291
+ " ",
292
+ H
293
+ ]
294
+ }
295
+ )
296
+ ]
297
+ },
298
+ i.id
299
+ );
300
+ })
301
+ }
302
+ ) }),
303
+ O && v.length > 0 && /* @__PURE__ */ r.jsxs(ie, { children: [
304
+ /* @__PURE__ */ r.jsx(ne, { children: /* @__PURE__ */ r.jsx(te, { children: P }) }),
305
+ $ && /* @__PURE__ */ r.jsx(oe, { children: $ }),
306
+ /* @__PURE__ */ r.jsx(se, { children: v.map((i, t) => {
307
+ const l = i.variant ?? "included";
308
+ return /* @__PURE__ */ r.jsxs(ae, { children: [
309
+ /* @__PURE__ */ r.jsx(le, { $variant: l, children: l === "included" ? /* @__PURE__ */ r.jsx(G, {}) : /* @__PURE__ */ r.jsx(J, {}) }),
310
+ /* @__PURE__ */ r.jsx(ce, { variant: "caption", children: i.label })
311
+ ] }, `${i.label}-${t}`);
312
+ }) })
313
+ ] })
90
314
  ] }),
91
- /* @__PURE__ */ e.jsx(A, { children: /* @__PURE__ */ e.jsx(v, { amount: f, period: y }) }),
92
- /* @__PURE__ */ e.jsxs(T, { children: [
93
- /* @__PURE__ */ e.jsx(h, { children: t && /* @__PURE__ */ e.jsx(p, { variant: "outline-primary", onClick: t.onClick, children: t.label }) }),
94
- /* @__PURE__ */ e.jsx(h, { children: a && /* @__PURE__ */ e.jsx(p, { onClick: a.onClick, children: a.label }) })
315
+ /* @__PURE__ */ r.jsx(ge, { children: /* @__PURE__ */ r.jsx(Y, { amount: E, period: W }) }),
316
+ /* @__PURE__ */ r.jsxs(xe, { children: [
317
+ /* @__PURE__ */ r.jsx(T, { children: x && /* @__PURE__ */ r.jsx(C, { variant: "outline-primary", onClick: x.onClick, children: x.label }) }),
318
+ /* @__PURE__ */ r.jsx(T, { children: g && /* @__PURE__ */ r.jsx(C, { onClick: g.onClick, children: g.label }) })
95
319
  ] })
96
320
  ] });
97
321
  };
98
322
  export {
99
- G as default
323
+ Ae as default
100
324
  };
@@ -18,21 +18,21 @@ const p = r.div`
18
18
  `, d = r.div`
19
19
  display: flex;
20
20
  align-items: center;
21
- `, u = ({ onHeaderBack: e, headerTitle: o, withRightIcon: s }) => {
22
- const a = c().dir === "rtl", i = s;
21
+ `, u = ({ onHeaderBack: e, headerTitle: s, withRightIcon: o }) => {
22
+ const a = c().dir === "rtl", i = o;
23
23
  return /* @__PURE__ */ t.jsxs(p, { children: [
24
24
  /* @__PURE__ */ t.jsxs(d, { children: [
25
25
  e && /* @__PURE__ */ t.jsx(
26
26
  n,
27
27
  {
28
- icon: /* @__PURE__ */ t.jsx(m, { style: a ? { transform: "rotate(180deg)" } : {} }),
28
+ icon: /* @__PURE__ */ t.jsx(m, { style: a ? { transform: "rotate(180deg)" } : {}, size: 20 }),
29
29
  onClick: e,
30
30
  onlyIcon: !0,
31
31
  size: "md",
32
32
  variant: "outline-primary"
33
33
  }
34
34
  ),
35
- /* @__PURE__ */ t.jsx(l, { variant: "h3", children: o })
35
+ /* @__PURE__ */ t.jsx(l, { variant: "h3", children: s })
36
36
  ] }),
37
37
  i && /* @__PURE__ */ t.jsx(n, { icon: /* @__PURE__ */ t.jsx(i, {}), onClick: e, onlyIcon: !0, size: "md", variant: "outline-primary" })
38
38
  ] });
@@ -1,10 +1,18 @@
1
1
  import React from 'react';
2
+ import type { ReactNode } from 'react';
3
+ import type { BadgeVariant } from '@hooks/useBadgeVariant';
4
+ import type { FontWeight } from '@theme/theme';
2
5
  export type PriceCardVariant = 'transparent' | 'purple';
3
6
  export type FeatureVariant = 'included' | 'excluded';
4
7
  export type PriceCardBadge = {
5
8
  label: string;
6
9
  bgColor: string;
7
10
  color: string;
11
+ weight?: FontWeight;
12
+ variant?: BadgeVariant;
13
+ children?: ReactNode;
14
+ onClose?: () => void;
15
+ image?: string;
8
16
  };
9
17
  export type PriceCardFeature = {
10
18
  label: string;
@@ -31,6 +39,7 @@ export type PriceCardProps = {
31
39
  price: PriceCardPrice;
32
40
  secondaryPrice?: SecondaryPrice;
33
41
  description: string;
42
+ hintComponent?: React.ReactNode;
34
43
  features: PriceCardFeature[];
35
44
  variant?: PriceCardVariant;
36
45
  badges?: PriceCardBadge[];