@customafk/lunas-ui 0.0.2 → 0.0.3-a

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/dist/Atoms/AspectRatio/index.js +2 -0
  2. package/dist/Atoms/Avatar/index.js +3 -3
  3. package/dist/Atoms/Badge/index.js +2 -0
  4. package/dist/Atoms/Breadcrumb/index.js +7 -23
  5. package/dist/Atoms/Button/index.d.ts +2 -2
  6. package/dist/Atoms/Button/index.js +2 -0
  7. package/dist/Atoms/Card/index.js +2 -0
  8. package/dist/Atoms/Checkbox/index.d.ts +6 -0
  9. package/dist/Atoms/Checkbox/index.js +276 -0
  10. package/dist/Atoms/Command/index.d.ts +7 -7
  11. package/dist/Atoms/Command/index.js +39 -50
  12. package/dist/Atoms/Dialog/index.js +16 -31
  13. package/dist/Atoms/DropdownMenu/index.js +2 -0
  14. package/dist/Atoms/Form/index.js +32 -21
  15. package/dist/Atoms/Input/index.d.ts +5 -1
  16. package/dist/Atoms/Input/index.js +45 -543
  17. package/dist/Atoms/Label/index.js +2 -0
  18. package/dist/Atoms/MenuItem/index.d.ts +14 -0
  19. package/dist/Atoms/MenuItem/index.js +287 -0
  20. package/dist/Atoms/Money/index.js +2 -0
  21. package/dist/Atoms/Navbar/index.js +2 -0
  22. package/dist/Atoms/NavigationMenu/index.js +2 -0
  23. package/dist/Atoms/NumberInput/index.d.ts +7 -0
  24. package/dist/Atoms/NumberInput/index.js +321 -0
  25. package/dist/Atoms/Popover/index.d.ts +8 -0
  26. package/dist/Atoms/Popover/index.js +286 -0
  27. package/dist/Atoms/Progress/index.js +2 -0
  28. package/dist/Atoms/QuantityBtn/index.js +2 -0
  29. package/dist/Atoms/RadioGroup/index.d.ts +7 -0
  30. package/dist/Atoms/RadioGroup/index.js +285 -0
  31. package/dist/Atoms/ScrollBar/index.js +4 -2
  32. package/dist/Atoms/Select/index.js +2 -0
  33. package/dist/Atoms/Sheet/index.d.ts +29 -0
  34. package/dist/Atoms/Sheet/index.js +422 -0
  35. package/dist/Atoms/Slider/index.d.ts +6 -0
  36. package/dist/Atoms/Slider/index.js +286 -0
  37. package/dist/Atoms/SmallQuantityBtn/index.d.ts +9 -0
  38. package/dist/Atoms/SmallQuantityBtn/index.js +110 -0
  39. package/dist/Atoms/Switch/index.d.ts +6 -0
  40. package/dist/Atoms/Switch/index.js +293 -0
  41. package/dist/Atoms/Tabs/index.d.ts +9 -0
  42. package/dist/Atoms/Tabs/index.js +304 -0
  43. package/dist/Atoms/Textarea/index.d.ts +5 -0
  44. package/dist/Atoms/Textarea/index.js +283 -0
  45. package/dist/Atoms/Tooltip/index.d.ts +10 -0
  46. package/dist/Atoms/Tooltip/index.js +289 -0
  47. package/dist/Atoms/UserAvatar/index.d.ts +2 -2
  48. package/dist/Atoms/UserAvatar/index.js +24 -28
  49. package/dist/Atoms/XButton/index.d.ts +10 -0
  50. package/dist/Atoms/XButton/index.js +309 -0
  51. package/dist/Authentication/SignIn/index.d.ts +1 -1
  52. package/dist/Authentication/SignIn/index.js +129 -74
  53. package/dist/Authentication/SignUp/index.d.ts +5 -5
  54. package/dist/Authentication/SignUp/index.js +181 -110
  55. package/dist/Authentication/ThankYou/index.js +13 -4
  56. package/dist/Ecommerce/Categories/index.d.ts +33 -0
  57. package/dist/Ecommerce/Categories/index.js +1426 -0
  58. package/dist/Icons/index.d.ts +5 -3
  59. package/dist/Icons/index.js +126 -97
  60. package/dist/Molecules/AuthenForm/index.js +30 -21
  61. package/dist/Molecules/Search/index.js +46 -57
  62. package/dist/Molecules/UserDropdown/index.js +42 -33
  63. package/dist/Organisms/Header/index.d.ts +25 -3
  64. package/dist/Organisms/Header/index.js +585 -324
  65. package/dist/hooks/index.d.ts +1 -54
  66. package/dist/hooks/index.js +3 -127
  67. package/dist/{types-BgHhiNa-.d.ts → types-BlE003QY.d.ts} +1 -1
  68. package/package.json +85 -41
