@giddaa-housing/ui 3.1.0 → 3.3.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.
Files changed (69) hide show
  1. package/css/generated/shared.css +1 -1
  2. package/css/giddaa.css +12 -3
  3. package/css/theme.css +4 -1
  4. package/dist/accordion.js +3 -2
  5. package/dist/activity-timeline.js +2 -2
  6. package/dist/alert.js +4 -4
  7. package/dist/breadcrumb.js +3 -3
  8. package/dist/button.js +8 -4
  9. package/dist/calendar.js +3 -3
  10. package/dist/call-card.js +1 -1
  11. package/dist/carousel.js +3 -3
  12. package/dist/chart.js +1 -1
  13. package/dist/chat.js +1 -1
  14. package/dist/checkbox.js +2 -2
  15. package/dist/combobox.js +6 -6
  16. package/dist/cta.js +3 -3
  17. package/dist/currency-selector.d.ts +10 -8
  18. package/dist/currency-selector.js +247 -28
  19. package/dist/data-table.js +2 -2
  20. package/dist/date-picker.js +6 -6
  21. package/dist/dialog.js +2 -2
  22. package/dist/dropdown-menu.js +20 -20
  23. package/dist/dropzone.js +1 -1
  24. package/dist/editorial-card.d.ts +20 -11
  25. package/dist/editorial-card.js +67 -2
  26. package/dist/file-upload.js +1 -1
  27. package/dist/filter.js +1 -1
  28. package/dist/footer.d.ts +8 -3
  29. package/dist/footer.js +16 -5
  30. package/dist/icons.d.ts +93 -0
  31. package/dist/icons.js +905 -0
  32. package/dist/infinite-scroll.js +1 -1
  33. package/dist/input-otp.js +2 -2
  34. package/dist/kpi-card.js +1 -1
  35. package/dist/match.js +1 -1
  36. package/dist/media-gallery-hero.js +4 -4
  37. package/dist/media-player.js +59 -48
  38. package/dist/message.js +1 -1
  39. package/dist/mobile-sidebar.js +4 -4
  40. package/dist/multi-step-form.js +2 -2
  41. package/dist/number-input.js +3 -3
  42. package/dist/pagination.js +4 -4
  43. package/dist/password-input.js +1 -1
  44. package/dist/phone-input.js +4 -4
  45. package/dist/photo-gallery.js +3 -3
  46. package/dist/price-tag.js +1 -1
  47. package/dist/property-listing-card.js +1 -1
  48. package/dist/rich-text-editor.js +4 -4
  49. package/dist/scroll-spy.d.ts +61 -0
  50. package/dist/scroll-spy.js +295 -0
  51. package/dist/search-input.js +1 -1
  52. package/dist/select.js +6 -6
  53. package/dist/sheet.js +2 -2
  54. package/dist/sidebar.js +1 -1
  55. package/dist/stepper.js +2 -2
  56. package/dist/styles.css +239 -26
  57. package/dist/tabs.d.ts +13 -1
  58. package/dist/tabs.js +9 -2
  59. package/dist/tag.js +1 -1
  60. package/dist/testimonial-block.js +1 -1
  61. package/dist/theme-switcher.d.ts +31 -0
  62. package/dist/theme-switcher.js +78 -0
  63. package/dist/time-picker.js +2 -2
  64. package/dist/toast.d.ts +38 -10
  65. package/dist/toast.js +56 -52
  66. package/dist/top-navbar.js +3 -3
  67. package/dist/video-player-dialog.d.ts +57 -0
  68. package/dist/video-player-dialog.js +188 -0
  69. package/package.json +17 -2
@@ -1,17 +1,235 @@
1
1
  "use client";
2
+ import { Check } from "./icons.js";
2
3
  import { t as cn } from "./cn-BI_4DMBf.js";
3
4
  import { t as useUncontrolled } from "./use-uncontrolled-CLfM1XbB.js";
4
5
  import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "./select.js";
5
- import { CheckIcon } from "lucide-react";
6
- import { jsx, jsxs } from "react/jsx-runtime";
6
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
7
7
  import { cva } from "class-variance-authority";
