@giddaa-housing/ui 3.0.1 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/css/generated/shared.css +1 -1
- package/css/giddaa.css +173 -2
- package/css/preset.css +8 -1
- package/css/theme.css +4 -1
- package/dist/accordion.js +2 -2
- package/dist/activity-timeline.js +5 -5
- package/dist/alert.js +1 -1
- package/dist/auth-layout.js +18 -18
- package/dist/bar-chart.d.ts +1 -1
- package/dist/breadcrumb.js +3 -3
- package/dist/bullet-chart.d.ts +1 -1
- package/dist/button-group.d.ts +1 -1
- package/dist/button.js +2 -2
- package/dist/calendar.js +3 -3
- package/dist/call-card.js +1 -1
- package/dist/carousel.d.ts +1 -1
- package/dist/carousel.js +3 -3
- package/dist/chart.d.ts +1 -1
- package/dist/chart.js +1 -1
- package/dist/chat.js +1 -1
- package/dist/checkbox.js +2 -2
- package/dist/combobox.d.ts +1 -1
- package/dist/combobox.js +6 -6
- package/dist/cta.js +3 -3
- package/dist/currency-selector.d.ts +10 -8
- package/dist/currency-selector.js +247 -28
- package/dist/data-table.js +2 -2
- package/dist/date-picker.js +6 -6
- package/dist/dialog.js +2 -2
- package/dist/dropdown-menu.d.ts +1 -1
- package/dist/dropdown-menu.js +20 -20
- package/dist/dropzone.js +1 -1
- package/dist/editorial-card.d.ts +20 -11
- package/dist/editorial-card.js +67 -2
- package/dist/file-upload.js +1 -1
- package/dist/filter.js +1 -1
- package/dist/footer.d.ts +4 -2
- package/dist/footer.js +38 -34
- package/dist/funnel-chart.d.ts +1 -1
- package/dist/heatmap-chart.d.ts +1 -1
- package/dist/icons.d.ts +93 -0
- package/dist/icons.js +905 -0
- package/dist/infinite-scroll.js +1 -1
- package/dist/input-group.js +4 -5
- package/dist/input-otp.js +2 -2
- package/dist/input-size-context.js +4 -2
- package/dist/input.js +1 -1
- package/dist/kpi-card.js +1 -1
- package/dist/line-chart.d.ts +1 -1
- package/dist/mask-input.d.ts +61 -0
- package/dist/mask-input.js +0 -0
- package/dist/match.js +1 -1
- package/dist/media-gallery-hero.js +1 -1
- package/dist/media-player.js +59 -48
- package/dist/message.js +1 -1
- package/dist/mobile-sidebar.d.ts +57 -0
- package/dist/mobile-sidebar.js +196 -0
- package/dist/multi-step-form.js +2 -2
- package/dist/number-input.d.ts +1 -1
- package/dist/number-input.js +3 -3
- package/dist/pagination.js +4 -4
- package/dist/password-input.js +1 -1
- package/dist/phone-input.d.ts +1 -1
- package/dist/phone-input.js +4 -4
- package/dist/photo-gallery.js +3 -3
- package/dist/pie-chart.d.ts +1 -1
- package/dist/popover.d.ts +1 -1
- package/dist/price-tag.js +1 -1
- package/dist/radar-chart.d.ts +1 -1
- package/dist/rich-text-editor.d.ts +1 -1
- package/dist/rich-text-editor.js +4 -4
- package/dist/scatter-chart.d.ts +1 -1
- package/dist/search-input.js +1 -1
- package/dist/select.d.ts +1 -1
- package/dist/select.js +6 -6
- package/dist/sheet.js +2 -2
- package/dist/sidebar.js +1 -1
- package/dist/{size-context-D4mYvcg8.d.ts → size-context-BX6kAdVj.d.ts} +2 -1
- package/dist/size-context.d.ts +2 -2
- package/dist/size-context.js +5 -2
- package/dist/sparkline.d.ts +1 -1
- package/dist/stepper.js +2 -2
- package/dist/styles.css +681 -128
- package/dist/table.js +2 -2
- package/dist/tabs.d.ts +1 -1
- package/dist/tag.d.ts +1 -1
- package/dist/tag.js +1 -1
- package/dist/testimonial-block.js +1 -1
- package/dist/theme-switcher.d.ts +31 -0
- package/dist/theme-switcher.js +78 -0
- package/dist/time-picker.js +2 -2
- package/dist/toast.d.ts +38 -10
- package/dist/toast.js +55 -52
- package/dist/top-navbar.d.ts +100 -0
- package/dist/top-navbar.js +295 -0
- package/dist/tree-map.d.ts +1 -1
- package/dist/video-player-dialog.d.ts +57 -0
- package/dist/video-player-dialog.js +188 -0
- package/dist/waterfall-chart.d.ts +1 -1
- package/package.json +25 -2
package/dist/combobox.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { Check, ChevronDown, 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 { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput } from "./input-group.js";
|
|
6
|
-
import { CheckIcon, ChevronDownIcon, XIcon } from "lucide-react";
|
|
7
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
8
|
import { cva } from "class-variance-authority";
|
|
9
9
|
import * as React from "react";
|
|
@@ -85,7 +85,7 @@ function ComboboxTrigger({ className, children, ...props }) {
|
|
|
85
85
|
"data-size": resolvedSize,
|
|
86
86
|
className: cn(comboboxTriggerVariants({ size: resolvedSize }), className),
|
|
87
87
|
...props,
|
|
88
|
-
children: [children, /* @__PURE__ */ jsx(Combobox$1.Icon, { render: /* @__PURE__ */ jsx(
|
|
88
|
+
children: [children, /* @__PURE__ */ jsx(Combobox$1.Icon, { render: /* @__PURE__ */ jsx(ChevronDown, { className: "text-line-strong transition-transform group-data-disabled/combobox-trigger:text-fg-caption-placeholder group-data-popup-open/combobox-trigger:rotate-180" }) })]
|
|
89
89
|
});
|
|
90
90
|
}
|
|
91
91
|
function ComboboxClear({ className, ...props }) {
|
|
@@ -96,7 +96,7 @@ function ComboboxClear({ className, ...props }) {
|
|
|
96
96
|
render: /* @__PURE__ */ jsx(InputGroupButton, {
|
|
97
97
|
variant: "ghost",
|
|
98
98
|
size: "icon-xs",
|
|
99
|
-
children: /* @__PURE__ */ jsx(
|
|
99
|
+
children: /* @__PURE__ */ jsx(X, { className: "pointer-events-none" })
|
|
100
100
|
})
|
|
101
101
|
});
|
|
102
102
|
}
|
|
@@ -158,9 +158,9 @@ function ComboboxItem({ className, children, ...props }) {
|
|
|
158
158
|
children: [multiple ? /* @__PURE__ */ jsx(Combobox$1.ItemIndicator, {
|
|
159
159
|
keepMounted: true,
|
|
160
160
|
className: "flex size-5 shrink-0 items-center justify-center rounded-sm border border-line bg-canvas text-transparent transition-[background-color,border-color,color] group-data-selected/combobox-item:border-action-primary group-data-selected/combobox-item:bg-action-primary group-data-selected/combobox-item:text-fg-on-brand group-data-disabled/combobox-item:border-line-subtle group-data-disabled/combobox-item:bg-surface group-data-disabled/combobox-item:text-fg-caption-placeholder [&>svg]:size-3",
|
|
161
|
-
children: /* @__PURE__ */ jsx(
|
|
161
|
+
children: /* @__PURE__ */ jsx(Check, {})
|
|
162
162
|
}) : null, /* @__PURE__ */ jsx("span", {
|
|
163
|
-
className: "flex min-w-0 flex-1 shrink-0 gap-2
|
|
163
|
+
className: "flex min-w-0 flex-1 shrink-0 items-center gap-2",
|
|
164
164
|
children
|
|
165
165
|
})]
|
|
166
166
|
});
|
|
@@ -219,7 +219,7 @@ function ComboboxChip({ className, children, showRemove = true, ...props }) {
|
|
|
219
219
|
render: /* @__PURE__ */ jsx(Button, {
|
|
220
220
|
variant: "ghost",
|
|
221
221
|
size: "icon-xs",
|
|
222
|
-
children: /* @__PURE__ */ jsx(
|
|
222
|
+
children: /* @__PURE__ */ jsx(X, { className: "pointer-events-none" })
|
|
223
223
|
})
|
|
224
224
|
})]
|
|
225
225
|
});
|
package/dist/cta.js
CHANGED
|
@@ -59,9 +59,9 @@ function CTAContent({ className, render, ...props }) {
|
|
|
59
59
|
function CTATag({ className, render, ...props }) {
|
|
60
60
|
return useRender({
|
|
61
61
|
defaultTagName: "span",
|
|
62
|
-
props: mergeProps({ className: cn("text-fg-brand text-gdt-capitalized uppercase font-semibold", className) }, props),
|
|
62
|
+
props: mergeProps({ className: cn("text-fg-brand text-gdt-capitalized uppercase font-semibold", "group-data-[variant=brand]/cta-card:text-fg-on-brand", className) }, props),
|
|
63
63
|
render,
|
|
64
|
-
state: { slot: "cta-
|
|
64
|
+
state: { slot: "cta-tag" }
|
|
65
65
|
});
|
|
66
66
|
}
|
|
67
67
|
function CTATitle({ className, render, ...props }) {
|
|
@@ -130,7 +130,7 @@ function CTAListItem({ children, className, icon, render, ...props }) {
|
|
|
130
130
|
function CTACard({ className, render, variant = "default", ...props }) {
|
|
131
131
|
return useRender({
|
|
132
132
|
defaultTagName: "div",
|
|
133
|
-
props: mergeProps({ className: cn("group/cta-card min-w-0 flex flex-col gap-3.5 py-6.5 px-6 rounded-2xl text", { "bg-canvas border shadow-1": variant === "default" }, { "bg-surface-brand shadow-2": variant === "brand" }) }, props),
|
|
133
|
+
props: mergeProps({ className: cn("group/cta-card min-w-0 flex flex-col gap-3.5 py-6.5 px-6 rounded-2xl text", { "bg-canvas border border-line shadow-1": variant === "default" }, { "bg-surface-brand shadow-2": variant === "brand" }) }, props),
|
|
134
134
|
render,
|
|
135
135
|
state: {
|
|
136
136
|
slot: "cta-card",
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import { VariantProps } from "class-variance-authority";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
//#region src/currency-selector.d.ts
|
|
4
|
-
type CurrencyFlagStripe = {
|
|
5
|
-
color: string;
|
|
6
|
-
size?: number;
|
|
7
|
-
};
|
|
8
4
|
type CurrencySelectorOption = {
|
|
9
5
|
code: string;
|
|
10
6
|
label: string;
|
|
7
|
+
/**
|
|
8
|
+
* ISO 3166-1 alpha-2 code used to pick the flag. Defaults to the first two
|
|
9
|
+
* letters of `code`, which is how ISO 4217 currency codes are built —
|
|
10
|
+
* `NGN` → `NG`, `USD` → `US`, `EUR` → `EU`.
|
|
11
|
+
*/
|
|
11
12
|
countryCode?: string;
|
|
12
|
-
flag
|
|
13
|
+
/** Custom artwork, for a currency the built-in flag set does not cover. */
|
|
14
|
+
flag?: React.ReactNode;
|
|
13
15
|
};
|
|
14
16
|
type CurrencySelectorSize = NonNullable<VariantProps<typeof currencySelectorTriggerVariants>["size"]>;
|
|
15
17
|
type CurrencySelectorProps = Omit<React.ComponentProps<"button">, "children" | "defaultValue" | "onChange" | "value"> & {
|
|
@@ -31,11 +33,11 @@ declare const currencySelectorTriggerVariants: (props?: ({
|
|
|
31
33
|
size?: "lg" | "md" | "sm" | null | undefined;
|
|
32
34
|
withBackground?: boolean | null | undefined;
|
|
33
35
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
34
|
-
declare function CurrencyFlag({
|
|
35
|
-
|
|
36
|
+
declare function CurrencyFlag({ countryCode, label, className }: {
|
|
37
|
+
countryCode?: string;
|
|
36
38
|
label?: string;
|
|
37
39
|
className?: string;
|
|
38
40
|
}): React.JSX.Element;
|
|
39
41
|
declare function CurrencySelector({ options, value, defaultValue, onValueChange, open, defaultOpen, onOpenChange, size, withBackground, showFlag, showOptionFlags, contentClassName, className, placeholder, type, ...props }: CurrencySelectorProps): React.JSX.Element;
|
|
40
42
|
//#endregion
|
|
41
|
-
export { CurrencyFlag,
|
|
43
|
+
export { CurrencyFlag, CurrencySelector, type CurrencySelectorOption, type CurrencySelectorProps, type CurrencySelectorSize, currencySelectorTriggerVariants };
|
|
@@ -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 {
|
|
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
|
|
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
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
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
|
|
47
|
-
|
|
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(
|
|
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(
|
|
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(
|
|
326
|
+
option.code === selectedValue ? /* @__PURE__ */ jsx(Check, { className: "ml-auto size-4 text-fg-brand" }) : null
|
|
108
327
|
]
|
|
109
328
|
}, option.code))
|
|
110
329
|
})]
|
package/dist/data-table.js
CHANGED
|
@@ -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(
|
|
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",
|
package/dist/date-picker.js
CHANGED
|
@@ -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:
|
|
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:
|
|
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(
|
|
87
|
+
children: [/* @__PURE__ */ jsx(X, {}), /* @__PURE__ */ jsx("span", {
|
|
88
88
|
className: "sr-only",
|
|
89
89
|
children: "Close"
|
|
90
90
|
})]
|
package/dist/dropdown-menu.d.ts
CHANGED