@@ -0,0 +1,1426 @@
1
+ // packages/Ecommerce/Categories/index.tsx
2
+ import { useCallback as useCallback4, useState as useState7 } from "react";
3
+
4
+ // packages/Ecommerce/Categories/components/AcceptBtn.tsx
5
+ import { useState } from "react";
6
+
7
+ // packages/Atoms/Select/index.tsx
8
+ import { forwardRef } from "react";
9
+
10
+ // packages/utils/constants.ts
11
+ var DEFAULT_ICON_SIZE = 24;
12
+
13
+ // packages/Icons/Lucide2ChevronDownIcon.tsx
14
+ import { jsx } from "react/jsx-runtime";
15
+ var Lucide2ChevronDownIcon = (props) => {
16
+ const { color, size } = props;
17
+ return /* @__PURE__ */ jsx(
18
+ "svg",
19
+ {
20
+ xmlns: "http://www.w3.org/2000/svg",
21
+ width: size ?? DEFAULT_ICON_SIZE,
22
+ height: size ?? DEFAULT_ICON_SIZE,
23
+ viewBox: "0 0 16 16",
24
+ fill: "none",
25
+ ...props,
26
+ children: /* @__PURE__ */ jsx(
27
+ "path",
28
+ {
29
+ d: "M4 6L8 10L12 6",
30
+ stroke: color ?? "#434349",
31
+ strokeWidth: "1.5",
32
+ strokeLinecap: "round",
33
+ strokeLinejoin: "round"
34
+ }
35
+ )
36
+ }
37
+ );
38
+ };
39
+ Lucide2ChevronDownIcon.displayName = "Lucide2ChevronDownIcon";
40
+ var Lucide2ChevronDownIcon_default = Lucide2ChevronDownIcon;
41
+
42
+ // packages/tailwindTheme.ts
43
+ var themes = {
44
+ spacing: {
45
+ 30: "7.5rem",
46
+ // 120px
47
+ 33: "8.25rem"
48
+ // 132px
49
+ },
50
+ colors: {
51
+ ui: {
52
+ white: "#ffffff",
53
+ "white-primary": "#ffffff",
54
+ "black-primary": "#111315",
55
+ "bg-white": "#FAFAFA",
56
+ primary: {
57
+ default: "#6C70F0",
58
+ 50: "#EEF2FF",
59
+ 100: "#E0E7FF",
60
+ 200: "#C8D2FD",
61
+ 300: "#A6B6FB",
62
+ 400: "#828EF7",
63
+ 500: "#6C70F0",
64
+ 600: "#5048E3",
65
+ 700: "#443AC8",
66
+ 800: "#3731A2",
67
+ 900: "#312F80",
68
+ 950: "#1F1C4A"
69
+ },
70
+ secondary: {
71
+ default: "#C170FF",
72
+ 50: "#F9F1FF",
73
+ 100: "#F3E2FF",
74
+ 200: "#ECD4FF",
75
+ 300: "#E0B8FF",
76
+ 400: "#D49BFF",
77
+ 500: "#C170FF",
78
+ 600: "#AE65E6",
79
+ 700: "#9A5ACC",
80
+ 800: "#874EB3",
81
+ 900: "#613880",
82
+ 950: "#3A224C"
83
+ },
84
+ tertiary: {
85
+ default: "#5B8CFF",
86
+ 50: "#EFF4FF",
87
+ 100: "#DEE8FF",
88
+ 200: "#CEDDFF",
89
+ 300: "#BDD1FF",
90
+ 400: "#7CA3FF",
91
+ 500: "#5B8CFF",
92
+ 600: "#527EE6",
93
+ 700: "#4062B3",
94
+ 800: "#2E4680",
95
+ 900: "#243866",
96
+ 950: "#1B2A4C"
97
+ },
98
+ destructive: {
99
+ default: "#EF4444",
100
+ 50: "#FEF2F2",
101
+ 100: "#FEE2E2",
102
+ 200: "#FECACA",
103
+ 300: "#FCA5A5",
104
+ 400: "#F87171",
105
+ 500: "#EF4444",
106
+ 600: "#DC2626",
107
+ 700: "#B91C1C",
108
+ 800: "#991B1B",
109
+ 900: "#7F1D1D",
110
+ 950: "#450A0A"
111
+ },
112
+ success: {
113
+ default: "#22c55e",
114
+ 50: "#f0fdf4",
115
+ 100: "#dcfce7",
116
+ 200: "#bbf7d0",
117
+ 300: "#86efac",
118
+ 400: "#4ade80",
119
+ 500: "#22c55e",
120
+ 600: "#16a34a",
121
+ 700: "#15803d",
122
+ 800: "#166534",
123
+ 900: "#14532d",
124
+ 950: "#052e16"
125
+ },
126
+ warn: {
127
+ default: "#f59e0b",
128
+ 50: "#fffbeb",
129
+ 100: "#fef3c7",
130
+ 200: "#fde68a",
131
+ 300: "#fcd34d",
132
+ 400: "#fbbf24",
133
+ 500: "#f59e0b",
134
+ 600: "#d97706",
135
+ 700: "#b45309",
136
+ 800: "#92400e",
137
+ 900: "#78350f",
138
+ 950: "#451a03"
139
+ },
140
+ text: {
141
+ black: "#09090b",
142
+ white: "#fafafa",
143
+ 50: "#fafafa",
144
+ 100: "#f4f4f5",
145
+ 200: "#e4e4e7",
146
+ 300: "#d4d4d8",
147
+ 400: "#a1a1aa",
148
+ 500: "#71717a",
149
+ 600: "#52525b",
150
+ 700: "#3f3f46",
151
+ 800: "#27272a",
152
+ 900: "#18181b",
153
+ 950: "#09090b"
154
+ },
155
+ surface: {
156
+ default: "#ffffff",
157
+ 50: "#ffffff",
158
+ 100: "#f5f5f5",
159
+ 200: "#e5e5e5",
160
+ 300: "#d4d4d4",
161
+ 400: "#a3a3a3",
162
+ 500: "#737373",
163
+ 600: "#525252",
164
+ 700: "#404040",
165
+ 800: "#262626",
166
+ 900: "#171717",
167
+ 950: "#0a0a0a"
168
+ },
169
+ border: {
170
+ default: "#64748B",
171
+ 50: "#f9fafb",
172
+ 100: "#f3f4f6",
173
+ 200: "#e5e7eb",
174
+ 300: "#d1d5db",
175
+ 400: "#9ca3af",
176
+ 500: "#64748B",
177
+ 600: "#475569",
178
+ 700: "#334155",
179
+ 800: "#1E293B",
180
+ 900: "#0F172A",
181
+ 950: "#020817"
182
+ },
183
+ // TEXT COLOR
184
+ "text-primary": "#111315",
185
+ "text-secondary": "#30353C",
186
+ "text-third": "#30353CCC",
187
+ "text-placeholder": "#11131566",
188
+ "text-white-placeholder": "#FDFDFD99",
189
+ "text-black": {
190
+ primary: "#19191B",
191
+ secondary: "#222325",
192
+ third: "#292A2E",
193
+ fourth: "#5F606A",
194
+ placeholder: "#B2B3BD"
195
+ },
196
+ "text-white": {
197
+ primary: "#FCFCFC",
198
+ secondary: "#F9F9F9",
199
+ third: "#D9D9D9"
200
+ },
201
+ // COLOR SPECIAL
202
+ "positive-flat": "#4ADE80",
203
+ "destruction-flat": "#EF4444",
204
+ "neutral-flat": "#BFDBFE",
205
+ rating: "#FDE047",
206
+ input: {
207
+ border: {
208
+ active: "#71717A",
209
+ disabled: "#D4D4D8"
210
+ },
211
+ bg: {
212
+ default: "#FDFDFD",
213
+ error: "#FEF2F2"
214
+ }
215
+ }
216
+ }
217
+ },
218
+ backgroundImage: {
219
+ "ui-bg-color": "linear-gradient(110deg, #9CD5F5 3.09%, #B1B8E6 33.47%, rgba(185, 155, 215, 0.90) 62.82%, #A293DF 84.45%, #878AEA 106.08%)",
220
+ "ui-bg-page": "radial-gradient(70.47% 70.47% at 50% 50%, #FDFDFD 0%, #F3F1FF 50%, #F1FCFF 100%)",
221
+ "ui-btn-primary": "linear-gradient(180deg, #828EF7 0%, #6C70F0 100%)",
222
+ "ui-btn-secondary": "linear-gradient(180deg, #4277EF 0%, #669BF4 100%)",
223
+ "ui-btn-accept": "linear-gradient(282deg, #30C36D 6.81%, #6BCD8A 93.19%)",
224
+ "ui-btn-destructive": "linear-gradient(282deg, #FF384A 7.07%, #FF5463 92.93%)",
225
+ "ui-status-bg-positive": "linear-gradient(0deg, #C4FFD8 0%, #68FF9D 100%)",
226
+ "ui-status-bg-negative": "linear-gradient(0deg, #FECACA 0%, #FF8F8F 100%)",
227
+ "ui-status-bg-neutral": "linear-gradient(0deg, #E1EBFF 0%, #C7E8FF 100%)",
228
+ "ui-status-order": "linear-gradient(282deg, #30C36D 6.81%, #6BCD8A 93.19%)",
229
+ "ui-status-out-of-stock": "linear-gradient(282deg, #FF384A 7.07%, #FF5463 92.93%)",
230
+ "ui-status-in-stock": "linear-gradient(282deg, #30A8FF 6.81%, #73BAED 93.19%)",
231
+ "ui-line": "linear-gradient(90deg, #D3D4FF 0%, #7587EA 50%, #AEC0FF 100%)"
232
+ },
233
+ boxShadow: {
234
+ "ui-sd-primary": "0 4px 20px 0 rgba(104, 109, 224, 0.5)",
235
+ "ui-sd-base": "0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)",
236
+ "ui-sd-destructive": "0 10px 10px 0 rgba(255, 56, 74, 0.15)",
237
+ "ui-sd-accept": "0 10px 10px 0 rgba(46, 213, 115, 0.15)",
238
+ "ui-xl": "0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)",
239
+ "ui-soft": "0px 5px 12px 0px rgba(0, 67, 101, 0.08)",
240
+ "ui-muli": "0px 5px 50px 0px rgba(0, 67, 101, 0.08), 0px 2px 6px 0px rgba(130, 169, 188, 0.08)",
241
+ "ui-category-effect": "0px 4px 50px 0px rgba(0, 67, 101, 0.08)",
242
+ "ui-flat": "0px 0.25rem 0.625rem 0px rgba(99, 102, 241, 0.07)",
243
+ "ui-overlay": "0px 4px 4px 1px rgba(99, 102, 241, 0.04)",
244
+ "ui-sticky-nav": "0px 3px 12px -1px rgba(151, 71, 255, 0.07)",
245
+ "ui-dialog": "0px 8px 12px 0px rgba(99, 102, 241, 0.15)"
246
+ },
247
+ fontSize: {
248
+ "ui-h1": ["1.5rem", "2rem"],
249
+ "ui-h2": ["1.25rem", "1.75rem"],
250
+ "ui-h3": ["1.125rem", "1.75rem"],
251
+ "ui-p": ["1rem", "1.5rem"],
252
+ "ui-note": ["0.875rem", "1.25rem"],
253
+ "ui-small-note": ["0.75rem", "1rem"]
254
+ },
255
+ keyframes: {
256
+ "accordion-down": {
257
+ from: { height: "0" },
258
+ to: { height: "var(--radix-accordion-content-height)" }
259
+ },
260
+ "accordion-up": {
261
+ from: { height: "var(--radix-accordion-content-height)" },
262
+ to: { height: "0" }
263
+ }
264
+ },
265
+ animation: {
266
+ "accordion-down": "accordion-down 0.2s ease-out",
267
+ "accordion-up": "accordion-up 0.2s ease-out"
268
+ }
269
+ };
270
+ var tailwindTheme_default = themes;
271
+
272
+ // packages/libs/utils.ts
273
+ import clsx from "clsx";
274
+ import { extendTailwindMerge } from "tailwind-merge";
275
+ var customTailwindMerge = () => {
276
+ return extendTailwindMerge({
277
+ ...tailwindTheme_default,
278
+ prefix: ""
279
+ });
280
+ };
281
+ var cn = (...inputs) => {
282
+ const customTwMerge = customTailwindMerge();
283
+ return customTwMerge(clsx(inputs));
284
+ };
285
+
286
+ // packages/Atoms/Select/index.tsx
287
+ import * as SelectPrimitive from "@radix-ui/react-select";
288
+ import { Check, ChevronDown, ChevronUp } from "lucide-react";
289
+ import { jsx as jsx2, jsxs } from "react/jsx-runtime";
290
+ var Select = SelectPrimitive.Root;
291
+ var SelectValue = SelectPrimitive.Value;
292
+ var SelectTrigger = forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
293
+ SelectPrimitive.Trigger,
294
+ {
295
+ ref,
296
+ className: cn(
297
+ "flex items-center justify-between",
298
+ "h-10 w-full",
299
+ "px-3 py-2",
300
+ "rounded-md border border-ui-primary-500",
301
+ "text-sm",
302
+ "bg-ui-surface-50",
303
+ "placeholder:text-ui-text-500",
304
+ "focus:outline-none",
305
+ "focus:ring-1",
306
+ "focus:ring-offset-2",
307
+ "focus:ring-offset-ui-primary-200",
308
+ "disabled:cursor-not-allowed",
309
+ "disabled:opacity-50 [&>span]:line-clamp-1",
310
+ className
311
+ ),
312
+ ...props,
313
+ children: [
314
+ children,
315
+ /* @__PURE__ */ jsx2(SelectPrimitive.Icon, { asChild: true, children: /* @__PURE__ */ jsx2(Lucide2ChevronDownIcon_default, { className: "size-4 opacity-50" }) })
316
+ ]
317
+ }
318
+ ));
319
+ SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
320
+ var SelectScrollUpButton = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx2(
321
+ SelectPrimitive.ScrollUpButton,
322
+ {
323
+ ref,
324
+ className: cn("flex items-center justify-center", "cursor-all-scroll py-1", className),
325
+ ...props,
326
+ children: /* @__PURE__ */ jsx2(ChevronUp, { className: "size-4" })
327
+ }
328
+ ));
329
+ SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
330
+ var SelectScrollDownButton = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx2(
331
+ SelectPrimitive.ScrollDownButton,
332
+ {
333
+ ref,
334
+ className: cn("flex cursor-all-scroll items-center justify-center py-1", className),
335
+ ...props,
336
+ children: /* @__PURE__ */ jsx2(ChevronDown, { className: "size-4" })
337
+ }
338
+ ));
339
+ SelectScrollDownButton.displayName = SelectPrimitive.ScrollDownButton.displayName;
340
+ var SelectContent = forwardRef(({ className, children, position = "popper", ...props }, ref) => /* @__PURE__ */ jsx2(SelectPrimitive.Portal, { children: /* @__PURE__ */ jsxs(
341
+ SelectPrimitive.Content,
342
+ {
343
+ ref,
344
+ className: cn(
345
+ "relative z-50",
346
+ "max-h-96 min-w-[8rem]",
347
+ "overflow-hidden",
348
+ "rounded-md border",
349
+ "bg-ui-surface-50",
350
+ "text-ui-text-900",
351
+ "shadow-ui-dialog",
352
+ "data-[state=open]:animate-in",
353
+ "data-[state=open]:zoom-in-95",
354
+ "data-[state=open]:fade-in-0",
355
+ "data-[state=closed]:animate-out",
356
+ "data-[state=closed]:fade-out-0",
357
+ "data-[state=closed]:zoom-out-95",
358
+ "data-[side=bottom]:slide-in-from-top-2",
359
+ "data-[side=left]:slide-in-from-right-2",
360
+ "data-[side=right]:slide-in-from-left-2",
361
+ "data-[side=top]:slide-in-from-bottom-2",
362
+ position === "popper" && "data-[side=bottom]:translate-y-1",
363
+ position === "popper" && "data-[side=left]:-translate-x-1",
364
+ position === "popper" && "data-[side=right]:translate-x-1",
365
+ position === "popper" && "data-[side=top]:-translate-y-1",
366
+ className
367
+ ),
368
+ position,
369
+ ...props,
370
+ children: [
371
+ /* @__PURE__ */ jsx2(SelectScrollUpButton, {}),
372
+ /* @__PURE__ */ jsx2(
373
+ SelectPrimitive.Viewport,
374
+ {
375
+ className: cn(
376
+ "p-1",
377
+ position === "popper" && "h-[var(--radix-select-trigger-height)]",
378
+ position === "popper" && "w-full",
379
+ position === "popper" && "min-w-[var(--radix-select-trigger-width)]"
380
+ ),
381
+ children
382
+ }
383
+ ),
384
+ /* @__PURE__ */ jsx2(SelectScrollDownButton, {})
385
+ ]
386
+ }
387
+ ) }));
388
+ SelectContent.displayName = SelectPrimitive.Content.displayName;
389
+ var SelectLabel = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx2(
390
+ SelectPrimitive.Label,
391
+ {
392
+ ref,
393
+ className: cn("py-1.5 pl-8 pr-2 text-sm font-semibold", className),
394
+ ...props
395
+ }
396
+ ));
397
+ SelectLabel.displayName = SelectPrimitive.Label.displayName;
398
+ var SelectItem = forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
399
+ SelectPrimitive.Item,
400
+ {
401
+ ref,
402
+ className: cn(
403
+ "relative",
404
+ "flex items-center",
405
+ "w-full",
406
+ "py-1.5 pl-8 pr-2",
407
+ "rounded-sm",
408
+ "text-sm",
409
+ "cursor-pointer",
410
+ "select-none",
411
+ "outline-none",
412
+ "focus:bg-ui-primary-100",
413
+ "focus:text-ui-text-900",
414
+ "data-[disabled]:pointer-events-none",
415
+ "data-[disabled]:opacity-50",
416
+ className
417
+ ),
418
+ ...props,
419
+ children: [
420
+ /* @__PURE__ */ jsx2("span", { className: "absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ jsx2(SelectPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx2(Check, { className: "size-4" }) }) }),
421
+ /* @__PURE__ */ jsx2(SelectPrimitive.ItemText, { children })
422
+ ]
423
+ }
424
+ ));
425
+ SelectItem.displayName = SelectPrimitive.Item.displayName;
426
+ var SelectSeparator = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx2(
427
+ SelectPrimitive.Separator,
428
+ {
429
+ ref,
430
+ className: cn("-mx-1 my-1 h-px bg-ui-border-400", className),
431
+ ...props
432
+ }
433
+ ));
434
+ SelectSeparator.displayName = SelectPrimitive.Separator.displayName;
435
+
436
+ // packages/Ecommerce/Categories/components/DateSelect.tsx
437
+ import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
438
+ var DateSelect = ({ onSortChange }) => {
439
+ return /* @__PURE__ */ jsxs2("div", { className: "flex flex-col gap-y-1", children: [
440
+ /* @__PURE__ */ jsx3("p", { className: "text-ui-small-note font-medium text-ui-text-600", children: "S\u1EAFp x\u1EBFp theo" }),
441
+ /* @__PURE__ */ jsxs2(Select, { onValueChange: onSortChange, defaultValue: "date-desc", children: [
442
+ /* @__PURE__ */ jsx3(SelectTrigger, { className: "h-fit min-w-28 rounded border border-ui-border-400 px-2 py-1 text-ui-small-note font-semibold text-ui-text-500", children: /* @__PURE__ */ jsx3(SelectValue, { placeholder: "Gi\xE1 th\u1EA5p nh\u1EA5t" }) }),
443
+ /* @__PURE__ */ jsxs2(SelectContent, { className: "[&_div]:pl-2 [&_svg]:hidden", children: [
444
+ /* @__PURE__ */ jsx3(SelectItem, { value: "price-asc", children: "Gi\xE1 th\u1EA5p nh\u1EA5t" }),
445
+ /* @__PURE__ */ jsx3(SelectItem, { value: "price-desc", children: "Gi\xE1 cao nh\u1EA5t" }),
446
+ /* @__PURE__ */ jsx3(SelectItem, { value: "date-desc", children: "M\u1EDBi nh\u1EA5t" }),
447
+ /* @__PURE__ */ jsx3(SelectItem, { value: "date-asc", children: "C\u0169 nh\u1EA5t" })
448
+ ] })
449
+ ] })
450
+ ] });
451
+ };
452
+ var DateSelect_default = DateSelect;
453
+
454
+ // packages/Ecommerce/Categories/Providers/useBrandProvider.tsx
455
+ import { createContext, useContext } from "react";
456
+ var BrandContext = createContext(null);
457
+ function useBrandProvider() {
458
+ const context = useContext(BrandContext);
459
+ if (!context) {
460
+ throw new Error("useBrandContext must be used within a BrandProvider");
461
+ }
462
+ return context;
463
+ }
464
+
465
+ // packages/Ecommerce/Categories/Providers/usePriceProvider.tsx
466
+ import { createContext as createContext2, useContext as useContext2 } from "react";
467
+ var PriceContext = createContext2(null);
468
+ function usePriceProvider() {
469
+ const context = useContext2(PriceContext);
470
+ if (!context) {
471
+ throw new Error("usePriceContext must be used within a PriceProvider");
472
+ }
473
+ return context;
474
+ }
475
+
476
+ // packages/Atoms/Button/index.tsx
477
+ import { forwardRef as forwardRef2, memo } from "react";
478
+
479
+ // packages/Atoms/Button/buttonVariants.ts
480
+ import { cva } from "class-variance-authority";
481
+ var buttonVariants = cva(
482
+ "flex items-center justify-center gap-1 rounded-md transition duration-150 ease-in-out enabled:hover:opacity-80 enabled:active:opacity-100 enabled:active:ring-4 disabled:cursor-not-allowed disabled:opacity-40",
483
+ {
484
+ variants: {
485
+ variant: {
486
+ default: "bg-ui-btn-primary !text-ui-text-50 enabled:focus:ring-ui-primary-200",
487
+ secondary: "bg-ui-surface-50 !text-ui-primary-500 shadow-ui-overlay enabled:focus:ring-ui-primary-200",
488
+ outline: "border border-solid border-ui-primary-400 !text-ui-primary-500 enabled:hover:shadow-ui-flat enabled:active:ring-ui-primary-200",
489
+ destructive: "bg-ui-destructive-500 !text-ui-text-50 enabled:active:ring-ui-destructive-200",
490
+ "destructive-secondary": "bg-ui-destructive-50 !text-ui-destructive-500 enabled:active:ring-ui-destructive-200",
491
+ "destructive-outline": "border border-solid border-ui-destructive-400 bg-ui-destructive-50 !text-ui-destructive-500 ring-ui-destructive-200 disabled:opacity-60",
492
+ "sort-outline": "bg-ui-primary-50 !text-ui-primary-500 enabled:focus:ring-ui-primary-200",
493
+ normal: "border-ui-black border border-solid bg-ui-white enabled:active:shadow-ui-xl"
494
+ },
495
+ size: {
496
+ default: "px-3 py-1.5 text-ui-note font-semibold",
497
+ base: "px-3 py-1.5 text-ui-note font-semibold",
498
+ large: "px-4 py-2 text-ui-p font-semibold",
499
+ small: "px-2 py-1 text-ui-small-note font-semibold"
500
+ }
501
+ },
502
+ defaultVariants: {
503
+ variant: "default",
504
+ size: "default"
505
+ }
506
+ }
507
+ );
508
+
509
+ // packages/Atoms/Button/index.tsx
510
+ import { Slot, Slottable } from "@radix-ui/react-slot";
511
+ import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
512
+ var Button = memo(
513
+ forwardRef2(
514
+ ({
515
+ className,
516
+ variant = "default",
517
+ size,
518
+ icon,
519
+ rightIcon,
520
+ asChild = false,
521
+ children,
522
+ ...props
523
+ }, reference) => {
524
+ const Comp = asChild ? Slot : "button";
525
+ return /* @__PURE__ */ jsxs3(
526
+ Comp,
527
+ {
528
+ className: cn(buttonVariants({ variant, size, className })),
529
+ ref: reference,
530
+ ...props,
531
+ children: [
532
+ icon,
533
+ /* @__PURE__ */ jsx4(Slottable, { children }),
534
+ rightIcon
535
+ ]
536
+ }
537
+ );
538
+ }
539
+ )
540
+ );
541
+ Button.displayName = "Button";
542
+ var Button_default = Button;
543
+
544
+ // packages/Icons/Lucide2TunnelIcon.tsx
545
+ import { jsx as jsx5 } from "react/jsx-runtime";
546
+ var Lucide2TunnelIcon = ({ size, color }) => {
547
+ return /* @__PURE__ */ jsx5(
548
+ "svg",
549
+ {
550
+ xmlns: "http://www.w3.org/2000/svg",
551
+ width: size ?? 16,
552
+ height: size ?? 16,
553
+ viewBox: "0 0 16 16",
554
+ fill: "none",
555
+ children: /* @__PURE__ */ jsx5(
556
+ "path",
557
+ {
558
+ d: "M6.90667 12.8087L5.33333 13.3333V7.66667L2.34667 4.38133C2.12363 4.13595 2.00004 3.81626 2 3.48467V2H12.6667V3.448C12.6666 3.80159 12.5261 4.14068 12.276 4.39067L9.33333 7.33333M12.8 12.8L14 14M9.33333 11.3333C9.33333 11.8638 9.54405 12.3725 9.91912 12.7475C10.2942 13.1226 10.8029 13.3333 11.3333 13.3333C11.8638 13.3333 12.3725 13.1226 12.7475 12.7475C13.1226 12.3725 13.3333 11.8638 13.3333 11.3333C13.3333 10.8029 13.1226 10.2942 12.7475 9.91912C12.3725 9.54405 11.8638 9.33333 11.3333 9.33333C10.8029 9.33333 10.2942 9.54405 9.91912 9.91912C9.54405 10.2942 9.33333 10.8029 9.33333 11.3333Z",
559
+ stroke: color ?? "currentColor",
560
+ strokeWidth: "1.3",
561
+ strokeLinecap: "round",
562
+ strokeLinejoin: "round"
563
+ }
564
+ )
565
+ }
566
+ );
567
+ };
568
+ var Lucide2TunnelIcon_default = Lucide2TunnelIcon;
569
+
570
+ // packages/Ecommerce/Categories/components/AcceptBtn.tsx
571
+ import { Fragment, jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
572
+ var AcceptBtn = ({ onFilterConfirm }) => {
573
+ const { brandSelected } = useBrandProvider();
574
+ const { price } = usePriceProvider();
575
+ const [sort, setSort] = useState("date-desc");
576
+ return /* @__PURE__ */ jsxs4(Fragment, { children: [
577
+ /* @__PURE__ */ jsx6(DateSelect_default, { onSortChange: (value) => setSort(value) }),
578
+ /* @__PURE__ */ jsx6(
579
+ Button_default,
580
+ {
581
+ variant: "outline",
582
+ icon: /* @__PURE__ */ jsx6(Lucide2TunnelIcon_default, { size: 16, color: "#828EF7" }),
583
+ className: "h-fit border-2 pl-4 pr-6 text-ui-note font-bold",
584
+ onClick: () => onFilterConfirm?.({
585
+ brand: brandSelected,
586
+ price,
587
+ sort
588
+ }),
589
+ children: /* @__PURE__ */ jsx6("span", { children: "L\u1ECDc k\u1EBFt qu\u1EA3" })
590
+ }
591
+ )
592
+ ] });
593
+ };
594
+ var AcceptBtn_default = AcceptBtn;
595
+
596
+ // packages/Ecommerce/Categories/components/BrandTag.tsx
597
+ import { jsx as jsx7 } from "react/jsx-runtime";
598
+ var BrandTag = ({ name }) => {
599
+ return /* @__PURE__ */ jsx7("div", { className: "size-fit select-none rounded border border-purple-400 bg-purple-50 px-3 py-1 text-ui-small-note font-semibold text-purple-500", children: name });
600
+ };
601
+ var BrandTag_default = BrandTag;
602
+
603
+ // packages/Ecommerce/Categories/components/BrandDisplay.tsx
604
+ import { Fragment as Fragment2, jsx as jsx8 } from "react/jsx-runtime";
605
+ var BrandDisplay = () => {
606
+ const { brandSelected } = useBrandProvider();
607
+ return /* @__PURE__ */ jsx8(Fragment2, { children: brandSelected.map((brand) => /* @__PURE__ */ jsx8(BrandTag_default, { ...brand }, brand.uuid)) });
608
+ };
609
+ var BrandDisplay_default = BrandDisplay;
610
+
611
+ // packages/Ecommerce/Categories/components/BrandModal.tsx
612
+ import { memo as memo2, useCallback, useState as useState2 } from "react";
613
+
614
+ // packages/Icons/Lucide2PlusIcon.tsx
615
+ import { jsx as jsx9 } from "react/jsx-runtime";
616
+ var Lucide2PlusIcon = ({ size, color }) => {
617
+ return /* @__PURE__ */ jsx9(
618
+ "svg",
619
+ {
620
+ xmlns: "http://www.w3.org/2000/svg",
621
+ width: size ?? 16,
622
+ height: size ?? 16,
623
+ viewBox: "0 0 16 16",
624
+ fill: "none",
625
+ children: /* @__PURE__ */ jsx9(
626
+ "path",
627
+ {
628
+ d: "M3.33325 7.99998H12.6666M7.99992 3.33331V12.6666",
629
+ stroke: color ?? "black",
630
+ strokeWidth: "1.33333",
631
+ strokeLinecap: "round",
632
+ strokeLinejoin: "round"
633
+ }
634
+ )
635
+ }
636
+ );
637
+ };
638
+ var Lucide2PlusIcon_default = Lucide2PlusIcon;
639
+
640
+ // packages/Ecommerce/Categories/components/FilterBtn.tsx
641
+ import { jsx as jsx10, jsxs as jsxs5 } from "react/jsx-runtime";
642
+ var FilterBtn = ({ title, onClick }) => {
643
+ return /* @__PURE__ */ jsxs5(
644
+ "button",
645
+ {
646
+ onClick,
647
+ className: "flex h-fit items-center gap-x-1 rounded border border-dashed border-ui-border-400 px-3 py-1 shadow-ui-overlay",
648
+ children: [
649
+ /* @__PURE__ */ jsx10(Lucide2PlusIcon_default, { size: 16, color: "#A1A1AA" }),
650
+ /* @__PURE__ */ jsx10("p", { className: "text-ui-small-note font-medium text-ui-text-400", children: title })
651
+ ]
652
+ }
653
+ );
654
+ };
655
+ var FilterBtn_default = FilterBtn;
656
+
657
+ // packages/Atoms/Command/index.tsx
658
+ import * as React2 from "react";
659
+
660
+ // packages/Atoms/Dialog/index.tsx
661
+ import * as React from "react";
662
+ import * as DialogPrimitive from "@radix-ui/react-dialog";
663
+ import { X } from "lucide-react";
664
+ import { jsx as jsx11, jsxs as jsxs6 } from "react/jsx-runtime";
665
+ var Dialog = DialogPrimitive.Root;
666
+ var DialogPortal = DialogPrimitive.Portal;
667
+ var DialogOverlay = React.forwardRef(({ className, ...props }, reference) => /* @__PURE__ */ jsx11(
668
+ DialogPrimitive.Overlay,
669
+ {
670
+ ref: reference,
671
+ className: cn(
672
+ "fixed inset-0 z-50 bg-black/80",
673
+ "data-[state=open]:animate-in",
674
+ "data-[state=closed]:animate-out",
675
+ "data-[state=closed]:fade-out-0",
676
+ "data-[state=open]:fade-in-0",
677
+ className
678
+ ),
679
+ ...props
680
+ }
681
+ ));
682
+ DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
683
+ var DialogContent = React.forwardRef(({ className, children, ...props }, reference) => /* @__PURE__ */ jsxs6(DialogPortal, { children: [
684
+ /* @__PURE__ */ jsx11(DialogOverlay, {}),
685
+ /* @__PURE__ */ jsxs6(
686
+ DialogPrimitive.Content,
687
+ {
688
+ ref: reference,
689
+ className: cn(
690
+ "fixed",
691
+ "left-[50%] top-[50%] z-50",
692
+ "grid w-full max-w-lg",
693
+ "rounded bg-ui-surface-50",
694
+ "translate-x-[-50%] translate-y-[-50%]",
695
+ "transition-all duration-300",
696
+ "data-[state=open]:animate-in",
697
+ "data-[state=open]:fade-in-0",
698
+ "data-[state=open]:zoom-in-95",
699
+ "data-[state=open]:slide-in-from-left-1/2",
700
+ "data-[state=open]:slide-in-from-top-[48%]",
701
+ "data-[state=closed]:animate-out",
702
+ "data-[state=closed]:fade-out-0",
703
+ "data-[state=closed]:zoom-out-[0.8]",
704
+ "data-[state=closed]:slide-out-to-left-1/2",
705
+ "data-[state=closed]:slide-out-to-top-[80%]",
706
+ className
707
+ ),
708
+ ...props,
709
+ children: [
710
+ children,
711
+ /* @__PURE__ */ jsxs6(DialogPrimitive.Close, { className: "ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute right-4 top-4 rounded-sm opacity-70 transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:pointer-events-none", children: [
712
+ /* @__PURE__ */ jsx11(X, { className: "size-4" }),
713
+ /* @__PURE__ */ jsx11("span", { className: "sr-only", children: "Close" })
714
+ ] })
715
+ ]
716
+ }
717
+ )
718
+ ] }));
719
+ DialogContent.displayName = DialogPrimitive.Content.displayName;
720
+ var DialogHeader = ({ className, ...props }) => /* @__PURE__ */ jsx11("div", { className: cn("flex flex-col space-y-1.5 text-center sm:text-left", className), ...props });
721
+ DialogHeader.displayName = "DialogHeader";
722
+ var DialogFooter = ({ className, ...props }) => /* @__PURE__ */ jsx11(
723
+ "div",
724
+ {
725
+ className: cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", className),
726
+ ...props
727
+ }
728
+ );
729
+ DialogFooter.displayName = "DialogFooter";
730
+ var DialogTitle = React.forwardRef(({ className, ...props }, reference) => /* @__PURE__ */ jsx11(
731
+ DialogPrimitive.Title,
732
+ {
733
+ ref: reference,
734
+ className: cn("text-lg font-semibold leading-none tracking-tight", className),
735
+ ...props
736
+ }
737
+ ));
738
+ DialogTitle.displayName = DialogPrimitive.Title.displayName;
739
+ var DialogDescription = React.forwardRef(({ className, ...props }, reference) => /* @__PURE__ */ jsx11(
740
+ DialogPrimitive.Description,
741
+ {
742
+ ref: reference,
743
+ className: cn("text-sm text-ui-text-400", className),
744
+ ...props
745
+ }
746
+ ));
747
+ DialogDescription.displayName = DialogPrimitive.Description.displayName;
748
+
749
+ // packages/Atoms/Command/index.tsx
750
+ import { VisuallyHidden } from "@radix-ui/react-visually-hidden";
751
+ import { Command as CommandPrimitive } from "cmdk";
752
+ import { Search } from "lucide-react";
753
+ import { jsx as jsx12, jsxs as jsxs7 } from "react/jsx-runtime";
754
+ var Command = React2.forwardRef(({ className, ...props }, reference) => /* @__PURE__ */ jsx12(
755
+ CommandPrimitive,
756
+ {
757
+ ref: reference,
758
+ className: cn(
759
+ "flex h-full w-full flex-col overflow-hidden rounded-md bg-ui-white text-ui-text-800",
760
+ className
761
+ ),
762
+ ...props
763
+ }
764
+ ));
765
+ Command.displayName = CommandPrimitive.displayName;
766
+ var CommandDialog = ({ children, ...props }) => {
767
+ return /* @__PURE__ */ jsxs7(Dialog, { ...props, children: [
768
+ /* @__PURE__ */ jsx12(DialogContent, { className: "p-0 shadow-lg", children: /* @__PURE__ */ jsx12(
769
+ Command,
770
+ {
771
+ className: cn(
772
+ "bg-neutral-50",
773
+ "[&_[cmdk-group-heading]]:px-0",
774
+ "[&_[cmdk-group-heading]]:font-medium",
775
+ "[&_[cmdk-group-heading]]:text-ui-text-800",
776
+ "[&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0",
777
+ "[&_[cmdk-group]]:px-2",
778
+ "[&_[cmdk-input-wrapper]_svg]:size-5",
779
+ "[&_[cmdk-input]]:h-12",
780
+ "[&_[cmdk-item]]:px-2",
781
+ "[&_[cmdk-item]]:py-3",
782
+ "[&_[cmdk-item]_svg]:size-5"
783
+ ),
784
+ children
785
+ }
786
+ ) }),
787
+ /* @__PURE__ */ jsx12(VisuallyHidden, { children: /* @__PURE__ */ jsx12(DialogTitle, {}) })
788
+ ] });
789
+ };
790
+ var CommandInput = React2.forwardRef(({ className, ...props }, reference) => /* @__PURE__ */ jsxs7("div", { className: "flex items-center border-b px-3", children: [
791
+ /* @__PURE__ */ jsx12(Search, { className: "mr-2 size-4 shrink-0 opacity-50" }),
792
+ /* @__PURE__ */ jsx12(
793
+ CommandPrimitive.Input,
794
+ {
795
+ ref: reference,
796
+ className: cn(
797
+ "flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none",
798
+ "placeholder:!text-ui-text-300",
799
+ "disabled:cursor-not-allowed",
800
+ "disabled:opacity-50",
801
+ className
802
+ ),
803
+ ...props
804
+ }
805
+ )
806
+ ] }));
807
+ CommandInput.displayName = CommandPrimitive.Input.displayName;
808
+ var CommandList = React2.forwardRef(({ className, ...props }, reference) => /* @__PURE__ */ jsx12(
809
+ CommandPrimitive.List,
810
+ {
811
+ ref: reference,
812
+ className: cn("max-h-[300px] overflow-y-auto overflow-x-hidden", className),
813
+ ...props
814
+ }
815
+ ));
816
+ CommandList.displayName = CommandPrimitive.List.displayName;
817
+ var CommandEmpty = React2.forwardRef((props, reference) => /* @__PURE__ */ jsx12(CommandPrimitive.Empty, { ref: reference, className: "py-6 text-center text-sm", ...props }));
818
+ CommandEmpty.displayName = CommandPrimitive.Empty.displayName;
819
+ var CommandGroup = React2.forwardRef(({ className, ...props }, reference) => /* @__PURE__ */ jsx12(
820
+ CommandPrimitive.Group,
821
+ {
822
+ ref: reference,
823
+ className: cn(
824
+ "overflow-hidden p-1 text-ui-text-800",
825
+ "[&_[cmdk-group-heading]]:px-2",
826
+ "[&_[cmdk-group-heading]]:py-1.5",
827
+ "[&_[cmdk-group-heading]]:text-xs",
828
+ "[&_[cmdk-group-heading]]:font-medium",
829
+ "[&_[cmdk-group-heading]]:text-ui-text-800",
830
+ className
831
+ ),
832
+ ...props
833
+ }
834
+ ));
835
+ CommandGroup.displayName = CommandPrimitive.Group.displayName;
836
+ var CommandSeparator = React2.forwardRef(({ className, ...props }, reference) => /* @__PURE__ */ jsx12(
837
+ CommandPrimitive.Separator,
838
+ {
839
+ ref: reference,
840
+ className: cn("bg-border -mx-1 h-px", className),
841
+ ...props
842
+ }
843
+ ));
844
+ CommandSeparator.displayName = CommandPrimitive.Separator.displayName;
845
+ var CommandItem = React2.forwardRef(({ className, ...props }, reference) => /* @__PURE__ */ jsx12(
846
+ CommandPrimitive.Item,
847
+ {
848
+ ref: reference,
849
+ className: cn(
850
+ "relative flex cursor-default select-none items-center gap-x-1 rounded-lg px-2 py-1.5 text-sm outline-none",
851
+ "data-[selected=true]:text-ui-text-800",
852
+ "data-[disabled=true]:pointer-events-none",
853
+ "data-[disabled=true]:opacity-50",
854
+ "hover:cursor-pointer hover:bg-ui-surface-100",
855
+ "transition-color duration-150 ease-in-out",
856
+ className
857
+ ),
858
+ ...props
859
+ }
860
+ ));
861
+ CommandItem.displayName = CommandPrimitive.Item.displayName;
862
+ var CommandShortcut = ({ className, ...props }) => {
863
+ return /* @__PURE__ */ jsx12(
864
+ "span",
865
+ {
866
+ className: cn("ml-auto text-xs tracking-widest text-ui-text-400", className),
867
+ ...props
868
+ }
869
+ );
870
+ };
871
+ CommandShortcut.displayName = "CommandShortcut";
872
+
873
+ // packages/Ecommerce/Categories/components/BrandModal.tsx
874
+ import { Fragment as Fragment3, jsx as jsx13, jsxs as jsxs8 } from "react/jsx-runtime";
875
+ var BrandModal = ({ data }) => {
876
+ const { brandSelected, setBrandSelected } = useBrandProvider();
877
+ const [open, setOpen] = useState2(false);
878
+ const handleOpen = useCallback(() => setOpen(true), []);
879
+ const handleResetBtn = useCallback(() => {
880
+ setBrandSelected([]);
881
+ setOpen(false);
882
+ }, [setBrandSelected]);
883
+ return /* @__PURE__ */ jsxs8(Fragment3, { children: [
884
+ /* @__PURE__ */ jsx13(FilterBtn_default, { title: "T\xECm ki\u1EBFm th\u01B0\u01A1ng hi\u1EC7u", onClick: handleOpen }),
885
+ /* @__PURE__ */ jsxs8(CommandDialog, { open, onOpenChange: setOpen, children: [
886
+ /* @__PURE__ */ jsx13(CommandInput, { placeholder: "T\xECm ki\u1EBFm th\u01B0\u01A1ng hi\u1EC7u..." }),
887
+ /* @__PURE__ */ jsx13(
888
+ CommandList,
889
+ {
890
+ className: cn(
891
+ "[&>div]:flex",
892
+ "[&>div]:flex-wrap",
893
+ "[&>div]:gap-2",
894
+ "[&>div]:px-4",
895
+ "[&>div]:pt-3"
896
+ ),
897
+ children: data.map(({ uuid, name }) => /* @__PURE__ */ jsx13(CommandItem, { value: name, className: "!p-0", children: /* @__PURE__ */ jsx13(
898
+ "button",
899
+ {
900
+ className: cn(
901
+ "rounded-md border border-ui-border-400 !px-3 !py-1 text-ui-note font-medium",
902
+ brandSelected.find((brand) => brand.uuid === uuid) && "border-ui-tertiary-400 bg-ui-tertiary-50 text-ui-tertiary-500 shadow-ui-flat"
903
+ ),
904
+ onClick: () => {
905
+ if (brandSelected.some((brand) => brand.uuid === uuid)) {
906
+ setBrandSelected(brandSelected.filter((brand) => brand.uuid !== uuid));
907
+ return;
908
+ }
909
+ setBrandSelected((prev) => [...prev, { uuid, name }]);
910
+ },
911
+ children: name
912
+ }
913
+ ) }, uuid))
914
+ }
915
+ ),
916
+ /* @__PURE__ */ jsx13("div", { className: cn("flex w-full justify-end gap-x-2.5 p-3"), children: /* @__PURE__ */ jsx13(Button_default, { variant: "outline", onClick: handleResetBtn, children: "Reset" }) })
917
+ ] })
918
+ ] });
919
+ };
920
+ var BrandModal_default = memo2(BrandModal);
921
+
922
+ // packages/Ecommerce/Categories/components/PricePopover.tsx
923
+ import { useCallback as useCallback3, useMemo as useMemo2, useState as useState4 } from "react";
924
+
925
+ // packages/Ecommerce/Categories/components/PriceTag.tsx
926
+ import { jsx as jsx14 } from "react/jsx-runtime";
927
+ var PriceTag = ({ name }) => {
928
+ return /* @__PURE__ */ jsx14("div", { className: "size-fit select-none text-nowrap rounded border border-ui-tertiary-400 bg-ui-tertiary-50 px-3 py-1 text-ui-small-note font-semibold text-ui-tertiary-500", children: name });
929
+ };
930
+ var PriceTag_default = PriceTag;
931
+
932
+ // packages/Atoms/NumberInput/index.tsx
933
+ import {
934
+ forwardRef as forwardRef5,
935
+ useCallback as useCallback2,
936
+ useMemo,
937
+ useRef,
938
+ useState as useState3
939
+ } from "react";
940
+ import { jsx as jsx15 } from "react/jsx-runtime";
941
+ var NumberInput = forwardRef5(({ className, value: initialValue, onChange, onValueChange, ...props }, ref) => {
942
+ const isFocused = useRef(false);
943
+ const [value, setValue] = useState3(void 0);
944
+ const formattedValue = useMemo(() => {
945
+ const regex = /\B(?=(?:\d{3})+(?!\d))/g;
946
+ const focused = isFocused.current;
947
+ if (initialValue) {
948
+ return focused ? initialValue : initialValue.toString().replaceAll(regex, ",");
949
+ }
950
+ if (!value) return "";
951
+ if (focused) return value.toString().replaceAll(regex, "");
952
+ return value.toString().replaceAll(regex, ",");
953
+ }, [initialValue, value]);
954
+ const handleChange = useCallback2(
955
+ (e) => {
956
+ const { value: value2 } = e.target;
957
+ if (/[^\d,]/.test(value2)) return;
958
+ setValue(value2.replaceAll(",", ""));
959
+ onChange?.(e);
960
+ onValueChange?.(Number(value2));
961
+ },
962
+ [onChange, onValueChange]
963
+ );
964
+ const handleFocus = useCallback2(() => {
965
+ isFocused.current = true;
966
+ if (initialValue) {
967
+ setValue((initialValue ?? "").toString().replaceAll(",", ""));
968
+ return;
969
+ }
970
+ setValue((value ?? "").toString().replaceAll(",", ""));
971
+ }, [initialValue, value]);
972
+ const handleBlur = useCallback2(() => {
973
+ isFocused.current = false;
974
+ setValue((value ?? "").toString().replaceAll(/\B(?=(?:\d{3})+(?!\d))/g, ","));
975
+ }, [value]);
976
+ return /* @__PURE__ */ jsx15(
977
+ "input",
978
+ {
979
+ ref,
980
+ value: formattedValue,
981
+ className: cn(
982
+ "relative",
983
+ "outline-none",
984
+ "px-2 py-1",
985
+ "!text-ui-note text-ui-text-600",
986
+ "rounded border border-ui-border-300",
987
+ "placeholder:!text-ui-note placeholder:text-ui-text-400",
988
+ "focus-within:border-ui-primary-500",
989
+ "focus-within:ring-4",
990
+ "focus-within:ring-ui-primary-50",
991
+ "transition-all duration-300 ease-in-out",
992
+ className
993
+ ),
994
+ ...props,
995
+ onChange: handleChange,
996
+ onFocus: handleFocus,
997
+ onBlur: handleBlur
998
+ }
999
+ );
1000
+ });
1001
+ var NumberInput_default = NumberInput;
1002
+
1003
+ // packages/Atoms/Popover/index.tsx
1004
+ import { forwardRef as forwardRef6 } from "react";
1005
+ import * as PopoverPrimitive from "@radix-ui/react-popover";
1006
+ import { jsx as jsx16 } from "react/jsx-runtime";
1007
+ var Popover = PopoverPrimitive.Root;
1008
+ var PopoverTrigger = PopoverPrimitive.Trigger;
1009
+ var PopoverContent = forwardRef6(({ className, align = "center", sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx16(PopoverPrimitive.Portal, { children: /* @__PURE__ */ jsx16(
1010
+ PopoverPrimitive.Content,
1011
+ {
1012
+ ref,
1013
+ align,
1014
+ sideOffset,
1015
+ className: cn(
1016
+ "z-50 w-72",
1017
+ "rounded-md border",
1018
+ "bg-ui-surface-50 p-4 text-ui-text-800",
1019
+ "shadow-md outline-none",
1020
+ "data-[state=open]:animate-in",
1021
+ "data-[state=open]:fade-in-0",
1022
+ "data-[state=open]:zoom-in-95",
1023
+ "data-[state=closed]:animate-out",
1024
+ "data-[state=closed]:fade-out-0",
1025
+ "data-[state=closed]:zoom-out-95",
1026
+ "data-[side=bottom]:slide-in-from-top-2",
1027
+ "data-[side=left]:slide-in-from-right-2",
1028
+ "data-[side=right]:slide-in-from-left-2",
1029
+ "data-[side=top]:slide-in-from-bottom-2",
1030
+ className
1031
+ ),
1032
+ ...props
1033
+ }
1034
+ ) }));
1035
+ PopoverContent.displayName = PopoverPrimitive.Content.displayName;
1036
+
1037
+ // packages/Ecommerce/Categories/components/PricePopover.tsx
1038
+ import { Fragment as Fragment4, jsx as jsx17, jsxs as jsxs9 } from "react/jsx-runtime";
1039
+ var PricePopover = () => {
1040
+ const { price, setPrice } = usePriceProvider();
1041
+ const [isOpen, setIsOpen] = useState4(false);
1042
+ const data = useMemo2(
1043
+ () => [
1044
+ {
1045
+ value: "0-100000",
1046
+ label: "D\u01B0\u1EDBi 100.000",
1047
+ option: {
1048
+ from: 0,
1049
+ to: 1e5
1050
+ }
1051
+ },
1052
+ {
1053
+ value: "100000-300000",
1054
+ label: "100.000 - 300.000",
1055
+ option: {
1056
+ from: 1e5,
1057
+ to: 3e5
1058
+ }
1059
+ },
1060
+ {
1061
+ value: "300000-600000",
1062
+ label: "300.000 - 600.000",
1063
+ option: {
1064
+ from: 3e5,
1065
+ to: 6e5
1066
+ }
1067
+ },
1068
+ {
1069
+ value: "600000-1000000",
1070
+ label: "600.000 - 1.000.000",
1071
+ option: {
1072
+ from: 6e5,
1073
+ to: 1e6
1074
+ }
1075
+ },
1076
+ {
1077
+ value: "1000000-2000000",
1078
+ label: "1.000.000 - 2.000.000",
1079
+ option: {
1080
+ from: 1e6,
1081
+ to: 2e6
1082
+ }
1083
+ },
1084
+ {
1085
+ value: "2000000-5000000",
1086
+ label: "2.000.000 - 5.000.000",
1087
+ option: {
1088
+ from: 2e6,
1089
+ to: 5e6
1090
+ }
1091
+ },
1092
+ {
1093
+ value: "5000000-8000000",
1094
+ label: "5.000.000 - 8.000.000",
1095
+ option: {
1096
+ from: 5e6,
1097
+ to: 8e6
1098
+ }
1099
+ },
1100
+ {
1101
+ value: "8000000-",
1102
+ label: "Tr\xEAn 8.000.000",
1103
+ option: {
1104
+ from: 8e6,
1105
+ to: Infinity
1106
+ }
1107
+ }
1108
+ ],
1109
+ []
1110
+ );
1111
+ const Item2 = useCallback3(
1112
+ (props) => {
1113
+ const { value, label } = props;
1114
+ return /* @__PURE__ */ jsx17(
1115
+ "button",
1116
+ {
1117
+ className: cn(
1118
+ "rounded-md border border-ui-border-400 !px-3 !py-1 !text-ui-note font-medium text-ui-text-400 shadow-ui-flat",
1119
+ price?.value === value && "border-ui-tertiary-400 bg-ui-tertiary-50 text-ui-tertiary-500"
1120
+ ),
1121
+ onClick: () => setPrice(props),
1122
+ children: label
1123
+ }
1124
+ );
1125
+ },
1126
+ [price?.value, setPrice]
1127
+ );
1128
+ const handleSubmit = useCallback3(() => {
1129
+ if (price && price.option.from > price.option.to) {
1130
+ setPrice(void 0);
1131
+ }
1132
+ setIsOpen(false);
1133
+ }, [price, setPrice]);
1134
+ return /* @__PURE__ */ jsx17(Fragment4, { children: /* @__PURE__ */ jsxs9(Popover, { open: isOpen, onOpenChange: setIsOpen, children: [
1135
+ /* @__PURE__ */ jsx17(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs9("div", { className: "flex flex-wrap gap-2", children: [
1136
+ price && /* @__PURE__ */ jsx17(PriceTag_default, { name: price?.label }),
1137
+ /* @__PURE__ */ jsx17(FilterBtn_default, { title: "T\xECm ki\u1EBFm theo gi\xE1", onClick: () => setIsOpen(true) })
1138
+ ] }) }),
1139
+ /* @__PURE__ */ jsxs9(
1140
+ PopoverContent,
1141
+ {
1142
+ className: "flex w-auto max-w-[34.25rem] flex-col gap-y-2.5",
1143
+ align: "start",
1144
+ sideOffset: 10,
1145
+ onInteractOutside: handleSubmit,
1146
+ children: [
1147
+ /* @__PURE__ */ jsxs9("div", { className: "flex flex-col gap-y-2", children: [
1148
+ /* @__PURE__ */ jsx17("p", { className: "text-ui-note font-medium", children: "Kho\u1EA3ng gi\xE1" }),
1149
+ /* @__PURE__ */ jsxs9("div", { className: "flex gap-x-2", children: [
1150
+ /* @__PURE__ */ jsx17(
1151
+ NumberInput_default,
1152
+ {
1153
+ placeholder: "T\u1EEB",
1154
+ value: price?.option.from.toString(),
1155
+ onValueChange: (value) => {
1156
+ setPrice((prev) => ({
1157
+ ...prev,
1158
+ option: { ...prev?.option, from: value, to: prev?.option.to ?? 0 },
1159
+ label: `${value.toLocaleString()} - ${prev?.option.to?.toLocaleString()}`,
1160
+ value: `${value}-${prev?.option.to}`
1161
+ }));
1162
+ }
1163
+ }
1164
+ ),
1165
+ /* @__PURE__ */ jsx17(
1166
+ NumberInput_default,
1167
+ {
1168
+ placeholder: "\u0110\u1EBFn",
1169
+ value: price?.option.to === Infinity ? "" : price?.option.to.toString(),
1170
+ onValueChange: (value) => setPrice((prev) => {
1171
+ if (prev) {
1172
+ return {
1173
+ ...prev,
1174
+ option: { ...prev.option, to: value ?? 0 },
1175
+ label: `${prev.option.from.toLocaleString()} - ${value.toLocaleString()}`,
1176
+ value: `${prev.option.from}-${value}`
1177
+ };
1178
+ }
1179
+ return prev;
1180
+ })
1181
+ }
1182
+ )
1183
+ ] })
1184
+ ] }),
1185
+ /* @__PURE__ */ jsxs9("div", { className: "flex flex-col gap-y-2 py-2", children: [
1186
+ /* @__PURE__ */ jsx17("p", { className: "text-ui-small-note text-ui-text-500", children: "G\u1EE3i \xFD" }),
1187
+ /* @__PURE__ */ jsx17("div", { className: "flex flex-wrap gap-2 px-3", children: data.map((item) => /* @__PURE__ */ jsx17(Item2, { ...item }, item.value)) })
1188
+ ] }),
1189
+ /* @__PURE__ */ jsxs9("div", { className: "flex justify-end gap-x-2 [&>button]:px-6", children: [
1190
+ /* @__PURE__ */ jsx17(Button_default, { variant: "outline", onClick: () => setPrice(void 0), children: "X\xF3a ch\u1ECDn" }),
1191
+ /* @__PURE__ */ jsx17(Button_default, { onClick: handleSubmit, children: "X\xE1c nh\u1EADn" })
1192
+ ] })
1193
+ ]
1194
+ }
1195
+ )
1196
+ ] }) });
1197
+ };
1198
+ var PricePopover_default = PricePopover;
1199
+
1200
+ // packages/Ecommerce/Categories/Providers/BrandProvider.tsx
1201
+ import { useState as useState5 } from "react";
1202
+ import { jsx as jsx18 } from "react/jsx-runtime";
1203
+ var BrandProvider = ({ children }) => {
1204
+ const [brandSelected, setBrandSelected] = useState5([]);
1205
+ return /* @__PURE__ */ jsx18(BrandContext.Provider, { value: { brandSelected, setBrandSelected }, children });
1206
+ };
1207
+ var BrandProvider_default = BrandProvider;
1208
+
1209
+ // packages/Ecommerce/Categories/Providers/PriceProvider.tsx
1210
+ import { useState as useState6 } from "react";
1211
+ import { jsx as jsx19 } from "react/jsx-runtime";
1212
+ var PriceProvider = ({ children }) => {
1213
+ const [price, setPrice] = useState6({
1214
+ value: "0-100000",
1215
+ label: "D\u01B0\u1EDBi 100.000",
1216
+ option: {
1217
+ from: 0,
1218
+ to: 1e5
1219
+ }
1220
+ });
1221
+ return /* @__PURE__ */ jsx19(PriceContext.Provider, { value: { price, setPrice }, children });
1222
+ };
1223
+ var PriceProvider_default = PriceProvider;
1224
+
1225
+ // packages/Icons/Lucide2LayoutGrid.tsx
1226
+ import { jsx as jsx20, jsxs as jsxs10 } from "react/jsx-runtime";
1227
+ var Lucide2LayoutGrid = ({ color, size }) => {
1228
+ return /* @__PURE__ */ jsxs10(
1229
+ "svg",
1230
+ {
1231
+ xmlns: "http://www.w3.org/2000/svg",
1232
+ width: size ?? DEFAULT_ICON_SIZE,
1233
+ height: size ?? DEFAULT_ICON_SIZE,
1234
+ viewBox: "0 0 17 17",
1235
+ fill: "none",
1236
+ children: [
1237
+ /* @__PURE__ */ jsx20(
1238
+ "path",
1239
+ {
1240
+ d: "M7.28923 2.58765H2.62256V7.25431H7.28923V2.58765Z",
1241
+ stroke: color ?? "#3B3C3F",
1242
+ strokeLinecap: "round",
1243
+ strokeLinejoin: "round"
1244
+ }
1245
+ ),
1246
+ /* @__PURE__ */ jsx20(
1247
+ "path",
1248
+ {
1249
+ d: "M14.6225 2.58765H9.95581V7.25431H14.6225V2.58765Z",
1250
+ stroke: color ?? "#3B3C3F",
1251
+ strokeLinecap: "round",
1252
+ strokeLinejoin: "round"
1253
+ }
1254
+ ),
1255
+ /* @__PURE__ */ jsx20(
1256
+ "path",
1257
+ {
1258
+ d: "M14.6225 9.9209H9.95581V14.5876H14.6225V9.9209Z",
1259
+ stroke: color ?? "#3B3C3F",
1260
+ strokeLinecap: "round",
1261
+ strokeLinejoin: "round"
1262
+ }
1263
+ ),
1264
+ /* @__PURE__ */ jsx20(
1265
+ "path",
1266
+ {
1267
+ d: "M7.28923 9.9209H2.62256V14.5876H7.28923V9.9209Z",
1268
+ stroke: color ?? "#3B3C3F",
1269
+ strokeLinecap: "round",
1270
+ strokeLinejoin: "round"
1271
+ }
1272
+ )
1273
+ ]
1274
+ }
1275
+ );
1276
+ };
1277
+ var Lucide2LayoutGrid_default = Lucide2LayoutGrid;
1278
+
1279
+ // packages/Icons/Lucide2LayoutListIcon.tsx
1280
+ import { jsx as jsx21, jsxs as jsxs11 } from "react/jsx-runtime";
1281
+ var Lucide2LayoutListIcon = ({ color, size, ...props }) => {
1282
+ return /* @__PURE__ */ jsxs11(
1283
+ "svg",
1284
+ {
1285
+ xmlns: "http://www.w3.org/2000/svg",
1286
+ width: size ?? DEFAULT_ICON_SIZE,
1287
+ height: size ?? DEFAULT_ICON_SIZE,
1288
+ viewBox: "0 0 17 17",
1289
+ fill: "none",
1290
+ ...props,
1291
+ children: [
1292
+ /* @__PURE__ */ jsx21(
1293
+ "path",
1294
+ {
1295
+ d: "M7.28923 9.9209H2.62256V14.5876H7.28923V9.9209Z",
1296
+ stroke: color ?? "#3B3C3F",
1297
+ strokeLinecap: "round",
1298
+ strokeLinejoin: "round"
1299
+ }
1300
+ ),
1301
+ /* @__PURE__ */ jsx21(
1302
+ "path",
1303
+ {
1304
+ d: "M7.28923 2.58765H2.62256V7.25431H7.28923V2.58765Z",
1305
+ stroke: color ?? "#3B3C3F",
1306
+ strokeLinecap: "round",
1307
+ strokeLinejoin: "round"
1308
+ }
1309
+ ),
1310
+ /* @__PURE__ */ jsx21(
1311
+ "path",
1312
+ {
1313
+ d: "M9.95581 3.25439H14.6225",
1314
+ stroke: color ?? "#3B3C3F",
1315
+ strokeLinecap: "round",
1316
+ strokeLinejoin: "round"
1317
+ }
1318
+ ),
1319
+ /* @__PURE__ */ jsx21(
1320
+ "path",
1321
+ {
1322
+ d: "M9.95581 6.58765H14.6225",
1323
+ stroke: color ?? "#3B3C3F",
1324
+ strokeLinecap: "round",
1325
+ strokeLinejoin: "round"
1326
+ }
1327
+ ),
1328
+ /* @__PURE__ */ jsx21(
1329
+ "path",
1330
+ {
1331
+ d: "M9.95581 10.5876H14.6225",
1332
+ stroke: color ?? "#3B3C3F",
1333
+ strokeLinecap: "round",
1334
+ strokeLinejoin: "round"
1335
+ }
1336
+ ),
1337
+ /* @__PURE__ */ jsx21(
1338
+ "path",
1339
+ {
1340
+ d: "M9.95581 13.9209H14.6225",
1341
+ stroke: color ?? "#3B3C3F",
1342
+ strokeLinecap: "round",
1343
+ strokeLinejoin: "round"
1344
+ }
1345
+ )
1346
+ ]
1347
+ }
1348
+ );
1349
+ };
1350
+ var Lucide2LayoutListIcon_default = Lucide2LayoutListIcon;
1351
+
1352
+ // packages/Ecommerce/Categories/index.tsx
1353
+ import { jsx as jsx22, jsxs as jsxs12 } from "react/jsx-runtime";
1354
+ var CategoriesPage = ({
1355
+ initialLayout = "GRID",
1356
+ brandData,
1357
+ children,
1358
+ onFilterConfirm,
1359
+ onLayoutChange
1360
+ }) => {
1361
+ const [layout, setLayout] = useState7(initialLayout);
1362
+ const handleGridSelect = useCallback4(() => {
1363
+ setLayout("GRID");
1364
+ onLayoutChange?.("GRID");
1365
+ }, [onLayoutChange]);
1366
+ const handleListSelect = useCallback4(() => {
1367
+ setLayout("LIST");
1368
+ onLayoutChange?.("LIST");
1369
+ }, [onLayoutChange]);
1370
+ return /* @__PURE__ */ jsxs12(
1371
+ "main",
1372
+ {
1373
+ className: cn(
1374
+ "flex flex-[1_0_0] flex-col overflow-clip",
1375
+ "items-start",
1376
+ "gap-y-8",
1377
+ "rounded-2xl bg-ui-surface-50 shadow-ui-overlay"
1378
+ ),
1379
+ children: [
1380
+ /* @__PURE__ */ jsxs12(
1381
+ "section",
1382
+ {
1383
+ className: cn("flex flex-col", "items-stretch gap-y-4", "h-fit w-full", "px-6 py-4"),
1384
+ children: [
1385
+ /* @__PURE__ */ jsxs12("div", { className: "flex h-fit w-full flex-col gap-y-0", children: [
1386
+ /* @__PURE__ */ jsxs12("div", { className: "flex items-center justify-between py-1", children: [
1387
+ /* @__PURE__ */ jsx22("h3", { className: "text-ui-h3 font-semibold text-ui-text-950", children: "T\u1EA5t c\u1EA3 s\u1EA3n ph\u1EA9m" }),
1388
+ /* @__PURE__ */ jsxs12("div", { className: "flex size-fit items-center gap-x-2", children: [
1389
+ /* @__PURE__ */ jsx22("button", { onClick: handleGridSelect, children: /* @__PURE__ */ jsx22(Lucide2LayoutGrid_default, { size: 16, color: layout === "GRID" ? "#18181B" : "#D4D4D8" }) }),
1390
+ /* @__PURE__ */ jsx22("button", { onClick: handleListSelect, children: /* @__PURE__ */ jsx22(
1391
+ Lucide2LayoutListIcon_default,
1392
+ {
1393
+ size: 16,
1394
+ color: layout === "LIST" ? "#18181B" : "#D4D4D8"
1395
+ }
1396
+ ) })
1397
+ ] })
1398
+ ] }),
1399
+ /* @__PURE__ */ jsx22("div", { className: "h-2 w-full bg-ui-line" })
1400
+ ] }),
1401
+ /* @__PURE__ */ jsx22(BrandProvider_default, { children: /* @__PURE__ */ jsx22(PriceProvider_default, { children: /* @__PURE__ */ jsxs12("div", { className: "grid grid-cols-3 gap-x-6 p-0", children: [
1402
+ /* @__PURE__ */ jsxs12("div", { className: "flex grow flex-col gap-y-1", children: [
1403
+ /* @__PURE__ */ jsx22("p", { className: "text-ui-small-note font-medium text-ui-text-800", children: "Th\u01B0\u01A1ng hi\u1EC7u" }),
1404
+ /* @__PURE__ */ jsxs12("div", { className: "flex h-full w-full flex-wrap gap-2 border-r border-ui-border-400", children: [
1405
+ /* @__PURE__ */ jsx22(BrandDisplay_default, {}),
1406
+ /* @__PURE__ */ jsx22(BrandModal_default, { data: brandData })
1407
+ ] })
1408
+ ] }),
1409
+ /* @__PURE__ */ jsxs12("div", { className: "flex grow flex-col gap-y-1", children: [
1410
+ /* @__PURE__ */ jsx22("p", { className: "text-ui-small-note font-medium text-ui-text-800", children: "Kho\u1EA3ng gi\xE1" }),
1411
+ /* @__PURE__ */ jsx22("div", { className: "flex size-full flex-wrap items-start gap-2 border-r border-ui-border-400", children: /* @__PURE__ */ jsx22(PricePopover_default, {}) })
1412
+ ] }),
1413
+ /* @__PURE__ */ jsx22("div", { className: "flex h-fit items-end justify-between gap-x-4", children: /* @__PURE__ */ jsx22(AcceptBtn_default, { onFilterConfirm }) })
1414
+ ] }) }) })
1415
+ ]
1416
+ }
1417
+ ),
1418
+ children
1419
+ ]
1420
+ }
1421
+ );
1422
+ };
1423
+ var Categories_default = CategoriesPage;
1424
+ export {
1425
+ Categories_default as default
1426
+ };