8
+ //#region src/lib/country-flags.tsx
9
+ /**
10
+ * Hand-drawn flags for the currencies the design system ships with. They are
11
+ * simplified for a 24×16 pill — recognisable at icon size rather than exact
12
+ * heraldry — and inlined so no icon or flag package is needed at runtime.
13
+ *
14
+ * Every flag draws into a `0 0 24 16` viewBox. Add a country by dropping a new
15
+ * entry into `COUNTRY_FLAGS`, keyed by its ISO 3166-1 alpha-2 code.
16
+ */
17
+ /** Points of a five-pointed star, so the EU/US/Ghana stars stay real stars. */
18
+ function starPath(cx, cy, radius) {
19
+ return `M${Array.from({ length: 10 }, (_, index) => {
20
+ const distance = index % 2 === 0 ? radius : radius * .382;
21
+ const angle = index * Math.PI / 5 - Math.PI / 2;
22
+ return `${(cx + Math.cos(angle) * distance).toFixed(2)} ${(cy + Math.sin(angle) * distance).toFixed(2)}`;
23
+ }).join("L")}Z`;
24
+ }
25
+ const US_STRIPE_HEIGHT = 16 / 13;
26
+ const US_STRIPES = Array.from({ length: 7 }, (_, index) => index * 2 * US_STRIPE_HEIGHT);
27
+ const US_STARS = Array.from({ length: 9 }, (_, index) => ({
28
+ x: 2.2 + index % 3 * 2.6,
29
+ y: 2 + Math.floor(index / 3) * 2.3
30
+ }));
31
+ const EU_STARS = Array.from({ length: 12 }, (_, index) => {
32
+ const angle = index * Math.PI / 6 - Math.PI / 2;
33
+ return {
34
+ x: 12 + Math.cos(angle) * 5,
35
+ y: 8 + Math.sin(angle) * 5
36
+ };
37
+ });
38
+ const MAPLE_LEAF = "M12 3.45L12.71 5.25L14.23 4.83L13.85 6.54L16.09 6.96L15.52 7.68L15.94 9.05L13.95 8.72L13.76 9.67L12.59 9.01L12.9 12.19L11.1 12.19L11.41 9.01L10.24 9.67L10.05 8.72L8.06 9.05L8.48 7.68L7.92 6.96L10.15 6.54L9.77 4.83L11.29 5.25Z";
39
+ const COUNTRY_FLAGS = {
40
+ /** Nigeria */
41
+ NG: () => /* @__PURE__ */ jsxs(Fragment, { children: [
42
+ /* @__PURE__ */ jsx("rect", {
43
+ width: "24",
44
+ height: "16",
45
+ fill: "#ffffff"
46
+ }),
47
+ /* @__PURE__ */ jsx("rect", {
48
+ width: "8",
49
+ height: "16",
50
+ fill: "#008751"
51
+ }),
52
+ /* @__PURE__ */ jsx("rect", {
53
+ x: "16",
54
+ width: "8",
55
+ height: "16",
56
+ fill: "#008751"
57
+ })
58
+ ] }),
59
+ /** United States */
60
+ US: () => /* @__PURE__ */ jsxs(Fragment, { children: [
61
+ /* @__PURE__ */ jsx("rect", {
62
+ width: "24",
63
+ height: "16",
64
+ fill: "#ffffff"
65
+ }),
66
+ US_STRIPES.map((y) => /* @__PURE__ */ jsx("rect", {
67
+ y,
68
+ width: "24",
69
+ height: US_STRIPE_HEIGHT,
70
+ fill: "#b22234"
71
+ }, y)),
72
+ /* @__PURE__ */ jsx("rect", {
73
+ width: "9.6",
74
+ height: US_STRIPE_HEIGHT * 7,
75
+ fill: "#3c3b6e"
76
+ }),
77
+ US_STARS.map((star) => /* @__PURE__ */ jsx("path", {
78
+ d: starPath(star.x, star.y, .85),
79
+ fill: "#ffffff"
80
+ }, `${star.x}-${star.y}`))
81
+ ] }),
82
+ /** United Kingdom */
83
+ GB: () => /* @__PURE__ */ jsxs(Fragment, { children: [
84
+ /* @__PURE__ */ jsx("rect", {
85
+ width: "24",
86
+ height: "16",
87
+ fill: "#012169"
88
+ }),
89
+ /* @__PURE__ */ jsx("path", {
90
+ d: "M0 0 24 16M24 0 0 16",
91
+ stroke: "#ffffff",
92
+ strokeWidth: "3.2"
93
+ }),
94
+ /* @__PURE__ */ jsx("path", {
95
+ d: "M0 0 24 16M24 0 0 16",
96
+ stroke: "#c8102e",
97
+ strokeWidth: "1.6"
98
+ }),
99
+ /* @__PURE__ */ jsx("path", {
100
+ d: "M12 0V16M0 8H24",
101
+ stroke: "#ffffff",
102
+ strokeWidth: "5.3"
103
+ }),
104
+ /* @__PURE__ */ jsx("path", {
105
+ d: "M12 0V16M0 8H24",
106
+ stroke: "#c8102e",
107
+ strokeWidth: "3.2"
108
+ })
109
+ ] }),
110
+ /** European Union */
111
+ EU: () => /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("rect", {
112
+ width: "24",
113
+ height: "16",
114
+ fill: "#003399"
115
+ }), EU_STARS.map((star) => /* @__PURE__ */ jsx("path", {
116
+ d: starPath(star.x, star.y, 1),
117
+ fill: "#ffcc00"
118
+ }, `${star.x.toFixed(2)}-${star.y.toFixed(2)}`))] }),
119
+ /** Canada */
120
+ CA: () => /* @__PURE__ */ jsxs(Fragment, { children: [
121
+ /* @__PURE__ */ jsx("rect", {
122
+ width: "24",
123
+ height: "16",
124
+ fill: "#ffffff"
125
+ }),
126
+ /* @__PURE__ */ jsx("rect", {
127
+ width: "6",
128
+ height: "16",
129
+ fill: "#d52b1e"
130
+ }),
131
+ /* @__PURE__ */ jsx("rect", {
132
+ x: "18",
133
+ width: "6",
134
+ height: "16",
135
+ fill: "#d52b1e"
136
+ }),
137
+ /* @__PURE__ */ jsx("path", {
138
+ d: MAPLE_LEAF,
139
+ fill: "#d52b1e"
140
+ })
141
+ ] }),
142
+ /** Japan */
143
+ JP: () => /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("rect", {
144
+ width: "24",
145
+ height: "16",
146
+ fill: "#ffffff"
147
+ }), /* @__PURE__ */ jsx("circle", {
148
+ cx: "12",
149
+ cy: "8",
150
+ r: "4.6",
151
+ fill: "#bc002d"
152
+ })] }),
153
+ /** Ghana */
154
+ GH: () => /* @__PURE__ */ jsxs(Fragment, { children: [
155
+ /* @__PURE__ */ jsx("rect", {
156
+ width: "24",
157
+ height: "16",
158
+ fill: "#fcd116"
159
+ }),
160
+ /* @__PURE__ */ jsx("rect", {
161
+ width: "24",
162
+ height: "5.33",
163
+ fill: "#ce1126"
164
+ }),
165
+ /* @__PURE__ */ jsx("rect", {
166
+ y: "10.67",
167
+ width: "24",
168
+ height: "5.33",
169
+ fill: "#006b3f"
170
+ }),
171
+ /* @__PURE__ */ jsx("path", {
172
+ d: starPath(12, 8, 2.3),
173
+ fill: "#000000"
174
+ })
175
+ ] }),
176
+ /** United Arab Emirates */
177
+ AE: () => /* @__PURE__ */ jsxs(Fragment, { children: [
178
+ /* @__PURE__ */ jsx("rect", {
179
+ width: "24",
180
+ height: "16",
181
+ fill: "#ffffff"
182
+ }),
183
+ /* @__PURE__ */ jsx("rect", {
184
+ x: "6",
185
+ width: "18",
186
+ height: "5.33",
187
+ fill: "#00732f"
188
+ }),
189
+ /* @__PURE__ */ jsx("rect", {
190
+ x: "6",
191
+ y: "10.67",
192
+ width: "18",
193
+ height: "5.33",
194
+ fill: "#000000"
195
+ }),
196
+ /* @__PURE__ */ jsx("rect", {
197
+ width: "6",
198
+ height: "16",
199
+ fill: "#ff0000"
200
+ })
201
+ ] })
202
+ };
203
+ /** Neutral placeholder for a currency we have no flag for yet. */
204
+ function FallbackFlag() {
205
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
206
+ /* @__PURE__ */ jsx("rect", {
207
+ width: "24",
208
+ height: "16",
209
+ fill: "currentColor",
210
+ opacity: "0.1"
211
+ }),
212
+ /* @__PURE__ */ jsx("circle", {
213
+ cx: "12",
214
+ cy: "8",
215
+ r: "4",
216
+ fill: "none",
217
+ stroke: "currentColor",
218
+ strokeWidth: "1",
219
+ opacity: "0.45"
220
+ }),
221
+ /* @__PURE__ */ jsx("path", {
222
+ d: "M8 8h8M12 4c1.8 1.9 1.8 6.1 0 8M12 4c-1.8 1.9-1.8 6.1 0 8",
223
+ fill: "none",
224
+ stroke: "currentColor",
225
+ strokeWidth: "1",
226
+ opacity: "0.45"
227
+ })
228
+ ] });
229
+ }
230
+ //#endregion
8
231
  //#region src/currency-selector.tsx
9
- const DEFAULT_FLAG = [
10
- { color: "#1f8f55" },
11
- { color: "#ffffff" },
12
- { color: "#1f8f55" }
13
- ];
14
- const currencySelectorTriggerVariants = cva("group/currency-selector inline-flex w-fit shrink-0 items-center rounded-full border-0 font-bold whitespace-nowrap outline-none transition-[background-color,color,box-shadow] focus-visible:shadow-[0_0_0_2px_var(--color-line-focus)] disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-60 data-popup-open:text-fg-primary [&_svg]:size-3.5 [&_svg]:shrink-0 [&_svg]:text-current", {
232
+ const currencySelectorTriggerVariants = cva("group/currency-selector inline-flex w-fit shrink-0 items-center rounded-full border-0 font-bold whitespace-nowrap outline-none transition-[background-color,color,box-shadow] focus-visible:shadow-[0_0_0_2px_var(--color-line-focus)] disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-60 data-popup-open:text-fg-primary [&_svg:not([data-slot=currency-flag])]:size-3.5 [&_svg]:shrink-0 [&_svg]:text-current", {
15
233
  variants: {
16
234
  size: {
17
235
  sm: "h-8 gap-1.5 px-3 text-gdt-xs",
@@ -31,20 +249,27 @@ const currencySelectorTriggerVariants = cva("group/currency-selector inline-flex
31
249
  function findOption(options, value) {
32
250
  return options.find((option) => option.code === value);
33
251
  }
34
- function CurrencyFlag({ flag = DEFAULT_FLAG, label, className }) {
35
- const total = flag.reduce((sum, stripe) => sum + (stripe.size ?? 1), 0);
36
- let cursor = 0;
37
- const stops = flag.flatMap((stripe) => {
38
- const start = cursor;
39
- cursor += (stripe.size ?? 1) / total * 100;
40
- return [`${stripe.color} ${start.toFixed(2)}%`, `${stripe.color} ${cursor.toFixed(2)}%`];
41
- });
42
- return /* @__PURE__ */ jsx("span", {
252
+ /** `USD` `US`, `EUR` `EU`: ISO 4217 codes lead with their country code. */
253
+ function toCountryCode(option) {
254
+ return (option.countryCode ?? option.code.slice(0, 2)).toUpperCase();
255
+ }
256
+ function CurrencyFlag({ countryCode, label, className }) {
257
+ const Flag = (countryCode ? COUNTRY_FLAGS[countryCode.toUpperCase()] : void 0) ?? FallbackFlag;
258
+ return /* @__PURE__ */ jsx("svg", {
259
+ viewBox: "0 0 24 16",
43
260
  role: "img",
44
261
  "aria-label": label ?? "Currency flag",
45
262
  "data-slot": "currency-flag",
46
- className: cn("inline-block h-4 w-6 shrink-0 overflow-hidden rounded-[3px] bg-cover shadow-[inset_0_0_0_1px_rgb(0_0_0/0.04)]", className),
47
- style: { backgroundImage: `linear-gradient(90deg, ${stops.join(", ")})` }
263
+ className: cn("inline-block size-4 w-6 shrink-0 overflow-hidden rounded-[3px] shadow-[inset_0_0_0_1px_rgb(0_0_0/0.08)]", className),
264
+ children: /* @__PURE__ */ jsx(Flag, {})
265
+ });
266
+ }
267
+ /** Renders the option's own artwork when it has any, else the built-in flag. */
268
+ function OptionFlag({ option }) {
269
+ if (option.flag) return option.flag;
270
+ return /* @__PURE__ */ jsx(CurrencyFlag, {
271
+ countryCode: toCountryCode(option),
272
+ label: `${toCountryCode(option)} flag`
48
273
  });
49
274
  }
50
275
  function CurrencySelector({ options, value, defaultValue, onValueChange, open, defaultOpen, onOpenChange, size = "md", withBackground = true, showFlag = true, showOptionFlags = true, contentClassName, className, placeholder = "Select currency", type = "button", ...props }) {
@@ -77,10 +302,7 @@ function CurrencySelector({ options, value, defaultValue, onValueChange, open, d
77
302
  withBackground
78
303
  }), className),
79
304
  ...props,
80
- children: [showFlag && selectedOption ? /* @__PURE__ */ jsx(CurrencyFlag, {
81
- flag: selectedOption.flag,
82
- label: `${selectedOption.countryCode ?? selectedOption.code} flag`
83
- }) : null, /* @__PURE__ */ jsx(SelectValue, {
305
+ children: [showFlag && selectedOption ? /* @__PURE__ */ jsx(OptionFlag, { option: selectedOption }) : null, /* @__PURE__ */ jsx(SelectValue, {
84
306
  placeholder,
85
307
  children: selectedOption?.code ?? placeholder
86
308
  })]
@@ -92,10 +314,7 @@ function CurrencySelector({ options, value, defaultValue, onValueChange, open, d
92
314
  value: option.code,
93
315
  className: "min-h-12 rounded-lg px-3 text-gdt-sm data-selected:bg-surface-brand-subtle data-selected:font-normal data-selected:text-fg-brand data-highlighted:bg-surface-brand-subtle",
94
316
  children: [
95
- showOptionFlags ? /* @__PURE__ */ jsx(CurrencyFlag, {
96
- flag: option.flag,
97
- label: `${option.countryCode ?? option.code} flag`
98
- }) : null,
317
+ showOptionFlags ? /* @__PURE__ */ jsx(OptionFlag, { option }) : null,
99
318
  /* @__PURE__ */ jsxs("span", {
100
319
  className: "min-w-0 flex-1 truncate",
101
320
  children: [
@@ -104,7 +323,7 @@ function CurrencySelector({ options, value, defaultValue, onValueChange, open, d
104
323
  option.label
105
324
  ]
106
325
  }),
107
- option.code === selectedValue ? /* @__PURE__ */ jsx(CheckIcon, { className: "ml-auto size-4 text-fg-brand" }) : null
326
+ option.code === selectedValue ? /* @__PURE__ */ jsx(Check, { className: "ml-auto size-4 text-fg-brand" }) : null
108
327
  ]
109
328
  }, option.code))
110
329
  })]
@@ -1,4 +1,5 @@
1
1
  "use client";
2
+ import { ChevronDown, ChevronLeft, ChevronRight, ChevronUp, ChevronsUpDown, Pin, SearchX, SlidersHorizontal } from "./icons.js";
2
3
  import { t as cn } from "./cn-BI_4DMBf.js";
3
4
  import { Button } from "./button.js";
4
5
  import { Input } from "./input.js";
@@ -11,7 +12,6 @@ import { Popover, PopoverBody, PopoverContent, PopoverFooter, PopoverHeader, Pop
11
12
  import { Skeleton } from "./skeleton.js";
12
13
  import { Table as Table$1, TableBody, TableCell, TableHead, TableHeader, TableRow } from "./table.js";
13
14
  import { TableCard, TableCardAction } from "./table-card.js";
14
- import { ChevronDown, ChevronLeft, ChevronRight, ChevronUp, ChevronsUpDown, PinIcon, SearchX, SlidersHorizontal } from "lucide-react";
15
15
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
16
16
  import * as React from "react";
17
17
  import { flexRender, getCoreRowModel, getSortedRowModel, useReactTable } from "@tanstack/react-table";
@@ -258,7 +258,7 @@ function DataTable({ className, containerClassName, emptyState, interactiveColum
258
258
  type: "button",
259
259
  className: "shrink-0 cursor-pointer border-none bg-transparent p-0 outline-none",
260
260
  onClick: () => isPinned ? header.column.pin(false) : header.column.pin("left"),
261
- children: /* @__PURE__ */ jsx(PinIcon, { className: cn("size-3.5", isPinned && "text-fg-brand") })
261
+ children: /* @__PURE__ */ jsx(Pin, { className: cn("size-3.5", isPinned && "text-fg-brand") })
262
262
  }) : null,
263
263
  header.column.getCanResize() ? /* @__PURE__ */ jsx("button", {
264
264
  "aria-label": "Resize column",
@@ -1,9 +1,9 @@
1
1
  "use client";
2
+ import { Calendar } from "./icons.js";
2
3
  import { t as cn } from "./cn-BI_4DMBf.js";
3
- import { Calendar } from "./calendar.js";
4
+ import { Calendar as Calendar$1 } from "./calendar.js";
4
5
  import { Popover, PopoverContent } from "./popover.js";
5
6
  import { n as PickerFooter, r as PickerTrigger, t as PICKER_COLLISION_AVOIDANCE } from "./picker-xSTzeYhc.js";
6
- import { CalendarIcon } from "lucide-react";
7
7
  import { jsx, jsxs } from "react/jsx-runtime";
8
8
  import * as React from "react";
9
9
  //#region src/date-picker.tsx
@@ -36,7 +36,7 @@ function DatePicker({ value, onChange, disabled = false, size, placeholder = "Se
36
36
  open,
37
37
  onOpenChange: handleOpenChange,
38
38
  children: [/* @__PURE__ */ jsx(PickerTrigger, {
39
- icon: CalendarIcon,
39
+ icon: Calendar,
40
40
  displayValue: value ? formatDate(value) : "",
41
41
  placeholder,
42
42
  disabled,
@@ -49,7 +49,7 @@ function DatePicker({ value, onChange, disabled = false, size, placeholder = "Se
49
49
  side: "bottom",
50
50
  collisionAvoidance: PICKER_COLLISION_AVOIDANCE,
51
51
  className: PANEL_CLASSES,
52
- children: [/* @__PURE__ */ jsx(Calendar, {
52
+ children: [/* @__PURE__ */ jsx(Calendar$1, {
53
53
  mode: "single",
54
54
  selected: pending,
55
55
  onSelect: setPending,
@@ -89,7 +89,7 @@ function DateRangePicker({ value, onChange, disabled = false, size, placeholder
89
89
  open,
90
90
  onOpenChange: handleOpenChange,
91
91
  children: [/* @__PURE__ */ jsx(PickerTrigger, {
92
- icon: CalendarIcon,
92
+ icon: Calendar,
93
93
  displayValue: (() => {
94
94
  if (value?.from && value?.to) return `${formatDate(value.from)} — ${formatDate(value.to)}`;
95
95
  if (value?.from) return formatDate(value.from);
@@ -106,7 +106,7 @@ function DateRangePicker({ value, onChange, disabled = false, size, placeholder
106
106
  side: "bottom",
107
107
  collisionAvoidance: PICKER_COLLISION_AVOIDANCE,
108
108
  className: cn(PANEL_CLASSES, "w-auto"),
109
- children: [/* @__PURE__ */ jsx(Calendar, {
109
+ children: [/* @__PURE__ */ jsx(Calendar$1, {
110
110
  mode: "range",
111
111
  selected: pending,
112
112
  onSelect: setPending,
package/dist/dialog.js CHANGED
@@ -1,9 +1,9 @@
1
1
  "use client";
2
+ import { X } from "./icons.js";
2
3
  import { t as cn } from "./cn-BI_4DMBf.js";
3
4
  import { SizeProvider, useComponentSize } from "./size-context.js";
4
5
  import { Button } from "./button.js";
5
6
  import { DialogNestingProvider, useDialogNestingDepth } from "./dialog-nesting.js";
6
- import { XIcon } from "lucide-react";
7
7
  import { jsx, jsxs } from "react/jsx-runtime";
8
8
  import { cva } from "class-variance-authority";
9
9
  import { Dialog as Dialog$1 } from "@base-ui/react/dialog";
@@ -84,7 +84,7 @@ function DialogContent({ className, children, size, showCloseButton = true, ...p
84
84
  variant: "tertiary",
85
85
  className: "absolute -top-10 right-0 z-10 group-data-[nested-dialog-open]/dialog-content:hidden",
86
86
  size: "icon-sm",
87
- children: [/* @__PURE__ */ jsx(XIcon, {}), /* @__PURE__ */ jsx("span", {
87
+ children: [/* @__PURE__ */ jsx(X, {}), /* @__PURE__ */ jsx("span", {
88
88
  className: "sr-only",
89
89
  children: "Close"
90
90
  })]
@@ -1,15 +1,15 @@
1
1
  "use client";
2
+ import { Check, ChevronRight } from "./icons.js";
2
3
  import { t as cn } from "./cn-BI_4DMBf.js";
3
4
  import { SizeProvider, useComponentSize } from "./size-context.js";
4
- import { CheckIcon, ChevronRightIcon } from "lucide-react";
5
5
  import { jsx, jsxs } from "react/jsx-runtime";
6
6
  import { cva } from "class-variance-authority";
7
- import { Menu as Menu$1 } from "@base-ui/react/menu";
7
+ import { Menu } from "@base-ui/react/menu";
8
8
  //#region src/dropdown-menu.tsx
9
9
  function DropdownMenu({ children, size, ...props }) {
10
10
  return /* @__PURE__ */ jsx(SizeProvider, {
11
11
  size,
12
- children: /* @__PURE__ */ jsx(Menu$1.Root, {
12
+ children: /* @__PURE__ */ jsx(Menu.Root, {
13
13
  "data-slot": "dropdown-menu",
14
14
  ...props,
15
15
  children
@@ -17,13 +17,13 @@ function DropdownMenu({ children, size, ...props }) {
17
17
  });
18
18
  }
19
19
  function DropdownMenuPortal({ ...props }) {
20
- return /* @__PURE__ */ jsx(Menu$1.Portal, {
20
+ return /* @__PURE__ */ jsx(Menu.Portal, {
21
21
  "data-slot": "dropdown-menu-portal",
22
22
  ...props
23
23
  });
24
24
  }
25
25
  function DropdownMenuTrigger({ ...props }) {
26
- return /* @__PURE__ */ jsx(Menu$1.Trigger, {
26
+ return /* @__PURE__ */ jsx(Menu.Trigger, {
27
27
  "data-slot": "dropdown-menu-trigger",
28
28
  ...props
29
29
  });
@@ -54,15 +54,15 @@ const dropdownMenuLabelVariants = cva("font-medium text-fg-secondary data-inset:
54
54
  });
55
55
  function DropdownMenuContent({ align = "start", alignOffset = 0, side = "bottom", sideOffset = 6, className, container, ...props }) {
56
56
  const resolvedSize = useComponentSize();
57
- return /* @__PURE__ */ jsx(Menu$1.Portal, {
57
+ return /* @__PURE__ */ jsx(Menu.Portal, {
58
58
  container,
59
- children: /* @__PURE__ */ jsx(Menu$1.Positioner, {
59
+ children: /* @__PURE__ */ jsx(Menu.Positioner, {
60
60
  className: "isolate z-50 outline-none",
61
61
  align,
62
62
  alignOffset,
63
63
  side,
64
64
  sideOffset,
65
- children: /* @__PURE__ */ jsx(Menu$1.Popup, {
65
+ children: /* @__PURE__ */ jsx(Menu.Popup, {
66
66
  "data-slot": "dropdown-menu-content",
67
67
  "data-size": resolvedSize,
68
68
  className: cn(dropdownMenuContentVariants({ size: resolvedSize }), className),
@@ -72,7 +72,7 @@ function DropdownMenuContent({ align = "start", alignOffset = 0, side = "bottom"
72
72
  });
73
73
  }
74
74
  function DropdownMenuGroup({ className, ...props }) {
75
- return /* @__PURE__ */ jsx(Menu$1.Group, {
75
+ return /* @__PURE__ */ jsx(Menu.Group, {
76
76
  "data-slot": "dropdown-menu-group",
77
77
  className: cn("scroll-my-1 space-y-0.5", className),
78
78
  ...props
@@ -80,7 +80,7 @@ function DropdownMenuGroup({ className, ...props }) {
80
80
  }
81
81
  function DropdownMenuLabel({ className, inset, ...props }) {
82
82
  const resolvedSize = useComponentSize();
83
- return /* @__PURE__ */ jsx(Menu$1.GroupLabel, {
83
+ return /* @__PURE__ */ jsx(Menu.GroupLabel, {
84
84
  "data-slot": "dropdown-menu-label",
85
85
  "data-inset": inset,
86
86
  className: cn(dropdownMenuLabelVariants({ size: resolvedSize }), className),
@@ -89,7 +89,7 @@ function DropdownMenuLabel({ className, inset, ...props }) {
89
89
  }
90
90
  function DropdownMenuItem({ className, inset, variant = "default", ...props }) {
91
91
  const resolvedSize = useComponentSize();
92
- return /* @__PURE__ */ jsx(Menu$1.Item, {
92
+ return /* @__PURE__ */ jsx(Menu.Item, {
93
93
  "data-slot": "dropdown-menu-item",
94
94
  "data-inset": inset,
95
95
  "data-size": resolvedSize,
@@ -99,20 +99,20 @@ function DropdownMenuItem({ className, inset, variant = "default", ...props }) {
99
99
  });
100
100
  }
101
101
  function DropdownMenuSub({ ...props }) {
102
- return /* @__PURE__ */ jsx(Menu$1.SubmenuRoot, {
102
+ return /* @__PURE__ */ jsx(Menu.SubmenuRoot, {
103
103
  "data-slot": "dropdown-menu-sub",
104
104
  ...props
105
105
  });
106
106
  }
107
107
  function DropdownMenuSubTrigger({ className, inset, children, ...props }) {
108
108
  const resolvedSize = useComponentSize();
109
- return /* @__PURE__ */ jsxs(Menu$1.SubmenuTrigger, {
109
+ return /* @__PURE__ */ jsxs(Menu.SubmenuTrigger, {
110
110
  "data-slot": "dropdown-menu-sub-trigger",
111
111
  "data-inset": inset,
112
112
  "data-size": resolvedSize,
113
113
  className: cn(dropdownMenuItemVariants({ size: resolvedSize }), "data-inset:pl-8 data-open:bg-surface data-open:text-fg-primary data-popup-open:bg-surface data-popup-open:text-fg-primary", className),
114
114
  ...props,
115
- children: [children, /* @__PURE__ */ jsx(ChevronRightIcon, { className: "cn-rtl-flip ml-auto" })]
115
+ children: [children, /* @__PURE__ */ jsx(ChevronRight, { className: "cn-rtl-flip ml-auto" })]
116
116
  });
117
117
  }
118
118
  function DropdownMenuSubContent({ align = "start", alignOffset = -3, side = "right", sideOffset = 4, className, ...props }) {
@@ -128,7 +128,7 @@ function DropdownMenuSubContent({ align = "start", alignOffset = -3, side = "rig
128
128
  }
129
129
  function DropdownMenuCheckboxItem({ className, children, checked, inset, ...props }) {
130
130
  const resolvedSize = useComponentSize();
131
- return /* @__PURE__ */ jsxs(Menu$1.CheckboxItem, {
131
+ return /* @__PURE__ */ jsxs(Menu.CheckboxItem, {
132
132
  "data-slot": "dropdown-menu-checkbox-item",
133
133
  "data-inset": inset,
134
134
  "data-size": resolvedSize,
@@ -138,19 +138,19 @@ function DropdownMenuCheckboxItem({ className, children, checked, inset, ...prop
138
138
  children: [/* @__PURE__ */ jsx("span", {
139
139
  className: "pointer-events-none absolute right-3 flex items-center justify-center text-fg-brand",
140
140
  "data-slot": "dropdown-menu-checkbox-item-indicator",
141
- children: /* @__PURE__ */ jsx(Menu$1.CheckboxItemIndicator, { children: /* @__PURE__ */ jsx(CheckIcon, {}) })
141
+ children: /* @__PURE__ */ jsx(Menu.CheckboxItemIndicator, { children: /* @__PURE__ */ jsx(Check, {}) })
142
142
  }), children]
143
143
  });
144
144
  }
145
145
  function DropdownMenuRadioGroup({ ...props }) {
146
- return /* @__PURE__ */ jsx(Menu$1.RadioGroup, {
146
+ return /* @__PURE__ */ jsx(Menu.RadioGroup, {
147
147
  "data-slot": "dropdown-menu-radio-group",
148
148
  ...props
149
149
  });
150
150
  }
151
151
  function DropdownMenuRadioItem({ className, children, inset, ...props }) {
152
152
  const resolvedSize = useComponentSize();
153
- return /* @__PURE__ */ jsxs(Menu$1.RadioItem, {
153
+ return /* @__PURE__ */ jsxs(Menu.RadioItem, {
154
154
  "data-slot": "dropdown-menu-radio-item",
155
155
  "data-inset": inset,
156
156
  "data-size": resolvedSize,
@@ -159,12 +159,12 @@ function DropdownMenuRadioItem({ className, children, inset, ...props }) {
159
159
  children: [/* @__PURE__ */ jsx("span", {
160
160
  className: "pointer-events-none absolute right-3 flex items-center justify-center text-fg-brand",
161
161
  "data-slot": "dropdown-menu-radio-item-indicator",
162
- children: /* @__PURE__ */ jsx(Menu$1.RadioItemIndicator, { children: /* @__PURE__ */ jsx(CheckIcon, {}) })
162
+ children: /* @__PURE__ */ jsx(Menu.RadioItemIndicator, { children: /* @__PURE__ */ jsx(Check, {}) })
163
163
  }), children]
164
164
  });
165
165
  }
166
166
  function DropdownMenuSeparator({ className, ...props }) {
167
- return /* @__PURE__ */ jsx(Menu$1.Separator, {
167
+ return /* @__PURE__ */ jsx(Menu.Separator, {
168
168
  "data-slot": "dropdown-menu-separator",
169
169
  className: cn("pointer-events-none my-1 h-px bg-line-subtle", className),
170
170
  ...props
package/dist/dropzone.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use client";
2
+ import { UploadCloud } from "./icons.js";
2
3
  import { t as cn } from "./cn-BI_4DMBf.js";
3
- import { UploadCloud } from "lucide-react";
4
4
  import { jsx, jsxs } from "react/jsx-runtime";
5
5
  import { createContext, use, useCallback, useRef, useState } from "react";
6
6
  //#region src/lib/use-file-picker.ts
@@ -1,17 +1,18 @@
1
1
  import { useRender } from "@base-ui/react/use-render";
2
2
  import { VariantProps } from "class-variance-authority";
3
+ import * as React from "react";
3
4
  //#region src/editorial-card.d.ts
4
5
  declare const editorialCardVariants: (props?: ({
5
6
  size?: "lg" | "md" | "sm" | null | undefined;
6
7
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
7
8
  type EditorialCardProps = useRender.ComponentProps<"article"> & VariantProps<typeof editorialCardVariants>;
8
- declare function EditorialCard({ className, render, size, ...props }: EditorialCardProps): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
9
- declare function EditorialCardHeader({ className, render, ...props }: useRender.ComponentProps<"div">): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
10
- declare function EditorialCardMeta({ className, render, ...props }: useRender.ComponentProps<"p">): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
11
- declare function EditorialCardTitle({ className, render, ...props }: useRender.ComponentProps<"h3">): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
12
- declare function EditorialCardMedia({ className, render, ...props }: useRender.ComponentProps<"div">): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
13
- declare function EditorialCardCategory({ className, render, ...props }: useRender.ComponentProps<"span">): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
14
- declare function EditorialCardPlayButton({ className, render, children, "aria-label": ariaLabel, ...props }: useRender.ComponentProps<"button">): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
9
+ declare function EditorialCard({ className, render, size, ...props }: EditorialCardProps): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
10
+ declare function EditorialCardHeader({ className, render, ...props }: useRender.ComponentProps<"div">): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
11
+ declare function EditorialCardMeta({ className, render, ...props }: useRender.ComponentProps<"p">): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
12
+ declare function EditorialCardTitle({ className, render, ...props }: useRender.ComponentProps<"h3">): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
13
+ declare function EditorialCardMedia({ className, render, ...props }: useRender.ComponentProps<"div">): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
14
+ declare function EditorialCardCategory({ className, render, ...props }: useRender.ComponentProps<"span">): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
15
+ declare function EditorialCardPlayButton({ className, render, children, "aria-label": ariaLabel, ...props }: useRender.ComponentProps<"button">): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
15
16
  type EditorialCardAttributionProps = Omit<useRender.ComponentProps<"div">, "children"> & {
16
17
  authorName: string;
17
18
  brand?: {
@@ -20,8 +21,16 @@ type EditorialCardAttributionProps = Omit<useRender.ComponentProps<"div">, "chil
20
21
  };
21
22
  prefix?: string;
22
23
  };
23
- declare function EditorialCardAttribution({ authorName, brand, className, prefix, render, ...props }: EditorialCardAttributionProps): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
24
- declare function EditorialCardExcerpt({ className, render, ...props }: useRender.ComponentProps<"p">): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
25
- declare function EditorialCardLink({ className, render, children, ...props }: useRender.ComponentProps<"a">): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
24
+ declare function EditorialCardAttribution({ authorName, brand, className, prefix, render, ...props }: EditorialCardAttributionProps): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
25
+ type EditorialCardRatingProps = Omit<useRender.ComponentProps<"div">, "children"> & {
26
+ rating: number;
27
+ source?: React.ReactNode;
28
+ totalReviews?: number;
29
+ reviewLabel?: string;
30
+ showScore?: boolean;
31
+ };
32
+ declare function EditorialCardRating({ className, rating, render, reviewLabel, showScore, source, totalReviews, ...props }: EditorialCardRatingProps): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
33
+ declare function EditorialCardExcerpt({ className, render, ...props }: useRender.ComponentProps<"p">): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
34
+ declare function EditorialCardLink({ className, render, children, ...props }: useRender.ComponentProps<"a">): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
26
35
  //#endregion
27
- export { EditorialCard, EditorialCardAttribution, type EditorialCardAttributionProps, EditorialCardCategory, EditorialCardExcerpt, EditorialCardHeader, EditorialCardLink, EditorialCardMedia, EditorialCardMeta, EditorialCardPlayButton, type EditorialCardProps, EditorialCardTitle, editorialCardVariants };
36
+ export { EditorialCard, EditorialCardAttribution, type EditorialCardAttributionProps, EditorialCardCategory, EditorialCardExcerpt, EditorialCardHeader, EditorialCardLink, EditorialCardMedia, EditorialCardMeta, EditorialCardPlayButton, type EditorialCardProps, EditorialCardRating, type EditorialCardRatingProps, EditorialCardTitle, editorialCardVariants };